xref: /petsc/include/petscdmtypes.h (revision 3ee9839e4674d2e0e9bcea975330f3458ebcb61e)
126bd1501SBarry Smith #if !defined(PETSCDMTYPES_H)
226bd1501SBarry Smith #define PETSCDMTYPES_H
31e25c274SJed Brown 
41e25c274SJed Brown /*S
51e25c274SJed Brown      DM - Abstract PETSc object that manages an abstract grid object and its interactions with the algebraic solvers
61e25c274SJed Brown 
71e25c274SJed Brown    Level: intermediate
81e25c274SJed Brown 
995452b02SPatrick Sanan    Notes:
1095452b02SPatrick Sanan     The DMDACreate() based object and the DMCompositeCreate() based object are examples of DMs
111e25c274SJed Brown 
121e25c274SJed Brown .seealso:  DMCompositeCreate(), DMDACreate(), DMSetType(), DMType
131e25c274SJed Brown S*/
141e25c274SJed Brown typedef struct _p_DM* DM;
151e25c274SJed Brown 
16bff4a2f0SMatthew G. Knepley /*E
17bff4a2f0SMatthew G. Knepley   DMBoundaryType - Describes the choice for fill of ghost cells on physical domain boundaries.
18bff4a2f0SMatthew G. Knepley 
19bff4a2f0SMatthew G. Knepley   Level: beginner
20bff4a2f0SMatthew G. Knepley 
21619efd4aSMatthew G. Knepley   A boundary may be of type DM_BOUNDARY_NONE (no ghost nodes), DM_BOUNDARY_GHOSTED (ghost vertices/cells
22dbb368e6SPatrick Sanan   exist but aren't filled; you can put values into them and then apply a stencil that uses those ghost locations),
23dbb368e6SPatrick Sanan   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;
24288e7d53SBarry Smith   not yet implemented for 3d), DM_BOUNDARY_PERIODIC (ghost vertices/cells filled by the opposite
25bff4a2f0SMatthew G. Knepley   edge of the domain), or DM_BOUNDARY_TWIST (like periodic, only glued backwards like a Mobius strip).
26bff4a2f0SMatthew G. Knepley 
27dbb368e6SPatrick Sanan   Notes:
28dbb368e6SPatrick Sanan   This is information for the boundary of the __PHYSICAL__ domain. It has nothing to do with boundaries between
29dbb368e6SPatrick Sanan   processes. That width is always determined by the stencil width; see DMDASetStencilWidth().
30bff4a2f0SMatthew G. Knepley 
31dbb368e6SPatrick Sanan   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 .
32288e7d53SBarry Smith 
3395452b02SPatrick Sanan   Developer Notes:
3495452b02SPatrick Sanan     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
35288e7d53SBarry Smith   as the 0th grid point where the physical boundary serves as the mirror?
36288e7d53SBarry Smith 
37dbb368e6SPatrick Sanan   References:
38a8d69d7bSBarry Smith   https://scicomp.stackexchange.com/questions/5355/writing-the-poisson-equation-finite-difference-matrix-with-neumann-boundary-cond
39288e7d53SBarry Smith 
40bff4a2f0SMatthew G. Knepley .seealso: DMDASetBoundaryType(), DMDACreate1d(), DMDACreate2d(), DMDACreate3d(), DMDACreate()
41bff4a2f0SMatthew G. Knepley E*/
42bff4a2f0SMatthew G. Knepley typedef enum {DM_BOUNDARY_NONE, DM_BOUNDARY_GHOSTED, DM_BOUNDARY_MIRROR, DM_BOUNDARY_PERIODIC, DM_BOUNDARY_TWIST} DMBoundaryType;
4362a38674SMatthew G. Knepley /*E
449dc85fa5SMatthew G. Knepley   DMBoundaryConditionType - indicates what type of boundary condition is to be imposed
459dc85fa5SMatthew G. Knepley 
469dc85fa5SMatthew G. Knepley   Note: This flag indicates the type of function which will define the condition:
479dc85fa5SMatthew G. Knepley $ DM_BC_ESSENTIAL       - A Dirichlet condition using a function of the coordinates
489dc85fa5SMatthew G. Knepley $ DM_BC_ESSENTIAL_FIELD - A Dirichlet condition using a function of the coordinates and auxiliary field data
49b18799e0SMatthew G. Knepley $ DM_BC_ESSENTIAL_BD_FIELD - A Dirichlet condition using a function of the coordinates, facet normal, and auxiliary field data
509dc85fa5SMatthew G. Knepley $ DM_BC_NATURAL         - A Neumann condition using a function of the coordinates
51b18799e0SMatthew G. Knepley $ DM_BC_NATURAL_FIELD   - A Neumann condition using a function of the coordinates and auxiliary field data
529dc85fa5SMatthew G. Knepley $ DM_BC_NATURAL_RIEMANN - A flux condition which determines the state in ghost cells
539dc85fa5SMatthew G. Knepley The user can check whether a boundary condition is essential using (type & DM_BC_ESSENTIAL), and similarly for
549dc85fa5SMatthew G. Knepley natural conditions (type & DM_BC_NATURAL)
559dc85fa5SMatthew G. Knepley 
569dc85fa5SMatthew G. Knepley   Level: beginner
579dc85fa5SMatthew G. Knepley 
589dc85fa5SMatthew G. Knepley .seealso: DMAddBoundary(), DMGetBoundary()
599dc85fa5SMatthew G. Knepley E*/
60b18799e0SMatthew G. Knepley typedef enum {DM_BC_ESSENTIAL = 1, DM_BC_ESSENTIAL_FIELD = 5, DM_BC_NATURAL = 2, DM_BC_NATURAL_FIELD = 6, DM_BC_ESSENTIAL_BD_FIELD = 9, DM_BC_NATURAL_RIEMANN = 10} DMBoundaryConditionType;
619dc85fa5SMatthew G. Knepley 
629dc85fa5SMatthew G. Knepley /*E
6362a38674SMatthew G. Knepley   DMPointLocationType - Describes the method to handle point location failure
6462a38674SMatthew G. Knepley 
6562a38674SMatthew G. Knepley   Level: beginner
6662a38674SMatthew G. Knepley 
6762a38674SMatthew G. Knepley   If a search using DM_POINTLOCATION_NONE fails, the failure is signaled with a negative cell number. On the
6862a38674SMatthew G. Knepley   other hand, if DM_POINTLOCATION_NEAREST is used, on failure, the (approximate) nearest point in the mesh is
692d1fa6caSMatthew G. Knepley   used, replacing the given point in the input vector. DM_POINTLOCATION_REMOVE returns values only for points
702d1fa6caSMatthew G. Knepley   which were located.
7162a38674SMatthew G. Knepley 
7262a38674SMatthew G. Knepley .seealso: DMLocatePoints()
7362a38674SMatthew G. Knepley E*/
742d1fa6caSMatthew G. Knepley typedef enum {DM_POINTLOCATION_NONE, DM_POINTLOCATION_NEAREST, DM_POINTLOCATION_REMOVE} DMPointLocationType;
7562a38674SMatthew G. Knepley 
765675c177SMatthew G. Knepley /*E
77174e7490SMatthew G. Knepley   DMAdaptationStrategy - Describes the strategy used for adaptive solves
785675c177SMatthew G. Knepley 
795675c177SMatthew G. Knepley   Level: beginner
805675c177SMatthew G. Knepley 
8159b28e79SMatthew G. Knepley   DM_ADAPTATION_INITIAL will refine a mesh based on an initial guess. DM_ADAPTATION_SEQUENTIAL will refine the
8259b28e79SMatthew G. Knepley   mesh based on a sequence of solves, much like grid sequencing. DM_ADAPTATION_MULTILEVEL will use the sequence
8359b28e79SMatthew G. Knepley   of constructed meshes in a multilevel solve, much like the Systematic Upscaling of Brandt.
845675c177SMatthew G. Knepley 
855675c177SMatthew G. Knepley .seealso: DMAdaptorSolve()
865675c177SMatthew G. Knepley E*/
87174e7490SMatthew G. Knepley typedef enum {DM_ADAPTATION_INITIAL, DM_ADAPTATION_SEQUENTIAL, DM_ADAPTATION_MULTILEVEL} DMAdaptationStrategy;
88174e7490SMatthew G. Knepley 
89174e7490SMatthew G. Knepley /*E
90174e7490SMatthew G. Knepley   DMAdaptationCriterion - Describes the test used to decide whether to coarsen or refine parts of the mesh
91174e7490SMatthew G. Knepley 
92174e7490SMatthew G. Knepley   Level: beginner
93174e7490SMatthew G. Knepley 
94174e7490SMatthew G. Knepley   DM_ADAPTATION_REFINE will uniformly refine a mesh, much like grid sequencing. DM_ADAPTATION_LABEL will adapt
95174e7490SMatthew G. Knepley   the mesh based upon a label of the cells filled with DMAdaptFlag markers. DM_ADAPTATION_METRIC will try to
96174e7490SMatthew G. Knepley   mesh the manifold described by the input metric tensor uniformly. PETSc can also construct such a metric based
97174e7490SMatthew G. Knepley   upon an input primal or a gradient field.
98174e7490SMatthew G. Knepley 
99174e7490SMatthew G. Knepley .seealso: DMAdaptorSolve()
100174e7490SMatthew G. Knepley E*/
101174e7490SMatthew G. Knepley typedef enum {DM_ADAPTATION_NONE, DM_ADAPTATION_REFINE, DM_ADAPTATION_LABEL, DM_ADAPTATION_METRIC} DMAdaptationCriterion;
1025675c177SMatthew G. Knepley 
1039dc85fa5SMatthew G. Knepley /*E
1049dc85fa5SMatthew G. Knepley   DMAdaptFlag - Marker in the label prescribing adaptation
1059dc85fa5SMatthew G. Knepley 
1069dc85fa5SMatthew G. Knepley   Level: beginner
1079dc85fa5SMatthew G. Knepley 
1089dc85fa5SMatthew G. Knepley .seealso: DMAdaptLabel()
1099dc85fa5SMatthew G. Knepley E*/
110bf2d5fbbSStefano Zampini typedef enum {DM_ADAPT_DETERMINE = PETSC_DETERMINE, DM_ADAPT_KEEP = 0, DM_ADAPT_REFINE, DM_ADAPT_COARSEN, DM_ADAPT_COARSEN_LAST, DM_ADAPT_RESERVED_COUNT} DMAdaptFlag;
111*3ee9839eSMatthew G. Knepley 
112*3ee9839eSMatthew G. Knepley /*E
113*3ee9839eSMatthew G. Knepley   DMDirection - Indicates a coordinate direction
114*3ee9839eSMatthew G. Knepley 
115*3ee9839eSMatthew G. Knepley   Level: beginner
116*3ee9839eSMatthew G. Knepley 
117*3ee9839eSMatthew G. Knepley .seealso: DMDAGetRay(), DMDAGetProcessorSubset(), DMPlexShearGeometry()
118*3ee9839eSMatthew G. Knepley E*/
119*3ee9839eSMatthew G. Knepley typedef enum {DM_X, DM_Y, DM_Z} DMDirection;
1209dc85fa5SMatthew G. Knepley 
12177623264SMatthew G. Knepley /*S
12277623264SMatthew G. Knepley   PetscPartitioner - PETSc object that manages a graph partitioner
12377623264SMatthew G. Knepley 
12477623264SMatthew G. Knepley   Level: intermediate
12577623264SMatthew G. Knepley 
12677623264SMatthew G. Knepley .seealso: PetscPartitionerCreate(), PetscPartitionerSetType(), PetscPartitionerType
12777623264SMatthew G. Knepley S*/
12877623264SMatthew G. Knepley typedef struct _p_PetscPartitioner *PetscPartitioner;
12977623264SMatthew G. Knepley 
1309dc85fa5SMatthew G. Knepley /*E
1319dc85fa5SMatthew G. Knepley   PetscUnit - The seven fundamental SI units
1329dc85fa5SMatthew G. Knepley 
1339dc85fa5SMatthew G. Knepley   Level: beginner
1349dc85fa5SMatthew G. Knepley 
1359dc85fa5SMatthew G. Knepley .seealso: DMPlexGetScale(), DMPlexSetScale()
1369dc85fa5SMatthew G. Knepley E*/
1379dc85fa5SMatthew G. Knepley 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;
1389dc85fa5SMatthew G. Knepley 
139b2b58855SToby Isaac /*S
140b2b58855SToby Isaac     DMField - PETSc object for defining a field on a mesh topology
141b2b58855SToby Isaac 
142b2b58855SToby Isaac     Level: intermediate
143b2b58855SToby Isaac S*/
144b2b58855SToby Isaac typedef struct _p_DMField* DMField;
145b2b58855SToby Isaac 
1461e25c274SJed Brown #endif
147