44 const pointField& sFeatLocalPts(surf.localPoints());
45 const edgeList& sFeatEds(surf.edges());
47 const vectorField& faceNormals = surf.faceNormals();
69 forAll(featurePointFeatureEdges, pI)
71 featurePointFeatureEdges[pI] =
pointEdges[featurePoints[pI]];
91 label sFPI = featurePoints[i];
93 tmpPts.
append(sFeatLocalPts[sFPI]);
95 pointMap[sFPI] = tmpPts.
size() - 1;
105 label sFEI = featureEdges[i];
109 const edge& fE = sFeatEds[sFEI];
114 if (pointMap[fE.
start()] == -1)
118 pointMap[fE.
start()] = tmpPts.
size() - 1;
121 eds[i].start() = pointMap[fE.
start()];
123 if (pointMap[fE.
end()] == -1)
127 pointMap[fE.
end()] = tmpPts.
size() - 1;
130 eds[i].
end() = pointMap[fE.
end()];
133 const labelList& eFaces = edgeFaces[sFEI];
140 label eFI = eFaces[j];
145 norms.
append(faceNormals[eFI]);
154 surf[eFI].
centre(surf.points())
155 - sFeatLocalPts[fE.
start()];
161 & (fC0tofE0/(
mag(fC0tofE0)+ vSmall))
171 if (eFaces.
size() == 2)
174 surf[eFaces[1]].
centre(surf.points())
175 - surf[eFaces[0]].
centre(surf.points());
180 if (isRegionFeatureEdge[i])
189 forAll(featurePointFeatureEdges, pI)
191 const labelList& fpfe = featurePointFeatureEdges[pI];
197 const label oldEdgeIndex = fpfe[eI];
199 const label newFeatureEdgeIndex = edgeMap[oldEdgeIndex];
201 if (newFeatureEdgeIndex != -1)
203 newFeatureEdges.
append(newFeatureEdgeIndex);
207 featurePointFeatureEdges[pI].
transfer(newFeatureEdges);
231 else if (eStat ==
FLAT)
235 else if (eStat ==
OPEN)
243 else if (eStat ==
NONE)
246 <<
nl <<
"classifyEdge returned NONE on edge "
248 <<
". There is a problem with definition of this edge."
260 ListListOps::combine<labelList>
276 forAll(featurePointFeatureEdges, pI)
316 else if (ptStatus ==
MIXED)
323 <<
nl <<
"classifyFeaturePoint returned NONFEATURE on point at "
325 <<
". There is a problem with definition of this feature point."
335 ListListOps::combine<labelList>
351 ptMap[i] = ftPtMap[i];
364 reset(move(pts), move(eds));
382 if (
findIndex(tmpFtPtNorms, ptEdNorms[
k]) == -1)
384 bool addNormal =
true;
404 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.
Unit conversion functions.