Skip to content

Commit

Permalink
Merge branch 'develop' into lroberts36/fix-static-refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
lroberts36 authored May 15, 2024
2 parents d285155 + dfda73b commit a0c92b1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/mesh/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,11 @@ Mesh::Mesh(ParameterInput *pin, ApplicationInput *app_in, RestartReader &rr,
auto locLevelGidLidCnghostGflag = mesh_info.level_gid_lid_cnghost_gflag;
current_level = -1;
for (int i = 0; i < nbtotal; i++) {
loclist[i] = LogicalLocation(locLevelGidLidCnghostGflag[6 * i], lx123[3 * i],
lx123[3 * i + 1], lx123[3 * i + 2]);
loclist[i] = LogicalLocation(locLevelGidLidCnghostGflag[NumIDsAndFlags * i],
lx123[3 * i], lx123[3 * i + 1], lx123[3 * i + 2]);
}

// rebuild the Block Tree

for (int i = 0; i < nbtotal; i++) {
forest.AddMeshBlock(forest.GetForestLocationFromLegacyTreeLocation(loclist[i]),
false);
Expand Down Expand Up @@ -695,7 +694,7 @@ Mesh::Mesh(ParameterInput *pin, ApplicationInput *app_in, RestartReader &rr,
packages, resolved_packages, gflag, costlist[i]);
if (block_list[i - nbs]->pmr)
block_list[i - nbs]->pmr->DerefinementCount() =
locLevelGidLidCnghostGflag[6 * i + 5];
locLevelGidLidCnghostGflag[NumIDsAndFlags * i + 5];
}
BuildGMGBlockLists(pin, app_in);
SetMeshBlockNeighbors(GridIdentifier::leaf(), block_list, ranklist);
Expand Down
2 changes: 1 addition & 1 deletion src/outputs/outputs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class PHDF5Output : public OutputType {
void WriteLevelsAndLocs_(Mesh *pm, hid_t file, const HDF5::H5P &pl, hsize_t offset,
hsize_t max_blocks_global) const;
void WriteSparseInfo_(Mesh *pm, hbool_t *sparse_allocated,
const std::vector<int> dealloc_count,
const std::vector<int> &dealloc_count,
const std::vector<std::string> &sparse_names, hsize_t num_sparse,
hid_t file, const HDF5::H5P &pl, size_t offset,
hsize_t max_blocks_global) const;
Expand Down
7 changes: 4 additions & 3 deletions src/outputs/parthenon_hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "outputs/outputs.hpp"
#include "outputs/parthenon_hdf5.hpp"
#include "outputs/parthenon_xdmf.hpp"
#include "outputs/restart.hpp"
#include "utils/string_utils.hpp"

namespace parthenon {
Expand Down Expand Up @@ -596,8 +597,8 @@ void PHDF5Output::WriteBlocksMetadata_(Mesh *pm, hid_t file, const HDF5::H5P &pl

{
// (LOC.)level, GID, LID, cnghost, gflag
hsize_t loc_cnt[2] = {num_blocks_local, 6};
hsize_t glob_cnt[2] = {max_blocks_global, 6};
hsize_t loc_cnt[2] = {num_blocks_local, NumIDsAndFlags};
hsize_t glob_cnt[2] = {max_blocks_global, NumIDsAndFlags};
std::vector<int> tmpID = OutputUtils::ComputeIDsAndFlags(pm);
HDF5Write2D(gBlocks, "loc.level-gid-lid-cnghost-gflag", tmpID.data(), &loc_offset[0],
&loc_cnt[0], &glob_cnt[0], pl);
Expand Down Expand Up @@ -662,7 +663,7 @@ void PHDF5Output::WriteLevelsAndLocs_(Mesh *pm, hid_t file, const HDF5::H5P &pl,
}

void PHDF5Output::WriteSparseInfo_(Mesh *pm, hbool_t *sparse_allocated,
const std::vector<int> dealloc_count,
const std::vector<int> &dealloc_count,
const std::vector<std::string> &sparse_names,
hsize_t num_sparse, hid_t file, const HDF5::H5P &pl,
size_t offset, hsize_t max_blocks_global) const {
Expand Down
2 changes: 2 additions & 0 deletions src/outputs/restart.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace parthenon {
class Mesh;
class Param;

constexpr int NumIDsAndFlags{6};

class RestartReader {
public:
RestartReader() = default;
Expand Down

0 comments on commit a0c92b1

Please sign in to comment.