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]];
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."
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."
354 ptMap[i] = ftPtMap[i];
388 if (!tmpFtPtNorms.
found(ptEdNorms[
k]))
390 bool addNormal =
true;
410 tmpFtPtNorms.
append(ptEdNorms[
k]);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
void setCapacity(const label len)
Alter the size of the underlying storage.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
bool found(const T &val, label pos=0) const
Same as contains().
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
const Vector< Cmpt > & centre(const Foam::UList< Vector< Cmpt > > &) const noexcept
Return this (for point which is a typedef to Vector<scalar>).
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
bool test(const label pos) const
Test for True value at specified position, never auto-vivify entries.
const labelListList & pointEdges() const
Return edges.
edgeMesh()
Default construct.
edgeMesh(const faMesh &mesh)
Construct finite-area edge mesh faMesh reference.
const pointField & points() const noexcept
Return points.
void transfer(edgeMesh &mesh)
Transfer the contents of the argument and annul the argument.
void operator=(const edgeMesh &rhs)
Copy assignment.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
label & end() noexcept
The end (second/last) vertex label.
vector vec(const UList< point > &pts) const
Return the vector (from first to second).
label start() const noexcept
The start (first) vertex label.
labelList regionEdges_
Feature edges which are on the boundary between regions.
const labelListList & normalDirections() const
labelListList edgeNormals_
Indices of the normals that are adjacent to the feature edges.
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
void sortPointsAndEdges(const Patch &, const labelUList &featureEdges, const labelUList ®ionFeatureEdges, const labelUList &feaurePoints)
pointStatus classifyFeaturePoint(label ptI) const
Classify the type of feature point. Requires valid stored member.
label nonFeatureStart_
Index of the start of the non-feature points.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
const labelListList & edgeNormals() const
Return the indices of the normals that are adjacent to the.
vectorField edgeDirections_
Flat and open edges require the direction of the edge.
label openStart_
Index of the start of the open feature edges.
labelListList featurePointEdges_
Indices of feature edges attached to feature points. The edges are.
label flatStart_
Index of the start of the flat feature edges.
@ NONFEATURE
Not a feature point.
@ MIXED
A point surrounded by both convex and concave edges.
@ CONCAVE
Fully concave point.
@ CONVEX
Fully convex point (w.r.t normals).
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.
@ FLAT
Neither concave or convex, on a flat surface.
@ OPEN
Only connected to a single face.
@ MULTIPLE
Multiply connected (connected to more than two faces).
@ NONE
Unclassified (consistency with surfaceFeatures).
label internalStart_
Index of the start of the internal feature edges.
vectorField normals_
Normals of the features, to be referred to by index by both feature.
static constexpr label nEdgeTypes
Number of possible feature edge types (i.e. number of slices).
label mixedStart_
Index of the start of the mixed type feature points.
labelListList normalDirections_
Starting directions for the edges.
const labelListList & featurePointNormals() const
Return the indices of the normals that are adjacent to the.
label multipleStart_
Index of the start of the multiply-connected feature edges.
labelListList featurePointNormals_
Indices of the normals that are adjacent to the feature points.
static scalar cosNormalAngleTol_
Angular closeness tolerance for treating normals as the same.
label concaveStart_
Index of the start of the concave feature points.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
List< edge > edgeList
List of edge.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values within a list.
List< labelList > labelListList
List of labelList.
List< label > labelList
A List of labels.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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...
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
Object access operator or list access operator (default is pass-through).
Unit conversion functions.