[petsc-users] Is the results of `DMAdaptLabel` as expected in `src/dm/impls/plex/tests/ex20.c`

Zongze Yang yangzongze at gmail.com
Tue Oct 4 09:18:52 CDT 2022


Hi everyone,

I am learning how to use the `DMAdaptLabel` for `DMPlex`, and found the
example `src/dm/impls/plex/tests/ex20.c` which label one cell to refine.

1. This example is just a uniform refinement when using the following
command. (see attached pdfs for the results).
```
[real-int32-gcc]
z2yang at ws5:~/opt/firedrake/real-int32-gcc/petsc/src/dm/impls/plex/tests$
./ex20 -dm_plex_box_faces 3,3 -dm_coord_space 0 -pre_adapt_dm_view
ascii::ascii_info -post_adapt_dm_view draw:tikz:figure2.tex
```
 Is this expected for this example?

2. I found there is a function named `DMAdaptLabel_Plex`, and
`DMAdaptLabel` did not call that function when the type of the dm is
`DMPlex`. Is the function `DMAdaptLabel_Plex` still in use?

3. `DMAdaptLabel` seems to lack some useful information when I use the
wrong adaptor. For example, if I set `-dm_adaptor mmg`, then the process
will give a segment fault because the `metric` passed to
`DMAdaptMetric_Mmg_Plex` is NULL, see the output below:
```
[real-int32-gcc]
z2yang at ws5:~/opt/firedrake/real-int32-gcc/petsc/src/dm/impls/plex/tests$
./ex20 -dm_plex_box_faces 3,3 -dm_coord_space 0 -pre_adapt_dm_view
draw:tikz:figure1.tex -post_adapt_dm_view draw:tikz:figure2.tex -dm_adaptor
mmg
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see https://petsc.org/release/faq/#valgrind and
https://petsc.org/release/faq/
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and
run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is
causing the crash.
Abort(59) on node 0 (rank 0 in comm 0): application called
MPI_Abort(MPI_COMM_WORLD, 59) - process 0
```

Thanks,
Zongze Yang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221004/307a4010/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pre_adapt.pdf
Type: application/pdf
Size: 2974 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221004/307a4010/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: post_adapt.pdf
Type: application/pdf
Size: 4023 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221004/307a4010/attachment-0001.pdf>


More information about the petsc-users mailing list