X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_Mesh.hxx;h=c1fea287ffcff1cea6a770b371b22655cf76dd3e;hb=dbd1374aa8aeac32c368b8f6add841e0bd90f807;hp=bc3c740126be2483e7172fa2c3ece994acf27cc8;hpb=23d90107acec5e54ded86d9f309fe5cb42720b78;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index bc3c74012..c1fea287f 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -58,7 +58,7 @@ #define MYASSERT(val) if (!(val)) throw SALOME_Exception(LOCALIZED("assertion not verified")); -class SMDS_EXPORT SMDS_Mesh:public SMDS_MeshObject +class SMDS_EXPORT SMDS_Mesh : public SMDS_MeshObject { public: friend class SMDS_MeshIDFactory; @@ -69,12 +69,12 @@ public: SMDS_Mesh(); - //! to retreive this SMDS_Mesh instance from its elements (index stored in SMDS_Elements) + //! to retrieve this SMDS_Mesh instance from its elements (index stored in SMDS_Elements) static std::vector _meshList; //! actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid - inline SMDS_UnstructuredGrid* getGrid() {return myGrid; } - inline int getMeshId() {return myMeshId; } + inline SMDS_UnstructuredGrid* getGrid() { return myGrid; } + inline int getMeshId() { return myMeshId; } virtual SMDS_NodeIteratorPtr nodesIterator (bool idInceasingOrder=false) const; virtual SMDS_EdgeIteratorPtr edgesIterator (bool idInceasingOrder=false) const; @@ -454,6 +454,53 @@ public: const SMDS_MeshNode * n25, const SMDS_MeshNode * n36); + // 2d order Pentahedron with 18 nodes + virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, + int n4, int n5, int n6, + int n12,int n23,int n31, + int n45,int n56,int n64, + int n14,int n25,int n36, + int n1245, int n2356, int n1346, + int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36, + const SMDS_MeshNode * n1245, + const SMDS_MeshNode * n2356, + const SMDS_MeshNode * n1346, + int ID); + virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, + const SMDS_MeshNode * n2, + const SMDS_MeshNode * n3, + const SMDS_MeshNode * n4, + const SMDS_MeshNode * n5, + const SMDS_MeshNode * n6, + const SMDS_MeshNode * n12, + const SMDS_MeshNode * n23, + const SMDS_MeshNode * n31, + const SMDS_MeshNode * n45, + const SMDS_MeshNode * n56, + const SMDS_MeshNode * n64, + const SMDS_MeshNode * n14, + const SMDS_MeshNode * n25, + const SMDS_MeshNode * n36, + const SMDS_MeshNode * n1245, + const SMDS_MeshNode * n2356, + const SMDS_MeshNode * n1346); + + // 2d oreder Hexahedrons with 20 nodes virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, @@ -689,6 +736,9 @@ public: static const SMDS_MeshElement* FindElement(const std::vector& nodes, const SMDSAbs_ElementType type=SMDSAbs_All, const bool noMedium=true); + static int GetElementsByNodes(const std::vector& nodes, + std::vector& foundElems, + const SMDSAbs_ElementType type=SMDSAbs_All); /*! * \brief Raise an exception if free memory (ram+swap) too low @@ -705,6 +755,7 @@ public: const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; } virtual int NbNodes() const; + virtual int NbElements() const; virtual int Nb0DElements() const; virtual int NbBalls() const; virtual int NbEdges() const; @@ -739,22 +790,18 @@ public: typedef std::vector SetOfNodes; typedef std::vector SetOfCells; - void updateNodeMinMax(); - void updateBoundingBox(); + //void updateBoundingBox(); double getMaxDim(); int fromVtkToSmds(int vtkid); - void incrementNodesCapacity(int nbNodes); - void incrementCellsCapacity(int nbCells); - void adjustStructure(); - void dumpGrid(string ficdump="dumpGrid"); + void dumpGrid(std::string ficdump="dumpGrid"); static int chunkSize; //! low level modification: add, change or remove node or element inline void setMyModified() { this->myModified = true; } void Modified(); - unsigned long GetMTime() const; + vtkMTimeType GetMTime() const; bool isCompacted(); protected: @@ -789,7 +836,7 @@ protected: { assert(ID >= 0); myElementIDFactory->adjustMaxId(ID); - if (ID >= myCells.size()) + if (ID >= (int)myCells.size()) myCells.resize(ID+SMDS_Mesh::chunkSize,0); } @@ -809,10 +856,10 @@ protected: int myMeshId; //! actual nodes coordinates, cells definition and reverse connectivity are stored in a vtkUnstructuredGrid - SMDS_UnstructuredGrid* myGrid; + SMDS_UnstructuredGrid* myGrid; //! Small objects like SMDS_MeshNode are allocated by chunks to limit memory costs of new - ObjectPool* myNodePool; + ObjectPool* myNodePool; //! Small objects like SMDS_VtkVolume are allocated by chunks to limit memory costs of new ObjectPool* myVolumePool; @@ -820,37 +867,31 @@ protected: ObjectPool* myEdgePool; ObjectPool* myBallPool; - //! SMDS_MeshNodes refer to vtk nodes (vtk id = index in myNodes),store reference to this mesh, and sub-shape - SetOfNodes myNodes; - - //! SMDS_MeshCells refer to vtk cells (vtk id != index in myCells),store reference to this mesh, and sub-shape - SetOfCells myCells; + //! SMDS_MeshNodes refer to vtk nodes (vtk id != index in myNodes),store reference to this mesh, and sub-shape + SetOfNodes myNodes; + SetOfCells myCells; //! a buffer to speed up elements addition by excluding some memory allocation - std::vector myNodeIds; + std::vector myNodeIds; //! for cells only: index = ID in vtkUnstructuredGrid, value = ID for SMDS users - std::vector myCellIdVtkToSmds; + std::vector myCellIdVtkToSmds; - SMDS_Mesh * myParent; - std::list myChildren; - SMDS_MeshNodeIDFactory *myNodeIDFactory; - SMDS_MeshElementIDFactory *myElementIDFactory; - SMDS_MeshInfo myInfo; + SMDS_Mesh * myParent; + std::list myChildren; + SMDS_MeshNodeIDFactory * myNodeIDFactory; + SMDS_MeshElementIDFactory * myElementIDFactory; + SMDS_MeshInfo myInfo; + //! any add, remove or change of node or cell + bool myModified; //! use a counter to keep track of modifications unsigned long myModifTime, myCompactTime; - int myNodeMin; - int myNodeMax; - bool myHasConstructionEdges; bool myHasConstructionFaces; bool myHasInverseElements; - //! any add, remove or change of node or cell - bool myModified; - double xmin; double xmax; double ymin;