boundSphere Class Reference

The smallest sphere enclosing a given set of points. More...

Public Member Functions

 boundSphere ()
 Construct a null/invalid sphere. More...
 
const pointc () const
 Return the centre. More...
 
scalar rSqr () const
 Return the radius squared. More...
 
scalar r () const
 Return the radius. More...
 
bool valid () const
 Return whether this sphere is valid. More...
 
bool contains (const point &p) const
 Return whether this sphere contains a given point. More...
 
void inflate (const scalar s)
 Expand the sphere by the given factor. More...
 
template<class PointList >
Foam::boundSphere::PointUList< PointList > pointUList (const PointList &ps)
 
template<class PointList >
Foam::boundSphere intersect (const PointList &ps, const FixedList< label, 4 > &pis, const label nPs)
 
template<class PointList >
Foam::boundSphere trivial (const PointList &ps, const FixedList< label, 4 > &pis, const label nPs)
 
template<class PointList >
Foam::boundSphere trivial (const PointList &ps, const FixedList< label, 4 > &pis, const label nPs, FixedList< label, 4 > &boundaryPis)
 
template<class PointList >
Foam::boundSphere bruteForce (const PointList &ps)
 
template<class PointList >
Foam::boundSphere bruteForce (const PointList &ps, FixedList< label, 4 > &boundaryPis)
 
template<class PointList >
Foam::boundSphere global (const PointList &ps, const bool strict)
 
template<class PointList >
Foam::boundSphere global (const PointList &ps, randomGenerator &rndGen, const bool strict)
 
template<class PointList >
Foam::boundSphere global (const PointList &ps, FixedList< RemoteData< point >, 4 > &boundaryPis, const bool strict)
 
template<class PointList >
Foam::boundSphere global (const PointList &ps, randomGenerator &rndGen, FixedList< RemoteData< point >, 4 > &boundaryPis, const bool strict)
 

Static Public Member Functions

static boundSphere cr (const point &c, const scalar r)
 Construct given a point and a radius. More...
 
static boundSphere cr (const Tuple2< point, scalar > &cr)
 Construct given a point and a radius. More...
 
static boundSphere crSqr (const point &c, const scalar rSqr)
 Construct given a point and a radius squared. More...
 
static boundSphere crSqr (const Tuple2< point, scalar > &crSqr)
 Construct given a point and a radius squared. More...
 
static bool overlap (const boundSphere &a, const boundSphere &b)
 Return whether two spheres overlap. More...
 
template<class PointList >
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. More...
 
template<class PointList >
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. More...
 
template<class PointList >
static boundSphere trivial (const PointList &ps, const FixedList< label, 4 > &pis, const label nPs, FixedList< label, 4 > &boundaryPis)
 Return the sphere bounding the given set of up to four points. More...
 
template<class PointList >
static boundSphere bruteForce (const PointList &ps)
 Return the sphere bounding the given set of points using an. More...
 
template<class PointList >
static boundSphere bruteForce (const PointList &ps, FixedList< label, 4 > &boundaryPis)
 Return the sphere bounding the given set of points using an. More...
 
template<class PointList >
static boundSphere (const PointList &ps)
 Return the sphere bounding the given set of points using Welzl's. More...
 
template<class PointList >
static boundSphere (const PointList &ps, randomGenerator &rndGen)
 Return the sphere bounding the given set of points using Welzl's. More...
 
template<class PointList >
static boundSphere (const PointList &ps, FixedList< label, 4 > &boundaryPis)
 Return the sphere bounding the given set of points using Welzl's. More...
 
template<class PointList >
static boundSphere (const PointList &ps, randomGenerator &rndGen, FixedList< label, 4 > &boundaryPis)
 Return the sphere bounding the given set of points using Welzl's. More...
 
template<class PointList >
static boundSphere global (const PointList &ps, const bool strict=false)
 Return the sphere bounding the given set of points using Welzl's. More...
 
template<class PointList >
static boundSphere global (const PointList &ps, randomGenerator &rndGen, const bool strict=false)
 Return the sphere bounding the given set of points using Welzl's. More...
 
template<class PointList >
static boundSphere global (const PointList &ps, FixedList< RemoteData< point >, 4 > &boundaryPis, const bool strict=false)
 Return the sphere bounding the given set of points using Welzl's. More...
 
template<class PointList >
static boundSphere global (const PointList &ps, randomGenerator &rndGen, FixedList< RemoteData< point >, 4 > &boundaryPis, const bool strict=false)
 Return the sphere bounding the given set of points using Welzl's. More...
 

Friends

bool operator== (const boundSphere &, const boundSphere &)
 Equality comparison. More...
 
