33 void Foam::CV2D::insertPointPair
35 Triangulation::Finite_vertices_iterator& vit,
38 const label hitSurface
44 || !insertMirrorPoint(
toPoint2D(vit->point()),
p)
55 qSurf_.
geometry()[hitSurface].getNormal
57 List<pointIndexHit>(1, pHit),
69 vit = Triangulation::Finite_vertices_iterator
73 Triangulation::All_vertices_iterator,
74 Triangulation::Infinite_tester
75 >(finite_vertices_end(), vit.predicate(), vit.base())
80 bool Foam::CV2D::insertPointPairAtIntersection
82 Triangulation::Finite_vertices_iterator& vit,
85 const scalar maxProtSize2
91 label interHitSurface = -1;
92 scalar interDist2 = 0;
94 Face_circulator fcStart = incident_faces(vit);
95 Face_circulator fc = fcStart;
100 if (!is_infinite(fc))
103 label hitSurface = -1;
105 qSurf_.findSurfaceNearestIntersection
116 toPoint2D(pHit.point()).distSqr(
vertices[vi]);
119 if (dist2 > interDist2)
121 scalar mps2 = maxProtSize2;
128 mps2 = meshControls().maxNotchLen2();
134 interPoint = toPoint2D(pHit.point());
135 interTri = pHit.index();
137 interHitSurface = hitSurface;
144 }
while (++fc != fcStart);
148 insertPointPair(vit, interPoint, interTri, interHitSurface);
156 Foam::label Foam::CV2D::insertBoundaryConformPointPairs
158 const fileName& fName
161 label nIntersections = 0;
165 Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
166 vit != finite_vertices_end();
171 if (!vit->nearOrOnBoundary())
177 Face_circulator fcStart = incident_faces(vit);
178 Face_circulator fc = fcStart;
180 bool infinite =
false;
181 bool changed =
false;
195 }
while (++fc != fcStart);
199 if (infinite || !changed)
continue;
206 vertices[nVerts++] = toPoint2D(circumcenter(fc));
208 if (nVerts == maxNvert)
212 }
while (++fc != fcStart);
216 if (nVerts == maxNvert)
continue;
222 point2DFromPoint defVert = toPoint2D(vit->point());
224 scalar maxProtSize2 = meshControls().maxNotchLen2();
226 if (vit->internalOrBoundaryPoint())
232 scalar perimeter = 0;
237 for (
int vi=0; vi<nVerts; vi++)
240 perimeter +=
mag(edge);
246 if (areaT2 < meshControls().minEdgeLen2())
continue;
249 scalar cellWidth = areaT2/perimeter;
268 perimeter > 2*meshControls().minCellSize()
269 && areaT2 > meshControls().minCellSize2()
270 && cellWidth > 0.5*meshControls().minEdgeLen()
273 maxProtSize2 = 0.25*meshControls().maxNotchLen2();
277 if (insertPointPairAtIntersection(vit, defVert,
vertices, maxProtSize2))
283 return nIntersections;
287 void Foam::CV2D::markNearBoundaryPoints()
292 Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
293 vit != finite_vertices_end();
297 if (vit->internalPoint())
302 label hitSurface = -1;
304 qSurf_.findSurfaceNearest
307 4*meshControls().minCellSize2(),
314 vit->setNearBoundary();
320 Info<<
count <<
" points marked as being near a boundary" <<
endl;
vector2D point2D
Point2D is a vector.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Vector2D< scalar > vector2D
A 2D vector of scalars obtained from the generic Vector2D.
const point2D & toPoint2D(const Foam::point &) const
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
Foam::point toPoint3D(const point2D &) const
const cv2DControls & meshControls() const
pointField vertices(const blockVertexList &bvl)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
bool boundaryTriangle(const CV2D::Face_handle fc)