[petsc-users] realCoords for DOFs

Yann Jobic yann.jobic at univ-amu.fr
Tue Dec 13 02:16:13 CST 2022



Le 12/13/2022 à 5:43 AM, Matthew Knepley a écrit :
> On Mon, Dec 12, 2022 at 6:06 PM Yann Jobic <yann.jobic at univ-amu.fr 
> <mailto:yann.jobic at univ-amu.fr>> wrote:
> 
>     Hi all,
> 
>     I'm trying to get the coords of the dofs of a DMPlex for a PetscFE
>     discretization, for orders greater than 1.
> 
>     I'm struggling to run dm/impls/plex/tutorials/ex8.c
>     I've got the following error (with option -view_coord) :
> 
> 
> You just need to call
> 
>    DMGetCoordinatesLocalSetUp()
> 
> before the loop. I try to indicate this in the error message(). I did 
> not call it in the example
> because it is only necessary for output. 

The error message is explicit. It feels strange to modify a Petsc 
tutorial in order to make it work, with an option proposed by it.
Maybe the option -view_coord should be removed then.
Thanks,
Yann


We do this so that output is
> not synchronizing.
> 
>    Thanks,
> 
>      Matt
> 
>     [0]PETSC ERROR: --------------------- Error Message
>     --------------------------------------------------------------
>     [0]PETSC ERROR: Object is in wrong state
>     [0]PETSC ERROR: DMGetCoordinatesLocalSetUp() has not been called
>     [0]PETSC ERROR: See https://petsc.org/release/faq/
>     <https://petsc.org/release/faq/> for trouble shooting.
>     [0]PETSC ERROR: Petsc Release Version 3.18.2, unknown
>     [0]PETSC ERROR:
>     /home/jobic/projet/fe-utils/petsc/fetools/cmake-build-debug/ex_closure_petsc
>     on a  named luke by jobic Mon Dec 12 23:34:37 2022
>     [0]PETSC ERROR: Configure options
>     --prefix=/local/lib/petsc/3.18/p3/gcc/nompi_hdf5 --with-mpi=0
>     --with-debugging=1 --with-blacs=1 --download-zlib,--download-p4est
>     --download-hdf5=1 --download-triangle=1 --with-single-library=0
>     --with-large-file-io=1 --with-shared-libraries=0 -CFLAGS=" -g -O0"
>     -CXXFLAGS=" -g -O0" -FFLAGS=" -g -O0" PETSC_ARCH=nompi_gcc_hdf5
>     [0]PETSC ERROR: #1 DMGetCoordinatesLocalNoncollective() at
>     /home/devel/src_linux/petsc-3.18.0/src/dm/interface/dmcoordinates.c:621
>     [0]PETSC ERROR: #2 DMPlexGetCellCoordinates() at
>     /home/devel/src_linux/petsc-3.18.0/src/dm/impls/plex/plexgeometry.c:1291
>     [0]PETSC ERROR: #3 main() at
>     /home/jobic/projet/fe-utils/petsc/fetools/src/ex_closure_petsc.c:86
>     [0]PETSC ERROR: PETSc Option Table entries:
>     [0]PETSC ERROR: -dm_plex_box_faces 2,2
>     [0]PETSC ERROR: -dm_plex_dim 2
>     [0]PETSC ERROR: -dm_plex_simplex 0
>     [0]PETSC ERROR: -petscspace_degree 1
>     [0]PETSC ERROR: -view_coord
>     [0]PETSC ERROR: ----------------End of Error Message -------send entire
>     error message to petsc-maint at mcs.anl.gov----------
> 
>     Maybe i've done something wrong ?
> 
> 
>     Moreover, i don't quite understand the function DMPlexGetLocalOffsets,
>     and how to use it with DMGetCoordinatesLocal. It seems that
>     DMGetCoordinatesLocal do not have the coords of the dofs, but only the
>     nodes defining the geometry.
> 
>     I've made some small modifications of ex8.c, but i still have an error :
>     [0]PETSC ERROR: --------------------- Error Message
>     --------------------------------------------------------------
>     [0]PETSC ERROR: Invalid argument
>     [0]PETSC ERROR: Wrong type of object: Parameter # 1
>     [0]PETSC ERROR: WARNING! There are option(s) set that were not used!
>     Could be the program crashed before they were used or a spelling
>     mistake, etc!
>     [0]PETSC ERROR: Option left: name:-sol value: vtk:sol.vtu
>     [0]PETSC ERROR: See https://petsc.org/release/faq/
>     <https://petsc.org/release/faq/> for trouble shooting.
>     [0]PETSC ERROR: Petsc Release Version 3.18.2, unknown
>     [0]PETSC ERROR:
>     /home/jobic/projet/fe-utils/petsc/fetools/cmake-build-debug/view_coords
>     on a  named luke by jobic Mon Dec 12 23:51:05 2022
>     [0]PETSC ERROR: Configure options
>     --prefix=/local/lib/petsc/3.18/p3/gcc/nompi_hdf5 --with-mpi=0
>     --with-debugging=1 --with-blacs=1 --download-zlib,--download-p4est
>     --download-hdf5=1 --download-triangle=1 --with-single-library=0
>     --with-large-file-io=1 --with-shared-libraries=0 -CFLAGS=" -g -O0"
>     -CXXFLAGS=" -g -O0" -FFLAGS=" -g -O0" PETSC_ARCH=nompi_gcc_hdf5
>     [0]PETSC ERROR: #1 PetscFEGetHeightSubspace() at
>     /home/devel/src_linux/petsc-3.18.0/src/dm/dt/fe/interface/fe.c:1692
>     [0]PETSC ERROR: #2 DMPlexGetLocalOffsets() at
>     /home/devel/src_linux/petsc-3.18.0/src/dm/impls/plex/plexceed.c:98
>     [0]PETSC ERROR: #3 ViewOffsets() at
>     /home/jobic/projet/fe-utils/petsc/fetools/src/view_coords.c:28
>     [0]PETSC ERROR: #4 main() at
>     /home/jobic/projet/fe-utils/petsc/fetools/src/view_coords.c:99
>     [0]PETSC ERROR: PETSc Option Table entries:
>     [0]PETSC ERROR: -heat_petscspace_degree 2
>     [0]PETSC ERROR: -sol vtk:sol.vtu
>     [0]PETSC ERROR: ----------------End of Error Message -------send entire
>     error message to petsc-maint at mcs.anl.gov----------
> 
> 
>     Is dm/impls/plex/tutorials/ex8.c a good example for viewing the coords
>     of the dofs of a DMPlex ?
> 
> 
>     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/>


More information about the petsc-users mailing list