CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > ParaView

PARAVIEW Grid visualization

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 23, 2007, 07:15
Default PARAVIEW Grid visualization
  #1
simone Marras
Guest
 
Posts: n/a
Hello, Im struggling in having paraview read my structure grid file. I tried towrite it as a DATASET RECTILINEAR_GRID and DATASET STRUCTURED_GRID with the routines here below, but when i open the data from paraview it says it doesn't have a reader for them and doesn't view anything. Can anyone help me by sending me his file format as a txt file so that Ill write mine with that same structure?

Thank you very much s.

1) "DATASET RECTILINEAR_GRID"

/* File grid.vts */

if((xy_grid = fopen("grid.vts", "w")) == NULL)

printf("The grid file could not be open\n");

else{

fprintf(xy_grid, "# vtk DataFile Version 2.0\n");

fprintf(xy_grid, "Grid\n");

fprintf(xy_grid, "ASCII\n");

fprintf(xy_grid, "\n");

fprintf(xy_grid, "DATASET RECTILINEAR_GRID\n");

fprintf(xy_grid, "DIMENSIONS %d %d\n", nx, ny, nz);

fprintf(xy_grid, "X_COORDINATES %d float\n", nx);

for(i=0; i<=nx-1; i++)

fprintf(xy_grid, "%f\t", x[i]);

fprintf(xy_grid, "\n Y_COORDINATES %d float\n", ny);

for(j=0; j<=ny-1; j++)

fprintf(xy_grid, "%f\t", y[j]);

fprintf(xy_grid, "\n Z_COORDINATES %d float\n", nz);

fprintf(xy_grid, "%f\t", z);

fprintf(xy_grid, "\n");

}

fclose(xy_grid);

2)"DATASET STRUCTURED_GRID"

/* File grid_m.dat for Octave visulaization *

wrt_fmat(imax*jmax-1, 0, "grid.msh", mesh);*/

/* File grid.vts *

//if((xy_grid = fopen(file_grid_name, "w")) == NULL)

if((xy_grid = fopen("grid.vts", "w")) == NULL)

printf("The grid file could not be open\n");

else{

fprintf(xy_grid, "# vtk DataFile Version 2.0\n");

fprintf(xy_grid, "Grid\n");

fprintf(xy_grid, "ASCII\n");

fprintf(xy_grid, "\n");

fprintf(xy_grid, "DATASET STRUCTURED_GRID\n");

fprintf(xy_grid, "DIMENSIONS %d %d\n", nx, ny, nz);

fprintf(xy_grid, "POINTS %d\n float", n);

//fprintf(xy_grid, "ORIGIN 0.000 0.000 0.000\n");

//fprintf(xy_grid, "SPACING 1.000 1.000 0.000\n");

fprintf(xy_grid, "\n");

///fprintf(xy_grid, "POINT_DATA %d\n", nx*ny*nz);

f//printf(xy_grid, "VECTORS vectors float\n");

//fprintf(xy_grid, "\n");*

for(i=0; i<=imax*jmax; i++)

for(j=0; j<=2; j++){

fprintf(xy_grid, "%.4f ", mesh[i][j]);

fprintf(xy_grid, " \n");

}

}

fclose(xy_grid);*/

  Reply With Quote

Old   January 23, 2007, 08:03
Default Re: PARAVIEW Grid visualization
  #2
Renato.
Guest
 
Posts: n/a
I hate the VTK's formats and in my case I chose the Ensight format to write my files. It's very simple to understand and implement and ParaView is able to read it.

I've put some Fortran routines to write Ensight files available at http://www.nacad.ufrj.br/~rnelias/paraview

Cheers

Renato.

  Reply With Quote

Old   January 23, 2007, 08:05
Default Re: PARAVIEW Grid visualization
  #3
simone Marras
Guest
 
Posts: n/a
Thank you very much renato, Ill follow your suggestions!

simone
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
View grid coordinates in Paraview ozzythewise OpenFOAM Paraview & paraFoam 1 June 30, 2010 11:04
Beginner's Question - cannot see grid in ParaView fishlurch OpenFOAM 3 January 7, 2010 09:49
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 21:41
Paraview file format for collocated grid hadian ParaView 0 February 13, 2008 09:55
Combustion Convergence problems Art Stretton Phoenics 5 April 2, 2002 04:59


All times are GMT -4. The time now is 04:18.