30 void Foam::CV2D::insertPointPair
32 Triangulation::Finite_vertices_iterator& vit,
35 const label hitSurface
41 || !insertMirrorPoint(
toPoint2D(vit->point()), p)
52 qSurf_.
geometry()[hitSurface].getNormal
54 List<pointIndexHit>(1, pHit),
66 vit = Triangulation::Finite_vertices_iterator
70 Triangulation::All_vertices_iterator,
71 Triangulation::Infinite_tester
72 >(finite_vertices_end(), vit.predicate(), vit.base())
77 bool Foam::CV2D::insertPointPairAtIntersection
79 Triangulation::Finite_vertices_iterator& vit,
82 const scalar maxProtSize2
88 label interHitSurface = -1;
89 scalar interDist2 = 0;
91 Face_circulator fcStart = incident_faces(vit);
92 Face_circulator fc = fcStart;
100 label hitSurface = -1;
116 if (dist2 > interDist2)
118 scalar mps2 = maxProtSize2;
132 interTri = pHit.index();
134 interHitSurface = hitSurface;
141 }
while (++fc != fcStart);
145 insertPointPair(vit, interPoint, interTri, interHitSurface);
155 Foam::label Foam::CV2D::insertBoundaryConformPointPairs
157 const fileName& fName
160 label nIntersections = 0;
164 Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
165 vit != finite_vertices_end();
170 if (!vit->nearOrOnBoundary())
176 Face_circulator fcStart = incident_faces(vit);
177 Face_circulator fc = fcStart;
179 bool infinite =
false;
180 bool changed =
false;
194 }
while (++fc != fcStart);
198 if (infinite || !changed)
continue;
205 vertices[nVerts++] =
toPoint2D(circumcenter(fc));
207 if (nVerts == maxNvert)
211 }
while (++fc != fcStart);
215 if (nVerts == maxNvert)
continue;
218 vertices[nVerts] = vertices[0];
225 if (vit->internalOrBoundaryPoint())
231 scalar perimeter = 0;
236 for (
int vi=0; vi<nVerts; vi++)
238 vector2D edge(vertices[vi+1] - vertices[vi]);
239 perimeter +=
mag(edge);
240 vector2D otherEdge = defVert - vertices[vi];
241 areaT2 +=
mag(edge.x()*otherEdge.y() - edge.y()*otherEdge.x());
248 scalar cellWidth = areaT2/perimeter;
276 if (insertPointPairAtIntersection(vit, defVert, vertices, maxProtSize2))
282 return nIntersections;
286 void Foam::CV2D::markNearBoundaryPoints()
291 Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
292 vit != finite_vertices_end();
296 if (vit->internalPoint())
301 label hitSurface = -1;
313 vit->setNearBoundary();
319 Info<< count <<
" points marked as being near a boundary" <<
endl;
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
vector2D point2D
Point2D is a vector.
Vector2D< scalar > vector2D
vector2D obtained from generic Vector2D
scalar maxNotchLen2() const
Return the maxNotchLen squared.
Ostream & endl(Ostream &os)
Add newline and flush stream.
point toPoint3D(const point2D &) const
label count(const ListType &l, typename ListType::const_reference x)
Count the number of occurrences of a value in a list.
const cv2DControls & meshControls() const
PointIndexHit< point > pointIndexHit
const point2D & toPoint2D(const point &) const
const point2D & point2DFromPoint
dimensioned< scalar > magSqr(const dimensioned< Type > &)
scalar minCellSize2() const
Return the square of the minimum cell size.
scalar minEdgeLen2() const
Return the minEdgeLen squared.
scalar minCellSize() const
Return the minimum cell size.
dimensioned< scalar > mag(const dimensioned< Type > &)
scalar minEdgeLen() const
Return the minEdgeLen.
Field< vector > vectorField
Specialisation of Field<T> for vector.
bool boundaryTriangle(const CV2D::Face_handle fc)