[petsc-users] How to construct DMPlex of cells with different topological dimension?

Matthew Knepley knepley at gmail.com
Sun Oct 31 07:16:14 CDT 2021


On Thu, Oct 28, 2021 at 10:48 PM 袁煕 <yuanxi at advancesoft.jp> wrote:

> Dear Matt,
>
>     My mesh is something like the following figure, which is composed of
> three elements : one hexahedron(solid element), one quadrilateral (shell
> element), and one line (beam element). I found the function "TestEmptyStrata"
> in file \dm\impls\plex\tests\ex11.c would be a good example to read in such
> a kind of mesh by using DMPlexSetCone. But a problem is that you should
> declare all faces and edges of hexahedron element, all edges in
> quadrilateral  element by DMPlexSetCone, otherwise PETsc could not do
> topological interpolation afterwards. Am I right here?
>    As general in FEM mesh, my mesh does not contain any information about faces
> or edges of solid elements. That's why I consider using DMCOMPOSITE. That is
>
> -   Put hexahedron, quadrilateral, and line elements into different  DM
> structures.
> -   do topological interpolation in those DMs separately.
> -   composite them.
>
>    Is there anything wrong in my above consideration?  Any suggestions?
>
>         ------------
>       /|             /|
>      / |           /  |  cell 0: Hex
>     /  |          /   |
>    ------------/   |
>    |   |         |   |
>    |   |         |   |   cell 1: Quad
>    |   --------|---|------------
>    |  /          |  /             /
>    | /           | /             /
>    |/            |/             /
>    -------------------------------------------
>                                   cell 2: line
>
> Much thanks for your help.
>

If you are solving something where everything is embedded in a volumetric
mesh, then there is no problem. However, if you really have
the mesh above, where lower dimensional pieces are sticking out of the
mesh, then Plex can represent the mesh, but automatic interpolation
(creation of edges and faces) will not work. Why is this? We use depth in
the DAG as a proxy for cell dimension, but this will no longer work
if faces are not part of a volume.

Will DMCOMPOSITE do what you want? It depends. It will be able to lay out a
vector, but it will not know about any topological connectivity
between the meshes and will not preallocate a Jacobian with any
interaction. If the meshes are truly separate, this is fine. If not, it is
not that
useful.

Could you modify the existing code to support this? Yes, it would not be
terribly difficult. When you load the mesh, you must know what kind
of cell you are loading. You could explicitly set this using
DMPlexSetCellType(). Then, instead of taking a certain height stratum of
the DAG
to loop over, you would instead use all cells marked with a certain cell
type. The rest of the interpolation code should work fine.

What kind of physics do you have where low dimensional features are not
embedded in the larger volume?

  Thanks,

     Matt


> Yuan
>
> 2021年10月28日(木) 22:05 Matthew Knepley <knepley at gmail.com>:
>
>> On Thu, Oct 28, 2021 at 4:59 AM 袁煕 <yuanxi at advancesoft.jp> wrote:
>>
>>> Dear Matt,
>>>
>>> Thank you for your quick response.
>>>
>>> I think what you mean is to build DAG from my mesh at first and then
>>> call DMPlexCreateFromDAG
>>> <https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexCreateFromDAG.html#DMPlexCreateFromDAG>()
>>> to construct DMPlex.
>>>
>>
>> No, I do not mean that.
>>
>>
>>> A new problem is,  as I know, the function DMPlexInterpolate would
>>> generate points with different depth. What's the difference  between those
>>> faces and segment elements generated by  DMPlexInterpolate  with that
>>> defined by the original mesh, or should we not use DMPlexInterpolate in
>>> such a case?
>>>
>>> On the other hand, can DMComposite be used in this case by defining
>>> DMPlex with different topological dimensions at first and then composite
>>> them?
>>>
>>
>> You do not need that. I am obviously not understanding your question. My
>> short answer is that Plex _already_ handles cells of different
>> dimension automatically without anything extra.
>>
>> Maybe it would help if you defined a specific problem you have.
>>
>>   Thanks,
>>
>>       Matt
>>
>>
>>> Thanks in advance.
>>>
>>> Yuan
>>>
>>>
>>> 2021年10月27日(水) 19:27 Matthew Knepley <knepley at gmail.com>:
>>>
>>>> On Wed, Oct 27, 2021 at 4:50 AM 袁煕 <yuanxi at advancesoft.jp> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am trying to parallelize my serial FEM program using PETSc. This
>>>>> program calculates structure deformation by using various types of elements
>>>>> such as solid, shell, beam, and truss. At the very beginning, I found it
>>>>> was hard for me to put such kinds of elements into DMPlex. Because solid
>>>>> elements are topologically three dimensional, shell element two, and beam
>>>>> or truss are topologically one-dimensional elements. After reading chapter
>>>>> 2.10: "DMPlex: Unstructured Grids in PETSc" of users manual carefully,  I
>>>>> found the provided functions, such as DMPlexSetCone, cannot declare those
>>>>> topological differences.
>>>>>
>>>>> My question is : Is it possible and how to define all those
>>>>> topologically different elements into a DMPlex struct?
>>>>>
>>>>
>>>> Yes. The idea is to program in a dimension-independent way, so that the
>>>> code can handle cells of any dimension.
>>>> What you probably want is the "depth" in the DAG representation, which
>>>> you can think of as the dimension of a cell.
>>>>
>>>>
>>>> https://petsc.org/main/docs/manualpages/DMPLEX/DMPlexGetPointDepth.html#DMPlexGetPointDepth
>>>>
>>>>   Thanks,
>>>>
>>>>      Matt
>>>>
>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Yuan.
>>>>>
>>>>>
>>>>
>>>> --
>>>> 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/>
>>>>
>>>
>>
>> --
>> 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/>
>>
>

-- 
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/20211031/c1426d88/attachment.html>


More information about the petsc-users mailing list