[petsc-users] Applying Multi-Point-Constraints with SNES

Matthew Knepley knepley at gmail.com
Thu Jul 6 15:33:37 CDT 2023


On Thu, Jul 6, 2023 at 3:40 PM Hongrui Yu <yuhongrui at utexas.edu> wrote:

> Hello PETSc users,
>
>
>
> In our Finite Element application we would like to apply
> Multi-Point-Constraints to some vertices. In these Multi-Point-Constraints
> we force certain DoF in the following nodes to be the same as those in
> controlling nodes. We use DMPlex to store our mesh. I’m wondering what
> would be a good way to implement this together with SNES? Or is there an
> example that does similar thing?
>

There is a simple thing that Jed implemented call "isoperiodicity" in
plexsfc.c, and you can see
him using it to define a periodic box in

  DMPlexCreateBoxMesh_Tensor_SFC_Periodicity_Private()

You could use exactly this to define an affine relation between two dofs.


> Currently both right-hand-side and solution vectors in out application are
> created using DMCreateGlobalVec(). And we tried (unsuccessfully) to modify
> solution within FormRHS or FormJacobian routines but the solution vector
> seems to be read-only (for good reason). Is there a way to tell SNES about
> these constraints? Or perhaps one can somehow create a vector with only a
> subset of the DoFs (the actual “unknowns”)?
>

Doing it as above will eliminate the constrained unknowns from the SNES
automatically, so this will not be a concern.

  Thanks,

     Matt


> Thank you in advance for any help or advice!
>
>
>
> Hongrui
>
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230706/7afa5328/attachment-0001.html>


More information about the petsc-users mailing list