Skip to content

Commit

Permalink
Added brief instructions for new particle field
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Mar 6, 2024
1 parent 13505df commit 0e86320
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tracers/tracers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "../main.hpp"
#include "basic_types.hpp"
#include "utils/error_checking.hpp"
#include <cmath>

namespace Tracers {
using namespace parthenon::package::prelude;
Expand Down Expand Up @@ -78,6 +79,9 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin) {
tracer_pkg->AddSwarmValue("B_z", swarm_name, real_swarmvalue_metadata);
}

// MARCUS AND EVAN LOOK
tracer_pkg->AddSwarmValue("lnrho_0", swarm_name, real_swarmvalue_metadata);

return tracer_pkg;
} // Initialize

Expand Down Expand Up @@ -155,6 +159,9 @@ TaskStatus FillTracers(MeshBlockData<Real> *mbd, parthenon::SimTime &tm) {
}
auto &rho = swarm->Get<Real>("rho").Get();
auto &pressure = swarm->Get<Real>("pressure").Get();
// MARCUS AND EVAN LOOK
const auto current_cycle = tm.ncycle;
auto &lnrho_0 = swarm->Get<Real>("lnrho_0").Get();

// Get hydro/mhd fluid vars
const auto &prim_pack = mbd->PackVariables(std::vector<std::string>{"prim"});
Expand All @@ -181,6 +188,11 @@ TaskStatus FillTracers(MeshBlockData<Real> *mbd, parthenon::SimTime &tm) {
B_z(n) = prim_pack(IB3, k, j, i);
}

// MARCUS AND EVAN LOOK
if (current_cycle % 1 == 0) {
lnrho_0(n) = Kokkos::log(prim_pack(IDN, k, j, i));
}

bool unsed_tmp = true;
swarm_d.GetNeighborBlockIndex(n, x(n), y(n), z(n), unsed_tmp);
}
Expand Down

0 comments on commit 0e86320

Please sign in to comment.