[petsc-users] Creating DMPlex from the subsection of a DM

Matthew Knepley knepley at gmail.com
Wed Feb 7 08:18:43 CST 2024


On Wed, Feb 7, 2024 at 8:30 AM Mark Adams <mfadams at lbl.gov> wrote:

> Wait for Matt to chime in, but I think you will need to start from scratch
> and use
> https://petsc.org/release/manualpages/DMPlex/DMPlexBuildFromCellList
>

Let me restate things to make sure I get it. You want to select a submesh
that retains its labels? There are many different kinds of submeshes. The
easiest one is

  https://petsc.org/main/manualpages/DMPlex/DMPlexFilter/

The selects a subset of cells. Since you always get the closure of any mesh
point, I am not sure it makes sense to select vertices independently of
cells, but maybe you can explain that to me. You just mark the cells you
want with another label and call that function. All labels will be
propagated (along with everything else).

  Thanks,

     Matt


> Mark
>
> On Wed, Feb 7, 2024 at 5:36 AM Vilmer Dahlberg via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
>
>> Dear PETSc dev team,
>>
>> I am working on an application which makes use of DMPlex. I would like to
>> extract a subsection of the dm based on some field metric defined on its
>> vertices or cells. I am using DMLabel to mark my boundary conditions and
>> would like the child mesh to retain some of the labels. Is there a simple
>> way of doing this? I could spend some time writing my own implementation,
>> looping over cells and building a new DM from scratch or using something
>> like DMPlexBuildFromCellListParallel, but I feel like there should exist a
>> solution. Could you point me in the right direction?
>>
>> Thanks in advance!
>>
>> Best,
>> Vilmer
>>
>

-- 
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/20240207/c2f7bcf1/attachment-0001.html>


More information about the petsc-users mailing list