Skip to content

Commit

Permalink
Take single time step with RK3
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois Foucart committed Nov 19, 2024
1 parent d93d83e commit 66db57e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,20 @@ struct EvolutionMetavars {
tmpl::at<typename factory_creation::factory_classes, Event>>>>;

using step_actions = tmpl::flatten<tmpl::list<
Particles::MonteCarlo::Actions::SendDataForMcCommunication<
volume_dim,
// No local time stepping
false, Particles::MonteCarlo::CommunicationStep::PreStep>,
Particles::MonteCarlo::Actions::ReceiveDataForMcCommunication<
volume_dim, Particles::MonteCarlo::CommunicationStep::PreStep>,
// Actions::RecordTimeStepperData<system>,
// Particles::MonteCarlo::Actions::SendDataForMcCommunication<
// volume_dim,
// No local time stepping
// false, Particles::MonteCarlo::CommunicationStep::PreStep>,
// Particles::MonteCarlo::Actions::ReceiveDataForMcCommunication<
// volume_dim, Particles::MonteCarlo::CommunicationStep::PreStep>,
Particles::MonteCarlo::Actions::TakeTimeStep<EnergyBins, NeutrinoSpecies>,
Particles::MonteCarlo::Actions::SendDataForMcCommunication<
volume_dim,
// No local time stepping
false, Particles::MonteCarlo::CommunicationStep::PostStep>,
Particles::MonteCarlo::Actions::ReceiveDataForMcCommunication<
volume_dim, Particles::MonteCarlo::CommunicationStep::PostStep>,
// Particles::MonteCarlo::Actions::SendDataForMcCommunication<
// volume_dim,
// No local time stepping
// false, Particles::MonteCarlo::CommunicationStep::PostStep>,
// Particles::MonteCarlo::Actions::ReceiveDataForMcCommunication<
// volume_dim, Particles::MonteCarlo::CommunicationStep::PostStep>,
// Actions::RecordTimeStepperData<system>,
// evolution::Actions::RunEventsAndDenseTriggers<tmpl::list<>>,
Actions::CleanHistory<system, false>>>;
Expand All @@ -201,7 +202,9 @@ struct EvolutionMetavars {
using initialization_actions = tmpl::list<
Initialization::Actions::InitializeItems<
Initialization::TimeStepping<EvolutionMetavars, TimeStepperBase>,
evolution::dg::Initialization::Domain<volume_dim>>,
evolution::dg::Initialization::Domain<volume_dim> //,
// Initialization::TimeStepperHistory<EvolutionMetavars>
>,
Initialization::Actions::AddSimpleTags<
evolution::dg::BackgroundGrVars<system, EvolutionMetavars, true>>,
evolution::dg::subcell::Actions::SetSubcellGrid<volume_dim, system,
Expand All @@ -224,7 +227,6 @@ struct EvolutionMetavars {
tmpl::list<
Parallel::PhaseActions<Parallel::Phase::Initialization,
initialization_actions>,
//,
// Parallel::PhaseActions<
// Parallel::Phase::InitializeTimeStepperHistory,
// SelfStart::self_start_procedure<step_actions, system>>,
Expand All @@ -235,9 +237,27 @@ struct EvolutionMetavars {

Parallel::PhaseActions<
Parallel::Phase::Evolve,
tmpl::list<Particles::MonteCarlo::Actions::TakeTimeStep<
EnergyBins, NeutrinoSpecies>,
Parallel::Actions::TerminatePhase>>
tmpl::list<
Actions::AdvanceTime, Actions::AdvanceTime,
Actions::AdvanceTime,
Particles::MonteCarlo::Actions::SendDataForMcCommunication<
volume_dim,
// No local time stepping
false, Particles::MonteCarlo::CommunicationStep::PreStep>,
Particles::MonteCarlo::Actions::ReceiveDataForMcCommunication<
volume_dim,
Particles::MonteCarlo::CommunicationStep::PreStep>,
Particles::MonteCarlo::Actions::TakeTimeStep<EnergyBins,
NeutrinoSpecies>,
Particles::MonteCarlo::Actions::SendDataForMcCommunication<
volume_dim,
// No local time stepping
false,
Particles::MonteCarlo::CommunicationStep::PostStep>,
Particles::MonteCarlo::Actions::ReceiveDataForMcCommunication<
volume_dim,
Particles::MonteCarlo::CommunicationStep::PostStep>,
Parallel::Actions::TerminatePhase>>
// tmpl::list<evolution::Actions::RunEventsAndTriggers,
// Actions::ChangeSlabSize, //step_actions,
// Actions::AdvanceTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "DataStructures/DataBox/DataBox.hpp"
#include "Domain/Tags.hpp"
#include "Evolution/Initialization/InitialData.hpp"
#include "Evolution/Particles/MonteCarlo/GhostZoneCommunicationTags.hpp"
#include "Evolution/Particles/MonteCarlo/MortarData.hpp"
#include "Evolution/Particles/MonteCarlo/Packet.hpp"
#include "Evolution/Particles/MonteCarlo/Tags.hpp"
Expand Down Expand Up @@ -51,6 +52,7 @@ namespace Initialization::Actions {
/// * Particles::MonteCarlo::Tags::CellLightCrossingTime<DataVector>
/// * Background hydro variables
/// * Particles::MonteCarlo::Tags::MortarDataTag<dim>
/// * Particles::MonteCarlo::Tags::McGhostZoneDataTag<dim>
///
/// - Removes: nothing
/// - Modifies: nothing
Expand All @@ -67,7 +69,8 @@ struct InitializeMCTags {
NeutrinoSpecies>,
Particles::MonteCarlo::Tags::CellLightCrossingTime<DataVector>,
hydro_variables_tag,
Particles::MonteCarlo::Tags::MortarDataTag<dim>>;
Particles::MonteCarlo::Tags::MortarDataTag<dim>,
Particles::MonteCarlo::Tags::McGhostZoneDataTag<dim>>;

using compute_tags = tmpl::list<>;

Expand Down Expand Up @@ -142,6 +145,13 @@ struct InitializeMCTags {
tmpl::list<Particles::MonteCarlo::Tags::MortarDataTag<dim>>>(
make_not_null(&box), std::move(mortar_data));

using GhostZoneData =
typename Particles::MonteCarlo::Tags::McGhostZoneDataTag<dim>::type;
GhostZoneData ghost_zone_data{};
Initialization::mutate_assign<
tmpl::list<Particles::MonteCarlo::Tags::McGhostZoneDataTag<dim>>>(
make_not_null(&box), std::move(ghost_zone_data));

return {Parallel::AlgorithmExecution::Continue, std::nullopt};
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ struct TimeStepMutator {
const size_t num_ghost_zones = 1;
// Get information stored in various databox containers in
// the format expected by take_time_step_on_element
const double start_time = 0.0; // current_step_id.step_time().value();
const double end_time = 0.1; // next_step_id.step_time().value();
const double start_time = current_step_id.step_time().value();
const double end_time = next_step_id.step_time().value();
Scalar<DataVector> det_jacobian_logical_to_inertial(lapse);
get(det_jacobian_logical_to_inertial) =
1.0 / get(det_inverse_jacobian_logical_to_inertial);
Expand Down
8 changes: 4 additions & 4 deletions src/Evolution/Particles/MonteCarlo/GhostZoneCommunication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ struct ReceiveDataForMcCommunication {
const DataVector& received_data_direction =
received_data[directional_element_id]
.ghost_zone_hydro_variables;
REQUIRE(received_data[directional_element_id]
.packets_entering_this_element == std::nullopt);
// REQUIRE(received_data[directional_element_id]
// .packets_entering_this_element == std::nullopt);
if (mortar_data->rest_mass_density[directional_element_id] ==
std::nullopt) {
continue;
Expand Down Expand Up @@ -368,8 +368,8 @@ struct ReceiveDataForMcCommunication {
received_data[directional_element_id]
.packets_entering_this_element;
// Temporary: currently no data for coupling to the fluid
REQUIRE(received_data[directional_element_id]
.ghost_zone_hydro_variables.size() == 0);
// REQUIRE(received_data[directional_element_id]
// .ghost_zone_hydro_variables.size() == 0);
if (received_data_packets == std::nullopt) {
continue;
} else {
Expand Down

0 comments on commit 66db57e

Please sign in to comment.