Ticket #60349: patch-cgnslib-4.1.1.diff

File patch-cgnslib-4.1.1.diff, 22.2 KB (added by mascguy (Christopher Nielsen), 3 years ago)
  • ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.cxx

    From 3d48a287141eb911b4888440e09c262743b4db3c Mon Sep 17 00:00:00 2001
    From: Mickael PHILIT <mickey.phy@gmail.com>
    Date: Wed, 4 Mar 2020 14:54:30 +0100
    Subject: [PATCH] Add support for new API cgio_read_***data***_type
    
    CGNS 4.1 removed old cgio API and now support providing memory data type.
    Changes are made to keep current behavior of CGNS reading.
    Data conversion is not let to CGNS with new API as it may only be stable for HDF5 files.
    ---
     ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.cxx     | 14 +--
     ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.h       |  3 +-
     ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReader.cxx    | 85 +++++++++++++------
     .../CGNSReader/vtkCGNSReaderInternal.cxx      | 44 +++++-----
     .../CGNSReader/vtkCGNSReaderInternal.h        | 53 ++++++++++--
     5 files changed, 133 insertions(+), 66 deletions(-)
    
    diff --git ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.cxx ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.cxx
    index 1e8ecae8c5..44429a4dd0 100644
    int readNodeStringData(int cgioNum, double nodeId, std::string& data) 
    4444
    4545  data.resize(size);
    4646  // read data
    47   if (cgio_read_all_data(cgioNum, nodeId, (void*)data.c_str()) != CG_OK)
     47  if (cgio_read_all_data_type(cgioNum, nodeId, "C1", (void*)data.c_str()) != CG_OK)
    4848  {
    4949    return 1;
    5050  }
    int readNodeData<char>(int cgioNum, double nodeId, std::vector<char>& data) 
    8080  data.resize(size + 1);
    8181
    8282  // read data
    83   if (cgio_read_all_data(cgioNum, nodeId, &data[0]) != CG_OK)
     83  if (cgio_read_all_data_type(cgioNum, nodeId, "C1", &data[0]) != CG_OK)
    8484  {
    8585    return 1;
    8686  }
    int readBaseIds(int cgioNum, double rootId, std::vector<double>& baseIds) 
    167167int readBaseCoreInfo(int cgioNum, double baseId, CGNSRead::BaseInformation& baseInfo)
    168168{
    169169  CGNSRead::char_33 dataType;
    170   std::vector<int> mdata;
     170  std::vector<int32_t> mdata;
    171171
    172172  if (cgio_get_name(cgioNum, baseId, baseInfo.name) != CG_OK)
    173173  {
    int readBaseCoreInfo(int cgioNum, double baseId, CGNSRead::BaseInformation& base 
    187187    return 1;
    188188  }
    189189
    190   if (CGNSRead::readNodeData<int>(cgioNum, baseId, mdata) != 0)
     190  if (CGNSRead::readNodeData<int32_t>(cgioNum, baseId, mdata) != 0)
    191191  {
    192192    std::cerr << "error while reading base dimension" << std::endl;
    193193    return 1;
    int readBaseIteration(int cgioNum, double nodeId, CGNSRead::BaseInformation& bas 
    209209  bool createTimeStates = true;
    210210  bool createIterStates = true;
    211211
    212   std::vector<int> ndata;
     212  std::vector<int32_t> ndata;
    213213  // read node data type
    214214  if (cgio_get_data_type(cgioNum, nodeId, dataType) != CG_OK)
    215215  {
    int readBaseIteration(int cgioNum, double nodeId, CGNSRead::BaseInformation& bas 
    222222    return 1;
    223223  }
    224224
    225   if (CGNSRead::readNodeData<int>(cgioNum, nodeId, ndata) != 0)
     225  if (CGNSRead::readNodeData<int32_t>(cgioNum, nodeId, ndata) != 0)
    226226  {
    227227    std::cerr << "error while reading number of state in base" << std::endl;
    228228    return 1;
    int readBaseIteration(int cgioNum, double nodeId, CGNSRead::BaseInformation& bas 
    298298      }
    299299
    300300      baseInfo.steps.clear();
    301       CGNSRead::readNodeData<int>(cgioNum, childrenIterative[nc], baseInfo.steps);
     301      CGNSRead::readNodeData<int32_t>(cgioNum, childrenIterative[nc], baseInfo.steps);
    302302      if (static_cast<int>(baseInfo.steps.size()) != nstates)
    303303      {
    304304        std::cerr << "Error reading steps node";
  • ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.h

    diff --git ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.h ParaViewCore/VTKExtensions/CGNSReader/cgio_helpers.h
    index bef0f3fbfa..07deb54ebe 100644
    inline int readNodeData(int cgioNum, double nodeId, std::vector<T>& data) 
    4646  cgsize_t size = 1;
    4747  cgsize_t dimVals[12];
    4848  int ndim;
     49  constexpr const char* dtName = CGNSRead::detail::cgns_type_name<T>();
    4950
    5051  if (cgio_get_dimensions(cgioNum, nodeId, &ndim, dimVals) != CG_OK)
    5152  {
    inline int readNodeData(int cgioNum, double nodeId, std::vector<T>& data) 
    6566  data.resize(size);
    6667
    6768  // read data
    68   if (cgio_read_all_data(cgioNum, nodeId, &data[0]) != CG_OK)
     69  if (cgio_read_all_data_type(cgioNum, nodeId, dtName, &data[0]) != CG_OK)
    6970  {
    7071    return 1;
    7172  }
  • ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReader.cxx

    diff --git ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReader.cxx ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReader.cxx
    index a1c417b810..7ca523997a 100644
    int StartsWithFlowSolution(const char* s) 
    526526
    527527  return ret;
    528528}
     529//----------------------------------------------------------------------------
     530// Small helper
     531const char* get_data_type(const CGNS_ENUMT(DataType_t) dt)
     532{
     533  const char* dataType;
     534  switch (dt)
     535  {
     536    case CGNS_ENUMV(Integer):
     537      dataType = "I4";
     538      break;
     539    case CGNS_ENUMV(LongInteger):
     540      dataType = "I8";
     541      break;
     542    case CGNS_ENUMV(RealSingle):
     543      dataType = "R4";
     544      break;
     545    case CGNS_ENUMV(RealDouble):
     546      dataType = "R8";
     547      break;
     548    case CGNS_ENUMV(Character):
     549      dataType = "C1";
     550      break;
     551    default:
     552      dataType = "MT";
     553  }
     554  return dataType;
     555}
    529556
    530557//----------------------------------------------------------------------------
    531558vtkCGNSReader::vtkCGNSReader()
    int vtkCGNSReader::vtkPrivate::getGridAndSolutionNames(int base, std::string& gr 
    672699    {
    673700      CGNSRead::char_33 gname;
    674701      const cgsize_t offset = static_cast<cgsize_t>(self->ActualTimeStep * 32);
    675       cgio_read_block_data(self->cgioNum, giterId, offset + 1, offset + 32, (void*)gname);
     702      cgio_read_block_data_type(
     703        self->cgioNum, giterId, offset + 1, offset + 32, "C1", (void*)gname);
    676704      gname[32] = '\0';
    677705      // NOTE: Names or identifiers contain no spaces and capitalization
    678706      //       is used to distinguish individual words making up a name.
    int vtkCGNSReader::vtkPrivate::getGridAndSolutionNames(int base, std::string& gr 
    732760        EndsWithPointers(nodeName))
    733761      {
    734762        CGNSRead::char_33 gname;
    735         cgio_read_block_data(self->cgioNum, iterChildId[cc],
     763        cgio_read_block_data_type(self->cgioNum, iterChildId[cc],
    736764          (cgsize_t)(self->ActualTimeStep * 32 + 1), (cgsize_t)(self->ActualTimeStep * 32 + 32),
    737           (void*)gname);
     765          "C1", (void*)gname);
    738766        gname[32] = '\0';
    739767        CGNSRead::removeTrailingWhiteSpaces(gname);
    740768        std::string tmpStr = std::string(gname);
    int vtkCGNSReader::vtkPrivate::readSolution(const std::string& solutionNameStr, 
    11971225      continue;
    11981226    }
    11991227    double cgioVarId = solChildId[ff];
     1228    const char* fieldDataType = get_data_type(cgnsVars[ff].dt);
    12001229
    12011230    // quick transfer of data because data types is given by cgns database
    12021231    if (cgnsVars[ff].isComponent == false)
    12031232    {
    1204       if (cgio_read_data(self->cgioNum, cgioVarId, fieldSrcStart, fieldSrcEnd, fieldSrcStride,
    1205             cellDim, fieldMemDims, fieldMemStart, fieldMemEnd, fieldMemStride,
     1233      if (cgio_read_data_type(self->cgioNum, cgioVarId, fieldSrcStart, fieldSrcEnd, fieldSrcStride,
     1234            fieldDataType, cellDim, fieldMemDims, fieldMemStart, fieldMemEnd, fieldMemStride,
    12061235            (void*)vtkVars[ff]->GetVoidPointer(0)) != CG_OK)
    12071236      {
    12081237        char message[81];
    12091238        cgio_error_message(message);
    1210         vtkGenericWarningMacro(<< "cgio_read_data :" << message);
     1239        vtkGenericWarningMacro(<< "cgio_read_data_type :" << message);
    12111240      }
    12121241    }
    12131242    else
    12141243    {
    1215       if (cgio_read_data(self->cgioNum, cgioVarId, fieldSrcStart, fieldSrcEnd, fieldSrcStride,
    1216             cellDim, fieldVectMemDims, fieldVectMemStart, fieldVectMemEnd, fieldVectMemStride,
     1244      if (cgio_read_data_type(self->cgioNum, cgioVarId, fieldSrcStart, fieldSrcEnd, fieldSrcStride,
     1245            fieldDataType, cellDim, fieldVectMemDims, fieldVectMemStart, fieldVectMemEnd,
     1246            fieldVectMemStride,
    12171247            (void*)vtkVars[ff]->GetVoidPointer(cgnsVars[ff].xyzIndex - 1)) != CG_OK)
    12181248      {
    12191249        char message[81];
    12201250        cgio_error_message(message);
    1221         vtkGenericWarningMacro(<< "cgio_read_data :" << message);
     1251        vtkGenericWarningMacro(<< "cgio_read_data_type :" << message);
    12221252      }
    12231253    }
    12241254    cgio_release_id(self->cgioNum, cgioVarId);
    int vtkCGNSReader::vtkPrivate::readBCData(const double nodeId, const int cellDim 
    14481478            continue;
    14491479          }
    14501480          double cgioVarId = varIds[ff];
     1481          const char* fieldDataType = get_data_type(cgnsVars[ff].dt);
    14511482
    14521483          cgsize_t dataSize = 1;
    14531484          cgsize_t dimVals[12];
    int vtkCGNSReader::vtkPrivate::readBCData(const double nodeId, const int cellDim 
    14741505            // quick transfer of data because data types is given by cgns database
    14751506            if (cgnsVars[ff].isComponent == false)
    14761507            {
    1477               if (cgio_read_all_data(
    1478                     self->cgioNum, cgioVarId, (void*)vtkVars[ff]->GetVoidPointer(0)) != CG_OK)
     1508              if (cgio_read_all_data_type(self->cgioNum, cgioVarId, fieldDataType,
     1509                    (void*)vtkVars[ff]->GetVoidPointer(0)) != CG_OK)
    14791510              {
    14801511                char message[81];
    14811512                cgio_error_message(message);
    1482                 vtkGenericWarningMacro(<< "cgio_read_data :" << message);
     1513                vtkGenericWarningMacro(<< "cgio_read_all_data_type :" << message);
    14831514              }
    14841515              if (dataSize == 1)
    14851516              {
    int vtkCGNSReader::vtkPrivate::readBCData(const double nodeId, const int cellDim 
    15101541              fieldVectMemDims[0] = fieldSrcEnd[0] * fieldVectMemStride[0];
    15111542              fieldVectMemEnd[0] = fieldSrcEnd[0] * fieldVectMemStride[0];
    15121543
    1513               if (cgio_read_data(self->cgioNum, cgioVarId, fieldSrcStart, fieldSrcEnd,
    1514                     fieldSrcStride, 1, fieldVectMemDims, fieldVectMemStart, fieldVectMemEnd,
    1515                     fieldVectMemStride,
     1544              if (cgio_read_data_type(self->cgioNum, cgioVarId, fieldSrcStart, fieldSrcEnd,
     1545                    fieldSrcStride, fieldDataType, 1, fieldVectMemDims, fieldVectMemStart,
     1546                    fieldVectMemEnd, fieldVectMemStride,
    15161547                    (void*)vtkVars[ff]->GetVoidPointer(cgnsVars[ff].xyzIndex - 1)) != CG_OK)
    15171548              {
    15181549                char message[81];
    15191550                cgio_error_message(message);
    1520                 vtkGenericWarningMacro(<< "cgio_read_data :" << message);
     1551                vtkGenericWarningMacro(<< "cgio_read_data_type :" << message);
    15211552              }
    15221553              if (dataSize == 1)
    15231554              {
    int vtkCGNSReader::GetUnstructuredZone( 
    22312262
    22322263    //
    22332264    CGNSRead::char_33 dataType;
    2234     std::vector<int> mdata;
     2265    std::vector<vtkTypeInt32> mdata;
    22352266
    22362267    if (cgio_get_name(this->cgioNum, elemIdList[sec], sectionInfoList[sec].name) != CG_OK)
    22372268    {
    int vtkCGNSReader::GetUnstructuredZone( 
    22462277      vtkErrorMacro(<< "Unexpected data type for dimension data of Element\n");
    22472278    }
    22482279
    2249     CGNSRead::readNodeData<int>(cgioNum, elemIdList[sec], mdata);
     2280    CGNSRead::readNodeData<vtkTypeInt32>(cgioNum, elemIdList[sec], mdata);
    22502281    if (mdata.size() != 2)
    22512282    {
    22522283      vtkErrorMacro(<< "Unexpected data for Elements_t node\n");
    int vtkCGNSReader::GetUnstructuredZone( 
    22672298
    22682299    if (strcmp(dataType, "I4") == 0)
    22692300    {
    2270       std::vector<int> mdata2;
    2271       CGNSRead::readNodeData<int>(this->cgioNum, elemRangeId, mdata2);
     2301      std::vector<vtkTypeInt32> mdata2;
     2302      CGNSRead::readNodeData<vtkTypeInt32>(this->cgioNum, elemRangeId, mdata2);
    22722303      if (mdata2.size() != 2)
    22732304      {
    22742305        vtkErrorMacro(<< "Unexpected data for ElementRange node\n");
    int vtkCGNSReader::GetUnstructuredZone( 
    22782309    }
    22792310    else if (strcmp(dataType, "I8") == 0)
    22802311    {
    2281       std::vector<cglong_t> mdata2;
    2282       CGNSRead::readNodeData<cglong_t>(this->cgioNum, elemRangeId, mdata2);
     2312      std::vector<vtkTypeInt64> mdata2;
     2313      CGNSRead::readNodeData<vtkTypeInt64>(this->cgioNum, elemRangeId, mdata2);
    22832314      if (mdata2.size() != 2)
    22842315      {
    22852316        vtkErrorMacro(<< "Unexpected data for ElementRange node\n");
    int vtkCGNSReader::RequestData(vtkInformation* vtkNotUsed(request), 
    44374468
    44384469      if (strcmp(dataType, "I4") == 0)
    44394470      {
    4440         std::vector<int> mdata;
    4441         CGNSRead::readNodeData<int>(this->cgioNum, baseChildId[zone], mdata);
     4471        std::vector<vtkTypeInt32> mdata;
     4472        CGNSRead::readNodeData<vtkTypeInt32>(this->cgioNum, baseChildId[zone], mdata);
    44424473        for (std::size_t index = 0; index < mdata.size(); index++)
    44434474        {
    44444475          zsize[index] = static_cast<cgsize_t>(mdata[index]);
    int vtkCGNSReader::RequestData(vtkInformation* vtkNotUsed(request), 
    44464477      }
    44474478      else if (strcmp(dataType, "I8") == 0)
    44484479      {
    4449         std::vector<cglong_t> mdata;
    4450         CGNSRead::readNodeData<cglong_t>(this->cgioNum, baseChildId[zone], mdata);
     4480        std::vector<vtkTypeInt64> mdata;
     4481        CGNSRead::readNodeData<vtkTypeInt64>(this->cgioNum, baseChildId[zone], mdata);
    44514482        for (std::size_t index = 0; index < mdata.size(); index++)
    44524483        {
    44534484          zsize[index] = static_cast<cgsize_t>(mdata[index]);
    int vtkCGNSReader::CanReadFile(const char* name) 
    47244755  }
    47254756
    47264757  // read data
    4727   if (cgio_read_all_data(cgioFile, childId, &FileVersion))
     4758  if (cgio_read_all_data_type(cgioFile, childId, "R4", &FileVersion))
    47284759  {
    47294760    vtkErrorMacro(<< "read CGNS version number");
    47304761    ierr = 0;
  • ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.cxx

    diff --git ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.cxx ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.cxx
    index 92c0d6ac51..a2bcf1a443 100644
    int setUpRind(const int cgioNum, const double rindId, int* rind) 
    3636
    3737  if (strcmp(dataType, "I4") == 0)
    3838  {
    39     std::vector<int> mdata;
    40     CGNSRead::readNodeData<int>(cgioNum, rindId, mdata);
     39    std::vector<vtkTypeInt32> mdata;
     40    CGNSRead::readNodeData<vtkTypeInt32>(cgioNum, rindId, mdata);
    4141    for (std::size_t index = 0; index < mdata.size(); index++)
    4242    {
    4343      rind[index] = static_cast<int>(mdata[index]);
    int setUpRind(const int cgioNum, const double rindId, int* rind) 
    4545  }
    4646  else if (strcmp(dataType, "I8") == 0)
    4747  {
    48     std::vector<cglong_t> mdata;
    49     CGNSRead::readNodeData<cglong_t>(cgioNum, rindId, mdata);
     48    std::vector<vtkTypeInt64> mdata;
     49    CGNSRead::readNodeData<vtkTypeInt64>(cgioNum, rindId, mdata);
    5050    for (std::size_t index = 0; index < mdata.size(); index++)
    5151    {
    5252      rind[index] = static_cast<int>(mdata[index]);
    int get_section_connectivity(const int cgioNum, const double cgioSectionId, cons 
    156156
    157157  if (sizeOfCnt == sizeof(vtkIdType))
    158158  {
    159     if (cgio_read_data(cgioNum, cgioElemConnectId, srcStart, srcEnd, srcStride, dim, memDim,
    160           memStart, memEnd, memStride, (void*)localElements) != CG_OK)
     159    if (cgio_read_data_type(cgioNum, cgioElemConnectId, srcStart, srcEnd, srcStride, dataType, dim,
     160          memDim, memStart, memEnd, memStride, (void*)localElements) != CG_OK)
    161161    {
    162162      char message[81];
    163163      cgio_error_message(message);
    164       std::cerr << "cgio_read_data :" << message;
     164      std::cerr << "cgio_read_data_type :" << message;
    165165      return 1;
    166166    }
    167167  }
    int get_section_connectivity(const int cgioNum, const double cgioSectionId, cons 
    181181        std::cerr << "Allocation failed for temporary connectivity array\n";
    182182      }
    183183
    184       if (cgio_read_data(cgioNum, cgioElemConnectId, srcStart, srcEnd, srcStride, dim, memDim,
    185             memStart, memEnd, memStride, (void*)data) != CG_OK)
     184      if (cgio_read_data_type(cgioNum, cgioElemConnectId, srcStart, srcEnd, srcStride, "I4", dim,
     185            memDim, memStart, memEnd, memStride, (void*)data) != CG_OK)
    186186      {
    187187        delete[] data;
    188188        char message[81];
    189189        cgio_error_message(message);
    190         std::cerr << "cgio_read_data :" << message;
     190        std::cerr << "cgio_read_data_type :" << message;
    191191        return 1;
    192192      }
    193193      for (cgsize_t n = 0; n < nn; n++)
    int get_section_connectivity(const int cgioNum, const double cgioSectionId, cons 
    204204        std::cerr << "Allocation failed for temporary connectivity array\n";
    205205        return 1;
    206206      }
    207       if (cgio_read_data(cgioNum, cgioElemConnectId, srcStart, srcEnd, srcStride, dim, memDim,
    208             memStart, memEnd, memStride, (void*)data) != CG_OK)
     207      if (cgio_read_data_type(cgioNum, cgioElemConnectId, srcStart, srcEnd, srcStride, "I8", dim,
     208            memDim, memStart, memEnd, memStride, (void*)data) != CG_OK)
    209209      {
    210210        delete[] data;
    211211        char message[81];
    212212        cgio_error_message(message);
    213         std::cerr << "cgio_read_data :" << message;
     213        std::cerr << "cgio_read_data_type :" << message;
    214214        return 1;
    215215      }
    216216      for (cgsize_t n = 0; n < nn; n++)
    int get_section_start_offset(const int cgioNum, const double cgioSectionId, cons 
    258258
    259259  if (sizeOfCnt == sizeof(vtkIdType))
    260260  {
    261     if (cgio_read_data(cgioNum, cgioElemOffsetId, srcStart, srcEnd, srcStride, dim, memDim,
    262           memStart, memEnd, memStride, (void*)localElementsIdx) != CG_OK)
     261    if (cgio_read_data_type(cgioNum, cgioElemOffsetId, srcStart, srcEnd, srcStride, dataType, dim,
     262          memDim, memStart, memEnd, memStride, (void*)localElementsIdx) != CG_OK)
    263263    {
    264264      char message[81];
    265265      cgio_error_message(message);
    266       std::cerr << "cgio_read_data :" << message;
     266      std::cerr << "cgio_read_data_type :" << message;
    267267      return 1;
    268268    }
    269269  }
    int get_section_start_offset(const int cgioNum, const double cgioSectionId, cons 
    283283        std::cerr << "Allocation failed for temporary connectivity offset array\n";
    284284      }
    285285
    286       if (cgio_read_data(cgioNum, cgioElemOffsetId, srcStart, srcEnd, srcStride, dim, memDim,
    287             memStart, memEnd, memStride, (void*)data) != CG_OK)
     286      if (cgio_read_data_type(cgioNum, cgioElemOffsetId, srcStart, srcEnd, srcStride, "I4", dim,
     287            memDim, memStart, memEnd, memStride, (void*)data) != CG_OK)
    288288      {
    289289        delete[] data;
    290290        char message[81];
    291291        cgio_error_message(message);
    292         std::cerr << "cgio_read_data :" << message;
     292        std::cerr << "cgio_read_data_type :" << message;
    293293        return 1;
    294294      }
    295295      for (cgsize_t n = 0; n < nn; n++)
    int get_section_start_offset(const int cgioNum, const double cgioSectionId, cons 
    306306        std::cerr << "Allocation failed for temporary connectivity array\n";
    307307        return 1;
    308308      }
    309       if (cgio_read_data(cgioNum, cgioElemOffsetId, srcStart, srcEnd, srcStride, dim, memDim,
    310             memStart, memEnd, memStride, (void*)data) != CG_OK)
     309      if (cgio_read_data_type(cgioNum, cgioElemOffsetId, srcStart, srcEnd, srcStride, "I8", dim,
     310            memDim, memStart, memEnd, memStride, (void*)data) != CG_OK)
    311311      {
    312312        delete[] data;
    313313        char message[81];
    314314        cgio_error_message(message);
    315         std::cerr << "cgio_read_data :" << message;
     315        std::cerr << "cgio_read_data_type :" << message;
    316316        return 1;
    317317      }
    318318      for (cgsize_t n = 0; n < nn; n++)
  • ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.h

    diff --git ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.h ParaViewCore/VTKExtensions/CGNSReader/vtkCGNSReaderInternal.h
    index 4bcfd5c75a..3df3bae8de 100644
    struct is_float<float> 
    7272};
    7373}
    7474
     75namespace detail
     76{
     77template <typename T>
     78constexpr const char* cgns_type_name() noexcept
     79{
     80  return "MT";
     81}
     82
     83template <>
     84constexpr const char* cgns_type_name<float>() noexcept
     85{
     86  return "R4";
     87}
     88
     89template <>
     90constexpr const char* cgns_type_name<double>() noexcept
     91{
     92  return "R8";
     93}
     94
     95template <>
     96constexpr const char* cgns_type_name<vtkTypeInt32>() noexcept
     97{
     98  return "I4";
     99}
     100
     101template <>
     102constexpr const char* cgns_type_name<vtkTypeInt64>() noexcept
     103{
     104  return "I8";
     105}
     106}
     107
    75108typedef char char_33[33];
    76109
    77110//------------------------------------------------------------------------------
    class BaseInformation 
    206239public:
    207240  char_33 name;
    208241
    209   int cellDim;
    210   int physicalDim;
     242  int32_t cellDim;
     243  int32_t physicalDim;
    211244  //
    212245  int baseNumber;
    213246
    214   std::vector<int> steps;
     247  std::vector<int32_t> steps;
    215248  std::vector<double> times;
    216249
    217250  // For unsteady meshes :
    int get_XYZ_mesh(const int cgioNum, const std::vector<double>& gridChildId, 
    469502    // quick transfer of data if same data types
    470503    if (sameType == true)
    471504    {
    472       if (cgio_read_data(cgioNum, coordId, srcStart, srcEnd, srcStride, cellDim, memEnd, memStart,
    473             memEnd, memStride, (void*)currentCoord))
     505      constexpr const char* dtNameT = detail::cgns_type_name<T>();
     506      if (cgio_read_data_type(cgioNum, coordId, srcStart, srcEnd, srcStride, dtNameT, cellDim,
     507            memEnd, memStart, memEnd, memStride, (void*)currentCoord))
    474508      {
    475509        char message[81];
    476510        cgio_error_message(message);
    477         std::cerr << "cgio_read_data :" << message;
     511        std::cerr << "cgio_read_data_type :" << message;
    478512      }
    479513    }
    480514    else
    481515    {
     516      constexpr const char* dtNameY = detail::cgns_type_name<Y>();
    482517      Y* dataArray = 0;
    483518      const cgsize_t memNoStride[3] = { 1, 1, 1 };
    484519
    int get_XYZ_mesh(const int cgioNum, const std::vector<double>& gridChildId, 
    489524        std::cerr << "Error allocating buffer array\n";
    490525        break;
    491526      }
    492       if (cgio_read_data(cgioNum, coordId, srcStart, srcEnd, srcStride, cellDim, memDims, memStart,
    493             memDims, memNoStride, (void*)dataArray))
     527      if (cgio_read_data_type(cgioNum, coordId, srcStart, srcEnd, srcStride, dtNameY, cellDim,
     528            memDims, memStart, memDims, memNoStride, (void*)dataArray))
    494529      {
    495530        delete[] dataArray;
    496531        char message[81];
    497532        cgio_error_message(message);
    498         std::cerr << "Buffer array cgio_read_data :" << message;
     533        std::cerr << "Buffer array cgio_read_data_type :" << message;
    499534        break;
    500535      }
    501536      for (vtkIdType ii = 0; ii < nPts; ++ii)