Actual source code: petscdsimpl.h
petsc-3.10.5 2019-03-28
Report Typos and Errors

      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 _n_DSBoundary *DSBoundary;

     12: struct _n_DSBoundary {
     13:   const char *name;
     14:   const char *labelname;
     15:   DMBoundaryConditionType type;
     16:   PetscInt    field;
     17:   PetscInt    numcomps;
     18:   PetscInt   *comps;
     19:   void      (*func)(void);
     20:   PetscInt    numids;
     21:   PetscInt   *ids;
     22:   void       *ctx;
     23:   DSBoundary  next;
     24: };

     26: typedef struct _PetscDSOps *PetscDSOps;
     27: struct _PetscDSOps {
     28:   PetscErrorCode (*setfromoptions)(PetscDS);
     29:   PetscErrorCode (*setup)(PetscDS);
     30:   PetscErrorCode (*view)(PetscDS,PetscViewer);
     31:   PetscErrorCode (*destroy)(PetscDS);
     32: };

     34: struct _p_PetscDS {
     35:   PETSCHEADER(struct _PetscDSOps);
     36:   void        *data;              /* Implementation object */
     37:   PetscDS     *subprobs;          /* The subspaces for each dimension */
     38:   PetscBool    setup;             /* Flag for setup */
     39:   PetscInt     Nf;                /* The number of solution fields */
     40:   PetscBool   *implicit;          /* Flag for implicit or explicit solve for each field */
     41:   PetscBool    defaultAdj[2];     /* [use cone() or support() first, use the transitive closure] for the case of no fields */
     42:   PetscBool   *adjacency;         /* Flags for defining variable influence (adjacency) for each field [use cone() or support() first, use the transitive closure] */
     43:   PetscBool    useJacPre;         /* Flag for using the Jacobian preconditioner */
     44:   PetscObject *disc;              /* The discretization for each solution field (PetscFE, PetscFV, etc.) */
     45:   PetscPointFunc   *obj;          /* Scalar integral (like an objective function) */
     46:   PetscPointFunc   *f;            /* Weak form integrands for F, f_0, f_1 */
     47:   PetscPointJac    *g;            /* Weak form integrands for J = dF/du, g_0, g_1, g_2, g_3 */
     48:   PetscPointJac    *gp;           /* Weak form integrands for preconditioner for J, g_0, g_1, g_2, g_3 */
     49:   PetscPointJac    *gt;           /* Weak form integrands for dF/du_t, g_0, g_1, g_2, g_3 */
     50:   PetscBdPointFunc *fBd;          /* Weak form boundary integrands F_bd, f_0, f_1 */
     51:   PetscBdPointJac  *gBd;          /* Weak form boundary integrands J_bd = dF_bd/du, g_0, g_1, g_2, g_3 */
     52:   PetscRiemannFunc *r;            /* Riemann solvers */
     53:   PetscPointFunc   *update;       /* Direct update of field coefficients */
     54:   PetscSimplePointFunc *exactSol; /* Exact solutions for each field */
     55:   PetscInt          numConstants; /* Number of constants passed to point functions */
     56:   PetscScalar      *constants;    /* Array of constants passed to point functions */
     57:   void       **ctx;               /* User contexts for each field */
     58:   PetscInt     dimEmbed;          /* The real space coordinate dimension */
     59:   /* Computed sizes */
     60:   PetscInt     totDim;            /* Total system dimension */
     61:   PetscInt     totComp;           /* Total field components */
     62:   PetscInt    *Nc;                /* Number of components for each field */
     63:   PetscInt    *Nb;                /* Number of basis functions for each field */
     64:   PetscInt    *off;               /* Offsets for each field */
     65:   PetscInt    *offDer;            /* Derivative offsets for each field */
     66:   PetscReal  **basis;             /* Default basis tabulation for each field */
     67:   PetscReal  **basisDer;          /* Default basis derivative tabulation for each field */
     68:   PetscReal  **basisFace;         /* Basis tabulation for each local face and field */
     69:   PetscReal  **basisDerFace;      /* Basis derivative tabulation for each local face and field */
     70:   /* Work space */
     71:   PetscScalar *u;                 /* Field evaluation */
     72:   PetscScalar *u_t;               /* Field time derivative evaluation */
     73:   PetscScalar *u_x;               /* Field gradient evaluation */
     74:   PetscScalar *refSpaceDer;       /* Workspace for computing derivative in the reference coordinates */
     75:   PetscReal   *x;                 /* Workspace for computing real coordinates */
     76:   PetscScalar *f0, *f1;           /* Point evaluations of weak form residual integrands */
     77:   PetscScalar *g0, *g1, *g2, *g3; /* Point evaluations of weak form Jacobian integrands */
     78:   DSBoundary   boundary;          /* Linked list of boundary conditions */
     79: };

     81: typedef struct {
     82:   PetscInt dummy; /* */
     83: } PetscDS_Basic;

     85: #endif