SpECTRE
v2025.04.21
|
A reorientable map from the cube to a frustum. More...
#include <Frustum.hpp>
Public Member Functions | |
Frustum (const std::array< std::array< double, 2 >, 4 > &face_vertices, double lower_bound, double upper_bound, OrientationMap< 3 > orientation_of_frustum, bool equiangular_map_at_outer=false, bool equiangular_map_at_inner=false, Distribution zeta_distribution=Distribution::Linear, std::optional< double > distribution_value=std::nullopt, double sphericity=0.0, double transition_phi=0.0, double opening_angle=M_PI_2) | |
Frustum (Frustum &&)=default | |
Frustum (const Frustum &)=default | |
Frustum & | operator= (const Frustum &)=default |
Frustum & | operator= (Frustum &&)=default |
template<typename T > | |
std::array< tt::remove_cvref_wrap_t< T >, 3 > | operator() (const std::array< T, 3 > &source_coords) const |
std::optional< std::array< double, 3 > > | inverse (const std::array< double, 3 > &target_coords) const |
Returns std::nullopt if Frustum (for a Frustum ). 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 > | |
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFrame > | jacobian (const std::array< T, 3 > &source_coords) const |
template<typename T > | |
tnsr::Ij< tt::remove_cvref_wrap_t< T >, 3, Frame::NoFrame > | inv_jacobian (const std::array< T, 3 > &source_coords) const |
void | pup (PUP::er &p) |
bool | is_identity () const |
Static Public Attributes | |
static constexpr size_t | dim = 3 |
Friends | |
bool | operator== (const Frustum &lhs, const Frustum &rhs) |
A reorientable map from the cube to a frustum.
A map from the logical cube to the volume determined by interpolating between two parallel rectangles each perpendicular to the lower_bound
and upper_bound
for the positions of the rectangular bases of the frustum along the face_vertices
:
face_vertices
is {{{{-2.0,3.0}}, {{2.0,5.0}}, {{0.0,1.0}}, {{1.0,3.0}}}}
.In the case where the two rectangles are geometrically similar, the volume formed is a geometric frustum. However, this coordinate map generalizes to rectangles which need not be similar. The user may reorient the frustum by passing an OrientationMap to the constructor. If with_equiangular_map
is true, then this coordinate map applies a tangent function mapping to the logical projective_scale_factor
is set to a quantity other than unity, then this coordinate map applies a rational function mapping to the logical auto_projective_scale_factor
is true
, the user-specified projective_scale_factor
is ignored and an appropriate value for projective_scale_factor
is computed based on the values passed to face_vertices
. See the page on redistributing gridpoints to see more detailed information on equiangular variables and projective scaling.
In terms of the face_vertices
variables, we define the following auxiliary variables:
The full map is then given by:
With Jacobian:
When constructing a Frustum map, it is not immediately obvious what value of
As seen in Cervone's [Cubes and Hypercubes Rotating] (http://www.math.union.edu/~dpvc/math/4D/rotation/welcome.html), there is a special case in which the inverse projection of a trapezoid is not another trapezoid, but a rectangle where the bases are congruent. Most often one will want to use the special value of
where
For the general case one will want to use the value:
This is the value for auto_projective_scale_factor
is true
.
Each of the frustum faces in the frustum map given above are flat, but the upper +z face of the frustum can be bulged out by setting a non-zero value for the sphericity
, where a value of 0.0
corresponds to the usual flat- face, and a value of 1.0
corresponds to a value of fully spherical. Using OrientationMaps allows the user to create a set of frustums that fully cover a spherical surface. The radius of the sphere is determined by the corner of the frustum that is furthest from the origin.
The full map is given by:
where sphericity
, and
The Jacobian is:
where
Using the parameter
The full map is obtained by setting
for the volume map
For
This function is compatible with the ability to bulge out the Frustum; the map and Jacobian remain unchanged, modulo this substitution.
domain::CoordinateMaps::Frustum::Frustum | ( | const std::array< std::array< double, 2 >, 4 > & | face_vertices, |
double | lower_bound, | ||
double | upper_bound, | ||
OrientationMap< 3 > | orientation_of_frustum, | ||
bool | equiangular_map_at_outer = false , |
||
bool | equiangular_map_at_inner = false , |
||
Distribution | zeta_distribution = Distribution::Linear , |
||
std::optional< double > | distribution_value = std::nullopt , |
||
double | sphericity = 0.0 , |
||
double | transition_phi = 0.0 , |
||
double | opening_angle = M_PI_2 |
||
) |
Constructs a frustum.
face_vertices | An array of four 2D vertices that define the (x, y) coordinates of the upper and lower base of the frustum. |
lower_bound | z distance from the origin to the lower base of the frustum. |
upper_bound | z distance from the origin to the upper base of the frustum. |
orientation_of_frustum | The orientation of the frustum in 3D space. |
equiangular_map_at_outer | Determines whether to apply a tangent function mapping to the logical coordinates (true) or not (false) at the larger side of the frustum. |
equiangular_map_at_inner | Determines whether to apply a tangent function mapping to the logical coordinates (true) or not (false) at the smaller side of the frustum. |
zeta_distribution | Whether to apply a linear, logarithmic, or projective mapping to the logical zeta coordinate. |
distribution_value | In the case of a projective map, the projective scale factor, otherwise unused. |
sphericity | Value between 0 and 1 which determines whether the surface of the upper base of the Frustum is flat (value of 0), spherical (value of 1), or somewhere in between. |
transition_phi | Determines whether the equiangular map used conforms to a lower half wedge (value of -1), an upper half wedge (value of +1), or a full wedge (value of 0). |
opening_angle | The opening angle of the wedge the frustum will conform to (have conforming boundaries with). |