[petsc-users] interpolate HDF5 mesh

Matthew Knepley knepley at gmail.com
Thu Dec 20 12:05:28 CST 2018


On Thu, Dec 20, 2018 at 12:56 PM Yann JOBIC <yann.jobic at univ-amu.fr> wrote:

> Le 20/12/2018 à 16:40, Matthew Knepley a écrit :
>
> On Thu, Dec 20, 2018 at 9:33 AM Yann JOBIC via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
>
>> Dear Petsc Users,
>>
>> When i'm using DMPlexCreateBoxMesh, my code works fine. However, when i
>> load the "exact" same mesh from an HDF5 file, it's not working anymore
>> (Nonlinear solve did not converge due to DIVERGED_FNORM_NAN iterations 0).
>>
>> The mesh view when i use DMPlexCreateBoxMesh looks like (i labeled my
>> boudary nodes):
>>
>> /* generated with DMPlexCreateBoxMesh */
>> DM Object: Mesh 1 MPI processes
>>    type: plex
>> Mesh in 3 dimensions:
>>    0-cells: 216
>>    1-cells: 540
>>    2-cells: 450
>>    3-cells: 125
>> Labels:
>>    Faces: 6 strata with value/size (2 (121), 4 (121), 3 (121), 6 (121),
>> 5 (121), 7 (121))
>>    boundary: 1 strata with value/size (1 (602))
>>    depth: 4 strata with value/size (0 (216), 1 (540), 2 (450), 3 (125))
>>    Face Sets: 6 strata with value/size (6 (25), 5 (25), 3 (25), 4 (25),
>> 1 (25), 2 (25))
>>    marker: 1 strata with value/size (1 (450))
>>
>> And when i use DMPlexCreateFromFile, or DMLoad, i have :
>>
>> /* generated with H5 file */
>> fin label DM
>> DM Object: Mesh 1 MPI processes
>>    type: plex
>> Mesh in 3 dimensions:
>>    0-cells: 216
>>    1-cells: 540
>>    2-cells: 450
>>    3-cells: 125
>> Labels:
>>    Faces: 6 strata with value/size (2 (121), 4 (121), 6 (121), 7 (121),
>> 5 (121), 3 (121))
>>    boundary: 1 strata with value/size (1 (602))
>>    depth: 4 strata with value/size (0 (216), 1 (540), 2 (450), 3 (125))
>>
>> It looks like my DM is not interpolated. Am i wrong ?
>>
>
> Its interpolated (you have 4 kinds of k-cells, instead of 2). However, you
> are missing your
> Face Sets marker, which probably means boundary conditions are not getting
> applied.
>
> My Face marker is label to 1, with the label  "boundary" (i used
> DMPlexMarkBoundaryFaces)
> After that, i create a new label, "Faces", with the number associated to
> the boundary condition.
> Faces = 0 -> ouest
> Faces = 1 -> est
> ...
>
> But you're right, I'm missing "Face Sets".
>

You are also missing "marker". Both of these are added by the mesh creation
function. Do you know
which one you are using (setting in a boundary condition)?

  Thanks,

    Matt


> I couldn't find the function which adds this label.
> Is there one ? or do i have to do as in  DMPlexCreateCubeMesh_Internal?
>
> Thanks,
>
> Yann
>
>   Thanks,
>
>     Matt
>
>
>> It's strange, because when i use DMPlexCreateFromFile, i put PETSC_TRUE
>> for interpolation.
>>
>> Even after loading the mesh, i used DMPlexInterpolate, which return a
>> new DM (not null).
>>
>> Do you know what's happening here ?
>> Maybe my DIVERGED_FNORM_NAN comes from another part of the code ?
>> (however only the mesh is changing)
>>
>> Thanks,
>>
>> Yann
>>
>
>

-- 
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/20181220/f40ac83d/attachment.html>


More information about the petsc-users mailing list