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.

On Monday, January 9, 2023 at 8:17:56 PM UTC-5 Wolfgang Bangerth wrote:

> 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: bang...@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/3423e147-3f4e-4015-a534-b806d5f8fd9fn%40googlegroups.com.

Reply via email to