Actual source code: dlregisdmdm.c

petsc-3.5.4 2015-05-23
Report Typos and Errors
  2: #include <petsc-private/dmdaimpl.h>
  3: #include <petsc-private/dmpleximpl.h>

  5: static PetscBool DMPackageInitialized = PETSC_FALSE;
  8: /*@C
  9:   DMFinalizePackage - This function finalizes everything in the DM package. It is called
 10:   from PetscFinalize().

 12:   Level: developer

 14: .keywords: AO, initialize, package
 15: .seealso: PetscInitialize()
 16: @*/
 17: PetscErrorCode  DMFinalizePackage(void)
 18: {

 22:   PetscFunctionListDestroy(&DMList);
 23:   DMPackageInitialized = PETSC_FALSE;
 24:   DMRegisterAllCalled  = PETSC_FALSE;
 25:   return(0);
 26: }

 28: #if defined(PETSC_HAVE_HYPRE)
 29: PETSC_EXTERN PetscErrorCode MatCreate_HYPREStruct(Mat);
 30: #endif

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

 39:   Level: developer

 41: .keywords: AO, initialize, package
 42: .seealso: PetscInitialize()
 43: @*/
 44: PetscErrorCode  DMInitializePackage(void)
 45: {
 46:   char           logList[256];
 47:   char           *className;
 48:   PetscBool      opt;

 52:   if (DMPackageInitialized) return(0);
 53:   DMPackageInitialized = PETSC_TRUE;

 55:   /* Register Classes */
 56:   PetscClassIdRegister("Distributed Mesh",&DM_CLASSID);

 58: #if defined(PETSC_HAVE_HYPRE)
 59:   MatRegister(MATHYPRESTRUCT, MatCreate_HYPREStruct);
 60: #endif

 62:   /* Register Constructors */
 63:   DMRegisterAll();
 64:   /* Register Events */
 65:   PetscLogEventRegister("DMConvert",              DM_CLASSID,&DM_Convert);
 66:   PetscLogEventRegister("DMGlobalToLocal",        DM_CLASSID,&DM_GlobalToLocal);
 67:   PetscLogEventRegister("DMLocalToGlobal",        DM_CLASSID,&DM_LocalToGlobal);

 69:   PetscLogEventRegister("DMDALocalADFunc",        DM_CLASSID,&DMDA_LocalADFunction);

 71:   PetscLogEventRegister("DMPlexInterp",           DM_CLASSID,&DMPLEX_Interpolate);
 72:   PetscLogEventRegister("DMPlexPartition",        DM_CLASSID,&DMPLEX_Partition);
 73:   PetscLogEventRegister("DMPlexDistribute",       DM_CLASSID,&DMPLEX_Distribute);
 74:   PetscLogEventRegister("DMPlexDistCones",        DM_CLASSID,&DMPLEX_DistributeCones);
 75:   PetscLogEventRegister("DMPlexDistLabels",       DM_CLASSID,&DMPLEX_DistributeLabels);
 76:   PetscLogEventRegister("DMPlexDistribSF",        DM_CLASSID,&DMPLEX_DistributeSF);
 77:   PetscLogEventRegister("DMPlexDistField",        DM_CLASSID,&DMPLEX_DistributeField);
 78:   PetscLogEventRegister("DMPlexDistData",         DM_CLASSID,&DMPLEX_DistributeData);
 79:   PetscLogEventRegister("DMPlexStratify",         DM_CLASSID,&DMPLEX_Stratify);
 80:   PetscLogEventRegister("DMPlexPrealloc",         DM_CLASSID,&DMPLEX_Preallocate);
 81:   PetscLogEventRegister("DMPlexResidualFE",       DM_CLASSID,&DMPLEX_ResidualFEM);
 82:   PetscLogEventRegister("DMPlexJacobianFE",       DM_CLASSID,&DMPLEX_JacobianFEM);
 83:   PetscLogEventRegister("DMPlexInterpFE",         DM_CLASSID,&DMPLEX_InterpolatorFEM);
 84:   PetscLogEventRegister("DMPlexInjectorFE",       DM_CLASSID,&DMPLEX_InjectorFEM);
 85:   /* Process info exclusions */
 86:   PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);
 87:   if (opt) {
 88:     PetscStrstr(logList, "da", &className);
 89:     if (className) {
 90:       PetscInfoDeactivateClass(DM_CLASSID);
 91:     }
 92:   }
 93:   /* Process summary exclusions */
 94:   PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);
 95:   if (opt) {
 96:     PetscStrstr(logList, "da", &className);
 97:     if (className) {
 98:       PetscLogEventDeactivateClass(DM_CLASSID);
 99:     }
100:   }
101:   PetscRegisterFinalize(DMFinalizePackage);
102:   return(0);
103: }
104: #include <petscfe.h>

