diff --git a/MeshLib/Elements/Element.h b/MeshLib/Elements/Element.h index 9e81ad10f68b0e6610445101528a8eee099b4ba0..7a62ff3a1375e96a2c3c6e1cc6e6132d1021cd78 100644 --- a/MeshLib/Elements/Element.h +++ b/MeshLib/Elements/Element.h @@ -179,6 +179,9 @@ public: */ virtual double computeVolume() = 0; + /// Returns the ID of a face given an array of nodes. + virtual unsigned identifyFace(Node* nodes[3]) const = 0; + /** * Checks if the node order of an element is correct by testing surface normals. */ @@ -192,13 +195,9 @@ protected: /// Return a specific edge node. virtual Node* getEdgeNode(unsigned edge_id, unsigned node_id) const = 0; - /// Returns the ID of a face given an array of nodes. - virtual unsigned identifyFace(Node* nodes[3]) const = 0; - /// Sets the element ID. virtual void setID(std::size_t id) { this->_id = id; } - Node** _nodes; std::size_t _id; /** diff --git a/MeshLib/Elements/TemplateHex.h b/MeshLib/Elements/TemplateHex.h index f6d7840677b7bf34b4567b2ae528f66a0dc43ab5..a781c8b37c6e71ba025eedff334c204e4ff1db1d 100644 --- a/MeshLib/Elements/TemplateHex.h +++ b/MeshLib/Elements/TemplateHex.h @@ -116,6 +116,9 @@ public: */ virtual Element* clone() const; + /// Returns the ID of a face given an array of nodes. + unsigned identifyFace(Node* nodes[3]) const; + protected: /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra. double computeVolume(); @@ -123,9 +126,6 @@ protected: /// Return a specific edge node. inline Node* getEdgeNode(unsigned edge_id, unsigned node_id) const { return _nodes[_edge_nodes[edge_id][node_id]]; }; - /// Returns the ID of a face given an array of nodes. - unsigned identifyFace(Node* nodes[3]) const; - static const unsigned _face_nodes[6][4]; static const unsigned _edge_nodes[12][2]; diff --git a/MeshLib/Elements/TemplatePrism.h b/MeshLib/Elements/TemplatePrism.h index 002a5c9ae846f4f6c56e3038fbb883a1bffa010f..9c2b49d06fb1afb7b70584f2d3604c78a6adda98 100644 --- a/MeshLib/Elements/TemplatePrism.h +++ b/MeshLib/Elements/TemplatePrism.h @@ -115,6 +115,9 @@ public: */ virtual Element* clone() const; + /// Returns the ID of a face given an array of nodes. + unsigned identifyFace(Node* nodes[3]) const; + protected: /// Calculates the volume of a prism by subdividing it into three tetrahedra. double computeVolume(); @@ -122,9 +125,6 @@ protected: /// Return a specific edge node. inline Node* getEdgeNode(unsigned edge_id, unsigned node_id) const { return _nodes[_edge_nodes[edge_id][node_id]]; }; - /// Returns the ID of a face given an array of nodes. - unsigned identifyFace(Node* nodes[3]) const; - static const unsigned _face_nodes[5][4]; static const unsigned _edge_nodes[9][2]; static const unsigned _n_face_nodes[5]; diff --git a/MeshLib/Elements/TemplatePyramid.h b/MeshLib/Elements/TemplatePyramid.h index 1f6eb67cbcde1292f695a482e1f145552fdb0494..89d277593c15b7d356d2ba23fe3f622b31dd62c2 100644 --- a/MeshLib/Elements/TemplatePyramid.h +++ b/MeshLib/Elements/TemplatePyramid.h @@ -113,6 +113,9 @@ public: */ virtual Element* clone() const; + /// Returns the ID of a face given an array of nodes. + unsigned identifyFace(Node* nodes[3]) const; + protected: /// Calculates the volume of a prism by subdividing it into two tetrahedra. double computeVolume(); @@ -120,9 +123,6 @@ protected: /// Return a specific edge node. inline Node* getEdgeNode(unsigned edge_id, unsigned node_id) const { return _nodes[_edge_nodes[edge_id][node_id]]; }; - /// Returns the ID of a face given an array of nodes. - unsigned identifyFace(Node* nodes[3]) const; - static const unsigned _face_nodes[5][4]; static const unsigned _edge_nodes[8][2]; static const unsigned _n_face_nodes[5]; diff --git a/MeshLib/Elements/TemplateQuad.h b/MeshLib/Elements/TemplateQuad.h index e6619e86ddb4ac03edd2d12206b4de5966879cae..21d8dc7a7c928f2873e028fdd909ebcfaff6d702 100644 --- a/MeshLib/Elements/TemplateQuad.h +++ b/MeshLib/Elements/TemplateQuad.h @@ -109,6 +109,9 @@ public: */ virtual Element* clone() const; + /// Returns the ID of a face given an array of nodes. + unsigned identifyFace(Node* nodes[3]) const; + protected: /// Calculates the area of a convex quadliteral by dividing it into two triangles. double computeVolume(); @@ -117,9 +120,6 @@ protected: /// Return a specific edge node. inline Node* getEdgeNode(unsigned edge_id, unsigned node_id) const { return _nodes[_edge_nodes[edge_id][node_id]]; }; - /// Returns the ID of a face given an array of nodes. - unsigned identifyFace(Node* nodes[3]) const; - static const unsigned _edge_nodes[4][2]; }; /* class */ diff --git a/MeshLib/Elements/TemplateTet.h b/MeshLib/Elements/TemplateTet.h index fc5fa63549f3932131c404d836dfcaf7bd7a7134..8fd425d1110431804ccfbcd58644ec22ee3c302f 100644 --- a/MeshLib/Elements/TemplateTet.h +++ b/MeshLib/Elements/TemplateTet.h @@ -111,6 +111,9 @@ public: */ virtual Element* clone() const; + /// Returns the ID of a face given an array of nodes. + unsigned identifyFace(Node* nodes[3]) const; + protected: /// Calculates the volume of a tetrahedron via the determinant of the matrix given by its four points. double computeVolume(); @@ -125,10 +128,6 @@ protected: return _nodes[_edge_nodes[edge_id][node_id]]; } - /// Returns the ID of a face given an array of nodes. - unsigned identifyFace(Node* nodes[3]) const; - - static const unsigned _face_nodes[4][3]; static const unsigned _edge_nodes[6][2]; diff --git a/MeshLib/Elements/TemplateTri.h b/MeshLib/Elements/TemplateTri.h index c91290193e21420ee7fa232d2bc5aab822f78fa7..25643b6de1e722bd44257d7a773e08bdb4855f0c 100644 --- a/MeshLib/Elements/TemplateTri.h +++ b/MeshLib/Elements/TemplateTri.h @@ -118,6 +118,9 @@ public: return new TemplateTri<NNODES,CELLTRITYPE>(*this); } + /// Returns the ID of a face given an array of nodes. + unsigned identifyFace(Node* nodes[3]) const; + protected: /// Calculates the area of the triangle by returning half of the area of the corresponding parallelogram. double computeVolume() @@ -132,9 +135,6 @@ protected: return _nodes[_edge_nodes[edge_id][node_id]]; } - /// Returns the ID of a face given an array of nodes. - unsigned identifyFace(Node* nodes[3]) const; - static const unsigned _edge_nodes[3][2]; }; /* class */