[petsc-users] DMPlex. Apply Dirichlet boundary condition

Matthew Knepley knepley at gmail.com
Wed Oct 17 08:48:41 CDT 2018


On Wed, Oct 17, 2018 at 12:29 AM Josh L <ysjosh.lo at gmail.com> wrote:

> Hi,
>
> My problem has an irregular domain and for the nodes I have to apply
> boundary condition, I only know their node number in nature ordering.
> How do I apply BC(zero out the corresponding entries in global Vec and
> Mat) after DMPlexDistribute when it is all in global ordering?
>
> If using DMLabel, how do I add those nodes to the label If I only have
> their number in nature ordering?
>

I will help you do whatever you want to do. However, first I would like to
encourage you not to do what you are doing.

<paperclip talking>It looks like you want to add  a boundary condition to
your continuum model?</paperclip talking>

First, you need a way to describe the boundary that is invariant to mesh
transformations, such as redistribution, adaptation, and coordinate
remapping.. For this you can use DMLabel. Those transformations update the
label so that the same topological piece of the mesh is marked after the
transformation.

Second, you should also specify your boundary condition in a way that is
invariant to these transformations. This function


https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DM/DMAddBoundary.html

encourages you to write boundary conditions as pointwise functions, which
can easily be projected into a finite element space
along a given DMLabel using DMProjectFunctionLabelLocal(). You can also use
a finite element function instead using DMProjectFieldLabelLocal(). These
functions are used internally by DMPlexInsertBoundaryValues().

Could you use that kind of a scheme?

  Thanks,

     Matt


> Thanks,
> Josh
>
>
>
>
>

-- 
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/20181017/6d8746b8/attachment-0001.html>


More information about the petsc-users mailing list