43 const pointField& sFeatLocalPts(surf.localPoints());
44 const edgeList& sFeatEds(surf.edges());
46 const vectorField& faceNormals = surf.faceNormals();
68 forAll(featurePointFeatureEdges, pI)
70 featurePointFeatureEdges[pI] =
pointEdges[featurePoints[pI]];
90 label sFPI = featurePoints[i];
92 tmpPts.
append(sFeatLocalPts[sFPI]);
94 pointMap[sFPI] = tmpPts.
size() - 1;
104 label sFEI = featureEdges[i];
108 const edge& fE = sFeatEds[sFEI];
113 if (pointMap[fE.
start()] == -1)
117 pointMap[fE.
start()] = tmpPts.
size() - 1;
120 eds[i].start() = pointMap[fE.
start()];
122 if (pointMap[fE.
end()] == -1)
126 pointMap[fE.
end()] = tmpPts.
size() - 1;
129 eds[i].
end() = pointMap[fE.
end()];
132 const labelList& eFaces = edgeFaces[sFEI];
139 label eFI = eFaces[j];
144 norms.
append(faceNormals[eFI]);
153 surf[eFI].
centre(surf.points())
154 - sFeatLocalPts[fE.
start()];
160 & (fC0tofE0/(
mag(fC0tofE0)+ vSmall))
170 if (eFaces.
size() == 2)
173 surf[eFaces[1]].
centre(surf.points())
174 - surf[eFaces[0]].
centre(surf.points());
179 if (isRegionFeatureEdge[i])
188 forAll(featurePointFeatureEdges, pI)
190 const labelList& fpfe = featurePointFeatureEdges[pI];
196 const label oldEdgeIndex = fpfe[eI];
198 const label newFeatureEdgeIndex = edgeMap[oldEdgeIndex];
200 if (newFeatureEdgeIndex != -1)
202 newFeatureEdges.
append(newFeatureEdgeIndex);
206 featurePointFeatureEdges[pI].
transfer(newFeatureEdges);
230 else if (eStat ==
FLAT)
234 else if (eStat ==
OPEN)
242 else if (eStat ==
NONE)
245 <<
nl <<
"classifyEdge returned NONE on edge "
247 <<
". There is a problem with definition of this edge."
259 ListListOps::combine<labelList>
275 forAll(featurePointFeatureEdges, pI)
315 else if (ptStatus ==
MIXED)
322 <<
nl <<
"classifyFeaturePoint returned NONFEATURE on point at "
324 <<
". There is a problem with definition of this feature point."
334 ListListOps::combine<labelList>
350 ptMap[i] = ftPtMap[i];
363 reset(move(pts), move(eds));
381 if (
findIndex(tmpFtPtNorms, ptEdNorms[
k]) == -1)
383 bool addNormal =
true;
403 tmpFtPtNorms.
append(ptEdNorms[
k]);
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void setCapacity(const label)
Alter the size of the underlying storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
iterator end()
Return an iterator to end traversing the UList.
const Vector< Cmpt > & centre(const Foam::List< Vector< Cmpt >> &) const
Return *this (used for point which is a typedef to Vector<scalar>.
void operator=(const edgeMesh &)
const labelListList & pointEdges() const
Return edges.
virtual void reset(pointField &&points, edgeList &&edges)
Reset primitive data (points, edges)
edgeMesh()
Construct null.
const pointField & points() const
Return points.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
label end() const
Return end vertex label.
vector vec(const pointField &) const
Return the vector (end - start)
label start() const
Return start 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.
static label nEdgeTypes
Number of possible feature edge types (i.e. number of slices)
void sortPointsAndEdges(const Patch &, const labelList &featureEdges, const labelList ®ionFeatureEdges, const labelList &feaurePoints)
const vectorField & edgeDirections() const
Return the edgeDirection vectors.
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.
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.
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.
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
errorManip< error > abort(error &err)
dimensioned< scalar > mag(const dimensioned< Type > &)
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.