Skip to content

Commit

Permalink
Fix logical location
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Sep 6, 2024
1 parent ce26db7 commit 97004f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- Order of operations in flux-correction has changed (expect round-off error differences to previous results for AMR sims)
- History outputs now carry the output block number, i.e., a file previously called parthenon.hst might now be called parthenon.out1.hst
- History outputs now contain two additional columns (cycle number and meshblock counts), which changes/shifts the column indices (hint: use the column headers to parse the contents and do not rely on fixed indices as they may also vary between different pgen due to custom/pgen-dependent content in the history file)
- Given the introduction of a forrest of tree (rather than a single tree), the logical locations are each meshblock (`pmb->loc`) are now local to the tree and not global any more. To recover the original global index use `auto loc = pmb->pmy_mesh->Forest().GetLegacyTreeLocation(pmb->loc);`
- [[PR 97]](https://github.com/parthenon-hpc-lab/athenapk/pull/97)
- Removes original `schure.cooling` cooling curve as it had unknown origin.
- To avoid confusion, only cooling table for a single solar metallicity are supported
Expand Down
12 changes: 6 additions & 6 deletions src/utils/few_modes_ft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,15 @@

// C++ headers
#include <random>
#include <utility>

// Parthenon headers
#include "basic_types.hpp"
#include "config.hpp"
#include "globals.hpp"
#include "kokkos_abstraction.hpp"
#include "mesh/domain.hpp"
#include "mesh/meshblock_pack.hpp"

// AthenaPK headers
#include "../main.hpp"
#include "few_modes_ft.hpp"
#include "utils/error_checking.hpp"

Expand Down Expand Up @@ -130,9 +127,12 @@ void FewModesFT::SetPhases(MeshBlock *pmb, ParameterInput *pin) {
const auto nx2 = pmb->block_size.nx(X2DIR);
const auto nx3 = pmb->block_size.nx(X3DIR);

const auto gis = pmb->loc.lx1() * pmb->block_size.nx(X1DIR);
const auto gjs = pmb->loc.lx2() * pmb->block_size.nx(X2DIR);
const auto gks = pmb->loc.lx3() * pmb->block_size.nx(X3DIR);
// Need to use legacy locations (which are global) because locations now are local
// to the tree, which results in inconsistencies for meshes with multiple trees.
const auto loc = pmb->pmy_mesh->Forest().GetLegacyTreeLocation(pmb->loc);
const auto gis = loc.lx1() * pmb->block_size.nx(X1DIR);
const auto gjs = loc.lx2() * pmb->block_size.nx(X2DIR);
const auto gks = loc.lx3() * pmb->block_size.nx(X3DIR);

// make local ref to capure in lambda
const auto num_modes = num_modes_;
Expand Down

0 comments on commit 97004f4

Please sign in to comment.