Salome HOME
Management of int64 fields into medcoupling.
[tools/medcoupling.git] / src / MEDLoader / MEDLoader.cxx
index 597b25fc14396a1b8500e95bd4966a08aab57ee7..687d0bcbf35a6d6c4b3b25c6b29c96bf83af4a3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2020  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -30,7 +30,7 @@
 #include "MEDCouplingMemArray.hxx"
 #include "MEDCouplingFieldDouble.hxx"
 #include "MEDCouplingFieldFloat.hxx"
-#include "MEDCouplingFieldInt.hxx"
+#include "MEDCouplingFieldInt32.hxx"
 #include "MEDCouplingGaussLocalization.hxx"
 #include "MEDCouplingTraits.hxx"
 #include "MCAuto.hxx"
@@ -146,6 +146,20 @@ using namespace MEDCoupling;
 
 /// @cond INTERNAL
 
+INTERP_KERNEL::NormalizedCellType ConvertGeometryType(med_geometry_type geotype)
+{
+  INTERP_KERNEL::NormalizedCellType result=INTERP_KERNEL::NORM_ERROR;
+  for(int i=0; i<MED_N_CELL_FIXED_GEO; i++)
+    {
+      if (typmai[i]==geotype)
+        {
+          result=typmai2[i];
+          break;
+        }
+    }
+  return result;
+}
+
 /*!
  * This method returns a first quick overview of mesh with name \a meshName into the file \a fileName.
  * @param possibilities the relativeToMeshDim authorized to returned maxdim. This vector is systematically cleared at the begin of this method.
@@ -1249,11 +1263,11 @@ MCAuto<MEDCoupling::MEDCouplingField> MEDCoupling::ReadField(const std::string&
       }
   }
   {
-    MCAuto<MEDFileIntField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileIntField1TS>(f));
+    MCAuto<MEDFileInt32Field1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileInt32Field1TS>(f));
     if(f1.isNotNull())
       {
-        MCAuto<MEDCoupling::MEDCouplingFieldInt> ret(f1->field(mesh));
-        return MEDCoupling::DynamicCast<MEDCouplingFieldInt,MEDCouplingField>(ret);
+        MCAuto<MEDCoupling::MEDCouplingFieldInt32> ret(f1->field(mesh));
+        return MEDCoupling::DynamicCast<MEDCouplingFieldInt32,MEDCouplingField>(ret);
       }
   }
   {
@@ -1376,10 +1390,10 @@ namespace MEDCoupling
         }
     }
     {
-      MCAuto<MEDFileIntField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileIntField1TS>(f));
+      MCAuto<MEDFileInt32Field1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileInt32Field1TS>(f));
       if(f1.isNotNull())
         {
-          MCAuto<MEDCoupling::MEDCouplingFieldInt> ret(ReadFieldCellLikeT<int>(f1,type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+          MCAuto<MEDCoupling::MEDCouplingFieldInt32> ret(ReadFieldCellLikeT<int>(f1,type,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
           return ret.retn();
         }
     }
@@ -1453,10 +1467,10 @@ MEDCoupling::MEDCouplingField *MEDCoupling::ReadFieldNode(const std::string& fil
       }
   }
   {
-    MCAuto<MEDFileIntField1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileIntField1TS>(f));
+    MCAuto<MEDFileInt32Field1TS> f1(MEDCoupling::DynamicCast<MEDFileAnyTypeField1TS,MEDFileInt32Field1TS>(f));
     if(f1.isNotNull())
       {
-        MCAuto<MEDCoupling::MEDCouplingFieldInt> ret(ReadFieldNodeT<int>(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
+        MCAuto<MEDCoupling::MEDCouplingFieldInt32> ret(ReadFieldNodeT<int>(f1,fileName,meshName,meshDimRelToMax,fieldName,iteration,order));
         return ret.retn();
       }
   }
@@ -1730,7 +1744,7 @@ void MEDCoupling::WriteField(const std::string& fileName, const MEDCoupling::MED
       }
   }
   {
-    const MEDCoupling::MEDCouplingFieldInt *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt *>(f));
+    const MEDCoupling::MEDCouplingFieldInt32 *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt32 *>(f));
     if(f1)
       {
         WriteFieldT<int>(fileName,f1,writeFromScratch);
@@ -1791,7 +1805,7 @@ void MEDCoupling::WriteFieldUsingAlreadyWrittenMesh(const std::string& fileName,
     return ;
   }
   {
-    const MEDCoupling::MEDCouplingFieldInt *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt *>(f));
+    const MEDCoupling::MEDCouplingFieldInt32 *f1(dynamic_cast<const MEDCoupling::MEDCouplingFieldInt32 *>(f));
     if(f1)
       WriteFieldUsingAlreadyWrittenMeshT<int>(fileName,f1);
     return ;