SpECTRE  v2024.12.16
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
domain::CoordinateMaps::TimeDependent::CubicScale< Dim > Class Template Reference

Maps the radius as r(t)=a(t)ρ+(b(t)a(t))ρ3R2 where ρ is the radius of the source coordinates. More...

#include <CubicScale.hpp>

Public Member Functions

 CubicScale (double outer_boundary, std::string function_of_time_name_a, std::string function_of_time_name_b)
 
template<typename T >
std::array< tt::remove_cvref_wrap_t< T >, Dim > operator() (const std::array< T, Dim > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
std::optional< std::array< double, Dim > > inverse (const std::array< double, Dim > &target_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 Returns std::nullopt if the point is outside the range of the map. The inverse function is only callable with doubles because the inverse might fail if called for a point out of range, and it is unclear what should happen if the inverse were to succeed for some points in a DataVector but fail for other points.
 
template<typename T >
std::array< tt::remove_cvref_wrap_t< T >, Dim > frame_velocity (const std::array< T, Dim > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
template<typename T >
tnsr::Ij< tt::remove_cvref_wrap_t< T >, Dim, Frame::NoFrameinv_jacobian (const std::array< T, Dim > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
template<typename T >
tnsr::Ij< tt::remove_cvref_wrap_t< T >, Dim, Frame::NoFramejacobian (const std::array< T, Dim > &source_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const
 
void pup (PUP::er &p)
 
const std::unordered_set< std::string > & function_of_time_names () const
 

Static Public Member Functions

static bool is_identity ()
 

Static Public Attributes

static constexpr size_t dim = Dim
 

Friends

template<size_t LocalDim>
bool operator== (const CubicScale< LocalDim > &lhs, const CubicScale< LocalDim > &rhs)
 

Detailed Description

template<size_t Dim>
class domain::CoordinateMaps::TimeDependent::CubicScale< Dim >

Maps the radius as r(t)=a(t)ρ+(b(t)a(t))ρ3R2 where ρ is the radius of the source coordinates.

The map scales the radius ρ in the source coordinates ξi^ by a factor a(t), while the coordinates near the outer boundary R, are scaled by a factor b(t). Here a(t) and b(t) are FunctionsOfTime. The target/mapped coordinates are denoted by xi.

The mapped coordinates are given by:

(1)xi=[a+(ba)ρ2R2]ξi^δi^i,

where ξi^ are the source coordinates, a and b are functions of time, ρ is the radius in the source coordinates, and R is the outer boundary.

The inverse map is computed by solving the cubic equation:

(2)(ba)ρ3R2+aρr=0,

which is done by defining q=ρ/R, and solving

(3)q[(ba)q2+a]rR=0.

The source coordinates are obtained using:

(4)ξi^=qRrxi(t)δii^

The Jacobian is given by:

(5)xiξi^=[a+(ba)ρ2R2]δi^i+2(ba)R2ξj^δj^iξk^δk^i^

The inverse Jacobian is given by:

(6)ξi^xi=1[a+(ba)ρ2/R2][δii^2(ba)[aR2+3(ba)ρ2]ξi^ξj^δj^i]

The mesh velocity vgi is given by:

(7)vgi=[dadt+(dbdtdadt)ρ2R2]ξi^δi^i.


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