src/Boundary/FacetedVolumeBoundary.cc
//------------------------------------------------------------------------------
// Find the node touching a given facet
//------------------------------------------------------------------------------
// Polygon
Find the node touching a given facet
Polygon
Find the node touching a given facet Polygon
std::vector<int>
nodesTouchingFacet(const NodeList<Dim<2>>& nodes,
                   const GeomFacet2d& facet,
                   const bool interiorBoundary) {
  const auto& p1 = facet.point1();
  const auto& p2 = facet.point2();
  const auto  phat = (p2 - p1).unitVector();
  const auto  smax = (p2 - p1).magnitude();
  const auto  plane = facetPlane(facet, interiorBoundary);
  const auto potentials = findNodesTouchingThroughPlanes(nodes, plane, plane);
  std::vector<int> result;
  const auto& pos = nodes.positions();
  for (const auto i: potentials) {
    const auto s = (pos(i) - p1).dot(phat);
    if (s >= 0.0 and s <= smax) result.push_back(i);
  }
  return result;
}
std :: vector < int > nodesTouchingFacet ( const NodeList < Dim < 2 > > & nodes , const GeomFacet2d & facet , const bool interiorBoundary ) { const auto & p1 = facet . point1 ( ) ; const auto & p2 = facet . point2 ( ) ; const auto phat = ( p2 - p1 ) . unitVector ( ) ; const auto smax = ( p2 - p1 ) . magnitude ( ) ; const auto plane = facetPlane ( facet , interiorBoundary ) ; const auto potentials = findNodesTouchingThroughPlanes ( nodes , plane , plane ) ; std :: vector < int > result ; const auto & pos = nodes . positions ( ) ; for ( const auto i : potentials ) { const auto s = ( pos ( i ) - p1 ) . dot ( phat ) ; if ( s >= 0.0 and s <= smax ) result . push_back ( i ) ; } return result ; }
Find the node touching a given facet
Polygon
Find the node touching a given facet Polygon