[petsc-users] VTS writer

Kharche, Sanjay S.R.Kharche at exeter.ac.uk
Wed Apr 29 02:10:30 CDT 2015


Dear All

I forgot to put the "3" or more lines of code I am using. Here they are.

> I am using the following 3 lines to write vts files. It is a structured FD mesh. I now have difference space steps in the 3 directions: it is 1 and 1 in X and Y directions, and 2 in Z direction. Can anyone say how to write this to the vts header?


// FD spacing in each direction
#define DX           0.250                /* X internode spacing                    */
#define DY           0.250                /* Y internode spacing                    */
#define DZ           0.500                /* Z internode spacing: See suppl of paper. */
.
.
main(){
.
.
			sprintf(str,"my_3d%d.vts",file_Counter++);
			PetscViewer viewer;
				PetscViewerVTKOpen(PETSC_COMM_WORLD,str,FILE_MODE_WRITE, &viewer);
				VecView(u, viewer);
			PetscViewerDestroy(&viewer);


More information about the petsc-users mailing list