X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileMesh.hxx;h=c895bc1c21f6f653fffb03e6ec2f9d7268744c6c;hb=77796374112bbbe85ad534ccea70085662cb3e32;hp=ca36d3f870ea5a29849b0d894a46ca7927de6a1a;hpb=064f758723b15f6a2451d56a9dc0ee8f3650f474;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index ca36d3f87..c895bc1c2 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -24,6 +24,7 @@ #include "MEDLoaderDefines.hxx" #include "MEDFileMeshLL.hxx" #include "MEDFileUtilities.hxx" +#include "MEDCouplingPartDefinition.hxx" #include "MEDFileMeshReadSelector.hxx" #include @@ -40,7 +41,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT virtual MEDFileMesh *createNewEmpty() const = 0; MEDLOADER_EXPORT virtual MEDFileMesh *deepCpy() const = 0; MEDLOADER_EXPORT virtual MEDFileMesh *shallowCpy() const = 0; @@ -200,15 +201,16 @@ namespace ParaMEDMEM MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileUMesh *New(); + MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); + MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(med_idt fid, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; MEDLOADER_EXPORT MEDFileMesh *deepCpy() const; MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const; MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const; MEDLOADER_EXPORT void clearNonDiscrAttributes() const; MEDLOADER_EXPORT void setName(const std::string& name); - MEDLOADER_EXPORT ~MEDFileUMesh(); // MEDLOADER_EXPORT int getMaxAbsFamilyIdInArrays() const; MEDLOADER_EXPORT int getMaxFamilyIdInArrays() const; @@ -222,6 +224,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT const DataArrayInt *getNumberFieldAtLevel(int meshDimRelToMaxExt) const; MEDLOADER_EXPORT const DataArrayInt *getRevNumberFieldAtLevel(int meshDimRelToMaxExt) const; MEDLOADER_EXPORT const DataArrayAsciiChar *getNameFieldAtLevel(int meshDimRelToMaxExt) const; + MEDLOADER_EXPORT const PartDefinition *getPartDefAtLevel(int meshDimRelToMaxExt, INTERP_KERNEL::NormalizedCellType gt=INTERP_KERNEL::NORM_ERROR) const; MEDLOADER_EXPORT int getNumberOfNodes() const; MEDLOADER_EXPORT bool hasImplicitPart() const; MEDLOADER_EXPORT int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const; @@ -260,6 +263,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT MEDCoupling1GTUMesh *getDirectUndergroundSingleGeoTypeMesh(INTERP_KERNEL::NormalizedCellType gt) const; MEDLOADER_EXPORT DataArrayInt *extractFamilyFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; MEDLOADER_EXPORT DataArrayInt *extractNumberFieldOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; + MEDLOADER_EXPORT int getRelativeLevOnGeoType(INTERP_KERNEL::NormalizedCellType gt) const; // MEDLOADER_EXPORT void setFamilyNameAttachedOnId(int id, const std::string& newFamName); MEDLOADER_EXPORT void setCoords(DataArrayDouble *coords); @@ -281,10 +285,13 @@ namespace ParaMEDMEM MEDLOADER_EXPORT bool unPolyze(std::vector& oldCode, std::vector& newCode, DataArrayInt *& o2nRenumCell); MEDLOADER_EXPORT DataArrayInt *zipCoords(); private: + MEDLOADER_EXPORT ~MEDFileUMesh(); void writeLL(med_idt fid) const; MEDFileUMesh(); MEDFileUMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); + void loadPartUMeshFromFile(med_idt fid, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); void loadUMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); + void dispatchLoadedPart(med_idt fid, const MEDFileUMeshL2& loaderl2, const std::string& mName, MEDFileMeshReadSelector *mrs); const MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt) const; MEDFileUMeshSplitL1 *getMeshAtLevSafe(int meshDimRelToMaxExt); void checkMeshDimCoherency(int meshDim, int meshDimRelToMax) const; @@ -302,6 +309,7 @@ namespace ParaMEDMEM MEDCouplingAutoRefCountObjectPtr _num_coords; MEDCouplingAutoRefCountObjectPtr _name_coords; mutable MEDCouplingAutoRefCountObjectPtr _rev_num_coords; + MEDCouplingAutoRefCountObjectPtr _part_coords; }; class MEDFileStructuredMesh : public MEDFileMesh @@ -309,7 +317,7 @@ namespace ParaMEDMEM friend class MEDFileMesh; public: MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT int getMaxAbsFamilyIdInArrays() const; MEDLOADER_EXPORT int getMaxFamilyIdInArrays() const; MEDLOADER_EXPORT int getMinFamilyIdInArrays() const; @@ -341,6 +349,7 @@ namespace ParaMEDMEM // tools MEDLOADER_EXPORT bool unPolyze(std::vector& oldCode, std::vector& newCode, DataArrayInt *& o2nRenumCell); protected: + ~MEDFileStructuredMesh() { } void changeFamilyIdArr(int oldId, int newId); void deepCpyAttributes(); void loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); @@ -374,7 +383,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; MEDLOADER_EXPORT MEDFileMesh *deepCpy() const; MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const; @@ -387,6 +396,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT const MEDCouplingCMesh *getMesh() const; MEDLOADER_EXPORT void setMesh(MEDCouplingCMesh *m); private: + ~MEDFileCMesh() { } const MEDCouplingStructuredMesh *getStructuredMesh() const; void writeLL(med_idt fid) const; MEDFileCMesh(); @@ -405,7 +415,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; MEDLOADER_EXPORT MEDFileMesh *deepCpy() const; MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const; @@ -417,6 +427,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT const MEDCouplingCurveLinearMesh *getMesh() const; MEDLOADER_EXPORT void setMesh(MEDCouplingCurveLinearMesh *m); private: + ~MEDFileCurveLinearMesh() { } MEDFileCurveLinearMesh(); MEDFileCurveLinearMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); const MEDCouplingStructuredMesh *getStructuredMesh() const; @@ -435,7 +446,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName); MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCpy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT std::string getName() const; MEDLOADER_EXPORT void setName(const std::string& newMeshName); MEDLOADER_EXPORT bool changeNames(const std::vector< std::pair >& modifTab); @@ -444,6 +455,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const; MEDLOADER_EXPORT void setOneTimeStep(MEDFileMesh *mesh1TimeStep); private: + ~MEDFileMeshMultiTS() { } void loadFromFile(const std::string& fileName, const std::string& mName); MEDFileMeshMultiTS(); MEDFileMeshMultiTS(const std::string& fileName); @@ -461,7 +473,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT static MEDFileMeshes *New(const std::string& fileName); MEDLOADER_EXPORT MEDFileMeshes *deepCpy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT std::string simpleRepr() const; MEDLOADER_EXPORT void simpleReprWithoutHeader(std::ostream& oss) const; MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const; @@ -478,6 +490,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void setMeshAtPos(int i, MEDFileMesh *mesh); MEDLOADER_EXPORT void destroyMeshAtPos(int i); private: + ~MEDFileMeshes() { } void checkCoherency() const; void loadFromFile(const std::string& fileName); MEDFileMeshes();