mcIdType nMin(ToIdType(std::distance(fetchedNodeIds.begin(),std::find(fetchedNodeIds.begin(),fetchedNodeIds.end(),true))));
mcIdType nMax(ToIdType(std::distance(fetchedNodeIds.rbegin(),std::find(fetchedNodeIds.rbegin(),fetchedNodeIds.rend(),true))));
nMax=nCoords-nMax;
- for(std::vector< std::vector< MCAuto<MEDFileUMeshPerType> > >::const_iterator it0=_per_type_mesh.begin();it0!=_per_type_mesh.end();it0++)
- for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
- (*it1)->getMesh()->renumberNodesWithOffsetInConn(-nMin);
- loadPartCoords(fid,infosOnComp,mName,dt,it,nMin,nMax);
+ if(!mrs || mrs->getNumberOfCoordsLoadSessions()==1)
+ {
+ for(std::vector< std::vector< MCAuto<MEDFileUMeshPerType> > >::const_iterator it0=_per_type_mesh.begin();it0!=_per_type_mesh.end();it0++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
+ (*it1)->getMesh()->renumberNodesWithOffsetInConn(-nMin);
+ loadPartCoords(fid,infosOnComp,mName,dt,it,nMin,nMax);
+ }
+ else
+ {
+ mcIdType nbOfCooLS(mrs->getNumberOfCoordsLoadSessions());
+ MCAuto<DataArrayIdType> fni(DataArrayIdType::BuildListOfSwitchedOn(fetchedNodeIds));
+ MCAuto< MapKeyVal<mcIdType, mcIdType> > o2n(fni->invertArrayN2O2O2NOptimized());
+ for(std::vector< std::vector< MCAuto<MEDFileUMeshPerType> > >::const_iterator it0=_per_type_mesh.begin();it0!=_per_type_mesh.end();it0++)
+ for(std::vector< MCAuto<MEDFileUMeshPerType> >::const_iterator it1=(*it0).begin();it1!=(*it0).end();it1++)
+ (*it1)->getMesh()->renumberNodesInConn(o2n->data());
+ for(mcIdType ipart = 0 ; ipart < nbOfCooLS ; ++ipart)
+ {
+ mcIdType partStart,partStop;
+ DataArray::GetSlice(nMin,nMax,1,ipart,nbOfCooLS,partStart,partStop);
+ loadPartCoords(fid,infosOnComp,mName,dt,it,partStart,partStop);
+ }
+ }
}
void MEDFileUMeshL2::loadConnectivity(med_idt fid, int mdim, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
#include "MEDFileMeshReadSelector.hxx"
+#include "InterpKernelException.hxx"
+
+#include <sstream>
+
using namespace MEDCoupling;
-MEDFileMeshReadSelector::MEDFileMeshReadSelector():_code(0xFFFFFFFF)
+MEDFileMeshReadSelector::MEDFileMeshReadSelector():_nb_coords_load_sessions(1),_code(0xFFFFFFFF)
{
}
_code=newCode;
}
+void MEDFileMeshReadSelector::setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions)
+{
+ if(newNbOfCoordsLoadSessions < 1)
+ throw INTERP_KERNEL::Exception("MEDFileMeshReadSelector::setNumberOfCoordsLoadSessions : input must be >= 1 !");
+ _nb_coords_load_sessions = newNbOfCoordsLoadSessions;
+}
+
bool MEDFileMeshReadSelector::isCellFamilyFieldReading() const
{
return _code & 0x00000001;
void MEDFileMeshReadSelector::reprAll(std::ostream& str) const
{
str << "MEDFileMeshReadSelector (code=" << _code << ") : \n";
+ str << "Number of coords load part sessions : " << this->_nb_coords_load_sessions << std::endl;
str << "Read family field on cells : " << ReprStatus(isCellFamilyFieldReading()) << std::endl;
str << "Read family field on nodes : " << ReprStatus(isNodeFamilyFieldReading()) << std::endl;
str << "Read name field on cells : " << ReprStatus(isCellNameFieldReading()) << std::endl;
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// Author : Anthony Geay (CEA/DEN)
+// Author : Anthony Geay (EDF R&D)
-#ifndef __MEDFILEMESHREADSELECTOR_HXX__
-#define __MEDFILEMESHREADSELECTOR_HXX__
+#pragma once
#include "MEDLoaderDefines.hxx"
-#include <sstream>
+#include "MCIdType.hxx"
+
#include <string>
namespace MEDCoupling
MEDFileMeshReadSelector(unsigned int code);
unsigned int getCode() const;
void setCode(unsigned int newCode);
+ mcIdType getNumberOfCoordsLoadSessions() const { return _nb_coords_load_sessions; }
+ void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
bool isCellFamilyFieldReading() const;
bool isNodeFamilyFieldReading() const;
bool isCellNameFieldReading() const;
private:
static std::string ReprStatus(bool v);
private:
+ mcIdType _nb_coords_load_sessions;
//bit #0 cell family field
//bit #1 node family field
//bit #2 cell name field
};
}
-#endif
public:
MEDFileMeshReadSelector();
MEDFileMeshReadSelector(unsigned int code);
+ mcIdType getNumberOfCoordsLoadSessions();
+ void setNumberOfCoordsLoadSessions(mcIdType newNbOfCoordsLoadSessions);
unsigned int getCode() const;
void setCode(unsigned int newCode);
bool isCellFamilyFieldReading() const;