Actual source code: glexg.c

      1: #include <petsc/private/dmpleximpl.h>

      3: PetscBool DMPlexGenerateRegisterAllCalled = PETSC_FALSE;

      5: #if defined(PETSC_HAVE_TRIANGLE)
      6: PETSC_EXTERN PetscErrorCode DMPlexGenerate_Triangle(DM, PetscBool, DM*);
      7: PETSC_EXTERN PetscErrorCode DMPlexRefine_Triangle(DM, double*, DM*);
      8: #endif
      9: #if defined(PETSC_HAVE_TETGEN)
     10: PETSC_EXTERN PetscErrorCode DMPlexGenerate_Tetgen(DM, PetscBool, DM*);
     11: PETSC_EXTERN PetscErrorCode DMPlexRefine_Tetgen(DM, double*, DM*);
     12: #endif
     13: #if defined(PETSC_HAVE_CTETGEN)
     14: PETSC_EXTERN PetscErrorCode DMPlexGenerate_CTetgen(DM, PetscBool, DM*);
     15: PETSC_EXTERN PetscErrorCode DMPlexRefine_CTetgen(DM, double*, DM*);
     16: #endif

     18: /*@C
     19:   DMPlexGenerateRegisterAll - Registers all of the mesh generation methods in the DMPlexGenerate package.

     21:   Not Collective

     23:   Level: advanced

     25: .seealso:  DMPlexGenerateRegisterDestroy()
     26: @*/
     27: PetscErrorCode  DMPlexGenerateRegisterAll(void)
     28: {

     32:   if (DMPlexGenerateRegisterAllCalled) return(0);
     33:   DMPlexGenerateRegisterAllCalled = PETSC_TRUE;
     34: #if defined(PETSC_HAVE_TRIANGLE)
     35:   DMPlexGenerateRegister("triangle",DMPlexGenerate_Triangle,DMPlexRefine_Triangle,NULL,1);
     36: #endif
     37: #if defined(PETSC_HAVE_CTETGEN)
     38:   DMPlexGenerateRegister("ctetgen",DMPlexGenerate_CTetgen,DMPlexRefine_CTetgen,NULL,2);
     39: #endif
     40: #if defined(PETSC_HAVE_TETGEN)
     41:   DMPlexGenerateRegister("tetgen",DMPlexGenerate_Tetgen,DMPlexRefine_Tetgen,NULL,2);
     42: #endif
     43:   DMPlexGenerateRegister("cellrefiner",NULL,NULL,DMPlexCellRefinerAdaptLabel,-1);
     44:   return(0);
     45: }