X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileMeshLL.hxx;h=b6872efc7763691dbd9daf02c69ea300d45f3bf4;hb=79402db9829440108ff06f587b21c86bf8b945db;hp=ffb34e35adbb41099fdab47473124cc2c788fa0a;hpb=d583bbdfd69b88f836ceba1cd62356c80f6aad3b;p=modules%2Fmed.git diff --git a/src/MEDLoader/MEDFileMeshLL.hxx b/src/MEDLoader/MEDFileMeshLL.hxx index ffb34e35a..b6872efc7 100644 --- a/src/MEDLoader/MEDFileMeshLL.hxx +++ b/src/MEDLoader/MEDFileMeshLL.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,7 @@ #include "MEDCouplingUMesh.hxx" #include "MEDCouplingCMesh.hxx" #include "MEDCoupling1GTUMesh.hxx" +#include "MEDCouplingPartDefinition.hxx" #include "MEDCouplingCurveLinearMesh.hxx" #include "MEDCouplingAutoRefCountObjectPtr.hxx" @@ -50,7 +51,8 @@ namespace ParaMEDMEM const char *getTimeUnit() const { return _dt_unit.getReprForWrite(); } int getIteration() const { return _iteration; } int getOrder() const { return _order; } - double getTime() { return _time; } + double getTime() const { return _time; } + MEDCouplingAutoRefCountObjectPtr getPartDefOfCoo() const { return _part_coords; } std::vector getAxisInfoOnMesh(med_idt fid, int mId, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& nstep, int& Mdim); static int GetMeshIdFromName(med_idt fid, const std::string& mName, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1); static double CheckMeshTimeStep(med_idt fid, const std::string& mname, int nstep, int dt, int it); @@ -64,15 +66,20 @@ namespace ParaMEDMEM int _iteration; int _order; double _time; + MEDCouplingAutoRefCountObjectPtr _part_coords; }; class MEDFileUMeshL2 : public MEDFileMeshL2 { public: MEDFileUMeshL2(); + std::vector loadCommonPart(med_idt fid, int mId, const std::string& mName, int dt, int it, int& Mdim); void loadAll(med_idt fid, int mId, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); + void loadPart(med_idt fid, int mId, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt, int it, MEDFileMeshReadSelector *mrs); void loadConnectivity(med_idt fid, int mdim, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); + void loadPartOfConnectivity(med_idt fid, int mdim, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt, int it, MEDFileMeshReadSelector *mrs); void loadCoords(med_idt fid, int mId, const std::vector& infosOnComp, const std::string& mName, int dt, int it); + void loadPartCoords(med_idt fid, int mId, const std::vector& infosOnComp, const std::string& mName, int dt, int it, int nMin, int nMax); 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]; } @@ -145,13 +152,17 @@ namespace ParaMEDMEM MEDFileUMeshAggregateCompute(); void setName(const std::string& name); void assignParts(const std::vector< const MEDCoupling1GTUMesh * >& mParts); + void assignDefParts(const std::vector& partDefs); void assignUMesh(MEDCouplingUMesh *m); MEDCouplingUMesh *getUmesh() const; + int getNumberOfCells() const; std::vector getParts() const; std::vector getGeoTypes() const; - std::vector getPartsWithoutComputation() const; - MEDCoupling1GTUMesh *getPartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const; + std::vector retrievePartsWithoutComputation() const; + MEDCoupling1GTUMesh *retrievePartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const; void getStartStopOfGeoTypeWithoutComputation(INTERP_KERNEL::NormalizedCellType gt, int& start, int& stop) const; + void renumberNodesInConnWithoutComputation(const int *newNodeNumbersO2N); + bool isStoredSplitByType() const; std::size_t getTimeOfThis() const; std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; @@ -165,6 +176,9 @@ namespace ParaMEDMEM int getSize() const; void setCoords(DataArrayDouble *coords); void forceComputationOfPartsFromUMesh() const; + const PartDefinition *getPartDefOfWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const; + void serialize(std::vector& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr >& bigArraysI) const; + void unserialize(const std::string& name, DataArrayDouble *coo, std::vector& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr >& bigArraysI); private: std::size_t getTimeOfParts() const; std::size_t getTimeOfUMesh() const; @@ -173,6 +187,7 @@ namespace ParaMEDMEM mutable std::size_t _mp_time; mutable std::size_t _m_time; mutable MEDCouplingAutoRefCountObjectPtr _m; + mutable std::vector< MEDCouplingAutoRefCountObjectPtr > _part_def; }; class MEDFileUMeshSplitL1 : public RefCountObject @@ -203,9 +218,11 @@ namespace ParaMEDMEM 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; + int getNumberOfCells() const; + bool isMeshStoredSplitByType() const { return _m_by_types.isStoredSplitByType(); } std::vector getGeoTypes() const; - std::vector getDirectUndergroundSingleGeoTypeMeshes() const { return _m_by_types.getPartsWithoutComputation(); } - MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const { return _m_by_types.getPartWithoutComputation(gt); } + std::vector getDirectUndergroundSingleGeoTypeMeshes() const { return _m_by_types.retrievePartsWithoutComputation(); } + MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const { return _m_by_types.retrievePartWithoutComputation(gt); } DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; std::vector getDistributionOfTypes() const { return _m_by_types.getDistributionOfTypes(); } @@ -214,25 +231,32 @@ namespace ParaMEDMEM const DataArrayInt *getNumberField() const; const DataArrayAsciiChar *getNameField() const; const DataArrayInt *getRevNumberField() const; + const PartDefinition *getPartDef(INTERP_KERNEL::NormalizedCellType gt) const; void eraseFamilyField(); void setGroupsFromScratch(const std::vector& ms, std::map& familyIds, std::map >& groups); void write(med_idt fid, const std::string& mName, int mdim) const; // void setFamilyArr(DataArrayInt *famArr); + DataArrayInt *getFamilyField(); void setRenumArr(DataArrayInt *renumArr); void setNameArr(DataArrayAsciiChar *nameArr); void changeFamilyIdArr(int oldId, int newId); // void renumberNodesInConn(const int *newNodeNumbersO2N); // + void serialize(std::vector& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr >& bigArraysI) const; + void unserialize(const std::string& name, DataArrayDouble *coo, std::vector& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr >& bigArraysI); + // static void ClearNonDiscrAttributes(const MEDCouplingMesh *tmp); static std::vector GetNewFamiliesNumber(int nb, const std::map& families); static void TraduceFamilyNumber(const std::vector< std::vector >& fidsGrps, std::map& familyIds, std::map& famIdTrad, std::map& newfams); static DataArrayInt *Renumber(const DataArrayInt *renum, const DataArrayInt *da); static MEDCouplingUMesh *Renumber2(const DataArrayInt *renum, MEDCouplingUMesh *m, const int *cellIds); + static MEDFileUMeshSplitL1 *Unserialize(const std::string& name, DataArrayDouble *coo, std::vector& tinyInt, std::vector< MEDCouplingAutoRefCountObjectPtr >& bigArraysI); private: + MEDFileUMeshSplitL1(); void assignCommonPart(); MEDCouplingUMesh *renumIfNeeded(MEDCouplingUMesh *m, const int *cellIds) const; DataArrayInt *renumIfNeededArr(const DataArrayInt *da) const;