47 const pointField& sFeatLocalPts(surf.localPoints());
48 const edgeList& sFeatEds(surf.edges());
50 const vectorField& faceNormals = surf.faceNormals();
59 label nFeatEds = featureEdges.
size();
60 label nFeatPts = featurePoints.
size();
72 forAll(featurePointFeatureEdges, pI)
74 featurePointFeatureEdges[pI] =
pointEdges[featurePoints[pI]];
80 labelList pointMap(sFeatLocalPts.size(), -1);
94 label sFPI = featurePoints[i];
96 tmpPts.
append(sFeatLocalPts[sFPI]);
98 pointMap[sFPI] = tmpPts.
size() - 1;
104 bitSet isRegionFeatureEdge(regionFeatureEdges);
108 label sFEI = featureEdges[i];
112 const edge& fE = sFeatEds[sFEI];
117 if (pointMap[fE.
start()] == -1)
121 pointMap[fE.
start()] = tmpPts.
size() - 1;
124 eds[i].start() = pointMap[fE.
start()];
126 if (pointMap[fE.
end()] == -1)
130 pointMap[fE.
end()] = tmpPts.
size() - 1;
133 eds[i].
end() = pointMap[fE.
end()];
136 const labelList& eFaces = edgeFaces[sFEI];
143 label eFI = eFaces[j];
148 norms.
append(faceNormals[eFI]);
157 surf[eFI].centre(surf.points())
158 - sFeatLocalPts[fE.
start()];
164 & (fC0tofE0/(
mag(fC0tofE0)+ VSMALL))
174 if (eFaces.
size() == 2)
177 surf[eFaces[1]].centre(surf.points())
178 - surf[eFaces[0]].centre(surf.points());
183 if (isRegionFeatureEdge.
test(i))
192 forAll(featurePointFeatureEdges, pI)
194 const labelList& fpfe = featurePointFeatureEdges[pI];
200 const label oldEdgeIndex = fpfe[eI];
202 const label newFeatureEdgeIndex = edgeMap[oldEdgeIndex];
204 if (newFeatureEdgeIndex != -1)
206 newFeatureEdges.
append(newFeatureEdgeIndex);
210 featurePointFeatureEdges[pI].
transfer(newFeatureEdges);
234 else if (eStat ==
FLAT)
238 else if (eStat ==
OPEN)
246 else if (eStat ==
NONE)
249 <<
nl <<
"classifyEdge returned NONE on edge " 251 <<
". There is a problem with definition of this edge." 263 ListListOps::combine<labelList>
279 forAll(featurePointFeatureEdges, pI)
319 else if (ptStatus ==
MIXED)
326 <<
nl <<
"classifyFeaturePoint returned NONFEATURE on point at " 328 <<
". There is a problem with definition of this feature point." 338 ListListOps::combine<labelList>
354 ptMap[i] = ftPtMap[i];
388 if (!tmpFtPtNorms.
found(ptEdNorms[
k]))
390 bool addNormal =
true;
410 tmpFtPtNorms.
append(ptEdNorms[
k]);
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
void size(const label n)
Older name for setAddressableSize.
vectorField normals_
Normals of the features, to be referred to by index by both feature.
const pointField & points() const noexcept
Return points.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
const labelListList & normalDirections() const
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void append(const T &val)
Append an element at the end of the list.
Unit conversion functions.
label mixedStart_
Index of the start of the mixed type feature points.
constexpr char nl
The newline '\n' character (0x0a)
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
label openStart_
Index of the start of the open feature edges.
Object access operator or list access operator (default is pass-through)
bool found(const T &val, label pos=0) const
Same as contains()
void operator=(const edgeMesh &rhs)
Copy assignment.
label concaveStart_
Index of the start of the concave feature points.
void setCapacity(const label len)
Alter the size of the underlying storage.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
label k
Boltzmann constant.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
A point surrounded by both convex and concave edges.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
edgeMesh()
Default construct.
#define forAll(list, i)
Loop across all elements in list.
label start() const noexcept
The start (first) vertex label.
label internalStart_
Index of the start of the internal feature edges.
labelListList normalDirections_
Starting directions for the edges.
const labelListList & pointEdges() const
Return edges.
void setSize(const label n)
Alias for resize()
labelList regionEdges_
Feature edges which are on the boundary between regions.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
label flatStart_
Index of the start of the flat feature edges.
void append(const T &val)
Copy append an element to the end of this list.
void sortPointsAndEdges(const Patch &, const labelUList &featureEdges, const labelUList ®ionFeatureEdges, const labelUList &feaurePoints)
vector vec(const UList< point > &pts) const
Return the vector (from first to second).
errorManip< error > abort(error &err)
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
Fully convex point (w.r.t normals)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Mesh data needed to do the Finite Area discretisation.
Only connected to a single face.
static edgeStatus classifyEdge(const List< vector > &norms, const labelList &edNorms, const vector &fC0tofC1)
Classify the type of feature edge. Requires face centre 0 to face.
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values within a list.
label multipleStart_
Index of the start of the multiply-connected feature edges.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
void transfer(edgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
Field< vector > vectorField
Specialisation of Field<T> for vector.
label end() const noexcept
The end (last/second) vertex label.
iterator end() noexcept
Return an iterator to end traversing the UList.
Neither concave or convex, on a flat surface.
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
label nonFeatureStart_
Index of the start of the non-feature points.
Multiply connected (connected to more than two faces)
static constexpr label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
Unclassified (consistency with surfaceFeatures)
static constexpr const zero Zero
Global zero (0)
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.