diff --git a/MeshLib/Elements/Element.h b/MeshLib/Elements/Element.h index 01a5b29eb206ddd3e66c326df9b0b54c297c0282..50017fcb044c7282e9e7b1940070df90778f8560 100644 --- a/MeshLib/Elements/Element.h +++ b/MeshLib/Elements/Element.h @@ -167,16 +167,6 @@ public: */ virtual Element* clone() const = 0; - /** - * This method should be called after at least two nodes of an element - * are collapsed. The node collapsing can/have to lead to an edge collapse. - * This method tries to create a new element of an appropriate type. The - * value of the attribute _value is carried over. In contrast to this the - * neighbor information is not carried over. - * @return an element of a different element type (MeshElemType) or NULL - */ - virtual Element* reviseElement() const = 0; - /** * Computes the length / area / volumen of this element. This is automatically * done at initalisation time but can be repeated by calling this function at any time. diff --git a/MeshLib/Elements/TemplateHex-impl.h b/MeshLib/Elements/TemplateHex-impl.h index cf14ab462d4742f6b659658c9d5914cefc60619b..c31298d9f5290b98f2018e952cb6241ae75c9173 100644 --- a/MeshLib/Elements/TemplateHex-impl.h +++ b/MeshLib/Elements/TemplateHex-impl.h @@ -173,107 +173,4 @@ ElementErrorCode TemplateHex<NNODES,CELLHEXTYPE>::validate() const return error_code; } -template <unsigned NNODES, CellType CELLHEXTYPE> -Element* TemplateHex<NNODES,CELLHEXTYPE>::reviseElement() const -{ - std::vector<size_t> collapsed_edges; - for (size_t edge(0); edge<getNEdges(); edge++) { - if (_nodes[_edge_nodes[edge][0]] == _nodes[_edge_nodes[edge][1]]) { - collapsed_edges.push_back(edge); - } - } - - if (collapsed_edges.size() == 1) { - ERR("[TemplateHex<NNODES,CELLHEXTYPE>::reviseElement()] collapsing of one edge in hexahedron not handled."); - return NULL; - } - - if (collapsed_edges.size() == 2) { - // try to create a prism out of the hex - if (collapsed_edges[0] == 0 && collapsed_edges[1] == 2) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[4]; - prism_nodes[2] = _nodes[5]; - prism_nodes[3] = _nodes[3]; - prism_nodes[4] = _nodes[7]; - prism_nodes[5] = _nodes[6]; - return new Prism(prism_nodes, _value); - } - if (collapsed_edges[0] == 1 && collapsed_edges[1] == 3) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[4]; - prism_nodes[2] = _nodes[7]; - prism_nodes[3] = _nodes[1]; - prism_nodes[4] = _nodes[5]; - prism_nodes[5] = _nodes[6]; - return new Prism(prism_nodes, _value); - } - if (collapsed_edges[0] == 4 && collapsed_edges[1] == 5) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[7]; - prism_nodes[2] = _nodes[3]; - prism_nodes[3] = _nodes[1]; - prism_nodes[4] = _nodes[6]; - prism_nodes[5] = _nodes[2]; - return new Prism(prism_nodes, _value); - } - if (collapsed_edges[0] == 5 && collapsed_edges[1] == 6) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[1]; - prism_nodes[2] = _nodes[4]; - prism_nodes[3] = _nodes[3]; - prism_nodes[4] = _nodes[2]; - prism_nodes[5] = _nodes[7]; - return new Prism(prism_nodes, _value); - } - if (collapsed_edges[0] == 6 && collapsed_edges[1] == 7) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[3]; - prism_nodes[2] = _nodes[4]; - prism_nodes[3] = _nodes[1]; - prism_nodes[4] = _nodes[2]; - prism_nodes[5] = _nodes[5]; - return new Prism(prism_nodes, _value); - } - if (collapsed_edges[0] == 7 && collapsed_edges[1] == 4) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[1]; - prism_nodes[2] = _nodes[5]; - prism_nodes[3] = _nodes[3]; - prism_nodes[4] = _nodes[2]; - prism_nodes[5] = _nodes[6]; - return new Prism(prism_nodes, _value); - } - if (collapsed_edges[0] == 8 && collapsed_edges[1] == 10) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[1]; - prism_nodes[2] = _nodes[4]; - prism_nodes[3] = _nodes[3]; - prism_nodes[4] = _nodes[2]; - prism_nodes[5] = _nodes[7]; - return new Prism(prism_nodes, _value); - } - if (collapsed_edges[0] == 9 && collapsed_edges[1] == 11) { - Node** prism_nodes = new Node*[6]; - prism_nodes[0] = _nodes[0]; - prism_nodes[1] = _nodes[3]; - prism_nodes[2] = _nodes[4]; - prism_nodes[3] = _nodes[1]; - prism_nodes[4] = _nodes[2]; - prism_nodes[5] = _nodes[5]; - return new Prism(prism_nodes, _value); - } - return NULL; - } - - return NULL; -} - } // end namespace MeshLib diff --git a/MeshLib/Elements/TemplateHex.h b/MeshLib/Elements/TemplateHex.h index 27504ac63d45e0fdf99b75daa3325687f28cff3d..1adc68b9238220bbca79b51dedc581cce75f6cfb 100644 --- a/MeshLib/Elements/TemplateHex.h +++ b/MeshLib/Elements/TemplateHex.h @@ -110,12 +110,6 @@ public: */ virtual Element* clone() const; - /** - * Change the element type from hexahedron to a prism if two appropriate edges of the hexahedron are collapsed. - * @return a prism element with nice properties or NULL - */ - virtual Element* reviseElement() const; - protected: /// Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra. double computeVolume(); diff --git a/MeshLib/Elements/TemplateLine.h b/MeshLib/Elements/TemplateLine.h index ae9dbcadf4f255aef671922607695606c072dee0..ad07b20c2b668aef1cc15ee68571e6b12ba117df 100644 --- a/MeshLib/Elements/TemplateLine.h +++ b/MeshLib/Elements/TemplateLine.h @@ -88,19 +88,6 @@ public: return new TemplateLine<NNODES,CELLLINETYPE>(*this); } - /** - * If for instance two nodes of the element are collapsed the Edge element disappears. - * @return NULL - */ - virtual Element* reviseElement() const - { - if (_nodes[0] == _nodes[1]) { - return NULL; - } - - return NULL; - } - protected: double computeVolume() { diff --git a/MeshLib/Elements/TemplatePrism-impl.h b/MeshLib/Elements/TemplatePrism-impl.h index cd9a7671fc256dc23485732bbcec84b57b3fca6d..a81ce1ca08e5fb4ec8099e4a8d832a6f70e8598d 100644 --- a/MeshLib/Elements/TemplatePrism-impl.h +++ b/MeshLib/Elements/TemplatePrism-impl.h @@ -182,42 +182,5 @@ ElementErrorCode TemplatePrism<NNODES,CELLPRISMTYPE>::validate() const return error_code; } -template <unsigned NNODES, CellType CELLPRISMTYPE> -Element* TemplatePrism<NNODES,CELLPRISMTYPE>::reviseElement() const -{ - // try to create Pyramid - if (_nodes[_edge_nodes[3][0]] == _nodes[_edge_nodes[3][1]]) { - Node** pyramid_nodes = new Node*[5]; - pyramid_nodes[0] = _nodes[1]; - pyramid_nodes[1] = _nodes[4]; - pyramid_nodes[2] = _nodes[5]; - pyramid_nodes[3] = _nodes[2]; - pyramid_nodes[4] = _nodes[0]; - return new Pyramid(pyramid_nodes, _value); - } - - if (_nodes[_edge_nodes[4][0]] == _nodes[_edge_nodes[4][1]]) { - Node** pyramid_nodes = new Node*[5]; - pyramid_nodes[0] = _nodes[0]; - pyramid_nodes[1] = _nodes[2]; - pyramid_nodes[2] = _nodes[5]; - pyramid_nodes[3] = _nodes[3]; - pyramid_nodes[4] = _nodes[1]; - return new Pyramid(pyramid_nodes, _value); - } - - if (_nodes[_edge_nodes[5][0]] == _nodes[_edge_nodes[5][1]]) { - Node** pyramid_nodes = new Node*[5]; - pyramid_nodes[0] = _nodes[0]; - pyramid_nodes[1] = _nodes[1]; - pyramid_nodes[2] = _nodes[4]; - pyramid_nodes[3] = _nodes[3]; - pyramid_nodes[4] = _nodes[2]; - return new Pyramid(pyramid_nodes, _value); - } - - return NULL; -} - } // end namespace MeshLib diff --git a/MeshLib/Elements/TemplatePrism.h b/MeshLib/Elements/TemplatePrism.h index 41305a7de2f1eeb747ed5bf1b77ab1f035fcaf5e..2faa97f38ea32ac23613650d7f2ab4676a2def47 100644 --- a/MeshLib/Elements/TemplatePrism.h +++ b/MeshLib/Elements/TemplatePrism.h @@ -109,17 +109,6 @@ public: */ virtual Element* clone() const; - /** - * This method should be called after at least two nodes of the prism - * element are collapsed. As a consequence of the node collapsing an edge - * of the prism will be collapsed. If one of the edges 3, 4 or 5 (see - * sketch @ref PrismNodeAndEdgeNumbering) is collapsed we obtain a - * pyramid. In this case the method will create the appropriate - * object of class Pyramid. - * @return a pyramid object or NULL - */ - virtual Element* reviseElement() const; - protected: /// Calculates the volume of a prism by subdividing it into three tetrahedra. double computeVolume(); diff --git a/MeshLib/Elements/TemplatePyramid-impl.h b/MeshLib/Elements/TemplatePyramid-impl.h index f752c750c833b02871a368a257f069306c2068b4..6dc3ed276910d04fec9680a3ab7fbe52aaf4d196 100644 --- a/MeshLib/Elements/TemplatePyramid-impl.h +++ b/MeshLib/Elements/TemplatePyramid-impl.h @@ -182,26 +182,4 @@ ElementErrorCode TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::validate() const return error_code; } -template <unsigned NNODES, CellType CELLPYRAMIDTYPE> -Element* TemplatePyramid<NNODES,CELLPYRAMIDTYPE>::reviseElement() const -{ - // try to create tetrahedron - if (_nodes[_edge_nodes[0][0]] == _nodes[_edge_nodes[0][1]] - || _nodes[_edge_nodes[1][0]] == _nodes[_edge_nodes[1][1]]) { - Node** tet_nodes = new Node*[4]; - for (unsigned k(0); k<4; k++) tet_nodes[k] = _nodes[k]; - return new Tet(tet_nodes, _value); - } - - if (_nodes[_edge_nodes[2][0]] == _nodes[_edge_nodes[2][1]] - || _nodes[_edge_nodes[3][0]] == _nodes[_edge_nodes[3][1]]) { - Node** tet_nodes = new Node*[4]; - for (unsigned k(0); k<3; k++) tet_nodes[k] = _nodes[k]; - tet_nodes[3] = _nodes[4]; - return new Tet(tet_nodes, _value); - } - - return NULL; -} - } // end namespace MeshLib diff --git a/MeshLib/Elements/TemplatePyramid.h b/MeshLib/Elements/TemplatePyramid.h index 6965eca08978be21caa9171c50e92d0d710f82bb..64f7a50c7518cb5e4f5ea1372a6b3a4ff82e1a7d 100644 --- a/MeshLib/Elements/TemplatePyramid.h +++ b/MeshLib/Elements/TemplatePyramid.h @@ -107,17 +107,6 @@ public: */ virtual Element* clone() const; - /** - * This method should be called after at least two nodes of the pyramid - * element are collapsed. As a consequence of the node collapsing an edge - * of the pyramid will be collapsed. If one of the edges 0, 1, 2 or 3 (see - * sketch @ref PyramidNodeAndEdgeNumbering) is collapsed we obtain a - * tetrahedron. In this case the method will create the appropriate - * object of class Tetrahedron. - * @return a Tetrahedron object or NULL - */ - virtual Element* reviseElement() const; - protected: /// Calculates the volume of a prism by subdividing it into two tetrahedra. double computeVolume(); diff --git a/MeshLib/Elements/TemplateQuad-impl.h b/MeshLib/Elements/TemplateQuad-impl.h index b4fb73457aa0ec669b13a6aa72d288d464bcfdfe..781ba81f9c12aaacae13b36f7eaf1e13c84d391d 100644 --- a/MeshLib/Elements/TemplateQuad-impl.h +++ b/MeshLib/Elements/TemplateQuad-impl.h @@ -132,28 +132,5 @@ ElementErrorCode TemplateQuad<NNODES,CELLQUADTYPE>::validate() const return error_code; } -template <unsigned NNODES, CellType CELLQUADTYPE> -Element* TemplateQuad<NNODES,CELLQUADTYPE>::reviseElement() const -{ - if (_nodes[0] == _nodes[1] || _nodes[1] == _nodes[2]) { - MeshLib::Node** tri_nodes = new MeshLib::Node*[3]; - tri_nodes[0] = _nodes[0]; - tri_nodes[1] = _nodes[2]; - tri_nodes[2] = _nodes[3]; - return new Tri(tri_nodes, _value); - } - - if (_nodes[2] == _nodes[3] || _nodes[3] == _nodes[0]) { - MeshLib::Node** tri_nodes = new MeshLib::Node*[3]; - tri_nodes[0] = _nodes[0]; - tri_nodes[1] = _nodes[1]; - tri_nodes[2] = _nodes[2]; - return new Tri(tri_nodes, _value); - } - - // this should not happen - return NULL; -} - } diff --git a/MeshLib/Elements/TemplateQuad.h b/MeshLib/Elements/TemplateQuad.h index e735e46c26330e355fd691d3549c8d62f2d8976c..869539a465ec82efa4208345d0218dd75d278bbd 100644 --- a/MeshLib/Elements/TemplateQuad.h +++ b/MeshLib/Elements/TemplateQuad.h @@ -109,17 +109,6 @@ public: */ virtual Element* clone() const; - /** - * This method should be called after at least two nodes of the quad - * element are collapsed. As a consequence of the node collapsing an edge - * of the quad will be collapsed. If one of the edges (see - * sketch @ref PyramidNodeAndEdgeNumbering) is collapsed we obtain a - * triangle. In this case the method will create the appropriate - * object of class Tri. - * @return a Tri object or NULL - */ - virtual Element* reviseElement() const; - protected: /// Calculates the area of a convex quadliteral by dividing it into two triangles. double computeVolume(); diff --git a/MeshLib/Elements/TemplateTet-impl.h b/MeshLib/Elements/TemplateTet-impl.h index 0da3790c04fa56bc78c287a02af046ec1a1326e6..5b738fee1996c09b17edd72c812cf1096e734587 100644 --- a/MeshLib/Elements/TemplateTet-impl.h +++ b/MeshLib/Elements/TemplateTet-impl.h @@ -152,36 +152,5 @@ ElementErrorCode TemplateTet<NNODES,CELLTETTYPE>::validate() const return error_code; } -template <unsigned NNODES, CellType CELLTETTYPE> -Element* TemplateTet<NNODES,CELLTETTYPE>::reviseElement() const -{ - if (_nodes[0] == _nodes[1] || _nodes[1] == _nodes[2]) { - MeshLib::Node** tri_nodes = new MeshLib::Node*[3]; - tri_nodes[0] = _nodes[0]; - tri_nodes[1] = _nodes[2]; - tri_nodes[2] = _nodes[3]; - return new Tri(tri_nodes, _value); - } - - if (_nodes[2] == _nodes[0]) { - MeshLib::Node** tri_nodes = new MeshLib::Node*[3]; - tri_nodes[0] = _nodes[0]; - tri_nodes[1] = _nodes[1]; - tri_nodes[2] = _nodes[3]; - return new Tri(tri_nodes, _value); - } - - if (_nodes[0] == _nodes[3] || _nodes[1] == _nodes[3] || _nodes[2] == _nodes[3]) { - MeshLib::Node** tri_nodes = new MeshLib::Node*[3]; - tri_nodes[0] = _nodes[0]; - tri_nodes[1] = _nodes[1]; - tri_nodes[2] = _nodes[2]; - return new Tri(tri_nodes, _value); - } - - // this should not happen - return NULL; -} - } // end namespace MeshLib diff --git a/MeshLib/Elements/TemplateTet.h b/MeshLib/Elements/TemplateTet.h index de9f82be76d23bff27942980bda934528372b50d..b21a693b2a281f073f79254a434c9f4b6922d866 100644 --- a/MeshLib/Elements/TemplateTet.h +++ b/MeshLib/Elements/TemplateTet.h @@ -105,15 +105,6 @@ public: */ virtual Element* clone() const; - /** - * This method should be called after at least two nodes of the tetrahedron - * element are collapsed. As a consequence of the node collapsing an edge - * of the tetrahedron will be collapsed. If one edge is collapsed we obtain - * a triangle. - * @return a Triangle object or NULL - */ - virtual Element* reviseElement() const; - protected: /// Calculates the volume of a tetrahedron via the determinant of the matrix given by its four points. double computeVolume(); diff --git a/MeshLib/Elements/TemplateTri-impl.h b/MeshLib/Elements/TemplateTri-impl.h index a32500f043b4dc643e659a5493be6e9baf92ae88..870ef659aa3d62248ee7024fa5d65612dcadf32f 100644 --- a/MeshLib/Elements/TemplateTri-impl.h +++ b/MeshLib/Elements/TemplateTri-impl.h @@ -88,28 +88,6 @@ ElementErrorCode TemplateTri<NNODES,CELLTRITYPE>::validate() const return error_code; } - -template <unsigned NNODES, CellType CELLTRITYPE> -Element* TemplateTri<NNODES,CELLTRITYPE>::reviseElement() const -{ - // try to create an edge - if (_nodes[0] == _nodes[1] || _nodes[1] == _nodes[2]) { - Node** nodes = new Node*[2]; - nodes[0] = _nodes[0]; - nodes[1] = _nodes[2]; - return new Line(nodes, _value); - } - - if (_nodes[0] == _nodes[2]) { - Node** nodes = new Node*[2]; - nodes[0] = _nodes[0]; - nodes[1] = _nodes[1]; - return new Line(nodes, _value); - } - - return NULL; -} - template <unsigned NNODES, CellType CELLTRITYPE> unsigned TemplateTri<NNODES,CELLTRITYPE>::identifyFace(Node* nodes[3]) const { diff --git a/MeshLib/Elements/TemplateTri.h b/MeshLib/Elements/TemplateTri.h index 6d1bb35427e60df038df363b04351eb5cdd600fe..499c551cd1c9e79e3118d2322cdfbe723b0aaa92 100644 --- a/MeshLib/Elements/TemplateTri.h +++ b/MeshLib/Elements/TemplateTri.h @@ -111,17 +111,6 @@ public: return new TemplateTri<NNODES,CELLTRITYPE>(*this); } - - /** - * This method should be called after at least two nodes of the triangle - * element are collapsed. As a consequence of the node collapsing an edge - * of the triangle will be collapsed. If one of the edges is collapsed we - * obtain an edge. In this case the method will create the appropriate - * object of class Edge. - * @return an Edge object or NULL - */ - virtual Element* reviseElement() const; - protected: /// Calculates the area of the triangle by returning half of the area of the corresponding parallelogram. double computeVolume()