/[escript]/trunk/finley/src/Mesh_saveVTK.c
ViewVC logotype

Diff of /trunk/finley/src/Mesh_saveVTK.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 818 by dhawcroft, Sun Aug 27 11:10:34 2006 UTC revision 850 by gross, Sun Sep 17 23:27:00 2006 UTC
# Line 452  void Finley_Mesh_saveVTK_MPIO(const char Line 452  void Finley_Mesh_saveVTK_MPIO(const char
452              "<UnstructuredGrid>\n" \              "<UnstructuredGrid>\n" \
453              "<Piece NumberOfPoints=\"%d\" NumberOfCells=\"%d\">\n" \              "<Piece NumberOfPoints=\"%d\" NumberOfCells=\"%d\">\n" \
454              "<Points>\n" \              "<Points>\n" \
455              "<DataArray NumberOfComponents=\"%d\" type=\"Float32\" format=\"ascii\">\n"              "<DataArray NumberOfComponents=\"%d\" type=\"Float64\" format=\"ascii\">\n"
456              ,numPoints,numGlobalCells,MAX(3,nDim));              ,numPoints,numGlobalCells,MAX(3,nDim));
457    
458    
# Line 845  void Finley_Mesh_saveVTK_MPIO(const char Line 845  void Finley_Mesh_saveVTK_MPIO(const char
845          if( myRank == 0)          if( myRank == 0)
846          {          {
847            char header[250];            char header[250];
848            sprintf(header,"<DataArray Name=\"%s\" type=\"Float32\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);            sprintf(header,"<DataArray Name=\"%s\" type=\"Float64\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);
849            MPI_File_iwrite_shared(fh,header,strlen(header),MPI_CHAR,&req);            MPI_File_iwrite_shared(fh,header,strlen(header),MPI_CHAR,&req);
850            MPI_Wait(&req,&status);            MPI_Wait(&req,&status);
851          }          }
# Line 1042  void Finley_Mesh_saveVTK_MPIO(const char Line 1042  void Finley_Mesh_saveVTK_MPIO(const char
1042          if( myRank == 0)          if( myRank == 0)
1043          {          {
1044            char header[250];            char header[250];
1045            sprintf(header, "<DataArray Name=\"%s\" type=\"Float32\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);            sprintf(header, "<DataArray Name=\"%s\" type=\"Float64\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);
1046            MPI_File_iwrite_shared(fh,header,strlen(header),MPI_CHAR,&req);            MPI_File_iwrite_shared(fh,header,strlen(header),MPI_CHAR,&req);
1047            MPI_Wait(&req,&status);            MPI_Wait(&req,&status);
1048          }          }
# Line 1523  void Finley_Mesh_saveVTK(const char * fi Line 1523  void Finley_Mesh_saveVTK(const char * fi
1523    * the reason for this if statement is explained in the long comment below    * the reason for this if statement is explained in the long comment below
1524    */    */
1525    nDim = mesh_p->Nodes->numDim;    nDim = mesh_p->Nodes->numDim;
1526    fprintf(fileHandle_p, "<DataArray NumberOfComponents=\"%d\" type=\"Float32\" format=\"ascii\">\n",MAX(3,nDim));    fprintf(fileHandle_p, "<DataArray NumberOfComponents=\"%d\" type=\"Float64\" format=\"ascii\">\n",MAX(3,nDim));
1527    /* vtk/mayavi doesn't like 2D data, it likes 3D data with a degenerate    /* vtk/mayavi doesn't like 2D data, it likes 3D data with a degenerate
1528    * third dimension to handle 2D data (like a sheet of paper).  So, if    * third dimension to handle 2D data (like a sheet of paper).  So, if
1529    * nDim is 2, we have to append zeros to the array to get this third    * nDim is 2, we have to append zeros to the array to get this third
# Line 1712  void Finley_Mesh_saveVTK(const char * fi Line 1712  void Finley_Mesh_saveVTK(const char * fi
1712            }            }
1713            nCompReqd = 9;            nCompReqd = 9;
1714          }          }
1715          fprintf(fileHandle_p, "<DataArray Name=\"%s\" type=\"Float32\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);          fprintf(fileHandle_p, "<DataArray Name=\"%s\" type=\"Float64\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);
1716    
1717          double sampleAvg[nComp];          double sampleAvg[nComp];
1718          for (i=0; i<numCells; i++)          for (i=0; i<numCells; i++)
# Line 1846  void Finley_Mesh_saveVTK(const char * fi Line 1846  void Finley_Mesh_saveVTK(const char * fi
1846            }            }
1847            nCompReqd = 9;            nCompReqd = 9;
1848          }          }
1849          fprintf(fileHandle_p, "<DataArray Name=\"%s\" type=\"Float32\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);          fprintf(fileHandle_p, "<DataArray Name=\"%s\" type=\"Float64\" NumberOfComponents=\"%d\" format=\"ascii\">\n",names_p[i_data], nCompReqd);
1850          /* write out the data */          /* write out the data */
1851          /* if the number of required components is more than the number          /* if the number of required components is more than the number
1852          * of actual components, pad with zeros          * of actual components, pad with zeros

Legend:
Removed from v.818  
changed lines
  Added in v.850

  ViewVC Help
Powered by ViewVC 1.1.26