Skip to content

Commit

Permalink
Merge branch 'pgrete/bump-parth-for-rr' into pgrete/next-w-tracer-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Jul 18, 2024
2 parents bae0ce0 + 3a8fe16 commit 73e59e9
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 15 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,17 @@
### Fixed (not changing behavior/API/variables/...)

### Infrastructure
- [[PR 109]](https://github.com/parthenon-hpc-lab/athenapk/pull/109) Bump Parthenon to latest develop (2024-05-29)
- [[PR 105]](https://github.com/parthenon-hpc-lab/athenapk/pull/105) Bump Parthenon to latest develop (2024-03-13)
- [[PR 84]](https://github.com/parthenon-hpc-lab/athenapk/pull/84) Added `CHANGELOG.md`

### Removed (removing behavior/API/varaibles/...)

### Incompatibilities (i.e. breaking changes)
- [[PR 109]](https://github.com/parthenon-hpc-lab/athenapk/pull/109) Bump Parthenon to latest develop (2024-05-29)
- Changed signature of `UserWorkBeforeOutput` to include `SimTime` as last paramter
- Fixes bitwise idential restarts for AMR simulations (the derefinement counter is now included)
- Order of operations in flux-correction has changed (expect round-off error differences to previous results for AMR sims)
- [[PR 84]](https://github.com/parthenon-hpc-lab/athenapk/pull/84) Bump Parthenon to latest develop (2024-02-15)
- Updated access to block dimension: `pmb->block_size.nx1` -> `pmb->block_size.nx(X1DIR)` (and similarly x2 and x3)
- Update access to mesh size: `pmesh->mesh_size.x1max` -> `pmesh->mesh_size.xmax(X1DIR)` (and similarly x2, x3, and min)
Expand Down
2 changes: 1 addition & 1 deletion docs/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ fixed_mass_rate = 1.0

## SNIA Feedback

Following [Prasad 2020](doi.org/10.1093/mnras/112.2.195), AthenaPK can inject
Following [Prasad 2020](https://doi.org/10.3847/1538-4357/abc33c), AthenaPK can inject
mass and energy from type Ia supernovae following the mass profile of the BCG.
This SNIA feedback can be configured with
```
Expand Down
2 changes: 1 addition & 1 deletion external/parthenon
4 changes: 2 additions & 2 deletions src/hydro/hydro_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ TaskCollection HydroDriver::MakeTaskCollection(BlockList_t &blocks, int stage) {
{
for (auto &pmb : blocks) {
auto &tl = sync_region_tr[0];
auto &sd = pmb->swarm_data.Get();
auto &sd = pmb->meshblock_data.Get()->GetSwarmData();
auto reset_comms =
tl.AddTask(none, &SwarmContainer::ResetCommunication, sd.get());
}
Expand All @@ -727,7 +727,7 @@ TaskCollection HydroDriver::MakeTaskCollection(BlockList_t &blocks, int stage) {
for (int n = 0; n < blocks.size(); n++) {
auto &tl = async_region_tr[n];
auto &pmb = blocks[n];
auto &sd = pmb->swarm_data.Get();
auto &sd = pmb->meshblock_data.Get()->GetSwarmData();
auto &mbd0 = pmb->meshblock_data.Get("base");
auto tracer_advect =
tl.AddTask(none, Tracers::AdvectTracers, mbd0.get(), integrator->dt);
Expand Down
3 changes: 2 additions & 1 deletion src/pgen/cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,10 @@ void InflowWindX2(std::shared_ptr<MeshBlockData<Real>> &mbd, bool coarse) {
const auto Bx_ = Bx;
const auto By_ = By;
const auto Bz_ = Bz;
const bool fine = false;
pmb->par_for_bndry(
"InflowWindX2", nb, IndexDomain::inner_x2, parthenon::TopologicalElement::CC,
coarse, KOKKOS_LAMBDA(const int, const int &k, const int &j, const int &i) {
coarse, fine, KOKKOS_LAMBDA(const int, const int &k, const int &j, const int &i) {
cons(IDN, k, j, i) = rho_wind_;
cons(IM2, k, j, i) = mom_wind_;
cons(IEN, k, j, i) = rhoe_wind_ + 0.5 * mom_wind_ * mom_wind_ / rho_wind_;
Expand Down
3 changes: 2 additions & 1 deletion src/pgen/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,8 @@ void ProblemGenerator(Mesh *pmesh, ParameterInput *pin, MeshData<Real> *md) {
}
}

void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin) {
void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin,
const parthenon::SimTime & /*tm*/) {
// get hydro
auto pkg = pmb->packages.Get("Hydro");
const Real gam = pin->GetReal("hydro", "gamma");
Expand Down
6 changes: 4 additions & 2 deletions src/pgen/pgen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ using namespace parthenon::driver::prelude;
void ProblemInitPackageData(ParameterInput *pin, parthenon::StateDescriptor *pkg);
void InitUserMeshData(ParameterInput *pin);
void ProblemGenerator(Mesh *pmesh, ParameterInput *pin, MeshData<Real> *md);
void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin);
void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin,
const parthenon::SimTime &tm);
void ClusterUnsplitSrcTerm(MeshData<Real> *md, const parthenon::SimTime &tm,
const Real beta_dt);
void ClusterSplitSrcTerm(MeshData<Real> *md, const parthenon::SimTime &tm,
Expand All @@ -121,7 +122,8 @@ void ProblemGenerator(Mesh *pm, parthenon::ParameterInput *pin, MeshData<Real> *
void ProblemInitPackageData(ParameterInput *pin, parthenon::StateDescriptor *pkg);
void Driving(MeshData<Real> *md, const parthenon::SimTime &tm, const Real dt);
void SetPhases(MeshBlock *pmb, ParameterInput *pin);
void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin);
void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin,
const parthenon::SimTime &tm);
void Cleanup();
} // namespace turbulence

Expand Down
6 changes: 3 additions & 3 deletions src/pgen/turbulence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,7 @@ void ProblemGenerator(Mesh *pmesh, ParameterInput *pin, MeshData<Real> *md) {

for (int b = 0; b < md->NumBlocks(); b++) {
pmb = md->GetBlockData(b)->GetBlockPointer();
auto &sd = pmb->swarm_data.Get();
auto &swarm = pmb->swarm_data.Get()->Get("tracers");
auto &swarm = pmb->meshblock_data.Get()->GetSwarmData()->Get("tracers");
auto rng_pool = tracer_pkg->Param<RNGPool>("rng_pool");

const Real &x_min = pmb->coords.Xf<1>(ib.s);
Expand Down Expand Up @@ -814,7 +813,8 @@ void Driving(MeshData<Real> *md, const parthenon::SimTime &tm, const Real dt) {
InjectBlob(md, tm, dt);
}

void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin) {
void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin,
const parthenon::SimTime & /*tm*/) {
auto hydro_pkg = pmb->packages.Get("Hydro");

// Store (common) acceleration field in spectral space
Expand Down
6 changes: 2 additions & 4 deletions src/tracers/tracers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin) {

TaskStatus AdvectTracers(MeshBlockData<Real> *mbd, const Real dt) {
auto *pmb = mbd->GetParentPointer();
auto &sd = pmb->swarm_data.Get();
auto &swarm = sd->Get("tracers");
auto &swarm = pmb->meshblock_data.Get()->GetSwarmData()->Get("tracers");

auto &x = swarm->Get<Real>("x").Get();
auto &y = swarm->Get<Real>("y").Get();
Expand Down Expand Up @@ -207,8 +206,7 @@ TaskStatus FillTracers(MeshData<Real> *md, parthenon::SimTime &tm) {
const auto &prim_pack = md->PackVariables(std::vector<std::string>{"prim"});
for (int b = 0; b < md->NumBlocks(); b++) {
auto *pmb = md->GetBlockData(b)->GetBlockPointer();
auto &sd = pmb->swarm_data.Get();
auto &swarm = sd->Get("tracers");
auto &swarm = pmb->meshblock_data.Get()->GetSwarmData()->Get("tracers");

// TODO(pgrete) cleanup once get swarm packs (currently in development upstream)
// pull swarm vars
Expand Down

0 comments on commit 73e59e9

Please sign in to comment.