X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileField.hxx;h=e7539a889a80e798cb7d3c7415a21bd9410daeb2;hb=d583bbdfd69b88f836ceba1cd62356c80f6aad3b;hp=06f929f3b93cc566dd71b1eb4bfdc310734c3c30;hpb=4e9a620291e47249b080e10dfe603d29e9ed7ef3;p=modules%2Fmed.git diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index 06f929f3b..e7539a889 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -57,7 +57,7 @@ namespace ParaMEDMEM static MEDFileFieldLoc *New(med_idt fid, int id); static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector& refCoo, const std::vector& gsCoo, const std::vector& w); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildrenWithNull() const; MEDFileFieldLoc *deepCpy() const; MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; } MEDLOADER_EXPORT void writeLL(med_idt fid) const; @@ -86,7 +86,7 @@ namespace ParaMEDMEM std::vector _w; }; -/// @cond INTERNAL + /// @cond INTERNAL class MEDFileAnyTypeField1TSWithoutSDA; class MEDFileFieldPerMeshPerType; class MEDFileField1TSWithoutSDA; @@ -101,10 +101,10 @@ namespace ParaMEDMEM static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId); static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector 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& dad, std::string& pfl, std::string& loc) const; void writeLL(med_idt fid, const MEDFileFieldNameScope& nasc) const; @@ -149,7 +149,7 @@ namespace ParaMEDMEM MEDFileFieldGlobsReal& glob, DataArrayDouble *arr, std::vector< MEDCouplingAutoRefCountObjectPtr >& 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); @@ -177,10 +177,10 @@ namespace ParaMEDMEM 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 getDirectChildren() const; + std::vector 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; @@ -233,7 +233,7 @@ namespace ParaMEDMEM 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 getDirectChildren() const; + std::vector getDirectChildrenWithNull() const; MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const; void simpleRepr(int bkOffset,std::ostream& oss, int id) const; void copyTinyInfoFrom(const MEDCouplingMesh *mesh); @@ -274,14 +274,14 @@ namespace ParaMEDMEM private: int addNewEntryIfNecessary(INTERP_KERNEL::NormalizedCellType type); MEDCouplingFieldDouble *finishField(TypeOfField type, const MEDFileFieldGlobsReal *glob, - const std::vector< std::pair >& dads, const std::vector& locs, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); + const std::vector< std::pair >& dads, const std::vector& locs, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr &arrOut, const MEDFileFieldNameScope& nasc) const; MEDCouplingFieldDouble *finishField2(TypeOfField type, const MEDFileFieldGlobsReal *glob, const std::vector< std::pair >& dads, const std::vector& locs, const std::vector& geoTypes, - const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); + const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr &arrOut, const MEDFileFieldNameScope& nasc) const; MEDCouplingFieldDouble *finishFieldNode2(const MEDFileFieldGlobsReal *glob, const std::vector< std::pair >& dads, const std::vector& locs, - const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); + const MEDCouplingMesh *mesh, const DataArrayInt *da, bool& isPfl, MEDCouplingAutoRefCountObjectPtr &arrOut, const MEDFileFieldNameScope& nasc) const; DataArray *finishField4(const std::vector< std::pair >& 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, @@ -307,7 +307,7 @@ namespace ParaMEDMEM static MEDFileFieldGlobs *New(const std::string& fname); static MEDFileFieldGlobs *New(); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildrenWithNull() const; MEDFileFieldGlobs *deepCpy() const; MEDFileFieldGlobs *shallowCpyPart(const std::vector& pfls, const std::vector& locs) const; MEDFileFieldGlobs *deepCpyPart(const std::vector& pfls, const std::vector& locs) const; @@ -334,7 +334,6 @@ namespace ParaMEDMEM 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; @@ -360,7 +359,7 @@ namespace ParaMEDMEM std::string _file_name; }; -/// @endcond INTERNAL + /// @endcond INTERNAL class MEDFileFieldGlobsReal { @@ -368,7 +367,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT MEDFileFieldGlobsReal(const std::string& fname); MEDLOADER_EXPORT MEDFileFieldGlobsReal(); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT void simpleReprGlobs(std::ostream& oss) const; MEDLOADER_EXPORT void resetContent(); MEDLOADER_EXPORT void shallowCpyGlobs(const MEDFileFieldGlobsReal& other); @@ -412,7 +411,6 @@ namespace ParaMEDMEM 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); @@ -491,7 +489,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::vector& getInfo(); MEDLOADER_EXPORT void setInfo(const std::vector& infos); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector 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); @@ -545,7 +543,7 @@ namespace ParaMEDMEM }; class MEDFileIntField1TSWithoutSDA; - + /*! * SDA is for Shared Data Arrays such as profiles. */ @@ -656,7 +654,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::vector& getInfo(); MEDLOADER_EXPORT std::vector getTypesOfFieldAvailable() const; MEDLOADER_EXPORT std::vector< std::vector > > getFieldSplitedByType(const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, - std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const throw(INTERP_KERNEL::Exception); + std::vector< std::vector >& pfls, std::vector< std::vector >& 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& levs) const; @@ -665,6 +663,7 @@ namespace ParaMEDMEM 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; @@ -676,7 +675,7 @@ namespace ParaMEDMEM //! 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 getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT std::vector getPflsReallyUsed() const; MEDLOADER_EXPORT std::vector getLocsReallyUsed() const; MEDLOADER_EXPORT std::vector getPflsReallyUsedMulti() const; @@ -693,9 +692,9 @@ namespace ParaMEDMEM protected: MEDCouplingAutoRefCountObjectPtr _content; }; - + class MEDFileIntField1TS; - + /*! * User class. */ @@ -723,9 +722,9 @@ namespace ParaMEDMEM MEDLOADER_EXPORT MEDFileAnyTypeField1TS *shallowCpy() const; MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArray() const; MEDLOADER_EXPORT DataArrayDouble *getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const; - + MEDLOADER_EXPORT std::vector< std::vector > getFieldSplitedByType2(const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, - std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const throw(INTERP_KERNEL::Exception); + std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; public: MEDLOADER_EXPORT static void SetDataArrayDoubleInField(MEDCouplingFieldDouble *f, MEDCouplingAutoRefCountObjectPtr& arr); MEDLOADER_EXPORT static DataArrayDouble *ReturnSafelyDataArrayDouble(MEDCouplingAutoRefCountObjectPtr& arr); @@ -775,7 +774,7 @@ namespace ParaMEDMEM 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: @@ -785,7 +784,7 @@ namespace ParaMEDMEM MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll); public: MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const; MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr > splitComponents() const; MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr > splitDiscretizations() const; @@ -913,10 +912,11 @@ namespace ParaMEDMEM 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 getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const; MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const; MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const; @@ -1062,8 +1062,8 @@ namespace ParaMEDMEM MEDLOADER_EXPORT MEDFileAnyTypeField1TS *nextt(); private: MEDCouplingAutoRefCountObjectPtr _fmts; - int _iter_id; - int _nb_iter; + int _iter_id; + int _nb_iter; }; class MEDFileFieldsIterator; @@ -1077,7 +1077,7 @@ namespace ParaMEDMEM 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 getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileFields *deepCpy() const; MEDLOADER_EXPORT MEDFileFields *shallowCpy() const; MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const; @@ -1085,6 +1085,7 @@ namespace ParaMEDMEM 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 > getCommonIterations(bool& areThereSomeForgottenTS) const; MEDLOADER_EXPORT std::vector getFieldsNames() const; @@ -1100,6 +1101,7 @@ namespace ParaMEDMEM 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 >& timeSteps) const; MEDLOADER_EXPORT MEDFileFields *partOfThisNotLyingOnSpecifiedTimeSteps(const std::vector< std::pair >& timeSteps) const; @@ -1131,8 +1133,8 @@ namespace ParaMEDMEM MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *nextt(); private: MEDCouplingAutoRefCountObjectPtr _fs; - int _iter_id; - int _nb_iter; + int _iter_id; + int _nb_iter; }; }