106: static PetscBool PetscFEPackageInitialized = PETSC_FALSE;
109: /*@C
110:   PetscFEFinalizePackage - This function finalizes everything in the PetscFE package. It is called
111:   from PetscFinalize().

113:   Level: developer

115: .keywords: PetscFE, initialize, package
116: .seealso: PetscInitialize()
117: @*/
118: PetscErrorCode PetscFEFinalizePackage(void)
119: {

123:   PetscFunctionListDestroy(&PetscSpaceList);
124:   PetscFunctionListDestroy(&PetscDualSpaceList);
125:   PetscFunctionListDestroy(&PetscFEList);
126:   PetscFEPackageInitialized       = PETSC_FALSE;
127:   PetscSpaceRegisterAllCalled     = PETSC_FALSE;
128:   PetscDualSpaceRegisterAllCalled = PETSC_FALSE;
129:   PetscFERegisterAllCalled        = PETSC_FALSE;
130:   return(0);
131: }

135: /*@C
136:   PetscFEInitializePackage - This function initializes everything in the FE package. It is called
137:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to PetscSpaceCreate()
138:   when using static libraries.

140:   Level: developer

142: .keywords: PetscFE, initialize, package
143: .seealso: PetscInitialize()
144: @*/
145: PetscErrorCode PetscFEInitializePackage(void)
146: {
147:   char           logList[256];
148:   char          *className;
149:   PetscBool      opt;

153:   if (PetscFEPackageInitialized) return(0);
154:   PetscFEPackageInitialized = PETSC_TRUE;

156:   /* Register Classes */
157:   PetscClassIdRegister("Linear Space", &PETSCSPACE_CLASSID);
158:   PetscClassIdRegister("Dual Space",   &PETSCDUALSPACE_CLASSID);
159:   PetscClassIdRegister("FE Space",     &PETSCFE_CLASSID);

161:   /* Register Constructors */
162:   PetscSpaceRegisterAll();
163:   PetscDualSpaceRegisterAll();
164:   PetscFERegisterAll();
165:   /* Register Events */
166:   /* Process info exclusions */
167:   PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);
168:   if (opt) {
169:     PetscStrstr(logList, "fe", &className);
170:     if (className) {PetscInfoDeactivateClass(PETSCFE_CLASSID);}
171:   }
172:   /* Process summary exclusions */
173:   PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);
174:   if (opt) {
175:     PetscStrstr(logList, "fe", &className);
176:     if (className) {PetscLogEventDeactivateClass(PETSCFE_CLASSID);}
177:   }
178:   PetscRegisterFinalize(PetscFEFinalizePackage);
179:   return(0);
180: }
181: #include <petscfv.h>

183: static PetscBool PetscFVPackageInitialized = PETSC_FALSE;
186: /*@C
187:   PetscFVFinalizePackage - This function finalizes everything in the PetscFV package. It is called
188:   from PetscFinalize().

190:   Level: developer

192: .keywords: PetscFV, initialize, package
193: .seealso: PetscInitialize()
194: @*/
195: PetscErrorCode PetscFVFinalizePackage(void)
196: {

200:   PetscFunctionListDestroy(&PetscLimiterList);
201:   PetscFunctionListDestroy(&PetscFVList);
202:   PetscFVPackageInitialized     = PETSC_FALSE;
203:   PetscFVRegisterAllCalled      = PETSC_FALSE;
204:   PetscLimiterRegisterAllCalled = PETSC_FALSE;
205:   return(0);
206: }

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

215:   Level: developer

