SpECTRE  v2025.01.30
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
domain::CoordinateMaps::ShapeMapTransitionFunctions::SphereTransition Class Referencefinal

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

#include <SphereTransition.hpp>

Public Member Functions

 SphereTransition (double r_min, double r_max, bool reverse=false)
 
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 radial_distortion) const override
 The inverse of the transition function. More...
 
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 radial_distortion) const =0
 The inverse of the transition function. More...
 
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)=ar+b.

Details

The coefficients a and b are chosen so that the function f(r)=ar+b falls off linearly from 1 at r_min to 0 at r_max. The coefficients are

(1)a=1rmaxrmin(2)b=rmaxrmaxrmin=armax

If reverse is set to true, then the function falls off from 0 at r_min to 1 at r_max. To do this, the coefficients are modified as aa and b1b.

The function can be called beyond r_min and r_max. Within r_min the value is 1, and outside r_max the value is 0. This is reversed if reverse is true. However, the gradient function cannot be called with a point beyond r_min and r_max.

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 f(r,θ,ϕ)[0,1] 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 f(r,θ,ϕ)[0,1] 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  radial_distortion 
) const
overridevirtual

The inverse of the transition function.

This method returns r/r~ given the mapped coordinates x~i (target_coords) and the spherical harmonic expansion Σ(t,θ,ϕ)=lmλlm(t)Ylm(θ,ϕ) (radial_distortion). See domain::CoordinateMaps::TimeDependent::Shape for details on how this quantity is used to compute the inverse of the Shape map.

To derive the expression for this inverse, solve Eq. ( ???) for r after substituting f(r,θ,ϕ).

Parameters
target_coordsThe mapped Cartesian coordinates x~i.
radial_distortionThe spherical harmonic expansion Σ(t,θ,ϕ).

Returns: The quantity r/r~.

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


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