2626KOKKOS_FUNCTION
2727unsigned int get_no_decomposition_bounding_gridbox (const CartesianMaps &gbxmaps,
2828 const unsigned int gbxindex, double &coord3,
29- double &coord1, double &coord2);
29+ double &coord1, double &coord2, double &radius );
3030
3131/* on host, throws error if maps are not all
3232the same size, else returns size of maps */
@@ -70,7 +70,8 @@ size_t CartesianMaps::local_to_global_gridbox_index(unsigned int local_gridbox_i
7070// TODO(ALL) make domain_decomp call compatible with GPUs and then remove comm_size guard
7171KOKKOS_FUNCTION
7272unsigned int CartesianMaps::get_local_bounding_gridbox (const unsigned int gbxindex, double &coord3,
73- double &coord1, double &coord2) const {
73+ double &coord1, double &coord2,
74+ double &radius) const {
7475 if (is_decomp) {
7576 auto coordinates = std::array<double , 3 >{coord3, coord1, coord2};
7677 const auto idx = domain_decomposition.get_local_bounding_gridbox (coordinates);
@@ -79,7 +80,7 @@ unsigned int CartesianMaps::get_local_bounding_gridbox(const unsigned int gbxind
7980 coord2 = coordinates[2 ];
8081 return idx;
8182 }
82- return get_no_decomposition_bounding_gridbox (*this , gbxindex, coord3, coord1, coord2);
83+ return get_no_decomposition_bounding_gridbox (*this , gbxindex, coord3, coord1, coord2, radius );
8384}
8485
8586/* returns flag to keep idx the same (flag = 0) or
@@ -264,14 +265,17 @@ if flag = 2 idx updated to forwards neighbour gbxindex.
264265_Note:_ backwards/forwards functions may change the
265266superdroplet's coords e.g. if it leaves the domain. */
266267KOKKOS_FUNCTION
267- unsigned int change_if_coord3nghbr (const CartesianMaps &gbxmaps, unsigned int idx, double &coord3) {
268+ unsigned int change_if_coord3nghbr (const CartesianMaps &gbxmaps, unsigned int idx, double &coord3,
269+ double &radius) {
268270 const auto flag = flag_sdgbxindex (idx, gbxmaps.coord3bounds (idx), coord3); // !=0 idx shld change
269271 switch (flag) {
270272 case 1 :
271273 idx = change_to_backwards_coord3nghbr (idx, gbxmaps, coord3);
274+ radius = kid_reinitialise_radius (radius);
272275 break ;
273276 case 2 :
274277 idx = change_to_forwards_coord3nghbr (idx, gbxmaps, coord3);
278+ radius = kid_reinitialise_radius (radius);
275279 break ;
276280 }
277281 return idx;
@@ -280,8 +284,8 @@ unsigned int change_if_coord3nghbr(const CartesianMaps &gbxmaps, unsigned int id
280284KOKKOS_FUNCTION
281285unsigned int get_no_decomposition_bounding_gridbox (const CartesianMaps &gbxmaps,
282286 const unsigned int gbxindex, double &coord3,
283- double &coord1, double &coord2) {
284- auto idx = (unsigned int )change_if_coord3nghbr (gbxmaps, gbxindex, coord3);
287+ double &coord1, double &coord2, double &radius ) {
288+ auto idx = (unsigned int )change_if_coord3nghbr (gbxmaps, gbxindex, coord3, radius );
285289 idx = change_if_coord1nghbr (gbxmaps, idx, coord1);
286290 idx = change_if_coord2nghbr (gbxmaps, idx, coord2);
287291 return idx;
0 commit comments