00001 #include <stdlib.h>
00002 #include <stdio.h>
00003 #include <string.h>
00004 #include "petscmat.h"
00005 #include "syspro.h"
00006 #include "syspro_impl.h"
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #undef __FUNCT__
00031 #define __FUNCT__ "PreprocessorSetPreservedCategories"
00032 PetscErrorCode PreprocessorSetPreservedCategories(char *preprocess,char *cats)
00033 {
00034 SystemPreprocessor pp; PetscErrorCode ierr;
00035 PetscFunctionBegin;
00036 ierr = SystemPreprocessorGetByName(preprocess,&pp); CHKERRQ(ierr);
00037 if (!pp->preserved) {
00038 ierr = PetscStrallocpy(cats,&pp->preserved); CHKERRQ(ierr);
00039 } else {
00040 size_t l1,l2; char *cnew;
00041 ierr = PetscStrlen(pp->preserved,&l1); CHKERRQ(ierr);
00042 ierr = PetscStrlen(cats,&l2); CHKERRQ(ierr);
00043 ierr = PetscMalloc((l1+l2+2)*sizeof(char),&cnew); CHKERRQ(ierr);
00044 ierr = sprintf(cnew,"%s,%s",pp->preserved,cats);
00045 ierr = PetscFree(pp->preserved); CHKERRQ(ierr);
00046 pp->preserved = cnew;
00047 }
00048 PetscFunctionReturn(0);
00049 }
00050
00051 #undef __FUNCT__
00052 #define __FUNCT__ "PreprocessorGetPreservedCategories"
00053 PetscErrorCode PreprocessorGetPreservedCategories(char *preprocess,char **cats)
00054 {
00055 SystemPreprocessor pp; PetscErrorCode ierr;
00056 PetscFunctionBegin;
00057 ierr = SystemPreprocessorGetByName(preprocess,&pp); CHKERRQ(ierr);
00058 *cats = pp->preserved;
00059 PetscFunctionReturn(0);
00060 }
00061
00062 #undef __FUNCT__
00063 #define __FUNCT__ "DeclarePreprocessorRequiredCategories"
00064
00065
00066
00067
00068
00069
00070
00071
00072 PetscErrorCode DeclarePreprocessorRequiredCategories
00073 (char *name,char *required)
00074 {
00075 SystemPreprocessor pp;
00076 PetscErrorCode ierr;
00077 PetscFunctionBegin;
00078 ierr = SystemPreprocessorGetByName(name,&pp); CHKERRQ(ierr);
00079 ierr = PetscStrallocpy(required,&(pp->required)); CHKERRQ(ierr);
00080 PetscFunctionReturn(0);
00081 }
00082
00083 #if 0
00084 #undef __FUNCT__
00085 #define __FUNCT__ "SysProComputeQuantity"
00086 PetscErrorCode SysProComputeQuantity
00087 (NumericalProblem problem,char *cat,char *mod,void *res,PetscTruth *flg)
00088 {
00089 PetscFunctionBegin;
00090 *flg = PETSC_FALSE;
00091 PetscFunctionReturn(0);
00092 }
00093
00094 #undef __FUNCT__
00095 #define __FUNCT__ "SysProRetrieveQuantity"
00096 PetscErrorCode SysProRetrieveQuantity
00097 (NumericalProblem problem,char *cat,char *mod,void *res,PetscTruth *flg)
00098 {
00099 PetscFunctionBegin;
00100 *flg = PETSC_FALSE;
00101 PetscFunctionReturn(0);
00102 }
00103 #endif