Salome HOME
Add test for .mesh file format
[tools/medcoupling.git] / src / MEDLoader / MEDFileUtilities.cxx
index 280963984bb63906d0260d06bffc6d04afbe76d4..2f8beeeae16bbf520477c2d987340d50f463b984 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -49,18 +49,21 @@ med_access_mode MEDFileUtilities::TraduceWriteMode(int medloaderwritemode)
 const char *MEDFileUtilities::GetReadableMEDFieldType(med_field_type ft)
 {
   static const char medFloat64[]="MED_FLOAT64";
+  static const char medFloat32[]="MED_FLOAT32";
   static const char medInt32[]="MED_INT32";
   static const char medInt64[]="MED_INT64";
   switch(ft)
   {
     case MED_FLOAT64:
       return medFloat64;
+    case MED_FLOAT32:
+      return medFloat32;
     case MED_INT32:
       return medInt32;
     case MED_INT64:
       return medInt64;
     default:
-      throw INTERP_KERNEL::Exception("Non supported field type ! Should be FLOAT64, INT32 or INT64 !");
+      throw INTERP_KERNEL::Exception("Non supported field type ! Should be FLOAT64, FLOAT32, INT32 or INT64 !");
   }
 }
 
@@ -200,6 +203,11 @@ void MEDCoupling::MEDFileWritableStandAlone::write30(const std::string& fileName
   this->writeXX(fileName,mode,3,0,6);
 }
 
+void MEDCoupling::MEDFileWritableStandAlone::write40(const std::string& fileName, int mode) const
+{
+  this->writeXX(fileName,mode,4,0,1);
+}
+
 void MEDCoupling::MEDFileWritableStandAlone::writeXX(const std::string& fileName, int mode, med_int maj, med_int min, med_int rel) const
 {
 #if ( MED_NUM_MAJEUR>4 || ( MED_NUM_MAJEUR==4 && MED_NUM_MINEUR>=1 ) )