X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileFieldOverView.hxx;h=dcc1917f81798fe1a1c041e18e59a9c21a150242;hb=693d8fb6ff12c9bef7e505b7d8791c93acbc96dc;hp=1a3f2714e97c82334a33b3993124aa16f884d006;hpb=0186d533aebc7da5bbb158fde43c0b1758c0cca4;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileFieldOverView.hxx b/src/MEDLoader/MEDFileFieldOverView.hxx index 1a3f2714e..dcc1917f8 100644 --- a/src/MEDLoader/MEDFileFieldOverView.hxx +++ b/src/MEDLoader/MEDFileFieldOverView.hxx @@ -21,6 +21,8 @@ #ifndef __MEDFILEFIELDOVERVIEW_HXX__ #define __MEDFILEFIELDOVERVIEW_HXX__ +#include "MEDLoaderDefines.hxx" + #include "MEDCouplingAutoRefCountObjectPtr.hxx" #include "MEDCouplingRefCountObject.hxx" #include "MEDCoupling1GTUMesh.hxx" @@ -46,14 +48,15 @@ namespace ParaMEDMEM class MEDFileMeshStruct : public RefCountObject { public: - static MEDFileMeshStruct *New(const MEDFileMesh *mesh); - std::size_t getHeapMemorySize() const; + MEDLOADER_EXPORT static MEDFileMeshStruct *New(const MEDFileMesh *mesh); + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildren() const; const MEDFileMesh *getTheMesh() const { return _mesh; } int getNumberOfNodes() const { return _nb_nodes; } - int getNumberOfElemsOfGeoType(INTERP_KERNEL::NormalizedCellType t) const throw(INTERP_KERNEL::Exception); - int getLevelOfGeoType(INTERP_KERNEL::NormalizedCellType t) const throw(INTERP_KERNEL::Exception); + int getNumberOfElemsOfGeoType(INTERP_KERNEL::NormalizedCellType t) const; + int getLevelOfGeoType(INTERP_KERNEL::NormalizedCellType t) const; int getNumberOfLevs() const; - int getNumberOfGeoTypesInLev(int relativeLev) const throw(INTERP_KERNEL::Exception); + int getNumberOfGeoTypesInLev(int relativeLev) const; private: MEDFileMeshStruct(const MEDFileMesh *mesh); private: @@ -62,55 +65,101 @@ namespace ParaMEDMEM int _nb_nodes; std::vector< std::vector > _geo_types_distrib; }; - + + class MEDFileField1TSStructItem; + class MEDMeshMultiLev : public RefCountObject { public: - std::size_t getHeapMemorySize() const; + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildren() const; public: - static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities) throw(INTERP_KERNEL::Exception); - static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& levs) throw(INTERP_KERNEL::Exception); + static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); + static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& levs); + static MEDMeshMultiLev *NewOnlyOnNode(const MEDFileMesh *m, const DataArrayInt *pflOnNode); void setNodeReduction(const DataArrayInt *nr); + bool isFastlyTheSameStruct(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs) const; + MEDLOADER_EXPORT DataArray *buildDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const; + virtual void selectPartOfNodes(const DataArrayInt *pflNodes) = 0; + virtual MEDMeshMultiLev *prepare() const = 0; + int getNumberOfCells(INTERP_KERNEL::NormalizedCellType t) const; + int getNumberOfNodes() const; + protected: + std::string getPflNameOfId(int id) const; + DataArray *constructDataArray(const MEDFileField1TSStructItem& fst, const MEDFileFieldGlobsReal *globs, const DataArray *vals) const; protected: MEDMeshMultiLev(); - MEDMeshMultiLev(const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); - protected: + MEDMeshMultiLev(const MEDMeshMultiLev& other); + MEDMeshMultiLev(int nbNodes, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); + protected: std::vector< MEDCouplingAutoRefCountObjectPtr > _pfls; std::vector< INTERP_KERNEL::NormalizedCellType > _geo_types; std::vector _nb_entities; MEDCouplingAutoRefCountObjectPtr _node_reduction; + int _nb_nodes; + public: + static const int PARAMEDMEM_2_VTKTYPE_LGTH=34; + static const unsigned char PARAMEDMEM_2_VTKTYPE[PARAMEDMEM_2_VTKTYPE_LGTH]; }; - + + class MEDStructuredMeshMultiLev; + class MEDUMeshMultiLev : public MEDMeshMultiLev { public: - static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector& levs) throw(INTERP_KERNEL::Exception); - static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities) throw(INTERP_KERNEL::Exception); + static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector& levs); + static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); + void selectPartOfNodes(const DataArrayInt *pflNodes); + MEDMeshMultiLev *prepare() const; + MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MEDCouplingAutoRefCountObjectPtr& part); + MEDLOADER_EXPORT void buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *&types, DataArrayInt *&cellLocations, DataArrayInt *& cells, DataArrayInt *&faceLocations, DataArrayInt *&faces) const; + private: + void reorderNodesIfNecessary(MEDCouplingAutoRefCountObjectPtr& coords, DataArrayInt *nodalConnVTK, DataArrayInt *polyhedNodalConnVTK) const; private: + MEDUMeshMultiLev(const MEDUMeshMultiLev& other); MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector& levs); MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); private: std::vector< MEDCouplingAutoRefCountObjectPtr > _parts; }; - class MEDCMeshMultiLev : public MEDMeshMultiLev + class MEDStructuredMeshMultiLev : public MEDMeshMultiLev + { + public: + void selectPartOfNodes(const DataArrayInt *pflNodes); + virtual std::vector getNodeGridStructure() const = 0; + protected: + MEDStructuredMeshMultiLev(); + MEDStructuredMeshMultiLev(const MEDStructuredMeshMultiLev& other); + MEDStructuredMeshMultiLev(int nbOfNodes, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); + }; + + class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev { public: - static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector& levs) throw(INTERP_KERNEL::Exception); - static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities) throw(INTERP_KERNEL::Exception); + static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector& levs); + static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); + std::vector getNodeGridStructure() const; + MEDMeshMultiLev *prepare() const; + MEDLOADER_EXPORT std::vector< DataArrayDouble * > buildVTUArrays() const; private: + MEDCMeshMultiLev(const MEDCMeshMultiLev& other); MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector& levs); MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); private: std::vector< MEDCouplingAutoRefCountObjectPtr > _coords; }; - class MEDCurveLinearMeshMultiLev : public MEDMeshMultiLev + class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev { public: - static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector& levs) throw(INTERP_KERNEL::Exception); - static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector& gts, const std::vector& pfls , const std::vector& nbEntities) throw(INTERP_KERNEL::Exception); + static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector& levs); + static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector& gts, const std::vector& pfls , const std::vector& nbEntities); + std::vector getNodeGridStructure() const; + MEDMeshMultiLev *prepare() const; + MEDLOADER_EXPORT void buildVTUArrays(DataArrayDouble *&coords, std::vector& nodeStrct) const; private: + MEDCurveLinearMeshMultiLev(const MEDCurveLinearMeshMultiLev& other); MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector& levs); MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); private: @@ -118,26 +167,31 @@ namespace ParaMEDMEM std::vector _structure; }; - class MEDFileField1TSStructItem2 : public RefCountObject + class MEDFileField1TSStructItem2 : public BigMemoryObject { public: MEDFileField1TSStructItem2(); MEDFileField1TSStructItem2(INTERP_KERNEL::NormalizedCellType a, const std::pair& b, const std::string& pfl, const std::string& loc); - void checkWithMeshStructForCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); - void checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); - void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + void checkWithMeshStructForCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); + void checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); + void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); // - std::size_t getHeapMemorySize() const; + MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildren() const; // const DataArrayInt *getPfl(const MEDFileFieldGlobsReal *globs) const; INTERP_KERNEL::NormalizedCellType getGeo() const { return _geo_type; } + int getNbEntity() const { return _nb_of_entity; } + const std::pair& getStartStop() const { return _start_end; } std::string getPflName() const; + int getNbOfIntegrationPts(const MEDFileFieldGlobsReal *globs) const; //! warning this method also set _nb_of_entity attribute ! - void checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + void checkInRange(int nbOfEntity, int nip, const MEDFileFieldGlobsReal *globs); + bool isFastlyEqual(int& startExp, INTERP_KERNEL::NormalizedCellType gt, const char *pflName) const; bool operator==(const MEDFileField1TSStructItem2& other) const throw(INTERP_KERNEL::Exception); - bool isCellSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - bool isNodeSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - static MEDFileField1TSStructItem2 BuildAggregationOf(const std::vector& objs, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + bool isCellSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const; + bool isNodeSupportEqual(const MEDFileField1TSStructItem2& other, const MEDFileFieldGlobsReal *globs) const; + static MEDFileField1TSStructItem2 BuildAggregationOf(const std::vector& objs, const MEDFileFieldGlobsReal *globs); public: static const char NEWLY_CREATED_PFL_NAME[]; private: @@ -148,25 +202,28 @@ namespace ParaMEDMEM int _nb_of_entity; }; - class MEDFileField1TSStructItem : public RefCountObject + class MEDFileField1TSStructItem : public BigMemoryObject { public: + MEDFileField1TSStructItem() { } MEDFileField1TSStructItem(TypeOfField a, const std::vector< MEDFileField1TSStructItem2 >& b); - void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); + void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); bool operator==(const MEDFileField1TSStructItem& other) const throw(INTERP_KERNEL::Exception); - std::size_t getHeapMemorySize() const; + MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildren() const; bool isEntityCell() const; bool isComputed() const { return _computed; } TypeOfField getType() const { return _type; } std::size_t getNumberOfItems() const { return _items.size(); } const MEDFileField1TSStructItem2& operator[](std::size_t i) const throw(INTERP_KERNEL::Exception); // - bool isCellSupportEqual(const MEDFileField1TSStructItem& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - bool isNodeSupportEqual(const MEDFileField1TSStructItem& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - MEDFileField1TSStructItem simplifyMeOnCellEntity(const MEDFileFieldGlobs *globs) const throw(INTERP_KERNEL::Exception); - bool isCompatibleWithNodesDiscr(const MEDFileField1TSStructItem& other, const MEDFileMeshStruct *meshSt, const MEDFileFieldGlobs *globs) const throw(INTERP_KERNEL::Exception); - bool isFullyOnOneLev(const MEDFileMeshStruct *meshSt, int& theFirstLevFull) const throw(INTERP_KERNEL::Exception); - MEDMeshMultiLev *buildFromScratchDataSetSupportOnCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); + bool isCellSupportEqual(const MEDFileField1TSStructItem& other, const MEDFileFieldGlobsReal *globs) const; + bool isNodeSupportEqual(const MEDFileField1TSStructItem& other, const MEDFileFieldGlobsReal *globs) const; + MEDFileField1TSStructItem simplifyMeOnCellEntity(const MEDFileFieldGlobsReal *globs) const; + bool isCompatibleWithNodesDiscr(const MEDFileField1TSStructItem& other, const MEDFileMeshStruct *meshSt, const MEDFileFieldGlobsReal *globs) const; + bool isFullyOnOneLev(const MEDFileMeshStruct *meshSt, int& theFirstLevFull) const; + MEDLOADER_EXPORT MEDMeshMultiLev *buildFromScratchDataSetSupportOnCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) const; + MEDLOADER_EXPORT static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt); private: bool _computed; TypeOfField _type; @@ -176,19 +233,19 @@ namespace ParaMEDMEM class MEDFileField1TSStruct : public RefCountObject { public: - static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst) throw(INTERP_KERNEL::Exception); - void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobs *globs) throw(INTERP_KERNEL::Exception); - std::size_t getHeapMemorySize() const; - bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *mst) const throw(INTERP_KERNEL::Exception); - bool isSupportSameAs(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception); - bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception); - MEDMeshMultiLev *buildFromScratchDataSetSupport(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - bool isDataSetSupportFastlyEqualTo(const MEDFileField1TSStruct& other, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); + static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst); + void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildren() const; + bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *mst) const; + bool isSupportSameAs(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt); + bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt); + MEDLOADER_EXPORT MEDMeshMultiLev *buildFromScratchDataSetSupport(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) const; + bool isDataSetSupportFastlyEqualTo(const MEDFileField1TSStruct& other, const MEDFileFieldGlobsReal *globs) const; private: MEDFileField1TSStruct(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst); - static MEDFileField1TSStructItem BuildItemFrom(const MEDFileAnyTypeField1TS *ref, const MEDFileMeshStruct *meshSt); - bool presenceOfCellDiscr(int& pos) const throw(INTERP_KERNEL::Exception); - bool presenceOfPartialNodeDiscr(int& pos) const throw(INTERP_KERNEL::Exception); + bool presenceOfCellDiscr(int& pos) const; + bool presenceOfPartialNodeDiscr(int& pos) const; private: std::vector _already_checked; }; @@ -196,12 +253,13 @@ namespace ParaMEDMEM class MEDFileFastCellSupportComparator : public RefCountObject { public: - static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref) throw(INTERP_KERNEL::Exception); - MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception); - bool isEqual(const MEDFileAnyTypeFieldMultiTS *other) throw(INTERP_KERNEL::Exception); - bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeFieldMultiTS *other) throw(INTERP_KERNEL::Exception); - std::size_t getHeapMemorySize() const; + MEDLOADER_EXPORT static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref); + MEDLOADER_EXPORT MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const; + MEDLOADER_EXPORT bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const; + bool isEqual(const MEDFileAnyTypeFieldMultiTS *other); + bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeFieldMultiTS *other); + std::size_t getHeapMemorySizeWithoutChildren() const; + std::vector getDirectChildren() const; private: MEDFileFastCellSupportComparator(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref); private: