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();
62 DynamicList<point> tmpPts;
64 DynamicList<vector> norms;
72 forAll(featurePointFeatureEdges, pI)
74 featurePointFeatureEdges[pI] =
pointEdges[featurePoints[pI]];
80 labelList pointMap(sFeatLocalPts.size(), -1);
90 List<edgeStatus> edStatus(nFeatEds,
NONE);
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)
119 tmpPts.
append(sFeatLocalPts[fE.start()]);
121 pointMap[fE.start()] = tmpPts.size() - 1;
124 eds[i].start() = pointMap[fE.start()];
126 if (pointMap[fE.end()] == -1)
128 tmpPts.append(sFeatLocalPts[fE.end()]);
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]);
150 faceMap[eFI] = norms.size() - 1;
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))
190 DynamicList<label> newFeatureEdges;
192 forAll(featurePointFeatureEdges, pI)
194 const labelList& fpfe = featurePointFeatureEdges[pI];
196 newFeatureEdges.setCapacity(fpfe.size());
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);
216 DynamicList<label>& externalEds(allEds[0]);
217 DynamicList<label>& internalEds(allEds[1]);
218 DynamicList<label>& flatEds(allEds[2]);
219 DynamicList<label>& openEds(allEds[3]);
220 DynamicList<label>& multipleEds(allEds[4]);
228 externalEds.append(i);
232 internalEds.append(i);
234 else if (eStat ==
FLAT)
238 else if (eStat ==
OPEN)
244 multipleEds.append(i);
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>
266 accessOp<labelList>()
270 edMap =
invert(edMap.size(), edMap);
279 forAll(featurePointFeatureEdges, pI)
301 List<DynamicList<label>> allPts(3);
303 DynamicList<label>& convexPts(allPts[0]);
304 DynamicList<label>& concavePts(allPts[1]);
305 DynamicList<label>& mixedPts(allPts[2]);
317 concavePts.append(i);
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>
341 accessOp<labelList>()
345 ftPtMap =
invert(ftPtMap.size(), ftPtMap);
354 ptMap[i] = ftPtMap[i];
378 DynamicList<label> tmpFtPtNorms;
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.
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)
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.
List< edge > edgeList
List of edge.
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.
void operator=(const edgeMesh &rhs)
Copy assignment.
label concaveStart_
Index of the start of the concave feature points.
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.
List< labelList > labelListList
List of labelList.
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 internalStart_
Index of the start of the internal feature edges.
labelListList normalDirections_
Starting directions for the edges.
const labelListList & pointEdges() const
Return edges.
vectorField pointField
pointField is a vectorField.
void setSize(const label n)
Alias for resize()
labelList regionEdges_
Feature edges which are on the boundary between regions.
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 sortPointsAndEdges(const Patch &, const labelUList &featureEdges, const labelUList ®ionFeatureEdges, const labelUList &feaurePoints)
errorManip< error > abort(error &err)
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
Fully convex point (w.r.t normals)
const Vector< Cmpt > & centre(const Foam::UList< Vector< Cmpt >> &) const noexcept
Return this (for point which is a typedef to Vector<scalar>)
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 (not the indices) of a list.
label multipleStart_
Index of the start of the multiply-connected feature edges.
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.
List< label > labelList
A List of labels.
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.