X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FMEDFileMesh.hxx;h=1e0f48bb2cb855431ca99f80bc00a7b91dba18ef;hb=cdd09520be1ff9d51b7f67e39fb0866bb71db901;hp=87ffb429a08903a41fee7b988b9755b77634e42a;hpb=234460763336340b26f2fe131594d303e87f2e03;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index 87ffb429a..1e0f48bb2 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 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,11 +27,12 @@ #include "MEDCouplingPartDefinition.hxx" #include "MEDFileMeshReadSelector.hxx" #include "MEDFileJoint.hxx" +#include "MEDFileEquivalence.hxx" #include #include -namespace ParaMEDMEM +namespace MEDCoupling { class MEDFileFieldGlobsReal; class MEDFileField1TSStructItem; @@ -44,7 +45,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() 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 *deepCopy() const = 0; MEDLOADER_EXPORT virtual MEDFileMesh *shallowCpy() const = 0; MEDLOADER_EXPORT virtual bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const; MEDLOADER_EXPORT virtual void clearNonDiscrAttributes() const; @@ -62,10 +63,12 @@ namespace ParaMEDMEM MEDLOADER_EXPORT int getIteration() const { return _iteration; } MEDLOADER_EXPORT void setTimeValue(double time) { _time=time; } MEDLOADER_EXPORT void setTime(int dt, int it, double time) { _time=time; _iteration=dt; _order=it; } - MEDLOADER_EXPORT double getTime(int& dt, int& it) { dt=_iteration; it=_order; return _time; } + MEDLOADER_EXPORT double getTime(int& dt, int& it) const { dt=_iteration; it=_order; return _time; } MEDLOADER_EXPORT double getTimeValue() const { return _time; } MEDLOADER_EXPORT void setTimeUnit(const std::string& unit) { _dt_unit=unit; } MEDLOADER_EXPORT std::string getTimeUnit() const { return _dt_unit; } + MEDLOADER_EXPORT void setAxisType(MEDCouplingAxisType at) { _axis_type=at; } + MEDLOADER_EXPORT MEDCouplingAxisType getAxisType() const { return _axis_type; } MEDLOADER_EXPORT std::vector getAllGeoTypes() const; MEDLOADER_EXPORT virtual int getNumberOfNodes() const = 0; MEDLOADER_EXPORT virtual int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const = 0; @@ -73,6 +76,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT virtual int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const = 0; MEDLOADER_EXPORT virtual void releaseImplicitPartIfAny() const = 0; MEDLOADER_EXPORT virtual std::vector getGeoTypesAtLevel(int meshDimRelToMax) const = 0; + MEDLOADER_EXPORT virtual int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const = 0; MEDLOADER_EXPORT virtual std::vector getNonEmptyLevels() const = 0; MEDLOADER_EXPORT virtual std::vector getNonEmptyLevelsExt() const = 0; MEDLOADER_EXPORT virtual std::vector getFamArrNonEmptyLevelsExt() const = 0; @@ -81,9 +85,10 @@ namespace ParaMEDMEM MEDLOADER_EXPORT virtual void write(const std::string& fileName, int mode) const; MEDLOADER_EXPORT virtual void write(med_idt fid) const; MEDLOADER_EXPORT virtual int getSizeAtLevel(int meshDimRelToMaxExt) const = 0; - MEDLOADER_EXPORT virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const = 0; + MEDLOADER_EXPORT virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const = 0; MEDLOADER_EXPORT virtual std::vector getDistributionOfTypes(int meshDimRelToMax) const; MEDLOADER_EXPORT virtual void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const = 0; + MEDLOADER_EXPORT virtual MEDFileMesh *cartesianize() const = 0; // MEDLOADER_EXPORT bool areFamsEqual(const MEDFileMesh *other, std::string& what) const; MEDLOADER_EXPORT bool areGrpsEqual(const MEDFileMesh *other, std::string& what) const; @@ -114,6 +119,17 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void setGroupsOnFamily(const std::string& famName, const std::vector& grps); MEDLOADER_EXPORT std::vector getGroupsNames() const; MEDLOADER_EXPORT std::vector getFamiliesNames() const; + MEDLOADER_EXPORT std::vector getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const; + MEDLOADER_EXPORT std::vector getGrpNonEmptyLevelsExt(const std::string& grp) const; + MEDLOADER_EXPORT std::vector getGrpNonEmptyLevels(const std::string& grp) const; + MEDLOADER_EXPORT std::vector getGrpsNonEmptyLevels(const std::vector& grps) const; + MEDLOADER_EXPORT std::vector getGrpsNonEmptyLevelsExt(const std::vector& grps) const; + MEDLOADER_EXPORT virtual std::vector getFamsNonEmptyLevels(const std::vector& fams) const = 0; + MEDLOADER_EXPORT virtual std::vector getFamsNonEmptyLevelsExt(const std::vector& fams) const = 0; + MEDLOADER_EXPORT std::vector getFamNonEmptyLevels(const std::string& fam) const; + MEDLOADER_EXPORT std::vector getFamNonEmptyLevelsExt(const std::string& fam) const; + MEDLOADER_EXPORT std::vector getFamiliesNamesWithFilePointOfView() const; + MEDLOADER_EXPORT static std::string GetMagicFamilyStr(); MEDLOADER_EXPORT void assignFamilyNameWithGroupName(); MEDLOADER_EXPORT std::vector removeEmptyGroups(); MEDLOADER_EXPORT void removeGroup(const std::string& name); @@ -170,9 +186,13 @@ namespace ParaMEDMEM MEDLOADER_EXPORT virtual DataArrayInt *getNodeFamiliesArr(const std::vector& fams, bool renum=false) const; // tools MEDLOADER_EXPORT virtual bool unPolyze(std::vector& oldCode, std::vector& newCode, DataArrayInt *& o2nRenumCell) = 0; - MEDLOADER_EXPORT int getNumberOfJoints(); + MEDLOADER_EXPORT int getNumberOfJoints() const; MEDLOADER_EXPORT MEDFileJoints *getJoints() const; - MEDLOADER_EXPORT void setJoints( MEDFileJoints* joints ); + MEDLOADER_EXPORT void setJoints( MEDFileJoints* joints ); + MEDFileEquivalences *getEquivalences() { return _equiv; } + const MEDFileEquivalences *getEquivalences() const { return _equiv; } + void killEquivalences() { _equiv=(MEDFileEquivalences *)0; } + void initializeEquivalences() { _equiv=MEDFileEquivalences::New(this); } protected: MEDFileMesh(); //! protected because no way in MED file API to specify this name @@ -184,7 +204,9 @@ namespace ParaMEDMEM void getFamilyRepr(std::ostream& oss) const; virtual void appendFamilyEntries(const DataArrayInt *famIds, const std::vector< std::vector >& fidsOfGrps, const std::vector& grpNames); virtual void changeFamilyIdArr(int oldId, int newId) = 0; - virtual std::list< MEDCouplingAutoRefCountObjectPtr > getAllNonNullFamilyIds() const = 0; + virtual std::list< MCAuto > getAllNonNullFamilyIds() const = 0; + virtual void loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs) = 0; + void loadLLWithAdditionalItems(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); void addGroupUnderground(bool isNodeGroup, const DataArrayInt *ids, DataArrayInt *famArr); static void TranslateFamilyIds(int offset, DataArrayInt *famArr, std::vector< std::vector >& famIdsPerGrp); static void ChangeAllGroupsContainingFamily(std::map >& groups, const std::string& familyNameToChange, const std::vector& newFamiliesNames); @@ -192,7 +214,12 @@ namespace ParaMEDMEM static std::string CreateNameNotIn(const std::string& nameTry, const std::vector& namesToAvoid); static int PutInThirdComponentOfCodeOffset(std::vector& code, int strt); void writeJoints(med_idt fid) const; - void loadJointsFromFile(med_idt fid, MEDFileJoints* toUseInstedOfReading=0); + void loadJointsFromFile(med_idt fid, MEDFileJoints *toUseInstedOfReading=0); + void loadEquivalences(med_idt fid); + void deepCpyEquivalences(const MEDFileMesh& other); + bool areEquivalencesEqual(const MEDFileMesh *other, std::string& what) const; + void getEquivalencesRepr(std::ostream& oss) const; + void checkCartesian() const; protected: int _order; int _iteration; @@ -203,7 +230,9 @@ namespace ParaMEDMEM mutable std::string _univ_name; bool _univ_wr_status; std::string _desc_name; - MEDCouplingAutoRefCountObjectPtr _joints; + MEDCouplingAxisType _axis_type; + MCAuto _joints; + MCAuto _equiv; protected: std::map > _groups; std::map _families; @@ -223,9 +252,12 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; - MEDLOADER_EXPORT MEDFileMesh *deepCpy() const; - MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const; + MEDLOADER_EXPORT MEDFileUMesh *deepCopy() const; + MEDLOADER_EXPORT MEDFileUMesh *shallowCpy() const; MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const; + MEDLOADER_EXPORT void checkConsistency() const; + MEDLOADER_EXPORT void checkSMESHConsistency() const; + MEDLOADER_EXPORT void clearNodeAndCellNumbers(); MEDLOADER_EXPORT void clearNonDiscrAttributes() const; MEDLOADER_EXPORT void setName(const std::string& name); // @@ -249,30 +281,25 @@ namespace ParaMEDMEM MEDLOADER_EXPORT int buildImplicitPartIfAny(INTERP_KERNEL::NormalizedCellType gt) const; MEDLOADER_EXPORT void releaseImplicitPartIfAny() const; MEDLOADER_EXPORT std::vector getGeoTypesAtLevel(int meshDimRelToMax) const; + MEDLOADER_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const; MEDLOADER_EXPORT void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const; + MEDLOADER_EXPORT MEDFileMesh *cartesianize() const; MEDLOADER_EXPORT std::vector getNonEmptyLevels() const; MEDLOADER_EXPORT std::vector getNonEmptyLevelsExt() const; MEDLOADER_EXPORT std::vector getFamArrNonEmptyLevelsExt() const; MEDLOADER_EXPORT std::vector getNumArrNonEmptyLevelsExt() const; MEDLOADER_EXPORT std::vector getNameArrNonEmptyLevelsExt() const; - MEDLOADER_EXPORT std::vector getGrpNonEmptyLevels(const std::string& grp) const; - MEDLOADER_EXPORT std::vector getGrpNonEmptyLevelsExt(const std::string& grp) const; - MEDLOADER_EXPORT std::vector getFamNonEmptyLevels(const std::string& fam) const; - MEDLOADER_EXPORT std::vector getFamNonEmptyLevelsExt(const std::string& fam) const; - MEDLOADER_EXPORT std::vector getGrpsNonEmptyLevels(const std::vector& grps) const; - MEDLOADER_EXPORT std::vector getGrpsNonEmptyLevelsExt(const std::vector& grps) const; MEDLOADER_EXPORT std::vector getFamsNonEmptyLevels(const std::vector& fams) const; MEDLOADER_EXPORT std::vector getFamsNonEmptyLevelsExt(const std::vector& fams) const; - MEDLOADER_EXPORT std::vector getGroupsOnSpecifiedLev(int meshDimRelToMaxExt) const; MEDLOADER_EXPORT DataArrayDouble *getCoords() const; MEDLOADER_EXPORT MEDCouplingUMesh *getGroup(int meshDimRelToMaxExt, const std::string& grp, bool renum=false) const; MEDLOADER_EXPORT MEDCouplingUMesh *getGroups(int meshDimRelToMaxExt, const std::vector& grps, bool renum=false) const; MEDLOADER_EXPORT MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const; MEDLOADER_EXPORT MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const; MEDLOADER_EXPORT DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const; - MEDLOADER_EXPORT MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const; - MEDLOADER_EXPORT MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const; + MEDLOADER_EXPORT MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const; MEDLOADER_EXPORT std::vector getDistributionOfTypes(int meshDimRelToMax) const; + MEDLOADER_EXPORT std::vector< std::pair > getAllDistributionOfTypes() const; MEDLOADER_EXPORT MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const; MEDLOADER_EXPORT MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const; MEDLOADER_EXPORT MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const; @@ -286,6 +313,7 @@ namespace ParaMEDMEM // MEDLOADER_EXPORT void setFamilyNameAttachedOnId(int id, const std::string& newFamName); MEDLOADER_EXPORT void setCoords(DataArrayDouble *coords); + MEDLOADER_EXPORT void setCoordsForced(DataArrayDouble *coords); MEDLOADER_EXPORT void eraseGroupsAtLevel(int meshDimRelToMaxExt); MEDLOADER_EXPORT void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr); MEDLOADER_EXPORT void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr); @@ -303,21 +331,25 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void buildInnerBoundaryAlongM1Group(const std::string& grpNameM1, DataArrayInt *&nodesDuplicated, DataArrayInt *&cellsModified, DataArrayInt *&cellsNotModified); MEDLOADER_EXPORT bool unPolyze(std::vector& oldCode, std::vector& newCode, DataArrayInt *& o2nRenumCell); MEDLOADER_EXPORT DataArrayInt *zipCoords(); + MEDLOADER_EXPORT DataArrayInt *deduceNodeSubPartFromCellSubPart(const std::map >& extractDef) const; + MEDLOADER_EXPORT MEDFileUMesh *extractPart(const std::map >& extractDef) const; MEDLOADER_EXPORT MEDFileUMesh *buildExtrudedMesh(const MEDCouplingUMesh *m1D, int policy) const; MEDLOADER_EXPORT MEDFileUMesh *linearToQuadratic(int conversionType=0, double eps=1e-12) const; MEDLOADER_EXPORT MEDFileUMesh *quadraticToLinear(double eps=1e-12) const; + MEDLOADER_EXPORT MCAuto symmetry3DPlane(const double point[3], const double normalVector[3]) const; + MEDLOADER_EXPORT static MCAuto Aggregate(const std::vector& meshes); // serialization MEDLOADER_EXPORT void serialize(std::vector& tinyDouble, std::vector& tinyInt, std::vector& tinyStr, - std::vector< MEDCouplingAutoRefCountObjectPtr >& bigArraysI, MEDCouplingAutoRefCountObjectPtr& bigArrayD); + std::vector< MCAuto >& bigArraysI, MCAuto& bigArrayD); MEDLOADER_EXPORT void unserialize(std::vector& tinyDouble, std::vector& tinyInt, std::vector& tinyStr, - std::vector< MEDCouplingAutoRefCountObjectPtr >& bigArraysI, MEDCouplingAutoRefCountObjectPtr& bigArrayD); + std::vector< MCAuto >& bigArraysI, MCAuto& bigArrayD); 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 loadLL(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); @@ -326,16 +358,16 @@ namespace ParaMEDMEM void computeRevNum() const; void synchronizeTinyInfoOnLeaves() const; void changeFamilyIdArr(int oldId, int newId); - std::list< MEDCouplingAutoRefCountObjectPtr > getAllNonNullFamilyIds() const; - MEDCouplingAutoRefCountObjectPtr& checkAndGiveEntryInSplitL1(int meshDimRelToMax, MEDCouplingPointSet *m); + std::list< MCAuto > getAllNonNullFamilyIds() const; + MCAuto& checkAndGiveEntryInSplitL1(int meshDimRelToMax, MEDCouplingPointSet *m); private: - std::vector< MEDCouplingAutoRefCountObjectPtr > _ms; - MEDCouplingAutoRefCountObjectPtr _coords; - MEDCouplingAutoRefCountObjectPtr _fam_coords; - MEDCouplingAutoRefCountObjectPtr _num_coords; - MEDCouplingAutoRefCountObjectPtr _name_coords; - mutable MEDCouplingAutoRefCountObjectPtr _rev_num_coords; - MEDCouplingAutoRefCountObjectPtr _part_coords; + std::vector< MCAuto > _ms; + MCAuto _coords; + MCAuto _fam_coords; + MCAuto _num_coords; + MCAuto _name_coords; + mutable MCAuto _rev_num_coords; + MCAuto _part_coords; }; class MEDFileStructuredMesh : public MEDFileMesh @@ -365,7 +397,9 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::vector getFamArrNonEmptyLevelsExt() const; MEDLOADER_EXPORT std::vector getNumArrNonEmptyLevelsExt() const; MEDLOADER_EXPORT std::vector getNameArrNonEmptyLevelsExt() const; - MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const; + MEDLOADER_EXPORT MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const; + MEDLOADER_EXPORT std::vector getFamsNonEmptyLevels(const std::vector& fams) const; + MEDLOADER_EXPORT std::vector getFamsNonEmptyLevelsExt(const std::vector& fams) const; MEDLOADER_EXPORT int getSizeAtLevel(int meshDimRelToMaxExt) const; MEDLOADER_EXPORT int getNumberOfNodes() const; MEDLOADER_EXPORT int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const; @@ -374,6 +408,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void releaseImplicitPartIfAny() const; MEDLOADER_EXPORT MEDCoupling1SGTUMesh *getImplicitFaceMesh() const; MEDLOADER_EXPORT std::vector getGeoTypesAtLevel(int meshDimRelToMax) const; + MEDLOADER_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType ct) const; MEDLOADER_EXPORT void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const; MEDLOADER_EXPORT virtual const MEDCouplingStructuredMesh *getStructuredMesh() const = 0; // tools @@ -381,7 +416,7 @@ namespace ParaMEDMEM protected: ~MEDFileStructuredMesh() { } void changeFamilyIdArr(int oldId, int newId); - std::list< MEDCouplingAutoRefCountObjectPtr > getAllNonNullFamilyIds() const; + std::list< MCAuto > getAllNonNullFamilyIds() const; void deepCpyAttributes(); void loadStrMeshFromFile(MEDFileStrMeshL2 *strm, med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); void writeStructuredLL(med_idt fid, const std::string& maa) const; @@ -390,20 +425,20 @@ namespace ParaMEDMEM static med_geometry_type GetGeoTypeFromMeshDim(int meshDim); private: static void LoadStrMeshDAFromFile(med_idt fid, int meshDim, int dt, int it, const std::string& mName, MEDFileMeshReadSelector *mrs, - MEDCouplingAutoRefCountObjectPtr& famCells, MEDCouplingAutoRefCountObjectPtr& numCells, MEDCouplingAutoRefCountObjectPtr& namesCells); + MCAuto& famCells, MCAuto& numCells, MCAuto& namesCells); private: - MEDCouplingAutoRefCountObjectPtr _fam_nodes; - MEDCouplingAutoRefCountObjectPtr _num_nodes; - MEDCouplingAutoRefCountObjectPtr _names_nodes; - MEDCouplingAutoRefCountObjectPtr _fam_cells; - MEDCouplingAutoRefCountObjectPtr _num_cells; - MEDCouplingAutoRefCountObjectPtr _names_cells; - MEDCouplingAutoRefCountObjectPtr _fam_faces; - MEDCouplingAutoRefCountObjectPtr _num_faces; - MEDCouplingAutoRefCountObjectPtr _names_faces; - mutable MEDCouplingAutoRefCountObjectPtr _rev_num_nodes; - mutable MEDCouplingAutoRefCountObjectPtr _rev_num_cells; - mutable MEDCouplingAutoRefCountObjectPtr _faces_if_necessary; + MCAuto _fam_nodes; + MCAuto _num_nodes; + MCAuto _names_nodes; + MCAuto _fam_cells; + MCAuto _num_cells; + MCAuto _names_cells; + MCAuto _fam_faces; + MCAuto _num_faces; + MCAuto _names_faces; + mutable MCAuto _rev_num_nodes; + mutable MCAuto _rev_num_cells; + mutable MCAuto _faces_if_necessary; }; class MEDFileCMesh : public MEDFileStructuredMesh @@ -416,8 +451,8 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; - MEDLOADER_EXPORT MEDFileMesh *deepCpy() const; - MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const; + MEDLOADER_EXPORT MEDFileCMesh *deepCopy() const; + MEDLOADER_EXPORT MEDFileCMesh *shallowCpy() const; MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const; MEDLOADER_EXPORT int getMeshDimension() const; MEDLOADER_EXPORT int getSpaceDimension() const; @@ -426,6 +461,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void clearNonDiscrAttributes() const; MEDLOADER_EXPORT const MEDCouplingCMesh *getMesh() const; MEDLOADER_EXPORT void setMesh(MEDCouplingCMesh *m); + MEDLOADER_EXPORT MEDFileMesh *cartesianize() const; private: ~MEDFileCMesh() { } const MEDCouplingStructuredMesh *getStructuredMesh() const; @@ -433,9 +469,9 @@ namespace ParaMEDMEM MEDFileCMesh(); void synchronizeTinyInfoOnLeaves() const; MEDFileCMesh(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); - void loadCMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); + void loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); private: - MEDCouplingAutoRefCountObjectPtr _cmesh; + MCAuto _cmesh; }; class MEDFileCurveLinearMesh : public MEDFileStructuredMesh @@ -448,8 +484,8 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; - MEDLOADER_EXPORT MEDFileMesh *deepCpy() const; - MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const; + MEDLOADER_EXPORT MEDFileCurveLinearMesh *deepCopy() const; + MEDLOADER_EXPORT MEDFileCurveLinearMesh *shallowCpy() const; MEDLOADER_EXPORT bool isEqual(const MEDFileMesh *other, double eps, std::string& what) const; MEDLOADER_EXPORT int getMeshDimension() const; MEDLOADER_EXPORT std::string simpleRepr() const; @@ -457,6 +493,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void clearNonDiscrAttributes() const; MEDLOADER_EXPORT const MEDCouplingCurveLinearMesh *getMesh() const; MEDLOADER_EXPORT void setMesh(MEDCouplingCurveLinearMesh *m); + MEDLOADER_EXPORT MEDFileMesh *cartesianize() const; private: ~MEDFileCurveLinearMesh() { } MEDFileCurveLinearMesh(); @@ -464,9 +501,9 @@ namespace ParaMEDMEM const MEDCouplingStructuredMesh *getStructuredMesh() const; void synchronizeTinyInfoOnLeaves() const; void writeLL(med_idt fid) const; - void loadCLMeshFromFile(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);//to imp + void loadLL(med_idt fid, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs);//to imp private: - MEDCouplingAutoRefCountObjectPtr _clmesh; + MCAuto _clmesh; }; class MEDFileMeshMultiTS : public RefCountObject, public MEDFileWritable @@ -475,18 +512,19 @@ namespace ParaMEDMEM MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(); MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName); MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName); - MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCpy() const; + MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() 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); + MEDLOADER_EXPORT void cartesianizeMe(); MEDLOADER_EXPORT MEDFileMesh *getOneTimeStep() const; MEDLOADER_EXPORT void write(med_idt fid) const; MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const; MEDLOADER_EXPORT void setOneTimeStep(MEDFileMesh *mesh1TimeStep); MEDLOADER_EXPORT MEDFileJoints *getJoints() const; - MEDLOADER_EXPORT void setJoints( MEDFileJoints* joints ); + MEDLOADER_EXPORT void setJoints(MEDFileJoints* joints); private: ~MEDFileMeshMultiTS() { } void loadFromFile(const std::string& fileName, const std::string& mName); @@ -494,7 +532,7 @@ namespace ParaMEDMEM MEDFileMeshMultiTS(const std::string& fileName); MEDFileMeshMultiTS(const std::string& fileName, const std::string& mName); private: - std::vector< MEDCouplingAutoRefCountObjectPtr > _mesh_one_ts; + std::vector< MCAuto > _mesh_one_ts; }; class MEDFileMeshesIterator; @@ -504,7 +542,7 @@ namespace ParaMEDMEM public: MEDLOADER_EXPORT static MEDFileMeshes *New(); MEDLOADER_EXPORT static MEDFileMeshes *New(const std::string& fileName); - MEDLOADER_EXPORT MEDFileMeshes *deepCpy() const; + MEDLOADER_EXPORT MEDFileMeshes *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT std::string simpleRepr() const; @@ -517,6 +555,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT MEDFileMesh *getMeshWithName(const std::string& mname) const; MEDLOADER_EXPORT std::vector getMeshesNames() const; MEDLOADER_EXPORT bool changeNames(const std::vector< std::pair >& modifTab); + MEDLOADER_EXPORT void cartesianizeMe(); // MEDLOADER_EXPORT void resize(int newSize); MEDLOADER_EXPORT void pushMesh(MEDFileMesh *mesh); @@ -524,12 +563,12 @@ namespace ParaMEDMEM MEDLOADER_EXPORT void destroyMeshAtPos(int i); private: ~MEDFileMeshes() { } - void checkCoherency() const; + void checkConsistencyLight() const; void loadFromFile(const std::string& fileName); MEDFileMeshes(); MEDFileMeshes(const std::string& fileName); private: - std::vector< MEDCouplingAutoRefCountObjectPtr > _meshes; + std::vector< MCAuto > _meshes; }; class MEDFileMeshesIterator @@ -539,7 +578,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT ~MEDFileMeshesIterator(); MEDLOADER_EXPORT MEDFileMesh *nextt(); private: - MEDCouplingAutoRefCountObjectPtr _ms; + MCAuto _ms; int _iter_id; int _nb_iter; };