From: ageay Date: Fri, 28 Jun 2013 11:17:33 +0000 (+0000) Subject: MED file loading on demand. X-Git-Tag: B4CMakeModifs~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bb45c3dc0b411e68ab2bbc6e81b9bb6ff418ef05;p=modules%2Fmed.git MED file loading on demand. --- diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 5f392a203..8471e77ce 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -207,7 +207,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::assignFieldNoProfile(int& start, int off { case ON_CELLS: { - getArray()->setContigPartOfSelectedValues2(_start,arrr,offset,offset+nbOfCells,1); + getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,offset,offset+nbOfCells,1); _end=_start+nbOfCells; _nval=nbOfCells; break; @@ -216,7 +216,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::assignFieldNoProfile(int& start, int off { MEDCouplingAutoRefCountObjectPtr arr=field->getDiscretization()->getOffsetArr(field->getMesh()); const int *arrPtr=arr->getConstPointer(); - getArray()->setContigPartOfSelectedValues2(_start,arrr,arrPtr[offset],arrPtr[offset+nbOfCells],1); + getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,arrPtr[offset],arrPtr[offset+nbOfCells],1); _end=_start+(arrPtr[offset+nbOfCells]-arrPtr[offset]); _nval=nbOfCells; break; @@ -254,7 +254,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::assignFieldNoProfile(int& start, int off } std::ostringstream oss2; oss2 << "Loc_" << nasc.getName() << "_" << INTERP_KERNEL::CellModel::GetCellModel(getGeoType()).getRepr() << "_" << _loc_id; _localization=oss2.str(); - getArray()->setContigPartOfSelectedValues(_start,arrr,da4); + getOrCreateAndGetArray()->setContigPartOfSelectedValues(_start,arrr,da4); _end=_start+_nval*nbi; glob.appendLoc(_localization.c_str(),getGeoType(),gsLoc.getRefCoords(),gsLoc.getGaussCoords(),gsLoc.getWeights()); break; @@ -298,14 +298,14 @@ void MEDFileFieldPerMeshPerTypePerDisc::assignFieldProfile(int& start, const Dat case ON_NODES: { _nval=idsInPfl->getNumberOfTuples(); - getArray()->setContigPartOfSelectedValues2(_start,arrr,0,arrr->getNumberOfTuples(),1); + getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,0,arrr->getNumberOfTuples(),1); _end=_start+_nval; break; } case ON_CELLS: { _nval=idsInPfl->getNumberOfTuples(); - getArray()->setContigPartOfSelectedValues(_start,arrr,idsInPfl); + getOrCreateAndGetArray()->setContigPartOfSelectedValues(_start,arrr,idsInPfl); _end=_start+_nval; break; } @@ -318,7 +318,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::assignFieldProfile(int& start, const Dat MEDCouplingAutoRefCountObjectPtr tmp=idsInPfl->buildExplicitArrByRanges(arr3); int trueNval=tmp->getNumberOfTuples(); _nval=idsInPfl->getNumberOfTuples(); - getArray()->setContigPartOfSelectedValues(_start,arrr,tmp); + getOrCreateAndGetArray()->setContigPartOfSelectedValues(_start,arrr,tmp); _end=_start+trueNval; break; } @@ -347,7 +347,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::assignFieldProfile(int& start, const Dat *tmpPtr++=j; // _nval=da4->getNumberOfTuples(); - getArray()->setContigPartOfSelectedValues(_start,arrr,tmp); + getOrCreateAndGetArray()->setContigPartOfSelectedValues(_start,arrr,tmp); _end=_start+trueNval; oss << "_loc_" << _loc_id; if(locIds) @@ -381,7 +381,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::assignNodeFieldNoProfile(int& start, con { _start=start; _nval=arrr->getNumberOfTuples(); - getArray()->setContigPartOfSelectedValues2(_start,arrr,0,_nval,1); + getOrCreateAndGetArray()->setContigPartOfSelectedValues2(_start,arrr,0,_nval,1); _end=_start+_nval; start=_end; } @@ -440,7 +440,7 @@ const MEDFileFieldPerMeshPerType *MEDFileFieldPerMeshPerTypePerDisc::getFather() return _father; } -void MEDFileFieldPerMeshPerTypePerDisc::prepareLoading(med_idt fid, int profileIt, int& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +void MEDFileFieldPerMeshPerTypePerDisc::loadOnlyStructureOfDataRecursively(med_idt fid, int profileIt, int& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) { INTERP_KERNEL::AutoPtr locname=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE); INTERP_KERNEL::AutoPtr pflname=MEDLoaderBase::buildEmptyString(MED_NAME_SIZE); @@ -472,7 +472,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::prepareLoading(med_idt fid, int profileI } } -void MEDFileFieldPerMeshPerTypePerDisc::finishLoading(med_idt fid, int profileIt, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +void MEDFileFieldPerMeshPerTypePerDisc::loadBigArray(med_idt fid, int profileIt, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) { std::string fieldName=nasc.getName(); std::string meshName=getMeshName(); @@ -482,7 +482,19 @@ void MEDFileFieldPerMeshPerTypePerDisc::finishLoading(med_idt fid, int profileIt INTERP_KERNEL::NormalizedCellType geoType=getGeoType(); med_geometry_type mgeoti; med_entity_type menti=MEDFileFieldPerMeshPerType::ConvertIntoMEDFileType(type,geoType,mgeoti); - DataArray *arr=getArray(); + DataArray *arr=getOrCreateAndGetArray(); + if(_start>_end) + throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::loadBigArray : internal error in range !"); + if(_start<0 || _start>=arr->getNumberOfTuples()) + { + std::ostringstream oss; oss << "MEDFileFieldPerMeshPerTypePerDisc::loadBigArray : Invalid start ("<< _start << ") regarding admissible range of allocated array [0," << arr->getNumberOfTuples() << ") !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } + if(_end<0 || _end>arr->getNumberOfTuples()) + { + std::ostringstream oss; oss << "MEDFileFieldPerMeshPerTypePerDisc::loadBigArray : Invalid start ("<< _start << ") regarding admissible range of allocated array [0," << arr->getNumberOfTuples() << "] !"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } DataArrayDouble *arrD=dynamic_cast(arr); if(arrD) { @@ -576,15 +588,15 @@ int MEDFileFieldPerMeshPerTypePerDisc::getNumberOfTuples() const return _end-_start; } -DataArray *MEDFileFieldPerMeshPerTypePerDisc::getArray() +DataArray *MEDFileFieldPerMeshPerTypePerDisc::getOrCreateAndGetArray() { - return _father->getArray(); + return _father->getOrCreateAndGetArray(); } -const DataArray *MEDFileFieldPerMeshPerTypePerDisc::getArray() const +const DataArray *MEDFileFieldPerMeshPerTypePerDisc::getOrCreateAndGetArray() const { const MEDFileFieldPerMeshPerType *fath=_father; - return fath->getArray(); + return fath->getOrCreateAndGetArray(); } const std::vector& MEDFileFieldPerMeshPerTypePerDisc::getInfo() const @@ -668,7 +680,7 @@ void MEDFileFieldPerMeshPerTypePerDisc::writeLL(med_idt fid, const MEDFileFieldN INTERP_KERNEL::NormalizedCellType geoType=getGeoType(); med_geometry_type mgeoti; med_entity_type menti=MEDFileFieldPerMeshPerType::ConvertIntoMEDFileType(type,geoType,mgeoti); - const DataArray *arr=getArray(); + const DataArray *arr=getOrCreateAndGetArray(); if(!arr) throw INTERP_KERNEL::Exception("MEDFileFieldPerMeshPerTypePerDisc::writeLL : no array set !"); const DataArrayDouble *arrD=dynamic_cast(arr); @@ -1245,15 +1257,15 @@ int MEDFileFieldPerMeshPerType::getNumberOfComponents() const return _father->getNumberOfComponents(); } -DataArray *MEDFileFieldPerMeshPerType::getArray() +DataArray *MEDFileFieldPerMeshPerType::getOrCreateAndGetArray() { - return _father->getArray(); + return _father->getOrCreateAndGetArray(); } -const DataArray *MEDFileFieldPerMeshPerType::getArray() const +const DataArray *MEDFileFieldPerMeshPerType::getOrCreateAndGetArray() const { const MEDFileFieldPerMesh *fath=_father; - return fath->getArray(); + return fath->getOrCreateAndGetArray(); } const std::vector& MEDFileFieldPerMeshPerType::getInfo() const @@ -1412,21 +1424,21 @@ MEDFileFieldPerMeshPerType::MEDFileFieldPerMeshPerType(med_idt fid, MEDFileField } } -void MEDFileFieldPerMeshPerType::prepareLoading(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +void MEDFileFieldPerMeshPerType::loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) { int pflId=0; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,pflId++) { - (*it)->prepareLoading(fid,pflId+1,start,nasc);//tony + (*it)->loadOnlyStructureOfDataRecursively(fid,pflId+1,start,nasc);//tony } } -void MEDFileFieldPerMeshPerType::finishLoading(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +void MEDFileFieldPerMeshPerType::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) { int pflId=0; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++,pflId++) { - (*it)->finishLoading(fid,pflId+1,nasc);//tony + (*it)->loadBigArray(fid,pflId+1,nasc);//tony } } @@ -1573,16 +1585,16 @@ void MEDFileFieldPerMesh::assignNodeFieldProfile(int& start, const DataArrayInt _field_pm_pt[pos]->assignNodeFieldProfile(start,pfl,field,arr,glob,nasc); } -void MEDFileFieldPerMesh::prepareLoading(med_idt fid, int& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +void MEDFileFieldPerMesh::loadOnlyStructureOfDataRecursively(med_idt fid, int& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) { for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++) - (*it)->prepareLoading(fid,start,nasc); + (*it)->loadOnlyStructureOfDataRecursively(fid,start,nasc); } -void MEDFileFieldPerMesh::finishLoading(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +void MEDFileFieldPerMesh::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) { for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++) - (*it)->finishLoading(fid,nasc); + (*it)->loadBigArraysRecursively(fid,nasc); } void MEDFileFieldPerMesh::writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception) @@ -1641,17 +1653,17 @@ int MEDFileFieldPerMesh::getNumberOfComponents() const return _father->getNumberOfComponents(); } -DataArray *MEDFileFieldPerMesh::getArray() +DataArray *MEDFileFieldPerMesh::getOrCreateAndGetArray() { if(!_father) - throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::getArray : no father ! internal error !"); + throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::getOrCreateAndGetArray : no father ! internal error !"); return _father->getOrCreateAndGetArray(); } -const DataArray *MEDFileFieldPerMesh::getArray() const +const DataArray *MEDFileFieldPerMesh::getOrCreateAndGetArray() const { if(!_father) - throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::getArray : no father ! internal error !"); + throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::getOrCreateAndGetArray : no father ! internal error !"); return _father->getOrCreateAndGetArray(); } @@ -1821,7 +1833,7 @@ bool MEDFileFieldPerMesh::renumberEntitiesLyingOnMesh(const char *meshName, cons std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> entriesKept; std::vector< const MEDFileFieldPerMeshPerTypePerDisc *> otherEntries; getUndergroundDataArrayExt(entries); - DataArray *arr0=getArray();//tony + DataArray *arr0=getOrCreateAndGetArray();//tony if(!arr0) throw INTERP_KERNEL::Exception("MEDFileFieldPerMesh::renumberEntitiesLyingOnMesh : DataArray storing values of field is null !"); DataArrayDouble *arr=dynamic_cast(arr0);//tony @@ -2126,7 +2138,7 @@ MEDCouplingFieldDouble *MEDFileFieldPerMesh::finishField(TypeOfField type, const isPfl=false; MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingFieldDouble::New(type,ONE_TIME); ret->setMesh(mesh); ret->setName(nasc.getName().c_str()); ret->setTime(getTime(),getIteration(),getOrder()); ret->setTimeUnit(nasc.getDtUnit().c_str()); - MEDCouplingAutoRefCountObjectPtr da=getArray()->selectByTupleRanges(dads); + MEDCouplingAutoRefCountObjectPtr da=getOrCreateAndGetArray()->selectByTupleRanges(dads); const std::vector& infos=getInfo(); da->setInfoOnComponents(infos); da->setName(""); @@ -2256,7 +2268,7 @@ DataArray *MEDFileFieldPerMesh::finishField4(const std::vectorincrRef(); } MEDCouplingAutoRefCountObjectPtr safePfl(pflOut); - MEDCouplingAutoRefCountObjectPtr da=getArray()->selectByTupleRanges(dads); + MEDCouplingAutoRefCountObjectPtr da=getOrCreateAndGetArray()->selectByTupleRanges(dads); const std::vector& infos=getInfo(); int nbOfComp=infos.size(); for(int i=0;i return ret; } -MEDFileAnyTypeField1TSWithoutSDA::MEDFileAnyTypeField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order):MEDFileFieldNameScope(fieldName),_iteration(iteration),_order(order),_csit(csit) +MEDFileAnyTypeField1TSWithoutSDA::MEDFileAnyTypeField1TSWithoutSDA(const char *fieldName, int csit, int iteration, int order):MEDFileFieldNameScope(fieldName),_iteration(iteration),_order(order),_csit(csit),_nb_of_tuples_to_be_allocated(-2) { } -MEDFileAnyTypeField1TSWithoutSDA::MEDFileAnyTypeField1TSWithoutSDA():_iteration(-1),_order(-1),_dt(0.),_csit(-1) +MEDFileAnyTypeField1TSWithoutSDA::MEDFileAnyTypeField1TSWithoutSDA():_iteration(-1),_order(-1),_dt(0.),_csit(-1),_nb_of_tuples_to_be_allocated(-1) { } @@ -3988,7 +4000,24 @@ void MEDFileAnyTypeField1TSWithoutSDA::writeLL(med_idt fid, const MEDFileWritabl _field_per_mesh[0]->writeLL(fid,nasc); } -void MEDFileAnyTypeField1TSWithoutSDA::finishLoading(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +void MEDFileAnyTypeField1TSWithoutSDA::allocIfNecessaryTheArrayToReceiveDataFromFile() throw(INTERP_KERNEL::Exception) +{ + if(_nb_of_tuples_to_be_allocated>=0) + { + getOrCreateAndGetArray()->alloc(_nb_of_tuples_to_be_allocated,getNumberOfComponents()); + _nb_of_tuples_to_be_allocated=-2; + return ; + } + if(_nb_of_tuples_to_be_allocated==-2 || _nb_of_tuples_to_be_allocated==-3) + return ; + if(_nb_of_tuples_to_be_allocated==-1) + throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::allocIfNecessaryTheArrayToReceiveDataFromFile : trying to read from a file an empty instance ! Need to prepare the structure before !"); + if(_nb_of_tuples_to_be_allocated<-3) + throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::allocIfNecessaryTheArrayToReceiveDataFromFile : internal error !"); + +} + +void MEDFileAnyTypeField1TSWithoutSDA::loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) { med_int numdt,numit; med_float dt; @@ -3999,20 +4028,26 @@ void MEDFileAnyTypeField1TSWithoutSDA::finishLoading(med_idt fid, const MEDFileF MEDfieldComputingStepInfo(fid,nasc.getName().c_str(),_csit,&numdt,&numit,&_dt); MEDfield23ComputingStepMeshInfo(fid,nasc.getName().c_str(),_csit,&numdt,&numit,&dt,&nmesh,meshName,&localMesh,&meshnumdt,&meshnumit); if(_iteration!=numdt || _order!=numit) - throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::finishLoading : unexpected exception internal error !"); + throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::loadBigArraysRecursively : unexpected exception internal error !"); _field_per_mesh.resize(nmesh); for(int i=0;iprepareLoading(fid,start,nasc); - } - getOrCreateAndGetArray()->alloc(start,getNumberOfComponents()); + _nb_of_tuples_to_be_allocated=0; for(int i=0;ifinishLoading(fid,nasc); - } + _field_per_mesh[i]->loadOnlyStructureOfDataRecursively(fid,_nb_of_tuples_to_be_allocated,nasc); +} + +void MEDFileAnyTypeField1TSWithoutSDA::loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +{ + allocIfNecessaryTheArrayToReceiveDataFromFile(); + for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++) + (*it)->loadBigArraysRecursively(fid,nasc); +} + +void MEDFileAnyTypeField1TSWithoutSDA::loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception) +{ + loadOnlyStructureOfDataRecursively(fid,nasc); + loadBigArraysRecursively(fid,nasc); } std::size_t MEDFileAnyTypeField1TSWithoutSDA::getHeapMemorySize() const @@ -4110,6 +4145,18 @@ void MEDFileAnyTypeField1TSWithoutSDA::setFieldProfile(const MEDCouplingFieldDou } } +/*! + * \param [in] newNbOfTuples - The new nb of tuples to be allocated. + */ +void MEDFileAnyTypeField1TSWithoutSDA::allocNotFromFile(int newNbOfTuples) throw(INTERP_KERNEL::Exception) +{ + if(_nb_of_tuples_to_be_allocated>=0) + throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TSWithoutSDA::allocNotFromFile : the object is expected to be appended to a data coming from a file but not loaded ! Load before appending data !"); + DataArray *arr(getOrCreateAndGetArray()); + arr->alloc(newNbOfTuples,arr->getNumberOfComponents()); + _nb_of_tuples_to_be_allocated=-3; +} + /*! * Copies tiny info and allocates \a this->_arr instance of DataArrayDouble to * append data of a given MEDCouplingFieldDouble. So that the size of \a this->_arr becomes @@ -4133,24 +4180,22 @@ int MEDFileAnyTypeField1TSWithoutSDA::copyTinyInfoFrom(const MEDCouplingFieldDou throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::copyTinyInfoFrom : unsupported fields with no name in MED file !"); if(!arr) throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::copyTinyInfoFrom : no array set !"); + if(!arr->isAllocated()) + throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::copyTinyInfoFrom : array is not allocated !"); _dt=field->getTime(_iteration,_order); int nbOfComponents=arr->getNumberOfComponents(); getOrCreateAndGetArray()->setInfoAndChangeNbOfCompo(arr->getInfoOnComponents()); if(!getOrCreateAndGetArray()->isAllocated()) { - getOrCreateAndGetArray()->alloc(arr->getNumberOfTuples(),arr->getNumberOfComponents()); + allocNotFromFile(arr->getNumberOfTuples()); return 0; } else { int oldNbOfTuples=getOrCreateAndGetArray()->getNumberOfTuples(); int newNbOfTuples=oldNbOfTuples+arr->getNumberOfTuples(); - MEDCouplingAutoRefCountObjectPtr tmp=createNewEmptyDataArrayInstance(); - tmp->alloc(newNbOfTuples,nbOfComponents); - tmp->copyStringInfoFrom(*getOrCreateAndGetArray()); - DataArray *arrr=getOrCreateAndGetArray(); - tmp->setContigPartOfSelectedValues2(0,arrr,0,oldNbOfTuples,1); - setArray(tmp); + getOrCreateAndGetArray()->reAlloc(newNbOfTuples); + _nb_of_tuples_to_be_allocated=-3; return oldNbOfTuples; } } @@ -4863,7 +4908,7 @@ MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS() //= MEDFileAnyTypeField1TS -MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { med_field_type typcha; // @@ -4897,16 +4942,19 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i MEDfieldComputingStepInfo(fid,fieldName.c_str(),1,&numdt,&numit,&dt); ret->setTime(numdt,numit,dt); ret->_csit=1; - ret->finishLoading(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); + if(loadAll) + ret->loadStructureAndBigArraysRecursively(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); + else + ret->loadOnlyStructureOfDataRecursively(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); return ret.retn(); } -MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) try:MEDFileFieldGlobsReal(fileName) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - _content=BuildContentFrom(fid,fileName); + _content=BuildContentFrom(fid,fileName,loadAll); loadGlobals(fid); } catch(INTERP_KERNEL::Exception& e) @@ -4914,7 +4962,7 @@ catch(INTERP_KERNEL::Exception& e) throw e; } -MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) { med_field_type typcha; std::vector infos; @@ -4954,16 +5002,19 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i MEDfieldComputingStepInfo(fid,fieldName,1,&numdt,&numit,&dt); ret->setTime(numdt,numit,dt); ret->_csit=1; - ret->finishLoading(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); + if(loadAll) + ret->loadStructureAndBigArraysRecursively(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); + else + ret->loadOnlyStructureOfDataRecursively(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); return ret.retn(); } -MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) try:MEDFileFieldGlobsReal(fileName) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - _content=BuildContentFrom(fid,fileName,fieldName); + _content=BuildContentFrom(fid,fileName,fieldName,loadAll); loadGlobals(fid); } catch(INTERP_KERNEL::Exception& e) @@ -4992,37 +5043,37 @@ MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::BuildNewInstanceFromContent(MEDF throw INTERP_KERNEL::Exception("MEDFileAnyTypeField1TS::BuildNewInstanceFromContent : internal error ! a content of type different from FLOAT64 and INT32 has been built but not intercepted !"); } -MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName); + MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName,loadAll); MEDCouplingAutoRefCountObjectPtr ret=BuildNewInstanceFromContent(c,fileName); ret->loadGlobals(fid); return ret.retn(); } -MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName,fieldName); + MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName,fieldName,loadAll); MEDCouplingAutoRefCountObjectPtr ret=BuildNewInstanceFromContent(c,fileName); ret->loadGlobals(fid); return ret.retn(); } -MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TS *MEDFileAnyTypeField1TS::New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName,fieldName,iteration,order); + MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName,fieldName,iteration,order,loadAll); MEDCouplingAutoRefCountObjectPtr ret=BuildNewInstanceFromContent(c,fileName); ret->loadGlobals(fid); return ret.retn(); } -MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception) { med_field_type typcha; std::vector infos; @@ -5073,16 +5124,16 @@ MEDFileAnyTypeField1TSWithoutSDA *MEDFileAnyTypeField1TS::BuildContentFrom(med_i oss << "(" << (*iter).first << "," << (*iter).second << "), "; throw INTERP_KERNEL::Exception(oss.str().c_str()); } - ret->finishLoading(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); + ret->loadStructureAndBigArraysRecursively(fid,*((const MEDFileAnyTypeField1TSWithoutSDA*)ret)); return ret.retn(); } -MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeField1TS::MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception) try:MEDFileFieldGlobsReal(fileName) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - _content=BuildContentFrom(fid,fileName,fieldName,iteration,order); + _content=BuildContentFrom(fid,fileName,fieldName,iteration,order,loadAll); loadGlobals(fid); } catch(INTERP_KERNEL::Exception& e) @@ -5550,9 +5601,9 @@ int MEDFileAnyTypeField1TS::copyTinyInfoFrom(const MEDCouplingFieldDouble *field * is to delete this field using decrRef() as it is no more needed. * \throw If reading the file fails. */ -MEDFileField1TS *MEDFileField1TS::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileField1TS *MEDFileField1TS::New(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileField1TS(fileName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileField1TS(fileName,loadAll); ret->contentNotNull(); return ret.retn(); } @@ -5567,9 +5618,9 @@ MEDFileField1TS *MEDFileField1TS::New(const char *fileName) throw(INTERP_KERNEL: * \throw If reading the file fails. * \throw If there is no field named \a fieldName in the file. */ -MEDFileField1TS *MEDFileField1TS::New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileField1TS *MEDFileField1TS::New(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileField1TS(fileName,fieldName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileField1TS(fileName,fieldName,loadAll); ret->contentNotNull(); return ret.retn(); } @@ -5587,9 +5638,9 @@ MEDFileField1TS *MEDFileField1TS::New(const char *fileName, const char *fieldNam * \throw If there is no field named \a fieldName in the file. * \throw If the required time step is missing from the file. */ -MEDFileField1TS *MEDFileField1TS::New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +MEDFileField1TS *MEDFileField1TS::New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileField1TS(fileName,fieldName,iteration,order); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileField1TS(fileName,fieldName,iteration,order,loadAll); ret->contentNotNull(); return ret.retn(); } @@ -5699,22 +5750,22 @@ DataArrayDouble *MEDFileField1TS::ReturnSafelyDataArrayDouble(MEDCouplingAutoRef return arrOutC; } -MEDFileField1TS::MEDFileField1TS(const char *fileName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeField1TS(fileName) +MEDFileField1TS::MEDFileField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeField1TS(fileName,loadAll) { } catch(INTERP_KERNEL::Exception& e) { throw e; } -MEDFileField1TS::MEDFileField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeField1TS(fileName,fieldName) +MEDFileField1TS::MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeField1TS(fileName,fieldName,loadAll) { } catch(INTERP_KERNEL::Exception& e) { throw e; } -MEDFileField1TS::MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeField1TS(fileName,fieldName,iteration,order) +MEDFileField1TS::MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeField1TS(fileName,fieldName,iteration,order,loadAll) { } catch(INTERP_KERNEL::Exception& e) @@ -5994,23 +6045,23 @@ MEDFileIntField1TS *MEDFileIntField1TS::New() return ret.retn(); } -MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntField1TS(fileName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntField1TS(fileName,loadAll); ret->contentNotNull(); return ret.retn(); } -MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntField1TS(fileName,fieldName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntField1TS(fileName,fieldName,loadAll); ret->contentNotNull(); return ret.retn(); } -MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) +MEDFileIntField1TS *MEDFileIntField1TS::New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntField1TS(fileName,fieldName,iteration,order); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntField1TS(fileName,fieldName,iteration,order,loadAll); ret->contentNotNull(); return ret.retn(); } @@ -6027,22 +6078,22 @@ MEDFileIntField1TS::MEDFileIntField1TS() _content=new MEDFileIntField1TSWithoutSDA; } -MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeField1TS(fileName) +MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeField1TS(fileName,loadAll) { } catch(INTERP_KERNEL::Exception& e) { throw e; } -MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeField1TS(fileName,fieldName) +MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeField1TS(fileName,fieldName,loadAll) { } catch(INTERP_KERNEL::Exception& e) { throw e; } -MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeField1TS(fileName,fieldName,iteration,order) +MEDFileIntField1TS::MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeField1TS(fileName,fieldName,iteration,order,loadAll) { } catch(INTERP_KERNEL::Exception& e) @@ -6355,20 +6406,20 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(const /*! * \param [in] fieldId field id in C mode */ -MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception) { med_field_type typcha; std::string dtunitOut; int nbOfStep=MEDFileAnyTypeField1TS::LocateField2(fid,"",fieldId,false,_name,typcha,_infos,dtunitOut); setDtUnit(dtunitOut.c_str()); - finishLoading(fid,nbOfStep,typcha); + loadStructureOrStructureAndBigArraysRecursively(fid,nbOfStep,typcha,loadAll); } -MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeFieldMultiTSWithoutSDA::MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception) try:MEDFileFieldNameScope(fieldName),_infos(infos) { setDtUnit(dtunit.c_str()); - finishLoading(fid,nbOfStep,fieldTyp); + loadStructureOrStructureAndBigArraysRecursively(fid,nbOfStep,fieldTyp,loadAll); } catch(INTERP_KERNEL::Exception& e) { @@ -6664,7 +6715,7 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::synchronizeNameScope() throw(INTERP_K } } -void MEDFileAnyTypeFieldMultiTSWithoutSDA::finishLoading(med_idt fid, int nbPdt, med_field_type fieldTyp) throw(INTERP_KERNEL::Exception) +void MEDFileAnyTypeFieldMultiTSWithoutSDA::loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll) throw(INTERP_KERNEL::Exception) { _time_steps.resize(nbPdt); for(int i=0;ifinishLoading(fid,*this); + if(loadAll) + _time_steps[i]->loadStructureAndBigArraysRecursively(fid,*this); + else + _time_steps[i]->loadOnlyStructureOfDataRecursively(fid,*this); } } @@ -7129,9 +7183,9 @@ void MEDFileAnyTypeFieldMultiTSWithoutSDA::setIteration(int i, MEDCouplingAutoRe //= MEDFileFieldMultiTSWithoutSDA -MEDFileFieldMultiTSWithoutSDA *MEDFileFieldMultiTSWithoutSDA::New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception) +MEDFileFieldMultiTSWithoutSDA *MEDFileFieldMultiTSWithoutSDA::New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception) { - return new MEDFileFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit); + return new MEDFileFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll); } MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA() @@ -7145,15 +7199,15 @@ MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(const char *fieldNa /*! * \param [in] fieldId field id in C mode */ -MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldId) +MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldId,loadAll) { } catch(INTERP_KERNEL::Exception& e) { throw e; } -MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit) +MEDFileFieldMultiTSWithoutSDA::MEDFileFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll) { } catch(INTERP_KERNEL::Exception& e) @@ -7227,12 +7281,12 @@ MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS() { } -MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) try:MEDFileFieldGlobsReal(fileName) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - _content=BuildContentFrom(fid,fileName); + _content=BuildContentFrom(fid,fileName,loadAll); loadGlobals(fid); } catch(INTERP_KERNEL::Exception& e) @@ -7240,7 +7294,7 @@ catch(INTERP_KERNEL::Exception& e) throw e; } -MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) { med_field_type typcha; std::vector infos; @@ -7252,12 +7306,12 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFr { case MED_FLOAT64: { - ret=new MEDFileFieldMultiTSWithoutSDA(fid,i); + ret=new MEDFileFieldMultiTSWithoutSDA(fid,i,loadAll); break; } case MED_INT32: { - ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,i); + ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,i,loadAll); break; } default: @@ -7270,7 +7324,7 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFr return ret.retn(); } -MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFrom(med_idt fid, const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { med_field_type typcha; // @@ -7282,12 +7336,12 @@ MEDFileAnyTypeFieldMultiTSWithoutSDA *MEDFileAnyTypeFieldMultiTS::BuildContentFr { case MED_FLOAT64: { - ret=new MEDFileFieldMultiTSWithoutSDA(fid,0); + ret=new MEDFileFieldMultiTSWithoutSDA(fid,0,loadAll); break; } case MED_INT32: { - ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,0); + ret=new MEDFileIntFieldMultiTSWithoutSDA(fid,0,loadAll); break; } default: @@ -7321,12 +7375,12 @@ MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromCont throw INTERP_KERNEL::Exception("MEDFileAnyTypeFieldMultiTS::BuildNewInstanceFromContent : internal error ! a content of type different from FLOAT64 and INT32 has been built but not intercepted !"); } -MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeFieldMultiTS::MEDFileAnyTypeFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) try:MEDFileFieldGlobsReal(fileName) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - _content=BuildContentFrom(fid,fileName,fieldName); + _content=BuildContentFrom(fid,fileName,fieldName,loadAll); loadGlobals(fid); } catch(INTERP_KERNEL::Exception& e) @@ -7336,9 +7390,9 @@ catch(INTERP_KERNEL::Exception& e) //= MEDFileIntFieldMultiTSWithoutSDA -MEDFileIntFieldMultiTSWithoutSDA *MEDFileIntFieldMultiTSWithoutSDA::New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception) +MEDFileIntFieldMultiTSWithoutSDA *MEDFileIntFieldMultiTSWithoutSDA::New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception) { - return new MEDFileIntFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit); + return new MEDFileIntFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll); } MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA() @@ -7349,8 +7403,8 @@ MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(const char *f { } -MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit) +MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldName,fieldTyp,infos,nbOfStep,dtunit,loadAll) { } catch(INTERP_KERNEL::Exception& e) @@ -7359,8 +7413,8 @@ catch(INTERP_KERNEL::Exception& e) /*! * \param [in] fieldId field id in C mode */ -MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldId) +MEDFileIntFieldMultiTSWithoutSDA::MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTSWithoutSDA(fid,fieldId,loadAll) { } catch(INTERP_KERNEL::Exception& e) @@ -7425,11 +7479,11 @@ MEDFileFieldMultiTSWithoutSDA *MEDFileIntFieldMultiTSWithoutSDA::convertToDouble * is to delete this field using decrRef() as it is no more needed. * \throw If reading the file fails. */ -MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileAnyTypeFieldMultiTS *MEDFileAnyTypeFieldMultiTS::New(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { MEDFileUtilities::CheckFileForRead(fileName); MEDFileUtilities::AutoFid fid=MEDfileOpen(fileName,MED_ACC_RDONLY); - MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName); + MEDCouplingAutoRefCountObjectPtr c=BuildContentFrom(fid,fileName,loadAll); MEDCouplingAutoRefCountObjectPtr ret=BuildNewInstanceFromContent(c,fileName); ret->loadGlobals(fid); return ret.retn(); @@ -7803,9 +7857,9 @@ MEDFileFieldMultiTS *MEDFileFieldMultiTS::New() * is to delete this field using decrRef() as it is no more needed. * \throw If reading the file fails. */ -MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileFieldMultiTS(fileName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileFieldMultiTS(fileName,loadAll); ret->contentNotNull();//to check that content type matches with \a this type. return ret.retn(); } @@ -7820,9 +7874,9 @@ MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const char *fileName) throw(INTERP * \throw If reading the file fails. * \throw If there is no field named \a fieldName in the file. */ -MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileFieldMultiTS *MEDFileFieldMultiTS::New(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileFieldMultiTS(fileName,fieldName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileFieldMultiTS(fileName,fieldName,loadAll); ret->contentNotNull();//to check that content type matches with \a this type. return ret.retn(); } @@ -8165,15 +8219,15 @@ MEDFileFieldMultiTS::MEDFileFieldMultiTS() _content=new MEDFileFieldMultiTSWithoutSDA; } -MEDFileFieldMultiTS::MEDFileFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTS(fileName) +MEDFileFieldMultiTS::MEDFileFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTS(fileName,loadAll) { } catch(INTERP_KERNEL::Exception& e) { throw e; } -MEDFileFieldMultiTS::MEDFileFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTS(fileName,fieldName) +MEDFileFieldMultiTS::MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTS(fileName,fieldName,loadAll) { } catch(INTERP_KERNEL::Exception& e) @@ -8247,9 +8301,9 @@ MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New() * is to delete this field using decrRef() as it is no more needed. * \throw If reading the file fails. */ -MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntFieldMultiTS(fileName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntFieldMultiTS(fileName,loadAll); ret->contentNotNull();//to check that content type matches with \a this type. return ret.retn(); } @@ -8264,9 +8318,9 @@ MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const char *fileName) throw( * \throw If reading the file fails. * \throw If there is no field named \a fieldName in the file. */ -MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) +MEDFileIntFieldMultiTS *MEDFileIntFieldMultiTS::New(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntFieldMultiTS(fileName,fieldName); + MEDCouplingAutoRefCountObjectPtr ret=new MEDFileIntFieldMultiTS(fileName,fieldName,loadAll); ret->contentNotNull();//to check that content type matches with \a this type. return ret.retn(); } @@ -8611,15 +8665,15 @@ MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWitho { } -MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTS(fileName) +MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTS(fileName,loadAll) { } catch(INTERP_KERNEL::Exception& e) { throw e; } -MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) -try:MEDFileAnyTypeFieldMultiTS(fileName,fieldName) +MEDFileIntFieldMultiTS::MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception) +try:MEDFileAnyTypeFieldMultiTS(fileName,fieldName,loadAll) { } catch(INTERP_KERNEL::Exception& e) @@ -8637,9 +8691,9 @@ MEDFileFields *MEDFileFields::New() return new MEDFileFields; } -MEDFileFields *MEDFileFields::New(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileFields *MEDFileFields::New(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) { - return new MEDFileFields(fileName); + return new MEDFileFields(fileName,loadAll); } std::size_t MEDFileFields::getHeapMemorySize() const @@ -8791,7 +8845,7 @@ MEDFileFields::MEDFileFields() { } -MEDFileFields::MEDFileFields(const char *fileName) throw(INTERP_KERNEL::Exception) +MEDFileFields::MEDFileFields(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception) try:MEDFileFieldGlobsReal(fileName) { MEDFileUtilities::CheckFileForRead(fileName); @@ -8808,12 +8862,12 @@ try:MEDFileFieldGlobsReal(fileName) { case MED_FLOAT64: { - _fields[i]=MEDFileFieldMultiTSWithoutSDA::New(fid,fieldName.c_str(),typcha,infos,nbOfStep,dtunit); + _fields[i]=MEDFileFieldMultiTSWithoutSDA::New(fid,fieldName.c_str(),typcha,infos,nbOfStep,dtunit,loadAll); break; } case MED_INT32: { - _fields[i]=MEDFileIntFieldMultiTSWithoutSDA::New(fid,fieldName.c_str(),typcha,infos,nbOfStep,dtunit); + _fields[i]=MEDFileIntFieldMultiTSWithoutSDA::New(fid,fieldName.c_str(),typcha,infos,nbOfStep,dtunit,loadAll); break; } default: diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index 44ada6414..867e36cb1 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -105,8 +105,8 @@ namespace ParaMEDMEM void getCoarseData(TypeOfField& type, std::pair& dad, std::string& pfl, std::string& loc) const throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); const MEDFileFieldPerMeshPerType *getFather() const; - void prepareLoading(med_idt fid, int profileIt, int& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); - void finishLoading(med_idt fid, int profileIt, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadOnlyStructureOfDataRecursively(med_idt fid, int profileIt, int& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadBigArray(med_idt fid, int profileIt, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void setNewStart(int newValueOfStart) throw(INTERP_KERNEL::Exception); int getIteration() const; int getOrder() const; @@ -120,8 +120,8 @@ namespace ParaMEDMEM int getNumberOfComponents() const; int getNumberOfTuples() const; int getStart() const { return _start; } - DataArray *getArray(); - const DataArray *getArray() const; + DataArray *getOrCreateAndGetArray(); + const DataArray *getOrCreateAndGetArray() const; const std::vector& getInfo() const; std::string getProfile() const; void setProfile(const char *newPflName); @@ -177,8 +177,8 @@ namespace ParaMEDMEM void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception); void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); const MEDFileFieldPerMesh *getFather() const; - void prepareLoading(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); - void finishLoading(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); void getDimension(int& dim) const; void fillTypesOfFieldAvailable(std::set& types) const throw(INTERP_KERNEL::Exception); @@ -191,8 +191,8 @@ namespace ParaMEDMEM void getSizes(int& globalSz, int& nbOfEntries) const; INTERP_KERNEL::NormalizedCellType getGeoType() const; int getNumberOfComponents() const; - DataArray *getArray(); - const DataArray *getArray() const; + DataArray *getOrCreateAndGetArray(); + const DataArray *getOrCreateAndGetArray() const; const std::vector& getInfo() const; std::vector getPflsReallyUsed() const; std::vector getLocsReallyUsed() const; @@ -232,8 +232,8 @@ namespace ParaMEDMEM void assignFieldNoProfileNoRenum(int& start, const std::vector& code, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception); void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); - void prepareLoading(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); - void finishLoading(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadOnlyStructureOfDataRecursively(med_idt fid, int &start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); void fillTypesOfFieldAvailable(std::set& types) const throw(INTERP_KERNEL::Exception); std::vector< std::vector< std::pair > > getFieldSplitedByType(std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const throw(INTERP_KERNEL::Exception); @@ -245,8 +245,8 @@ namespace ParaMEDMEM int getMeshOrder() const { return _mesh_order; } std::string getMeshName() const { return _mesh_name; } int getNumberOfComponents() const; - DataArray *getArray(); - const DataArray *getArray() const; + DataArray *getOrCreateAndGetArray(); + const DataArray *getOrCreateAndGetArray() const; const std::vector& getInfo() const; std::vector getPflsReallyUsed() const; std::vector getLocsReallyUsed() const; @@ -502,7 +502,11 @@ namespace ParaMEDMEM public: bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector& oldCode, const std::vector& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception); public: - virtual void finishLoading(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void allocNotFromFile(int newNbOfTuples) throw(INTERP_KERNEL::Exception); + void allocIfNecessaryTheArrayToReceiveDataFromFile() throw(INTERP_KERNEL::Exception); + void loadOnlyStructureOfDataRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid, const MEDFileWritable& opts, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); protected: int getMeshIdFromMeshName(const char *mName) const throw(INTERP_KERNEL::Exception); @@ -515,6 +519,11 @@ namespace ParaMEDMEM public: //! only useable on reading mutable int _csit; + // -3 means allocated and build from scratch + // -2 means allocated and read from a file + // -1 means not allocated and build from scratch + // >=0 means not allocated and read from a file + mutable int _nb_of_tuples_to_be_allocated; }; class MEDFileIntField1TSWithoutSDA; @@ -589,20 +598,20 @@ namespace ParaMEDMEM { protected: MEDFileAnyTypeField1TS(); - MEDFileAnyTypeField1TS(const char *fileName) throw(INTERP_KERNEL::Exception); - MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + MEDFileAnyTypeField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileAnyTypeField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception); MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent); static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception); // direct forwarding to MEDFileAnyTypeField1TSWithoutSDA instance _content public: - static MEDFileAnyTypeField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); int getDimension() const; int getIteration() const; int getOrder() const; @@ -670,9 +679,9 @@ namespace ParaMEDMEM class MEDLOADER_EXPORT MEDFileField1TS : public MEDFileAnyTypeField1TS { public: - static MEDFileField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileField1TS *New(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent); static MEDFileField1TS *New(); MEDFileIntField1TS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception); @@ -702,9 +711,9 @@ namespace ParaMEDMEM const MEDFileField1TSWithoutSDA *contentNotNull() const throw(INTERP_KERNEL::Exception); MEDFileField1TSWithoutSDA *contentNotNull() throw(INTERP_KERNEL::Exception); private: - MEDFileField1TS(const char *fileName) throw(INTERP_KERNEL::Exception); - MEDFileField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + MEDFileField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception); MEDFileField1TS(const MEDFileField1TSWithoutSDA& other, bool shallowCopyOfContent); MEDFileField1TS(); }; @@ -713,9 +722,9 @@ namespace ParaMEDMEM { public: static MEDFileIntField1TS *New(); - static MEDFileIntField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileIntField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileIntField1TS *New(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent); MEDFileField1TS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -738,9 +747,9 @@ namespace ParaMEDMEM MEDFileIntField1TSWithoutSDA *contentNotNull() throw(INTERP_KERNEL::Exception); private: MEDFileIntField1TS(); - MEDFileIntField1TS(const char *fileName) throw(INTERP_KERNEL::Exception); - MEDFileIntField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + MEDFileIntField1TS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll) throw(INTERP_KERNEL::Exception); MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent); }; @@ -749,8 +758,8 @@ namespace ParaMEDMEM protected: MEDFileAnyTypeFieldMultiTSWithoutSDA(); MEDFileAnyTypeFieldMultiTSWithoutSDA(const char *fieldName); - MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId) throw(INTERP_KERNEL::Exception); - MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception); + MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception); public: std::size_t getHeapMemorySize() const; virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const throw(INTERP_KERNEL::Exception); @@ -791,7 +800,7 @@ namespace ParaMEDMEM DataArray *getUndergroundDataArray(int iteration, int order) const throw(INTERP_KERNEL::Exception); DataArray *getUndergroundDataArrayExt(int iteration, int order, std::vector< std::pair,std::pair > >& entries) const throw(INTERP_KERNEL::Exception); bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector& oldCode, const std::vector& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception); - void finishLoading(med_idt fid, int nbPdt, med_field_type fieldTyp) throw(INTERP_KERNEL::Exception); + void loadStructureOrStructureAndBigArraysRecursively(med_idt fid, int nbPdt, med_field_type fieldTyp, bool loadAll) throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid, const MEDFileWritable& opts) const throw(INTERP_KERNEL::Exception); public: const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const throw(INTERP_KERNEL::Exception); @@ -819,8 +828,8 @@ namespace ParaMEDMEM class MEDLOADER_EXPORT MEDFileFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA { public: - static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception); - MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId) throw(INTERP_KERNEL::Exception); + static MEDFileFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception); const char *getTypeStr() const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const throw(INTERP_KERNEL::Exception); @@ -828,7 +837,7 @@ namespace ParaMEDMEM MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const throw(INTERP_KERNEL::Exception); protected: MEDFileFieldMultiTSWithoutSDA(const char *fieldName); - MEDFileFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception); + MEDFileFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception); med_field_type getMEDFileFieldType() const { return MED_FLOAT64; } MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const throw(INTERP_KERNEL::Exception); void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const throw(INTERP_KERNEL::Exception); @@ -839,15 +848,15 @@ namespace ParaMEDMEM class MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA : public MEDFileAnyTypeFieldMultiTSWithoutSDA { public: - static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception); - MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId) throw(INTERP_KERNEL::Exception); + static MEDFileIntFieldMultiTSWithoutSDA *New(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception); const char *getTypeStr() const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const throw(INTERP_KERNEL::Exception); MEDFileFieldMultiTSWithoutSDA *convertToDouble() const throw(INTERP_KERNEL::Exception); protected: MEDFileIntFieldMultiTSWithoutSDA(const char *fieldName); - MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit) throw(INTERP_KERNEL::Exception); + MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception); med_field_type getMEDFileFieldType() const { return MED_INT32; } MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const throw(INTERP_KERNEL::Exception); void checkCoherencyOfType(const MEDFileAnyTypeField1TSWithoutSDA *f1ts) const throw(INTERP_KERNEL::Exception); @@ -864,14 +873,14 @@ namespace ParaMEDMEM { protected: MEDFileAnyTypeFieldMultiTS(); - MEDFileAnyTypeFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception); - MEDFileAnyTypeFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + MEDFileAnyTypeFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileAnyTypeFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); MEDFileAnyTypeFieldMultiTS(const MEDFileAnyTypeFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent); static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); public: - static MEDFileAnyTypeFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception); @@ -938,8 +947,8 @@ namespace ParaMEDMEM { public: static MEDFileFieldMultiTS *New(); - static MEDFileFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileFieldMultiTS *New(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent); MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception); void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const throw(INTERP_KERNEL::Exception); @@ -967,8 +976,8 @@ std::vector< std::vector > getFieldSplitedByType2(int iterati private: MEDFileFieldMultiTS(); MEDFileFieldMultiTS(const MEDFileFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent); - MEDFileFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception); - MEDFileFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + MEDFileFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); }; /*! @@ -978,8 +987,8 @@ std::vector< std::vector > getFieldSplitedByType2(int iterati { public: static MEDFileIntFieldMultiTS *New(); - static MEDFileIntFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileIntFieldMultiTS *New(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent); MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception); void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const throw(INTERP_KERNEL::Exception); @@ -1003,8 +1012,8 @@ std::vector< std::vector > getFieldSplitedByType2(int iterati private: MEDFileIntFieldMultiTS(); MEDFileIntFieldMultiTS(const MEDFileIntFieldMultiTSWithoutSDA& other, bool shallowCopyOfContent); - MEDFileIntFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception); - MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + MEDFileIntFieldMultiTS(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); + MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll) throw(INTERP_KERNEL::Exception); }; class MEDCOUPLING_EXPORT MEDFileAnyTypeFieldMultiTSIterator @@ -1028,7 +1037,7 @@ std::vector< std::vector > getFieldSplitedByType2(int iterati { public: static MEDFileFields *New(); - static MEDFileFields *New(const char *fileName) throw(INTERP_KERNEL::Exception); + static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySize() const; MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception); MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -1067,7 +1076,7 @@ std::vector< std::vector > getFieldSplitedByType2(int iterati void changeLocsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception); private: MEDFileFields(); - MEDFileFields(const char *fileName) throw(INTERP_KERNEL::Exception); + MEDFileFields(const char *fileName, bool loadAll) throw(INTERP_KERNEL::Exception); private: std::vector< MEDCouplingAutoRefCountObjectPtr > _fields; }; diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 8a1b23654..99bd607de 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -1102,9 +1102,9 @@ namespace ParaMEDMEM class MEDFileAnyTypeField1TS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable { public: - static MEDFileAnyTypeField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); int getDimension() const throw(INTERP_KERNEL::Exception); int getIteration() const throw(INTERP_KERNEL::Exception); @@ -1229,9 +1229,9 @@ namespace ParaMEDMEM class MEDFileField1TS : public MEDFileAnyTypeField1TS { public: - static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); - static MEDFileField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - static MEDFileField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception); + static MEDFileField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileField1TS *New(); ParaMEDMEM::MEDFileIntField1TS *convertToInt(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception); @@ -1246,19 +1246,19 @@ namespace ParaMEDMEM void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception); %extend { - MEDFileField1TS(const char *fileName) throw(INTERP_KERNEL::Exception) + MEDFileField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileField1TS::New(fileName); + return MEDFileField1TS::New(fileName,loadAll); } - MEDFileField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) + MEDFileField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileField1TS::New(fileName,fieldName); + return MEDFileField1TS::New(fileName,fieldName,loadAll); } - MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) + MEDFileField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileField1TS::New(fileName,fieldName,iteration,order); + return MEDFileField1TS::New(fileName,fieldName,iteration,order,loadAll); } MEDFileField1TS() @@ -1364,9 +1364,9 @@ namespace ParaMEDMEM { public: static MEDFileIntField1TS *New(); - static MEDFileIntField1TS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileIntField1TS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); - static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception); + static MEDFileIntField1TS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntField1TS *New(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception); ParaMEDMEM::MEDFileField1TS *convertToDouble(bool deepCpyGlobs=true) const throw(INTERP_KERNEL::Exception); // void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception); @@ -1378,19 +1378,19 @@ namespace ParaMEDMEM return MEDFileIntField1TS::New(); } - MEDFileIntField1TS(const char *fileName) throw(INTERP_KERNEL::Exception) + MEDFileIntField1TS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileIntField1TS::New(fileName); + return MEDFileIntField1TS::New(fileName,loadAll); } - MEDFileIntField1TS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) + MEDFileIntField1TS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileIntField1TS::New(fileName,fieldName); + return MEDFileIntField1TS::New(fileName,fieldName,loadAll); } - MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order) throw(INTERP_KERNEL::Exception) + MEDFileIntField1TS(const char *fileName, const char *fieldName, int iteration, int order, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileIntField1TS::New(fileName,fieldName,iteration,order); + return MEDFileIntField1TS::New(fileName,fieldName,iteration,order,loadAll); } std::string __str__() const throw(INTERP_KERNEL::Exception) @@ -1490,7 +1490,7 @@ namespace ParaMEDMEM class MEDFileAnyTypeFieldMultiTS : public RefCountObject, public MEDFileFieldGlobsReal, public MEDFileWritable { public: - static MEDFileAnyTypeFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception); + static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); static MEDFileAnyTypeFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception); virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -1781,8 +1781,8 @@ namespace ParaMEDMEM { public: static MEDFileFieldMultiTS *New() throw(INTERP_KERNEL::Exception); - static MEDFileFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + static MEDFileFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); // MEDCouplingFieldDouble *getFieldAtLevel(TypeOfField type, int iteration, int order, int meshDimRelToMax, int renumPol=0) const throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *getFieldAtTopLevel(TypeOfField type, int iteration, int order, int renumPol=0) const throw(INTERP_KERNEL::Exception); @@ -1800,14 +1800,14 @@ namespace ParaMEDMEM return MEDFileFieldMultiTS::New(); } - MEDFileFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception) + MEDFileFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileFieldMultiTS::New(fileName); + return MEDFileFieldMultiTS::New(fileName,loadAll); } - MEDFileFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) + MEDFileFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileFieldMultiTS::New(fileName,fieldName); + return MEDFileFieldMultiTS::New(fileName,fieldName,loadAll); } std::string __str__() const throw(INTERP_KERNEL::Exception) @@ -1918,8 +1918,8 @@ namespace ParaMEDMEM { public: static MEDFileIntFieldMultiTS *New(); - static MEDFileIntFieldMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception); - static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception); + static MEDFileIntFieldMultiTS *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); + static MEDFileIntFieldMultiTS *New(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception); // void appendFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals) throw(INTERP_KERNEL::Exception); void appendFieldProfile(const MEDCouplingFieldDouble *field, const DataArrayInt *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile) throw(INTERP_KERNEL::Exception); @@ -1931,14 +1931,14 @@ namespace ParaMEDMEM return MEDFileIntFieldMultiTS::New(); } - MEDFileIntFieldMultiTS(const char *fileName) throw(INTERP_KERNEL::Exception) + MEDFileIntFieldMultiTS(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileIntFieldMultiTS::New(fileName); + return MEDFileIntFieldMultiTS::New(fileName,loadAll); } - MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName) throw(INTERP_KERNEL::Exception) + MEDFileIntFieldMultiTS(const char *fileName, const char *fieldName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileIntFieldMultiTS::New(fileName,fieldName); + return MEDFileIntFieldMultiTS::New(fileName,fieldName,loadAll); } std::string __str__() const throw(INTERP_KERNEL::Exception) @@ -2020,7 +2020,7 @@ namespace ParaMEDMEM { public: static MEDFileFields *New() throw(INTERP_KERNEL::Exception); - static MEDFileFields *New(const char *fileName) throw(INTERP_KERNEL::Exception); + static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception); MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception); void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); @@ -2043,9 +2043,9 @@ namespace ParaMEDMEM return MEDFileFields::New(); } - MEDFileFields(const char *fileName) throw(INTERP_KERNEL::Exception) + MEDFileFields(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception) { - return MEDFileFields::New(fileName); + return MEDFileFields::New(fileName,loadAll); } std::string __str__() const throw(INTERP_KERNEL::Exception)