本文整理汇总了C++中PetscRegisterFinalize函数的典型用法代码示例。如果您正苦于以下问题:C++ PetscRegisterFinalize函数的具体用法?C++ PetscRegisterFinalize怎么用?C++ PetscRegisterFinalize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PetscRegisterFinalize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PetscDLLibraryRegister
/*@C
PFInitializePackage - This function initializes everything in the PF package. It is called
from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to PFCreate()
when using static libraries.
Input Parameter:
. path - The dynamic library path, or PETSC_NULL
Level: developer
.keywords: Vec, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode PFInitializePackage(const char path[])
{
char logList[256];
char *className;
PetscBool opt;
PetscErrorCode ierr;
PetscFunctionBegin;
if (PFPackageInitialized) PetscFunctionReturn(0);
PFPackageInitialized = PETSC_TRUE;
/* Register Classes */
ierr = PetscClassIdRegister("PointFunction",&PF_CLASSID);CHKERRQ(ierr);
/* Register Constructors */
ierr = PFRegisterAll(path);CHKERRQ(ierr);
/* Process info exclusions */
ierr = PetscOptionsGetString(PETSC_NULL, "-info_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "pf", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscInfoDeactivateClass(PF_CLASSID);CHKERRQ(ierr);
}
}
/* Process summary exclusions */
ierr = PetscOptionsGetString(PETSC_NULL, "-log_summary_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "pf", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscLogEventDeactivateClass(PF_CLASSID);CHKERRQ(ierr);
}
}
ierr = PetscRegisterFinalize(PFFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:Kun-Qu,项目名称:petsc,代码行数:46,代码来源:pf.c
示例2: PetscDLLibraryRegister
/*@C
RGInitializePackage - This function initializes everything in the RG package.
It is called from PetscDLLibraryRegister() when using dynamic libraries, and
on the first call to RGCreate() when using static libraries.
Level: developer
.seealso: SlepcInitialize()
@*/
PetscErrorCode RGInitializePackage(void)
{
char logList[256];
char *className;
PetscBool opt;
PetscErrorCode ierr;
PetscFunctionBegin;
if (RGPackageInitialized) PetscFunctionReturn(0);
RGPackageInitialized = PETSC_TRUE;
/* Register Classes */
ierr = PetscClassIdRegister("Region",&RG_CLASSID);CHKERRQ(ierr);
/* Register Constructors */
ierr = RGRegisterAll();CHKERRQ(ierr);
/* Process info exclusions */
ierr = PetscOptionsGetString(NULL,"-info_exclude",logList,256,&opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList,"rg",&className);CHKERRQ(ierr);
if (className) {
ierr = PetscInfoDeactivateClass(RG_CLASSID);CHKERRQ(ierr);
}
}
/* Process summary exclusions */
ierr = PetscOptionsGetString(NULL,"-log_summary_exclude",logList,256,&opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList,"rg",&className);CHKERRQ(ierr);
if (className) {
ierr = PetscLogEventDeactivateClass(RG_CLASSID);CHKERRQ(ierr);
}
}
ierr = PetscRegisterFinalize(RGFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:OpenCMISS-Dependencies,项目名称:slepc,代码行数:42,代码来源:rgbasic.c
示例3: TaoCreate
/*@C
TaoInitializePackage - This function sets up PETSc to use the Tao
package. When using static libraries, this function is called from the
first entry to TaoCreate(); when using shared libraries, it is called
from PetscDLLibraryRegister()
Level: developer
.seealso: TaoCreate()
@*/
PetscErrorCode TaoInitializePackage(void)
{
PetscErrorCode ierr;
PetscFunctionBegin;
if (TaoPackageInitialized) PetscFunctionReturn(0);
TaoPackageInitialized = PETSC_TRUE;
ierr = PetscClassIdRegister("Tao",&TAO_CLASSID);CHKERRQ(ierr);
/* Tell PETSc what solvers are available */
ierr = TaoRegisterAll();CHKERRQ(ierr);
/* Tell PETSc what events are associated with Tao */
ierr = PetscLogEventRegister("TaoSolve",TAO_CLASSID,&Tao_Solve);CHKERRQ(ierr);
ierr = PetscLogEventRegister("TaoObjectiveEval",TAO_CLASSID,&Tao_ObjectiveEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("TaoGradientEval",TAO_CLASSID,&Tao_GradientEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("TaoHessianEval",TAO_CLASSID,&Tao_HessianEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("TaoConstraintsEval",TAO_CLASSID,&Tao_ConstraintsEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("TaoJacobianEval",TAO_CLASSID,&Tao_JacobianEval);CHKERRQ(ierr);
ierr = PetscRegisterFinalize(TaoFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:OpenCMISS-Dependencies,项目名称:petsc,代码行数:35,代码来源:dlregistao.c
示例4: PetscSFFinalizePackage
/*@C
PetscSFInitializePackage - Initialize SF package
Logically Collective
Level: developer
.seealso: PetscSFFinalizePackage()
@*/
PetscErrorCode PetscSFInitializePackage(void)
{
PetscErrorCode ierr;
PetscFunctionBegin;
if (PetscSFPackageInitialized) PetscFunctionReturn(0);
PetscSFPackageInitialized = PETSC_TRUE;
ierr = PetscClassIdRegister("Bipartite Graph",&PETSCSF_CLASSID);
CHKERRQ(ierr);
ierr = PetscSFRegisterAll();
CHKERRQ(ierr);
ierr = PetscLogEventRegister("PetscSFSetGraph" , PETSCSF_CLASSID, &PETSCSF_SetGraph);
CHKERRQ(ierr);
ierr = PetscLogEventRegister("PetscSFBcastBegin" , PETSCSF_CLASSID, &PETSCSF_BcastBegin);
CHKERRQ(ierr);
ierr = PetscLogEventRegister("PetscSFBcastEnd" , PETSCSF_CLASSID, &PETSCSF_BcastEnd);
CHKERRQ(ierr);
ierr = PetscLogEventRegister("PetscSFReduceBegin" , PETSCSF_CLASSID, &PETSCSF_ReduceBegin);
CHKERRQ(ierr);
ierr = PetscLogEventRegister("PetscSFReduceEnd" , PETSCSF_CLASSID, &PETSCSF_ReduceEnd);
CHKERRQ(ierr);
ierr = PetscLogEventRegister("PetscSFFetchOpBegin" , PETSCSF_CLASSID, &PETSCSF_FetchAndOpBegin);
CHKERRQ(ierr);
ierr = PetscLogEventRegister("PetscSFFetchOpEnd" , PETSCSF_CLASSID, &PETSCSF_FetchAndOpEnd);
CHKERRQ(ierr);
ierr = PetscRegisterFinalize(PetscSFFinalizePackage);
CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:ZJLi2013,项目名称:petsc,代码行数:39,代码来源:dlregissf.c
示例5: MatInitializePackage
/*@C
MatMFFDInitializePackage - This function initializes everything in the MatMFFD package. It is called
from MatInitializePackage().
Level: developer
.keywords: Vec, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode MatMFFDInitializePackage(void)
{
char logList[256];
PetscBool opt,pkg;
PetscErrorCode ierr;
PetscFunctionBegin;
if (MatMFFDPackageInitialized) PetscFunctionReturn(0);
MatMFFDPackageInitialized = PETSC_TRUE;
/* Register Classes */
ierr = PetscClassIdRegister("MatMFFD",&MATMFFD_CLASSID);CHKERRQ(ierr);
/* Register Constructors */
ierr = MatMFFDRegisterAll();CHKERRQ(ierr);
/* Register Events */
ierr = PetscLogEventRegister("MatMult MF",MATMFFD_CLASSID,&MATMFFD_Mult);CHKERRQ(ierr);
/* Process info exclusions */
ierr = PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrInList("matmffd",logList,',',&pkg);CHKERRQ(ierr);
if (pkg) {ierr = PetscInfoDeactivateClass(MATMFFD_CLASSID);CHKERRQ(ierr);}
}
/* Process summary exclusions */
ierr = PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrInList("matmffd",logList,',',&pkg);CHKERRQ(ierr);
if (pkg) {ierr = PetscLogEventExcludeClass(MATMFFD_CLASSID);CHKERRQ(ierr);}
}
/* Register package finalizer */
ierr = PetscRegisterFinalize(MatMFFDFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:petsc,项目名称:petsc,代码行数:40,代码来源:mffd.c
示例6: PetscImageListAdd
static PetscErrorCode PetscImageListAdd(const char filename[],const char ext[],PetscInt count)
{
PetscErrorCode ierr;
PetscImageList image,oimage = SAWs_images;
PetscBool flg;
PetscFunctionBegin;
if (oimage) {
ierr = PetscStrcmp(filename,oimage->filename,&flg);CHKERRQ(ierr);
if (flg) {
oimage->count = count;
PetscFunctionReturn(0);
}
while (oimage->next) {
oimage = oimage->next;
ierr = PetscStrcmp(filename,oimage->filename,&flg);CHKERRQ(ierr);
if (flg) {
oimage->count = count;
PetscFunctionReturn(0);
}
}
ierr = PetscNew(&image);CHKERRQ(ierr);
oimage->next = image;
} else {
ierr = PetscRegisterFinalize(PetscImageListDestroy);CHKERRQ(ierr);
ierr = PetscNew(&image);CHKERRQ(ierr);
SAWs_images = image;
}
ierr = PetscStrallocpy(filename,&image->filename);CHKERRQ(ierr);
ierr = PetscStrallocpy(ext,&image->ext);CHKERRQ(ierr);
image->count = count;
PetscFunctionReturn(0);
}
开发者ID:plguhur,项目名称:petsc,代码行数:33,代码来源:dsave.c
示例7: PetscDLLibraryRegister
/*@C
PetscDSInitializePackage - This function initializes everything in the DS package. It is called
from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to PetscDSCreate()
when using static libraries.
Level: developer
.keywords: PetscDS, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode PetscDSInitializePackage(void)
{
char logList[256];
PetscBool opt,pkg;
PetscErrorCode ierr;
PetscFunctionBegin;
if (PetscDSPackageInitialized) PetscFunctionReturn(0);
PetscDSPackageInitialized = PETSC_TRUE;
/* Register Classes */
ierr = PetscClassIdRegister("Discrete System", &PETSCDS_CLASSID);CHKERRQ(ierr);
/* Register Constructors */
ierr = PetscDSRegisterAll();CHKERRQ(ierr);
/* Register Events */
/* Process info exclusions */
ierr = PetscOptionsGetString(NULL,NULL,"-info_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrInList("ds",logList,',',&pkg);CHKERRQ(ierr);
if (pkg) {ierr = PetscInfoDeactivateClass(PETSCDS_CLASSID);CHKERRQ(ierr);}
}
/* Process summary exclusions */
ierr = PetscOptionsGetString(NULL,NULL,"-log_exclude",logList,sizeof(logList),&opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrInList("ds",logList,',',&pkg);CHKERRQ(ierr);
if (pkg) {ierr = PetscLogEventExcludeClass(PETSCDS_CLASSID);CHKERRQ(ierr);}
}
/* Register package finalizer */
ierr = PetscRegisterFinalize(PetscDSFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:firedrakeproject,项目名称:petsc,代码行数:41,代码来源:dlregisdmdm.c
示例8: PetscDLLibraryRegister
/*@C
DMInitializePackage - This function initializes everything in the DM package. It is called
from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to AOCreate()
or DMDACreate() when using static libraries.
Level: developer
.keywords: AO, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode DMInitializePackage(void)
{
char logList[256];
char *className;
PetscBool opt;
PetscErrorCode ierr;
PetscFunctionBegin;
if (DMPackageInitialized) PetscFunctionReturn(0);
DMPackageInitialized = PETSC_TRUE;
/* Register Classes */
ierr = PetscClassIdRegister("Distributed Mesh",&DM_CLASSID);CHKERRQ(ierr);
#if defined(PETSC_HAVE_HYPRE)
ierr = MatRegister(MATHYPRESTRUCT, MatCreate_HYPREStruct);CHKERRQ(ierr);
#endif
/* Register Constructors */
ierr = DMRegisterAll();CHKERRQ(ierr);
/* Register Events */
ierr = PetscLogEventRegister("DMConvert", DM_CLASSID,&DM_Convert);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMGlobalToLocal", DM_CLASSID,&DM_GlobalToLocal);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMLocalToGlobal", DM_CLASSID,&DM_LocalToGlobal);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMDALocalADFunc", DM_CLASSID,&DMDA_LocalADFunction);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexInterpolate", DM_CLASSID,&DMPLEX_Interpolate);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexPartition", DM_CLASSID,&DMPLEX_Partition);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexDistribute", DM_CLASSID,&DMPLEX_Distribute);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexDistribCones", DM_CLASSID,&DMPLEX_DistributeCones);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexDistribLabels", DM_CLASSID,&DMPLEX_DistributeLabels);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexDistribSF", DM_CLASSID,&DMPLEX_DistributeSF);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexDistribField", DM_CLASSID,&DMPLEX_DistributeField);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexDistribData", DM_CLASSID,&DMPLEX_DistributeData);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexStratify", DM_CLASSID,&DMPLEX_Stratify);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexPreallocate", DM_CLASSID,&DMPLEX_Preallocate);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexResidualFEM", DM_CLASSID,&DMPLEX_ResidualFEM);CHKERRQ(ierr);
ierr = PetscLogEventRegister("DMPlexJacobianFEM", DM_CLASSID,&DMPLEX_JacobianFEM);CHKERRQ(ierr);
/* Process info exclusions */
ierr = PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "da", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscInfoDeactivateClass(DM_CLASSID);CHKERRQ(ierr);
}
}
/* Process summary exclusions */
ierr = PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "da", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscLogEventDeactivateClass(DM_CLASSID);CHKERRQ(ierr);
}
}
ierr = PetscRegisterFinalize(DMFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:00liujj,项目名称:petsc,代码行数:68,代码来源:dlregisdmdm.c
示例9: PetscDLLibraryRegister
/*@C
SNESMSInitializePackage - This function initializes everything in the SNESMS package. It is called
from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to SNESCreate_MS()
when using static libraries.
Input Parameter:
path - The dynamic library path, or PETSC_NULL
Level: developer
.keywords: SNES, SNESMS, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode SNESMSInitializePackage(const char path[])
{
PetscErrorCode ierr;
PetscFunctionBegin;
if (SNESMSPackageInitialized) PetscFunctionReturn(0);
SNESMSPackageInitialized = PETSC_TRUE;
ierr = SNESMSRegisterAll();CHKERRQ(ierr);
ierr = PetscRegisterFinalize(SNESMSFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:Kun-Qu,项目名称:petsc,代码行数:24,代码来源:ms.c
示例10: dUnitsInitializePackage
dErr dUnitsInitializePackage(const dUNUSED char path[])
{
dErr err;
dFunctionBegin;
if (dUnitsPackageInitialized) dFunctionReturn(0);
dUnitsPackageInitialized = dTRUE;
err = PetscClassIdRegister("dUnits",&dUNITS_CLASSID);dCHK(err);
err = PetscRegisterFinalize(dUnitsFinalizePackage);dCHK(err);
dFunctionReturn(0);
}
开发者ID:xyuan,项目名称:dohp,代码行数:11,代码来源:dunits.c
示例11: PetscThreadCommFinalizePackage
/*@C
PetscThreadCommInitializePackage - Initializes ThreadComm package
Logically collective
Input Parameter:
. path - The dynamic library path, or PETSC_NULL
Level: developer
.seealso: PetscThreadCommFinalizePackage()
@*/
PetscErrorCode PetscThreadCommInitializePackage(const char *path)
{
PetscErrorCode ierr;
PetscFunctionBegin;
if(PetscThreadCommPackageInitialized) PetscFunctionReturn(0);
ierr = PetscThreadCommInitialize();CHKERRQ(ierr);
PetscThreadCommPackageInitialized = PETSC_TRUE;
ierr = PetscRegisterFinalize(PetscThreadCommFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:Kun-Qu,项目名称:petsc,代码行数:23,代码来源:dlregisthreadcomm.c
示例12: PetscSFFinalizePackage
/*@C
PetscSFInitializePackage - Initialize SF package
Logically Collective
Input Arguments:
. path - the dynamic library path or PETSC_NULL
Level: developer
.seealso: PetscSFFinalizePackage()
@*/
PetscErrorCode PetscSFInitializePackage(const char *path)
{
PetscErrorCode ierr;
PetscFunctionBegin;
if (PetscSFPackageInitialized) PetscFunctionReturn(0);
PetscSFPackageInitialized = PETSC_TRUE;
ierr = PetscClassIdRegister("Bipartite Graph",&PETSCSF_CLASSID);CHKERRQ(ierr);
ierr = PetscRegisterFinalize(PetscSFFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:Kun-Qu,项目名称:petsc,代码行数:23,代码来源:dlregissf.c
示例13: PCGAMGClassicalInitializePackage
PetscErrorCode PCGAMGClassicalInitializePackage(void)
{
PetscErrorCode ierr;
PetscFunctionBegin;
if (PCGAMGClassicalPackageInitialized) PetscFunctionReturn(0);
ierr = PetscFunctionListAdd(&PCGAMGClassicalProlongatorList,PCGAMGCLASSICALDIRECT,PCGAMGProlongator_Classical_Direct);CHKERRQ(ierr);
ierr = PetscFunctionListAdd(&PCGAMGClassicalProlongatorList,PCGAMGCLASSICALSTANDARD,PCGAMGProlongator_Classical_Standard);CHKERRQ(ierr);
ierr = PetscRegisterFinalize(PCGAMGClassicalFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:ZJLi2013,项目名称:petsc,代码行数:11,代码来源:classical.c
示例14: PetscDLLibraryRegister
/*@C
TSRKInitializePackage - This function initializes everything in the TSRK package. It is called
from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to TSCreate_RK()
when using static libraries.
Level: developer
.keywords: TS, TSRK, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode TSRKInitializePackage(void)
{
PetscErrorCode ierr;
PetscFunctionBegin;
if (TSRKPackageInitialized) PetscFunctionReturn(0);
TSRKPackageInitialized = PETSC_TRUE;
ierr = TSRKRegisterAll();CHKERRQ(ierr);
ierr = PetscObjectComposedDataRegister(&explicit_stage_time_id);CHKERRQ(ierr);
ierr = PetscRegisterFinalize(TSRKFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:pombredanne,项目名称:petsc,代码行数:22,代码来源:rk.c
示例15: TSInitializePackage
/*@C
TSAdaptInitializePackage - This function initializes everything in the TSAdapt package. It is
called from TSInitializePackage().
Level: developer
.keywords: TSAdapt, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode TSAdaptInitializePackage(void)
{
PetscErrorCode ierr;
PetscFunctionBegin;
if (TSAdaptPackageInitialized) PetscFunctionReturn(0);
TSAdaptPackageInitialized = PETSC_TRUE;
ierr = PetscClassIdRegister("TSAdapt",&TSADAPT_CLASSID);CHKERRQ(ierr);
ierr = TSAdaptRegisterAll();CHKERRQ(ierr);
ierr = PetscRegisterFinalize(TSAdaptFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:petsc,项目名称:petsc,代码行数:21,代码来源:tsadapt.c
示例16: PetscViewerInitializePackage
/*@C
PetscViewerMathematicaInitializePackage - This function initializes everything in the Petsc interface to Mathematica. It is
called from PetscViewerInitializePackage().
Level: developer
.keywords: Petsc, initialize, package
.seealso: PetscSysInitializePackage(), PetscInitialize()
@*/
PetscErrorCode PetscViewerMathematicaInitializePackage(void)
{
PetscError ierr;
PetscFunctionBegin;
if (PetscViewerMathematicaPackageInitialized) PetscFunctionReturn(0);
PetscViewerMathematicaPackageInitialized = PETSC_TRUE;
mathematicaEnv = (void*) MLInitialize(0);
ierr = PetscRegisterFinalize(PetscViewerMathematicaFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:firedrakeproject,项目名称:petsc,代码行数:22,代码来源:mathematica.c
示例17: PetscP4estInitialize
PetscErrorCode PetscP4estInitialize(void)
{
PetscBool psc_catch_signals = PETSC_FALSE;
PetscBool psc_print_backtrace = PETSC_TRUE;
int psc_log_threshold = SC_LP_DEFAULT;
int pp4est_log_threshold = SC_LP_DEFAULT;
char logList[256], *className;
PetscBool opt;
PetscErrorCode ierr;
PetscFunctionBegin;
if (PetscP4estInitialized) PetscFunctionReturn(0);
PetscP4estInitialized = PETSC_TRUE;
ierr = PetscClassIdRegister("p4est logging",&P4ESTLOGGING_CLASSID);CHKERRQ(ierr);
ierr = PetscOptionsGetString(NULL,NULL, "-info_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "p4est", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscInfoDeactivateClass(P4ESTLOGGING_CLASSID);CHKERRQ(ierr);
}
}
ierr = PetscHeaderCreate(P4estLoggingObject,P4ESTLOGGING_CLASSID,"p4est","p4est logging","DM",PETSC_COMM_WORLD,NULL,PetscObjectView);CHKERRQ(ierr);
if (sc_package_id == -1) {
int log_threshold_shifted = psc_log_threshold + 1;
PetscBool set;
PetscBeganSc = PETSC_TRUE;
ierr = PetscOptionsGetBool(NULL,NULL,"-petsc_sc_catch_signals",&psc_catch_signals,NULL);CHKERRQ(ierr);
ierr = PetscOptionsGetBool(NULL,NULL,"-petsc_sc_print_backtrace",&psc_print_backtrace,NULL);CHKERRQ(ierr);
ierr = PetscOptionsGetEnum(NULL,NULL,"-petsc_sc_log_threshold",SCLogTypes,(PetscEnum*)&log_threshold_shifted,&set);CHKERRQ(ierr);
if (set) psc_log_threshold = log_threshold_shifted - 1;
sc_init(PETSC_COMM_WORLD,(int)psc_catch_signals,(int)psc_print_backtrace,PetscScLogHandler,psc_log_threshold);
if (sc_package_id == -1) SETERRQ(PETSC_COMM_WORLD,PETSC_ERR_LIB,"Could not initialize libsc package used by p4est");
sc_set_abort_handler(PetscScAbort);
}
if (p4est_package_id == -1) {
int log_threshold_shifted = pp4est_log_threshold + 1;
PetscBool set;
ierr = PetscOptionsGetEnum(NULL,NULL,"-petsc_p4est_log_threshold",SCLogTypes,(PetscEnum*)&log_threshold_shifted,&set);CHKERRQ(ierr);
if (set) pp4est_log_threshold = log_threshold_shifted - 1;
PetscStackCallP4est(p4est_init,(PetscScLogHandler,pp4est_log_threshold));
if (p4est_package_id == -1) SETERRQ(PETSC_COMM_WORLD,PETSC_ERR_LIB,"Could not initialize p4est");
}
ierr = DMForestRegisterType(DMP4EST);CHKERRQ(ierr);
ierr = DMForestRegisterType(DMP8EST);CHKERRQ(ierr);
ierr = PetscRegisterFinalize(PetscP4estFinalize);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:tom-klotz,项目名称:petsc,代码行数:50,代码来源:petsc_p4est_package.c
示例18: PetscFortranCallbackGetSizes
/*@C
PetscFortranCallbackRegister - register a type+subtype callback
Not Collective
Input Arguments:
+ classid - ID of class on which to register callback
- subtype - subtype string, or NULL for class ids
Output Arguments:
. id - callback id
Level: developer
.seealso: PetscFortranCallbackGetSizes()
@*/
PetscErrorCode PetscFortranCallbackRegister(PetscClassId classid,const char *subtype,PetscFortranCallbackId *id)
{
PetscErrorCode ierr;
FortranCallbackBase *base;
FortranCallbackLink link;
PetscFunctionBegin;
*id = 0;
if (classid < PETSC_SMALLEST_CLASSID || PETSC_LARGEST_CLASSID <= classid) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_ARG_CORRUPT,"ClassId %D corrupt",classid);
if (classid >= _maxclassid) {
PetscClassId newmax = PETSC_SMALLEST_CLASSID + 2*(PETSC_LARGEST_CLASSID-PETSC_SMALLEST_CLASSID);
FortranCallbackBase *newbase;
if (!_classbase) {
ierr = PetscRegisterFinalize(PetscFortranCallbackFinalize);CHKERRQ(ierr);
}
ierr = PetscMalloc((newmax-PETSC_SMALLEST_CLASSID)*sizeof(_classbase[0]),&newbase);CHKERRQ(ierr);
ierr = PetscMemzero(newbase,(newmax-PETSC_SMALLEST_CLASSID)*sizeof(_classbase[0]));CHKERRQ(ierr);
ierr = PetscMemcpy(newbase,_classbase,(_maxclassid-PETSC_SMALLEST_CLASSID)*sizeof(_classbase[0]));CHKERRQ(ierr);
ierr = PetscFree(_classbase);CHKERRQ(ierr);
_classbase = newbase;
_maxclassid = newmax;
}
base = &_classbase[classid-PETSC_SMALLEST_CLASSID];
if (!subtype) *id = PETSC_SMALLEST_FORTRAN_CALLBACK + base->basecount++;
else {
for (link=base->subtypes; link; link=link->next) { /* look for either both NULL or matching values (implies both non-NULL) */
PetscBool match;
ierr = PetscStrcmp(subtype,link->type_name,&match);CHKERRQ(ierr);
if (match) { /* base type or matching subtype */
goto found;
}
}
/* Not found. Create node and prepend to class' subtype list */
ierr = PetscMalloc(sizeof(*link),&link);CHKERRQ(ierr);
ierr = PetscStrallocpy(subtype,&link->type_name);CHKERRQ(ierr);
link->max = PETSC_SMALLEST_FORTRAN_CALLBACK;
link->next = base->subtypes;
base->subtypes = link;
found:
*id = link->max++;
base->maxsubtypecount = PetscMax(base->maxsubtypecount,link->max-PETSC_SMALLEST_FORTRAN_CALLBACK);
}
PetscFunctionReturn(0);
}
开发者ID:feelpp,项目名称:debian-petsc,代码行数:64,代码来源:fcallback.c
示例19: PetscDLLibraryRegister
/*@C
PCInitializePackage - This function initializes everything in the PC package. It is called
from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to PCCreate()
when using static libraries.
Level: developer
.keywords: PC, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode PCInitializePackage(void)
{
char logList[256];
char *className;
PetscBool opt;
PetscErrorCode ierr;
PetscFunctionBegin;
if (PCPackageInitialized) PetscFunctionReturn(0);
PCPackageInitialized = PETSC_TRUE;
/* Initialize subpackages */
ierr = PCGAMGInitializePackage();CHKERRQ(ierr);
/* Register Classes */
ierr = PetscClassIdRegister("Preconditioner",&PC_CLASSID);CHKERRQ(ierr);
/* Register Constructors */
ierr = PCRegisterAll();CHKERRQ(ierr);
/* Register Events */
ierr = PetscLogEventRegister("PCSetUp", PC_CLASSID,&PC_SetUp);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCSetUpOnBlocks", PC_CLASSID,&PC_SetUpOnBlocks);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCApplyOnBlocks", PC_CLASSID,&PC_ApplyOnBlocks);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCApplyOnMproc", PC_CLASSID,&PC_ApplyOnMproc);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCApply", PC_CLASSID,&PC_Apply);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCApplyCoarse", PC_CLASSID,&PC_ApplyCoarse);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCApplyMultiple", PC_CLASSID,&PC_ApplyMultiple);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCApplySymmLeft", PC_CLASSID,&PC_ApplySymmetricLeft);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCApplySymmRight", PC_CLASSID,&PC_ApplySymmetricRight);CHKERRQ(ierr);
ierr = PetscLogEventRegister("PCModifySubMatri", PC_CLASSID,&PC_ModifySubMatrices);CHKERRQ(ierr);
/* Process info exclusions */
ierr = PetscOptionsGetString(NULL, "-info_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "pc", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscInfoDeactivateClass(PC_CLASSID);CHKERRQ(ierr);
}
}
/* Process summary exclusions */
ierr = PetscOptionsGetString(NULL, "-log_summary_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "pc", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscLogEventDeactivateClass(PC_CLASSID);CHKERRQ(ierr);
}
}
/* Register data */
ierr = PetscObjectComposedDataRegister(&PetscMGLevelId);CHKERRQ(ierr);
ierr = PetscRegisterFinalize(PCFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:pombredanne,项目名称:petsc,代码行数:58,代码来源:dlregisksp.c
示例20: PetscDLLibraryRegister
/*@C
SNESInitializePackage - This function initializes everything in the SNES package. It is called
from PetscDLLibraryRegister() when using dynamic libraries, and on the first call to SNESCreate()
when using static libraries.
Level: developer
.keywords: SNES, initialize, package
.seealso: PetscInitialize()
@*/
PetscErrorCode SNESInitializePackage(void)
{
char logList[256];
char *className;
PetscBool opt;
PetscErrorCode ierr;
PetscFunctionBegin;
if (SNESPackageInitialized) PetscFunctionReturn(0);
SNESPackageInitialized = PETSC_TRUE;
/* Initialize subpackages */
ierr = SNESMSInitializePackage();CHKERRQ(ierr);
/* Register Classes */
ierr = PetscClassIdRegister("SNES",&SNES_CLASSID);CHKERRQ(ierr);
ierr = PetscClassIdRegister("SNESLineSearch",&SNESLINESEARCH_CLASSID);CHKERRQ(ierr);
ierr = PetscClassIdRegister("DMSNES",&DMSNES_CLASSID);CHKERRQ(ierr);
/* Register Constructors */
ierr = SNESRegisterAll();CHKERRQ(ierr);
ierr = SNESLineSearchRegisterAll();CHKERRQ(ierr);
/* Register Events */
ierr = PetscLogEventRegister("SNESSolve", SNES_CLASSID,&SNES_Solve);CHKERRQ(ierr);
ierr = PetscLogEventRegister("SNESFunctionEval", SNES_CLASSID,&SNES_FunctionEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("SNESObjectiveEval", SNES_CLASSID,&SNES_ObjectiveEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("SNESNGSEval", SNES_CLASSID,&SNES_NGSEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("SNESNGSFuncEval", SNES_CLASSID,&SNES_NGSFuncEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("SNESJacobianEval", SNES_CLASSID,&SNES_JacobianEval);CHKERRQ(ierr);
ierr = PetscLogEventRegister("SNESLineSearch", SNESLINESEARCH_CLASSID,&SNESLINESEARCH_Apply);CHKERRQ(ierr);
ierr = PetscLogEventRegister("SNESNPCSolve", SNES_CLASSID,&SNES_NPCSolve);CHKERRQ(ierr);
/* Process info exclusions */
ierr = PetscOptionsGetString(NULL,NULL, "-info_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "snes", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscInfoDeactivateClass(SNES_CLASSID);CHKERRQ(ierr);
}
}
/* Process summary exclusions */
ierr = PetscOptionsGetString(NULL,NULL, "-log_exclude", logList, 256, &opt);CHKERRQ(ierr);
if (opt) {
ierr = PetscStrstr(logList, "snes", &className);CHKERRQ(ierr);
if (className) {
ierr = PetscLogEventDeactivateClass(SNES_CLASSID);CHKERRQ(ierr);
}
}
ierr = PetscRegisterFinalize(SNESFinalizePackage);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
开发者ID:tom-klotz,项目名称:petsc,代码行数:57,代码来源:dlregissnes.c
注:本文中的PetscRegisterFinalize函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论