Go to the documentation of this file.
53 #ifndef searchableSphere_H
54 #define searchableSphere_H
68 class searchableSphere
70 public searchableSurface
109 const struct componentOrder order_;
118 inline static componentOrder getOrdering(
const vector&
radii);
126 (
p.x() - origin_.
x()) / radii_.
x(),
127 (
p.y() - origin_.
y()) / radii_.
y(),
128 (
p.z() - origin_.
z()) / radii_.
z()
137 p.x() * radii_.
x() + origin_.
x(),
138 p.y() * radii_.
y() + origin_.
y(),
139 p.z() * radii_.
z() + origin_.
z()
152 const scalar nearestDistSqr
166 searchableSphere(
const searchableSphere&) =
delete;
169 void operator=(
const searchableSphere&) =
delete;
200 const dictionary&
dict
219 scalar
radius() const noexcept
221 return radii_[order_.major];
264 virtual label
size()
const
296 virtual void findNearest
318 virtual void findLineAll
vectorField pointField
pointField is a vectorField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Cmpt & x() const
Access to the vector x component.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
A class for managing temporary objects.
virtual volumeType outsideVolumeType() const
What is type of points outside bounds.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
scalar radius() const noexcept
The radius of the sphere, or major radius of the spheroid.
shapeType
The type of shape.
virtual const wordList & regions() const
Names of regions.
virtual label size() const
Range of local indices that can be returned.
IOobject(const IOobject &)=default
Copy construct.
point surfacePoint(const scalar theta, const scalar phi) const
A point on the sphere at given location.
const Cmpt & z() const
Access to the vector z component.
bool writeData(Ostream &) const
Pure virtual writeData function.
TypeName("searchableSphere")
Runtime type information.
List< word > wordList
A List of words.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
const vector & radii() const noexcept
The radii of the spheroid.
Oblate (major = mezzo > minor)
An enumeration wrapper for classification of a location as being inside/outside of a volume.
enum shapeType shape() const noexcept
The type of shape.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
vector surfaceNormal(const scalar theta, const scalar phi) const
Surface normal on the sphere at given location.
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
virtual void getVolumeType(const pointField &points, List< volumeType > &volType) const
Determine type (inside/outside/mixed) for point.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const =0
Vector< scalar > vector
A scalar version of the templated Vector.
const Cmpt & y() const
Access to the vector y component.
Sphere (all components equal)
Prolate (major > mezzo = minor)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
virtual ~searchableSphere()=default
Destructor.
const point & centre() const noexcept
The centre (origin) of the sphere.
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
virtual tmp< pointField > points() const
Get the points that define the surface.
A bounding box defined in terms of min/max extrema points.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
vector point
Point is a vector.
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
virtual bool hasVolumeType() const
Whether supports volume type (below)
A location outside the volume.
Minimal example by using system/controlDict.functions:
Searching on general spheroid.