Actual source code: dmregall.c

      1: #include <petscdm.h>
      2: #include <petscdmplex.h>
      3: #include <petsc/private/dmimpl.h>
      4: #include <petsc/private/dmpleximpl.h>
      5: #include <petsc/private/petscfeimpl.h>
      6: #include <petsc/private/petscfvimpl.h>
      7: #include <petsc/private/petscdsimpl.h>
      8: PETSC_EXTERN PetscErrorCode DMCreate_DA(DM);
      9: PETSC_EXTERN PetscErrorCode DMCreate_Composite(DM);
     10: PETSC_EXTERN PetscErrorCode DMCreate_Sliced(DM);
     11: PETSC_EXTERN PetscErrorCode DMCreate_Shell(DM);
     12: PETSC_EXTERN PetscErrorCode DMCreate_Redundant(DM);
     13: PETSC_EXTERN PetscErrorCode DMCreate_Plex(DM);
     14: PETSC_EXTERN PetscErrorCode DMCreate_Patch(DM);
     15: PETSC_EXTERN PetscErrorCode DMCreate_Swarm(DM);
     16: #if defined(PETSC_HAVE_MOAB)
     17: PETSC_EXTERN PetscErrorCode DMCreate_Moab(DM);
     18: #endif
     19: PETSC_EXTERN PetscErrorCode DMCreate_Network(DM);
     20: PETSC_EXTERN PetscErrorCode DMCreate_Forest(DM);
     21: #if defined(PETSC_HAVE_P4EST)
     22: PETSC_EXTERN PetscErrorCode DMCreate_p4est(DM);
     23: PETSC_EXTERN PetscErrorCode DMCreate_p8est(DM);
     24: #endif
     25: PETSC_EXTERN PetscErrorCode DMCreate_Product(DM);
     26: PETSC_EXTERN PetscErrorCode DMCreate_Stag(DM);

     28: /*@C
     29:   DMRegisterAll - Registers all of the DM components in the DM package.

     31:   Not Collective

     33:   Level: advanced

     35: .seealso: `DMRegister()`, `DMRegisterDestroy()`
     36: @*/
     37: PetscErrorCode DMRegisterAll(void)
     38: {
     39:   PetscFunctionBegin;
     40:   if (DMRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     41:   DMRegisterAllCalled = PETSC_TRUE;

     43:   PetscCall(DMRegister(DMDA, DMCreate_DA));
     44:   PetscCall(DMRegister(DMCOMPOSITE, DMCreate_Composite));
     45:   PetscCall(DMRegister(DMSLICED, DMCreate_Sliced));
     46:   PetscCall(DMRegister(DMSHELL, DMCreate_Shell));
     47:   PetscCall(DMRegister(DMREDUNDANT, DMCreate_Redundant));
     48:   PetscCall(DMRegister(DMPLEX, DMCreate_Plex));
     49:   PetscCall(DMRegister(DMPATCH, DMCreate_Patch));
     50:   PetscCall(DMRegister(DMSWARM, DMCreate_Swarm));
     51: #if defined(PETSC_HAVE_MOAB)
     52:   PetscCall(DMRegister(DMMOAB, DMCreate_Moab));
     53: #endif
     54:   PetscCall(DMRegister(DMNETWORK, DMCreate_Network));
     55:   PetscCall(DMRegister(DMFOREST, DMCreate_Forest));
     56: #if defined(PETSC_HAVE_P4EST)
     57:   PetscCall(DMRegister(DMP4EST, DMCreate_p4est));
     58:   PetscCall(DMRegister(DMP8EST, DMCreate_p8est));
     59: #endif
     60:   PetscCall(DMRegister(DMPRODUCT, DMCreate_Product));
     61:   PetscCall(DMRegister(DMSTAG, DMCreate_Stag));
     62:   PetscFunctionReturn(PETSC_SUCCESS);
     63: }

     65: #include <petscfe.h>

     67: PETSC_EXTERN PetscErrorCode PetscSpaceCreate_Polynomial(PetscSpace);
     68: PETSC_EXTERN PetscErrorCode PetscSpaceCreate_Ptrimmed(PetscSpace);
     69: PETSC_EXTERN PetscErrorCode PetscSpaceCreate_Tensor(PetscSpace);
     70: PETSC_EXTERN PetscErrorCode PetscSpaceCreate_Sum(PetscSpace);
     71: PETSC_EXTERN PetscErrorCode PetscSpaceCreate_Point(PetscSpace);
     72: PETSC_EXTERN PetscErrorCode PetscSpaceCreate_Subspace(PetscSpace);
     73: PETSC_EXTERN PetscErrorCode PetscSpaceCreate_WXY(PetscSpace);

     75: /*@C
     76:   PetscSpaceRegisterAll - Registers all of the PetscSpace components in the PetscFE package.

     78:   Not Collective

     80:   Level: advanced

     82: .seealso: `PetscSpaceRegister()`, `PetscSpaceRegisterDestroy()`
     83: @*/
     84: PetscErrorCode PetscSpaceRegisterAll(void)
     85: {
     86:   PetscFunctionBegin;
     87:   if (PetscSpaceRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
     88:   PetscSpaceRegisterAllCalled = PETSC_TRUE;

     90:   PetscCall(PetscSpaceRegister(PETSCSPACEPOLYNOMIAL, PetscSpaceCreate_Polynomial));
     91:   PetscCall(PetscSpaceRegister(PETSCSPACEPTRIMMED, PetscSpaceCreate_Ptrimmed));
     92:   PetscCall(PetscSpaceRegister(PETSCSPACETENSOR, PetscSpaceCreate_Tensor));
     93:   PetscCall(PetscSpaceRegister(PETSCSPACESUM, PetscSpaceCreate_Sum));
     94:   PetscCall(PetscSpaceRegister(PETSCSPACEPOINT, PetscSpaceCreate_Point));
     95:   PetscCall(PetscSpaceRegister(PETSCSPACESUBSPACE, PetscSpaceCreate_Subspace));
     96:   PetscCall(PetscSpaceRegister(PETSCSPACEWXY, PetscSpaceCreate_WXY));
     97:   PetscFunctionReturn(PETSC_SUCCESS);
     98: }

    100: PETSC_EXTERN PetscErrorCode PetscDualSpaceCreate_Lagrange(PetscDualSpace);
    101: PETSC_EXTERN PetscErrorCode PetscDualSpaceCreate_Lagrange_BDM(PetscDualSpace);
    102: PETSC_EXTERN PetscErrorCode PetscDualSpaceCreate_Simple(PetscDualSpace);
    103: PETSC_EXTERN PetscErrorCode PetscDualSpaceCreate_Refined(PetscDualSpace);
    104: PETSC_EXTERN PetscErrorCode PetscDualSpaceCreate_Sum(PetscDualSpace);

    106: /*@C
    107:   PetscDualSpaceRegisterAll - Registers all of the PetscDualSpace components in the PetscFE package.

    109:   Not Collective

    111:   Level: advanced

    113: .seealso: `PetscDualSpaceRegister()`, `PetscDualSpaceRegisterDestroy()`
    114: @*/
    115: PetscErrorCode PetscDualSpaceRegisterAll(void)
    116: {
    117:   PetscFunctionBegin;
    118:   if (PetscDualSpaceRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
    119:   PetscDualSpaceRegisterAllCalled = PETSC_TRUE;

    121:   PetscCall(PetscDualSpaceRegister(PETSCDUALSPACELAGRANGE, PetscDualSpaceCreate_Lagrange));
    122:   PetscCall(PetscDualSpaceRegister(PETSCDUALSPACEBDM, PetscDualSpaceCreate_Lagrange));
    123:   PetscCall(PetscDualSpaceRegister(PETSCDUALSPACESIMPLE, PetscDualSpaceCreate_Simple));
    124:   PetscCall(PetscDualSpaceRegister(PETSCDUALSPACEREFINED, PetscDualSpaceCreate_Refined));
    125:   PetscCall(PetscDualSpaceRegister(PETSCDUALSPACESUM, PetscDualSpaceCreate_Sum));
    126:   PetscFunctionReturn(PETSC_SUCCESS);
    127: }

    129: PETSC_EXTERN PetscErrorCode PetscFECreate_Basic(PetscFE);
    130: PETSC_EXTERN PetscErrorCode PetscFECreate_Nonaffine(PetscFE);
    131: PETSC_EXTERN PetscErrorCode PetscFECreate_Composite(PetscFE);
    132: #if defined(PETSC_HAVE_OPENCL)
    133: PETSC_EXTERN PetscErrorCode PetscFECreate_OpenCL(PetscFE);
    134: #endif
    135: PETSC_EXTERN PetscErrorCode PetscFECreate_Vector(PetscFE);

    137: /*@C
    138:   PetscFERegisterAll - Registers all of the PetscFE components in the `PetscFE` package.

    140:   Not Collective

    142:   Level: advanced

    144: .seealso: `PetscFERegister()`, `PetscFERegisterDestroy()`
    145: @*/
    146: PetscErrorCode PetscFERegisterAll(void)
    147: {
    148:   PetscFunctionBegin;
    149:   if (PetscFERegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
    150:   PetscFERegisterAllCalled = PETSC_TRUE;

    152:   PetscCall(PetscFERegister(PETSCFEBASIC, PetscFECreate_Basic));
    153:   PetscCall(PetscFERegister(PETSCFECOMPOSITE, PetscFECreate_Composite));
    154: #if defined(PETSC_HAVE_OPENCL)
    155:   PetscCall(PetscFERegister(PETSCFEOPENCL, PetscFECreate_OpenCL));
    156: #endif
    157:   PetscCall(PetscFERegister(PETSCFEVECTOR, PetscFECreate_Vector));
    158:   PetscFunctionReturn(PETSC_SUCCESS);
    159: }
    160: #include <petscfv.h>

    162: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_Sin(PetscLimiter);
    163: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_Zero(PetscLimiter);
    164: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_None(PetscLimiter);
    165: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_Minmod(PetscLimiter);
    166: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_VanLeer(PetscLimiter);
    167: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_VanAlbada(PetscLimiter);
    168: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_Superbee(PetscLimiter);
    169: PETSC_EXTERN PetscErrorCode PetscLimiterCreate_MC(PetscLimiter);

    171: /*@C
    172:   PetscLimiterRegisterAll - Registers all of the `PetscLimiter` components in the `PetscFV` package.

    174:   Not Collective

    176:   Level: advanced

    178: .seealso: `PetscLimiterRegister()`, `PetscLimiterRegisterDestroy()`
    179: @*/
    180: PetscErrorCode PetscLimiterRegisterAll(void)
    181: {
    182:   PetscFunctionBegin;
    183:   if (PetscLimiterRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
    184:   PetscLimiterRegisterAllCalled = PETSC_TRUE;

    186:   PetscCall(PetscLimiterRegister(PETSCLIMITERSIN, PetscLimiterCreate_Sin));
    187:   PetscCall(PetscLimiterRegister(PETSCLIMITERZERO, PetscLimiterCreate_Zero));
    188:   PetscCall(PetscLimiterRegister(PETSCLIMITERNONE, PetscLimiterCreate_None));
    189:   PetscCall(PetscLimiterRegister(PETSCLIMITERMINMOD, PetscLimiterCreate_Minmod));
    190:   PetscCall(PetscLimiterRegister(PETSCLIMITERVANLEER, PetscLimiterCreate_VanLeer));
    191:   PetscCall(PetscLimiterRegister(PETSCLIMITERVANALBADA, PetscLimiterCreate_VanAlbada));
    192:   PetscCall(PetscLimiterRegister(PETSCLIMITERSUPERBEE, PetscLimiterCreate_Superbee));
    193:   PetscCall(PetscLimiterRegister(PETSCLIMITERMC, PetscLimiterCreate_MC));
    194:   PetscFunctionReturn(PETSC_SUCCESS);
    195: }

    197: PETSC_EXTERN PetscErrorCode PetscFVCreate_Upwind(PetscFV);
    198: PETSC_EXTERN PetscErrorCode PetscFVCreate_LeastSquares(PetscFV);

    200: /*@C
    201:   PetscFVRegisterAll - Registers all of the `PetscFV` components in the `PetscFV` package.

    203:   Not Collective

    205:   Level: advanced

    207: .seealso: `PetscFVRegister()`, `PetscFVRegisterDestroy()`
    208: @*/
    209: PetscErrorCode PetscFVRegisterAll(void)
    210: {
    211:   PetscFunctionBegin;
    212:   if (PetscFVRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
    213:   PetscFVRegisterAllCalled = PETSC_TRUE;

    215:   PetscCall(PetscFVRegister(PETSCFVUPWIND, PetscFVCreate_Upwind));
    216:   PetscCall(PetscFVRegister(PETSCFVLEASTSQUARES, PetscFVCreate_LeastSquares));
    217:   PetscFunctionReturn(PETSC_SUCCESS);
    218: }
    219: #include <petscds.h>

    221: PETSC_EXTERN PetscErrorCode PetscDSCreate_Basic(PetscDS);

    223: /*@C
    224:   PetscDSRegisterAll - Registers all of the `PetscDS` components in the `PetscDS` package.

    226:   Not Collective

    228:   Level: advanced

    230: .seealso: `PetscDSRegister()`, `PetscDSRegisterDestroy()`
    231: @*/
    232: PetscErrorCode PetscDSRegisterAll(void)
    233: {
    234:   PetscFunctionBegin;
    235:   if (PetscDSRegisterAllCalled) PetscFunctionReturn(PETSC_SUCCESS);
    236:   PetscDSRegisterAllCalled = PETSC_TRUE;

    238:   PetscCall(PetscDSRegister(PETSCDSBASIC, PetscDSCreate_Basic));
    239:   PetscFunctionReturn(PETSC_SUCCESS);
    240: }