Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix forest size for symmetry dimensions #1093

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- [[PR 1004]](https://github.com/parthenon-hpc-lab/parthenon/pull/1004) Allow parameter modification from an input file for restarts

### Fixed (not changing behavior/API/variables/...)
- [[PR 1093]](https://github.com/parthenon-hpc-lab/parthenon/pull/1093) Fix forest size for symmetry dimensions
- [[PR 1089]](https://github.com/parthenon-hpc-lab/parthenon/pull/1089) Fix loading restart files without derefinement counter
- [[PR 1079]](https://github.com/parthenon-hpc-lab/parthenon/pull/1079) Address XDMF/Visit Issues
- [[PR 1088]](https://github.com/parthenon-hpc-lab/parthenon/pull/1088) Correctly fill fluxes for non-cell variables in SparsePacks
Expand Down
7 changes: 7 additions & 0 deletions src/mesh/forest/forest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,18 @@ Forest Forest::HyperRectangular(RegionSize mesh_size, RegionSize block_size,
for (auto dir : {X1DIR, X2DIR, X3DIR}) {
if (mesh_size.symmetry(dir)) {
nblock[dir - 1] = 1;
// Symmetry directions have just a single zone for
// both the mesh and for each block
max_common_power2_divisor = 1;
continue;
}
// Add error checking
ndim = dir;
nblock[dir - 1] = mesh_size.nx(dir) / block_size.nx(dir);
PARTHENON_REQUIRE(mesh_size.nx(dir) % block_size.nx(dir) == 0,
"Block size is not evenly divisible into the base mesh size.");
PARTHENON_REQUIRE(nblock[dir - 1] > 0,
"Must have a mesh that has a block size greater than one.");
max_common_power2_divisor =
std::min(max_common_power2_divisor, MaximumPowerOf2Divisor(nblock[dir - 1]));
}
Expand Down
Loading