Salome HOME
Merge branch 'V9_3_BR'
[tools/medcoupling.git] / src / MEDLoader / MEDFileData.cxx
index 2a722d0d6700f16fc7d5e3627ba3e42e2c2d2df9..8c3c171731f00fd79044121a476ac23f361b4747 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2019  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
@@ -21,6 +21,7 @@
 #include "MEDFileData.hxx"
 #include "MEDLoaderBase.hxx"
 #include "MEDFileSafeCaller.txx"
+#include "MEDFileBlowStrEltUp.hxx"
 
 #include "InterpKernelAutoPtr.hxx"
 
@@ -231,6 +232,15 @@ bool MEDFileData::unPolyzeMeshes()
   return !meshesImpacted.empty();
 }
 
+void MEDFileData::dealWithStructureElements()
+{
+  if(_struct_elems.isNull())
+    throw INTERP_KERNEL::Exception("MEDFileData::dealWithStructureElements : no structure elements in this !");
+  if(_meshes.isNull() || _fields.isNull())
+    throw INTERP_KERNEL::Exception("MEDFileData::dealWithStructureElements : meshes and fields must be not null !");
+  MEDFileBlowStrEltUp::DealWithSE(_fields,_meshes,_struct_elems);
+}
+
 /*!
  * Precondition : all instances in \a mfds should have a single mesh with fields on it. If there is an instance with not exactly one mesh an exception will be thrown.
  * You can invoke MEDFileFields::partOfThisLyingOnSpecifiedMeshName method to make it work.
@@ -309,7 +319,7 @@ try
   readHeader(fid);
   _mesh_supports=MEDFileMeshSupports::New(fid);
   _struct_elems=MEDFileStructureElements::New(fid,_mesh_supports);
-  _fields=MEDFileFields::New(fid);
+  _fields=MEDFileFields::NewWithDynGT(fid,_struct_elems,true);
   _meshes=MEDFileMeshes::New(fid);
   _params=MEDFileParameters::New(fid);
 }