Skip to content

Commit

Permalink
Apply clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bendudson committed Oct 12, 2023
1 parent 3597663 commit 1c1d834
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions include/bout/options.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ public:
static void cleanup();

/// The type used to store values
using ValueType =
bout::utils::variant<bool, int, BoutReal, std::string, Field2D, Field3D, FieldPerp,
Array<BoutReal>, Array<int>, Matrix<BoutReal>, Tensor<BoutReal>>;
using ValueType = bout::utils::variant<bool, int, BoutReal, std::string, Field2D,
Field3D, FieldPerp, Array<BoutReal>, Array<int>,
Matrix<BoutReal>, Tensor<BoutReal>>;

/// The type used to store attributes
/// Extends the variant class so that cast operator can be implemented
Expand Down
10 changes: 6 additions & 4 deletions src/mesh/data/gridfromfile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ struct GetDimensions {
std::vector<int> operator()(MAYBE_UNUSED(int value)) { return {1}; }
std::vector<int> operator()(MAYBE_UNUSED(BoutReal value)) { return {1}; }
std::vector<int> operator()(MAYBE_UNUSED(const std::string& value)) { return {1}; }
template<typename T>
std::vector<int> operator()(const Array<T>& array) { return {array.size()}; }
template <typename T>
std::vector<int> operator()(const Array<T>& array) {
return {array.size()};
}
std::vector<int> operator()(const Matrix<BoutReal>& array) {
const auto shape = array.shape();
return {std::get<0>(shape), std::get<1>(shape)};
Expand Down Expand Up @@ -484,8 +486,8 @@ bool GridFile::get(Mesh* UNUSED(m), std::vector<int>& var, const std::string& na

// Check size
if (full_var.size() < len + offset) {
throw BoutException("{} has length {}. Expected {} elements + {} offset",
name, full_var.size(), len, offset);
throw BoutException("{} has length {}. Expected {} elements + {} offset", name,
full_var.size(), len, offset);
}

// Ensure that output variable has the correct size
Expand Down
11 changes: 7 additions & 4 deletions src/mesh/impls/bout/boutmesh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2080,21 +2080,24 @@ void BoutMesh::topology() {
if (limiter_count > 0) {
std::vector<int> limiter_yinds, limiter_xstarts, limiter_xends;
if (!source->get(this, limiter_yinds, "limiter_yinds", limiter_count)) {
throw BoutException("Couldn't read limiter_yinds vector of length {} from mesh", limiter_count);
throw BoutException("Couldn't read limiter_yinds vector of length {} from mesh",
limiter_count);
}
if (!source->get(this, limiter_xstarts, "limiter_xstarts", limiter_count)) {
throw BoutException("Couldn't read limiter_xstarts vector of length {} from mesh", limiter_count);
throw BoutException("Couldn't read limiter_xstarts vector of length {} from mesh",
limiter_count);
}
if (!source->get(this, limiter_xends, "limiter_xends", limiter_count)) {
throw BoutException("Couldn't read limiter_xend vector of length {} from mesh", limiter_count);
throw BoutException("Couldn't read limiter_xend vector of length {} from mesh",
limiter_count);
}

for (int i = 0; i < limiter_count; ++i) {
int yind = limiter_yinds[i];
int xstart = limiter_xstarts[i];
int xend = limiter_xends[i];
output_info.write("Adding a limiter between y={} and {}. X indices {} to {}\n",
yind, yind+1, xstart, xend);
yind, yind + 1, xstart, xend);
add_target(yind, xstart, xend);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/sys/options.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,8 @@ Array<int> Options::as<Array<int>>(const Array<int>& similar_to) const {

Array<int> result = bout::utils::visit(
ConvertContainer<Array<int>>{
fmt::format(
_("Value for option {:s} cannot be converted to an Array<int>"),
full_name),
fmt::format(_("Value for option {:s} cannot be converted to an Array<int>"),
full_name),
similar_to},
value);

Expand Down

0 comments on commit 1c1d834

Please sign in to comment.