Date: 2015-10-02T22:17:03+00:00

Actual source code: petscfe.h
petsc-3.6.2 2015-10-02
Report Typos and Errors

      1: /*
      2:       Objects which encapsulate finite element spaces and operations
      3: */
      6: #include <petscdm.h>
      7: #include <petscdt.h>
      8: #include <petscfetypes.h>
      9: #include <petscdstypes.h>

     11: /* Assuming dim <= 3 */
     12: typedef struct {
     13:   PetscReal v0[3];
     14:   PetscReal J[9];
     15:   PetscReal invJ[9];
     16:   PetscReal detJ;
     17:   PetscReal n[3];
     18:   PetscInt  dim;
     19:   PetscInt  dimEmbed;
     20: } PetscFECellGeom;

     22: PETSC_EXTERN PetscErrorCode PetscFEInitializePackage(void);

     24: PETSC_EXTERN PetscClassId PETSCSPACE_CLASSID;

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

     29:   Level: beginner

     31: .seealso: PetscSpaceSetType(), PetscSpace
     32: J*/
     33: typedef const char *PetscSpaceType;
     34: #define PETSCSPACEPOLYNOMIAL "poly"
     35: #define PETSCSPACEDG         "dg"

     37: PETSC_EXTERN PetscFunctionList PetscSpaceList;
     38: PETSC_EXTERN PetscErrorCode PetscSpaceCreate(MPI_Comm, PetscSpace *);
     39: PETSC_EXTERN PetscErrorCode PetscSpaceDestroy(PetscSpace *);
     40: PETSC_EXTERN PetscErrorCode PetscSpaceSetType(PetscSpace, PetscSpaceType);
     41: PETSC_EXTERN PetscErrorCode PetscSpaceGetType(PetscSpace, PetscSpaceType *);
     42: PETSC_EXTERN PetscErrorCode PetscSpaceSetUp(PetscSpace);
     43: PETSC_EXTERN PetscErrorCode PetscSpaceSetFromOptions(PetscSpace);
     44: PETSC_STATIC_INLINE PetscErrorCode PetscSpaceViewFromOptions(PetscSpace A,PetscObject B,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,B,name);}

     46: PETSC_EXTERN PetscErrorCode PetscSpaceView(PetscSpace,PetscViewer);
     47: PETSC_EXTERN PetscErrorCode PetscSpaceRegister(const char [], PetscErrorCode (*)(PetscSpace));
     48: PETSC_EXTERN PetscErrorCode PetscSpaceRegisterDestroy(void);

     50: PETSC_EXTERN PetscErrorCode PetscSpaceGetDimension(PetscSpace, PetscInt *);
     51: PETSC_EXTERN PetscErrorCode PetscSpaceSetOrder(PetscSpace, PetscInt);
     52: PETSC_EXTERN PetscErrorCode PetscSpaceGetOrder(PetscSpace, PetscInt *);
     53: PETSC_EXTERN PetscErrorCode PetscSpaceEvaluate(PetscSpace, PetscInt, const PetscReal[], PetscReal[], PetscReal[], PetscReal[]);

     55: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialSetNumVariables(PetscSpace, PetscInt);
     56: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialGetNumVariables(PetscSpace, PetscInt *);
     57: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialSetSymmetric(PetscSpace, PetscBool);
     58: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialGetSymmetric(PetscSpace, PetscBool *);
     59: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialSetTensor(PetscSpace, PetscBool);
     60: PETSC_EXTERN PetscErrorCode PetscSpacePolynomialGetTensor(PetscSpace, PetscBool *);

     62: PETSC_EXTERN PetscErrorCode PetscSpaceDGSetQuadrature(PetscSpace, PetscQuadrature);
     63: PETSC_EXTERN PetscErrorCode PetscSpaceDGGetQuadrature(PetscSpace, PetscQuadrature *);

     65: PETSC_EXTERN PetscClassId PETSCDUALSPACE_CLASSID;

     67: /*J
     68:   PetscDualSpaceType - String with the name of a PETSc dual space

     70:   Level: beginner

     72: .seealso: PetscDualSpaceSetType(), PetscDualSpace
     73: J*/
     74: typedef const char *PetscDualSpaceType;
     75: #define PETSCDUALSPACELAGRANGE "lagrange"
     76: #define PETSCDUALSPACESIMPLE   "simple"

     78: PETSC_EXTERN PetscFunctionList PetscDualSpaceList;
     79: PETSC_EXTERN PetscErrorCode PetscDualSpaceCreate(MPI_Comm, PetscDualSpace *);
     80: PETSC_EXTERN PetscErrorCode PetscDualSpaceDestroy(PetscDualSpace *);
     81: PETSC_EXTERN PetscErrorCode PetscDualSpaceDuplicate(PetscDualSpace, PetscDualSpace *);
     82: PETSC_EXTERN PetscErrorCode PetscDualSpaceSetType(PetscDualSpace, PetscDualSpaceType);
     83: PETSC_EXTERN PetscErrorCode PetscDualSpaceGetType(PetscDualSpace, PetscDualSpaceType *);
     84: PETSC_EXTERN PetscErrorCode PetscDualSpaceSetUp(PetscDualSpace);
     85: PETSC_EXTERN PetscErrorCode PetscDualSpaceSetFromOptions(PetscDualSpace);
     86: PETSC_STATIC_INLINE PetscErrorCode PetscDualSpaceViewFromOptions(PetscDualSpace A,PetscObject B,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,B,name);}

     88: PETSC_EXTERN PetscErrorCode PetscDualSpaceView(PetscDualSpace,PetscViewer);
     89: PETSC_EXTERN PetscErrorCode PetscDualSpaceRegister(const char [], PetscErrorCode (*)(PetscDualSpace));
     90: PETSC_EXTERN PetscErrorCode PetscDualSpaceRegisterDestroy(void);

     92: PETSC_EXTERN PetscErrorCode PetscDualSpaceGetDimension(PetscDualSpace, PetscInt *);
     93: PETSC_EXTERN PetscErrorCode PetscDualSpaceSetOrder(PetscDualSpace, PetscInt);
     94: PETSC_EXTERN PetscErrorCode PetscDualSpaceGetOrder(PetscDualSpace, PetscInt *);
     95: PETSC_EXTERN PetscErrorCode PetscDualSpaceSetDM(PetscDualSpace, DM);
     96: PETSC_EXTERN PetscErrorCode PetscDualSpaceGetDM(PetscDualSpace, DM *);
     97: PETSC_EXTERN PetscErrorCode PetscDualSpaceGetFunctional(PetscDualSpace, PetscInt, PetscQuadrature *);
     98: PETSC_EXTERN PetscErrorCode PetscDualSpaceCreateReferenceCell(PetscDualSpace, PetscInt, PetscBool, DM *);

    100: PETSC_EXTERN PetscErrorCode PetscDualSpaceApply(PetscDualSpace, PetscInt, PetscFECellGeom *, PetscInt, PetscErrorCode (*)(PetscInt, const PetscReal [], PetscInt, PetscScalar *, void *), void *, PetscScalar *);

    102: PETSC_EXTERN PetscErrorCode PetscDualSpaceLagrangeGetContinuity(PetscDualSpace, PetscBool *);
    103: PETSC_EXTERN PetscErrorCode PetscDualSpaceLagrangeSetContinuity(PetscDualSpace, PetscBool);

    105: PETSC_EXTERN PetscErrorCode PetscDualSpaceGetHeightSubspace(PetscDualSpace,PetscInt,PetscDualSpace *);
    106: PETSC_EXTERN PetscErrorCode PetscDualSpaceSimpleSetDimension(PetscDualSpace, PetscInt);
    107: PETSC_EXTERN PetscErrorCode PetscDualSpaceSimpleSetFunctional(PetscDualSpace, PetscInt, PetscQuadrature);

    109: PETSC_EXTERN PetscClassId PETSCFE_CLASSID;

    111: /*J
    112:   PetscFEType - String with the name of a PETSc finite element space

    114:   Level: beginner

    116:   Note: Currently, the classes are concerned with the implementation of element integration

    118: .seealso: PetscFESetType(), PetscFE
    119: J*/
    120: typedef const char *PetscFEType;
    121: #define PETSCFEBASIC     "basic"
    122: #define PETSCFENONAFFINE "nonaffine"
    123: #define PETSCFEOPENCL    "opencl"
    124: #define PETSCFECOMPOSITE "composite"

    126: PETSC_EXTERN PetscFunctionList PetscFEList;
    127: PETSC_EXTERN PetscErrorCode PetscFECreate(MPI_Comm, PetscFE *);
    128: PETSC_EXTERN PetscErrorCode PetscFEDestroy(PetscFE *);
    129: PETSC_EXTERN PetscErrorCode PetscFESetType(PetscFE, PetscFEType);
    130: PETSC_EXTERN PetscErrorCode PetscFEGetType(PetscFE, PetscFEType *);
    131: PETSC_EXTERN PetscErrorCode PetscFESetUp(PetscFE);
    132: PETSC_EXTERN PetscErrorCode PetscFESetFromOptions(PetscFE);
    133: PETSC_STATIC_INLINE PetscErrorCode PetscFEViewFromOptions(PetscFE A,PetscObject B,const char name[]) {return PetscObjectViewFromOptions((PetscObject)A,B,name);}

    135: PETSC_EXTERN PetscErrorCode PetscFEView(PetscFE,PetscViewer);
    136: PETSC_EXTERN PetscErrorCode PetscFERegister(const char [], PetscErrorCode (*)(PetscFE));
    137: PETSC_EXTERN PetscErrorCode PetscFERegisterDestroy(void);
    138: PETSC_EXTERN PetscErrorCode PetscFECreateDefault(DM, PetscInt, PetscInt, PetscBool, const char [], PetscInt, PetscFE *);

    140: PETSC_EXTERN PetscErrorCode PetscFEGetDimension(PetscFE, PetscInt *);
    141: PETSC_EXTERN PetscErrorCode PetscFEGetSpatialDimension(PetscFE, PetscInt *);
    142: PETSC_EXTERN PetscErrorCode PetscFESetNumComponents(PetscFE, PetscInt);
    143: PETSC_EXTERN PetscErrorCode PetscFEGetNumComponents(PetscFE, PetscInt *);
    144: PETSC_EXTERN PetscErrorCode PetscFEGetTileSizes(PetscFE, PetscInt *, PetscInt *, PetscInt *, PetscInt *);
    145: PETSC_EXTERN PetscErrorCode PetscFESetTileSizes(PetscFE, PetscInt, PetscInt, PetscInt, PetscInt);
    146: PETSC_EXTERN PetscErrorCode PetscFESetBasisSpace(PetscFE, PetscSpace);
    147: PETSC_EXTERN PetscErrorCode PetscFEGetBasisSpace(PetscFE, PetscSpace *);
    148: PETSC_EXTERN PetscErrorCode PetscFESetDualSpace(PetscFE, PetscDualSpace);
    149: PETSC_EXTERN PetscErrorCode PetscFEGetDualSpace(PetscFE, PetscDualSpace *);
    150: PETSC_EXTERN PetscErrorCode PetscFESetQuadrature(PetscFE, PetscQuadrature);
    151: PETSC_EXTERN PetscErrorCode PetscFEGetQuadrature(PetscFE, PetscQuadrature *);
    152: PETSC_EXTERN PetscErrorCode PetscFEGetNumDof(PetscFE, const PetscInt **);
    153: PETSC_EXTERN PetscErrorCode PetscFEGetDefaultTabulation(PetscFE, PetscReal **, PetscReal **, PetscReal **);
    154: PETSC_EXTERN PetscErrorCode PetscFEGetFaceTabulation(PetscFE, PetscReal **);
    155: PETSC_EXTERN PetscErrorCode PetscFEGetTabulation(PetscFE, PetscInt, const PetscReal[], PetscReal **, PetscReal **, PetscReal **);
    156: PETSC_EXTERN PetscErrorCode PetscFERestoreTabulation(PetscFE, PetscInt, const PetscReal[], PetscReal **, PetscReal **, PetscReal **);
    157: PETSC_EXTERN PetscErrorCode PetscFERefine(PetscFE, PetscFE *);

    159: PETSC_EXTERN PetscErrorCode PetscFEIntegrate(PetscFE, PetscDS, PetscInt, PetscInt, PetscFECellGeom *, const PetscScalar[], PetscDS, const PetscScalar[], PetscReal[]);
    160: PETSC_EXTERN PetscErrorCode PetscFEIntegrateResidual(PetscFE, PetscDS, PetscInt, PetscInt, PetscFECellGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);
    161: PETSC_EXTERN PetscErrorCode PetscFEIntegrateBdResidual(PetscFE, PetscDS, PetscInt, PetscInt, PetscFECellGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);
    162: PETSC_EXTERN PetscErrorCode PetscFEIntegrateJacobian(PetscFE, PetscDS, PetscInt, PetscInt, PetscInt, PetscFECellGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);
    163: PETSC_EXTERN PetscErrorCode PetscFEIntegrateBdJacobian(PetscFE, PetscDS, PetscInt, PetscInt, PetscInt, PetscFECellGeom *, const PetscScalar[], const PetscScalar[], PetscDS, const PetscScalar[], PetscScalar[]);

    165: PETSC_EXTERN PetscErrorCode PetscFECompositeGetMapping(PetscFE, PetscInt *, const PetscReal *[], const PetscReal *[], const PetscReal *[]);

    167: PETSC_EXTERN PetscErrorCode PetscFEOpenCLSetRealType(PetscFE, PetscDataType);
    168: PETSC_EXTERN PetscErrorCode PetscFEOpenCLGetRealType(PetscFE, PetscDataType *);

    170: #endif