X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileField.hxx;h=2f6e1ae386759b5050fbf09f0b833e1bb5707deb;hb=854b8c30cd78bd9c7679492863fab2128552bb92;hp=ad1f8970c90837cf2bf8d0a66e7a5ca9a33a53af;hpb=6bd10d7e6cae03a42102a8eb70607c2d7e11adb5;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index ad1f8970c..2f6e1ae38 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -50,7 +50,7 @@ namespace ParaMEDMEM { public: void MEDLOADER_EXPORT simpleRepr(std::ostream& oss) const; - const MEDLOADER_EXPORT std::string& getName() const { return _name; } + std::string MEDLOADER_EXPORT getName() const { return _name; } void MEDLOADER_EXPORT setName(const char *name); static MEDFileFieldLoc *New(med_idt fid, const char *locName); static MEDFileFieldLoc *New(med_idt fid, int id); @@ -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& start, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadBigArray(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void setNewStart(int newValueOfStart) throw(INTERP_KERNEL::Exception); int getIteration() const; int getOrder() const; @@ -120,10 +120,9 @@ namespace ParaMEDMEM int getNumberOfComponents() const; int getNumberOfTuples() const; int getStart() const { return _start; } - DataArray *getArray(); - const DataArray *getArray() const; - const DataArrayDouble *getArrayDouble() const; - DataArrayDouble *getArrayDouble(); + int getEnd() const { return _end; } + DataArray *getOrCreateAndGetArray(); + const DataArray *getOrCreateAndGetArray() const; const std::vector& getInfo() const; std::string getProfile() const; void setProfile(const char *newPflName); @@ -163,6 +162,7 @@ namespace ParaMEDMEM std::string _localization; //! only on assignement -3 : ON_NODES, -2 : ON_CELLS, -1 : ON_GAUSS_NE, 0..* : ON_GAUSS_PT mutable int _loc_id; + mutable int _profile_it; public: mutable int _tmp_work1; }; @@ -179,8 +179,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); @@ -193,10 +193,8 @@ namespace ParaMEDMEM void getSizes(int& globalSz, int& nbOfEntries) const; INTERP_KERNEL::NormalizedCellType getGeoType() const; int getNumberOfComponents() const; - DataArray *getArray(); - const DataArray *getArray() const; - const DataArrayDouble *getArrayDouble() const; - DataArrayDouble *getArrayDouble(); + DataArray *getOrCreateAndGetArray(); + const DataArray *getOrCreateAndGetArray() const; const std::vector& getInfo() const; std::vector getPflsReallyUsed() const; std::vector getLocsReallyUsed() const; @@ -209,6 +207,7 @@ namespace ParaMEDMEM void getFieldAtLevel(int meshDim, TypeOfField type, const MEDFileFieldGlobsReal *glob, std::vector< std::pair >& dads, std::vector& pfls, std::vector& locs, std::vector& geoTypes) const; void fillValues(int& startEntryId, std::vector< std::pair,std::pair > >& entries) const; void setLeaves(const std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerTypePerDisc > >& leaves) throw(INTERP_KERNEL::Exception); + bool keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair >& its) throw(INTERP_KERNEL::Exception); static med_entity_type ConvertIntoMEDFileType(TypeOfField ikType, INTERP_KERNEL::NormalizedCellType ikGeoType, med_geometry_type& medfGeoType); private: std::vector addNewEntryIfNecessary(const MEDCouplingFieldDouble *field, int offset, int nbOfCells) throw(INTERP_KERNEL::Exception); @@ -236,8 +235,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); @@ -249,10 +248,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; - DataArrayDouble *getArrayDouble(); - const DataArrayDouble *getArrayDouble() const; + DataArray *getOrCreateAndGetArray(); + const DataArray *getOrCreateAndGetArray() const; const std::vector& getInfo() const; std::vector getPflsReallyUsed() const; std::vector getLocsReallyUsed() const; @@ -260,6 +257,7 @@ namespace ParaMEDMEM std::vector getLocsReallyUsedMulti() const; bool changeMeshNames(const std::vector< std::pair >& modifTab) 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 keepOnlySpatialDiscretization(TypeOfField tof, int &globalNum, std::vector< std::pair >& its) throw(INTERP_KERNEL::Exception); void changePflsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception); void changeLocsRefsNamesGen(const std::vector< std::pair, std::string > >& mapOfModif) throw(INTERP_KERNEL::Exception); MEDCouplingFieldDouble *getFieldOnMeshAtLevel(TypeOfField type, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, bool& isPfl, MEDCouplingAutoRefCountObjectPtr &arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); @@ -507,12 +505,21 @@ namespace ParaMEDMEM DataArray *getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception); public: bool renumberEntitiesLyingOnMesh(const char *meshName, const std::vector& oldCode, const std::vector& newCode, const DataArrayInt *renumO2N, MEDFileFieldGlobsReal& glob) throw(INTERP_KERNEL::Exception); + std::vector< MEDCouplingAutoRefCountObjectPtr > splitDiscretizations() const throw(INTERP_KERNEL::Exception); + int keepOnlySpatialDiscretization(TypeOfField tof, std::vector< std::pair >& its) 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); + bool 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 loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadStructureAndBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void releaseArrays() 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); int addNewEntryIfNecessary(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception); + void updateData(int newLgth, const std::vector< std::pair >& oldStartStops) throw(INTERP_KERNEL::Exception); protected: std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > > _field_per_mesh; int _iteration; @@ -521,6 +528,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; @@ -595,20 +607,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; @@ -641,7 +653,11 @@ namespace ParaMEDMEM int getNonEmptyLevels(const char *mname, std::vector& levs) const throw(INTERP_KERNEL::Exception); public: void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); + void loadArrays() throw(INTERP_KERNEL::Exception); + void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception); + void releaseArrays() throw(INTERP_KERNEL::Exception); std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitComponents() const throw(INTERP_KERNEL::Exception); + std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeField1TS > > splitDiscretizations() const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeField1TS *deepCpy() const throw(INTERP_KERNEL::Exception); int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr) throw(INTERP_KERNEL::Exception); virtual MEDFileAnyTypeField1TS *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0; @@ -664,7 +680,6 @@ namespace ParaMEDMEM virtual med_field_type getMEDFileFieldType() const = 0; MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() throw(INTERP_KERNEL::Exception); const MEDFileAnyTypeField1TSWithoutSDA *contentNotNullBase() const throw(INTERP_KERNEL::Exception); - //void setContent(MEDCouplingAutoRefCountObjectPtr newc); tony protected: MEDCouplingAutoRefCountObjectPtr _content; }; @@ -677,9 +692,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); @@ -709,9 +724,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(); }; @@ -720,9 +735,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); @@ -745,9 +760,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); }; @@ -756,12 +771,13 @@ 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); virtual std::vector< MEDCouplingAutoRefCountObjectPtr > splitComponents() const throw(INTERP_KERNEL::Exception); + virtual std::vector< MEDCouplingAutoRefCountObjectPtr > splitDiscretizations() const throw(INTERP_KERNEL::Exception); virtual const char *getTypeStr() const throw(INTERP_KERNEL::Exception) = 0; virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0; virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const throw(INTERP_KERNEL::Exception) = 0; @@ -798,8 +814,11 @@ 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); + void loadBigArraysRecursively(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void loadBigArraysRecursivelyIfNecessary(med_idt fid, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); + void releaseArrays() throw(INTERP_KERNEL::Exception); public: const MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeField1TSWithoutSDA *getTimeStepAtPos2(int pos) throw(INTERP_KERNEL::Exception); @@ -826,8 +845,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); @@ -835,7 +854,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); @@ -846,15 +865,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); @@ -863,7 +882,7 @@ namespace ParaMEDMEM }; class MEDFileAnyTypeFieldMultiTSIterator; - + class MEDFileFastCellSupportComparator; /*! * User class. */ @@ -871,26 +890,33 @@ 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, const char *fieldName) 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, bool loadAll=true) throw(INTERP_KERNEL::Exception); + void loadArrays() throw(INTERP_KERNEL::Exception); + void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception); + void releaseArrays() 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); std::size_t getHeapMemorySize() const; virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception); std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const throw(INTERP_KERNEL::Exception); + std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const throw(INTERP_KERNEL::Exception); virtual MEDFileAnyTypeFieldMultiTS *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0; virtual void checkCoherencyOfType(const MEDFileAnyTypeField1TS *f1ts) const throw(INTERP_KERNEL::Exception) = 0; // virtual MEDFileAnyTypeField1TS *getTimeStepAtPos(int pos) const throw(INTERP_KERNEL::Exception) = 0; MEDFileAnyTypeField1TS *getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception); MEDFileAnyTypeField1TS *getTimeStepGivenTime(double time, double eps=1e-8) const throw(INTERP_KERNEL::Exception); + static std::vector< std::vector > SplitIntoCommonTimeSeries(const std::vector& vectFMTS) throw(INTERP_KERNEL::Exception); + static std::vector< std::vector > SplitPerCommonSupport(const std::vector& vectFMTS, const MEDFileMesh *mesh) throw(INTERP_KERNEL::Exception); + static int CheckSupportAcrossTime(MEDFileAnyTypeFieldMultiTS *f0, MEDFileAnyTypeFieldMultiTS *f1, const MEDFileMesh *mesh, TypeOfField& tof0, TypeOfField& tof1) throw(INTERP_KERNEL::Exception); public:// direct forwarding to MEDFileField1TSWithoutSDA instance _content std::string getName() const; void setName(const char *name); @@ -932,6 +958,8 @@ namespace ParaMEDMEM protected: MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() throw(INTERP_KERNEL::Exception); const MEDFileAnyTypeFieldMultiTSWithoutSDA *contentNotNullBase() const throw(INTERP_KERNEL::Exception); + private: + static std::vector< std::vector > SplitPerCommonSupportNotNodesAlg(const std::vector& vectFMTS, const MEDFileMesh *mesh, std::vector< MEDCouplingAutoRefCountObjectPtr >& cmps) throw(INTERP_KERNEL::Exception); protected: MEDCouplingAutoRefCountObjectPtr _content; }; @@ -945,8 +973,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); @@ -974,8 +1002,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); }; /*! @@ -985,8 +1013,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); @@ -1010,8 +1038,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 @@ -1035,12 +1063,15 @@ 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); void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception); + void loadArrays() throw(INTERP_KERNEL::Exception); + void loadArraysIfNecessary() throw(INTERP_KERNEL::Exception); + void releaseArrays() throw(INTERP_KERNEL::Exception); int getNumberOfFields() const; std::vector< std::pair > getCommonIterations(bool& areThereSomeForgottenTS) const throw(INTERP_KERNEL::Exception); std::vector getFieldsNames() const throw(INTERP_KERNEL::Exception); @@ -1074,7 +1105,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; };