Rectangular matrix, constraints

55 views
Skip to first unread message

Basca Jadamba

unread,
Jan 8, 2023, 10:40:12 AM1/8/23
to deal.II User Group

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?    

Wolfgang Bangerth

unread,
Jan 9, 2023, 8:17:56 PM1/9/23
to dea...@googlegroups.com
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: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Basca Jadamba

unread,
Jan 10, 2023, 8:23:16 AM1/10/23
to deal.II User Group
Thank you for the suggestions, Wolfgang. K, U, and A are correctly computed (linear system is solved correctly) and they are verified by an analytical example, it is S that I am not getting right when hanging nodes are involved.  I will do some hand computations by hand to see where I can get from there.
Reply all
Reply to author
Forward
0 new messages