47 const pointField& sFeatLocalPts(surf.localPoints());
48 const edgeList& sFeatEds(surf.edges());
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];
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];
368 edgeMesh newmesh(std::move(pts), std::move(eds));
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.
void transfer(List< T > &list)
void setSize(const label n)
Alias for resize()
void append(const T &val)
Append an element at the end of the list.
bool found(const T &val, label pos=0) const
True if the value if found in the list.
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
Return *this (used 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 value at specified position, never auto-vivify entries.
Mesh data needed to do the Finite Area discretisation.
const labelListList & pointEdges() const
Return edges.
edgeMesh()
Default construct.
const pointField & points() const noexcept
Return points.
void operator=(const edgeMesh &rhs)
Copy assignment.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label end() const
Return end (last/second) vertex label.
vector vec(const UList< point > &pts) const
Return the vector (end - start)
label start() const
Return 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.
transferModelList & transfer()
Transfer.
const labelListList & sortedEdgeFaces() const
Return edge-face addressing sorted (for edges with more than.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
surfaceVectorField faceNormals(mesh.Sf()/mesh.magSf())
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
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)
errorManip< error > abort(error &err)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0)
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)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
Unit conversion functions.