Skip to content

Commit

Permalink
Merge pull request #2886 from boutproject/minor-fixes
Browse files Browse the repository at this point in the history
Some minor fixes, docs, ...
  • Loading branch information
bendudson committed Mar 20, 2024
2 parents c80b0ec + bdb24ce commit e30163d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ coverage/
/_version.txt
/BOUT++-v*.tar.gz
/BOUT++-v*.tar.xz
/CMakeCache.txt
/CMakeFiles/cmake.check_cache
3 changes: 2 additions & 1 deletion include/bout/options.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,8 @@ public:
/// {"long_name", "some velocity"}
/// });
Options& setAttributes(
std::initializer_list<std::pair<std::string, Options::AttributeType>> attrs) {
const std::initializer_list<std::pair<std::string, Options::AttributeType>>&
attrs) {
for (const auto& attr : attrs) {
attributes[attr.first] = attr.second;
}
Expand Down
2 changes: 1 addition & 1 deletion include/bout/single_index_ops.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using EXEC_POL = RAJA::cuda_exec<CUDA_BLOCK_SIZE>;
using EXEC_POL = RAJA::loop_exec;
#endif // end BOUT_USE_CUDA
////-----------CUDA settings------------------------------------------------------end
#endif
#endif // end BOUT_HAS_RAJA

// Ind3D: i.zp():
BOUT_HOST_DEVICE inline int i_zp(const int id, const int nz) {
Expand Down
2 changes: 1 addition & 1 deletion include/bout/sundials_backports.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// These are common backports shared between the CVode, ARKode, and IDA solvers
//
// Copyright 2022 Peter Hill, BOUT++ Team
// SPDX-License-Identifier: LGPLv3
// SPDX-License-Identifier: LGPL-3.0-or-later

#ifndef BOUT_SUNDIALS_BACKPORTS_H
#define BOUT_SUNDIALS_BACKPORTS_H
Expand Down
8 changes: 8 additions & 0 deletions include/bout/utils.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ public:
return data[i.ind];
}

T& operator[](Ind3D i) {
// ny and nz are private :-(
// ASSERT2(i.nz == n3);
// ASSERT2(i.ny == n2);
ASSERT2(0 <= i.ind && i.ind < n1 * n2 * n3);
return data[i.ind];
}

Tensor& operator=(const T& val) {
for (auto& i : data) {
i = val;
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/fv_ops.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Slices<T> makeslices(bool use_slices, const T& field) {

namespace FV {

// Div ( a Grad_perp(f) ) -- ∇( a ∇⊥ f) -- Vorticity
// Div ( a Grad_perp(f) ) -- ∇( a ∇⊥ f) -- Vorticity
Field3D Div_a_Grad_perp(const Field3D& a, const Field3D& f) {
ASSERT2(a.getLocation() == f.getLocation());

Expand Down

0 comments on commit e30163d

Please sign in to comment.