Nathan Collier avatar Nathan Collier committed 5de65db

changed VMS monitor function to use IGAWriteVec

Comments (0)

Files changed (1)


 typedef struct {
   PetscReal nu;
   PetscScalar fx,fy,fz;
+  IGA iga;
 } AppCtx;
 #undef __FUNCT__
 #undef __FUNCT__
-#define __FUNCT__ "WriteSolution"
-PetscErrorCode WriteSolution(Vec C, const char pattern[],int number)
+#define __FUNCT__ "OutputMonitor"
+PetscErrorCode OutputMonitor(TS ts,PetscInt it_number,PetscReal c_time,Vec U,void *mctx)
-  PetscErrorCode  ierr;
-  MPI_Comm        comm;
-  char            filename[256];
-  PetscViewer     viewer;
-  PetscFunctionBegin;
-  sprintf(filename,pattern,number);
-  ierr = PetscObjectGetComm((PetscObject)C,&comm);CHKERRQ(ierr);
-  ierr = PetscViewerBinaryOpen(comm,filename,FILE_MODE_WRITE,&viewer);CHKERRQ(ierr);
-  ierr = VecView(C,viewer);CHKERRQ(ierr);
-  ierr = PetscViewerFlush(viewer);CHKERRQ(ierr);
-  ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
+  PetscErrorCode ierr;
+  AppCtx *user = (AppCtx *)mctx;
+  char           filename[256];
+  sprintf(filename,"./nsvms%d.dat",it_number);
+  ierr = IGAWriteVec(user->iga,U,filename);CHKERRQ(ierr);
-#undef __FUNCT__
-#define __FUNCT__ "OutputMonitor"
-PetscErrorCode OutputMonitor(TS ts,PetscInt step,PetscReal t,Vec U,void *mctx)
-  PetscErrorCode ierr;
-  PetscFunctionBegin;
-  ierr = WriteSolution(U,"nsvms%d.dat",step);CHKERRQ(ierr);
-  PetscFunctionReturn(0);
 #undef __FUNCT__
 #define __FUNCT__ "main"
   ierr = IGACreate(PETSC_COMM_WORLD,&iga);CHKERRQ(ierr);
   ierr = IGASetDim(iga,3);CHKERRQ(ierr);
   ierr = IGASetDof(iga,4);CHKERRQ(ierr);
+  user.iga = iga;
   IGAAxis axis0;
   ierr = IGAGetAxis(iga,0,&axis0);CHKERRQ(ierr);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.