The problem actually has a two dimensional null space; constant on each 
domain but possibly different constants. I think you need to build the 
MatNullSpace by explicitly constructing two vectors, one with 0 on one domain 
and constant value on the other and one with 0 on the other domain and constant 
on the first. 

   Separate note: why use FGMRES instead of just GMRES? If the problem is 
linear and the preconditioner is linear (no GMRES inside the smoother) then you 
can just use GMRES and it will save a little space/work and be conceptually 
clearer.

  Barry

> On Sep 29, 2021, at 8:46 AM, Marco Cisternino <marco.cistern...@optimad.it> 
> wrote:
> 
> Good morning,
> I want to solve the Poisson equation on a 3D domain with 2 non-connected 
> sub-domains.
> I am using FGMRES+GAMG and I have no problem if the two sub-domains see a 
> Dirichlet boundary condition each.
> On the same domain I would like to solve the Poisson equation imposing 
> periodic boundary condition in one direction and homogenous Neumann boundary 
> conditions in the other two directions. The two sub-domains are symmetric 
> with respect to the separation between them and the operator discretization 
> and the right hand side are symmetric as well. It would be nice to have the 
> same solution in both the sub-domains.
> Setting the null space to the constant, the solver converges to a solution 
> having the same gradients in both sub-domains but different values.
> Am I doing some wrong with the null space? I’m not setting a block matrix 
> (one block for each sub-domain), should I?
> I tested the null space against the matrix using MatNullSpaceTest and the 
> answer is true. Can I do something more to have a symmetric solution as 
> outcome of the solver?
> Thank you in advance for any comments and hints.
>  
> Best regards,
>  
> Marco Cisternino

Reply via email to