Celeritas  0.5.0-56+6b053cd
List of all members
celeritas::SimpleQuadric Class Reference

General quadric expression but with no off-axis terms. More...

#include <SimpleQuadric.hh>

Type aliases

using Intersections = Array< real_type, 2 >
 Surface type identifier.
 
using StorageSpan = Span< real_type const, 7 >
 Surface type identifier.
 
using SpanConstReal3 = Span< real_type const, 3 >
 Surface type identifier.
 
static CELER_CONSTEXPR_FUNCTION SurfaceType surface_type ()
 Surface type identifier.
 
static CELER_CONSTEXPR_FUNCTION bool simple_safety ()
 Safety is not the intersection along surface normal.
 
 SimpleQuadric (Real3 const &abc, Real3 const &def, real_type g)
 Construct with coefficients. More...
 
template<class R >
CELER_FUNCTION SimpleQuadric (Span< R, StorageSpan::extent >)
 Construct from raw data.
 
 SimpleQuadric (Plane const &other) noexcept
 Promote from a plane. More...
 
template<Axis T>
 SimpleQuadric (CylAligned< T > const &other) noexcept
 Promote from an axis-aligned cylinder.
 
 SimpleQuadric (Sphere const &other) noexcept
 Promote from a sphere. More...
 
template<Axis T>
 SimpleQuadric (ConeAligned< T > const &other) noexcept
 Promote from an axis-aligned cone.
 
CELER_FUNCTION SpanConstReal3 second () const
 Second-order terms.
 
CELER_FUNCTION SpanConstReal3 first () const
 First-order terms.
 
CELER_FUNCTION real_type zeroth () const
 Zeroth-order term.
 
CELER_FUNCTION StorageSpan data () const
 Get a view to the data for type-deleted storage.
 
CELER_FUNCTION SignedSense calc_sense (Real3 const &pos) const
 Determine the sense of the position relative to this surface.
 
CELER_FUNCTION Intersections calc_intersections (Real3 const &pos, Real3 const &dir, SurfaceState on_surface) const
 Calculate all possible straight-line intersections with this surface.
 
CELER_FUNCTION Real3 calc_normal (Real3 const &pos) const
 Calculate outward normal at a position.
 

Detailed Description

General quadric expression but with no off-axis terms.

Stored:

\[ ax^2 + by^2 + cz^2 + dx + ey + fz + g = 0 \]

This can represent axis-aligned hyperboloids, ellipsoids, elliptical cylinders, etc.

Constructor & Destructor Documentation

◆ SimpleQuadric() [1/3]

celeritas::SimpleQuadric::SimpleQuadric ( Real3 const &  abc,
Real3 const &  def,
real_type  g 
)

Construct with coefficients.

The quadric is ill-defined if all non-constants are zero.

TODO: normalize so that largest eigenvalue is unity?

◆ SimpleQuadric() [2/3]

celeritas::SimpleQuadric::SimpleQuadric ( Plane const &  other)
explicitnoexcept

Promote from a plane.

Note that the plane is written as \( ax + by + cz - d = 0 \) whereas the simple quadric has a different sign for the constant: \( dx + ey + fz + g = 0 \) .

◆ SimpleQuadric() [3/3]

celeritas::SimpleQuadric::SimpleQuadric ( Sphere const &  other)
explicitnoexcept

Promote from a sphere.

  x^2 + y^2 + z^2
      - 2x_0 - 2y_0 - 2z_0
      + x_0^2 + y_0^2 + z_0^2 - r^2 = 0
* 

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