A class for describing discrete 2D mappings from the logical domain to the physical domain.
More...
|
using | BSplineR = typename SplineEvaluator::bsplines_type1 |
| Indicate the bspline type of the first logical dimension.
|
|
using | BSplineTheta = typename SplineEvaluator::bsplines_type2 |
| Indicate the bspline type of the second logical dimension.
|
|
using | cartesian_tag_x = X |
| Indicate the first physical coordinate.
|
|
using | cartesian_tag_y = Y |
| Indicate the second physical coordinate.
|
|
using | curvilinear_tag_r = R |
| Indicate the first logical coordinate.
|
|
using | curvilinear_tag_theta = Theta |
| Indicate the second logical coordinate.
|
|
using | CoordArg = ddc::Coordinate< R, Theta > |
| The type of the argument of the function described by this mapping.
|
|
using | CoordResult = ddc::Coordinate< X, Y > |
| The type of the result of the function described by this mapping.
|
|
|
KOKKOS_FUNCTION | DiscreteToCartesian (SplineType curvilinear_to_x, SplineType curvilinear_to_y, SplineEvaluator const &evaluator, IdxRangeRTheta idx_range_singular_point) |
| Instantiate a DiscreteToCartesian from the coefficients of 2D splines approximating the mapping.
|
|
KOKKOS_FUNCTION ddc::Coordinate< X, Y > | operator() (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const |
| Compute the physical coordinates from the logical coordinates.
|
|
KOKKOS_FUNCTION void | jacobian_matrix (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord, Matrix_2x2 &matrix) const |
| Compute full Jacobian matrix.
|
|
KOKKOS_FUNCTION double | jacobian_11 (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const |
| Compute the (1,1) coefficient of the Jacobian matrix.
|
|
KOKKOS_FUNCTION double | jacobian_12 (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const |
| Compute the (1,2) coefficient of the Jacobian matrix.
|
|
KOKKOS_FUNCTION double | jacobian_21 (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const |
| Compute the (2,1) coefficient of the Jacobian matrix.
|
|
KOKKOS_FUNCTION double | jacobian_22 (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const |
| Compute the (2,2) coefficient of the Jacobian matrix.
|
|
KOKKOS_FUNCTION double | jacobian (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const |
| Compute the Jacobian, the determinant of the Jacobian matrix of the mapping.
|
|
KOKKOS_INLINE_FUNCTION Matrix_2x2 | first_order_jacobian_matrix_r_rtheta (ddc::Coordinate< curvilinear_tag_r, curvilinear_tag_theta > const &coord) const |
| Get the first order expansion of the Jacobian matrix with the theta component divided by r.
|
|
KOKKOS_INLINE_FUNCTION IdxRangeRTheta | idx_range_singular_point () const |
| Get the index range describing the points which should be used to evaluate functions at the central point.
|
|
KOKKOS_INLINE_FUNCTION const ddc::Coordinate< X, Y > | control_point (ddc::DiscreteElement< BSplineR, BSplineTheta > const &el) const |
| Get a control point of the mapping on B-splines.
|
|
template<class
X, class
Y, class SplineEvaluator, class
R = typename SplineEvaluator::continuous_dimension_type1, class
Theta = typename SplineEvaluator::continuous_dimension_type2, class MemorySpace = typename SplineEvaluator::memory_space>
class DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >
A class for describing discrete 2D mappings from the logical domain to the physical domain.
The mapping describe here is only defined on a grid. The DiscreteToCartesian class decomposes the mapping on B-splines to evaluate it on the physical domain.
\( x(r,\theta) = \sum_k c_{x,k} B_k(r,\theta),\)
\( y(r,\theta) = \sum_k c_{y,k} B_k(r,\theta).\)
This mapping could be costly to inverse.
template<class
X , class
Y , class SplineEvaluator , class
R = typename SplineEvaluator::continuous_dimension_type1, class
Theta = typename SplineEvaluator::continuous_dimension_type2, class MemorySpace = typename SplineEvaluator::memory_space>
KOKKOS_FUNCTION DiscreteToCartesian< X, Y, SplineEvaluator, R, Theta, MemorySpace >::DiscreteToCartesian |
( |
SplineType |
curvilinear_to_x, |
|
|
SplineType |
curvilinear_to_y, |
|
|
SplineEvaluator const & |
evaluator, |
|
|
IdxRangeRTheta |
idx_range_singular_point |
|
) |
| |
|
inline |
Instantiate a DiscreteToCartesian from the coefficients of 2D splines approximating the mapping.
A discrete mapping is a mapping whose values are known only at the mesh points of the grid. To interpolate the mapping, we use B-splines. The DiscreteToCartesian mapping is initialized from the coefficients in front of the basis splines which arise when we approximate the functions \( x(r,\theta) \), and \( y(r,\theta) \) (with \( x \) and \( y \) the physical dimensions in the logical domain) with Splines (using SplineBuilder2D). Then to interpolate the mapping, we will evaluate the decomposed functions on B-splines (see DiscreteToCartesian::operator()).
Here, the evaluator is given as input.
- Parameters
-
[in] | curvilinear_to_x | Bsplines coefficients of the first physical dimension in the logical domain. |
[in] | curvilinear_to_y | Bsplines coefficients of the second physical dimension in the logical domain. |
[in] | evaluator | The evaluator used to evaluate the mapping. |
[in] | idx_range_singular_point | The index range describing the points which should be used to evaluate functions at the central point. |
- See also
- SplineBuilder2D
-
DiscreteToCartesian::operator()
-
SplineBoundaryValue
template<class
X , class
Y , class SplineEvaluator , class
R = typename SplineEvaluator::continuous_dimension_type1, class
Theta = typename SplineEvaluator::continuous_dimension_type2, class MemorySpace = typename SplineEvaluator::memory_space>
Compute the (1,1) coefficient of the Jacobian matrix.
For a mapping given by \( \mathcal{F} : (r,\theta)\mapsto (x,y) \), the (1,1) coefficient of the Jacobian matrix is given by \( \frac{\partial x}{\partial r} \). As the mapping is decomposed on B-splines, it means it computes the derivatives of B-splines \( \frac{\partial x}{\partial r} (r,\theta)= \sum_k c_{x,k} \frac{\partial B_k}{\partial r}(r,\theta)\) (the derivatives are implemented in SplineEvaluator2D).
- Parameters
-
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
- Returns
- A double with the value of the (1,1) coefficient of the Jacobian matrix.
- See also
- SplineEvaluator2D
template<class
X , class
Y , class SplineEvaluator , class
R = typename SplineEvaluator::continuous_dimension_type1, class
Theta = typename SplineEvaluator::continuous_dimension_type2, class MemorySpace = typename SplineEvaluator::memory_space>
Compute the (1,2) coefficient of the Jacobian matrix.
For a mapping given by \( \mathcal{F} : (r,\theta)\mapsto (x,y) \), the (1,2) coefficient of the Jacobian matrix is given by \( \frac{\partial x}{\partial \theta} \). As the mapping is decomposed on B-splines, it means it computes \( \frac{\partial x}{\partial \theta}(r,\theta) = \sum_k c_{x,k} \frac{\partial B_k}{\partial \theta}(r,\theta) \) (the derivatives of B-splines are implemented in SplineEvaluator2D).
- Parameters
-
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
- Returns
- A double with the value of the (1,2) coefficient of the Jacobian matrix.
- See also
- SplineEvaluator2D
template<class
X , class
Y , class SplineEvaluator , class
R = typename SplineEvaluator::continuous_dimension_type1, class
Theta = typename SplineEvaluator::continuous_dimension_type2, class MemorySpace = typename SplineEvaluator::memory_space>
Compute the (2,1) coefficient of the Jacobian matrix.
For a mapping given by \( \mathcal{F} : (r,\theta)\mapsto (x,y) \), the (2,1) coefficient of the Jacobian matrix is given by \( \frac{\partial y}{\partial r} \). As the mapping is decomposed on B-splines, it means it computes \( \frac{\partial y}{\partial r}(r,\theta) = \sum_k c_{y,k} \frac{\partial B_k}{\partial r}(r,\theta)\) (the derivatives of B-splines are implemented in SplineEvaluator2D).
- Parameters
-
[in] | coord | The coordinate where we evaluate the Jacobian matrix. . |
- Returns
- A double with the value of the (2,1) coefficient of the Jacobian matrix.
- See also
- SplineEvaluator2D
template<class
X , class
Y , class SplineEvaluator , class
R = typename SplineEvaluator::continuous_dimension_type1, class
Theta = typename SplineEvaluator::continuous_dimension_type2, class MemorySpace = typename SplineEvaluator::memory_space>
Compute the (2,2) coefficient of the Jacobian matrix.
For a mapping given by \( \mathcal{F} : (r,\theta)\mapsto (x,y) \), the (2,2) coefficient of the Jacobian matrix is given by \( \frac{\partial y}{\partial \theta} \). As the mapping is decomposed on B-splines, it means it computes \( \frac{\partial y}{\partial \theta} (r,\theta) = \sum_k c_{y,k} \frac{\partial B_k}{\partial \theta}(r,\theta) \) (the derivatives of B-splines are implemented in SplineEvaluator2D).
- Parameters
-
[in] | coord | The coordinate where we evaluate the Jacobian matrix. |
- Returns
- A double with the value of the (2,2) coefficient of the Jacobian matrix.
- See also
- SplineEvaluator2D
template<class
X , class
Y , class SplineEvaluator , class
R = typename SplineEvaluator::continuous_dimension_type1, class
Theta = typename SplineEvaluator::continuous_dimension_type2, class MemorySpace = typename SplineEvaluator::memory_space>
Get a control point of the mapping on B-splines.
The mapping \( (r,\theta) \mapsto (x,y) \) decomposed on B-splines can be identified by its control points \( \{(c_{x,k}, c_{y,k})\}_{k} \) where \( c_{x,k} \) and \( c_{y,k} \) are the B-splines coefficients:
\( x(r,\theta) = \sum_{k=0}^{N_r\times N_{\theta}-1} c_{x, k} B_k{r,\theta} \),
\( y(r,\theta) = \sum_{k=0}^{N_r\times N_{\theta}-1} c_{y, k} B_k{r,\theta} \),
where \( N_r\times N_{\theta} \) is the number of B-splines.
The control points can be obtained by interpolating the mapping on interpolation points (see GrevilleInterpolationPoints or KnotsAsInterpolationPoints). We can also note that the first control points \( \{(c_{x,k}, c_{y,k})\}_{k=0}^{N_{\theta}} \) are equal to the pole \( (c_{x,k}, c_{y,k}) = (x_0,y_0) \), \( \forall k = 0, ..., N_{\theta}-1 \) where \( x(0,\theta), y(0,\theta) = (x_0,y_0) \) \( \forall \theta \).
- Parameters
-
[in] | el | The number of the control point. |
- Returns
- The el-th control point.
- See also
- GrevilleInterpolationPoints
-
KnotsAsInterpolationPoints