xref: /petsc/include/petscdstypes.h (revision 509b31aaa32200dbab7fb52b06fff6095f240aca)
1a4963045SJacob Faibussowitsch #pragma once
22764a2aaSMatthew G. Knepley 
36528b96dSMatthew G. Knepley #include <petscdmlabel.h>
46528b96dSMatthew G. Knepley 
5ce78bad3SBarry Smith /* MANSEC = DM */
6ac09b921SBarry Smith /* SUBMANSEC = DT */
7ac09b921SBarry Smith 
82764a2aaSMatthew G. Knepley /*S
987497f52SBarry Smith   PetscDS - PETSc object that manages a discrete system, which is a set of discretizations + continuum equations from a `PetscWeakForm`
102764a2aaSMatthew G. Knepley 
112764a2aaSMatthew G. Knepley   Level: intermediate
122764a2aaSMatthew G. Knepley 
13db781477SPatrick Sanan .seealso: `PetscDSCreate()`, `PetscDSSetType()`, `PetscDSType`, `PetscWeakForm`, `PetscFECreate()`, `PetscFVCreate()`
142764a2aaSMatthew G. Knepley S*/
152764a2aaSMatthew G. Knepley typedef struct _p_PetscDS *PetscDS;
162764a2aaSMatthew G. Knepley 
176528b96dSMatthew G. Knepley /*S
186528b96dSMatthew G. Knepley   PetscWeakForm - PETSc object that manages a sets of pointwise functions defining a system of equations
196528b96dSMatthew G. Knepley 
206528b96dSMatthew G. Knepley   Level: intermediate
216528b96dSMatthew G. Knepley 
22db781477SPatrick Sanan .seealso: `PetscWeakFormCreate()`, `PetscDS`, `PetscFECreate()`, `PetscFVCreate()`
236528b96dSMatthew G. Knepley S*/
246528b96dSMatthew G. Knepley typedef struct _p_PetscWeakForm *PetscWeakForm;
256528b96dSMatthew G. Knepley 
2606ad1575SMatthew G. Knepley /*S
2706ad1575SMatthew G. Knepley   PetscFormKey - This key indicates how to use a set of pointwise functions defining part of a system of equations
2806ad1575SMatthew G. Knepley 
29a5b23f4aSJose E. Roman   The subdomain on which to integrate is specified by (label, value), the test function field by (field), and the
3006ad1575SMatthew G. Knepley   piece of the equation by (part). For example, LHS = 0 and RHS = 1 in IMEX methods. More pieces can be present for
3106ad1575SMatthew G. Knepley   operator splitting methods.
3206ad1575SMatthew G. Knepley 
3306ad1575SMatthew G. Knepley   Level: intermediate
3406ad1575SMatthew G. Knepley 
355d83a8b1SBarry Smith   Note:
365d83a8b1SBarry Smith   This is a struct, not a `PetscObject`
375d83a8b1SBarry Smith 
38db781477SPatrick Sanan .seealso: `DMPlexSNESComputeResidualFEM()`, `DMPlexSNESComputeJacobianFEM()`, `DMPlexSNESComputeBoundaryFEM()`
3906ad1575SMatthew G. Knepley S*/
40ce78bad3SBarry Smith typedef struct {
4106ad1575SMatthew G. Knepley   DMLabel  label; /* The (label, value) select a subdomain */
426528b96dSMatthew G. Knepley   PetscInt value;
4306ad1575SMatthew G. Knepley   PetscInt field; /* Selects the field for the test function */
4406ad1575SMatthew G. Knepley   PetscInt part;  /* Selects the equation part. For example, LHS = 0 and RHS = 1 in IMEX methods. More pieces can be present for operator splitting methods. */
4506ad1575SMatthew G. Knepley } PetscFormKey;
4606ad1575SMatthew G. Knepley 
4706ad1575SMatthew G. Knepley /*E
4806ad1575SMatthew G. Knepley   PetscWeakFormKind - The kind of weak form. The specific forms are given in the documentation for the integraton functions.
4906ad1575SMatthew G. Knepley 
5016a05f60SBarry Smith   Values:
5116a05f60SBarry Smith + OBJECTIVE                  - Objective form
5216a05f60SBarry Smith . F0, F1                     - Residual forms
5316a05f60SBarry Smith . G0, G1, G2, G3             - Jacobian forms
5416a05f60SBarry Smith . GP0, GP1, GP2, GP3         - Jacobian preconditioner matrix forms
5516a05f60SBarry Smith . GT0, GT1, GT2, GT3         - Dynamic Jacobian matrix forms
5616a05f60SBarry Smith . BDF0, BDF1                 - Boundary Residual forms
5716a05f60SBarry Smith . BDG0, BDG1, BDG2, BDG3     - Jacobian forms
5816a05f60SBarry Smith . BDGP0, BDGP1, BDGP2, BDGP3 - Jacobian preconditioner matrix forms
59d2b2dc1eSMatthew G. Knepley . R                          - Riemann solver
60d2b2dc1eSMatthew G. Knepley - CEED                       - libCEED QFunction
6106ad1575SMatthew G. Knepley 
6206ad1575SMatthew G. Knepley   Level: beginner
6306ad1575SMatthew G. Knepley 
6416a05f60SBarry Smith .seealso: `PetscWeakForm`, `PetscFEIntegrateResidual()`, `PetscFEIntegrateJacobian()`, `PetscFEIntegrateBdResidual()`, `PetscFEIntegrateBdJacobian()`,
6516a05f60SBarry Smith           `PetscFVIntegrateRHSFunction()`, `PetscWeakFormSetIndexResidual()`, `PetscWeakFormClearIndex()`
6606ad1575SMatthew G. Knepley E*/
679371c9d4SSatish Balay typedef enum {
689371c9d4SSatish Balay   PETSC_WF_OBJECTIVE,
699371c9d4SSatish Balay   PETSC_WF_F0,
709371c9d4SSatish Balay   PETSC_WF_F1,
719371c9d4SSatish Balay   PETSC_WF_G0,
729371c9d4SSatish Balay   PETSC_WF_G1,
739371c9d4SSatish Balay   PETSC_WF_G2,
749371c9d4SSatish Balay   PETSC_WF_G3,
759371c9d4SSatish Balay   PETSC_WF_GP0,
769371c9d4SSatish Balay   PETSC_WF_GP1,
779371c9d4SSatish Balay   PETSC_WF_GP2,
789371c9d4SSatish Balay   PETSC_WF_GP3,
799371c9d4SSatish Balay   PETSC_WF_GT0,
809371c9d4SSatish Balay   PETSC_WF_GT1,
819371c9d4SSatish Balay   PETSC_WF_GT2,
829371c9d4SSatish Balay   PETSC_WF_GT3,
839371c9d4SSatish Balay   PETSC_WF_BDF0,
849371c9d4SSatish Balay   PETSC_WF_BDF1,
859371c9d4SSatish Balay   PETSC_WF_BDG0,
869371c9d4SSatish Balay   PETSC_WF_BDG1,
879371c9d4SSatish Balay   PETSC_WF_BDG2,
889371c9d4SSatish Balay   PETSC_WF_BDG3,
899371c9d4SSatish Balay   PETSC_WF_BDGP0,
909371c9d4SSatish Balay   PETSC_WF_BDGP1,
919371c9d4SSatish Balay   PETSC_WF_BDGP2,
929371c9d4SSatish Balay   PETSC_WF_BDGP3,
939371c9d4SSatish Balay   PETSC_WF_R,
94d2b2dc1eSMatthew G. Knepley   PETSC_WF_CEED,
959371c9d4SSatish Balay   PETSC_NUM_WF
969371c9d4SSatish Balay } PetscWeakFormKind;
9706ad1575SMatthew G. Knepley PETSC_EXTERN const char *const PetscWeakFormKinds[];
98*509b31aaSMatthew G. Knepley 
99*509b31aaSMatthew G. Knepley typedef void (*PetscPointFunc)(PetscInt, PetscInt, PetscInt, const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], PetscReal, const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]);
100*509b31aaSMatthew G. Knepley typedef void (*PetscPointJac)(PetscInt, PetscInt, PetscInt, const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], PetscReal, PetscReal, const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]);
101*509b31aaSMatthew G. Knepley typedef void (*PetscBdPointFunc)(PetscInt, PetscInt, PetscInt, const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], PetscReal, const PetscReal[], const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]);
102*509b31aaSMatthew G. Knepley typedef void (*PetscBdPointJac)(PetscInt, PetscInt, PetscInt, const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], const PetscInt[], const PetscInt[], const PetscScalar[], const PetscScalar[], const PetscScalar[], PetscReal, PetscReal, const PetscReal[], const PetscReal[], PetscInt, const PetscScalar[], PetscScalar[]);
103*509b31aaSMatthew G. Knepley typedef void (*PetscRiemannFunc)(PetscInt, PetscInt, const PetscReal[], const PetscReal[], const PetscScalar[], const PetscScalar[], PetscInt, const PetscScalar[], PetscScalar[], void *);
104*509b31aaSMatthew G. Knepley 
105*509b31aaSMatthew G. Knepley /*S
106*509b31aaSMatthew G. Knepley   PetscSimplePointFn - A prototype of a simple pointwise function that can be passed to, for example, `DMPlexTransformExtrudeSetNormalFunction()`
107*509b31aaSMatthew G. Knepley 
108*509b31aaSMatthew G. Knepley   Calling Sequence:
109*509b31aaSMatthew G. Knepley + dim  - The coordinate dimension of the original mesh (usually a surface)
110*509b31aaSMatthew G. Knepley . time - The current time, or 0.
111*509b31aaSMatthew G. Knepley . x    - The location of the current normal, in the coordinate space of the original mesh
112*509b31aaSMatthew G. Knepley . r    - The layer number of this point
113*509b31aaSMatthew G. Knepley . u    - The user provides the computed normal on output
114*509b31aaSMatthew G. Knepley - ctx  - An optional user context
115*509b31aaSMatthew G. Knepley 
116*509b31aaSMatthew G. Knepley   Level: beginner
117*509b31aaSMatthew G. Knepley 
118*509b31aaSMatthew G. Knepley   Note:
119*509b31aaSMatthew G. Knepley   The deprecated `PetscSimplePointFunc` works as a replacement for `PetscSimplePointFn` *
120*509b31aaSMatthew G. Knepley 
121*509b31aaSMatthew G. Knepley .seealso: `DMPlexTransformExtrudeSetNormalFunction()`
122*509b31aaSMatthew G. Knepley S*/
123*509b31aaSMatthew G. Knepley PETSC_EXTERN_TYPEDEF typedef PetscErrorCode(PetscSimplePointFn)(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt r, PetscScalar u[], void *ctx);
124*509b31aaSMatthew G. Knepley 
125*509b31aaSMatthew G. Knepley PETSC_EXTERN_TYPEDEF typedef PetscSimplePointFn *PetscSimplePointFunc;
126