44 void Foam::rayShooting::splitLine
46 const line<point, point>& l,
48 DynamicList<Vb::Point>& initialPoints
54 const scalar minDistFromSurfaceSqr
62 magSqr(midPoint - l.start()) > minDistFromSurfaceSqr
63 &&
magSqr(midPoint - l.end()) > minDistFromSurfaceSqr
86 if (randomiseInitialGrid_)
109 <<
"Point perturbation crosses a surface. Not inserting." 123 const dictionary& initialPointsDict,
126 const conformationSurfaces& geometryToConformTo,
127 const cellShapeControl& cellShapeControls,
128 const autoPtr<backgroundMeshDecomposition>& decomposition
141 randomiseInitialGrid_(detailsDict().
get<Switch>(
"randomiseInitialGrid")),
142 randomPerturbationCoeff_
144 detailsDict().
get<scalar>(
"randomPerturbationCoeff")
154 const searchableSurfaces& surfaces = geometryToConformTo().geometry();
155 const labelList& surfacesToConformTo = geometryToConformTo().surfaces();
157 const scalar maxRayLength(surfaces.bounds().mag());
160 label initialPointsSize = 0;
163 initialPointsSize += surfaces[surfI].size();
166 DynamicList<Vb::Point> initialPoints(initialPointsSize);
168 forAll(surfacesToConformTo, surfI)
170 const searchableSurface&
s = surfaces[surfacesToConformTo[surfI]];
172 tmp<pointField> faceCentresTmp(
s.coordinates());
173 const pointField& faceCentres = faceCentresTmp();
175 Info<<
" Shoot rays from " <<
s.name() <<
nl 176 <<
" nRays = " << faceCentres.size() <<
endl;
185 && !decomposition().positionOnThisProcessor(fC)
193 randomPerturbationCoeff_
194 *cellShapeControls().cellSize(fC)
198 label hitSurfaceStart;
202 geometryToConformTo().findSurfaceNearest
211 geometryToConformTo().getNormal
214 List<pointIndexHit>(1, surfHitStart),
221 geometryToConformTo().findSurfaceNearestIntersection
223 fC - normStart[0]*pert,
224 fC - normStart[0]*maxRayLength,
229 if (surfHitEnd.hit())
232 geometryToConformTo().getNormal
235 List<pointIndexHit>(1, surfHitEnd),
239 if ((normStart[0] & normEnd[0]) < 0)
241 line<point, point> l(fC, surfHitEnd.point());
247 decomposition().findLine
253 if (procIntersection.hit())
259 procIntersection.point()
275 return initialPoints.shrink();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
rayShooting(const dictionary &initialPointsDict, const Time &runTime, Random &rndGen, const conformationSurfaces &geometryToConformTo, const cellShapeControl &cellShapeControls, const autoPtr< backgroundMeshDecomposition > &decomposition)
Construct from components.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
static bool & parRun() noexcept
Test if this a parallel run.
const cellShapeControl & cellShapeControls() const
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
Type sample01()
Return a sample whose components lie in the range [0,1].
PointFrompoint toPoint(const Foam::point &p)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
defineTypeNameAndDebug(combustionModel, 0)
const conformationSurfaces & geometryToConformTo() const
#define WarningInFunction
Report a warning using Foam::Warning.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field< vector > vectorField
Specialisation of Field<T> for vector.
List< label > labelList
A List of labels.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
scalar minimumSurfaceDistanceCoeffSqr_
Only allow the placement of initial points that are within the.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
virtual List< Vb::Point > initialPoints() const
Return the initial points for the conformalVoronoiMesh.