SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
domain::CoordinateMaps::FocallyLiftedInnerMaps::Side Class Reference

A FocallyLiftedInnerMap that maps a 3D unit right cylindrical shell to a volume that connects portions of two spherical surfaces. More...

#include <FocallyLiftedSide.hpp>

Public Member Functions

 Side (const std::array< double, 3 > &center, const double radius, const double z_lower, const double z_upper)
 
 Side (Side &&)=default
 
 Side (const Side &)=default
 
Sideoperator= (const Side &)=default
 
Sideoperator= (Side &&)=default
 
template<typename T >
void forward_map (const gsl::not_null< std::array< tt::remove_cvref_wrap_t< T >, 3 > * > target_coords, const std::array< T, 3 > &source_coords) const
 
std::optional< std::array< double, 3 > > inverse (const std::array< double, 3 > &target_coords, double sigma_in) const
 
template<typename T >
void jacobian (const gsl::not_null< tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFrame > * > jacobian_out, const std::array< T, 3 > &source_coords) const
 
template<typename T >
void inv_jacobian (const gsl::not_null< tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFrame > * > inv_jacobian_out, const std::array< T, 3 > &source_coords) const
 
template<typename T >
void sigma (const gsl::not_null< tt::remove_cvref_wrap_t< T > * > sigma_out, const std::array< T, 3 > &source_coords) const
 
template<typename T >
void deriv_sigma (const gsl::not_null< std::array< tt::remove_cvref_wrap_t< T >, 3 > * > deriv_sigma_out, const std::array< T, 3 > &source_coords) const
 
template<typename T >
void dxbar_dsigma (const gsl::not_null< std::array< tt::remove_cvref_wrap_t< T >, 3 > * > dxbar_dsigma_out, const std::array< T, 3 > &source_coords) const
 
std::optional< double > lambda_tilde (const std::array< double, 3 > &parent_mapped_target_coords, const std::array< double, 3 > &projection_point, bool source_is_between_focus_and_target) const
 
template<typename T >
void deriv_lambda_tilde (const gsl::not_null< std::array< tt::remove_cvref_wrap_t< T >, 3 > * > deriv_lambda_tilde_out, const std::array< T, 3 > &target_coords, const T &lambda_tilde, const std::array< double, 3 > &projection_point) const
 
void pup (PUP::er &p)
 

Static Public Member Functions

static bool is_identity ()
 

Static Public Attributes

static constexpr size_t dim = 3
 

Friends

bool operator== (const Side &lhs, const Side &rhs)
 

Detailed Description

A FocallyLiftedInnerMap that maps a 3D unit right cylindrical shell to a volume that connects portions of two spherical surfaces.

Details

The domain of the map is a 3D unit right cylinder with coordinates (x¯,y¯,z¯) such that 1z¯1 and 1x¯2+y¯24. The range of the map has coordinates (x,y,z).

Consider a sphere with center Ci and radius R that is intersected by two planes normal to the z axis located at z=zL and z=zU, with zL<zU. Side provides the following functions:

forward_map()

forward_map() maps (x¯,y¯,z¯) to a point on the inner surface x¯2+y¯2=1 by dividing x¯ and y¯ by (1+σ), where σ is the function given by Eq. (7) below. Then it maps that point to a point on the portion of the sphere with zLzzU. forward_map() returns x0i, the 3D coordinates on that sphere, which are given by

(1)x00=Rsinθx¯1+σ+C0,(2)x01=Rsinθy¯1+σ+C1,(3)x02=Rcosθ+C2.

Here

(4)θ=θmax+(θminθmax)z¯+12,

where

(5)cos(θmax)=(zLC2)/R,(6)cos(θmin)=(zUC2)/R.

Note that θ decreases with increasing z¯, which is the usual convention for a polar angle but might otherwise cause confusion.

sigma

σ is a function that is zero on the sphere xi=x0i and unity at x¯2+y¯2=4 (corresponding to the upper surface of the FocallyLiftedMap). We define

(7)σ=x¯2+y¯21.

deriv_sigma

deriv_sigma returns

(8)σx¯j=(x¯1+σ,y¯1+σ,0).

jacobian

jacobian returns x0k/x¯j. The arguments to jacobian are (x¯,y¯,z¯). Differentiating Eqs.(1–4) above yields

x00x¯=Rsinθy¯2(1+σ)3,x00y¯=Rsinθx¯y¯(1+σ)3,x00z¯=Rcosθθminθmax2(1+σ)x¯,x01x¯=Rsinθx¯y¯(1+σ)3,x01y¯=Rsinθx¯2(1+σ)3,x01z¯=Rcosθθminθmax2(1+σ)y¯,x02x¯=0,x02y¯=0,x02z¯=Rsinθθminθmax2.

inverse

inverse takes x0i and σ as arguments, and returns (x¯,y¯,z¯), or a default-constructed std::optional<std::array<double, 3>> if x0i or σ are outside the range of the map.

If σ is outside the range [0,1] then we return a default-constructed std::optional<std::array<double, 3>>.

To get z¯ we invert Eq. (4):

(9)z¯=2acos((x02C2)/R)θmaxθminθmax1.

If z¯ is outside the range [1,1] then we return a default-constructed std::optional<std::array<double, 3>>.

To compute x¯ and y¯, we invert Eqs. (1–3) and use σ:

(10)x¯=(x00C0)(1+σ)ρ,(11)y¯=(x01C1)(1+σ)ρ,

where

(12)ρ=(x00C0)2+(x01C1)2.

lambda_tilde

lambda_tilde takes as arguments a point xi and a projection point Pi, and computes λ~, the solution to

(13)x0i=Pi+(xiPi)λ~.

Since x0i must lie on the sphere, λ~ is the solution of the quadratic equation

(14)|Pi+(xiPi)λ~Ci|2R2=0.

In solving the quadratic, we choose the larger root if x2>zP and the smaller root otherwise. We demand that the root is greater than unity. If there is no such root, this means that the point xi is not in the range of the map so we return a default-constructed std::optional<double>.

deriv_lambda_tilde

deriv_lambda_tilde takes as arguments x0i, a projection point Pi, and λ~, and returns λ~/xi. By differentiating Eq. (14), we find

λ~xj=λ~2Cjx0j(x0iPi)(x0iCi)(15)=λ~2Cjx0j|x0iPi|2+(x0iPi)(PiCi).

inv_jacobian

inv_jacobian returns x¯i/x0k, where σ is held fixed. The arguments to inv_jacobian are (x¯,y¯,z¯).

Note from Eqs. (9–12) that x¯ and y¯ depend only on x00 and x01 but not on x02.

By differentiating Eqs. (9–12), we find

x¯x00=y¯2(1+σ)ρ,x¯x01=x¯y¯(1+σ)ρ,x¯x02=0,y¯x00=x¯y¯(1+σ)ρ,y¯x01=x¯2(1+σ)ρ,y¯x02=0,z¯x00=0,z¯x01=0,z¯x02=2ρ(θminθmax),

where

ρ=Rsinθ=Rsin(θmax+(θminθmax)z¯+12),

which is also equal to the quantity in Eq. (12).

dxbar_dsigma

dxbar_dsigma returns x¯i/σ, where x0i is held fixed.

From Eqs. (10) and (11) we have

(16)x¯iσ=(x¯x¯2+y¯2,y¯x¯2+y¯2,0).


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