39 template<
class Po
intList>
40 inline Foam::boundSphere::PointUList<PointList>
41 Foam::boundSphere::pointUList(
const PointList& ps)
47 inline void Foam::boundSphere::sortBoundaryPis
52 for (
label iter = 0; iter < 3; ++ iter)
54 for (
label i = 0; i < 3; ++ i)
58 boundaryPis[i] == -1 ?
true
59 : boundaryPis[i + 1] == -1 ?
false
60 : boundaryPis[i] > boundaryPis[i + 1]
63 Swap(boundaryPis[i], boundaryPis[i + 1]);
70 template<
class Remote>
71 inline void Foam::boundSphere::sortBoundaryPis
73 FixedList<Remote, 4>& boundaryPis
76 for (
label iter = 0; iter < 3; ++ iter)
78 for (
label i = 0; i < 3; ++ i)
82 boundaryPis[i].proci == -1 ?
true
83 : boundaryPis[i + 1].proci == -1 ?
false
84 : boundaryPis[i].proci > boundaryPis[i + 1].proci ?
true
85 : boundaryPis[i].proci < boundaryPis[i + 1].proci ?
false
86 : boundaryPis[i].elementi > boundaryPis[i + 1].elementi
89 Swap(boundaryPis[i], boundaryPis[i + 1]);
100 c_(
point::uniform(NaN)),
188 if (!a.
valid() || !
b.valid())
return false;
194 template<
class Po
intList>
202 return implementation::intersect(pointUList(ps), pis, nPs);
206 template<
class Po
intList>
216 return implementation::trivial(pointUList(ps), pis, nPs, boundaryPis);
220 template<
class Po
intList>
229 return implementation::trivial(pointUList(ps), pis, nPs, boundaryPis);
233 template<
class Po
intList>
241 return implementation::bruteForce(pointUList(ps), boundaryPis);
245 template<
class Po
intList>
252 return implementation::bruteForce(pointUList(ps), boundaryPis);
256 template<
class Po
intList>
265 return implementation::local(pointUList(ps),
rndGen, boundaryPis);
269 template<
class Po
intList>
276 FixedList<label, 4> boundaryPis({-1, -1, -1, -1});
278 return implementation::local(pointUList(ps),
rndGen, boundaryPis);
282 template<
class Po
intList>
286 FixedList<label, 4>& boundaryPis
289 randomGenerator
rndGen(0);
291 return implementation::local(pointUList(ps),
rndGen, boundaryPis);
295 template<
class Po
intList>
300 FixedList<label, 4>& boundaryPis
303 return implementation::local(pointUList(ps),
rndGen, boundaryPis);
307 template<
class Po
intList>
317 return implementation::global(pointUList(ps),
rndGen, boundaryPis, strict);
321 template<
class Po
intList>
331 return implementation::global(pointUList(ps),
rndGen, boundaryPis, strict);
335 template<
class Po
intList>
345 return implementation::global(pointUList(ps),
rndGen, boundaryPis, strict);
349 template<
class Po
intList>
358 return implementation::global(pointUList(ps),
rndGen, boundaryPis, strict);
366 return a.c_ ==
b.c_ && a.rSqr_ ==
b.rSqr_;
Struct for keeping processor, element (cell, face, point) and a piece of data. Used for finding minim...
A 2-tuple for storing two objects of different types.
const Type2 & second() const
Return second.
const Type1 & first() const
Return first.
The smallest sphere enclosing a given set of points.
boundSphere()
Construct a null/invalid sphere.
static bool overlap(const boundSphere &a, const boundSphere &b)
Return whether two spheres overlap.
bool valid() const
Return whether this sphere is valid.
scalar r() const
Return the radius.
static boundSphere trivial(const PointList &ps, const FixedList< label, 4 > &pis, const label nPs)
Return the sphere bounding the given set of up to four points.
static boundSphere bruteForce(const PointList &ps)
Return the sphere bounding the given set of points using an.
static boundSphere crSqr(const point &c, const scalar rSqr)
Construct given a point and a radius squared.
void inflate(const scalar s)
Expand the sphere by the given factor.
static boundSphere intersect(const PointList &ps, const FixedList< label, 4 > &pis, const label nPs)
Return the sphere intersecting the given set of up to four points.
scalar rSqr() const
Return the radius squared.
static boundSphere cr(const point &c, const scalar r)
Construct given a point and a radius.
const point & c() const
Return the centre.
static boundSphere global(const PointList &ps, const bool strict=false)
Return the sphere bounding the given set of points using Welzl's.
bool contains(const point &p) const
Return whether this sphere contains a given point.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool valid(const PtrList< ModelType > &l)
const dimensionedScalar c
Speed of light in a vacuum.
bool operator!=(const particle &, const particle &)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
vector point
Point is a vector.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
void sqrt(LagrangianPatchField< scalar > &f, const LagrangianPatchField< scalar > &f1)
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
randomGenerator rndGen(653213)