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

Make geometry.dims abort message more user-friendly #4459

Merged
merged 1 commit into from
Dec 1, 2023
Merged
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
12 changes: 9 additions & 3 deletions Source/Utils/WarpXUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,17 @@ void CheckDims ()
#endif
const ParmParse pp_geometry("geometry");
std::string dims;
pp_geometry.get("dims", dims);
std::string dims_error = "The selected WarpX executable was built as '";
dims_error.append(dims_compiled).append("'-dimensional, but the ");
dims_error.append("inputs file declares 'geometry.dims = ").append(dims).append("'.\n");
dims_error.append("Please re-compile with a different WarpX_DIMS option or select the right executable name.");
if (pp_geometry.contains("dims")) {
pp_geometry.get("dims", dims);
dims_error.append("inputs file declares 'geometry.dims = ").append(dims).append("'.\n");
dims_error.append("Please re-compile with a different WarpX_DIMS option or select the right executable name.");
} else {
dims = "Not specified";
dims_error.append("inputs file does not declare 'geometry.dims'. Please add 'geometry.dims = ");
dims_error.append(dims_compiled).append("' to inputs file.");
}
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(dims == dims_compiled, dims_error);
}

Expand Down