Actual source code: petscdsimpl.h
petsc-3.6.3 2015-12-03
1: #if !defined(_PETSCDSIMPL_H)
2: #define _PETSCDSIMPL_H
4: #include <petscds.h>
5: #include <petsc/private/petscimpl.h>
7: PETSC_EXTERN PetscBool PetscDSRegisterAllCalled;
8: PETSC_EXTERN PetscErrorCode PetscDSRegisterAll(void);
10: typedef struct _PetscDSOps *PetscDSOps;
11: struct _PetscDSOps {
12: PetscErrorCode (*setfromoptions)(PetscDS);
13: PetscErrorCode (*setup)(PetscDS);
14: PetscErrorCode (*view)(PetscDS,PetscViewer);
15: PetscErrorCode (*destroy)(PetscDS);
16: };
18: struct _p_PetscDS {
19: PETSCHEADER(struct _PetscDSOps);
20: void *data; /* Implementation object */
21: PetscBool setup; /* Flag for setup */
22: PetscInt Nf; /* The number of solution fields */
23: PetscBool *implicit; /* Flag for implicit or explicit solve */
24: PetscBool *adjacency; /* Flag for variable influence */
25: PetscObject *disc; /* The discretization for each solution field (PetscFE, PetscFV, etc.) */
26: PetscObject *discBd; /* The boundary discretization for each solution field (PetscFE, PetscFV, etc.) */
27: PetscPointFunc *obj; /* Scalar integral (like an objective function) */
28: PetscPointFunc *f; /* Weak form integrands f_0, f_1 */
29: PetscPointJac *g; /* Weak form integrands g_0, g_1, g_2, g_3 */
30: PetscBdPointFunc *fBd; /* Weak form boundary integrands f_0, f_1 */
31: PetscBdPointJac *gBd; /* Weak form boundary integrands g_0, g_1, g_2, g_3 */
32: PetscRiemannFunc *r; /* Riemann solvers */
33: void **ctx; /* User contexts for each field */
34: PetscInt dim; /* The spatial dimension */
35: /* Computed sizes */
36: PetscInt totDim, totDimBd; /* Total system dimension */
37: PetscInt totComp; /* Total field components */
38: /* Work space */
39: PetscInt *off, *offBd; /* Offsets for each field */
40: PetscInt *offDer, *offDerBd; /* Derivative offsets for each field */
41: PetscReal **basis, **basisBd; /* Default basis tabulation for each field */
42: PetscReal **basisDer, **basisDerBd; /* Default basis derivative tabulation for each field */
43: PetscScalar *u; /* Field evaluation */
44: PetscScalar *u_t; /* Field time derivative evaluation */
45: PetscScalar *u_x; /* Field gradient evaluation */
46: PetscScalar *refSpaceDer; /* Workspace for computing derivative in the reference coordinates */
47: PetscReal *x; /* Workspace for computing real coordinates */
48: PetscScalar *f0, *f1; /* Point evaluations of weak form residual integrands */
49: PetscScalar *g0, *g1, *g2, *g3; /* Point evaluations of weak form Jacobian integrands */
50: };
52: typedef struct {
53: PetscInt dummy; /* */
54: } PetscDS_Basic;
56: #endif