SpECTRE  v2024.09.29
ylm::Strahlkorper< Frame > Class Template Reference

A star-shaped surface expanded in spherical harmonics. More...

#include <Strahlkorper.hpp>

Classes

struct  Center
 
struct  LMax
 
struct  Radius
 

Public Types

using options = tmpl::list< LMax, Radius, Center >
 

Public Member Functions

 Strahlkorper (const Strahlkorper &)=default
 
 Strahlkorper (Strahlkorper &&)=default
 
Strahlkorperoperator= (const Strahlkorper &)=default
 
Strahlkorperoperator= (Strahlkorper &&)=default
 
 Strahlkorper (size_t l_max, size_t m_max, double radius, std::array< double, 3 > center)
 Construct a sphere of radius radius with a given center.
 
 Strahlkorper (size_t l_max, double radius, std::array< double, 3 > center)
 Construct a sphere of radius radius, setting m_max=l_max.
 
 Strahlkorper (size_t l_max, size_t m_max, const DataVector &radius_at_collocation_points, std::array< double, 3 > center)
 Construct a Strahlkorper from a DataVector containing the radius at the collocation points. More...
 
 Strahlkorper (size_t l_max, size_t m_max, const ModalVector &spectral_coefficients, std::array< double, 3 > center)
 Construct a Strahlkorper from a ModalVector containing the spectral coefficients. More...
 
template<typename OtherFrame >
 Strahlkorper (const Strahlkorper< OtherFrame > &another_strahlkorper)
 Copies a Strahlkorper from another frame into this Strahlkorper. More...
 
template<typename OtherFrame >
 Strahlkorper (size_t l_max, size_t m_max, const Strahlkorper< OtherFrame > &another_strahlkorper)
 Prolong or restrict another surface to the given l_max and m_max. More...
 
template<typename OtherFrame >
 Strahlkorper (DataVector coefs, const Strahlkorper< OtherFrame > &another_strahlkorper)
 Construct a Strahlkorper from another Strahlkorper, but explicitly specifying the coefficients. Here coefficients are in the same storage scheme as the coefficients() member function returns. More...
 
void pup (PUP::er &p)
 Serialization for Charm++.
 
const DataVectorcoefficients () const
 
DataVectorcoefficients ()
 
const std::array< double, 3 > & expansion_center () const
 Point about which the spectral basis of the Strahlkorper is expanded. The center is given in the frame in which the Strahlkorper is defined. This center must be somewhere inside the Strahlkorper, but in principle it can be anywhere. See physical_center() for a different measure.
 
std::array< double, 3 > physical_center () const
 Approximate physical center (determined by \(l=1\) coefficients) Implementation of Eqs. (38)-(40) in [88].
 
double average_radius () const
 Average radius of the surface (determined by \(Y_{00}\) coefficient)
 
size_t l_max () const
 Maximum \(l\) in \(Y_{lm}\) decomposition.
 
size_t m_max () const
 Maximum \(m\) in \(Y_{lm}\) decomposition.
 
double radius (double theta, double phi) const
 Radius at a particular angle \((\theta,\phi)\). This is inefficient if done at multiple points many times. See ylm::Spherepack for alternative ways of computing this.
 
bool point_is_contained (const std::array< double, 3 > &x) const
 Determine if a point x is contained inside the surface. The point must be given in Cartesian coordinates in the frame in which the Strahlkorper is defined. This is inefficient if done at multiple points many times.
 
const ylm::Spherepackylm_spherepack () const
 

Static Public Attributes

static constexpr Options::String help
 

Detailed Description

template<typename Frame>
class ylm::Strahlkorper< Frame >

A star-shaped surface expanded in spherical harmonics.

Constructor & Destructor Documentation

◆ Strahlkorper() [1/5]

template<typename Frame >
ylm::Strahlkorper< Frame >::Strahlkorper ( size_t  l_max,
size_t  m_max,
const DataVector radius_at_collocation_points,
std::array< double, 3 >  center 
)
explicit

Construct a Strahlkorper from a DataVector containing the radius at the collocation points.

