Actual source code: dlregistagger.c

      1: #include <petsc/private/vecimpl.h>

      3: PetscClassId VEC_TAGGER_CLASSID;

      5: static PetscBool VecTaggerPackageInitialized = PETSC_FALSE;

      7: PetscBool VecTaggerRegisterAllCalled;

      9: /*@C
     10:   VecTaggerInitializePackage - Initialize VecTagger package

     12:   Logically Collective

     14:   Level: developer

     16: .seealso: `VecTaggerFinalizePackage()`
     17: @*/
     18: PetscErrorCode VecTaggerInitializePackage(void)
     19: {
     20:   PetscFunctionBegin;
     21:   if (VecTaggerPackageInitialized) PetscFunctionReturn(PETSC_SUCCESS);
     22:   VecTaggerPackageInitialized = PETSC_TRUE;

     24:   PetscCall(PetscClassIdRegister("Vector Indices Tagger", &VEC_TAGGER_CLASSID));
     25:   PetscCall(VecTaggerRegisterAll());
     26:   PetscCall(PetscRegisterFinalize(VecTaggerFinalizePackage));
     27:   PetscFunctionReturn(PETSC_SUCCESS);
     28: }

     30: /*@C
     31:   VecTaggerFinalizePackage - Finalize VecTagger package, it is called from PetscFinalize()

     33:   Logically Collective

     35:   Level: developer

     37: .seealso: `VecTaggerInitializePackage()`
     38: @*/
     39: PetscErrorCode VecTaggerFinalizePackage(void)
     40: {
     41:   PetscFunctionBegin;
     42:   PetscCall(PetscFunctionListDestroy(&VecTaggerList));
     43:   VecTaggerPackageInitialized = PETSC_FALSE;
     44:   VecTaggerRegisterAllCalled  = PETSC_FALSE;
     45:   PetscFunctionReturn(PETSC_SUCCESS);
     46: }