On 2/8/22 09:06, Hermes Sampedro wrote:
>
> I checked that in both cases, the operators/system_matrix have the same
> values just in the assemble_system() function. I was wondering if there
> is something internally that change somehow the systme_matrix. I can see
> that after checking the values of the operators I have the following
> lines which I am not sure if there is something happening:
No functions in deal.II touch your linear system unless you specifically
call a function that takes a matrix or vector as argument. So, if you
have the distribute_local_to_global() call for one type of matrix, you
need to call it for the other kind of matrix as well. But these
functions do not internally store some kind of magic pointer to the
matrix and right hand side so that at some later point, when you're not
watching, they do something nefarious to your matrix :-)
My suggestion would be to make sure that before the solve, the two
matrices and corresponding right hand sides are the same. This is often
awkward if the objects are large, but you can test this by outputting
the norm of these objects.
Then check that the solution is also the same. My guess is that for some
reason, either the matrix or the rhs are different.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/