On 1/8/23 08:40, Basca Jadamba wrote:
I am trying to assemble a rectangular matrix S with a property that K*U=S*A where A/U is the coefficient/solution pair in an elliptic PDE (think -div(a grad u) = f) and where K is the system matrix. S is a FullMatrix (no sparsity pattern) and it works fine on uniform meshes (correctness is checked by a norm of the difference K*U-S*A). I am not able to get a correct matrix on adaptively refined meshes and it has probably to do something with the constraints for U and A. I have this issue for a scalar (problem above) and a vector problem (linear elasticity). Something like this is used for the assembling step:

constraints_row.distribute_local_to_global(cell_matrix,

local_dof_indices_row,

constraints_col,

local_dof_indices_col,

S);

Can anyone give me a suggestion where the problem could be or where I should look in the documentation?

It's not clear to me whether you think that K, S, or A are wrong. Furthermore, if you solve the linear system for U, you should *always* have that
  || KU - SA ||
is small, simply by virtue of having solved the linear system. If the norm is not small, then you haven't solved the linear system.

The way I tend to debug this kind of thing is to make the situation as small as possible. In your case, this would mean using lowest order elements, choosing the mesh to be a 2x2 mesh where you refine one cell, and then you can use a piece of paper to enumerate all degrees of freedom and compute matrix and vector elements by hand. For this situation, you have only 14 DoFs -- few enough that things fit on a single page with a bit of work.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/


--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/59246f84-5bb8-2bc0-6757-0801c6d2a8b8%40colostate.edu.

Reply via email to