24 const auto local_subdomain = idx_fine( 0 );
27 local_subdomain, 2 * idx_coarse_bot( 1 ), 2 * idx_coarse_bot( 2 ), 2 * idx_coarse_bot( 3 ) };
29 local_subdomain, 2 * idx_coarse_top( 1 ), 2 * idx_coarse_top( 2 ), 2 * idx_coarse_top( 3 ) };
35 const auto coarse_bot =
36 grid::shell::coords( idx_coarse_bot_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
40 const auto coarse_top =
41 grid::shell::coords( idx_coarse_top_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
45 const auto fine =
grid::shell::coords( idx_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
47 const auto fine_norm = fine.norm();
48 const auto coarse_bot_norm = coarse_bot.norm();
49 const auto coarse_top_norm = coarse_top.norm();
51 const auto nu = ( fine_norm - coarse_bot_norm ) / ( coarse_top_norm - coarse_bot_norm );
53 weights( 0 ) = 1.0 - nu;
112 const auto local_subdomain = idx_fine( 0 );
115 local_subdomain, 2 * idx_coarse_bot_0( 1 ), 2 * idx_coarse_bot_0( 2 ), 2 * idx_coarse_bot_0( 3 ) };
117 local_subdomain, 2 * idx_coarse_bot_1( 1 ), 2 * idx_coarse_bot_1( 2 ), 2 * idx_coarse_bot_1( 3 ) };
119 local_subdomain, 2 * idx_coarse_top_0( 1 ), 2 * idx_coarse_top_0( 2 ), 2 * idx_coarse_top_0( 3 ) };
121 local_subdomain, 2 * idx_coarse_top_1( 1 ), 2 * idx_coarse_top_1( 2 ), 2 * idx_coarse_top_1( 3 ) };
129 const auto coarse_bot_0 =
130 grid::shell::coords( idx_coarse_bot_0_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
131 const auto coarse_bot_1 =
132 grid::shell::coords( idx_coarse_bot_1_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
133 const auto coarse_bot_chord = 0.5 * ( coarse_bot_0 + coarse_bot_1 );
137 const auto coarse_top_0 =
138 grid::shell::coords( idx_coarse_top_0_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
139 const auto coarse_top_1 =
140 grid::shell::coords( idx_coarse_top_1_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
141 const auto coarse_top_chord = 0.5 * ( coarse_top_0 + coarse_top_1 );
145 const auto fine =
grid::shell::coords( idx_fine, subdomain_shell_coords_fine, subdomain_radii_fine );
147 const auto fine_norm = fine.norm();
148 const auto coarse_bot_norm = coarse_bot_chord.norm();
149 const auto coarse_top_norm = coarse_top_chord.norm();
151 const auto nu = ( fine_norm - coarse_bot_norm ) / ( coarse_top_norm - coarse_bot_norm );
153 weights( 0 ) = 0.5 * ( 1.0 - nu );
154 weights( 1 ) = 0.5 * nu;
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.
Definition grid_transfer_linear.hpp:14
dense::Vec< typename CoordsShellType::value_type, 3 > coords(const int subdomain, const int x, const int y, const int r, const CoordsShellType &coords_shell, const CoordsRadiiType &coords_radii)
Definition spherical_shell.hpp:2789