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: /* MANSEC = DM */
      9: /* SUBMANSEC = SPACE */

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

     14:   Level: beginner

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

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

     23: PETSC_EXTERN PetscClassId PETSCSPACE_CLASSID;

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

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

     37:   Level: beginner

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

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

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

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

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

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

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

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

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