SauvMedConvertor.cxx
SauvReader.cxx
SauvWriter.cxx
+ MEDExt.cxx
)
ADD_LIBRARY(medloader ${medloader_SOURCES})
--- /dev/null
+// Copyright (C) 2018 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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (EDF R&D)
+
+#include "MEDExt.hxx"
+
+med_int MEDfieldnEntityType(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit)
+{
+ return 1;
+}
+
+med_err MEDfieldEntityType(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit, med_entity_type * const entitypes, med_int * const usedbyncs)
+{
+ entitypes[0]=MED_CELL;
+ *usedbyncs=1584;
+ return 0;
+}
+
+med_int MEDfieldnGeotype(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit, const med_entity_type entitype)
+{
+ return 1;
+}
+
+med_err MEDfieldGeotype(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit, const med_entity_type entitype, med_geometry_type *const geotypes, med_int * const usedbyncs)
+{
+ geotypes[0]=MED_QUAD4;
+ *usedbyncs=1584;
+ return 0;
+}
+
--- /dev/null
+// Copyright (C) 2018 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
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay (EDF R&D)
+
+#include "med.h"
+
+constexpr med_int MED_ALL_NUMDT = 1999999999;
+
+med_int MEDfieldnEntityType(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit);
+
+med_err MEDfieldEntityType(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit, med_entity_type * const entitypes, med_int * const usedbyncs);
+
+med_int MEDfieldnGeotype(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit, const med_entity_type entitype);
+
+med_err MEDfieldGeotype(const med_idt fid, const char * const fieldname, const med_int numdt, const med_int numit, const med_entity_type entitype, med_geometry_type *const geotypes, med_int * const usedbyncs);
#include "MEDCouplingFieldDouble.hxx"
#include "MEDCouplingFieldTemplate.hxx"
+#include "MEDExt.hxx"
+
#include <sstream>
using namespace MEDCoupling;
void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities)
{
_time_steps.resize(nbPdt);
+ int nentitype(MEDfieldnEntityType(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT));
+ INTERP_KERNEL::AutoPtr<med_entity_type> types(new med_entity_type[nentitype]);
+ med_int usedbyncs;
+ MEDFILESAFECALLERRD0(MEDfieldEntityType,(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types,&usedbyncs));
+ for(int i=0;i<nentitype;i++)
+ {
+ int ngeotype(MEDfieldnGeotype(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types[i]));
+ INTERP_KERNEL::AutoPtr<med_geometry_type> geotypes(new med_geometry_type[ngeotype]);
+ med_int geousedbyncs;
+ MEDFILESAFECALLERRD0(MEDfieldGeotype,(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types[i],geotypes,&geousedbyncs));
+ }
for(int i=0;i<nbPdt;i++)
{
std::vector< std::pair<int,int> > ts;