Actual source code: petscspace.h

  1: /*
  2:       Objects which encapsulate finite element spaces
  3: */
  4: #pragma once
  5: #include <petscdm.h>
  6: #include <petscdt.h>

  8: /* SUBMANSEC = SPACE */

 10: /*S
 11:   PetscSpace - PETSc object that manages a linear space, e.g. the space of d-dimensional polynomials of given degree

 13:   Level: beginner

 15: .seealso: `PetscSpaceCreate()`, `PetscDualSpace`, `PetscDualSpaceCreate()`, `PetscSpaceSetType()`, `PetscSpaceType`, PetscFE`
 16: S*/
 17: typedef struct _p_PetscSpace *PetscSpace;

 19: PETSC_EXTERN PetscErrorCode PetscFEInitializePackage(void);
 20: PETSC_EXTERN PetscErrorCode PetscFEFinalizePackage(void);

 22: PETSC_EXTERN PetscClassId PETSCSPACE_CLASSID;

 24: /*J
 25:   PetscSpaceType - String with the name of a PETSc linear space

 27:   Values:
 28: +  `PETSCSPACEPOLYNOMIAL` - a polynomial space, e.g. P1 is the space of linear polynomials
 29: .  `PETSCSPACEPTRIMMED`   - a trimmed polynomial space
 30: .  `PETSCSPACETENSOR`     - a space consisting of the tensor product of two or more spaces
 31: .  `PETSCSPACESUM`        - a direct or a concatenation sum
 32: .  `PETSCSPACEPOINT`      - functions defined by values on a set of quadrature points
 33: .  `PETSCSPACESUBSPACE`   - some kind of subspace, no idea what
 34: -  `PETSCSPACEWXY`        - space that encapsulates the Wheeler-Xu-Yotov enrichments

 36:   Level: beginner

 38: .seealso: `PetscSpaceSetType()`, `PetscSpace`, `PetscSpaceType`
 39: J*/
 40: typedef const char *PetscSpaceType;
 41: #define PETSCSPACEPOLYNOMIAL "poly"
 42: #define PETSCSPACEPTRIMMED   "ptrimmed"
 43: #define PETSCSPACETENSOR     "tensor"
 44: #define PETSCSPACESUM        "sum"
 45: #define PETSCSPACEPOINT      "point"
 46: #define PETSCSPACESUBSPACE   "subspace"
 47: #define PETSCSPACEWXY        "wxy"

 49: PETSC_EXTERN PetscFunctionList PetscSpaceList;
 50: PETSC_EXTERN PetscErrorCode    PetscSpaceCreate(MPI_Comm, PetscSpace *);
 51: PETSC_EXTERN PetscErrorCode    PetscSpaceDestroy(PetscSpace *);
 52: PETSC_EXTERN PetscErrorCode    PetscSpaceSetType(PetscSpace, PetscSpaceType);
 53: PETSC_EXTERN PetscErrorCode    PetscSpaceGetType(PetscSpace, PetscSpaceType *);
 54: PETSC_EXTERN PetscErrorCode    PetscSpaceSetUp(PetscSpace);
 55: PETSC_EXTERN PetscErrorCode    PetscSpaceSetFromOptions(PetscSpace);
 56: PETSC_EXTERN PetscErrorCode    PetscSpaceViewFromOptions(PetscSpace, PetscObject, const char[]);

 58: PETSC_EXTERN PetscErrorCode PetscSpaceView(PetscSpace, PetscViewer);
 59: PETSC_EXTERN PetscErrorCode PetscSpaceRegister(const char[], PetscErrorCode (*)(PetscSpace));
 60: PETSC_EXTERN PetscErrorCode PetscSpaceRegisterDestroy(void);

 62: PETSC_EXTERN PetscErrorCode PetscSpaceGetDimension(PetscSpace, PetscInt *);
 63: PETSC_EXTERN PetscErrorCode PetscSpaceSetNumComponents(PetscSpace, PetscInt);
 64: PETSC_EXTERN PetscErrorCode PetscSpaceGetNumComponents(PetscSpace, PetscInt *);
 65: PETSC_EXTERN PetscErrorCode PetscSpaceSetNumVariables(PetscSpace, PetscInt);
 66: PETSC_EXTERN PetscErrorCode PetscSpaceGetNumVariables(PetscSpace, PetscInt *);
 67: PETSC_EXTERN PetscErrorCode PetscSpaceSetDegree(PetscSpace, PetscInt, PetscInt);
 68: PETSC_EXTERN PetscErrorCode PetscSpaceGetDegree(PetscSpace, PetscInt *, PetscInt *);
 69: PETSC_EXTERN PetscErrorCode PetscSpaceEvaluate(PetscSpace, PetscInt, const PetscReal[], PetscReal[], PetscReal[], PetscReal[]);
 70: PETSC_EXTERN PetscErrorCode PetscSpaceGetHeightSubspace(PetscSpace, PetscInt, PetscSpace *);

 72: static inline PETSC_DEPRECATED_FUNCTION(3, 17, 0, "<property not used>", ) PetscErrorCode PetscSpacePolynomialSetSymmetric(PetscSpace sp, PetscBool s)
 73: {
 74:   PetscCheck(!s, PetscObjectComm((PetscObject)sp), PETSC_ERR_SUP, "PETSCSPACEPOLYNOMIAL does not support symmetric polynomials");
 75:   return PETSC_SUCCESS;
 76: }
 77: static inline PETSC_DEPRECATED_FUNCTION(3, 17, 0, "<property not used>", ) PetscErrorCode PetscSpacePolynomialGetSymmetric(PETSC_UNUSED PetscSpace sp, PetscBool *s)
 78: {
 79:   *s = PETSC_FALSE;
 80:   return PETSC_SUCCESS;
 81: }
 82: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialSetTensor(PetscSpace, PetscBool);
 83: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialGetTensor(PetscSpace, PetscBool *);

 85: PETSC_EXTERN PetscErrorCode PetscSpacePTrimmedSetFormDegree(PetscSpace, PetscInt);
 86: PETSC_EXTERN PetscErrorCode PetscSpacePTrimmedGetFormDegree(PetscSpace, PetscInt *);

 88: PETSC_EXTERN PetscErrorCode PetscSpaceTensorSetNumSubspaces(PetscSpace, PetscInt);
 89: PETSC_EXTERN PetscErrorCode PetscSpaceTensorGetNumSubspaces(PetscSpace, PetscInt *);
 90: PETSC_EXTERN PetscErrorCode PetscSpaceTensorSetSubspace(PetscSpace, PetscInt, PetscSpace);
 91: PETSC_EXTERN PetscErrorCode PetscSpaceTensorGetSubspace(PetscSpace, PetscInt, PetscSpace *);

 93: PETSC_EXTERN PetscErrorCode PetscSpaceSumSetNumSubspaces(PetscSpace, PetscInt);
 94: PETSC_EXTERN PetscErrorCode PetscSpaceSumGetNumSubspaces(PetscSpace, PetscInt *);
 95: PETSC_EXTERN PetscErrorCode PetscSpaceSumSetSubspace(PetscSpace, PetscInt, PetscSpace);
 96: PETSC_EXTERN PetscErrorCode PetscSpaceSumGetSubspace(PetscSpace, PetscInt, PetscSpace *);
 97: PETSC_EXTERN PetscErrorCode PetscSpaceSumSetConcatenate(PetscSpace, PetscBool);
 98: PETSC_EXTERN PetscErrorCode PetscSpaceSumGetConcatenate(PetscSpace, PetscBool *);
 99: PETSC_EXTERN PetscErrorCode PetscSpaceSumSetInterleave(PetscSpace, PetscBool, PetscBool);
100: PETSC_EXTERN PetscErrorCode PetscSpaceSumGetInterleave(PetscSpace, PetscBool *, PetscBool *);
101: PETSC_EXTERN PetscErrorCode PetscSpaceCreateSum(PetscInt, const PetscSpace[], PetscBool, PetscSpace *);

103: PETSC_EXTERN PetscErrorCode PetscSpacePointGetPoints(PetscSpace, PetscQuadrature *);
104: PETSC_EXTERN PetscErrorCode PetscSpacePointSetPoints(PetscSpace, PetscQuadrature);