diff --git a/src/Evolution/DgSubcell/Actions/ReconstructionCommunication.hpp b/src/Evolution/DgSubcell/Actions/ReconstructionCommunication.hpp index 529a5830a9590..04b0c81fc2136 100644 --- a/src/Evolution/DgSubcell/Actions/ReconstructionCommunication.hpp +++ b/src/Evolution/DgSubcell/Actions/ReconstructionCommunication.hpp @@ -251,18 +251,21 @@ struct SendDataForReconstruction { // // Copy over data since it's already oriented from interpolation // - // hacky solution to remove the negative rho interpolation problem - size_t N = sliced_data_in_direction.size(); - DataVector temp{N}; - for (size_t i = 0; i < N; i++) { - temp[i] = sliced_data_in_direction[i]; - } - for (size_t i = 0; i < 363; i++) { - if (temp[i] < 1e-12) { - temp[i] = 1e-12; - } - } - std::copy(temp.begin(), temp.end(), subcell_data_to_send.begin()); + // hacky solution to remove the negative rho interpolation problem : + // Removed while trying to work on a new solution + // size_t N = sliced_data_in_direction.size(); + // DataVector temp{N}; + // for (size_t i = 0; i < N; i++) { + // temp[i] = sliced_data_in_direction[i]; + // } + // for (size_t i = 0; i < 363; i++) { + // if (temp[i] < 1e-12) { + // temp[i] = 1e-12; + // } + // } + // std::copy(temp.begin(), temp.end(), subcell_data_to_send.begin()); + std::copy(sliced_data_in_direction.begin(), + sliced_data_in_direction.end(), subcell_data_to_send.begin()); // Copy rdmp data to end of subcell_data_to_send std::copy( @@ -309,6 +312,19 @@ template struct ReceivedAndSendDataForReconstruction { using inbox_tags = tmpl::list< evolution::dg::Tags::BoundaryCorrectionAndGhostCellsInbox>; + template + static Parallel::iterable_action_return_t apply( + db::DataBox& box, tuples::TaggedTuple& /*inboxes*/, + Parallel::GlobalCache& cache, + const ArrayIndex& /*array_index*/, const ActionList /*meta*/, + const ParallelComponent* const /*meta*/) { + using flux_variables = typename Metavariables::system::flux_variables; + + // need a conditional to make sure I have received all the data that was + // needed at this stage for interpolation. + } }; /*! * \brief Receive the subcell data from our neighbor, and accumulate the data diff --git a/src/Evolution/DgSubcell/SliceData.cpp b/src/Evolution/DgSubcell/SliceData.cpp index 5bd0b2684337d..ae751a81c82d5 100644 --- a/src/Evolution/DgSubcell/SliceData.cpp +++ b/src/Evolution/DgSubcell/SliceData.cpp @@ -138,61 +138,64 @@ DirectionMap slice_data_impl( subcell_extents); } } - } else { - // We add directions to `interpolated` to mark that we are interpolating - // in this particular direction. The value of the bool is `true` _if_ we - // did FD interpolation and `false` if DG interpolation should be - // done. This allows passing in a DirectionalIdMap of just the neighbors - // that need interpolation but with `std::nullopt` in order to not spend - // resources slicing when the data would be overwritten by DG - // interpolation (cheaper and more accurate). - DirectionMap interpolated{}; - for (const auto& [directional_element_id, interpolant] : - fd_to_neighbor_fd_interpolants) { - if (LIKELY(not interpolant.has_value())) { - // Just to keep track. - interpolated[directional_element_id.direction()] = false; - continue; - } - interpolated[directional_element_id.direction()] = true; - auto result_span = - gsl::make_span(result.at(directional_element_id.direction()).data(), - result.at(directional_element_id.direction()).size() - - additional_buffer); - interpolant.value().interpolate(make_not_null(&result_span), - volume_subcell_vars); - } - // Now copy data for neighbors that are in the same block. - for (size_t component_index = 0; component_index < number_of_components; - ++component_index) { - const size_t component_offset_volume = component_index * num_pts; - for (auto& [direction, sliced_data] : result) { - if (UNLIKELY(interpolated.contains(direction))) { - continue; - } - const size_t component_offset_result = - gsl::at(result_grid_points, direction.dimension()) * - component_index; - std::array lower_bounds = - make_array(static_cast(0)); - std::array upper_bounds = subcell_extents.indices(); - if (direction.side() == Side::Lower) { - gsl::at(upper_bounds, direction.dimension()) = number_of_ghost_points; - } else { - gsl::at(lower_bounds, direction.dimension()) = - gsl::at(upper_bounds, direction.dimension()) - - number_of_ghost_points; - } - // No need to worry about sliced_data including the additional buffer - // because the instantiations of copy_data above never use the - // sliced_data.size(). All indexing is done by the lower/upper bounds - // arguments - copy_data(&sliced_data, volume_subcell_vars, component_offset_result, - component_offset_volume, lower_bounds, upper_bounds, - subcell_extents); - } - } } + // else { + // // We add directions to `interpolated` to mark that we are interpolating + // // in this particular direction. The value of the bool is `true` _if_ we + // // did FD interpolation and `false` if DG interpolation should be + // // done. This allows passing in a DirectionalIdMap of just the neighbors + // // that need interpolation but with `std::nullopt` in order to not spend + // // resources slicing when the data would be overwritten by DG + // // interpolation (cheaper and more accurate). + // DirectionMap interpolated{}; + // for (const auto& [directional_element_id, interpolant] : + // fd_to_neighbor_fd_interpolants) { + // if (LIKELY(not interpolant.has_value())) { + // // Just to keep track. + // interpolated[directional_element_id.direction()] = false; + // continue; + // } + // interpolated[directional_element_id.direction()] = true; + // auto result_span = + // gsl::make_span(result.at(directional_element_id.direction()).data(), + // result.at(directional_element_id.direction()).size() + // - + // additional_buffer); + // interpolant.value().interpolate(make_not_null(&result_span), + // volume_subcell_vars); + // } + // // Now copy data for neighbors that are in the same block. + // for (size_t component_index = 0; component_index < number_of_components; + // ++component_index) { + // const size_t component_offset_volume = component_index * num_pts; + // for (auto& [direction, sliced_data] : result) { + // if (UNLIKELY(interpolated.contains(direction))) { + // continue; + // } + // const size_t component_offset_result = + // gsl::at(result_grid_points, direction.dimension()) * + // component_index; + // std::array lower_bounds = + // make_array(static_cast(0)); + // std::array upper_bounds = subcell_extents.indices(); + // if (direction.side() == Side::Lower) { + // gsl::at(upper_bounds, direction.dimension()) = + // number_of_ghost_points; + // } else { + // gsl::at(lower_bounds, direction.dimension()) = + // gsl::at(upper_bounds, direction.dimension()) - + // number_of_ghost_points; + // } + // // No need to worry about sliced_data including the additional buffer + // // because the instantiations of copy_data above never use the + // // sliced_data.size(). All indexing is done by the lower/upper bounds + // // arguments + // copy_data(&sliced_data, volume_subcell_vars, component_offset_result, + // component_offset_volume, lower_bounds, upper_bounds, + // subcell_extents); + // } + // } + // } return result; }