<div dir="ltr">I think Mark mentioned this earlier, but I want to make sure that the rigid body null vectors should be specified only when Neumann boundary conditions are used on all boundaries of the domain, correct? Alternatively, if a Dirichlet boundary condition is used (on any part of the domain boundary) then there is no null space, i.e., the operator is a full rank matrix?<div><br></div><div>If the above is true, then I think I do not need to specify the rigid body null modes because I am using Dirichlet boundary conditions for the velocity solver. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 30, 2024 at 12:28 PM Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Yes to 6 null vectors in 3D, 3 null vectors in 2D. The center of mass does not need to be identified because you can algebraically orthogonalize (lines 411-420 here).<br>
<br>
<a href="https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/plex/plexfem.c?ref_type=heads*L377-425__;Iw!!G_uCfscf7eWS!ezw7zWJYwCHHUvoAmPZ4JT-HJ8l8V8aC3pq3VbTRke4EO6i5Z_AxjqmaJ1M_6BS6b99zSzfvl8FQIhZEjNHJ84-m6w$" rel="noreferrer" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/plex/plexfem.c?ref_type=heads#L377-425</a><br>
<br>
See also this implementation with raw coordinates. GAMG orthogonalizes within each aggregate (in a later phase of the algorithm) so global orthogonalization is not necessary.<br>
<br>
<a href="https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/gamg/agg.c?ref_type=heads*L387__;Iw!!G_uCfscf7eWS!ezw7zWJYwCHHUvoAmPZ4JT-HJ8l8V8aC3pq3VbTRke4EO6i5Z_AxjqmaJ1M_6BS6b99zSzfvl8FQIhZEjNFr-J8G0w$" rel="noreferrer" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/pc/impls/gamg/agg.c?ref_type=heads#L387</a><br>
<br>
Amneet Bhalla <<a href="mailto:mail2amneet@gmail.com" target="_blank">mail2amneet@gmail.com</a>> writes:<br>
<br>
> I think the nullspace for the velocity operator is of the form<br>
><br>
> vnull = U + ω × r<br>
> in which U is a rigid body velocity and ω is the rigid body rotational<br>
> velocity, and r is the radius vector from the center of mass. I believe I<br>
> need to construct 6 nullspace vectors in 3D and 3 nullspace vectors in 2D.<br>
> Sounds correct? Also does the center of mass coordinates matter when<br>
> defining r?<br>
><br>
> On Wed, Oct 30, 2024 at 7:53 AM Amneet Bhalla <<a href="mailto:mail2amneet@gmail.com" target="_blank">mail2amneet@gmail.com</a>> wrote:<br>
><br>
>> @Mark: Is there some document/paper that I can follow to check the algebra<br>
>> of these zero eigenvectors/null space modes?<br>
>><br>
>> @Jed : We use a projection method preconditioner to solve the coupled<br>
>> velocity pressure system as described here (<br>
>> <a href="https://urldefense.us/v3/__https://www.sciencedirect.com/science/article/pii/S0021999123004205__;!!G_uCfscf7eWS!ezw7zWJYwCHHUvoAmPZ4JT-HJ8l8V8aC3pq3VbTRke4EO6i5Z_AxjqmaJ1M_6BS6b99zSzfvl8FQIhZEjNFHB5gzxg$" rel="noreferrer" target="_blank">https://www.sciencedirect.com/science/article/pii/S0021999123004205</a>). It<br>
>> is an approximation of the Schur complement. As a part of projection<br>
>> preconditioner, we need to solve just the momentum equation separately<br>
>> without considering the pressure part.<br>
>><br>
>> On Tue, Oct 29, 2024 at 8:03 PM Jed Brown <<a href="mailto:jed@jedbrown.org" target="_blank">jed@jedbrown.org</a>> wrote:<br>
>><br>
>>> And to be clear, we recommend using fieldsplit Schur to separate the<br>
>>> pressure and velocity part (there are many examples). Applying AMG directly<br>
>>> to the saddle point problem will not be a good solver because the<br>
>>> heuristics assume positivity and do not preserve inf-sup stability (nor do<br>
>>> standard smoothers).<br>
>>><br>
>>> Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> writes:<br>
>>><br>
>>> > This is linear elasticity and there are 6 "null" vectors (if you removed<br>
>>> > Dirichlet boundary conditions these are eigenvectors with zero<br>
>>> eigenvalue):<br>
>>> > 3 translations, x, y, z, and three rotatiions xx, yy ,zz.<br>
>>> > x = (1,0,0,1,0,0,1,0 ...)<br>
>>> > and xx is something like (0, z_1, -y_1, 0, z_2, -y_2, ...) where z_1 is<br>
>>> the<br>
>>> > z coordinate of the first vertex, etc.<br>
>>> ><br>
>>> > Mark<br>
>>> ><br>
>>> > On Tue, Oct 29, 2024 at 3:47 PM Amneet Bhalla <<a href="mailto:mail2amneet@gmail.com" target="_blank">mail2amneet@gmail.com</a>><br>
>>> wrote:<br>
>>> ><br>
>>> >> Hi Mark,<br>
>>> >><br>
>>> >> Thanks! I am not sure how to construct null space and zero energy modes<br>
>>> >> manually for this operator. Is there some theory or documentation I can<br>
>>> >> follow to figure out what the null space and zero energy modes look<br>
>>> like<br>
>>> >> for this operator? Once I know what these are in symbolic form, I<br>
>>> think I<br>
>>> >> should be able to construct them manually.<br>
>>> >><br>
>>> >> Best,<br>
>>> >> --Amneet<br>
>>> >><br>
>>> >> On Tue, Oct 29, 2024 at 7:35 AM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:<br>
>>> >><br>
>>> >>> Oh my mistake. You are using staggered grids. So you don't have a<br>
>>> block<br>
>>> >>> size that hypre would use for the "nodal" methods.<br>
>>> >>> I'm not sure what you are doing exactly, but try hypre and you could<br>
>>> >>> create the null space, zero energy modes, manually, attach to the<br>
>>> matrix<br>
>>> >>> and try GAMG.<br>
>>> >>> You can run with '-info :pc' and grep on GAMG to see if GAMG is<br>
>>> picking<br>
>>> >>> the null space up (send this output if you can't figure it out).<br>
>>> >>><br>
>>> >>> Thanks,<br>
>>> >>> Mark<br>
>>> >>><br>
>>> >>> On Tue, Oct 29, 2024 at 9:28 AM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.gov</a>> wrote:<br>
>>> >>><br>
>>> >>>> This coordinate interface is just a shortcut for vertex based<br>
>>> >>>> discretizations with 3 dof per vertex, etc. (maybe works in 2D).<br>
>>> >>>> You will need to construct the null space vectors manually and<br>
>>> attach it<br>
>>> >>>> to the matrix. Used by GAMG.<br>
>>> >>>><br>
>>> >>>> Note, for hypre you want to use the "nodal" options and it does not<br>
>>> use<br>
>>> >>>> these null space vectors. That is probably the way you want to go.<br>
>>> >>>> eg: -pc_hypre_boomeramg_nodal_coarsen<br>
>>> >>>><br>
>>> >>>> I would run with hypre boomerang and -help and grep on nodal to see<br>
>>> all<br>
>>> >>>> the "nodal" options and use them.<br>
>>> >>>><br>
>>> >>>> Thanks,<br>
>>> >>>> Mark<br>
>>> >>>><br>
>>> >>>><br>
>>> >>>> On Mon, Oct 28, 2024 at 8:06 PM Amneet Bhalla <<a href="mailto:mail2amneet@gmail.com" target="_blank">mail2amneet@gmail.com</a><br>
>>> ><br>
>>> >>>> wrote:<br>
>>> >>>><br>
>>> >>>>> Hi Folks,<br>
>>> >>>>><br>
>>> >>>>> I am trying to solve the momentum equation in a projection<br>
>>> >>>>> preconditioner using GAMG or Hypre solver. The equation looks like<br>
>>> for<br>
>>> >>>>> velocity variable *v* looks like:<br>
>>> >>>>><br>
>>> >>>>><br>
>>> >>>>> [image: Screenshot 2024-10-28 at 4.15.17 PM.png]<br>
>>> >>>>><br>
>>> >>>>> Here, μ is spatially varying dynamic viscosity and λ is spatially<br>
>>> >>>>> varying bulk viscosity. I understand that I need to specify rigid<br>
>>> body<br>
>>> >>>>> nullspace modes to the multigrid solver in order to accelerate its<br>
>>> >>>>> convergence. Looking into this routine<br>
>>> MatNullSpaceCreateRigidBody() (<br>
>>> >>>>><br>
>>> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Mat/MatNullSpaceCreateRigidBody/__;!!G_uCfscf7eWS!bVR6duCoDqPhZrWS-sm1c5qxsFPjZMhdT86AqLpPzWgVy5qoRhd4_Jue2LJOIS6LRrtV2cHGrqger1Yvb-Y5f-0$" rel="noreferrer" target="_blank">https://urldefense.us/v3/__https://petsc.org/release/manualpages/Mat/MatNullSpaceCreateRigidBody/__;!!G_uCfscf7eWS!bVR6duCoDqPhZrWS-sm1c5qxsFPjZMhdT86AqLpPzWgVy5qoRhd4_Jue2LJOIS6LRrtV2cHGrqger1Yvb-Y5f-0$</a><br>
>>> >>>>> <<br>
>>> <a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/Mat/MatNullSpaceCreateRigidBody/__;!!G_uCfscf7eWS!eKqgIJjCdMzIU76f7X65AmGxrU_-lC7W02BMWafJ77DNf_IuQk6O1X3qU1x9Ez8NJ20vZEL-mF6T1yNmDnwv0eWa2w$" rel="noreferrer" target="_blank">https://urldefense.us/v3/__https://petsc.org/release/manualpages/Mat/MatNullSpaceCreateRigidBody/__;!!G_uCfscf7eWS!eKqgIJjCdMzIU76f7X65AmGxrU_-lC7W02BMWafJ77DNf_IuQk6O1X3qU1x9Ez8NJ20vZEL-mF6T1yNmDnwv0eWa2w$</a><br>
>>> >),<br>
>>> >>>>> I see that I need to provide the coordinates of each node. I am<br>
>>> using<br>
>>> >>>>> staggered grid discretization. Do I need to provide coordinates of<br>
>>> >>>>> staggered grid locations?<br>
>>> >>>>><br>
>>> >>>>> Thanks,<br>
>>> >>>>> --<br>
>>> >>>>> --Amneet<br>
>>> >>>>><br>
>>> >>>>><br>
>>> >>>>><br>
>>> >>>>><br>
>>> >><br>
>>> >> --<br>
>>> >> --Amneet<br>
>>> >><br>
>>> >><br>
>>> >><br>
>>> >><br>
>>><br>
>><br>
>><br>
>> --<br>
>> --Amneet<br>
>><br>
>><br>
>><br>
>><br>
><br>
> -- <br>
> --Amneet<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>--Amneet <br><br></div><div><br></div><div><br></div></div></div>