bool operator!= (const boundSphere &, const boundSphere &)
 Inequality comparison. More...
 
Istreamoperator>> (Istream &, boundSphere &)
 Read from stream. More...
 
Ostreamoperator<< (Ostream &, const boundSphere &)
 Write to stream. More...
 

Detailed Description

The smallest sphere enclosing a given set of points.

Source files

Definition at line 62 of file boundSphere.H.

Constructor & Destructor Documentation

◆ boundSphere() [1/5]

boundSphere ( )
inline

Construct a null/invalid sphere.

Definition at line 98 of file boundSphereI.H.

◆ boundSphere() [2/5]

static boundSphere ( const PointList &  ps)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the local sphere containing the points on this processor only.

◆ boundSphere() [3/5]

static boundSphere ( const PointList &  ps,
randomGenerator rndGen 
)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the local sphere containing the points on this processor only.

◆ boundSphere() [4/5]

static boundSphere ( const PointList &  ps,
FixedList< label, 4 > &  boundaryPis 
)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the local sphere containing the points on this processor only.

◆ boundSphere() [5/5]

static boundSphere ( const PointList &  ps,
randomGenerator rndGen,
FixedList< label, 4 > &  boundaryPis 
)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the local sphere containing the points on this processor only.

Member Function Documentation

◆ cr() [1/2]

Foam::boundSphere cr ( const point c,
const scalar  r 
)
inlinestatic

Construct given a point and a radius.

Definition at line 105 of file boundSphereI.H.

References Foam::constant::universal::c, and Foam::sqr().

Here is the call graph for this function:

◆ cr() [2/2]

Foam::boundSphere cr ( const Tuple2< point, scalar > &  cr)
inlinestatic

Construct given a point and a radius.

Definition at line 111 of file boundSphereI.H.

References Tuple2< Type1, Type2 >::first(), Tuple2< Type1, Type2 >::second(), and Foam::sqr().

Here is the call graph for this function:

◆ crSqr() [1/2]

Foam::boundSphere crSqr ( const point c,
const scalar  rSqr 
)
inlinestatic

Construct given a point and a radius squared.

Definition at line 120 of file boundSphereI.H.

References Foam::constant::universal::c.

◆ crSqr() [2/2]

Foam::boundSphere crSqr ( const Tuple2< point, scalar > &  crSqr)
inlinestatic

Construct given a point and a radius squared.

Definition at line 130 of file boundSphereI.H.

References Tuple2< Type1, Type2 >::first(), and Tuple2< Type1, Type2 >::second().

Here is the call graph for this function:

◆ c()

const Foam::point & c ( ) const
inline

Return the centre.

Definition at line 144 of file boundSphereI.H.

Referenced by print::generate().

Here is the caller graph for this function:

◆ rSqr()

Foam::scalar rSqr ( ) const
inline

Return the radius squared.

Definition at line 150 of file boundSphereI.H.

◆ r()

Foam::scalar r ( ) const
inline

Return the radius.

Definition at line 156 of file boundSphereI.H.

References Foam::sqrt().

Referenced by print::generate(), and boundSphere::overlap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valid()

bool valid ( ) const
inline

Return whether this sphere is valid.

Definition at line 162 of file boundSphereI.H.

Referenced by boundSphere::overlap().

Here is the caller graph for this function:

◆ contains()

bool contains ( const point p) const
inline

Return whether this sphere contains a given point.

Definition at line 168 of file boundSphereI.H.

References Foam::magSqr(), p, and Foam::blendedInterfacialModel::valid().

Here is the call graph for this function:

◆ inflate()

void inflate ( const scalar  s)
inline

Expand the sphere by the given factor.

Definition at line 174 of file boundSphereI.H.

References s(), and Foam::sqr().

Here is the call graph for this function:

◆ overlap()

bool overlap ( const boundSphere a,
const boundSphere b 
)
inlinestatic

Return whether two spheres overlap.

Definition at line 182 of file boundSphereI.H.

References b, Foam::magSqr(), boundSphere::r(), Foam::sqr(), and boundSphere::valid().

Referenced by nearby::intersectFaces(), and TriPatchIntersection< SrcPatchType, TgtPatchType >::TriPatchIntersection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intersect() [1/2]

static boundSphere intersect ( const PointList &  ps,
const FixedList< label, 4 > &  pis,
const label  nPs 
)
inlinestatic

Return the sphere intersecting the given set of up to four points.

◆ trivial() [1/4]

static boundSphere trivial ( const PointList &  ps,
const FixedList< label, 4 > &  pis,
const label  nPs 
)
inlinestatic

