SpECTRE
v2025.03.17
|
A FocallyLiftedInnerMap that maps a 3D unit right cylinder to a volume that connects a 2D annulus to a spherical surface. More...
#include <FocallyLiftedFlatSide.hpp>
Public Member Functions | |
FlatSide (const std::array< double, 3 > ¢er, const double inner_radius, const double outer_radius) | |
FlatSide (FlatSide &&)=default | |
FlatSide (const FlatSide &)=default | |
FlatSide & | operator= (const FlatSide &)=default |
FlatSide & | operator= (FlatSide &&)=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 FlatSide &lhs, const FlatSide &rhs) |
A FocallyLiftedInnerMap that maps a 3D unit right cylinder to a volume that connects a 2D annulus to 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 \(1\leq \bar{x}^2+\bar{y}^2 \leq 4\). The range of the map has coordinates \((x,y,z)\).
Consider a 2D annulus in 3D space oriented normal to the \(z\) axis. The inner and outer radii of the annulus are \(R_\mathrm{in}\) and \(R_\mathrm{out}\), and the (3D) center of the annulus is \(C^i\). FlatSide
provides the following functions:
forward_map()
maps \((\bar{x},\bar{y},\bar{z}=-1)\) to the interior of the annulus. 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 annulus, which are given by
\begin{align} x_0^0 &= \left(R_\mathrm{in}+(R_\mathrm{out}-R_\mathrm{in}) (\bar{\rho}-1)\right) \frac{\bar{x}}{\bar{\rho}} + C^0, \label{eq:forward_map_x}\\ x_0^1 &= \left(R_\mathrm{in}+(R_\mathrm{out}-R_\mathrm{in}) (\bar{\rho}-1)\right) \frac{\bar{y}}{\bar{\rho}} + C^1,\\ x_0^2 &= C^2 \label{eq:forward_map_z}, \end{align}
where
\begin{align} \bar{\rho} = \sqrt{\bar{x}^2+\bar{y}^2}.\label{eq:rhobar}\end{align}
\(\sigma\) is a function that is zero on the sphere \(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). \label{eq:deriv_sigma} \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. ( \(\ref{eq:forward_map_x}\)– \(\ref{eq:forward_map_z}\)) above yields
\begin{align*} \frac{\partial x_0^0}{\partial \bar{x}} &= R_\mathrm{out}-R_\mathrm{in} + (2 R_\mathrm{in}-R_\mathrm{out}) \frac{\bar{y}^2}{\bar{\rho}^3},\\ \frac{\partial x_0^0}{\partial \bar{y}} &= -(2 R_\mathrm{in}-R_\mathrm{out}) \frac{\bar{x}\bar{y}}{\bar{\rho}^3},\\ \frac{\partial x_0^1}{\partial \bar{x}} &= -(2 R_\mathrm{in}-R_\mathrm{out}) \frac{\bar{x}\bar{y}}{\bar{\rho}^3},\\ \frac{\partial x_0^1}{\partial \bar{y}} &= R_\mathrm{out}-R_\mathrm{in} + (2 R_\mathrm{in}-R_\mathrm{out}) \frac{\bar{x}^2}{\bar{\rho}^3},\\ \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.
Let
\begin{align} \rho = \sqrt{(x_0^0-C^0)^2+(x_0^1-C^1)^2}. \label{eq:rho} \end{align}
Then
\begin{align} \bar{x} &= \frac{x_0^0-C^0}{\rho} \frac{\rho+R_\mathrm{out}-2 R_\mathrm{in}}{R_\mathrm{out}-R_\mathrm{in}},\\ \bar{y} &= \frac{x_0^1-C^1}{\rho} \frac{\rho+R_\mathrm{out}-2 R_\mathrm{in}}{R_\mathrm{out}-R_\mathrm{in}},\\ \bar{z} &= 2\sigma - 1. \end{align}
Note that \(\rho\) in Eq. ( \(\ref{eq:rho}\)) can be written
\begin{align} \rho = R_\mathrm{in}+(R_\mathrm{out}-R_\mathrm{in})(\bar{\rho}-1), \label{eq:rho_from_rhobar} \end{align}
where \(\bar{\rho}\) is given by Eq. ( \(\ref{eq:rhobar}\)).
If \(\bar{z}\) is outside the range \([-1,1]\) or if \(\bar{x}^2+\bar{y}^2\) is less than 1 or greater than 4 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}
If \(\tilde{\lambda}\) is less than unity (indicating that the supplied point is outside the range of the map), then a default-constructed std::optional<double>
is returned.
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_\mathrm{out}-R_\mathrm{in}} + \frac{\bar{y}^2}{\bar{\rho}^2\rho} \frac{R_\mathrm{out}-2 R_\mathrm{in}}{R_\mathrm{out}-R_\mathrm{in}},\\ \frac{\partial \bar{x}}{\partial x_0^1} &= - \frac{\bar{x}\bar{y}}{\bar{\rho}^2\rho} \frac{R_\mathrm{out}-2 R_\mathrm{in}}{R_\mathrm{out}-R_\mathrm{in}},\\ \frac{\partial \bar{y}}{\partial x_0^1} &= \frac{1}{R_\mathrm{out}-R_\mathrm{in}} + \frac{\bar{x}^2}{\bar{\rho}^2\rho} \frac{R_\mathrm{out}-2 R_\mathrm{in}}{R_\mathrm{out}-R_\mathrm{in}},\\ \frac{\partial \bar{y}}{\partial x_0^0} &= - \frac{\bar{x}\bar{y}}{\bar{\rho}^2\rho} \frac{R_\mathrm{out}-2 R_\mathrm{in}}{R_\mathrm{out}-R_\mathrm{in}}, \end{align}
where \(\rho\) is computed from Eq. ( \(\ref{eq:rho_from_rhobar}\)).
dxbar_dsigma
returns \(\partial \bar{x}^i/\partial \sigma\), where \(x_0^i\) is held fixed.
From Eq. ( \(\ref{eq:deriv_sigma}\)) we have
\begin{align} \frac{\partial \bar{x}^i}{\partial \sigma} &= (0,0,2). \end{align}