Skip to content

Commit

Permalink
Fix beam.units = static (#840)
Browse files Browse the repository at this point in the history
Currently, we only support (and document correctly) "static" units,
but the user was able to also pass "dynamic", upon which we did print
"Dynamic units" but then still used static ones.

This now errors out correctly for anything else than "static" until
we implement another variant.
  • Loading branch information
ax3l authored Feb 11, 2025
1 parent f8f7af0 commit 001c192
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/initialization/InitDistribution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,8 @@ namespace impactx

if (unit_type == "static") {
amrex::Print() << "Static units" << std::endl;
} else if (unit_type == "dynamic") {
amrex::Print() << "Dynamic units" << std::endl;
} else {
throw std::runtime_error("Unknown units (static/dynamic): " + unit_type);
throw std::runtime_error("Unknown units (use 'static'): " + unit_type);
}

amrex::Print() << "Initialized beam distribution parameters" << std::endl;
Expand Down

0 comments on commit 001c192

Please sign in to comment.