Re: [deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-18 Thread ntetsika
Hi Daniel and Wolfgang,

When I apply periodic boundary conditions only on velocities at all the 
four sides of my unit square domain, then the rank of B (mxn) becomes 
rank(B) = n-1, which I think is as you say due to the fact that the 
pressure is up to a constant . However, when I try to impose periodic 
boundary conditions for both velocities AND pressure, then the rank of B 
becomes much less than the number of its columns and there comes my problem 
with inverting the B^T (diag M)^{-1} B. 

Any suggestions how to overcome this problem? I've tried to release some 
nodes on the boundaries (i.e. have periodic b.c. on all the sides except 
from 4 nodes - 1 free node per side) but still not working.

Thank you in advance!

Best,
Magda

On Thursday, January 17, 2019 at 7:17:25 PM UTC-5, Daniel Arndt wrote:
>
> Magda,
>
> [...] 
>>
> B has rank much less than the number of columns which is due to the fully 
>> periodic boundary conditions and the corresponding sparsity pattern. So I 
>> don't know how I could solve this issue. Any ideas?
>>
> Can you identify the corresponding eigenvector of B^T B? I would still not 
> be surprised if the pressure is only unique up to a constant implying that 
> a vector representing a constant pressure is such an eigenvector.
>
> Best,
> Daniel
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-17 Thread Daniel Arndt
Magda,

[...] 
>
B has rank much less than the number of columns which is due to the fully 
> periodic boundary conditions and the corresponding sparsity pattern. So I 
> don't know how I could solve this issue. Any ideas?
>
Can you identify the corresponding eigenvector of B^T B? I would still not 
be surprised if the pressure is only unique up to a constant implying that 
a vector representing a constant pressure is such an eigenvector.

Best,
Daniel

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-17 Thread ntetsika
Hi Wolfgang,

that's exactly the problem, B has rank much less than the number of columns 
which is due to the fully periodic boundary conditions and the 
corresponding sparsity pattern. So I don't know how I could solve this 
issue. Any ideas?

Best,
Magda

On Wednesday, January 16, 2019 at 7:31:50 PM UTC-5, Wolfgang Bangerth wrote:
>
> On 1/16/19 10:19 AM, ntet...@berkeley.edu  wrote: 
> > 
> > thanks for the reply. I'm working on Immersed Boundary Method and 
> flagella 
> > swimming, and, more specifically, I'm trying to model a unit square 
> domain, 
> > which is infinitely replicated in two dimensions, governed by the 
> > incompressible time-dependent stokes equations for low Reynolds number. 
> For 
> > this reason I need periodic boundary conditions for velocity in both 
> > directions, but also for pressure. Therefore, for my unit square domain, 
> I 
> > need to have *pure* periodicity, i.e., 
> > 
> >   \bold{u}_left = \bold{u}_left and p_left = p_right 
> > 
> >   \bold{u}_bottom = \bold{u}_top and p_bottom = p_top 
> > 
> > Does that make sense to you? 
>
> Hm, I see. You are thinking of an infinite lattice of flagella at periodic 
> positions, all of which are swimming in synchrony. (They should make that 
> an 
> Olympic sport!) You then just cut out one lattice square. I guess the 
> boundary 
> conditions make sense then. 
>
>
> > My main problem with that is that when I'm trying to use the Block 
> > Preconditioner for the time-dependent Stokes (without convection), i.e. 
> when I 
> > need to form the {\tilde{S}}^{-1}  \approx [B^T (diag M)^{-1} B]^{-1} + 
> > \Delta{t}(\nu)M_p^{-1}, I have problems to invert the B^T (diag M)^{-1} 
> B - it 
> > says not invertible. Any ideas? 
>
> The term 
>B^T (diag M)^{-1} B 
> is not invertible if one of the following three conditions is true: 
> * B is an  n x m  matrix where m>n, i.e., it is not "tall and skinny" 
> * B is an  n x m  matrix with n<=m but its column rank is less than n. 
> * (diag M) is not invertible. 
>
> You can now work your way down this list and check which condition is the 
> problem. For example, I would check that all diagonal entries of M are in 
> fact 
> nonzero (you most likely want them to actually be positive as well). 
>
> Best 
>   W. 
>
> -- 
>  
> Wolfgang Bangerth  email: bang...@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 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-16 Thread Wolfgang Bangerth
On 1/16/19 10:19 AM, ntets...@berkeley.edu wrote:
> 
> thanks for the reply. I'm working on Immersed Boundary Method and flagella 
> swimming, and, more specifically, I'm trying to model a unit square domain, 
> which is infinitely replicated in two dimensions, governed by the 
> incompressible time-dependent stokes equations for low Reynolds number. For 
> this reason I need periodic boundary conditions for velocity in both 
> directions, but also for pressure. Therefore, for my unit square domain, I 
> need to have *pure* periodicity, i.e.,
> 
>   \bold{u}_left = \bold{u}_left and p_left = p_right
> 
>   \bold{u}_bottom = \bold{u}_top and p_bottom = p_top
> 
> Does that make sense to you?

Hm, I see. You are thinking of an infinite lattice of flagella at periodic 
positions, all of which are swimming in synchrony. (They should make that an 
Olympic sport!) You then just cut out one lattice square. I guess the boundary 
conditions make sense then.


> My main problem with that is that when I'm trying to use the Block 
> Preconditioner for the time-dependent Stokes (without convection), i.e. when 
> I 
> need to form the {\tilde{S}}^{-1}  \approx [B^T (diag M)^{-1} B]^{-1} + 
> \Delta{t}(\nu)M_p^{-1}, I have problems to invert the B^T (diag M)^{-1} B - 
> it 
> says not invertible. Any ideas?

The term
   B^T (diag M)^{-1} B
is not invertible if one of the following three conditions is true:
* B is an  n x m  matrix where m>n, i.e., it is not "tall and skinny"
* B is an  n x m  matrix with n<=m but its column rank is less than n.
* (diag M) is not invertible.

You can now work your way down this list and check which condition is the 
problem. For example, I would check that all diagonal entries of M are in fact 
nonzero (you most likely want them to actually be positive as well).

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 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-16 Thread ntetsika
Hi Wolfgang,

thanks for the reply. I'm working on Immersed Boundary Method and flagella 
swimming, and, more specifically, I'm trying to model a unit square domain, 
which is infinitely replicated in two dimensions, governed by the 
incompressible time-dependent stokes equations for low Reynolds number. For 
this reason I need periodic boundary conditions for velocity in both 
directions, but also for pressure. Therefore, for my unit square domain, I 
need to have *pure* periodicity, i.e.,

 \bold{u}_left = \bold{u}_left and p_left = p_right

 \bold{u}_bottom = \bold{u}_top and p_bottom = p_top

Does that make sense to you?

My main problem with that is that when I'm trying to use the Block 
Preconditioner for the time-dependent Stokes (without convection), i.e. 
when I need to form the {\tilde{S}}^{-1}  \approx [B^T (diag M)^{-1} 
B]^{-1} + \Delta{t}(\nu)M_p^{-1}, I have problems to invert the B^T (diag 
M)^{-1} B - it says not invertible. Any ideas?

Best,
Magda

On Tuesday, January 15, 2019 at 6:22:12 PM UTC-5, Wolfgang Bangerth wrote:
>
> On 1/15/19 10:02 AM, ntet...@berkeley.edu  wrote: 
> > thank you for replying. I have looked thoroughly step 45 but it's not of 
> much 
> > help for my case. I actually want to impose periodic boundary conditions 
> for 
> > both velocities and pressure (I need to have a representative periodic 
> cell). 
>
> Is this really what you want to do? Can you elaborate on your setup? 
>
> I'm asking this because generally, mathematically speaking, you can only 
> impose the *stress* at the boundary, not the pressure alone. Second, if 
> you 
> think for example about an infinite pipe and you cut a piece out, then at 
> the 
> left and right end of that pipe segment, you can enforce that the velocity 
> is 
> periodic -- but the pressure will *not* be periodic, as there will be a 
> pressure drop along the pipe which counters the friction forces. 
>
> Best 
>   W. 
>
> -- 
>  
> Wolfgang Bangerth  email: bang...@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 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-15 Thread Wolfgang Bangerth
On 1/15/19 10:02 AM, ntets...@berkeley.edu wrote:
> thank you for replying. I have looked thoroughly step 45 but it's not of much 
> help for my case. I actually want to impose periodic boundary conditions for 
> both velocities and pressure (I need to have a representative periodic cell).

Is this really what you want to do? Can you elaborate on your setup?

I'm asking this because generally, mathematically speaking, you can only 
impose the *stress* at the boundary, not the pressure alone. Second, if you 
think for example about an infinite pipe and you cut a piece out, then at the 
left and right end of that pipe segment, you can enforce that the velocity is 
periodic -- but the pressure will *not* be periodic, as there will be a 
pressure drop along the pipe which counters the friction forces.

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 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-15 Thread ntetsika
Hi Daniel,

thank you for replying. I have looked thoroughly step 45 but it's not of 
much help for my case. I actually want to impose periodic boundary 
conditions for both velocities and pressure (I need to have a 
representative periodic cell). I used the following lines to set pressure 
to zero at the first node, but still gives me the same problem when I try 
to invert [B^T (diag M)^{-1} B] with cg solver for the purpose of Block 
Preconditioning - it says [B^T (diag M)^{-1} B] not invertible.

// constraint first pressure dof to be 0

std::vector boundary_dofs (dof_handler.n_dofs(), false);

DoFTools::extract_boundary_dofs (dof_handler, fe.component_mask(pressure), 
boundary_dofs);

const int first_boundary_dof = std::distance (boundary_dofs.begin(), 
std::find (boundary_dofs.begin(), boundary_dofs.end(), true));

constraints.add_line(first_boundary_dof);


I was thinking maybe the time-dependent stokes problem I'm trying to solve 
with fully periodic boundary conditions (velocities+pressure) is 
over-constrained and maybe that's why [B^T (diag M)^{-1} B] is not 
invertible. What do you think? Any ideas?


Thanks again for the help!


Best,

Magda

On Tuesday, January 15, 2019 at 11:05:38 AM UTC-5, Daniel Arndt wrote:
>
> Magda,
>
> [...]
>> DoFTools::make_periodicity_constraints(dof_handler, 2, 3, 1, 
>> constraints);
>> DoFTools::make_periodicity_constraints(dof_handler, 4, 1, 0, 
>> constraints);
>>
>>
> These two lines imply that you want to impose periodic boundary conditions 
> for all the components. Assuming the dof_handler variable is of type 
> FESystem and describes both velocity and pressure (as is the case in the 
> code-gallery example),
> this in particular holds true for the pressure. Is that what you are 
> intending?
> If so, you probably need another constraint to make the pressure unique.
> Otherwise, you might want to have a look at step-45 
>  where a 
> Stokes problem is solved with periodic boundary conditions on part of the 
> boundary.
> There only periodicity constraints for the velocity are stored in the 
> ConstraintMatrix object.
>
> Best,
> Daniel
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Problem with Block Preconditioner and Fully Periodic Boundary Conditions

2019-01-15 Thread Daniel Arndt
Magda,

[...]
> DoFTools::make_periodicity_constraints(dof_handler, 2, 3, 1, constraints);
> DoFTools::make_periodicity_constraints(dof_handler, 4, 1, 0, constraints);
>
>
These two lines imply that you want to impose periodic boundary conditions 
for all the components. Assuming the dof_handler variable is of type 
FESystem and describes both velocity and pressure (as is the case in the 
code-gallery example),
this in particular holds true for the pressure. Is that what you are 
intending?
If so, you probably need another constraint to make the pressure unique.
Otherwise, you might want to have a look at step-45 
 where a Stokes 
problem is solved with periodic boundary conditions on part of the boundary.
There only periodicity constraints for the velocity are stored in the 
ConstraintMatrix object.

Best,
Daniel

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.