Date: 2026-03-31T05:46:03+00:00

Actual source code: petscdmfield.h

      1: #pragma once

      3: #include <petscdm.h>
      4: #include <petscdt.h>
      5: #include <petscfe.h>

      7: /* SUBMANSEC = DM */

      9: PETSC_EXTERN PetscErrorCode DMFieldInitializePackage(void);
     10: PETSC_EXTERN PetscErrorCode DMFieldFinalizePackage(void);

     12: PETSC_EXTERN PetscClassId DMFIELD_CLASSID;

     14: /*J
     15:     DMFieldType - String with the name of a `DMField` implementation

     17:     Level: intermediate

     19: .seealso: [](ch_dmbase), `DMField`, `DMFieldSetType()`, `DMFieldGetType()`, `DMFieldRegister()`
     20: J*/
     21: typedef const char *DMFieldType;
     22: #define DMFIELDDA    "da"
     23: #define DMFIELDDS    "ds"
     24: #define DMFIELDSHELL "shell"

     26: PETSC_EXTERN PetscFunctionList DMFieldList;
     27: PETSC_EXTERN PetscErrorCode    DMFieldSetType(DMField, DMFieldType);
     28: PETSC_EXTERN PetscErrorCode    DMFieldGetType(DMField, DMFieldType *);
     29: PETSC_EXTERN PetscErrorCode    DMFieldRegister(const char[], PetscErrorCode (*)(DMField));

     31: typedef enum {
     32:   DMFIELD_VERTEX,
     33:   DMFIELD_EDGE,
     34:   DMFIELD_FACET,
     35:   DMFIELD_CELL
     36: } DMFieldContinuity;
     37: PETSC_EXTERN const char *const DMFieldContinuities[];

     39: PETSC_EXTERN PetscErrorCode DMFieldDestroy(DMField *);
     40: PETSC_EXTERN PetscErrorCode DMFieldView(DMField, PetscViewer);

     42: PETSC_EXTERN PetscErrorCode DMFieldGetDM(DMField, DM *);
     43: PETSC_EXTERN PetscErrorCode DMFieldGetNumComponents(DMField, PetscInt *);

     45: PETSC_EXTERN PetscErrorCode DMFieldEvaluate(DMField, Vec, PetscDataType, void *, void *, void *);
     46: PETSC_EXTERN PetscErrorCode DMFieldEvaluateFE(DMField, IS, PetscQuadrature, PetscDataType, void *, void *, void *);
     47: PETSC_EXTERN PetscErrorCode DMFieldEvaluateFV(DMField, IS, PetscDataType, void *, void *, void *);
     48: PETSC_EXTERN PetscErrorCode DMFieldCreateFEGeom(DMField, IS, PetscQuadrature, PetscFEGeomMode, PetscFEGeom **);

     50: PETSC_EXTERN PetscErrorCode DMFieldCreateDefaultQuadrature(DMField, IS, PetscQuadrature *);
     51: PETSC_EXTERN PetscErrorCode DMFieldCreateDefaultFaceQuadrature(DMField, IS, PetscQuadrature *);

     53: PETSC_EXTERN PetscErrorCode DMFieldGetDegree(DMField, IS, PetscInt *, PetscInt *);

     55: PETSC_EXTERN PetscErrorCode DMFieldCreateDA(DM, PetscInt, const PetscScalar *, DMField *);
     56: PETSC_EXTERN PetscErrorCode DMFieldCreateDS(DM, PetscInt, Vec, DMField *);
     57: PETSC_EXTERN PetscErrorCode DMFieldCreateDSWithDG(DM, DM, PetscInt, Vec, Vec, DMField *);

     59: PETSC_EXTERN PetscErrorCode DMFieldCreateShell(DM, PetscInt, DMFieldContinuity, PetscCtx, DMField *);
     60: PETSC_EXTERN PetscErrorCode DMFieldShellSetDestroy(DMField, PetscErrorCode (*)(DMField));
     61: PETSC_EXTERN PetscErrorCode DMFieldShellGetContext(DMField, PetscCtxRt);
     62: PETSC_EXTERN PetscErrorCode DMFieldShellSetEvaluate(DMField, PetscErrorCode (*)(DMField, Vec, PetscDataType, void *, void *, void *));
     63: PETSC_EXTERN PetscErrorCode DMFieldShellSetEvaluateFE(DMField, PetscErrorCode (*)(DMField, IS, PetscQuadrature, PetscDataType, void *, void *, void *));
     64: PETSC_EXTERN PetscErrorCode DMFieldShellEvaluateFEDefault(DMField, IS, PetscQuadrature, PetscDataType, void *, void *, void *);
     65: PETSC_EXTERN PetscErrorCode DMFieldShellSetEvaluateFV(DMField, PetscErrorCode (*)(DMField, IS, PetscDataType, void *, void *, void *));
     66: PETSC_EXTERN PetscErrorCode DMFieldShellEvaluateFVDefault(DMField, IS, PetscDataType, void *, void *, void *);
     67: PETSC_EXTERN PetscErrorCode DMFieldShellSetGetDegree(DMField, PetscErrorCode (*)(DMField, IS, PetscInt *, PetscInt *));
     68: PETSC_EXTERN PetscErrorCode DMFieldShellSetCreateDefaultQuadrature(DMField, PetscErrorCode (*)(DMField, IS, PetscQuadrature *));