System Preprocessors
|
00001 #ifndef PREPROCESS_IMPL_H 00002 #define PREPROCESS_IMPL_H 00003 00004 #include "petsc.h" 00005 #include "syspro.h" 00006 00007 #define SYSPROCHECKVALID(i,c,s) {if (!i) SETERRQ1(PETSC_COMM_SELF,1,"Null pointer for <%s>",s); if (i->cookie==0) SETERRQ1(PETSC_COMM_SELF,1,"Not a valid <%s>; maybe object has already been freed",s); if (i->cookie!=c) SETERRQ1(PETSC_COMM_SELF,1,"Not a valid <%s>",s);} 00008 #define SYSPROCHECKVALIDa(i,c,s,a) {if (!i) SETERRQ2(PETSC_COMM_SELF,1,"Null pointer for <%s>, argument %d",s,a); if (i->cookie==0) SETERRQ2(PETSC_COMM_SELF,1,"Not a valid <%s>, argument %d; maybe object has already been freed",s,a); if (i->cookie!=c) SETERRQ2(PETSC_COMM_SELF,1,"Not a valid <%s>, argument %d",s,a);} 00009 00010 #define NUMERICALPROBLEMHEADER \ 00011 MPI_Comm comm; void *ctx; 00012 00013 struct NumericalProblem_ { 00014 NUMERICALPROBLEMHEADER 00015 }; 00016 00017 struct SystemPreprocessor_ { 00018 const char *name; 00019 SalsaTransform transform; 00020 const char *preserved,*required; 00021 PetscBool exhaustive; 00022 PetscErrorCode(*setup)(NumericalProblem,SalsaTransform); 00023 PetscErrorCode(*unset)(NumericalProblem); 00024 PetscErrorCode(*ctxcreate)(NumericalProblem,void**); 00025 PetscErrorCode(*ctxdelete)(void*); 00026 PetscErrorCode(*start_function)(const char*,int,PetscBool,NumericalProblem,NumericalProblem*,void*,void**,PetscBool*); 00027 PetscErrorCode(*end_function)(const char*,PetscBool,void*,void*,NumericalProblem,NumericalProblem,NumericalSolution,NumericalSolution); 00028 PetscErrorCode(*optionshandling)(); 00029 PetscErrorCode(*intelligence)(NumericalProblem,const char**,const char**); 00030 }; 00031 00032 struct SalsaTransform_ { 00033 int cookie; 00034 char *name; PetscBool userchoices; 00035 SalsaTransformObject *transformobjects; 00036 PetscErrorCode(*suitabilityctxtester)(void*); 00037 int alloc_objects,n_objects,*aprioriselection; 00038 int n_annotate_c; char **annotations_c; 00039 int n_annotate_i; char **annotations_i; 00040 } ; 00041 00042 #endif