4#include <Kokkos_UnorderedMap.hpp>
44 for (
int i = 0; i < 2; ++i )
46 if ( bcs[i].sbf == sbf )
57 for (
auto& [_sbf, _bcf] : bcs )
70 for (
int i = 0; i < 2; ++i )
72 if ( bcs[i].bcf == bcf )
85 grid::shell::allocate_scalar_grid< ShellBoundaryFlag >(
"mask_data_shell_boundary", domain );
87 auto tmp_data_for_global_subdomain_indices =
88 grid::shell::allocate_scalar_grid< int64_t >(
"tmp_data_for_global_subdomain_indices", domain );
99 Kokkos::MDRangePolicy(
101 { mask_data.extent( 0 ), mask_data.extent( 1 ), mask_data.extent( 2 ), mask_data.extent( 3 ) } ),
102 KOKKOS_LAMBDA(
const int local_subdomain_id,
const int x,
const int y,
const int r ) {
108 for (
const auto& [subdomain_info, data] : domain.
subdomains() )
110 const auto& [local_subdomain_id, neighborhood] = data;
112 if ( subdomain_info.subdomain_r() == 0 )
114 Kokkos::parallel_for(
115 "set_boundary_flags",
116 Kokkos::MDRangePolicy( { 0, 0 }, { mask_data.extent( 1 ), mask_data.extent( 2 ) } ),
117 KOKKOS_LAMBDA(
const int x,
const int y ) {
122 if ( subdomain_info.subdomain_r() == num_radial_subdomains - 1 )
124 Kokkos::parallel_for(
125 "set_boundary_flags",
126 Kokkos::MDRangePolicy( { 0, 0 }, { mask_data.extent( 1 ), mask_data.extent( 2 ) } ),
127 KOKKOS_LAMBDA(
const int x,
const int y ) {
Send and receive buffers for all process-local subdomain boundaries.
Definition communication.hpp:56
Parallel data structure organizing the thick spherical shell metadata for distributed (MPI parallel) ...
Definition spherical_shell.hpp:2498
const std::map< SubdomainInfo, std::tuple< LocalSubdomainIdx, SubdomainNeighborhood > > & subdomains() const
Definition spherical_shell.hpp:2580
const DomainInfo & domain_info() const
Returns a const reference.
Definition spherical_shell.hpp:2577
int num_subdomains_in_radial_direction() const
Definition spherical_shell.hpp:849
Concept for types that behave like bitmask flags.
Definition bit_masking.hpp:17
Definition shell/bit_masks.hpp:8
void set_boundary_condition_flag(BoundaryConditions &bcs, ShellBoundaryFlag sbf, BoundaryConditionFlag bcf)
Set the boundary condition flag that is associated with a location in the shell e....
Definition shell/bit_masks.hpp:55
BoundaryConditionMapping[2] BoundaryConditions
Definition shell/bit_masks.hpp:37
ShellBoundaryFlag
FlagLike that indicates boundary types for the thick spherical shell.
Definition shell/bit_masks.hpp:12
Grid4DDataScalar< ShellBoundaryFlag > setup_boundary_mask_data(const DistributedDomain &domain)
Set up mask data for a distributed shell domain. The mask encodes boundary information for each grid ...
Definition shell/bit_masks.hpp:82
ShellBoundaryFlag get_shell_boundary_flag(const BoundaryConditions bcs, BoundaryConditionFlag bcf)
Retrieve the ShellBoundary flag associated with a certain boundary condition type/flag.
Definition shell/bit_masks.hpp:68
BoundaryConditionFlag get_boundary_condition_flag(const BoundaryConditions bcs, ShellBoundaryFlag sbf)
Retrieve the boundary condition flag that is associated with a location in the shell e....
Definition shell/bit_masks.hpp:42
BoundaryConditionFlag
FlagLike that indicates the type of boundary condition
Definition shell/bit_masks.hpp:25
Kokkos::View< ScalarType ****, Layout > Grid4DDataScalar
Definition grid_types.hpp:25
Definition shell/bit_masks.hpp:32
BoundaryConditionFlag bcf
Definition shell/bit_masks.hpp:34
ShellBoundaryFlag sbf
Definition shell/bit_masks.hpp:33