8#ifndef model_MeshRegionBoundary_cpp_
9#define model_MeshRegionBoundary_cpp_
24 allSimplices.erase(newStart);
25 const auto regionBoundaryNeighbors(newStart->regionBoundaryNeighbors());
26 for(
const auto&
neighbor : regionBoundaryNeighbors)
28 const auto neighborRgnIDs(
neighbor->regionIDs());
29 if( neighborRgnIDs.find(regionBndID.first)!=neighborRgnIDs.end()
30 && neighborRgnIDs.find(regionBndID.second)!=neighborRgnIDs.end()
31 && allSimplices.find(
neighbor)!=allSimplices.end())
33 if( (newStart->outNormal(regionBndID.first)-
neighbor->outNormal(regionBndID.first)).norm()<FLT_EPSILON
34 && (newStart->outNormal(regionBndID.second)-
neighbor->outNormal(regionBndID.second)).norm()<FLT_EPSILON
39 buildSingleFace(
neighbor,newFace,allSimplices);
43 faces().emplace(newFace->sID,newFace);
48 void MeshRegionBoundary<dim>::buildFaces()
52 const auto t0= std::chrono::system_clock::now();
53 std::cout<<
"MeshRegionBoundary ("<<regionBndID.first<<
","<<regionBndID.second<<
") buiding faces "<<std::flush;
56 std::set<
const Simplex<dim,dim-1>*> allSimplices(simplices());
57 while(allSimplices.size())
59 auto newFace = topology.createFace(*allSimplices.begin());
60 buildSingleFace(*allSimplices.begin(),newFace,allSimplices);
63 while(allSimplices.size())
65 auto newFace = topology.createFace(*allSimplices.begin());
66 buildSingleFace(*allSimplices.begin(),newFace,allSimplices);
69 for(
auto& face :
faces())
71 face.second->finalize();
size_t InstanceCount< Derived >::count
static std::string magentaColor
static std::string defaultColor
MeshRegionBoundary(const std::pair< size_t, size_t > &rbndID, PolyhedralMesh< dim > &topologyIn)
std::map< size_t, std::shared_ptr< PlanarMeshFaceType > > MeshFacesContainerType
const MeshFacesContainerType & faces() const
const std::set< const SimplexType * > & simplices() const
const std::pair< int, int > regionBndID