From: Anthony Geay Date: Mon, 29 Oct 2018 10:03:41 +0000 (+0100) Subject: First test with effective mockup medfile library X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8161a21339658f338adb3546bfa93810ed8450fb;p=tools%2Fmedcoupling.git First test with effective mockup medfile library --- diff --git a/src/MEDLoader/CMakeLists.txt b/src/MEDLoader/CMakeLists.txt index 4d2787fbb..b54b36b51 100644 --- a/src/MEDLoader/CMakeLists.txt +++ b/src/MEDLoader/CMakeLists.txt @@ -80,7 +80,6 @@ SET(medloader_SOURCES SauvMedConvertor.cxx SauvReader.cxx SauvWriter.cxx - MEDExt.cxx ) ADD_LIBRARY(medloader ${medloader_SOURCES}) diff --git a/src/MEDLoader/MEDExt.cxx b/src/MEDLoader/MEDExt.cxx deleted file mode 100644 index 81f609d7d..000000000 --- a/src/MEDLoader/MEDExt.cxx +++ /dev/null @@ -1,46 +0,0 @@ -// 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; -} - diff --git a/src/MEDLoader/MEDExt.hxx b/src/MEDLoader/MEDExt.hxx deleted file mode 100644 index f430d8768..000000000 --- a/src/MEDLoader/MEDExt.hxx +++ /dev/null @@ -1,31 +0,0 @@ -// 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); diff --git a/src/MEDLoader/MEDFileFieldMultiTS.cxx b/src/MEDLoader/MEDFileFieldMultiTS.cxx index 1c49925ad..576e482d5 100644 --- a/src/MEDLoader/MEDFileFieldMultiTS.cxx +++ b/src/MEDLoader/MEDFileFieldMultiTS.cxx @@ -27,8 +27,6 @@ #include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingFieldTemplate.hxx" -#include "MEDExt.hxx" - #include using namespace MEDCoupling; @@ -488,19 +486,19 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysR _time_steps.resize(nbPdt); INTERP_KERNEL::AutoCppPtr entitiesFast; const MEDFileEntities *entitiesForSubInstances(entities); - /*if(!entities) + if(!entities) { - int nentitype(MEDfieldnEntityType(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT)); + int nentitype(MEDfieldnEntityType(fid,_name.c_str(),MED_ALL_IT,MED_ALL_IT)); INTERP_KERNEL::AutoPtr types(new med_entity_type[nentitype]); med_int usedbyncs; - MEDFILESAFECALLERRD0(MEDfieldEntityType,(fid,_name.c_str(),MED_ALL_NUMDT,MED_ALL_NUMDT,types,&usedbyncs)); + MEDFILESAFECALLERRD0(MEDfieldEntityType,(fid,_name.c_str(),MED_ALL_IT,MED_ALL_IT,types,&usedbyncs)); std::vector< std::pair > entitiesFastP; for(int i=0;i 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)); + MEDFILESAFECALLERRD0(MEDfieldGeometryType,(fid,_name.c_str(),MED_ALL_IT,MED_ALL_IT,types[i],geotypes,&geousedbyncs)); for(int j=0;j p(MEDFileMesh::ConvertFromMEDFileEntity(types[i]),MEDFileJointOneStep::ConvertGeometryType(geotypes[j])); @@ -509,7 +507,7 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysR } entitiesFast=new MEDFileStaticEntities(entitiesFastP); entitiesForSubInstances=entitiesFast; - }*/ + } for(int i=0;i > ts;