Skip to content

Commit

Permalink
MultiFabRegister::mf_name Keep Direction Convention
Browse files Browse the repository at this point in the history
Keep `[x]`, `[y]`, `[z]` suffixes for now to avoid breakage for
Python users.
  • Loading branch information
ax3l committed Sep 23, 2024
1 parent cc5443f commit 4eb99a5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Source/ablastr/fields/MultiFabRegister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,11 +592,16 @@ namespace ablastr::fields
int level
) const
{
// Add the suffix "[dir=dir]"
// Add the suffix for the direction [x] or [y] or [z]
// note: since Cartesian is not correct for all our supported geometries,
// in the future we might want to break this to "[dir=0/1/2]".
// This will be a breaking change for (Python) users that rely on that string.
constexpr int x_in_ascii = 120;
std::string const component_name{char(x_in_ascii + dir.dir)};
return mf_name(
name
.append("[dir=")
.append(std::to_string(dir.dir))
.append("[")
.append(component_name)
.append("]"),
level
);
Expand Down

0 comments on commit 4eb99a5

Please sign in to comment.