SpECTRE
v2025.01.30
|
A FocallyLiftedInnerMap that maps a 3D unit right cylinder to a volume that connects a portion of a plane and a spherical surface. More...
#include <FocallyLiftedFlatEndcap.hpp>
Public Member Functions | |
FlatEndcap (const std::array< double, 3 > ¢er, double radius) | |
FlatEndcap (FlatEndcap &&)=default | |
FlatEndcap (const FlatEndcap &)=default | |
FlatEndcap & | operator= (const FlatEndcap &)=default |
FlatEndcap & | operator= (FlatEndcap &&)=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 () |
Friends | |
bool | operator== (const FlatEndcap &lhs, const FlatEndcap &rhs) |
A FocallyLiftedInnerMap that maps a 3D unit right cylinder to a volume that connects a portion of a plane and a spherical surface.
The domain of the map is a 3D unit right cylinder with coordinates \((\bar{x},\bar{y},\bar{z})\) such that \(-1\leq\bar{z}\leq 1\) and \(\bar{x}^2+\bar{y}^2 \leq 1\). The range of the map has coordinates \((x,y,z)\).
Consider a 2D circle in 3D space that is normal to the \(z\) axis and has (3D) center \(C^i\) and radius \(R\). FlatEndcap
provides the following functions:
forward_map()
maps \((\bar{x},\bar{y},\bar{z}=-1)\) to the interior of the circle. The arguments to forward_map()
are \((\bar{x},\bar{y},\bar{z})\), but \(\bar{z}\) is ignored. forward_map()
returns \(x_0^i\), the 3D coordinates on the circle, which are given by
\begin{align} x_0^0 &= R \bar{x} + C^0,\\ x_0^1 &= R \bar{y} + C^1,\\ x_0^2 &= C^2. \end{align}
\(\sigma\) is a function that is zero on the plane \(x^i=x_0^i\) and unity at \(\bar{z}=+1\) (corresponding to the upper surface of the FocallyLiftedMap). We define
\begin{align} \sigma &= \frac{\bar{z}+1}{2}. \end{align}
deriv_sigma
returns
\begin{align} \frac{\partial \sigma}{\partial \bar{x}^j} &= (0,0,1/2). \end{align}
jacobian
returns \(\partial x_0^k/\partial \bar{x}^j\). The arguments to jacobian
are \((\bar{x},\bar{y},\bar{z})\), but \(\bar{z}\) is ignored.
Differentiating Eqs.(1–3) above yields
\begin{align*} \frac{\partial x_0^0}{\partial \bar{x}} &= R,\\ \frac{\partial x_0^1}{\partial \bar{y}} &= R, \end{align*}
and all other components are zero.
inverse
takes \(x_0^i\) and \(\sigma\) as arguments, and returns \((\bar{x},\bar{y},\bar{z})\), or a default-constructed std::optional<std::array<double, 3>>
if \(x_0^i\) or \(\sigma\) are outside the range of the map. The formula for the inverse is straightforward:
\begin{align} \bar{x} &= \frac{x_0^0-C^0}{R},\\ \bar{y} &= \frac{x_0^1-C^1}{R},\\ \bar{z} &= 2\sigma - 1. \end{align}
If \(\bar{z}\) is outside the range \([-1,1]\) or if \(\bar{x}^2+\bar{y}^2 > 1\) then we return a default-constructed std::optional<std::array<double, 3>>
lambda_tilde
takes as arguments a point \(x^i\) and a projection point \(P^i\), and computes \(\tilde{\lambda}\), the solution to
\begin{align} x_0^i = P^i + (x^i - P^i) \tilde{\lambda}.\end{align}
Since \(x_0^i\) must lie on the plane \(x_0^3=C^3\),
\begin{align} \tilde{\lambda} &= \frac{C^3-P^3}{x^3-P^3}.\end{align}
For FocallyLiftedInnerMaps::FlatEndcap
, \(x^i\) is always between \(P^i\) and \(x_0^i\), so \(\tilde{\lambda}\ge 1\). Therefore a default-constructed std::optional<double>
is returned if \(\tilde{\lambda}\) is less than unity (meaning that \(x^i\) is outside the range of the map).
deriv_lambda_tilde
takes as arguments \(x_0^i\), a projection point \(P^i\), and \(\tilde{\lambda}\), and returns \(\partial \tilde{\lambda}/\partial x^i\). We have
\begin{align} \frac{\partial\tilde{\lambda}}{\partial x^3} = -\frac{C^3-P^3}{(x^3-P^3)^2} = -\frac{\tilde{\lambda}^2}{C^3-P^3}, \end{align}
and other components are zero.
inv_jacobian
returns \(\partial \bar{x}^i/\partial x_0^k\), where \(\sigma\) is held fixed. The arguments to inv_jacobian
are \((\bar{x},\bar{y},\bar{z})\), but \(\bar{z}\) is ignored.
The nonzero components are
\begin{align} \frac{\partial \bar{x}}{\partial x_0^0} &= \frac{1}{R},\\ \frac{\partial \bar{y}}{\partial x_0^1} &= \frac{1}{R}. \end{align}
dxbar_dsigma
returns \(\partial \bar{x}^i/\partial \sigma\), where \(x_0^i\) is held fixed.
From Eq. (6) we have
\begin{align} \frac{\partial \bar{x}^i}{\partial \sigma} &= (0,0,2). \end{align}