#include "MEDFileMeshLL.hxx"
#include "MEDFileMesh.hxx"
#include "MEDLoaderBase.hxx"
+#include "MEDFileMeshReadSelector.hxx"
#include "MEDCouplingUMesh.hxx"
using namespace ParaMEDMEM;
-MEDFileMeshL2::MEDFileMeshL2():_name(MED_NAME_SIZE),_description(MED_COMMENT_SIZE),_dt_unit(MED_LNAME_SIZE)
+MEDFileMeshL2::MEDFileMeshL2():_name(MED_NAME_SIZE),_description(MED_COMMENT_SIZE),_univ_name(MED_LNAME_SIZE),_dt_unit(MED_LNAME_SIZE)
{
}
if(!found)
{
std::ostringstream oss;
- oss << "No such meshname (" << mname << ") in file ! Must be in :";
+ oss << "No such meshname (" << mname << ") in file ! Must be in : ";
std::copy(ms.begin(),ms.end(),std::ostream_iterator<std::string>(oss,", "));
throw INTERP_KERNEL::Exception(oss.str().c_str());
}
INTERP_KERNEL::AutoPtr<char> nameTmp=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisname=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
INTERP_KERNEL::AutoPtr<char> axisunit=MEDLoaderBase::buildEmptyString(naxis*MED_SNAME_SIZE);
+ INTERP_KERNEL::AutoPtr<char> univTmp=MEDLoaderBase::buildEmptyString(MED_LNAME_SIZE);
if(MEDmeshInfo(fid,mId,nameTmp,&spaceDim,&Mdim,&type_maillage,_description.getPointer(),_dt_unit.getPointer(),
&stype,&nstep,&axistype,axisname,axisunit)!=0)
throw INTERP_KERNEL::Exception("A problem has been detected when trying to get info on mesh !");
+ MEDmeshUniversalNameRd(fid,nameTmp,_univ_name.getPointer());
switch(type_maillage)
{
case MED_UNSTRUCTURED_MESH:
return infosOnComp;
}
-void MEDFileMeshL2::ReadFamiliesAndGrps(med_idt fid, const char *meshName, std::map<std::string,int>& fams, std::map<std::string, std::vector<std::string> >& grps)
+void MEDFileMeshL2::ReadFamiliesAndGrps(med_idt fid, const char *meshName, std::map<std::string,int>& fams, std::map<std::string, std::vector<std::string> >& grps, MEDFileMeshReadSelector *mrs)
{
+ if(mrs && !(mrs->isCellFamilyFieldReading() || mrs->isNodeFamilyFieldReading()))
+ return ;
char nomfam[MED_NAME_SIZE+1];
med_int numfam;
int nfam=MEDnFamily(fid,meshName);
{
}
-void MEDFileUMeshL2::loadAll(med_idt fid, int mId, const char *mName, int dt, int it)
+void MEDFileUMeshL2::loadAll(med_idt fid, int mId, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
_name.set(mName);
int nstep;
_time=CheckMeshTimeStep(fid,mName,nstep,dt,it);
_iteration=dt;
_order=it;
- loadConnectivity(fid,Mdim,mName,dt,it);//to improve check (dt,it) coherency
+ loadConnectivity(fid,Mdim,mName,dt,it,mrs);//to improve check (dt,it) coherency
loadCoords(fid,mId,infosOnComp,mName,dt,it);
}
-void MEDFileUMeshL2::loadConnectivity(med_idt fid, int mdim, const char *mName, int dt, int it)
+void MEDFileUMeshL2::loadConnectivity(med_idt fid, int mdim, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs)
{
_per_type_mesh.resize(1);
_per_type_mesh[0].clear();
for(int j=0;j<MED_N_CELL_FIXED_GEO;j++)
{
- MEDFileUMeshPerType *tmp=MEDFileUMeshPerType::New(fid,mName,dt,it,mdim,typmai[j],typmai2[j]);
+ MEDFileUMeshPerType *tmp=MEDFileUMeshPerType::New(fid,mName,dt,it,mdim,typmai[j],typmai2[j],mrs);
if(tmp)
_per_type_mesh[0].push_back(tmp);
}
MEDCouplingUMesh *MEDFileUMeshSplitL1::getWholeMesh(bool renum) const
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> tmp;
- if(renum)
+ if(renum && ((const DataArrayInt *)_num))
tmp=_m;
else
tmp=_m_by_types;