Return the sphere bounding the given set of up to four points.

Referenced by TriPatchIntersection< SrcPatchType, TgtPatchType >::TriPatchIntersection().

Here is the caller graph for this function:

◆ trivial() [2/4]

static boundSphere trivial ( const PointList &  ps,
const FixedList< label, 4 > &  pis,
const label  nPs,
FixedList< label, 4 > &  boundaryPis 
)
inlinestatic

Return the sphere bounding the given set of up to four points.

◆ bruteForce() [1/4]

static boundSphere bruteForce ( const PointList &  ps)
inlinestatic

Return the sphere bounding the given set of points using an.

inefficient brute-force method

◆ bruteForce() [2/4]

static boundSphere bruteForce ( const PointList &  ps,
FixedList< label, 4 > &  boundaryPis 
)
inlinestatic

Return the sphere bounding the given set of points using an.

inefficient brute-force method

◆ global() [1/8]

static boundSphere global ( const PointList &  ps,
const bool  strict = false 
)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the global sphere containing the points on all processors.

Referenced by print::generate().

Here is the caller graph for this function:

◆ global() [2/8]

static boundSphere global ( const PointList &  ps,
randomGenerator rndGen,
const bool  strict = false 
)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the global sphere containing the points on all processors.

◆ global() [3/8]

static boundSphere global ( const PointList &  ps,
FixedList< RemoteData< point >, 4 > &  boundaryPis,
const bool  strict = false 
)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the global sphere containing the points on all processors.

◆ global() [4/8]

static boundSphere global ( const PointList &  ps,
randomGenerator rndGen,
FixedList< RemoteData< point >, 4 > &  boundaryPis,
const bool  strict = false 
)
inlinestatic

Return the sphere bounding the given set of points using Welzl's.

algorithm. Constructs the global sphere containing the points on all processors.

◆ pointUList()

Foam::boundSphere::PointUList<PointList> pointUList ( const PointList &  ps)
inline

Definition at line 41 of file boundSphereI.H.

◆ intersect() [2/2]

Foam::boundSphere intersect ( const PointList &  ps,
const FixedList< label, 4 > &  pis,
const label  nPs 
)
inline

Definition at line 195 of file boundSphereI.H.

◆ trivial() [3/4]

Foam::boundSphere trivial ( const PointList &  ps,
const FixedList< label, 4 > &  pis,
const label  nPs 
)
inline

Definition at line 207 of file boundSphereI.H.

◆ trivial() [4/4]

Foam::boundSphere trivial ( const PointList &  ps,
const FixedList< label, 4 > &  pis,
const label  nPs,
FixedList< label, 4 > &  boundaryPis 
)
inline

Definition at line 221 of file boundSphereI.H.

◆ bruteForce() [3/4]

Foam::boundSphere bruteForce ( const PointList &  ps)
inline

Definition at line 234 of file boundSphereI.H.

◆ bruteForce() [4/4]

Foam::boundSphere bruteForce ( const PointList &  ps,
FixedList< label, 4 > &  boundaryPis 
)
inline

Definition at line 246 of file boundSphereI.H.

◆ global() [5/8]

Foam::boundSphere global ( const PointList &  ps,
const bool  strict 
)
inline

Definition at line 308 of file boundSphereI.H.

References rndGen().

Here is the call graph for this function:

◆ global() [6/8]

Foam::boundSphere global ( const PointList &  ps,
randomGenerator rndGen,
const bool  strict 
)
inline

Definition at line 322 of file boundSphereI.H.

References rndGen().

Here is the call graph for this function:

◆ global() [7/8]

Foam::boundSphere global ( const PointList &  ps,
FixedList< RemoteData< point >, 4 > &  boundaryPis,
const bool  strict 
)
inline

Definition at line 336 of file boundSphereI.H.

References rndGen().

Here is the call graph for this function:

◆ global() [8/8]

Foam::boundSphere global ( const PointList &  ps,
randomGenerator rndGen,
FixedList< RemoteData< point >, 4 > &  boundaryPis,
const bool  strict 
)
inline

Definition at line 350 of file boundSphereI.H.

References rndGen().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator==

bool operator== ( const boundSphere ,
const boundSphere  
)
friend

Equality comparison.

◆ operator!=

bool operator!= ( const boundSphere ,
const boundSphere  
)
friend

Inequality comparison.

◆ operator>>

Istream& operator>> ( Istream ,
boundSphere  
)
friend

Read from stream.

◆ operator<<

Ostream& operator<< ( Ostream ,
const boundSphere  
)
friend

Write to stream.


The documentation for this class was generated from the following files: