32bool Foam::CV2D::dualCellSurfaceIntersection
34 const Triangulation::Finite_vertices_iterator& vit
37 Triangulation::Edge_circulator ecStart = incident_edges(vit);
38 Triangulation::Edge_circulator ec = ecStart;
47 if (!qSurf_.globalBounds().contains(e0))
53 toPoint3D(circumcenter(ec->first->neighbor(ec->second)));
56 if (!qSurf_.globalBounds().contains(e1))
63 if (qSurf_.findSurfaceAnyIntersection(e0, e1))
70 }
while (++ec != ecStart);
76void Foam::CV2D::insertPointPairs
85 if (meshControls().mirrorPoints())
91 nearSurfacePoints[ppi],
103 toPoint3D(surfacePoints[ppi]),
108 qSurf_.geometry()[surfaceHits[ppi]].getNormal
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;
143void Foam::CV2D::insertSurfaceNearestPointPairs()
145 Info<<
"insertSurfaceNearestPointPairs: ";
147 label nSurfacePointsEst =
150 label(number_of_vertices()),
151 label(10*
sqrt(scalar(number_of_vertices())))
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"
const cv2DControls & meshControls() const
Foam::point toPoint3D(const point2D &) const
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A class for handling file names.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
UList< label > labelUList
A UList of labels.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define forAll(list, i)
Loop across all elements in list.