CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] PARAVIEW Grid visualization

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2007, 08: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, 09: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, 09: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


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Visualization of a 3D Flow field (paraview) Chris123 ParaView 2 November 27, 2018 09:51
[Other] Mesh quality visualization in paraview Lieven OpenFOAM Meshing & Mesh Conversion 3 June 20, 2018 20:03
paraview installation woes vex OpenFOAM Installation 15 January 30, 2011 08:11
paraFoam reader for OpenFOAM 1.6 smart OpenFOAM Installation 13 November 16, 2009 22:41
Visualization on unstructured grid Jim K Main CFD Forum 3 July 24, 2005 04:13


All times are GMT -4. The time now is 17:43.