SpECTRE
v2024.12.16
|
Translation map defined by
#include <Translation.hpp>
Public Member Functions | |
Translation (std::string function_of_time_name) | |
Translation (std::string function_of_time_name, double inner_radius, double outer_radius) | |
Translation (std::string function_of_time_name, std::unique_ptr< MathFunction< 1, Frame::Inertial > > radial_function, std::array< double, Dim > ¢er) | |
Translation (const Translation< Dim > &Translation_Map) | |
Translation (Translation &&)=default | |
Translation & | operator= (Translation &&)=default |
Translation & | operator= (const Translation &Translation_Map) |
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 |
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::NoFrame > | inv_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::NoFrame > | 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 |
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 Translation< LocalDim > &lhs, const Translation< LocalDim > &rhs) |
Translation map defined by
The map adds a translation to the coordinates
The piecewise translation translates the coordinates
Where
The radial MathFunction translation translates the coordinates
If you only supply a FunctionOfTime to the constructor of this class, the radial function will be set to 1.0 causing a uniform translation for your coordinates. If a FunctionOfTime, MathFunction, and map center are passed in, the radius will be found through
where r is the radius and
The piecewise inverse translates the coordinates
Where
The inverse map also assumes that if
The radial MathFunction inverse translates the coordinates
where
For the piecewise translation, the frame velocity is found through
For the radial MathFunction translation, the frame velocity is found through
where
For the piecewise translation, the jacobian is computed based on what region the coordinates
otherwise, it will return the identity matrix.
For the radial MathFunction translation, the jacobian is computed through the first derivative when the radius is bigger than 1.e-13:
Where
At a radius smaller than 1e-13, we ASSERT that the radial MathFunction is smooth
The inverse jacobian is computed numerically by inverting the jacobian.