44void 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_)
90 midPoint.x() + pert*(
rndGen().sample01<scalar>() - 0.5),
91 midPoint.y() + pert*(
rndGen().sample01<scalar>() - 0.5),
92 midPoint.z() + pert*(
rndGen().sample01<scalar>() - 0.5)
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")
157 const scalar maxRayLength(surfaces.bounds().mag());
160 label initialPointsSize = 0;
163 initialPointsSize += surfaces[surfI].size();
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;
193 randomPerturbationCoeff_
198 label hitSurfaceStart;
214 List<pointIndexHit>(1, surfHitStart),
223 fC - normStart[0]*pert,
224 fC - normStart[0]*maxRayLength,
229 if (surfHitEnd.hit())
235 List<pointIndexHit>(1, surfHitEnd),
239 if ((normStart[0] & normEnd[0]) < 0)
241 line<point, point> l(fC, surfHitEnd.hitPoint());
253 if (procIntersection.hit())
259 procIntersection.hitPoint()
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static bool & parRun() noexcept
Test if this a parallel run.
pointIndexHit findLine(const point &start, const point &end) const
Find nearest intersection of line between start and end, (exposing.
scalar minimumSurfaceDistanceCoeffSqr_
Only allow the placement of initial points that are within the.
const conformationSurfaces & geometryToConformTo() const
const cellShapeControl & cellShapeControls() const
const backgroundMeshDecomposition & decomposition() const
static const complex min
complex (-VGREAT,-VGREAT)
virtual List< Vb::Point > initialPoints() const
Return the initial points for the conformalVoronoiMesh.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
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))
#define WarningInFunction
Report a warning using Foam::Warning.
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointFrompoint toPoint(const Foam::point &p)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vectorField pointField
pointField is a vectorField.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field< vector > vectorField
Specialisation of Field<T> for vector.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.