/[escript]/branches/windows_from_1456_trunk_1574_merged_in/finley/src/Mesh_saveVTK.c
ViewVC logotype

Diff of /branches/windows_from_1456_trunk_1574_merged_in/finley/src/Mesh_saveVTK.c

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

revision 1579 by phornby, Wed May 28 11:13:51 2008 UTC revision 1580 by phornby, Tue Jun 3 14:03:40 2008 UTC
# Line 51  void Finley_Mesh_saveVTK(const char * fi Line 51  void Finley_Mesh_saveVTK(const char * fi
51  {  {
52    char error_msg[LenErrorMsg_MAX], *txt_buffer=NULL, tmp_buffer[LEN_TMP_BUFFER];    char error_msg[LenErrorMsg_MAX], *txt_buffer=NULL, tmp_buffer[LEN_TMP_BUFFER];
53    double sampleAvg[NCOMP_MAX], *values, rtmp;    double sampleAvg[NCOMP_MAX], *values, rtmp;
54    size_t len_txt_buffer, max_len_names, txt_buffer_in_use;    size_t txt_buffer_in_use;
55      dim_t len_txt_buffer,  max_len_names;
56    FILE * fileHandle_p = NULL;    FILE * fileHandle_p = NULL;
57    int mpi_size, i, j, cellType;    int mpi_size, i, j, cellType;
58    dim_t i_data;    dim_t i_data;
# Line 230  void Finley_Mesh_saveVTK(const char * fi Line 231  void Finley_Mesh_saveVTK(const char * fi
231           } else {           } else {
232             write_pointdata=TRUE;             write_pointdata=TRUE;
233           }           }
234           max_len_names =MAX(max_len_names,strlen(names_p[i_data]));           max_len_names =MAX(max_len_names,(dim_t)strlen(names_p[i_data]));
235         }         }
236       }       }
237       nodetype = (nodetype == FINLEY_UNKNOWN) ? FINLEY_NODES : nodetype;       nodetype = (nodetype == FINLEY_UNKNOWN) ? FINLEY_NODES : nodetype;
# Line 400  void Finley_Mesh_saveVTK(const char * fi Line 401  void Finley_Mesh_saveVTK(const char * fi
401    /*   allocate text buffer              */    /*   allocate text buffer              */
402    /*                                     */    /*                                     */
403    max_name_len=0;    max_name_len=0;
404    for (i_data =0 ;i_data<num_data;++i_data) max_name_len=MAX(max_name_len,strlen(names_p[i_data]));    for (i_data =0 ;i_data<num_data;++i_data) max_name_len=MAX(max_name_len,(dim_t)strlen(names_p[i_data]));
405    len_txt_buffer= strlen(tags_header) + 3 * LEN_PRINTED_INT_FORMAT + (30+3*max_name_len); /* header */    len_txt_buffer= strlen(tags_header) + 3 * LEN_PRINTED_INT_FORMAT + (30+3*max_name_len); /* header */
406    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, myNumPoints * LEN_TMP_BUFFER);    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, myNumPoints * LEN_TMP_BUFFER);
407    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, numCellFactor*myNumCells*(LEN_PRINTED_INT_FORMAT*numVTKNodesPerElement+1));    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, numCellFactor*myNumCells*(LEN_PRINTED_INT_FORMAT*numVTKNodesPerElement+1));
408    len_txt_buffer=MAX(len_txt_buffer,200+3*max_len_names);    len_txt_buffer=MAX(len_txt_buffer,200+3*max_len_names);
409    len_txt_buffer=MAX(len_txt_buffer, strlen(tag_Float_DataArray) + LEN_PRINTED_INT_FORMAT + max_len_names);    len_txt_buffer=MAX(len_txt_buffer, (dim_t)strlen(tag_Float_DataArray) + LEN_PRINTED_INT_FORMAT + max_len_names);
410    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, numCellFactor*myNumCells*LEN_PRINTED_FLOAT_TENSOR_FORMAT);    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, numCellFactor*myNumCells*LEN_PRINTED_FLOAT_TENSOR_FORMAT);
411    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, myNumPoints*LEN_PRINTED_FLOAT_TENSOR_FORMAT);    if (mpi_size > 1) len_txt_buffer=MAX(len_txt_buffer, myNumPoints*LEN_PRINTED_FLOAT_TENSOR_FORMAT);
412    txt_buffer=TMPMEMALLOC(len_txt_buffer+1,char);    txt_buffer=TMPMEMALLOC(len_txt_buffer+1,char);

Legend:
Removed from v.1579  
changed lines
  Added in v.1580

  ViewVC Help
Powered by ViewVC 1.1.26