Matrix construction for vector valued problems

101 views
Skip to first unread message

Ali Seddiq

unread,
Oct 15, 2021, 2:26:03 PM10/15/21
to dea...@googlegroups.com
Hello,

As my first question (which is an elementary math level question) and considering step-20 as an example, I was wondering how two equations  (bilinear forms) containing two unknowns can be summed up to a single equation? While for example in the case of a system of two linear equations it is not allowed. (my guess: bilinear forms are still in integral form)
I noticed this lack of understanding when I was trying to implement a vector valued problem. It is of nonlinear type and composed of two equations. I linearized and discretized equations separately. Now I have a 2*2 matrix (consider A, B | A' , B') multiplied by {del.u ,del. v} (as unknowns) and on the right hand side I have {f1, f2}.
So as my second question, am I still  able to solve it at the current shape? Could anyone point me to a similar step in deal.ii?
Step-23 looks very similar but still I am not sure how to construct the matrix.
Thank you!
Ali

Wolfgang Bangerth

unread,
Oct 19, 2021, 2:31:37 PM10/19/21
to dea...@googlegroups.com

Ali,

> As my first question (which is an elementary math level question) and
> considering step-20 as an example, I was wondering how two equations
>  (bilinear forms) containing two unknowns can be summed up to a single
> equation? While for example in the case of a system of two linear equations it
> is not allowed. (my guess: bilinear forms are still in integral form)
> I noticed this lack of understanding when I was trying to implement a vector
> valued problem. It is of nonlinear type and composed of two equations. I
> linearized and discretized equations separately. Now I have a 2*2 matrix
> (consider A, B | A' , B') multiplied by {del.u ,del. v} (as unknowns) and on
> the right hand side I have {f1, f2}.

Take the mixed Laplace equation as an example:
u + grad p = 0
-div u = f
If you multiply the first equation by a test function v and the second by a
test function q, then you will get the following two weak forms after
integration by parts (ignoring boundary conditions for a moment):
(v,u) - (div v, p) = 0 \forall v
-(q, div u) = (q,f) \forall q
We probably agree on this, right?

Now, we generally add these equations together and then have
(v,u) - (div v, p) - (q, div u) = (q,f) \forall v,q
If I understand your question right, then you are asking about why we can add
these equations together? That is because it is true *for all v,q*, and
consequently it is in particular true if we choose q=0. But if we choose q=0,
then the previous equation simplifies to
(v,u) - (div v, p) = 0 \forall v
On the other hand, if we had chosen v=0, then we will get that
-(q, div u) = (q,f) \forall q

In other words, the presence of the test functions and the statement "for all
test functions" allows us to recover the original equations from the summed-up
equation.

Does that make sense?

Best
Wolfgang

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

Ali Seddiq

unread,
Oct 20, 2021, 4:21:12 PM10/20/21
to dea...@googlegroups.com
Dear Prof. Bangerth, 
Thank you very much for your clear explanations. 
So according to that, is it still correct if I sum up the equations in discretized form? (Considering the fact that they're still containing trial and test functions, though in discretized form). 
Also could you please point me out to an example or a universal approach to implement equations in matrix-vector forms (linear systems)? Mixed Laplace seems to be serving as a typical example in this regard but not sure as it also involves some considerations on preconditioning and solver usage. 
Thank you, 
Ali

--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/bd22b462-f1de-c700-31fb-6567a51e604b%40colostate.edu.

Wolfgang Bangerth

unread,
Oct 24, 2021, 11:41:05 PM10/24/21
to dea...@googlegroups.com
On 10/20/21 2:20 PM, Ali Seddiq wrote:
> So according to that, is it still correct if I sum up the equations in
> discretized form? (Considering the fact that they're still containing trial
> and test functions, though in discretized form).

No. It is the presence of the "for all test functions v,q" that makes that
possible. When you form a concrete row of the matrix, you are considering a
specific test function with index i.


> Also could you please point me out to an example or a universal approach to
> implement equations in matrix-vector forms (linear systems)? Mixed Laplace
> seems to be serving as a typical example in this regard but not sure as it
> also involves some considerations on preconditioning and solver usage.

Have you taken a look at the documentation module on vector-valued problems?
https://dealii.org/developer/doxygen/deal.II/group__vector__valued.html

Best
W.
Reply all
Reply to author
Forward
0 new messages