Loading...
Searching...
No Matches
terra::fe::wedge::shell Namespace Reference

Functions

constexpr void prolongation_constant_fine_grid_stencil_offsets_at_coarse_vertex (dense::Vec< int, 3 >(&offsets)[21])
 
template<typename ScalarType >
constexpr ScalarType prolongation_constant_weight (const int x_fine, const int y_fine, const int r_fine, const int x_coarse, const int y_coarse, const int r_coarse)
 
template<typename ScalarType >
constexpr dense::Vec< ScalarType, 2 > prolongation_linear_weights (const dense::Vec< int, 4 > &idx_fine, const dense::Vec< int, 4 > &idx_coarse_bot, const grid::Grid3DDataVec< ScalarType, 3 > &subdomain_shell_coords_fine, const grid::Grid2DDataScalar< ScalarType > subdomain_radii_fine)
 Computes prolongation weights for the spherical shell.
 
template<typename ScalarType >
constexpr dense::Vec< ScalarType, 2 > prolongation_linear_weights (const dense::Vec< int, 4 > &idx_fine, const dense::Vec< int, 4 > &idx_coarse_bot_0, const dense::Vec< int, 4 > &idx_coarse_bot_1, const grid::Grid3DDataVec< ScalarType, 3 > &subdomain_shell_coords_fine, const grid::Grid2DDataScalar< ScalarType > subdomain_radii_fine)
 Computes prolongation weights for the spherical shell.
 

Function Documentation

◆ prolongation_constant_fine_grid_stencil_offsets_at_coarse_vertex()

constexpr void terra::fe::wedge::shell::prolongation_constant_fine_grid_stencil_offsets_at_coarse_vertex ( dense::Vec< int, 3 >(&)  offsets[21])
constexpr

◆ prolongation_constant_weight()

template<typename ScalarType >
constexpr ScalarType terra::fe::wedge::shell::prolongation_constant_weight ( const int  x_fine,
const int  y_fine,
const int  r_fine,
const int  x_coarse,
const int  y_coarse,
const int  r_coarse 
)
constexpr

◆ prolongation_linear_weights() [1/2]

template<typename ScalarType >
constexpr dense::Vec< ScalarType, 2 > terra::fe::wedge::shell::prolongation_linear_weights ( const dense::Vec< int, 4 > &  idx_fine,
const dense::Vec< int, 4 > &  idx_coarse_bot,
const grid::Grid3DDataVec< ScalarType, 3 > &  subdomain_shell_coords_fine,
const grid::Grid2DDataScalar< ScalarType >  subdomain_radii_fine 
)
constexpr

Computes prolongation weights for the spherical shell.

Note
See overload of this function for details.

This covers the (simpler) case that the fine node index and the corresponding coarse grid nodes are radially aligned.

◆ prolongation_linear_weights() [2/2]

template<typename ScalarType >
constexpr dense::Vec< ScalarType, 2 > terra::fe::wedge::shell::prolongation_linear_weights ( const dense::Vec< int, 4 > &  idx_fine,
const dense::Vec< int, 4 > &  idx_coarse_bot_0,
const dense::Vec< int, 4 > &  idx_coarse_bot_1,
const grid::Grid3DDataVec< ScalarType, 3 > &  subdomain_shell_coords_fine,
const grid::Grid2DDataScalar< ScalarType >  subdomain_radii_fine 
)
constexpr

Computes prolongation weights for the spherical shell.

Ensures that affine scalar functions (f(x) = a_1 * x_1 + a_2 * x_2 + a_3 * x_3 + c) are interpolated exactly.

Returns the non-zero columns of the prolongation matrix, i.e., the weights have to be multiplied with corresponding coarse grid values, summed, and written to the fine grid node. Therefore, this function is best used in a loop over the fine grid points.

A fine grid node is either located exactly at a coarse grid node, or between a pair of coarse grid nodes. There are three cases to consider overall:

a) fine grid node is at same position as coarse grid point => weight is 1.0 b) fine grid node is between two radially aligned coarse grid points (the projection of the two coarse grid points onto the unit sphere is equal) => call the other overload of this function c) otherwise => CALL THIS FUNCTION

We can in that last case find four (distinct) coarse grid nodes bot_0, bot_1, top_0, top_1 with top_j and bot_j being aligned on a radial layer for j = 0, 1, such that all these nodes are aligned on a plane that also contains the fine grid node.

(Technically, that fine grid node is located on one facet of a spherical wedge element. We can therefore ignore the contributions from the other two wedge nodes that are not part of that facet).

It is required to specify the two bottom indices of those coarse nodes. The top ones are computed within this function.

Note
Due to the refinement algorithm, negative prolongation weights are possible (and required) since in some cases at the boundary (largely the entire outer boundary) during refinement new nodes are created that are not contained in the "affine" coarse grid mesh.
Parameters
idx_fineindex (local_subdomain_id, x, y, r) of the fine grid node
idx_coarse_bot_0coarse grid index (local_subdomain_id, x_coarse, y_coarse, r_coarse) of one of the nodes at the bottom of the wedge's plane that contains the fine-grid node.
idx_coarse_bot_1coarse grid index (local_subdomain_id, x_coarse, y_coarse, r_coarse) of the other node at the bottom of the wedge's plane that contains the fine-grid node.
subdomain_shell_coords_finethe coords of the nodes on the unit sphere
subdomain_radii_finethe node radii
Returns
(weight_bot, weight_top) to scale the four coarse grid nodes: fine = weight_bot * ( coarse(bot_0) + coarse(bot_1) ) + weight_top * ( coarse(top_0) + coarse(top_1) )