#include "petscmat.h"
Go to the source code of this file.
Defines | |
#define | TRUTH(x) ( (x) ? PETSC_TRUE : PETSC_FALSE ) |
Typedefs | |
typedef struct SystemPreprocessor_ * | SystemPreprocessor |
typedef struct NumericalProblem_ * | NumericalProblem |
typedef struct NumericalSolution_ * | NumericalSolution |
typedef PetscReal | SuitabilityValue |
typedef struct SalsaTransform_ * | SalsaTransform |
typedef struct SalsaTransformObject_ * | SalsaTransformObject |
Functions | |
PetscErrorCode | SysProInitialize () |
PetscErrorCode | SysProFinalize () |
PetscErrorCode | DeclarePreprocessor (char *name, PetscErrorCode(*global_setup)(), PetscErrorCode(*specific_setup)(NumericalProblem, SalsaTransform), PetscErrorCode(*specific_unset)(NumericalProblem), PetscErrorCode(*global_unset)(), PetscErrorCode(*ctxcreate)(NumericalProblem, void **), PetscErrorCode(*ctxdelete)(void *), PetscErrorCode(*start_function)(char *, int, PetscTruth, NumericalProblem, NumericalProblem *, void *, void **, PetscTruth *), PetscErrorCode(*end_function)(char *, PetscTruth, void *, void *, NumericalProblem, NumericalProblem, NumericalSolution, NumericalSolution)) |
PetscErrorCode | DeclarePreprocessorIntelligentChoice (char *name, PetscErrorCode(*picker)(NumericalProblem, char **, char **)) |
PetscErrorCode | PreprocessorsOptionsHandling () |
PetscErrorCode | SysProDeclareFunctions (PetscErrorCode(*classstaticsetup)(char *), PetscErrorCode(*classdynamicsetup)(char *, NumericalProblem), PetscErrorCode(*classproblemcloner)(char *, char *, int, NumericalProblem, NumericalProblem), PetscErrorCode(*solver)(NumericalProblem, void *, NumericalSolution *), PetscErrorCode(*problemdelete)(NumericalProblem), PetscErrorCode(*solutioncreator)(NumericalProblem, NumericalSolution *), PetscErrorCode(*solutioncopy)(NumericalSolution, NumericalSolution), PetscErrorCode(*solutiondelete)(NumericalSolution), PetscErrorCode(*ctxcloner)(char *, char *, void *, void **), PetscErrorCode(*ctxfree)(void *), PetscErrorCode(*solutioncontextdelete)(NumericalSolution)) |
PetscErrorCode | ProcessPreprocessorOptions (char *processor, void *ctx) |
PetscErrorCode | PreprocessorGetIndex (char *, int *) |
PetscErrorCode | SystemPreprocessorGetByName (char *, SystemPreprocessor *) |
PetscErrorCode | PreprocessorGetSetting (char *, char **, int *) |
PetscErrorCode | RetrievePreprocessorChoice (int, char **, int *) |
PetscErrorCode | GetFirstPreprocessor (char **preprocess) |
PetscErrorCode | GetNextPreprocessor (char **next_one) |
PetscErrorCode | SuccessorPreprocessor (char *, char **) |
PetscErrorCode | InitRetrievingPreprocessors () |
PetscErrorCode | StartRetrievingCurrentPreprocessors (char **, char **, int *, PetscTruth *) |
PetscErrorCode | ContinueRetrievingCurrentPreprocessors (char **, char **, int *, PetscTruth *) |
PetscErrorCode | StartRetrievingAllPreprocessors (char **, char ***, int *, PetscTruth *) |
PetscErrorCode | ContinueRetrievingAllPreprocessors (char **, char ***, int *, PetscTruth *) |
PetscErrorCode | RetrieveAllPreprocessorValues (char *, char ***, int *) |
PetscErrorCode | RegisterPreprocessorContext (char *pre, void *ctx) |
PetscErrorCode | PreprocessorGetContext (char *pre, void **ctx) |
PetscErrorCode | PreprocessedSolution (char *, NumericalProblem, void *, NumericalSolution *) |
PetscErrorCode | PreprocessedProblemSolving (NumericalProblem, NumericalSolution *) |
PetscErrorCode | PreprocessorSetPreservedCategories (char *, char *) |
PetscErrorCode | PreprocessorGetPreservedCategories (char *, char **) |
PetscErrorCode | SysProComputeQuantity (NumericalProblem, char *, char *, void *, int *, PetscTruth *) |
PetscErrorCode | SysProRetrieveQuantity (NumericalProblem, char *, char *, void *, int *, PetscTruth *) |
PetscErrorCode | SysProRemoveQuantity (NumericalProblem, char *, char *, PetscTruth *) |
PetscErrorCode | SysProFreeQuantities (NumericalProblem) |
PetscErrorCode | SysProDefaultTrace (void *ctx, char *fmt, va_list argp) |
PetscErrorCode | SysProDeclareTraceFunction (PetscErrorCode(*fn)(void *, char *, va_list)) |
PetscErrorCode | SysProDeclareTraceContext (void *ctx) |
PetscErrorCode | SysProTraceMessage (char *fmt,...) |
PetscErrorCode | SysProHasTrace (PetscTruth *flg) |
PetscErrorCode | SysProDeclareProblemMonitor (PetscErrorCode(*)(NumericalProblem)) |
PetscErrorCode | SysProDeclareErrorTracer (PetscErrorCode(*)(NumericalProblem, NumericalSolution, char *)) |
PetscErrorCode | SysProGetErrorTracer (PetscErrorCode(**)(NumericalProblem, NumericalSolution, char *)) |
PetscErrorCode | TabReportAllPreprocessors (char **key, int) |
PetscErrorCode | TabReportActivePreprocessors (char **key, char **val, int) |
PetscErrorCode | ReportEnabledPreprocessors (char *name) |
PetscErrorCode | ReportSysProCallStackState (char *name) |
PetscErrorCode | ScreenOutputTab (char *key, char *val) |
PetscErrorCode | ScreenOutputTabLine (char *key, char *val) |
PetscErrorCode | NumericalProblemGetComm (NumericalProblem, MPI_Comm *) |
#define TRUTH | ( | x | ) | ( (x) ? PETSC_TRUE : PETSC_FALSE ) |
Definition at line 6 of file syspro.h.
Referenced by is_gmres_method(), PreprocessedSolution(), PreprocessorsOptionsHandling(), set_intelligent_scaling(), setup_pc(), TransformGetNextUnmarkedItem(), and TransformObjectGetIntAnnotation().
typedef struct NumericalProblem_* NumericalProblem |
typedef struct NumericalSolution_* NumericalSolution |
typedef struct SalsaTransform_* SalsaTransform |
typedef struct SalsaTransformObject_* SalsaTransformObject |
typedef PetscReal SuitabilityValue |
typedef struct SystemPreprocessor_* SystemPreprocessor |
PetscErrorCode ContinueRetrievingAllPreprocessors | ( | char ** | cclass, | |
char *** | types, | |||
int * | ntypes, | |||
PetscTruth * | success | |||
) |
This routine is to be used repeatedly after an initial call to StartRetrievingAllPreprocessors().
The types
argument is allocated internally and should be deallocated by the user.
Definition at line 186 of file reporting.c.
References CHKERRQ(), ierr, SalsaTransform_::n_objects, SystemPreprocessor_::name, npreprocess, preprocessreadout, SystemPreprocessor_::transform, and TransformObjectsGetNames().
Referenced by RetrieveAllPreprocessorValues(), StartRetrievingAllPreprocessors(), and TabReportPreprocessors().
PetscErrorCode ContinueRetrievingCurrentPreprocessors | ( | char ** | cclass, | |
char ** | type, | |||
int * | opt, | |||
PetscTruth * | success | |||
) |
This routine is to be used repeatedly after an initial call to StartRetrievingCurrentPreprocessors().
Definition at line 125 of file reporting.c.
References CHKERRQ(), ierr, SystemPreprocessor_::name, preprocesslevel, preprocessreadout, and RetrievePreprocessorChoice().
Referenced by StartRetrievingCurrentPreprocessors(), and TabReportPreprocessors().
PetscErrorCode DeclarePreprocessor | ( | char * | name, | |
PetscErrorCode(*)() | this_preprocessor_setup, | |||
PetscErrorCode(*)(NumericalProblem, SalsaTransform) | specific_setup, | |||
PetscErrorCode(*)(NumericalProblem) | specific_unset, | |||
PetscErrorCode(*)() | global_unset, | |||
PetscErrorCode(*)(NumericalProblem, void **) | ctxcreate, | |||
PetscErrorCode(*)(void *) | ctxdelete, | |||
PetscErrorCode(*)(char *, int, PetscTruth, NumericalProblem, NumericalProblem *, void *, void **, PetscTruth *) | start_function, | |||
PetscErrorCode(*)(char *, PetscTruth, void *, void *, NumericalProblem, NumericalProblem, NumericalSolution, NumericalSolution) | end_function | |||
) |
Declare a preprocessor class, by specifing its various members.
The name
argument should not contain the colon character.
Here is an explanation of the various function arguments.
this_preprocessor_setup()
: this routine is called only once, inside this function. This is a good place for defining all the preprocessors in this class
specific_setup(NumericalProblem,SalsaTransform)
: this is called at the start of a preprocessing stage; one could use this for computing matrix metadata.
global_unset(void)
: this is called in SysProFinalize().
ctx_create(NumericalProblem,void**)
: create an object that can be used for the duration of the application of this preprocessor
ctxdelete(void*)
: delete the context again
start_function
: this is the function that performs the forward transform of the problem. Prototype:
PetscErrorCode start_function (char *classmember, int optionvalue, PetscTruth overwrite, NumericalProblem problem, NumericalProblem *transformedproblem, void *globalcontext, void **localcontext, PetscTruth *success)
end_function
: this is the backtransform. Its main task is copying or backtransforming the preprocessed solution to the original solution.
PetscErrorCode end_function (char *classmember, PetscTruth overwrite, void *globalcontext, void *localcontext, NumericalProblem pproblem, NumericalProblem oproblem, NumericalSolution psolution, NumericalSolution osolution)
pproblem
and psolution
are the preprocessed quantities, the end function has to unprocess them and leave the result in oproblem
, osolution
. Actually, oproblem
is only for reference.
Definition at line 319 of file preprocess.c.
References CHKERRQ(), PreprocessorsGlobalInfo_::classstaticsetup, SystemPreprocessor_::ctxcreate, SystemPreprocessor_::ctxdelete, SystemPreprocessor_::end_function, SystemPreprocessor_::exhaustive, ierr, SystemPreprocessor_::name, NewTransform(), NPREPROCESS, npreprocess, SystemPreprocessor_::setup, SystemPreprocessor_::start_function, SystemPreprocessor_::transform, SystemPreprocessor_::unset, and unsetpreprocessor.
Referenced by DeclareApproximationPreprocessor(), DeclareDistributionPreprocessor(), DeclareFlipsignPreprocessor(), DeclareKSPPreprocessor(), DeclarePCPreprocessor(), DeclareScalingPreprocessor(), DeclareSingletonPreprocessor(), and main().
PetscErrorCode DeclarePreprocessorIntelligentChoice | ( | char * | name, | |
PetscErrorCode(*)(NumericalProblem, char **, char **) | picker | |||
) |
Install a function to pick the optimal choice for a preprocessor
Definition at line 399 of file preprocess.c.
References CHKERRQ(), ierr, SystemPreprocessor_::intelligence, and SystemPreprocessorGetByName().
Referenced by DeclareScalingPreprocessor().
PetscErrorCode GetFirstPreprocessor | ( | char ** | preprocess | ) |
Get the name of the first declared preprocessor (in order of declaration) or null if none have been declared. Subsequent preprocessors can be retrieved with GetNextPreprocessor() or SuccessorPreprocessor().
Definition at line 45 of file reporting.c.
References CHKERRQ(), GetNextPreprocessor(), ierr, and preprocessreadout.
Referenced by PreprocessedProblemSolving(), and PreprocessorsOptionsHandling().
PetscErrorCode GetNextPreprocessor | ( | char ** | next_one | ) |
Get the next preprocessor according to the variable preprocessreadout.
The result is null if there are no further preprocessors.
Definition at line 61 of file reporting.c.
References SystemPreprocessor_::name, npreprocess, and preprocessreadout.
Referenced by GetFirstPreprocessor(), and PreprocessorsOptionsHandling().
PetscErrorCode InitRetrievingPreprocessors | ( | ) |
Definition at line 169 of file reporting.c.
References preprocessreadout.
Referenced by TabReportPreprocessors().
PetscErrorCode NumericalProblemGetComm | ( | NumericalProblem | , | |
MPI_Comm * | ||||
) |
Definition at line 411 of file preprocess.c.
References NumericalProblem_::comm.
Referenced by create_solver().
PetscErrorCode PreprocessedProblemSolving | ( | NumericalProblem | problem, | |
NumericalSolution * | solution | |||
) |
Invoking this routine starts the preprocessing and ultimate solution of the numerical problem.
Definition at line 1063 of file preprocess.c.
References CHKERRQ(), PreprocessorsGlobalInfo_::errortracer, GetFirstPreprocessor(), ierr, PreprocessedSolution(), preprocesslevel, and PreprocessorsGlobalInfo_::problemsolver.
Referenced by main(), and PreprocessedLinearSystemSolution().
PetscErrorCode PreprocessedSolution | ( | char * | pclassname, | |
NumericalProblem | problem, | |||
void * | prevctx, | |||
NumericalSolution * | rsolution | |||
) |
This routine handles the application of one preprocessor. Depending on the runtime setup (see section Usage modes), one choice is applied, or a sequence of choices is applied consecutively. The forward and backward transformation of the preprocessor are done here, and if necessary, backup copies of the system are kept around.
Definition at line 868 of file preprocess.c.
References CHKERRQ(), ChooseFirstTransform(), PreprocessorsGlobalInfo_::classdynamicsetup, SystemPreprocessor_::ctxcreate, SystemPreprocessor_::ctxdelete, PreprocessorsGlobalInfo_::errortracer, SystemPreprocessor_::exhaustive, ierr, PreprocessedSolution(), preprocesslevel, PreprocessorSpecificSetup(), PreprocessorsGlobalInfo_::problemsolver, RegisterPreprocessorContext(), RegisterPreprocessorSetting(), ReportSysProCallStackState(), PreprocessorsGlobalInfo_::solutioncontextdelete, PreprocessorsGlobalInfo_::solutiondelete, SuccessorPreprocessor(), SysProPreprocessorEndFunction(), SysproPreprocessorStartFunction(), SysProProblemCloneContext(), SysProTraceMessage(), SystemPreprocessorGetByName(), SystemPreprocessor_::transform, TransformGetNextUnmarkedItem(), TransformGetUserChoices(), TransformItemGetFirstOption(), TransformItemGetNextOption(), TransformObjectGetName(), TRUTH, and SystemPreprocessor_::unset.
Referenced by PreprocessedProblemSolving(), and PreprocessedSolution().
PetscErrorCode PreprocessorGetContext | ( | char * | pre, | |
void ** | ctx | |||
) |
Definition at line 668 of file preprocess.c.
References CHKERRQ(), ierr, preprocessorcontexts, PreprocessorGetIndex(), and solutioncontext.
Referenced by setup_ksp(), and setup_pc().
PetscErrorCode PreprocessorGetIndex | ( | char * | , | |
int * | ||||
) |
Definition at line 577 of file preprocess.c.
References CHKERRQ(), ierr, and npreprocess.
Referenced by PreprocessorGetContext(), RegisterPreprocessorContext(), and SystemPreprocessorGetByName().
PetscErrorCode PreprocessorGetPreservedCategories | ( | char * | , | |
char ** | ||||
) |
Definition at line 53 of file compute.c.
References CHKERRQ(), ierr, SystemPreprocessor_::preserved, and SystemPreprocessorGetByName().
PetscErrorCode PreprocessorGetSetting | ( | char * | , | |
char ** | , | |||
int * | ||||
) |
Definition at line 545 of file preprocess.c.
References currentchoices, currentoptions, currentpreprocessors, and preprocesslevel.
Referenced by disable_ksps().
PetscErrorCode PreprocessorSetPreservedCategories | ( | char * | , | |
char * | ||||
) |
Definition at line 32 of file compute.c.
References CHKERRQ(), ierr, SystemPreprocessor_::preserved, and SystemPreprocessorGetByName().
Referenced by DeclareApproximationPreprocessor(), DeclareDistributionPreprocessor(), DeclareFlipsignPreprocessor(), DeclareKSPPreprocessor(), DeclarePCPreprocessor(), DeclareScalingPreprocessor(), and DeclareSingletonPreprocessor().
PetscErrorCode PreprocessorsOptionsHandling | ( | ) |
Process commandline options that control the behaviour of SysPro. For more information see Command line options handling.
Definition at line 46 of file options.c.
References CHKERRQ(), SystemPreprocessor_::exhaustive, GetFirstPreprocessor(), GetNextPreprocessor(), ierr, SystemPreprocessor_::optionshandling, PreprocessorSaveAprioriSelection(), ReportEnabledPreprocessors(), SystemPreprocessorGetByName(), TransformGetByName(), TransformGetNextUnmarkedItem(), TransformGetNUnmarked(), TransformItemOptionsUseOnly(), TransformObjectGetName(), TransformObjectsUseOnly(), TransformSetUserChoices(), TRUTH, and TYPELEN.
Referenced by main().
PetscErrorCode ProcessPreprocessorOptions | ( | char * | processor, | |
void * | ctx | |||
) |
PetscErrorCode RegisterPreprocessorContext | ( | char * | pre, | |
void * | ctx | |||
) |
Definition at line 646 of file preprocess.c.
References CHKERRQ(), ierr, preprocessorcontexts, PreprocessorGetIndex(), and solutioncontext.
Referenced by PreprocessedLinearSystemSolution(), and PreprocessedSolution().
PetscErrorCode ReportEnabledPreprocessors | ( | char * | name | ) |
Report preprocessor choices that are available after the specific setup has possible disabled some of the registered ones. This function uses the sysprotrace
function, so this has to have been declared.
Definition at line 387 of file reporting.c.
References CHKERRQ(), ierr, SysProHasTrace(), SysProTraceMessage(), TransformGetByName(), and TransformReportEnabled().
Referenced by PreprocessorsOptionsHandling(), and PreprocessorSpecificSetup().
PetscErrorCode ReportSysProCallStackState | ( | char * | name | ) |
Report preprocessor choices that are available after the specific setup has possible disabled some of the registered ones. This function uses the sysprotrace
function, so this has to have been declared.
Definition at line 411 of file reporting.c.
References CHKERRQ(), ierr, ScreenOutputTabLine(), SysProHasTrace(), SysProTraceMessage(), and TabReportPreprocessors().
Referenced by PreprocessedSolution().
PetscErrorCode RetrieveAllPreprocessorValues | ( | char * | , | |
char *** | , | |||
int * | ||||
) |
Definition at line 210 of file reporting.c.
References CHKERRQ(), ContinueRetrievingAllPreprocessors(), ierr, npreprocess, and preprocessreadout.
Referenced by pcoptionshandling().
PetscErrorCode RetrievePreprocessorChoice | ( | int | , | |
char ** | , | |||
int * | ||||
) |
Definition at line 565 of file preprocess.c.
References currentchoices, and currentoptions.
Referenced by ContinueRetrievingCurrentPreprocessors().
PetscErrorCode ScreenOutputTab | ( | char * | key, | |
char * | val | |||
) |
Definition at line 320 of file reporting.c.
References CHKERRQ(), ierr, SysProHasTrace(), and SysProTraceMessage().
PetscErrorCode ScreenOutputTabLine | ( | char * | key, | |
char * | val | |||
) |
Definition at line 347 of file reporting.c.
References CHKERRQ(), ierr, MAXLEN, SysProHasTrace(), and SysProTraceMessage().
Referenced by ReportSysProCallStackState().
PetscErrorCode StartRetrievingAllPreprocessors | ( | char ** | cclass, | |
char *** | types, | |||
int * | ntypes, | |||
PetscTruth * | success | |||
) |
This routine gives the class of the first declared preprocessor, and all possible values. To get the next preprocessor, call ContinueRetrievingAllPreprocessors().
The class, types, and ntypes arguments can all be null.
The types
argument is allocated internally and should be deallocated by the user.
Definition at line 157 of file reporting.c.
References CHKERRQ(), ContinueRetrievingAllPreprocessors(), ierr, and preprocessreadout.
PetscErrorCode StartRetrievingCurrentPreprocessors | ( | char ** | cclass, | |
char ** | type, | |||
int * | opt, | |||
PetscTruth * | success | |||
) |
This routine gives the class and current value of the first declared preprocessor. To get the next preprocessor, call ContinueRetrievingAllPreprocessors().
The class, types, and ntypes arguments can all be null.
Definition at line 108 of file reporting.c.
References CHKERRQ(), ContinueRetrievingCurrentPreprocessors(), ierr, and preprocessreadout.
PetscErrorCode SuccessorPreprocessor | ( | char * | this_one, | |
char ** | next_one | |||
) |
Given a preprocessor, get the name of the next one (in order of declaration) or null if there are no further ones.
The arguments are allowed to be the same.
Definition at line 78 of file reporting.c.
References CHKERRQ(), ierr, SystemPreprocessor_::name, and npreprocess.
Referenced by PreprocessedSolution().
PetscErrorCode SysProComputeQuantity | ( | NumericalProblem | theproblem, | |
char * | cat, | |||
char * | cmp, | |||
void * | res, | |||
int * | reslen, | |||
PetscTruth * | flg | |||
) |
anamod SysPro-AnaMod interface
The SysPro linear package has a few routines to facilitate integration with AnaMod
SysProComputeQuantity()
: to compute a quantity using AnaMod and store it as the metadata of a linear systemSysProRetrieveQuantity()
: to get an already computed quantitySysProFreeQuantities()
: to destroy the metadata objectSysProRemoveQuantity()
: to invalidate/free selected quantitiesThis routine is used in SysPro to compute quantities. See also SysProRetrieveQuantity().
Definition at line 23 of file syspro_anamod.c.
References CHKERRQ(), ierr, LinearSystemGetMetadata(), and LinearSystemGetParts().
Referenced by flipsign(), MatSymmetricPart(), sans_partition(), specific_flipsign_choices(), and specific_singleton_choices().
PetscErrorCode SysProDeclareErrorTracer | ( | PetscErrorCode(*)(NumericalProblem, NumericalSolution, char *) | ) |
PetscErrorCode SysProDeclareFunctions | ( | PetscErrorCode(*)(char *) | classstaticsetup, | |
PetscErrorCode(*)(char *, NumericalProblem) | classdynamicsetup, | |||
PetscErrorCode(*)(char *, char *, int, NumericalProblem, NumericalProblem) | classproblemcloner, | |||
PetscErrorCode(*)(NumericalProblem, void *, NumericalSolution *) | problemsolver, | |||
PetscErrorCode(*)(NumericalProblem) | problemdelete, | |||
PetscErrorCode(*)(NumericalProblem, NumericalSolution *) | solutioncreator, | |||
PetscErrorCode(*)(NumericalSolution, NumericalSolution) | solutioncopy, | |||
PetscErrorCode(*)(NumericalSolution) | solutiondelete, | |||
PetscErrorCode(*)(char *, char *, void *, void **) | ctxcloner, | |||
PetscErrorCode(*)(void *) | ctxfree, | |||
PetscErrorCode(*)(NumericalSolution) | solutioncontextdelete | |||
) |
Install various functions
classstaticsetup
: this function is called on each processor as it is being created; see DeclarePreprocessor().classdynamicsetup
: this function is called as any invocation of a preprocessor starts; see PreprocessedSolution();classproblemcloner
: a function to clone the context : optional see Tracing the preprocessors for more details.problemsolver
: the ultimate problem solver : requiredproblemdelete
: delete a problem objectsolutioncreator
: creates a solution object; optional, but required a preprocessor has an endfunction.solutioncopy
: guess what this does; optionalsolutiondelete
: optional, but needed if solutioncopy is usedcontextcloner
: problems can carry a context; this clones the context if a problem is copied; otherwise the pointer is simply duplicatedcontextfree
: used to delete cloned contextssolutioncontextdelete
: hm. Definition at line 440 of file preprocess.c.
References PreprocessorsGlobalInfo_::classdynamicsetup, PreprocessorsGlobalInfo_::classproblemcloner, PreprocessorsGlobalInfo_::classstaticsetup, PreprocessorsGlobalInfo_::clonecontext, PreprocessorsGlobalInfo_::freecontext, PreprocessorsGlobalInfo_::problemdelete, PreprocessorsGlobalInfo_::problemsolver, PreprocessorsGlobalInfo_::solutioncontextdelete, PreprocessorsGlobalInfo_::solutioncopy, PreprocessorsGlobalInfo_::solutioncreator, and PreprocessorsGlobalInfo_::solutiondelete.
Referenced by main().
PetscErrorCode SysProDeclareProblemMonitor | ( | PetscErrorCode(*)(NumericalProblem) | ) |
PetscErrorCode SysProDeclareTraceContext | ( | void * | ctx | ) |
PetscErrorCode SysProDeclareTraceFunction | ( | PetscErrorCode(*)(void *, char *, va_list) | fn | ) |
Specify a trace function.
The trace function has a prototype
PetscErrorCode tracefunction(void*,char*,va_list)
printf
. The first argument is a context, which can be set by SysProDeclareTraceContext().Here is an example of how you would write a trace function:
#include <stdarg.h> PetscErrorCode tracefunction(void *ctx,char *fmt,va_list argp) { char *prefix = (char*)ctx; PetscFunctionBegin; printf("%s ",prefix); vprintf(fmt, argp); PetscFunctionReturn(0); }
string.h
(probably in /usr/include
) to see which "v" versions of printf
are available.There is a default trace function SysProDefaultTrace().
You can undeclare a trace function by passing NULL.
See also SysProTraceMessage().
Definition at line 64 of file tracing.c.
References sysprotrace.
Referenced by main().
PetscErrorCode SysProDefaultTrace | ( | void * | ctx, | |
char * | fmt, | |||
va_list | argp | |||
) |
PetscErrorCode SysProFinalize | ( | ) |
Definition at line 236 of file preprocess.c.
References CHKERRQ(), currentchoices, currentoptions, currentpreprocessors, DeregisterTransform(), ierr, SystemPreprocessor_::name, npreprocess, preprocessorcontexts, SystemPreprocessor_::preserved, SystemPreprocessor_::transform, and unsetpreprocessor.
Referenced by main().
PetscErrorCode SysProFreeQuantities | ( | NumericalProblem | ) |
Definition at line 96 of file syspro_anamod.c.
References CHKERRQ(), ierr, and LinearSystemGetMetadata().
PetscErrorCode SysProGetErrorTracer | ( | PetscErrorCode(**)(NumericalProblem, NumericalSolution, char *) | ) |
PetscErrorCode SysProHasTrace | ( | PetscTruth * | flg | ) |
Test whether a trace function has been declared; see SysProDeclareTraceFunction(). Normally you would use SysProTraceMessage() which performs this test internally, but this function can be useful if a large amount of processing has to be performed to construct the trace message to begin with.
Definition at line 109 of file tracing.c.
References sysprotrace.
Referenced by ReportEnabledPreprocessors(), ReportSysProCallStackState(), ScreenOutputTab(), and ScreenOutputTabLine().
PetscErrorCode SysProInitialize | ( | ) |
Allocate SysPro globals. See also SysProFinalize().
Definition at line 211 of file preprocess.c.
References CHKERRQ(), CreateGlobalInfo(), currentchoices, currentoptions, currentpreprocessors, ierr, NPREPROCESS, preprocessorcontexts, and unsetpreprocessor.
Referenced by main().
PetscErrorCode SysProRemoveQuantity | ( | NumericalProblem | theproblem, | |
char * | cat, | |||
char * | cmp, | |||
PetscTruth * | flg | |||
) |
This routine is used to invalidate and free computed quantities. See also SysProRetrieveQuantity(), SysProComputeQuantity().
Definition at line 80 of file syspro_anamod.c.
References CHKERRQ(), ierr, and LinearSystemGetMetadata().
Referenced by singleton_specific_unset().
PetscErrorCode SysProRetrieveQuantity | ( | NumericalProblem | theproblem, | |
char * | cat, | |||
char * | cmp, | |||
void * | res, | |||
int * | reslen, | |||
PetscTruth * | flg | |||
) |
This routine is used in SysPro to retrieve already computed quantities. Reports failure if the quantity has not already been computed. See also SysProComputeQuantity().
Definition at line 52 of file syspro_anamod.c.
References CHKERRQ(), ierr, and LinearSystemGetParts().
Referenced by disable_pcs(), eliminate_singletons(), MatSymmetricPart(), set_intelligent_scaling(), specific_approximation_choices(), and specific_scaling_choices().
PetscErrorCode SysProTraceMessage | ( | char * | fmt, | |
... | ||||
) |
This function prints a trace message if a trace function has been declared; see SysProDeclareTraceFunction().
Definition at line 89 of file tracing.c.
References CHKERRQ(), ierr, sysprotrace, and sysprotracectx.
Referenced by adder(), ChooseFirstTransform(), PreprocessedSolution(), ReportEnabledPreprocessors(), ReportSysProCallStackState(), ScreenOutputTab(), ScreenOutputTabLine(), and solvebycopy().
PetscErrorCode SystemPreprocessorGetByName | ( | char * | , | |
SystemPreprocessor * | ||||
) |
Definition at line 598 of file preprocess.c.
References CHKERRQ(), ierr, and PreprocessorGetIndex().
Referenced by DeclarePCPreprocessor(), DeclarePreprocessorIntelligentChoice(), DeclarePreprocessorRequiredCategories(), PreprocessedSolution(), PreprocessorGetPreservedCategories(), PreprocessorSetPreservedCategories(), PreprocessorsOptionsHandling(), PreprocessorSpecificSetup(), and TransformGetByName().
PetscErrorCode TabReportActivePreprocessors | ( | char ** | key, | |
char ** | val, | |||
int | ||||
) |
Definition at line 309 of file reporting.c.
References CHKERRQ(), ierr, and TabReportPreprocessors().
PetscErrorCode TabReportAllPreprocessors | ( | char ** | key, | |
int | ||||
) |
Definition at line 295 of file reporting.c.
References CHKERRQ(), ierr, and TabReportPreprocessors().