SpECTRE  v2024.04.12
domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition Class Referencefinal

A transition function that falls off as \(f(r) = g(r) / r\) where \(g(r) = ar + b\). More...

#include <SphereTransition.hpp>

Public Member Functions

 SphereTransition (double r_min, double r_max)
 
double operator() (const std::array< double, 3 > &source_coords) const override
 
DataVector operator() (const std::array< DataVector, 3 > &source_coords) const override
 
std::optional< double > original_radius_over_radius (const std::array< double, 3 > &target_coords, double distorted_radius) const override
 
std::array< double, 3 > gradient (const std::array< double, 3 > &source_coords) const override
 
std::array< DataVector, 3 > gradient (const std::array< DataVector, 3 > &source_coords) const override
 
 WRAPPED_PUPable_decl_template (SphereTransition)
 
 SphereTransition (CkMigrateMessage *const msg)
 
void pup (PUP::er &p) override
 
std::unique_ptr< ShapeMapTransitionFunctionget_clone () const override
 
bool operator== (const ShapeMapTransitionFunction &other) const override
 
bool operator!= (const ShapeMapTransitionFunction &other) const override
 
- Public Member Functions inherited from domain::CoordinateMaps::ShapeMapTransitionFunctions::ShapeMapTransitionFunction
virtual std::optional< double > original_radius_over_radius (const std::array< double, 3 > &target_coords, double distorted_radius) const =0
 
virtual bool operator== (const ShapeMapTransitionFunction &other) const =0
 
virtual bool operator!= (const ShapeMapTransitionFunction &other) const =0
 
 WRAPPED_PUPable_abstract (ShapeMapTransitionFunction)
 
 ShapeMapTransitionFunction (CkMigrateMessage *m)
 

Detailed Description

A transition function that falls off as \(f(r) = g(r) / r\) where \(g(r) = ar + b\).

Details

The coefficients \(a\) and \(b\) are chosen so that the function \(g(r) = ar + b\) falls off linearly from 1 at r_min to 0 at r_max. This means that \(f(r)\) falls off from \(1/r_{\text{min}}\) at r_min to 0 at r_max. The coefficients are

\begin{align} a &= \frac{-1}{r_{\text{max}} - r_{\text{min}}} \\ b &= \frac{r_{\text{max}}}{r_{\text{max}} - r_{\text{min}}} = -a r_{\text{max}} \end{align}

Member Function Documentation

◆ get_clone()

std::unique_ptr< ShapeMapTransitionFunction > domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::get_clone ( ) const
inlineoverridevirtual

Evaluate the gradient of the transition function with respect to the Cartesian coordinates x, y and z at the Cartesian coordinates source_coords.

Implements domain::CoordinateMaps::ShapeMapTransitionFunctions::ShapeMapTransitionFunction.

◆ gradient() [1/2]

std::array< DataVector, 3 > domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::gradient ( const std::array< DataVector, 3 > &  source_coords) const
overridevirtual

Evaluate the gradient of the transition function with respect to the Cartesian coordinates x, y and z at the Cartesian coordinates source_coords.

Implements domain::CoordinateMaps::ShapeMapTransitionFunctions::ShapeMapTransitionFunction.

◆ gradient() [2/2]

std::array< double, 3 > domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::gradient ( const std::array< double, 3 > &  source_coords) const
overridevirtual

Evaluate the gradient of the transition function with respect to the Cartesian coordinates x, y and z at the Cartesian coordinates source_coords.

Implements domain::CoordinateMaps::ShapeMapTransitionFunctions::ShapeMapTransitionFunction.

◆ operator!=()

bool domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::operator!= ( const ShapeMapTransitionFunction other) const
overridevirtual

◆ operator()() [1/2]

DataVector domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::operator() ( const std::array< DataVector, 3 > &  source_coords) const
overridevirtual

Evaluate the transition function at the Cartesian coordinates source_coords.

Implements domain::CoordinateMaps::ShapeMapTransitionFunctions::ShapeMapTransitionFunction.

◆ operator()() [2/2]

double domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::operator() ( const std::array< double, 3 > &  source_coords) const
overridevirtual

Evaluate the transition function at the Cartesian coordinates source_coords.

Implements domain::CoordinateMaps::ShapeMapTransitionFunctions::ShapeMapTransitionFunction.

◆ operator==()

bool domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::operator== ( const ShapeMapTransitionFunction other) const
overridevirtual

◆ original_radius_over_radius()

std::optional< double > domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition::original_radius_over_radius ( const std::array< double, 3 > &  target_coords,
double  distorted_radius 
) const
overridevirtual

Given the mapped coordinates target_coords and the corresponding spherical harmonic expansion \(\sum_{lm} \lambda_{lm}(t)Y_{lm}\), distorted_radius, this method evaluates the original radius from the mapped radius by inverting the domain::CoordinateMaps::TimeDependent::Shape map. It also divides by the mapped radius to simplify calculations in the shape map.

Implements domain::CoordinateMaps::ShapeMapTransitionFunctions::ShapeMapTransitionFunction.


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