SpECTRE
v2024.12.16
|
Time-dependent compression of a finite 3D spherical volume. More...
#include <SphericalCompression.hpp>
Public Member Functions | |
SphericalCompression (std::string function_of_time_name, double min_radius, double max_radius, const std::array< double, 3 > ¢er) | |
template<typename T > | |
std::array< tt::remove_cvref_wrap_t< T >, 3 > | operator() (const std::array< T, 3 > &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, 3 > > | inverse (const std::array< double, 3 > &target_coords, double time, const std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > &functions_of_time) const |
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 >, 3 > | frame_velocity (const std::array< T, 3 > &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 >, 3, Frame::NoFrame > | jacobian (const std::array< T, 3 > &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 >, 3, Frame::NoFrame > | inv_jacobian (const std::array< T, 3 > &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 = 3 |
Friends | |
bool | operator== (const SphericalCompression &lhs, const SphericalCompression &rhs) |
Time-dependent compression of a finite 3D spherical volume.
Let
The mapped coordinates are a continuous function of the unmapped coordinates, but the Jacobians are not continuous at InteriorMap
is true, the map is the one appropriate for InteriorMap
is false, the map is the one appropriate for
The mapped coordinates
where
The frame velocity
where
Differentiating the equations for
and taking the derivatives yields
Inserting
and
into the Jacobian yields
This map finds the inverse Jacobian by first finding the Jacobian and then numerically inverting it.
For
the map will be invertible and nonsingular. For simplicity, here we enforce this condition, even though perhaps the map might be generalized to handle cases that are still invertible but violate this condition. This avoids the need to specially handle the cases
After requiring the above inequality to be satisfied, however, the inverse mapping can be derived as follows. Let
Taking the Euclidean magnitude of both sides and simplifying yields
which implies
Inserting
In the regime
Solving this linear equation for
Inserting the expressions for
then gives
Finally, inserting