# Re: [deal.II] Setting off-diagonal elements in the matrix

On 08/08/2017 05:07 AM, 'Maxi Miller' via deal.II User Group wrote:

Having a coupled set of poisson-like equations
\partial_t a = \nabla^2 a
\partial_t b = \nabla^2 b + \nabla^2 a
I can write the weak form(s) as (while ignoring boundary conditions)
\partial_t a = (\nabla v_1, \nabla a)
\partial_t b = (\nabla v_2, \nabla b) + (\nabla v_2, \nabla a)
Now in deal.II I add both equations to the same matrix (first the main
diagonals):
|
|

and then the off-diagonal term
\partial_t b = (\nabla v_2, \nabla a)

|
|
But wouldn't that be the same as for the system of equations
\partial_t a = \nabla^2 a + \nabla^2 b
\partial_t b = \nabla^2 b
?
How does deal.II distinguish between both?



The subsect of shape functions i or j for which fe_values[a].value(i) and fe_values[b].value(i) is nonzero, is different. So if you exchange a<->b and i<->j in the right hand side of



then you will get the same number, but you really have to change both. But unless you also change i<->j on the left, you will get the transpose matrix, as you suspected.

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

To unsubscribe from this group and stop receiving emails from it, send an email