X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FMEDLoader%2FMEDFileMeshLL.hxx;h=c956ce7b4546245ae87c7ceeeafc11f42b8b469a;hb=693d8fb6ff12c9bef7e505b7d8791c93acbc96dc;hp=377dc48b9ebbdf36c9910ccf46cd6d4f63cf56dc;hpb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileMeshLL.hxx b/src/MEDLoader/MEDFileMeshLL.hxx index 377dc48b9..c956ce7b4 100644 --- a/src/MEDLoader/MEDFileMeshLL.hxx +++ b/src/MEDLoader/MEDFileMeshLL.hxx @@ -26,6 +26,7 @@ #include "MEDCouplingUMesh.hxx" #include "MEDCouplingCMesh.hxx" +#include "MEDCoupling1GTUMesh.hxx" #include "MEDCouplingCurveLinearMesh.hxx" #include "MEDCouplingAutoRefCountObjectPtr.hxx" @@ -35,25 +36,30 @@ namespace ParaMEDMEM { + class MEDFileMeshReadSelector; + class MEDFileMeshL2 : public RefCountObject { public: MEDFileMeshL2(); - std::size_t getHeapMemorySize() const { return 0; } + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildren() const; const char *getName() const { return _name.getReprForWrite(); } const char *getDescription() const { return _description.getReprForWrite(); } + const char *getUnivName() const { return _univ_name.getReprForWrite(); } const char *getTimeUnit() const { return _dt_unit.getReprForWrite(); } int getIteration() const { return _iteration; } int getOrder() const { return _order; } double getTime() { return _time; } - std::vector getAxisInfoOnMesh(med_idt fid, int mId, const char *mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& nstep, int& Mdim) throw(INTERP_KERNEL::Exception); - static int GetMeshIdFromName(med_idt fid, const char *mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1) throw(INTERP_KERNEL::Exception); - static double CheckMeshTimeStep(med_idt fid, const char *mname, int nstep, int dt, int it) throw(INTERP_KERNEL::Exception); - static void ReadFamiliesAndGrps(med_idt fid, const char *mname, std::map& fams, std::map >& grps); + std::vector getAxisInfoOnMesh(med_idt fid, int mId, const char *mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& nstep, int& Mdim); + static int GetMeshIdFromName(med_idt fid, const char *mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1); + static double CheckMeshTimeStep(med_idt fid, const char *mname, int nstep, int dt, int it); + static void ReadFamiliesAndGrps(med_idt fid, const char *mname, std::map& fams, std::map >& grps, MEDFileMeshReadSelector *mrs); static void WriteFamiliesAndGrps(med_idt fid, const char *mname, const std::map& fams, const std::map >& grps, int tooLongStrPol); protected: MEDFileString _name; MEDFileString _description; + MEDFileString _univ_name; MEDFileString _dt_unit; int _iteration; int _order; @@ -64,9 +70,9 @@ namespace ParaMEDMEM { public: MEDFileUMeshL2(); - void loadAll(med_idt fid, int mId, const char *mName, int dt, int it); - void loadConnectivity(med_idt fid, int mdim, const char *mName, int dt, int it); - void loadCoords(med_idt fid, int mId, const std::vector& infosOnComp, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception); + void loadAll(med_idt fid, int mId, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs); + void loadConnectivity(med_idt fid, int mdim, const char *mName, int dt, int it, MEDFileMeshReadSelector *mrs); + void loadCoords(med_idt fid, int mId, const std::vector& infosOnComp, const char *mName, int dt, int it); int getNumberOfLevels() const { return _per_type_mesh.size(); } bool emptyLev(int levId) const { return _per_type_mesh[levId].empty(); } const std::vector< MEDCouplingAutoRefCountObjectPtr >& getLev(int levId) const { return _per_type_mesh[levId]; } @@ -96,10 +102,10 @@ namespace ParaMEDMEM { public: MEDFileCMeshL2(); - void loadAll(med_idt fid, int mId, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception); + void loadAll(med_idt fid, int mId, const char *mName, int dt, int it); MEDCouplingCMesh *getMesh() { return _cmesh; } private: - static med_data_type GetDataTypeCorrespondingToSpaceId(int id) throw(INTERP_KERNEL::Exception); + static med_data_type GetDataTypeCorrespondingToSpaceId(int id); private: MEDCouplingAutoRefCountObjectPtr _cmesh; }; @@ -108,7 +114,7 @@ namespace ParaMEDMEM { public: MEDFileCLMeshL2(); - void loadAll(med_idt fid, int mId, const char *mName, int dt, int it) throw(INTERP_KERNEL::Exception); + void loadAll(med_idt fid, int mId, const char *mName, int dt, int it); MEDCouplingCurveLinearMesh *getMesh() { return _clmesh; } private: MEDCouplingAutoRefCountObjectPtr _clmesh; @@ -126,11 +132,44 @@ namespace ParaMEDMEM void updateTime() const; private: const MEDFileUMeshSplitL1 *_st; - mutable unsigned int _mpt_time; - mutable unsigned int _num_time; + mutable std::size_t _mpt_time; + mutable std::size_t _num_time; mutable MEDCouplingAutoRefCountObjectPtr _m; }; + class MEDFileUMeshAggregateCompute : public BigMemoryObject + { + public: + MEDFileUMeshAggregateCompute(); + void assignParts(const std::vector< const MEDCoupling1GTUMesh * >& mParts); + void assignUMesh(MEDCouplingUMesh *m); + MEDCouplingUMesh *getUmesh() const; + std::vector getParts() const; + std::vector getPartsWithoutComputation() const; + MEDCoupling1GTUMesh *getPartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const; + std::size_t getTimeOfThis() const; + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildren() const; + MEDFileUMeshAggregateCompute deepCpy(DataArrayDouble *coords) const; + bool isEqual(const MEDFileUMeshAggregateCompute& other, double eps, std::string& what) const; + void clearNonDiscrAttributes() const; + void synchronizeTinyInfo(const MEDFileMesh& master) const; + bool empty() const; + int getMeshDimension() const; + std::vector getDistributionOfTypes() const; + int getSize() const; + void setCoords(DataArrayDouble *coords); + private: + void forceComputationOfPartsFromUMesh() const; + std::size_t getTimeOfParts() const; + std::size_t getTimeOfUMesh() const; + private: + mutable std::vector< MEDCouplingAutoRefCountObjectPtr > _m_parts; + mutable std::size_t _mp_time; + mutable std::size_t _m_time; + mutable MEDCouplingAutoRefCountObjectPtr _m; + }; + class MEDFileUMeshSplitL1 : public RefCountObject { friend class MEDFileUMeshPermCompute; @@ -139,21 +178,26 @@ namespace ParaMEDMEM MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const char *mName, int id); MEDFileUMeshSplitL1(MEDCouplingUMesh *m); MEDFileUMeshSplitL1(MEDCouplingUMesh *m, bool newOrOld); - std::size_t getHeapMemorySize() const; - MEDFileUMeshSplitL1 *deepCpy() const; + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildren() const; + MEDFileUMeshSplitL1 *deepCpy(DataArrayDouble *coords) const; + void setCoords(DataArrayDouble *coords); bool isEqual(const MEDFileUMeshSplitL1 *other, double eps, std::string& what) const; void clearNonDiscrAttributes() const; void synchronizeTinyInfo(const MEDFileMesh& master) const; - void assignMesh(MEDCouplingUMesh *m, bool newOrOld) throw(INTERP_KERNEL::Exception); + void assignMesh(MEDCouplingUMesh *m, bool newOrOld); bool empty() const; bool presenceOfOneFams(const std::vector& ids) const; int getMeshDimension() const; void simpleRepr(std::ostream& oss) const; - int getSize() const throw(INTERP_KERNEL::Exception); + int getSize() const; MEDCouplingUMesh *getFamilyPart(const int *idsBg, const int *idsEnd, bool renum) const; DataArrayInt *getFamilyPartArr(const int *idsBg, const int *idsEnd, bool renum) const; MEDCouplingUMesh *getWholeMesh(bool renum) const; - DataArrayInt *getOrCreateAndGetFamilyField() throw(INTERP_KERNEL::Exception); + std::vector getDirectUndergroundSingleGeoTypeMeshes() const { return _m_by_types.getPartsWithoutComputation(); } + MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const { return _m_by_types.getPartWithoutComputation(gt); } + std::vector getDistributionOfTypes() const { return _m_by_types.getDistributionOfTypes(); } + DataArrayInt *getOrCreateAndGetFamilyField(); const DataArrayInt *getFamilyField() const; const DataArrayInt *getNumberField() const; const DataArrayAsciiChar *getNameField() const; @@ -166,9 +210,9 @@ namespace ParaMEDMEM void setFamilyArr(DataArrayInt *famArr); void setRenumArr(DataArrayInt *renumArr); void setNameArr(DataArrayAsciiChar *nameArr); - void changeFamilyIdArr(int oldId, int newId) throw(INTERP_KERNEL::Exception); + void changeFamilyIdArr(int oldId, int newId); // - void renumberNodesInConn(const int *newNodeNumbersO2N) throw(INTERP_KERNEL::Exception); + void renumberNodesInConn(const int *newNodeNumbersO2N); // static void ClearNonDiscrAttributes(const MEDCouplingMesh *tmp); static std::vector GetNewFamiliesNumber(int nb, const std::map& families); @@ -181,7 +225,7 @@ namespace ParaMEDMEM DataArrayInt *renumIfNeededArr(const DataArrayInt *da) const; void computeRevNum() const; private: - MEDCouplingAutoRefCountObjectPtr _m_by_types; + MEDFileUMeshAggregateCompute _m_by_types; MEDCouplingAutoRefCountObjectPtr _fam; MEDCouplingAutoRefCountObjectPtr _num; MEDCouplingAutoRefCountObjectPtr _names;