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(1,"Null pointer for <%s>",s); if (i->cookie!=c) SETERRQ1(1,"Not a valid <%s>",s);}
00008 #define SYSPROCHECKVALIDa(i,c,s,a) {if (!i) SETERRQ2(1,"Null pointer for <%s>, argument %d",s,a); if (i->cookie!=c) SETERRQ2(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 char *name;
00019 SalsaTransform transform;
00020 char *preserved,*required;
00021 PetscTruth exhaustive;
00022 PetscErrorCode(*setup)(NumericalProblem,SalsaTransform);
00023 PetscErrorCode(*unset)(NumericalProblem);
00024 PetscErrorCode(*ctxcreate)(NumericalProblem,void**);
00025 PetscErrorCode(*ctxdelete)(void*);
00026 PetscErrorCode(*start_function)(char*,int,PetscTruth,NumericalProblem,NumericalProblem*,void*,void**,PetscTruth*);
00027 PetscErrorCode(*end_function)(char*,PetscTruth,void*,void*,NumericalProblem,NumericalProblem,NumericalSolution,NumericalSolution);
00028 PetscErrorCode(*optionshandling)();
00029 PetscErrorCode(*intelligence)(NumericalProblem,char**,char**);
00030 };
00031
00032 struct SalsaTransformObject_ {
00033 char *name,*explanation;
00034 SalsaTransform transform;
00035 int n_options,alloc_options,*options; char *option,**optionexplanation;
00036 int *options_marked; int active_option;
00037 int alloc_annotate_c; char **annotate_c;
00038 int alloc_annotate_i,*annotate_i;
00039 int marked;
00040 PetscErrorCode(*suitabilityfunction)
00041 (NumericalProblem,void*,SuitabilityValue*);
00042 void *suitabilityctx;
00043 };
00044
00045 struct SalsaTransform_ {
00046 char *name; PetscTruth userchoices;
00047 SalsaTransformObject *transformobjects;
00048 int alloc_objects,n_objects,*aprioriselection;
00049 int n_annotate_c; char **annotations_c;
00050 int n_annotate_i; char **annotations_i;
00051 } ;
00052
00053 #endif