34template<
class FaceList,
class Po
intField>
36Foam::PrimitivePatch<FaceList, PointField>::calcBdryPoints()
const
38 if (boundaryPointsPtr_)
42 <<
"boundaryPoints already calculated"
51 <<
"Calculating boundary points from existing addressing"
54 bp.reserve(2*nBoundaryEdges());
56 for (
const edge&
e : boundaryEdges())
59 bp.insert(
e.second());
65 <<
"Calculating boundary points with manual edge addressing"
74 const List<face_type>& locFcs = localFaces();
78 for (
const auto&
f : locFcs)
80 edgeCount +=
f.nEdges();
84 HashTable<label, edge, Hash<edge>> knownEdges(2*edgeCount);
86 for (
const auto&
f : locFcs)
88 const label numEdges =
f.nEdges();
90 for (label edgei = 0; edgei < numEdges; ++edgei)
92 ++ knownEdges(
f.edge(edgei));
106 bp.reserve(2*edgeCount);
110 const edge&
e = iter.key();
114 bp.insert(
e.first());
115 bp.insert(
e.second());
120 boundaryPointsPtr_.reset(
new labelList(bp.sortedToc()));
127template<
class FaceList,
class Po
intField>
133 point_type::uniform(ROOTVGREAT),
134 point_type::uniform(-ROOTVGREAT)
140 for (
const label pointi : meshPoints())
149 for (
const face_type&
f : *
this)
151 for (
const label pointi :
f)
153 bb.
first() = min(bb.
first(), points_[pointi]);
163template<
class FaceList,
class Po
intField>
167 scalar radiusSqr = 0;
169 const point_type& fc = this->faceCentres()[facei];
171 for (
const label fp : this->
operator[](facei))
173 const scalar sqrDist =
magSqr(fc - points_[fp]);
174 if (radiusSqr < sqrDist)
An ordered pair of two objects of type <T> with first() and second() elements.
const T & first() const noexcept
Access the first element.
const T & second() const noexcept
Access the second element.
const labelList & meshPoints() const
Return labelList of mesh points in patch.
std::remove_reference< PointField >::type::value_type point_type
The point type.
Pair< point_type > box() const
The enclosing (bounding) box for the patch points.
scalar sphere(const label facei) const
The enclosing (bounding) sphere radius^2 for specified face.
const Field< point_type > & faceCentres() const
Return face centres for patch.
std::remove_reference< FaceList >::type::value_type face_type
The face type.
bool hasMeshPoints() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define DebugInfo
Report an information message using Foam::Info.
#define DebugInFunction
Report an information message using Foam::Info.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a).
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.