[petsc-users] Problem with DMRefine and DMLabel

Matthew Knepley knepley at gmail.com
Wed Dec 13 05:15:48 CST 2017


On Wed, Dec 13, 2017 at 4:30 AM, Santos Teixeira Frederico <
fsantost at student.ethz.ch> wrote:

> Hi folks,
>
> In the example SNES/62.c, when I use "-simplex 1" and "-refinement_limit
> 0.05", it seems the refined DMPlex does not carry all the labels from the
> original DM.
>

This is correct. Here is the problem. When you use -refinement_limit
(instead of -dm_refine), I call Triangle/TetGen to do
the refinement. They do not tell me how they changed the mesh to get there,
so I have no way of propagating the labels.
There is a special name ("marker") that I was using for the boundary, which
I automatically mark after generation.

We could choose to also mark boundary faces, but it seems redundant. If you
want them marked, you can call
DMPlexMarkBoundaryFaces() on the new mesh. Does this seem reasonable?

  Thanks,

      Matt


> You can see that if you place, in the function CreateMesh, one
> DMViewFromOptions right after the DMPlexCreateBoxMesh and another
> DMViewFromOptions after DMRefine. The first output is
>
> DM Object: DM_0x84000000_0 1 MPI processes
>   type: plex
> DM_0x84000000_0 in 2 dimensions:
>   0-cells: 9
>   1-cells: 16
>   2-cells: 8
> Labels:
>   Face Sets: 4 strata with value/size (1 (2), 4 (2), 2 (2), 3 (2))
>   marker: 4 strata with value/size (4 (5), 1 (3), 2 (5), 3 (3))
>   depth: 3 strata with value/size (0 (9), 1 (16), 2 (8))
>
> which is correct w.r.t. the definition from DMPlexCreateBoxMesh. However,
> the second output is
>
> DM Object: DM_0x84000000_1 1 MPI processes
>   type: plex
> DM_0x84000000_1 in 2 dimensions:
>   0-cells: 145
>   1-cells: 400
>   2-cells: 256
> Labels:
>   marker: 4 strata with value/size (4 (3), 1 (57), 2 (3), 3 (1))
>   depth: 3 strata with value/size (0 (145), 1 (400), 2 (256))
>
> Note that the label "Face Sets" disappeared and that the label "marker"
> does not include all the boundary points.
> The full set of options is:
>
> -run_type full
> -refinement_limit 0.005
> -simplex 1
> -dm_view
> -dm_plex_separate_marker
> -interpolate 1
> -vel_petscspace_order 2
> -pres_petscspace_order 1
> -ksp_view
> -ksp_monitor
> -ksp_type fgmres
> -ksp_gmres_restart 10
> -ksp_rtol 1.0e-9
> -pc_type fieldsplit
> -pc_fieldsplit_type schur
> -pc_fieldsplit_schur_factorization_type full
> -fieldsplit_pressure_ksp_rtol 1e-10
> -fieldsplit_velocity_ksp_type gmres
> -fieldsplit_velocity_pc_type lu
> -fieldsplit_pressure_pc_type jacobi
> -snes_error_if_not_converged
> -ksp_error_if_not_converged
> -snes_view
> -snes_monitor
>
> Am I missing anything?
>
> Regards,
>  Fred.
>



-- 
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.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20171213/d5482141/attachment.html>


More information about the petsc-users mailing list