static MEDFileFieldLoc *New(med_idt fid, int id);
static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
std::size_t getHeapMemorySizeWithoutChildren() const;
- std::vector<const BigMemoryObject *> getDirectChildren() const;
+ std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileFieldLoc *deepCpy() const;
MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
std::vector<double> _w;
};
-/// @cond INTERNAL
+ /// @cond INTERNAL
class MEDFileAnyTypeField1TSWithoutSDA;
class MEDFileFieldPerMeshPerType;
class MEDFileField1TSWithoutSDA;
static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId);
static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
std::size_t getHeapMemorySizeWithoutChildren() const;
- std::vector<const BigMemoryObject *> getDirectChildren() const;
+ std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileFieldPerMeshPerTypePerDisc *deepCpy(MEDFileFieldPerMeshPerType *father) const;
void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
- void assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
+ void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob);
void getCoarseData(TypeOfField& type, std::pair<int,int>& dad, std::string& pfl, std::string& loc) const;
void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const;
MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >& result);
static MEDFileFieldPerMeshPerTypePerDisc *NewObjectOnSameDiscThanPool(TypeOfField typeF, INTERP_KERNEL::NormalizedCellType geoType, DataArrayInt *idsOfMeshElt,
bool isPfl, int nbi, int offset, std::list< const MEDFileFieldPerMeshPerTypePerDisc *>& entriesOnSameDisc,
- MEDFileFieldGlobsReal& glob, bool ¬InExisting) throw(INTERP_KERNEL::Exception);
+ MEDFileFieldGlobsReal& glob, bool ¬InExisting);
private:
MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt);
MEDFileFieldPerMeshPerTypePerDisc(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt, const std::string& dummy);
static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc);
std::size_t getHeapMemorySizeWithoutChildren() const;
- std::vector<const BigMemoryObject *> getDirectChildren() const;
+ std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileFieldPerMeshPerType *deepCpy(MEDFileFieldPerMesh *father) const;
void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
- void assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
+ void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
void assignNodeFieldNoProfile(int& start, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob);
void assignNodeFieldProfile(int& start, const DataArrayInt *pfl, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
const MEDFileFieldPerMesh *getFather() const;
static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc);
std::size_t getHeapMemorySizeWithoutChildren() const;
- std::vector<const BigMemoryObject *> getDirectChildren() const;
+ std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
private:
int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type);
MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob,
- const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
+ const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob,
const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
const std::vector<INTERP_KERNEL::NormalizedCellType>& geoTypes,
- const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
+ const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob,
const std::vector< std::pair<int,int> >& dads, const std::vector<int>& locs,
- const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception);
+ const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr<DataArray> &arrOut, const MEDFileFieldNameScope& nasc) const;
DataArray *finishField4(const std::vector< std::pair<int,int> >& dads, const DataArrayInt *pflIn, int nbOfElems, DataArrayInt *&pflOut) const;
void assignNewLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves);
static void SortArraysPerType(const MEDFileFieldGlobsReal *glob, TypeOfField type,
static MEDFileFieldGlobs *New(const std::string& fname);
static MEDFileFieldGlobs *New();
std::size_t getHeapMemorySizeWithoutChildren() const;
- std::vector<const BigMemoryObject *> getDirectChildren() const;
+ std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDFileFieldGlobs *deepCpy() const;
MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
int getNbOfGaussPtPerCell(int locId) const;
int getLocalizationId(const std::string& loc) const;
std::string getFileName() const { return _file_name; }
- std::string getFileName2() const { return _file_name; }
const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
const DataArrayInt *getProfileFromId(int pflId) const;
std::string _file_name;
};
-/// @endcond INTERNAL
+ /// @endcond INTERNAL
class MEDFileFieldGlobsReal
{
MEDLOADER_EXPORT MEDFileFieldGlobsReal(const std::string& fname);
MEDLOADER_EXPORT MEDFileFieldGlobsReal();
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+ MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT void simpleReprGlobs(std::ostream& oss) const;
MEDLOADER_EXPORT void resetContent();
MEDLOADER_EXPORT void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
MEDLOADER_EXPORT int getNbOfGaussPtPerCell(int locId) const;
MEDLOADER_EXPORT int getLocalizationId(const std::string& loc) const;
MEDLOADER_EXPORT std::string getFileName() const;
- MEDLOADER_EXPORT std::string getFileName2() const;
MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalizationFromId(int locId) const;
MEDLOADER_EXPORT const MEDFileFieldLoc& getLocalization(const std::string& locName) const;
MEDLOADER_EXPORT MEDFileFieldLoc& getLocalizationFromId(int locId);
MEDLOADER_EXPORT std::vector<std::string>& getInfo();
MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+ MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
};
class MEDFileIntField1TSWithoutSDA;
-
+
/*!
* SDA is for Shared Data Arrays such as profiles.
*/
MEDLOADER_EXPORT std::vector<std::string>& getInfo();
MEDLOADER_EXPORT std::vector<TypeOfField> getTypesOfFieldAvailable() const;
MEDLOADER_EXPORT std::vector< std::vector<std::pair<int,int> > > getFieldSplitedByType(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
- std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception);
+ std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
MEDLOADER_EXPORT MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId);
MEDLOADER_EXPORT const MEDFileFieldPerMeshPerTypePerDisc *getLeafGivenMeshAndTypeAndLocId(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId) const;
MEDLOADER_EXPORT int getNonEmptyLevels(const std::string& mname, std::vector<int>& levs) const;
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void unloadArrays();
+ MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitComponents() const;
MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitDiscretizations() const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *deepCpy() const;
//! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+ MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
protected:
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> _content;
};
-
+
class MEDFileIntField1TS;
-
+
/*!
* User class.
*/
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *shallowCpy() const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray() const;
MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair<std::pair<INTERP_KERNEL::NormalizedCellType,int>,std::pair<int,int> > >& entries) const;
-
+
MEDLOADER_EXPORT std::vector< std::vector<DataArrayDouble *> > getFieldSplitedByType2(const std::string& mname, std::vector<INTERP_KERNEL::NormalizedCellType>& types, std::vector< std::vector<TypeOfField> >& typesF,
- std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const throw(INTERP_KERNEL::Exception);
+ std::vector< std::vector<std::string> >& pfls, std::vector< std::vector<std::string> >& locs) const;
public:
MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MEDCouplingAutoRefCountObjectPtr<DataArray>& arr);
MEDFileIntField1TS(const std::string& fileName, const std::string& fieldName, int iteration, int order, bool loadAll);
MEDFileIntField1TS(const MEDFileIntField1TSWithoutSDA& other, bool shallowCopyOfContent);
};
-
+
class MEDFileAnyTypeFieldMultiTSWithoutSDA : public RefCountObject, public MEDFileFieldNameScope
{
protected:
MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
public:
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+ MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const;
MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void unloadArrays();
+ MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void writeLL(med_idt fid) const;
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+ MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const;
MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt();
private:
MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTS> _fmts;
- int _iter_id;
- int _nb_iter;
+ int _iter_id;
+ int _nb_iter;
};
class MEDFileFieldsIterator;
MEDLOADER_EXPORT static MEDFileFields *New();
MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
- MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+ MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
MEDLOADER_EXPORT MEDFileFields *deepCpy() const;
MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
MEDLOADER_EXPORT void loadArrays();
MEDLOADER_EXPORT void loadArraysIfNecessary();
MEDLOADER_EXPORT void unloadArrays();
+ MEDLOADER_EXPORT void unloadArraysWithoutDataLoss();
MEDLOADER_EXPORT int getNumberOfFields() const;
MEDLOADER_EXPORT std::vector< std::pair<int,int> > getCommonIterations(bool& areThereSomeForgottenTS) const;
MEDLOADER_EXPORT std::vector<std::string> getFieldsNames() const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldAtPos(int i) const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *getFieldWithName(const std::string& fieldName) const;
MEDLOADER_EXPORT MEDFileFields *buildSubPart(const int *startIds, const int *endIds) const;
+ MEDLOADER_EXPORT bool removeFieldsWithoutAnyTimeStep();
MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedMeshName(const std::string& meshName) const;
MEDLOADER_EXPORT MEDFileFields *partOfThisLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair<int,int> >& timeSteps) const;
MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt();
private:
MEDCouplingAutoRefCountObjectPtr<MEDFileFields> _fs;
- int _iter_id;
- int _nb_iter;
+ int _iter_id;
+ int _nb_iter;
};
}