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
Changes from 1 commit
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
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