Note
The collocation points of the constructed Strahlkorper will not be exactly radius_at_collocation_points. Instead, the constructed Strahlkorper will match the shape given by radius_at_collocation_points only to order (l_max,m_max). This is because the ylm::Spherepack representation of the Strahlkorper has more collocation points than spectral coefficients. Specifically, radius_at_collocation_points has \((l_{\rm max} + 1) (2 m_{\rm max} + 1)\) degrees of freedom, but because there are only \(m_{\rm max}^2+(l_{\rm max}-m_{\rm max})(2m_{\rm max}+1)\) spectral coefficients, it is not possible to choose spectral coefficients to exactly match all points in radius_at_collocation_points.

◆ Strahlkorper() [2/5]

template<typename Frame >
ylm::Strahlkorper< Frame >::Strahlkorper ( size_t  l_max,
size_t  m_max,
const ModalVector spectral_coefficients,
std::array< double, 3 >  center 
)
explicit

Construct a Strahlkorper from a ModalVector containing the spectral coefficients.

Details

The spectral coefficients should be in the form defined by ylm::Strahlkorper::coefficients() const.

◆ Strahlkorper() [3/5]

template<typename Frame >
template<typename OtherFrame >
ylm::Strahlkorper< Frame >::Strahlkorper ( const Strahlkorper< OtherFrame > &  another_strahlkorper)
inlineexplicit

Copies a Strahlkorper from another frame into this Strahlkorper.

Note
The OtherFrame is ignored.

◆ Strahlkorper() [4/5]

template<typename Frame >
template<typename OtherFrame >
ylm::Strahlkorper< Frame >::Strahlkorper ( size_t  l_max,
size_t  m_max,
const Strahlkorper< OtherFrame > &  another_strahlkorper 
)
inline

Prolong or restrict another surface to the given l_max and m_max.

Note
The OtherFrame is ignored.

◆ Strahlkorper() [5/5]

template<typename Frame >
template<typename OtherFrame >
ylm::Strahlkorper< Frame >::Strahlkorper ( DataVector  coefs,
const Strahlkorper< OtherFrame > &  another_strahlkorper 
)
inline

Construct a Strahlkorper from another Strahlkorper, but explicitly specifying the coefficients. Here coefficients are in the same storage scheme as the coefficients() member function returns.

Note
The OtherFrame is ignored.

Member Function Documentation

◆ coefficients()

template<typename Frame >
const DataVector & ylm::Strahlkorper< Frame >::coefficients ( ) const
inline

These coefficients are stored as SPHEREPACK coefficients. Suppose you represent a set of coefficients \(F^{lm}\) in the expansion

\[ f(\theta,\phi) = \sum_{l=0}^{l_{max}} \sum_{m=-l}^{l} F^{lm} Y^{lm}(\theta,\phi) \]

Here the \(Y^{lm}(\theta,\phi)\) are the usual complex-valued scalar spherical harmonics, so \(F^{lm}\) are also complex-valued. But here we assume that \(f(\theta,\phi)\) is real, so therefore the \(F^{lm}\) obey \(F^{l-m} = (-1)^m (F^{lm})^\star\). So one does not need to store both real and imaginary parts for both positive and negative \(m\), and the stored coefficients can all be real.

So the stored coefficients are:

\begin{align} \text{coefficients()(l,m)} &= (-1)^m \sqrt{\frac{2}{\pi}} \Re(F^{lm}) \quad \text{for} \quad m\ge 0, \\ \text{coefficients()(l,m)} &= (-1)^m \sqrt{\frac{2}{\pi}} \Im(F^{lm}) \quad \text{for} \quad m<0 \end{align}

Member Data Documentation

◆ help

template<typename Frame >
constexpr Options::String ylm::Strahlkorper< Frame >::help
staticconstexpr
Initial value:
{
"A star-shaped surface expressed as an expansion in spherical "
"harmonics.\n"
"Currently only a spherical Strahlkorper can be constructed from\n"
"Options. To do this, specify parameters Center, Radius, and LMax."}

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