#include "petscdmplex.h" PetscErrorCode DMPlexGenerateRegister(const char sname[], PetscErrorCode (*fnc)(DM, PetscBool, DM*), PetscErrorCode (*rfnc)(DM, PetscReal*, DM*), PetscErrorCode (*alfnc)(DM, DMLabel, DM*), PetscInt dim)Not Collective
name_solver | - name of a new user-defined grid generator | |
fnc | - generator function | |
rfnc | - refinement function | |
alfnc | - adapt by label function | |
dim | - dimension of boundary of domain |
DMPlexGenerateRegister("my_generator",MyGeneratorCreate,MyGeneratorRefiner,MyGeneratorAdaptor,dim);
Then, your generator can be chosen with the procedural interface via
DMPlexGenerate(dm,"my_generator",...)or at runtime via the option
-dm_plex_generator my_generator