SpECTRE
v2024.12.16
|
Distorts a distribution of points radially according to a spherical harmonic expansion while preserving angles. More...
#include <Shape.hpp>
Public Types | |
using | FunctionsOfTimeMap = std::unordered_map< std::string, std::unique_ptr< domain::FunctionsOfTime::FunctionOfTime > > |
Public Member Functions | |
Shape (const std::array< double, 3 > ¢er, size_t l_max, size_t m_max, std::unique_ptr< ShapeMapTransitionFunctions::ShapeMapTransitionFunction > transition_func, std::string shape_function_of_time_name, std::optional< std::string > size_function_of_time_name=std::nullopt) | |
Shape (Shape &&)=default | |
Shape & | operator= (Shape &&)=default |
Shape (const Shape &rhs) | |
Shape & | operator= (const Shape &rhs) |
template<typename T > | |
std::array< tt::remove_cvref_wrap_t< T >, 3 > | operator() (const std::array< T, 3 > &source_coords, double time, const FunctionsOfTimeMap &functions_of_time) const |
std::optional< std::array< double, 3 > > | inverse (const std::array< double, 3 > &target_coords, double time, const FunctionsOfTimeMap &functions_of_time) const |
template<typename T > | |
std::array< tt::remove_cvref_wrap_t< T >, 3 > | frame_velocity (const std::array< T, 3 > &source_coords, double time, const FunctionsOfTimeMap &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 FunctionsOfTimeMap &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 FunctionsOfTimeMap &functions_of_time) const |
void | coords_frame_velocity_jacobian (gsl::not_null< std::array< DataVector, 3 > * > source_and_target_coords, gsl::not_null< std::array< DataVector, 3 > * > frame_vel, gsl::not_null< tnsr::Ij< DataVector, 3, Frame::NoFrame > * > jac, double time, const FunctionsOfTimeMap &functions_of_time) const |
An optimized call that computes the target coordinates, frame velocity and jacobian at once to avoid duplicate calculations. More... | |
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 Shape &lhs, const Shape &rhs) |
Distorts a distribution of points radially according to a spherical harmonic expansion while preserving angles.
The shape map distorts the distance
ylm::Spherepack::spectral_size()
number of components. These are in Spherepack order and should be the Spherepack coefficients, not the spherical harmonic coefficients. See the note below. To use this, set the size_function_of_time_name
argument of the constructor to std::nullopt
.size_function_of_time_name
argument of the constructor to the name of the FunctionOfTime that's in the cache. This method is useful if we have control systems because we have a separate control system controlling a separate function of time for the shape_function_of_time_name
argument in the constructor that must always be specified) are not the complex spherical-harmonic coefficients
size_function_of_time_name
argument is given to the constructor, then it is asserted that the Strahlkorper
. This is because you would typically represent the expansion of a strahlkorper as An additional dimensionless domain-dependent transition function
Given a point with cartesian coordinates
The shape map maps the unmapped coordinates
Or written another way
The form in Eq.
The inverse map is given by:
where
For more details, see ShapeMapTransitionFunction::original_radius_over_radius .
The frame velocity
The Jacobian is given by:
where
The inverse Jacobian is computed by numerically inverting the Jacobian.
For future optimization, the interpolation_info
objects calculated in all functions of this class could be cached. Since every element should evaluate the same grid coordinates most time steps, this might greatly decrease computation. Every element has their own clone of the shape map so the caching could be done with member variables. Care must be taken that jacobian
currently calculates the interpolation_info
with an order higher.
void domain::CoordinateMaps::TimeDependent::Shape::coords_frame_velocity_jacobian | ( | gsl::not_null< std::array< DataVector, 3 > * > | source_and_target_coords, |
gsl::not_null< std::array< DataVector, 3 > * > | frame_vel, | ||
gsl::not_null< tnsr::Ij< DataVector, 3, Frame::NoFrame > * > | jac, | ||
double | time, | ||
const FunctionsOfTimeMap & | functions_of_time | ||
) | const |
An optimized call that computes the target coordinates, frame velocity and jacobian at once to avoid duplicate calculations.
The first argument source_and_target_coords
should contain the source coordinates and will be overwritten in place with the target coordinates.