System Preprocessors
u1.c
Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include "syspro.h"
00003 
00004 /* Test for global allocations */
00005 
00006 static PetscErrorCode copy
00007 (NumericalProblem problem,void *dum,NumericalSolution *rsol)
00008 {
00009   NumericalSolution sol; PetscErrorCode ierr;
00010   PetscFunctionBegin;
00011   ierr = PetscMalloc(sizeof(int),(int**)&sol); CHKERRQ(ierr);
00012   *(int*)sol = *(int*)problem;
00013   *rsol = sol;
00014   PetscFunctionReturn(0);
00015 }
00016 
00017 int main(int argc,char **argv) {
00018   PetscErrorCode ierr;
00019   PetscInitialize(&argc,&argv,0,0);
00020   ierr = SysProInitialize(); CHKERRQ(ierr);
00021   ierr = SysProDeclareFunctions
00022     (NULL,NULL,NULL,copy,NULL,NULL,NULL,NULL,NULL,NULL,NULL); CHKERRQ(ierr);
00023   ierr = SysProFinalize(); CHKERRQ(ierr);
00024   PetscFinalize();
00025   return 0;
00026 }