Skip to content

Commit

Permalink
Call FillTracer every cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Mar 6, 2024
1 parent db3c876 commit 13505df
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/hydro/hydro_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

// Parthenon headers
#include "amr_criteria/refinement_package.hpp"
#include "basic_types.hpp"
#include "bvals/comms/bvals_in_one.hpp"
#include "prolong_restrict/prolong_restrict.hpp"
#include <parthenon/parthenon.hpp>
Expand Down Expand Up @@ -411,6 +412,8 @@ TaskCollection HydroDriver::MakeTaskCollection(BlockList_t &blocks, int stage) {

auto receive =
tl.AddTask(send, &SwarmContainer::Receive, sd.get(), BoundaryCommSubset::all);

auto fill = tl.AddTask(receive, Tracers::FillTracers, mbd0.get(), tm);
}
}

Expand Down
7 changes: 0 additions & 7 deletions src/pgen/turbulence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,6 @@ void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin) {
// store state of distribution
auto state_dist = few_modes_ft.GetDistState();
pin->SetString("problem/turbulence", "state_dist", state_dist);

// TODO(pgrete) move this to a more central location in the driver
auto tracer_pkg = pmb->packages.Get("tracers");
if (tracer_pkg->Param<bool>("enabled")) {
auto &mbd = pmb->meshblock_data.Get();
Tracers::FillTracers(mbd.get());
}
}

} // namespace turbulence
4 changes: 3 additions & 1 deletion src/tracers/tracers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "tracers.hpp"
#include "../main.hpp"
#include "basic_types.hpp"
#include "utils/error_checking.hpp"

namespace Tracers {
Expand Down Expand Up @@ -126,7 +127,7 @@ TaskStatus AdvectTracers(MeshBlockData<Real> *mbd, const Real dt) {
* Registered Quantities (in addition to t, x, y, z):
* rho, vel, B
**/
void FillTracers(MeshBlockData<Real> *mbd) {
TaskStatus FillTracers(MeshBlockData<Real> *mbd, parthenon::SimTime &tm) {

auto *pmb = mbd->GetParentPointer();
auto hydro_pkg = pmb->packages.Get("Hydro");
Expand Down Expand Up @@ -184,6 +185,7 @@ void FillTracers(MeshBlockData<Real> *mbd) {
swarm_d.GetNeighborBlockIndex(n, x(n), y(n), z(n), unsed_tmp);
}
});
return TaskStatus::complete;

} // FillTracers

Expand Down
2 changes: 1 addition & 1 deletion src/tracers/tracers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin);

TaskStatus AdvectTracers(MeshBlockData<Real> *mbd, const Real dt);

void FillTracers(MeshBlockData<Real> *rc);
TaskStatus FillTracers(MeshBlockData<Real> *mbd, parthenon::SimTime &tm);

} // namespace Tracers

Expand Down

0 comments on commit 13505df

Please sign in to comment.