Commit e7e4561e authored by Robert Maynard's avatar Robert Maynard

Add the ability to remove concident points on the shell of meshes.

parent 25171f09
......@@ -204,6 +204,11 @@ public:
//compute the cells that make the shell/skin of the set of meshes
virtual bool computeShell(const smtk::mesh::HandleRange& meshes, smtk::mesh::HandleRange& shell) const = 0;
//----------------------------------------------------------------------------
//merge any duplicate points used by the cells that have been passed
virtual bool mergeCoincidentContactPoints(const smtk::mesh::HandleRange& meshes,
double tolerance) const = 0;
//----------------------------------------------------------------------------
virtual bool setDomain(const smtk::mesh::HandleRange& meshsets,
const smtk::mesh::Domain& domain) const = 0;
......
......@@ -302,6 +302,13 @@ smtk::mesh::MeshSet MeshSet::extractShell() const
entities );
}
//----------------------------------------------------------------------------
bool MeshSet::mergeCoincidentContactPoints( double tolerance ) const
{
const smtk::mesh::InterfacePtr& iface = this->m_parent->interface();
return iface->mergeCoincidentContactPoints(this->m_range, tolerance);
}
//----------------------------------------------------------------------------
//intersect two mesh sets, placing the results in the return mesh set
MeshSet set_intersect( const MeshSet& a, const MeshSet& b)
......
......@@ -107,6 +107,12 @@ public:
//Will return an empty set when no shell can be found
smtk::mesh::MeshSet extractShell() const;
//Merge all duplicate points contained within this meshset.
//Will return true when any points have been merged
//Will cause any existing PointConnectivity and PointSet's to become
//invalid, and using them will cause any undefined behavior
bool mergeCoincidentContactPoints(double tolerance=0.0) const;
private:
smtk::mesh::CollectionPtr m_parent;
smtk::mesh::Handle m_handle;
......
......@@ -23,6 +23,7 @@
#include "moab/Core.hpp"
#include "moab/FileOptions.hpp"
#include "moab/Interface.hpp"
#include "moab/MergeMesh.hpp"
#include "moab/ReaderIface.hpp"
#include "moab/Skinner.hpp"
......@@ -748,11 +749,22 @@ bool Interface::computeShell(const smtk::mesh::HandleRange& meshes,
}
::moab::Skinner skinner(this->moabInterface());
::moab::ErrorCode rval;
rval = skinner.find_skin(this->getRoot(),
cells,
false, //return cells not verts
shell);
::moab::ErrorCode rval= skinner.find_skin(this->getRoot(),
cells,
false, //return cells not verts
shell);
return (rval == ::moab::MB_SUCCESS);
}
//----------------------------------------------------------------------------
bool Interface::mergeCoincidentContactPoints(const smtk::mesh::HandleRange& meshes,
double tolerance) const
{
//we want to merge the contact points for all dimensions
//of the meshes, not just the highest dimension i expect
::moab::MergeMesh meshmerger(this->moabInterface());
smtk::mesh::HandleRange temp = meshes; //merge_entities takes by non const ref
::moab::ErrorCode rval = meshmerger.merge_entities(temp, tolerance);
return (rval == ::moab::MB_SUCCESS);
}
......
......@@ -173,6 +173,11 @@ public:
//compute the cells that make the shell/skin of the set of meshes
bool computeShell(const smtk::mesh::HandleRange& meshes, smtk::mesh::HandleRange& shell) const;
//----------------------------------------------------------------------------
//merge any duplicate points used by the cells that have been passed
bool mergeCoincidentContactPoints(const smtk::mesh::HandleRange& meshes,
double tolerance) const;
//----------------------------------------------------------------------------
bool setDomain(const smtk::mesh::HandleRange& meshsets,
const smtk::mesh::Domain& domain) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment