Actual source code: dlregisdmdm.c

  1: #include <petscao.h>
  2: #include <petsc/private/dmlabelimpl.h>
  3: #include <petsc/private/dmfieldimpl.h>
  4: #include <petsc/private/dmpleximpl.h>
  5: #include <petsc/private/dmplextransformimpl.h>
  6: #include <petsc/private/petscdsimpl.h>
  7: #include <petsc/private/petscfeimpl.h>
  8: #include <petsc/private/petscfvimpl.h>
  9: #include <petsc/private/dmswarmimpl.h>
 10: #include <petsc/private/dmnetworkimpl.h>

 12: static PetscBool DMPackageInitialized = PETSC_FALSE;
 13: /*@C
 14:   DMFinalizePackage - This function finalizes everything in the `DM` package. It is called
 15:   from `PetscFinalize()`.

 17:   Level: developer

 19: .seealso: `PetscInitialize()`
 20: @*/
 21: PetscErrorCode DMFinalizePackage(void)
 22: {
 23:   PetscFunctionBegin;
 24:   PetscCall(PetscFunctionListDestroy(&DMList));
 25:   DMPackageInitialized = PETSC_FALSE;
 26:   DMRegisterAllCalled  = PETSC_FALSE;
 27:   PetscFunctionReturn(PETSC_SUCCESS);
 28: }

 30: #if defined(PETSC_HAVE_HYPRE)
 31: PETSC_EXTERN PetscErrorCode MatCreate_HYPREStruct(Mat);
 32: PETSC_EXTERN PetscErrorCode MatCreate_HYPRESStruct(Mat);
 33: #endif

 35: /*@C
 36:   DMInitializePackage - This function initializes everything in the `DM` package. It is called
 37:   from `PetscDLLibraryRegister_petscdm()` when using dynamic libraries, and on the first call to `DMCreate()`
 38:   or `DMDACreate()` when using shared or static libraries.

 40:   Level: developer

 42: .seealso: `PetscInitialize()`
 43: @*/
 44: PetscErrorCode DMInitializePackage(void)
 45: {
 46:   char      logList[256];
 47:   PetscBool opt, pkg;

 49:   PetscFunctionBegin;
 50:   if (DMPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
 51:   DMPackageInitialized = PETSC_TRUE;

 53:   /* Register Classes */
 54:   PetscCall(PetscClassIdRegister("Distributed Mesh", &DM_CLASSID));
 55:   PetscCall(PetscClassIdRegister("DM Label", &DMLABEL_CLASSID));
 56:   PetscCall(PetscClassIdRegister("Quadrature", &PETSCQUADRATURE_CLASSID));
 57:   PetscCall(PetscClassIdRegister("Mesh Transform", &DMPLEXTRANSFORM_CLASSID));

 59: #if defined(PETSC_HAVE_HYPRE)
 60:   PetscCall(MatRegister(MATHYPRESTRUCT, MatCreate_HYPREStruct));
 61:   PetscCall(MatRegister(MATHYPRESSTRUCT, MatCreate_HYPRESStruct));
 62: #endif
 63:   PetscCall(PetscSectionSymRegister(PETSCSECTIONSYMLABEL, PetscSectionSymCreate_Label));

 65:   /* Register Constructors */
 66:   PetscCall(DMRegisterAll());
 67:   /* Register Events */
 68:   PetscCall(PetscLogEventRegister("DMConvert", DM_CLASSID, &DM_Convert));
 69:   PetscCall(PetscLogEventRegister("DMGlobalToLocal", DM_CLASSID, &DM_GlobalToLocal));
 70:   PetscCall(PetscLogEventRegister("DMLocalToGlobal", DM_CLASSID, &DM_LocalToGlobal));
 71:   PetscCall(PetscLogEventRegister("DMLocatePoints", DM_CLASSID, &DM_LocatePoints));
 72:   PetscCall(PetscLogEventRegister("DMCoarsen", DM_CLASSID, &DM_Coarsen));
 73:   PetscCall(PetscLogEventRegister("DMRefine", DM_CLASSID, &DM_Refine));
 74:   PetscCall(PetscLogEventRegister("DMCreateInterp", DM_CLASSID, &DM_CreateInterpolation));
 75:   PetscCall(PetscLogEventRegister("DMCreateRestrict", DM_CLASSID, &DM_CreateRestriction));
 76:   PetscCall(PetscLogEventRegister("DMCreateInject", DM_CLASSID, &DM_CreateInjection));
 77:   PetscCall(PetscLogEventRegister("DMCreateMat", DM_CLASSID, &DM_CreateMatrix));
 78:   PetscCall(PetscLogEventRegister("DMCreateMassMat", DM_CLASSID, &DM_CreateMassMatrix));
 79:   PetscCall(PetscLogEventRegister("DMLoad", DM_CLASSID, &DM_Load));
 80:   PetscCall(PetscLogEventRegister("DMAdaptInterp", DM_CLASSID, &DM_AdaptInterpolator));
 81:   PetscCall(PetscLogEventRegister("DMProjectFunc", DM_CLASSID, &DM_ProjectFunction));

 83:   PetscCall(PetscLogEventRegister("DMPlexBuFrCeLi", DM_CLASSID, &DMPLEX_BuildFromCellList));
 84:   PetscCall(PetscLogEventRegister("DMPlexBuCoFrCeLi", DM_CLASSID, &DMPLEX_BuildCoordinatesFromCellList));
 85:   PetscCall(PetscLogEventRegister("DMPlexCreateGmsh", DM_CLASSID, &DMPLEX_CreateGmsh));
 86:   PetscCall(PetscLogEventRegister("DMPlexCrFromFile", DM_CLASSID, &DMPLEX_CreateFromFile));
 87:   PetscCall(PetscLogEventRegister("DMPlexCrFromOpts", DM_CLASSID, &DMPLEX_CreateFromOptions));
 88:   PetscCall(PetscLogEventRegister("Mesh Partition", DM_CLASSID, &DMPLEX_Partition));
 89:   PetscCall(PetscLogEventRegister("Mesh Migration", DM_CLASSID, &DMPLEX_Migrate));
 90:   PetscCall(PetscLogEventRegister("DMPlexPartSelf", DM_CLASSID, &DMPLEX_PartSelf));
 91:   PetscCall(PetscLogEventRegister("DMPlexPartLblInv", DM_CLASSID, &DMPLEX_PartLabelInvert));
 92:   PetscCall(PetscLogEventRegister("DMPlexPartLblSF", DM_CLASSID, &DMPLEX_PartLabelCreateSF));
 93:   PetscCall(PetscLogEventRegister("DMPlexPartStrtSF", DM_CLASSID, &DMPLEX_PartStratSF));
 94:   PetscCall(PetscLogEventRegister("DMPlexPointSF", DM_CLASSID, &DMPLEX_CreatePointSF));
 95:   PetscCall(PetscLogEventRegister("DMPlexInterp", DM_CLASSID, &DMPLEX_Interpolate));
 96:   PetscCall(PetscLogEventRegister("DMPlexDistribute", DM_CLASSID, &DMPLEX_Distribute));
 97:   PetscCall(PetscLogEventRegister("DMPlexDistCones", DM_CLASSID, &DMPLEX_DistributeCones));
 98:   PetscCall(PetscLogEventRegister("DMPlexDistLabels", DM_CLASSID, &DMPLEX_DistributeLabels));
 99:   PetscCall(PetscLogEventRegister("DMPlexDistSF", DM_CLASSID, &DMPLEX_DistributeSF));
100:   PetscCall(PetscLogEventRegister("DMPlexDistOvrlp", DM_CLASSID, &DMPLEX_DistributeOverlap));
101:   PetscCall(PetscLogEventRegister("DMPlexDistField", DM_CLASSID, &DMPLEX_DistributeField));
102:   PetscCall(PetscLogEventRegister("DMPlexDistData", DM_CLASSID, &DMPLEX_DistributeData));
103:   PetscCall(PetscLogEventRegister("DMPlexInterpSF", DM_CLASSID, &DMPLEX_InterpolateSF));
104:   PetscCall(PetscLogEventRegister("DMPlexGToNBegin", DM_CLASSID, &DMPLEX_GlobalToNaturalBegin));
105:   PetscCall(PetscLogEventRegister("DMPlexGToNEnd", DM_CLASSID, &DMPLEX_GlobalToNaturalEnd));
106:   PetscCall(PetscLogEventRegister("DMPlexNToGBegin", DM_CLASSID, &DMPLEX_NaturalToGlobalBegin));
107:   PetscCall(PetscLogEventRegister("DMPlexNToGEnd", DM_CLASSID, &DMPLEX_NaturalToGlobalEnd));
108:   PetscCall(PetscLogEventRegister("DMPlexStratify", DM_CLASSID, &DMPLEX_Stratify));
109:   PetscCall(PetscLogEventRegister("DMPlexSymmetrize", DM_CLASSID, &DMPLEX_Symmetrize));
110:   PetscCall(PetscLogEventRegister("DMPlexPrealloc", DM_CLASSID, &DMPLEX_Preallocate));
111:   PetscCall(PetscLogEventRegister("DMPlexResidualFE", DM_CLASSID, &DMPLEX_ResidualFEM));
112:   PetscCall(PetscLogEventRegister("DMPlexJacobianFE", DM_CLASSID, &DMPLEX_JacobianFEM));
113:   PetscCall(PetscLogEventRegister("DMPlexInterpFE", DM_CLASSID, &DMPLEX_InterpolatorFEM));
114:   PetscCall(PetscLogEventRegister("DMPlexInjectorFE", DM_CLASSID, &DMPLEX_InjectorFEM));
115:   PetscCall(PetscLogEventRegister("DMPlexIntegralFEM", DM_CLASSID, &DMPLEX_IntegralFEM));
116:   PetscCall(PetscLogEventRegister("DMPlexRebalance", DM_CLASSID, &DMPLEX_RebalanceSharedPoints));
117:   PetscCall(PetscLogEventRegister("DMPlexLocatePoints", DM_CLASSID, &DMPLEX_LocatePoints));
118:   PetscCall(PetscLogEventRegister("DMPlexTopologyView", DM_CLASSID, &DMPLEX_TopologyView));
119:   PetscCall(PetscLogEventRegister("DMPlexDistributionView", DM_CLASSID, &DMPLEX_DistributionView));
120:   PetscCall(PetscLogEventRegister("DMPlexLabelsView", DM_CLASSID, &DMPLEX_LabelsView));
121:   PetscCall(PetscLogEventRegister("DMPlexCoordinatesView", DM_CLASSID, &DMPLEX_CoordinatesView));
122:   PetscCall(PetscLogEventRegister("DMPlexSectionView", DM_CLASSID, &DMPLEX_SectionView));
123:   PetscCall(PetscLogEventRegister("DMPlexGlobalVectorView", DM_CLASSID, &DMPLEX_GlobalVectorView));
124:   PetscCall(PetscLogEventRegister("DMPlexLocalVectorView", DM_CLASSID, &DMPLEX_LocalVectorView));
125:   PetscCall(PetscLogEventRegister("DMPlexTopologyLoad", DM_CLASSID, &DMPLEX_TopologyLoad));
126:   PetscCall(PetscLogEventRegister("DMPlexDistributionLoad", DM_CLASSID, &DMPLEX_DistributionLoad));
127:   PetscCall(PetscLogEventRegister("DMPlexLabelsLoad", DM_CLASSID, &DMPLEX_LabelsLoad));
128:   PetscCall(PetscLogEventRegister("DMPlexCoordinatesLoad", DM_CLASSID, &DMPLEX_CoordinatesLoad));
129:   PetscCall(PetscLogEventRegister("DMPlexSectionLoad", DM_CLASSID, &DMPLEX_SectionLoad));
130:   PetscCall(PetscLogEventRegister("DMPlexGlobalVectorLoad", DM_CLASSID, &DMPLEX_GlobalVectorLoad));
131:   PetscCall(PetscLogEventRegister("DMPlexLocalVectorLoad", DM_CLASSID, &DMPLEX_LocalVectorLoad));
132:   PetscCall(PetscLogEventRegister("DMPlexMetricEnforceSPD", DM_CLASSID, &DMPLEX_MetricEnforceSPD));
133:   PetscCall(PetscLogEventRegister("DMPlexMetricNormalize", DM_CLASSID, &DMPLEX_MetricNormalize));
134:   PetscCall(PetscLogEventRegister("DMPlexMetricAverage", DM_CLASSID, &DMPLEX_MetricAverage));
135:   PetscCall(PetscLogEventRegister("DMPlexMetricIntersect", DM_CLASSID, &DMPLEX_MetricIntersection));
136:   PetscCall(PetscLogEventRegister("DMPlexGenerate", DM_CLASSID, &DMPLEX_Generate));
137:   PetscCall(PetscLogEventRegister("DMPlexTransform", DM_CLASSID, &DMPLEX_Transform));
138:   PetscCall(PetscLogEventRegister("DMPlexGetLocOff", DM_CLASSID, &DMPLEX_GetLocalOffsets));

140:   PetscCall(PetscLogEventRegister("RebalBuildGraph", DM_CLASSID, &DMPLEX_RebalBuildGraph));
141:   PetscCall(PetscLogEventRegister("RebalGatherGraph", DM_CLASSID, &DMPLEX_RebalGatherGraph));
142:   PetscCall(PetscLogEventRegister("RebalPartition", DM_CLASSID, &DMPLEX_RebalPartition));
143:   PetscCall(PetscLogEventRegister("RebalScatterPart", DM_CLASSID, &DMPLEX_RebalScatterPart));
144:   PetscCall(PetscLogEventRegister("RebalRewriteSF", DM_CLASSID, &DMPLEX_RebalRewriteSF));
145:   PetscCall(PetscLogEventRegister("DMPlexUninterp", DM_CLASSID, &DMPLEX_Uninterpolate));

147:   PetscCall(PetscLogEventRegister("DMSwarmMigrate", DM_CLASSID, &DMSWARM_Migrate));
148:   PetscCall(PetscLogEventRegister("DMSwarmDETSetup", DM_CLASSID, &DMSWARM_DataExchangerTopologySetup));
149:   PetscCall(PetscLogEventRegister("DMSwarmDExBegin", DM_CLASSID, &DMSWARM_DataExchangerBegin));
150:   PetscCall(PetscLogEventRegister("DMSwarmDExEnd", DM_CLASSID, &DMSWARM_DataExchangerEnd));
151:   PetscCall(PetscLogEventRegister("DMSwarmDESendCnt", DM_CLASSID, &DMSWARM_DataExchangerSendCount));
152:   PetscCall(PetscLogEventRegister("DMSwarmDEPack", DM_CLASSID, &DMSWARM_DataExchangerPack));
153:   PetscCall(PetscLogEventRegister("DMSwarmAddPnts", DM_CLASSID, &DMSWARM_AddPoints));
154:   PetscCall(PetscLogEventRegister("DMSwarmRmvPnts", DM_CLASSID, &DMSWARM_RemovePoints));
155:   PetscCall(PetscLogEventRegister("DMSwarmSort", DM_CLASSID, &DMSWARM_Sort));
156:   PetscCall(PetscLogEventRegister("DMSwarmSetSizes", DM_CLASSID, &DMSWARM_SetSizes));

158:   PetscCall(PetscLogEventRegister("DMNtLayoutSetUp", DM_CLASSID, &DMNetwork_LayoutSetUp));
159:   PetscCall(PetscLogEventRegister("DMNtSetUp", DM_CLASSID, &DMNetwork_SetUpNetwork));
160:   PetscCall(PetscLogEventRegister("DMNtDistribute", DM_CLASSID, &DMNetwork_Distribute));
161:   /* Process Info */
162:   {
163:     PetscClassId classids[1];

165:     classids[0] = DM_CLASSID;
166:     PetscCall(PetscInfoProcessClass("dm", 1, classids));
167:   }

169:   /* Process summary exclusions */
170:   PetscCall(PetscOptionsGetString(NULL, NULL, "-log_exclude", logList, sizeof(logList), &opt));
171:   if (opt) {
172:     PetscCall(PetscStrInList("dm", logList, ',', &pkg));
173:     if (pkg) PetscCall(PetscLogEventExcludeClass(DM_CLASSID));
174:   }

176:   PetscCall(DMGenerateRegisterAll());
177:   PetscCall(PetscRegisterFinalize(DMGenerateRegisterDestroy));
178:   PetscCall(DMPlexTransformRegisterAll());
179:   PetscCall(PetscRegisterFinalize(DMPlexTransformRegisterDestroy));
180:   PetscCall(DMLabelRegisterAll());
181:   PetscCall(PetscRegisterFinalize(DMLabelRegisterDestroy));
182:   PetscCall(PetscRegisterFinalize(DMFinalizePackage));
183:   PetscFunctionReturn(PETSC_SUCCESS);
184: }
185: #include <petscfe.h>

187: static PetscBool PetscFEPackageInitialized = PETSC_FALSE;

189: /*@C
190:   PetscFEFinalizePackage - This function finalizes everything in the `PetscFE` package. It is called
191:   from `PetscFinalize()`.

193:   Level: developer

195: .seealso: `PetscInitialize()`
196: @*/
197: PetscErrorCode PetscFEFinalizePackage(void)
198: {
199:   PetscFunctionBegin;
200:   PetscCall(PetscFunctionListDestroy(&PetscSpaceList));
201:   PetscCall(PetscFunctionListDestroy(&PetscDualSpaceList));
202:   PetscCall(PetscFunctionListDestroy(&PetscFEList));
203:   PetscFEPackageInitialized       = PETSC_FALSE;
204:   PetscSpaceRegisterAllCalled     = PETSC_FALSE;
205:   PetscDualSpaceRegisterAllCalled = PETSC_FALSE;
206:   PetscFERegisterAllCalled        = PETSC_FALSE;
207:   PetscFunctionReturn(PETSC_SUCCESS);
208: }

210: /*@C
211:   PetscFEInitializePackage - This function initializes everything in the `PetscFE` package. It is called
212:   from `PetscDLLibraryRegister()` when using dynamic libraries, and on the first call to `PetscSpaceCreate()`
213:   when using static libraries.

215:   Level: developer

217: .seealso: `PetscInitialize()`
218: @*/
219: PetscErrorCode PetscFEInitializePackage(void)
220: {
221:   char      logList[256];
222:   PetscBool opt, pkg;

224:   PetscFunctionBegin;
225:   if (PetscFEPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
226:   PetscFEPackageInitialized = PETSC_TRUE;

228:   /* Register Classes */
229:   PetscCall(PetscClassIdRegister("Linear Space", &PETSCSPACE_CLASSID));
230:   PetscCall(PetscClassIdRegister("Dual Space", &PETSCDUALSPACE_CLASSID));
231:   PetscCall(PetscClassIdRegister("FE Space", &PETSCFE_CLASSID));
232:   /* Register Constructors */
233:   PetscCall(PetscSpaceRegisterAll());
234:   PetscCall(PetscDualSpaceRegisterAll());
235:   PetscCall(PetscFERegisterAll());
236:   /* Register Events */
237:   PetscCall(PetscLogEventRegister("DualSpaceSetUp", PETSCDUALSPACE_CLASSID, &PETSCDUALSPACE_SetUp));
238:   PetscCall(PetscLogEventRegister("FESetUp", PETSCFE_CLASSID, &PETSCFE_SetUp));
239:   /* Process Info */
240:   {
241:     PetscClassId classids[3];

243:     classids[0] = PETSCFE_CLASSID;
244:     classids[1] = PETSCSPACE_CLASSID;
245:     classids[2] = PETSCDUALSPACE_CLASSID;
246:     PetscCall(PetscInfoProcessClass("fe", 1, classids));
247:     PetscCall(PetscInfoProcessClass("space", 1, &classids[1]));
248:     PetscCall(PetscInfoProcessClass("dualspace", 1, &classids[2]));
249:   }
250:   /* Process summary exclusions */
251:   PetscCall(PetscOptionsGetString(NULL, NULL, "-log_exclude", logList, sizeof(logList), &opt));
252:   if (opt) {
253:     PetscCall(PetscStrInList("fe", logList, ',', &pkg));
254:     if (pkg) PetscCall(PetscLogEventExcludeClass(PETSCFE_CLASSID));
255:   }
256:   /* Register package finalizer */
257:   PetscCall(PetscRegisterFinalize(PetscFEFinalizePackage));
258:   PetscFunctionReturn(PETSC_SUCCESS);
259: }
260: #include <petscfv.h>

262: static PetscBool PetscFVPackageInitialized = PETSC_FALSE;

264: /*@C
265:   PetscFVFinalizePackage - This function finalizes everything in the `PetscFV` package. It is called
266:   from `PetscFinalize()`.

268:   Level: developer

270: .seealso: `PetscInitialize()`
271: @*/
272: PetscErrorCode PetscFVFinalizePackage(void)
273: {
274:   PetscFunctionBegin;
275:   PetscCall(PetscFunctionListDestroy(&PetscLimiterList));
276:   PetscCall(PetscFunctionListDestroy(&PetscFVList));
277:   PetscFVPackageInitialized     = PETSC_FALSE;
278:   PetscFVRegisterAllCalled      = PETSC_FALSE;
279:   PetscLimiterRegisterAllCalled = PETSC_FALSE;
280:   PetscFunctionReturn(PETSC_SUCCESS);
281: }

283: /*@C
284:   PetscFVInitializePackage - This function initializes everything in the `PetscFV` package. It is called
285:   from `PetscDLLibraryRegister()` when using dynamic libraries, and on the first call to `PetscFVCreate()`
286:   when using static libraries.

288:   Level: developer

290: .seealso: `PetscInitialize()`
291: @*/
292: PetscErrorCode PetscFVInitializePackage(void)
293: {
294:   char      logList[256];
295:   PetscBool opt, pkg;

297:   PetscFunctionBegin;
298:   if (PetscFVPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
299:   PetscFVPackageInitialized = PETSC_TRUE;

301:   /* Register Classes */
302:   PetscCall(PetscClassIdRegister("FV Space", &PETSCFV_CLASSID));
303:   PetscCall(PetscClassIdRegister("Limiter", &PETSCLIMITER_CLASSID));
304:   /* Register Constructors */
305:   PetscCall(PetscFVRegisterAll());
306:   /* Register Events */
307:   /* Process Info */
308:   {
309:     PetscClassId classids[2];

311:     classids[0] = PETSCFV_CLASSID;
312:     classids[1] = PETSCLIMITER_CLASSID;
313:     PetscCall(PetscInfoProcessClass("fv", 1, classids));
314:     PetscCall(PetscInfoProcessClass("limiter", 1, &classids[1]));
315:   }
316:   /* Process summary exclusions */
317:   PetscCall(PetscOptionsGetString(NULL, NULL, "-log_exclude", logList, sizeof(logList), &opt));
318:   if (opt) {
319:     PetscCall(PetscStrInList("fv", logList, ',', &pkg));
320:     if (pkg) PetscCall(PetscLogEventExcludeClass(PETSCFV_CLASSID));
321:     PetscCall(PetscStrInList("limiter", logList, ',', &pkg));
322:     if (pkg) PetscCall(PetscLogEventExcludeClass(PETSCLIMITER_CLASSID));
323:   }
324:   /* Register package finalizer */
325:   PetscCall(PetscRegisterFinalize(PetscFVFinalizePackage));
326:   PetscFunctionReturn(PETSC_SUCCESS);
327: }
328: #include <petscds.h>

330: static PetscBool PetscDSPackageInitialized = PETSC_FALSE;

332: /*@C
333:   PetscDSFinalizePackage - This function finalizes everything in the `PetscDS` package. It is called
334:   from `PetscFinalize()`.

336:   Level: developer

338: .seealso: `PetscInitialize()`
339: @*/
340: PetscErrorCode PetscDSFinalizePackage(void)
341: {
342:   PetscFunctionBegin;
343:   PetscCall(PetscFunctionListDestroy(&PetscDSList));
344:   PetscDSPackageInitialized = PETSC_FALSE;
345:   PetscDSRegisterAllCalled  = PETSC_FALSE;
346:   PetscFunctionReturn(PETSC_SUCCESS);
347: }

349: /*@C
350:   PetscDSInitializePackage - This function initializes everything in the `PetscDS` package. It is called
351:   from `PetscDLLibraryRegister()` when using dynamic libraries, and on the first call to `PetscDSCreate()`
352:   when using static libraries.

354:   Level: developer

356: .seealso: `PetscInitialize()`
357: @*/
358: PetscErrorCode PetscDSInitializePackage(void)
359: {
360:   char      logList[256];
361:   PetscBool opt, pkg;

363:   PetscFunctionBegin;
364:   if (PetscDSPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
365:   PetscDSPackageInitialized = PETSC_TRUE;

367:   /* Register Classes */
368:   PetscCall(PetscClassIdRegister("Discrete System", &PETSCDS_CLASSID));
369:   PetscCall(PetscClassIdRegister("Weak Form", &PETSCWEAKFORM_CLASSID));
370:   /* Register Constructors */
371:   PetscCall(PetscDSRegisterAll());
372:   /* Register Events */
373:   /* Process Info */
374:   {
375:     PetscClassId classids[1];

377:     classids[0] = PETSCDS_CLASSID;
378:     PetscCall(PetscInfoProcessClass("ds", 1, classids));
379:   }
380:   /* Process summary exclusions */
381:   PetscCall(PetscOptionsGetString(NULL, NULL, "-log_exclude", logList, sizeof(logList), &opt));
382:   if (opt) {
383:     PetscCall(PetscStrInList("ds", logList, ',', &pkg));
384:     if (pkg) PetscCall(PetscLogEventExcludeClass(PETSCDS_CLASSID));
385:   }
386:   /* Register package finalizer */
387:   PetscCall(PetscRegisterFinalize(PetscDSFinalizePackage));
388:   PetscFunctionReturn(PETSC_SUCCESS);
389: }

391: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
392: /*
393:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

395:   This one registers all the mesh generators and partitioners that are in
396:   the basic DM library.

398: */
399: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscdm(void)
400: {
401:   PetscFunctionBegin;
402:   PetscCall(AOInitializePackage());
403:   PetscCall(PetscPartitionerInitializePackage());
404:   PetscCall(DMInitializePackage());
405:   PetscCall(PetscFEInitializePackage());
406:   PetscCall(PetscFVInitializePackage());
407:   PetscCall(DMFieldInitializePackage());
408:   PetscCall(PetscDSInitializePackage());
409:   PetscFunctionReturn(PETSC_SUCCESS);
410: }

412: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */