libMesh
|
This class defines a sphere.
More...
#include <sphere.h>
Public Member Functions | |
Sphere () | |
Dummy Constructor. More... | |
Sphere (const Point &c, const Real r) | |
Constructs a sphere of radius r centered at c. More... | |
Sphere (const Point &, const Point &, const Point &, const Point &) | |
Constructs a sphere connecting four points. More... | |
Sphere (const Sphere &other_sphere) | |
Copy-constructor. More... | |
~Sphere () | |
Destructor. More... | |
void | create_from_center_radius (const Point &c, const Real r) |
Defines a sphere of radius r centered at c. More... | |
bool | intersects (const Sphere &other_sphere) const |
Real | distance (const Sphere &other_sphere) const |
virtual bool | above_surface (const Point &p) const override |
virtual bool | below_surface (const Point &p) const override |
virtual bool | on_surface (const Point &p) const override |
virtual Point | closest_point (const Point &p) const override |
virtual Point | unit_normal (const Point &p) const override |
Real | radius () const |
Real & | radius () |
const Point & | center () const |
Point & | center () |
virtual Point | surface_coords (const Point &cart) const override |
virtual Point | world_coords (const Point &sph) const override |
Private Attributes | |
Point | _cent |
The center of the sphere. More... | |
Real | _rad |
The radius of the sphere. More... | |
This class defines a sphere.
It also computes coordinate transformations between cartesian \( (x, y, z) \) and spherical \( (r, \theta, \phi) \) coordinates. The spherical coordinates are valid in the ranges:
The coordinates are related as follows: \( \phi \) is the angle in the xy plane starting with 0. from the positive x axis, \( \theta \) is measured against the positive z axis.
* * \ | Z * \theta| * \ | . * \ | . * \ | . * \ | . * \|. * --------------+---------.--------- * /|\ . Y * /phi\ . * / | \ . * / | \ . * /.........\ * / | * X / *
Constructs a sphere of radius r centered at c.
Definition at line 43 of file sphere.C.
References create_from_center_radius().
Constructs a sphere connecting four points.
Definition at line 62 of file sphere.C.
References std::abs(), create_from_center_radius(), libMesh::TypeTensor< T >::det(), libMesh::libmesh_ignore(), libMesh::TensorTools::norm(), libMesh::TypeVector< T >::norm_sq(), and libMesh::Real.
libMesh::Sphere::Sphere | ( | const Sphere & | other_sphere | ) |
Copy-constructor.
Definition at line 53 of file sphere.C.
References center(), create_from_center_radius(), and radius().
|
default |
Destructor.
Does nothing at the moment.
|
overridevirtual |
true
if the point p is above the surface, false otherwise. Implements libMesh::Surface.
Definition at line 143 of file sphere.C.
References center(), libMesh::TypeVector< T >::norm(), and radius().
Referenced by below_surface().
|
overridevirtual |
true
if the point p is below the surface, false otherwise. Implements libMesh::Surface.
Definition at line 158 of file sphere.C.
References above_surface(), and radius().
|
inline |
Definition at line 163 of file sphere.h.
References _cent.
Referenced by above_surface(), closest_point(), create_from_center_radius(), distance(), on_surface(), Sphere(), surface_coords(), unit_normal(), and world_coords().
|
inline |
Implements libMesh::Surface.
Definition at line 184 of file sphere.C.
References center(), radius(), and unit_normal().
Definition at line 131 of file sphere.C.
References center(), libMesh::TensorTools::norm(), radius(), and libMesh::Real.
Referenced by intersects().
bool libMesh::Sphere::intersects | ( | const Sphere & | other_sphere | ) | const |
true
if other_sphere intersects this sphere, false otherwise. Definition at line 124 of file sphere.C.
References distance().
|
overridevirtual |
true
if the point p is on the surface, false otherwise.Implements libMesh::Surface.
Definition at line 167 of file sphere.C.
References std::abs(), center(), libMesh::TypeVector< T >::norm(), and radius().
|
inline |
Definition at line 153 of file sphere.h.
References _rad.
Referenced by above_surface(), below_surface(), closest_point(), create_from_center_radius(), distance(), on_surface(), Sphere(), and unit_normal().
|
inline |
cart
. Reimplemented from libMesh::Surface.
Definition at line 201 of file sphere.h.
References center(), libMesh::libmesh_ignore(), libMesh::TypeVector< T >::norm(), libMesh::pi, libMesh::Real, and std::sqrt().
Implements libMesh::Surface.
Definition at line 201 of file sphere.C.
References center(), radius(), and libMesh::TypeVector< T >::unit().
Referenced by closest_point().
sph
. Reimplemented from libMesh::Surface.
Definition at line 222 of file sphere.h.
References center(), and libMesh::Real.
|
private |
|
private |