32 bool Foam::CV2D::dualCellSurfaceIntersection
34 const Triangulation::Finite_vertices_iterator& vit
37 Triangulation::Edge_circulator ecStart = incident_edges(vit);
38 Triangulation::Edge_circulator ec = ecStart;
53 toPoint3D(circumcenter(ec->first->neighbor(ec->second)));
70 }
while (++ec != ecStart);
76 void Foam::CV2D::insertPointPairs
78 const DynamicList<point2D>& nearSurfacePoints,
79 const DynamicList<point2D>& surfacePoints,
80 const DynamicList<label>& surfaceTris,
81 const DynamicList<label>& surfaceHits,
85 if (meshControls().mirrorPoints())
91 nearSurfacePoints[ppi],
103 toPoint3D(surfacePoints[ppi]),
108 qSurf_.geometry()[surfaceHits[ppi]].getNormal
110 List<pointIndexHit>(1, pHit),
116 meshControls().ppDist(),
123 Info<< surfacePoints.size() <<
" point-pairs inserted" <<
endl;
125 if (meshControls().objOutput())
130 forAll(surfacePoints, ppi)
136 Info<<
"insertPointPairs: Written " << surfacePoints.size()
137 <<
" inserted point-pair locations to file " 138 << str.name() <<
endl;
143 void Foam::CV2D::insertSurfaceNearestPointPairs()
145 Info<<
"insertSurfaceNearestPointPairs: ";
147 label nSurfacePointsEst =
150 label(number_of_vertices()),
151 label(10*
sqrt(scalar(number_of_vertices())))
154 DynamicList<point2D> nearSurfacePoints(nSurfacePointsEst);
155 DynamicList<point2D> surfacePoints(nSurfacePointsEst);
156 DynamicList<label> surfaceTris(nSurfacePointsEst);
157 DynamicList<label> surfaceHits(nSurfacePointsEst);
167 Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
168 vit != finite_vertices_end();
172 if (vit->internalPoint())
174 point2DFromPoint vert(toPoint2D(vit->point()));
177 label hitSurface = -1;
179 qSurf_.findSurfaceNearest
182 4*meshControls().minCellSize2(),
189 vit->setNearBoundary();
225 if (dualCellSurfaceIntersection(vit))
227 nearSurfacePoints.append(vert);
228 surfacePoints.append(toPoint2D(pHit.hitPoint()));
229 surfaceTris.append(pHit.index());
230 surfaceHits.append(hitSurface);
242 "surfaceNearestIntersections.obj"
dimensionedScalar sqrt(const dimensionedScalar &ds)
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
#define forAll(list, i)
Loop across all elements in list.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
scalar minEdgeLen2() const
Return the minEdgeLen squared.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)