217: .keywords: PetscFV, initialize, package
218: .seealso: PetscInitialize()
219: @*/
220: PetscErrorCode PetscFVInitializePackage(void)
221: {
222:   char           logList[256];
223:   char          *className;
224:   PetscBool      opt;

228:   if (PetscFVPackageInitialized) return(0);
229:   PetscFVPackageInitialized = PETSC_TRUE;

231:   /* Register Classes */
232:   PetscClassIdRegister("FV Space", &PETSCFV_CLASSID);
233:   PetscClassIdRegister("Limiter",  &PETSCLIMITER_CLASSID);

235:   /* Register Constructors */
236:   PetscFVRegisterAll();
237:   /* Register Events */
238:   /* Process info exclusions */
239:   PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);
240:   if (opt) {
241:     PetscStrstr(logList, "fv", &className);
242:     if (className) {PetscInfoDeactivateClass(PETSCFV_CLASSID);}
243:     PetscStrstr(logList, "limiter", &className);
244:     if (className) {PetscInfoDeactivateClass(PETSCLIMITER_CLASSID);}
245:   }
246:   /* Process summary exclusions */
247:   PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);
248:   if (opt) {
249:     PetscStrstr(logList, "fv", &className);
250:     if (className) {PetscLogEventDeactivateClass(PETSCFV_CLASSID);}
251:     PetscStrstr(logList, "limiter", &className);
252:     if (className) {PetscLogEventDeactivateClass(PETSCLIMITER_CLASSID);}
253:   }
254:   PetscRegisterFinalize(PetscFVFinalizePackage);
255:   return(0);
256: }
257: #include <petscds.h>

259: static PetscBool PetscDSPackageInitialized = PETSC_FALSE;
262: /*@C
263:   PetscDSFinalizePackage - This function finalizes everything in the PetscDS package. It is called
264:   from PetscFinalize().

266:   Level: developer

268: .keywords: PetscDS, initialize, package
269: .seealso: PetscInitialize()
270: @*/
271: PetscErrorCode PetscDSFinalizePackage(void)
272: {

276:   PetscFunctionListDestroy(&PetscDSList);
277:   PetscDSPackageInitialized = PETSC_FALSE;
278:   PetscDSRegisterAllCalled  = PETSC_FALSE;
279:   return(0);
280: }

284: /*@C
285:   PetscDSInitializePackage - This function initializes everything in the DS package. It is called
286:   from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to PetscDSCreate()
287:   when using static libraries.

289:   Level: developer

291: .keywords: PetscDS, initialize, package
292: .seealso: PetscInitialize()
293: @*/
294: PetscErrorCode PetscDSInitializePackage(void)
295: {
296:   char           logList[256];
297:   char          *className;
298:   PetscBool      opt;

302:   if (PetscDSPackageInitialized) return(0);
303:   PetscDSPackageInitialized = PETSC_TRUE;

305:   /* Register Classes */
306:   PetscClassIdRegister("Discrete System", &PETSCDS_CLASSID);

308:   /* Register Constructors */
309:   PetscDSRegisterAll();
310:   /* Register Events */
311:   /* Process info exclusions */
312:   PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);
313:   if (opt) {
314:     PetscStrstr(logList, "ds", &className);
315:     if (className) {PetscInfoDeactivateClass(PETSCDS_CLASSID);}
316:   }
317:   /* Process summary exclusions */
318:   PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);
319:   if (opt) {
320:     PetscStrstr(logList, "ds", &className);
321:     if (className) {PetscLogEventDeactivateClass(PETSCDS_CLASSID);}
322:   }
323:   PetscRegisterFinalize(PetscDSFinalizePackage);
324:   return(0);
325: }

327: #if defined(PETSC_HAVE_DYNAMIC_LIBRARIES)
330: /*
331:   PetscDLLibraryRegister - This function is called when the dynamic library it is in is opened.

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

336: */
337: PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscdm(void)
338: {

342:   AOInitializePackage();
343:   DMInitializePackage();
344:   PetscFEInitializePackage();
345:   PetscFVInitializePackage();
346:   return(0);
347: }

349: #endif /* PETSC_HAVE_DYNAMIC_LIBRARIES */