53#ifndef searchableSphere_H
54#define searchableSphere_H
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;
221 return radii_[order_.major];
264 virtual label
size()
const
296 virtual void findNearest
318 virtual void findLineAll
Minimal example by using system/controlDict.functions:
Defines the attributes of an object for which implicit objectRegistry management is supported,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
const Cmpt & z() const
Access to the vector z component.
const Cmpt & y() const
Access to the vector y component.
const Cmpt & x() const
Access to the vector x component.
A bounding box defined in terms of min/max extrema points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Searching on general spheroid.
virtual label size() const
Range of local indices that can be returned.
TypeName("searchableSphere")
Runtime type information.
const vector & radii() const noexcept
The radii of the spheroid.
bool writeData(Ostream &) const
Pure virtual writeData function.
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
virtual void boundingSpheres(pointField ¢res, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared), one per element.
virtual void getVolumeType(const pointField &points, List< volumeType > &volType) const
Determine type (inside/outside/mixed) for point.
vector surfaceNormal(const scalar theta, const scalar phi) const
Surface normal on the sphere at given location.
enum shapeType shape() const noexcept
The type of shape.
virtual ~searchableSphere()=default
Destructor.
const point & centre() const noexcept
The centre (origin) of the sphere.
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
scalar radius() const noexcept
The radius of the sphere, or major radius of the spheroid.
virtual tmp< pointField > points() const
Get the points that define the surface.
virtual volumeType outsideVolumeType() const
What is type of points outside bounds.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
virtual void getRegion(const List< pointIndexHit > &, labelList ®ion) const
From a set of points and indices get the region.
virtual const wordList & regions() const
Names of regions.
point surfacePoint(const scalar theta, const scalar phi) const
A point on the sphere at given location.
shapeType
The type of shape.
@ PROLATE
Prolate (major > mezzo = minor)
@ GENERAL
General spheroid.
@ SPHERE
Sphere (all components equal)
@ OBLATE
Oblate (major = mezzo > minor)
virtual bool hasVolumeType() const
Whether supports volume type (below)
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const =0
A class for managing temporary objects.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
An enumeration wrapper for classification of a location as being inside/outside of a volume.
@ OUTSIDE
A location outside the volume.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
List< word > wordList
A List of words.
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.