PETSC_EXTERN PetscErrorCode PetscDLLibraryRegister_petscsys(void) #endif { PetscErrorCode ierr; PetscFunctionBegin; /* If we got here then PETSc was properly loaded */ ierr = PetscSysInitializePackage(); CHKERRQ(ierr); ierr = PetscDrawInitializePackage(); CHKERRQ(ierr); ierr = PetscViewerInitializePackage(); CHKERRQ(ierr); ierr = PetscRandomInitializePackage(); CHKERRQ(ierr); #if defined(PETSC_USE_SINGLE_LIBRARY) ierr = PetscDLLibraryRegister_petscvec(); CHKERRQ(ierr); ierr = PetscDLLibraryRegister_petscmat(); CHKERRQ(ierr); ierr = PetscDLLibraryRegister_petscdm(); CHKERRQ(ierr); ierr = PetscDLLibraryRegister_petscksp(); CHKERRQ(ierr); ierr = PetscDLLibraryRegister_petscsnes(); CHKERRQ(ierr); ierr = PetscDLLibraryRegister_petscts(); CHKERRQ(ierr); #endif PetscFunctionReturn(0); }
/*@C PetscDrawCreate - Creates a graphics context. Collective on MPI_Comm Input Parameter: + comm - MPI communicator . display - X display when using X windows . title - optional title added to top of window . x,y - coordinates of lower left corner of window or PETSC_DECIDE - w, h - width and height of window or PETSC_DECIDE or PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE, or PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE Output Parameter: . draw - location to put the PetscDraw context Level: beginner Concepts: graphics^creating context Concepts: drawing^creating context .seealso: PetscDrawSetFromOptions(), PetscDrawDestroy(), PetscDrawSetType() @*/ PetscErrorCode PetscDrawCreate(MPI_Comm comm,const char display[],const char title[],int x,int y,int w,int h,PetscDraw *indraw) { PetscDraw draw; PetscErrorCode ierr; PetscReal dpause; PetscBool flag; PetscFunctionBegin; ierr = PetscDrawInitializePackage(); CHKERRQ(ierr); *indraw = 0; ierr = PetscHeaderCreate(draw,_p_PetscDraw,struct _PetscDrawOps,PETSC_DRAW_CLASSID,"Draw","Graphics","Draw",comm,PetscDrawDestroy,0); CHKERRQ(ierr); draw->data = 0; ierr = PetscStrallocpy(title,&draw->title); CHKERRQ(ierr); ierr = PetscStrallocpy(display,&draw->display); CHKERRQ(ierr); draw->x = x; draw->y = y; draw->w = w; draw->h = h; draw->pause = 0.0; draw->coor_xl = 0.0; draw->coor_xr = 1.0; draw->coor_yl = 0.0; draw->coor_yr = 1.0; draw->port_xl = 0.0; draw->port_xr = 1.0; draw->port_yl = 0.0; draw->port_yr = 1.0; draw->popup = 0; ierr = PetscOptionsGetReal(NULL,"-draw_pause",&dpause,&flag); CHKERRQ(ierr); if (flag) draw->pause = dpause; draw->savefilename = NULL; draw->savefilemovie = PETSC_FALSE; draw->savefilecount = -1; ierr = PetscDrawSetCurrentPoint(draw,.5,.9); CHKERRQ(ierr); draw->boundbox_xl = .5; draw->boundbox_xr = .5; draw->boundbox_yl = .9; draw->boundbox_yr = .9; *indraw = draw; PetscFunctionReturn(0); }
/*@C PetscDrawCreate - Creates a graphics context. Collective on MPI_Comm Input Parameter: + comm - MPI communicator . display - X display when using X windows . title - optional title added to top of window . x,y - coordinates of lower left corner of window or PETSC_DECIDE - w, h - width and height of window or PETSC_DECIDE or PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE, or PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE Output Parameter: . draw - location to put the PetscDraw context Level: beginner Concepts: graphics^creating context Concepts: drawing^creating context .seealso: PetscDrawSetFromOptions(), PetscDrawDestroy(), PetscDrawSetType() @*/ PetscErrorCode PetscDrawCreate(MPI_Comm comm,const char display[],const char title[],int x,int y,int w,int h,PetscDraw *indraw) { PetscDraw draw; PetscErrorCode ierr; PetscReal dpause; PetscBool flag; PetscFunctionBegin; #ifndef PETSC_USE_DYNAMIC_LIBRARIES ierr = PetscDrawInitializePackage(PETSC_NULL);CHKERRQ(ierr); #endif *indraw = 0; ierr = PetscHeaderCreate(draw,_p_PetscDraw,struct _PetscDrawOps,PETSC_DRAW_CLASSID,-1,"Draw","Graphics","Draw",comm,PetscDrawDestroy,0);CHKERRQ(ierr); draw->data = 0; ierr = PetscStrallocpy(title,&draw->title);CHKERRQ(ierr); ierr = PetscStrallocpy(display,&draw->display);CHKERRQ(ierr); draw->x = x; draw->y = y; draw->w = w; draw->h = h; draw->pause = 0.0; draw->coor_xl = 0.0; draw->coor_xr = 1.0; draw->coor_yl = 0.0; draw->coor_yr = 1.0; draw->port_xl = 0.0; draw->port_xr = 1.0; draw->port_yl = 0.0; draw->port_yr = 1.0; draw->popup = 0; ierr = PetscOptionsGetReal(PETSC_NULL,"-draw_pause",&dpause,&flag);CHKERRQ(ierr); if (flag) draw->pause = dpause; draw->savefilename = PETSC_NULL; draw->savefilemovie = PETSC_FALSE; *indraw = draw; PetscFunctionReturn(0); }