OGS
|
Collapses nodes with a distance smaller min_distance and reduces elements accordingly.
Definition at line 35 of file MeshRevision.h.
#include <MeshRevision.h>
Public Member Functions | |
MeshRevision (MeshLib::Mesh &mesh) | |
unsigned | getNumberOfCollapsibleNodes (double eps=std::numeric_limits< double >::epsilon()) const |
Returns the number of potentially collapsible nodes. | |
std::vector< std::size_t > | collapseNodeIndices (double eps) const |
MeshLib::Mesh * | simplifyMesh (const std::string &new_mesh_name, double eps, unsigned min_elem_dim=1) const |
Private Member Functions | |
std::vector< MeshLib::Node * > | constructNewNodesArray (const std::vector< std::size_t > &id_map) const |
Private Attributes | |
MeshLib::Mesh & | _mesh |
The original mesh used for constructing the class. | |
|
explicit |
Constructor
mesh | The mesh which is being revised. Note that node IDs in mesh are changed during computation but are reset after the algorithms implemented here are finished |
Definition at line 1005 of file MeshRevision.cpp.
std::vector< std::size_t > MeshToolsLib::MeshRevision::collapseNodeIndices | ( | double | eps | ) | const |
Designates nodes to be collapsed by setting their ID to the index of the node they will get merged with.
Definition at line 1094 of file MeshRevision.cpp.
References _mesh, MathLib::Point3dWithID::getID(), MeshLib::Mesh::getNodes(), MeshLib::Mesh::getNumberOfNodes(), GeoLib::Grid< POINT >::getPntVecsOfGridCellsIntersectingCube(), and MathLib::sqrDist().
Referenced by getNumberOfCollapsibleNodes(), MeshAnalysisDialog::on_startButton_pressed(), and simplifyMesh().
|
private |
Constructs a new node vector for the resulting mesh by removing all nodes whose ID indicates they need to be merged/removed.
Definition at line 1150 of file MeshRevision.cpp.
References _mesh, and MeshLib::Mesh::getNodes().
Referenced by simplifyMesh().
unsigned MeshToolsLib::MeshRevision::getNumberOfCollapsibleNodes | ( | double | eps = std::numeric_limits<double>::epsilon() | ) | const |
Returns the number of potentially collapsible nodes.
Definition at line 1007 of file MeshRevision.cpp.
References collapseNodeIndices().
Referenced by MeshToolsLib::MeshValidation::existCollapsibleNodes().
MeshLib::Mesh * MeshToolsLib::MeshRevision::simplifyMesh | ( | const std::string & | new_mesh_name, |
double | eps, | ||
unsigned | min_elem_dim = 1 ) const |
Create a new mesh where all nodes with a distance < eps from each other are collapsed. Elements are adjusted accordingly and elements with nonplanar faces are subdivided into geometrically correct elements.
new_mesh_name | New name. |
eps | Minimum distance for nodes not to be collapsed |
min_elem_dim | Minimum dimension of elements to be inserted into new mesh (i.e. min_elem_dim=3 will prevent the new mesh to contain 2D elements) |
Definition at line 1022 of file MeshRevision.cpp.
References _mesh, BaseLib::cleanupVectorElements(), collapseNodeIndices(), constructNewNodesArray(), MeshLib::copyElement(), ERR(), MeshLib::Element::getDimension(), MeshLib::Mesh::getElements(), MeshLib::Element::getNumberOfBaseNodes(), MeshLib::Mesh::getNumberOfElements(), MeshLib::Mesh::getProperties(), NonCoplanar, MeshLib::Mesh::resetNodeIDs(), and MeshLib::Element::validate().
Referenced by MeshToolsLib::convertSurfaceToMesh(), and main().
|
private |
The original mesh used for constructing the class.
Definition at line 75 of file MeshRevision.h.
Referenced by collapseNodeIndices(), constructNewNodesArray(), and simplifyMesh().