1 #if !defined(_PETSCDMTYPES_H) 2 #define _PETSCDMTYPES_H 3 4 /*S 5 DM - Abstract PETSc object that manages an abstract grid object and its interactions with the algebraic solvers 6 7 Level: intermediate 8 9 Concepts: grids, grid refinement 10 11 Notes: The DMDACreate() based object and the DMCompositeCreate() based object are examples of DMs 12 13 .seealso: DMCompositeCreate(), DMDACreate(), DMSetType(), DMType 14 S*/ 15 typedef struct _p_DM* DM; 16 17 /*E 18 DMBoundaryType - Describes the choice for fill of ghost cells on physical domain boundaries. 19 20 Level: beginner 21 22 A boundary may be of type DM_BOUNDARY_NONE (no ghost nodes), DM_BOUNDARY_GHOSTED (ghost vertices/cells 23 exist but aren't filled, you can put values into them and then apply a stencil that uses those ghost locations), 24 DM_BOUNDARY_MIRROR (the ghost value is the same as the value 1 grid point in; that is the 0th grid point in the real mesh acts like a mirror to define the ghost point value; 25 not yet implemented for 3d), DM_BOUNDARY_PERIODIC (ghost vertices/cells filled by the opposite 26 edge of the domain), or DM_BOUNDARY_TWIST (like periodic, only glued backwards like a Mobius strip). 27 28 Note: This is information for the boundary of the __PHYSICAL__ domain. It has nothing to do with boundaries between 29 processes, that width is always determined by the stencil width, see DMDASetStencilWidth(). 30 31 Note: If the physical grid points have values 0 1 2 3 with DM_BOUNDARY_MIRROR then the local vector with ghost points has the values 1 0 1 2 3 2 32 33 Developer notes: Should DM_BOUNDARY_MIRROR have the same meaning with DMDA_Q0, that is a staggered grid? In that case should the ghost point have the same value 34 as the 0th grid point where the physical boundary serves as the mirror? 35 36 References: http://scicomp.stackexchange.com/questions/5355/writing-the-poisson-equation-finite-difference-matrix-with-neumann-boundary-cond 37 38 .seealso: DMDASetBoundaryType(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDACreate() 39 E*/ 40 typedef enum {DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_MIRROR, DM_BOUNDARY_PERIODIC, DM_BOUNDARY_TWIST} DMBoundaryType; 41 42 /*E 43 DMBoundaryConditionType - indicates what type of boundary condition is to be imposed 44 45 Note: This flag indicates the type of function which will define the condition: 46 $ DM_BC_ESSENTIAL - A Dirichlet condition using a function of the coordinates 47 $ DM_BC_ESSENTIAL_FIELD - A Dirichlet condition using a function of the coordinates and auxiliary field data 48 $ DM_BC_NATURAL - A Neumann condition using a function of the coordinates 49 $ DM_BC_NATURAL_FIELD - A Dirichlet condition using a function of the coordinates and auxiliary field data 50 $ DM_BC_NATURAL_RIEMANN - A flux condition which determines the state in ghost cells 51 The user can check whether a boundary condition is essential using (type & DM_BC_ESSENTIAL), and similarly for 52 natural conditions (type & DM_BC_NATURAL) 53 54 Level: beginner 55 56 .seealso: DMAddBoundary(), DMGetBoundary() 57 E*/ 58 typedef enum {DM_BC_ESSENTIAL = 1, DM_BC_ESSENTIAL_FIELD = 5, DM_BC_NATURAL = 2, DM_BC_NATURAL_FIELD = 6, DM_BC_NATURAL_RIEMANN = 10} DMBoundaryConditionType; 59 60 /*E 61 DMPointLocationType - Describes the method to handle point location failure 62 63 Level: beginner 64 65 If a search using DM_POINTLOCATION_NONE fails, the failure is signaled with a negative cell number. On the 66 other hand, if DM_POINTLOCATION_NEAREST is used, on failure, the (approximate) nearest point in the mesh is 67 used, replacing the given point in the input vector. DM_POINTLOCATION_REMOVE returns values only for points 68 which were located. 69 70 .seealso: DMLocatePoints() 71 E*/ 72 typedef enum {DM_POINTLOCATION_NONE, DM_POINTLOCATION_NEAREST, DM_POINTLOCATION_REMOVE} DMPointLocationType; 73 74 /*E 75 DMAdaptationType - Describes the strategy used for adaptive solves 76 77 Level: beginner 78 79 If a search using DM_POINTLOCATION_NONE fails, the failure is signaled with a negative cell number. On the 80 other hand, if DM_POINTLOCATION_NEAREST is used, on failure, the (approximate) nearest point in the mesh is 81 used, replacing the given point in the input vector. DM_POINTLOCATION_REMOVE returns values only for points 82 which were located. 83 84 .seealso: DMAdaptorSolve() 85 E*/ 86 typedef enum {DM_ADAPTATION_INITIAL, DM_ADAPTATION_SEQUENTIAL, DM_ADAPTATION_MULTILEVEL} DMAdaptationType; 87 88 /*E 89 DMAdaptFlag - Marker in the label prescribing adaptation 90 91 Level: beginner 92 93 .seealso: DMAdaptLabel() 94 E*/ 95 typedef enum {DM_ADAPT_DETERMINE = PETSC_DETERMINE, DM_ADAPT_KEEP = 0, DM_ADAPT_REFINE, DM_ADAPT_COARSEN, DM_ADAPT_RESERVED_COUNT} DMAdaptFlag; 96 97 /*S 98 PetscPartitioner - PETSc object that manages a graph partitioner 99 100 Level: intermediate 101 102 Concepts: partition, mesh 103 104 .seealso: PetscPartitionerCreate(), PetscPartitionerSetType(), PetscPartitionerType 105 S*/ 106 typedef struct _p_PetscPartitioner *PetscPartitioner; 107 108 /*E 109 PetscUnit - The seven fundamental SI units 110 111 Level: beginner 112 113 .seealso: DMPlexGetScale(), DMPlexSetScale() 114 E*/ 115 typedef enum {PETSC_UNIT_LENGTH, PETSC_UNIT_MASS, PETSC_UNIT_TIME, PETSC_UNIT_CURRENT, PETSC_UNIT_TEMPERATURE, PETSC_UNIT_AMOUNT, PETSC_UNIT_LUMINOSITY, NUM_PETSC_UNITS} PetscUnit; 116 117 #endif 118