/[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

temp_trunk_copy/finley/src/Mesh_saveVTK.c revision 1384 by phornby, Fri Jan 11 02:29:38 2008 UTC trunk/finley/src/Mesh_saveVTK.c revision 1572 by gross, Mon May 26 12:50:56 2008 UTC
# Line 60  void Finley_Mesh_saveVTK(const char * fi Line 60  void Finley_Mesh_saveVTK(const char * fi
60    index_t myFirstNode, myLastNode, *globalNodeIndex, k, *node_index, myFirstCell;    index_t myFirstNode, myLastNode, *globalNodeIndex, k, *node_index, myFirstCell;
61    #ifdef PASO_MPI    #ifdef PASO_MPI
62    int ierr;    int ierr;
63    int amode = MPI_MODE_CREATE | MPI_MODE_WRONLY |  MPI_MODE_SEQUENTIAL;    int amode = MPI_MODE_CREATE | MPI_MODE_WRONLY |  MPI_MODE_SEQUENTIAL;
64    MPI_File mpi_fileHandle_p;    MPI_File mpi_fileHandle_p;
65    MPI_Status mpi_status;    MPI_Status mpi_status;
66    MPI_Request mpi_req;    MPI_Request mpi_req;
# Line 128  void Finley_Mesh_saveVTK(const char * fi Line 128  void Finley_Mesh_saveVTK(const char * fi
128              /*   MPI_Info_set(mpi_info, "direct_write",          "true"); */              /*   MPI_Info_set(mpi_info, "direct_write",          "true"); */
129            #endif            #endif
130            ierr=MPI_File_open(mesh_p->Nodes->MPIInfo->comm, (char*)filename_p, amode,mpi_info, &mpi_fileHandle_p);            ierr=MPI_File_open(mesh_p->Nodes->MPIInfo->comm, (char*)filename_p, amode,mpi_info, &mpi_fileHandle_p);
131            if (! ierr) {            if (ierr != MPI_SUCCESS) {
132            perror(filename_p);            perror(filename_p);
133                sprintf(error_msg, "saveVTK: File %s could not be opened for writing in parallel.", filename_p);                sprintf(error_msg, "saveVTK: File %s could not be opened for writing in parallel.", filename_p);
134                Finley_setError(IO_ERROR,error_msg);                Finley_setError(IO_ERROR,error_msg);
# Line 274  void Finley_Mesh_saveVTK(const char * fi Line 274  void Finley_Mesh_saveVTK(const char * fi
274         myNumCells= Finley_ElementFile_getMyNumElements(elements);         myNumCells= Finley_ElementFile_getMyNumElements(elements);
275         myFirstCell= Finley_ElementFile_getFirstElement(elements);         myFirstCell= Finley_ElementFile_getFirstElement(elements);
276         NN = elements->numNodes;         NN = elements->numNodes;
277         if (nodetype==FINLEY_REDUCED_NODES || nodetype==FINLEY_REDUCED_NODES) {         if (nodetype==FINLEY_REDUCED_NODES) {
278            TypeId = elements->LinearReferenceElement->Type->TypeId;            TypeId = elements->LinearReferenceElement->Type->TypeId;
279         } else {         } else {
280            TypeId = elements->ReferenceElement->Type->TypeId;            TypeId = elements->ReferenceElement->Type->TypeId;
# Line 590  void Finley_Mesh_saveVTK(const char * fi Line 590  void Finley_Mesh_saveVTK(const char * fi
590      } else {      } else {
591         fprintf(fileHandle_p,tags_End_Offset_and_Start_Type);         fprintf(fileHandle_p,tags_End_Offset_and_Start_Type);
592      }      }
       
         
593       /* write element type */       /* write element type */
594       sprintf(tmp_buffer, INT_NEWLINE_FORMAT, cellType);       sprintf(tmp_buffer, INT_NEWLINE_FORMAT, cellType);
595       if ( mpi_size > 1) {       if ( mpi_size > 1) {
# Line 961  void Finley_Mesh_saveVTK(const char * fi Line 959  void Finley_Mesh_saveVTK(const char * fi
959                 MPI_Info_free(&mpi_info);                 MPI_Info_free(&mpi_info);
960                 #undef MPIO_HINTS                 #undef MPIO_HINTS
961               #endif               #endif
              MPI_File_close(&mpi_fileHandle_p);  
962            #endif            #endif
963          }          }
964            #ifdef PASO_MPI
965               MPI_File_close(&mpi_fileHandle_p);
966            #endif
967       } else {       } else {
968           fprintf(fileHandle_p,footer);           fprintf(fileHandle_p,footer);
969           fclose(fileHandle_p);           fclose(fileHandle_p);

Legend:
Removed from v.1384  
changed lines
  Added in v.1572

  ViewVC Help
Powered by ViewVC 1.1.26