33void Foam::CV2D::insertPointPair
38 const label hitSurface
44 || !insertMirrorPoint(
toPoint2D(vit->point()),
p)
55 qSurf_.
geometry()[hitSurface].getNormal
57 List<pointIndexHit>(1, pHit),
73 Triangulation::All_vertices_iterator,
74 Triangulation::Infinite_tester
75 >(finite_vertices_end(), vit.predicate(), vit.base())
80bool Foam::CV2D::insertPointPairAtIntersection
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
119 if (dist2 > interDist2)
121 scalar mps2 = maxProtSize2;
128 mps2 = meshControls().maxNotchLen2();
134 interPoint = toPoint2D(pHit.hitPoint());
135 interTri = pHit.index();
137 interHitSurface = hitSurface;
144 }
while (++fc != fcStart);
148 insertPointPair(vit, interPoint, interTri, interHitSurface);
156Foam::label Foam::CV2D::insertBoundaryConformPointPairs
158 const fileName& fName
161 label nIntersections = 0;
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;
287void Foam::CV2D::markNearBoundaryPoints()
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;
const cv2DControls & meshControls() const
Foam::point toPoint3D(const point2D &) const
const point2D & toPoint2D(const Foam::point &) const
Triangulation::Finite_vertices_iterator Finite_vertices_iterator
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Vector2D< scalar > vector2D
A 2D vector of scalars obtained from the generic Vector2D.
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
bool boundaryTriangle(const CV2D::Face_handle fc)
messageStream Info
Information stream (stdout output on master, null elsewhere)
vector2D point2D
Point2D is a vector.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
pointField vertices(const blockVertexList &bvl)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)