44 const pointField& sFeatLocalPts(surf.localPoints());
45 const edgeList& sFeatEds(surf.edges());
46 const labelListList edgeFaces = PatchTools::sortedEdgeFaces(surf);
47 const vectorField& faceNormals = surf.faceNormals();
48 const labelListList pointEdges = PatchTools::sortedPointEdges(surf);
69 forAll(featurePointFeatureEdges, pI)
71 featurePointFeatureEdges[pI] = pointEdges[featurePoints[pI]];
77 labelList pointMap(sFeatLocalPts.size(), -1);
91 label sFPI = featurePoints[i];
93 tmpPts.
append(sFeatLocalPts[sFPI]);
95 pointMap[sFPI] = tmpPts.
size() - 1;
99 nonFeatureStart_ = tmpPts.
size();
105 label sFEI = featureEdges[i];
109 const edge& fE = sFeatEds[sFEI];
111 edgeDirections[i] = fE.
vec(sFeatLocalPts);
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]);
150 edgeNormals[i][j] =
faceMap[eFI];
152 const vector cross = (faceNormals[eFI] ^ edgeDirections[i]);
154 surf[eFI].
centre(surf.points())
155 - sFeatLocalPts[fE.
start()];
157 normalDirections[i][j] =
160 (cross/(
mag(cross) + VSMALL))
161 & (fC0tofE0/(
mag(fC0tofE0)+ VSMALL))
169 vector fC0tofC1(vector::zero);
171 if (eFaces.
size() == 2)
174 surf[eFaces[1]].
centre(surf.points())
175 - surf[eFaces[0]].centre(surf.points());
178 edStatus[i] = classifyEdge(norms, edgeNormals[i], fC0tofC1);
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);
223 if (eStat == EXTERNAL)
227 else if (eStat == INTERNAL)
231 else if (eStat == FLAT)
235 else if (eStat == OPEN)
239 else if (eStat == MULTIPLE)
243 else if (eStat == NONE)
247 ":extendedEdgeMesh::sortPointsAndEdges" 250 " const labelList& featureEdges," 251 " const labelList& feaurePoints" 253 ) <<
nl <<
"classifyEdge returned NONE on edge " 255 <<
". There is a problem with definition of this edge." 260 internalStart_ = externalEds.
size();
261 flatStart_ = internalStart_ + internalEds.
size();
262 openStart_ = flatStart_ + flatEds.
size();
263 multipleStart_ = openStart_ + openEds.
size();
267 ListListOps::combine<labelList>
283 forAll(featurePointFeatureEdges, pI)
291 edgeMesh::operator=(
edgeMesh(pts, eds));
294 edgeDirections_ = edgeDirections/(
mag(edgeDirections) + VSMALL);
295 edgeNormals_ = edgeNormals;
296 normalDirections_ = normalDirections;
297 regionEdges_ = regionEdges;
311 for (
label i = 0; i < nonFeatureStart_; i++)
315 if (ptStatus == CONVEX)
319 else if (ptStatus == CONCAVE)
323 else if (ptStatus == MIXED)
327 else if (ptStatus == NONFEATURE)
331 ":extendedEdgeMesh::sortPointsAndEdges" 334 " const labelList& featureEdges," 335 " const labelList& feaurePoints" 337 ) <<
nl <<
"classifyFeaturePoint returned NONFEATURE on point at " 339 <<
". There is a problem with definition of this feature point." 344 concaveStart_ = convexPts.
size();
345 mixedStart_ = concaveStart_ + concavePts.
size();
349 ListListOps::combine<labelList>
365 ptMap[i] = ftPtMap[i];
384 for (
label i = 0; i < nonFeatureStart_; i++)
388 const labelList& ptEds = edgeMesh::pointEdges()[i];
392 const labelList& ptEdNorms(edgeNormals[ptEds[j]]);
396 if (
findIndex(tmpFtPtNorms, ptEdNorms[
k]) == -1)
398 bool addNormal =
true;
405 (normals_[ptEdNorms[k]] & normals_[tmpFtPtNorms[q]])
418 tmpFtPtNorms.
append(ptEdNorms[k]);
424 featurePointNormals[i] = tmpFtPtNorms;
427 featurePointNormals_ = featurePointNormals;
428 featurePointEdges_ = featurePointFeatureEdges;
iterator end()
Return an iterator to end traversing the UList.
const pointField & points
void setCapacity(const label)
Alter the size of the underlying storage.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
dimensioned< scalar > mag(const dimensioned< Type > &)
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
void setSize(const label)
Reset size of List.
volVectorField vectorField(fieldObject, mesh)
label k
Boltzmann constant.
Unit conversion functions.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
vector vec(const pointField &) const
Return the vector (end - start)
errorManip< error > abort(error &err)
const Vector< Cmpt > & centre(const Foam::List< Vector< Cmpt > > &) const
Return *this (used for point which is a typedef to Vector<scalar>.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
Points connected by edges.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
label end() const
Return end vertex label.
label start() const
Return start vertex label.
void cross(FieldField< Field1, typename crossProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
void sortPointsAndEdges(const Patch &, const labelList &featureEdges, const labelList ®ionFeatureEdges, const labelList &feaurePoints)
void inplaceRenumber(const labelUList &oldToNew, ListType &)
Inplace renumber the values of a list.