How to solve for the null space of system matrix?

47 views
Skip to first unread message

sotelo...@gmail.com

unread,
Oct 8, 2016, 12:37:42 PM10/8/16
to deal.II User Group
Hi All,
I am trying to solve Ax =0

This system comes from an homogeneous helmholtz equation with Dirichlet BC

I followed step 7 with CG solver. Works for the first cycles of refinement (using only uniform refinement) then it does not converge). Added SSOR preconditioner but it does not convege either.

Any suggestions?

Edith

Daniel Arndt

unread,
Oct 9, 2016, 4:33:16 AM10/9/16
to deal.II User Group
Edith,

If I understand you correctly, you basically consider step-7 and replace the Neumann boundary conditions by inhomogeneous Dirichlet boundary conditions.
The system matrix is symmetric and positive definite and hence CG should work.

Can you verify that the solution is correct if you use a direct solver (SparseDirectUMFPACK [1])?

Best,
Daniel

[1] https://www.dealii.org/8.4.1/doxygen/deal.II/classSparseDirectUMFPACK.html

Edith Sotelo

unread,
Oct 10, 2016, 11:52:13 AM10/10/16
to dea...@googlegroups.com
Hi Daniel,
It works with a direct solver.
It is working with the CG solver as well I just increased the number of iterations (1000-> 2000)  and  decreased the tolerance (10^ -12 -> 10 ^ -10)

Note about the system I am solving:
In my PDE my RHS =0  (homogenous Helmholtz Eq. with Dirichlet BC) ,  Basically I am solving  a system Ax=0  
If there is a better way to solve this I would like to try.  

Edith


--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/F6_iqj1mJnA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Wolfgang Bangerth

unread,
Oct 10, 2016, 11:59:10 AM10/10/16
to dea...@googlegroups.com
On 10/10/2016 09:52 AM, Edith Sotelo wrote:
> It works with a direct solver.
> It is working with the CG solver as well I just increased the number of
> iterations (1000-> 2000) and decreased the tolerance (10^ -12 -> 10 ^ -10)
>
> Note about the system I am solving:
> In my PDE my RHS =0 (homogenous Helmholtz Eq. with Dirichlet BC) , Basically
> I am solving a system Ax=0
> If there is a better way to solve this I would like to try.

I think it's not quite clear to me what you do. If you solve the equation
operator * u = 0
but with nonzero Dirichlet boundary condition, then this leads to a linear system
A x = b
where b is not the zero vector. That's because the boundary values appear in
the rhs vector. You need to solve this like any other linear system.

However, if you have the Helmholtz equation with the "bad" sign in front of
the mass term, then the matrix may be indefinite, and CG can not solve it.

Best
W.


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

Edith Sotelo

unread,
Oct 10, 2016, 12:05:23 PM10/10/16
to dea...@googlegroups.com
Wolfgang,
You are right. My system has a non zero RHS after imposing the Dirichlet BC. That was my bad.

CG still works, just slow though.

Edith

Wolfgang Bangerth

unread,
Oct 10, 2016, 1:39:04 PM10/10/16
to dea...@googlegroups.com
On 10/10/2016 10:05 AM, Edith Sotelo wrote:
> You are right. My system has a non zero RHS after imposing the Dirichlet BC. That was my bad.
>
> CG still works, just slow though.

So what is the equation and the preconditioner you use?

Edith Sotelo

unread,
Oct 10, 2016, 3:24:51 PM10/10/16
to dea...@googlegroups.com
I am solving for a plane wave.
laplacian (u) +k^2 u =0 domain (0,1) * (0,1) ; k =20 for this case

BC: u(0,y) =1, u (1,y) = cos kx, du/dy =0 for the other 2 boundaries


currently using the solver and preconditioner of tutorial 7: CG solver and SSOR preconditioner

Edith

Wolfgang Bangerth

unread,
Oct 10, 2016, 3:47:20 PM10/10/16
to dea...@googlegroups.com
On 10/10/2016 01:24 PM, Edith Sotelo wrote:
> I am solving for a plane wave.
> laplacian (u) +k^2 u =0 domain (0,1) * (0,1) ; k =20 for this case

This is the "bad" sign. If k is large enough, your operator (and consequently
the matrix) will not be positive definite. Consequently, CG may not converge.

Edith Sotelo

unread,
Oct 10, 2016, 4:47:15 PM10/10/16
to dea...@googlegroups.com
What solver should I use then? just direct solver?

Edith

Wolfgang Bangerth

unread,
Oct 10, 2016, 4:55:07 PM10/10/16
to dea...@googlegroups.com
On 10/10/2016 02:47 PM, Edith Sotelo wrote:
> What solver should I use then? just direct solver?

There are a number that can work. The direct solver is on. You can also try
Minres or GMRES or Bicgstab.
Reply all
Reply to author
Forward
0 new messages