Skip to content

Commit d01c25c

Browse files
dschwoerergithub-actions[bot]
authored andcommitted
Apply clang-format changes
1 parent df490b9 commit d01c25c

23 files changed

Lines changed: 173 additions & 183 deletions

File tree

include/bout/field.hxx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -531,18 +531,18 @@ T pow(BoutReal lhs, const T& rhs, const std::string& rgn = "RGN_ALL") {
531531
#ifdef FIELD_FUNC
532532
#error This macro has already been defined
533533
#else
534-
#define FIELD_FUNC(_name, func) \
535-
template <typename T, typename = bout::utils::EnableIfField<T>> \
536-
inline T _name(const T& f, const std::string& rgn = "RGN_ALL") { \
537-
AUTO_TRACE(); \
538-
/* Check if the input is allocated */ \
539-
checkData(f); \
540-
/* Define and allocate the output result */ \
541-
T result{emptyFrom(f)}; \
542-
BOUT_FOR(d, result.getRegion(rgn)) { result[d] = func(f[d]); } \
543-
result.name = std::string(#_name "(") + f.name + std::string(")"); \
544-
checkData(result); \
545-
return result; \
534+
#define FIELD_FUNC(_name, func) \
535+
template <typename T, typename = bout::utils::EnableIfField<T>> \
536+
inline T _name(const T& f, const std::string& rgn = "RGN_ALL") { \
537+
AUTO_TRACE(); \
538+
/* Check if the input is allocated */ \
539+
checkData(f); \
540+
/* Define and allocate the output result */ \
541+
T result{emptyFrom(f)}; \
542+
BOUT_FOR(d, result.getRegion(rgn)) { result[d] = func(f[d]); } \
543+
result.name = std::string(#_name "(") + f.name + std::string(")"); \
544+
checkData(result); \
545+
return result; \
546546
}
547547
#endif
548548

@@ -685,16 +685,16 @@ inline T floor(const T& var, BoutReal f, const std::string& rgn = "RGN_ALL") {
685685
}
686686
#if BOUT_USE_FCI_AUTOMAGIC
687687
if (var.isFci()) {
688-
for (size_t i=0; i < result.numberParallelSlices(); ++i) {
688+
for (size_t i = 0; i < result.numberParallelSlices(); ++i) {
689689
BOUT_FOR(d, result.yup(i).getRegion(rgn)) {
690-
if (result.yup(i)[d] < f) {
691-
result.yup(i)[d] = f;
692-
}
690+
if (result.yup(i)[d] < f) {
691+
result.yup(i)[d] = f;
692+
}
693693
}
694694
BOUT_FOR(d, result.ydown(i).getRegion(rgn)) {
695-
if (result.ydown(i)[d] < f) {
696-
result.ydown(i)[d] = f;
697-
}
695+
if (result.ydown(i)[d] < f) {
696+
result.ydown(i)[d] = f;
697+
}
698698
}
699699
}
700700
} else

include/bout/field3d.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ public:
488488
friend class Vector2D;
489489

490490
Field3D& calcParallelSlices();
491-
void allowParallelSlices([[maybe_unused]] bool allow){
491+
void allowParallelSlices([[maybe_unused]] bool allow) {
492492
#if CHECK > 0
493493
allowCalcParallelSlices = allow;
494494
#endif

include/bout/fv_ops.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include "bout/vector2d.hxx"
1111

1212
#include "bout/utils.hxx"
13-
#include <bout/mesh.hxx>
1413
#include <bout/difops.hxx>
14+
#include <bout/mesh.hxx>
1515

1616
namespace FV {
1717
/*!

include/bout/index_derivs_interface.hxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,13 @@ T DDY(const T& f, CELL_LOC outloc = CELL_DEFAULT, const std::string& method = "D
203203
if (f.isFci()) {
204204
ASSERT1(f.getDirectionY() == YDirectionType::Standard);
205205
T f_tmp = f;
206-
if (!f.hasParallelSlices()){
206+
if (!f.hasParallelSlices()) {
207207
#if BOUT_USE_FCI_AUTOMAGIC
208208
f_tmp.calcParallelSlices();
209209
#else
210-
throw BoutException("parallel slices needed for parallel derivatives. Make sure to communicate and apply parallel boundary conditions before calling derivative");
210+
throw BoutException(
211+
"parallel slices needed for parallel derivatives. Make sure to communicate and "
212+
"apply parallel boundary conditions before calling derivative");
211213
#endif
212214
}
213215
return standardDerivative<T, DIRECTION::YOrthogonal, DERIV::Standard>(f_tmp, outloc,

include/bout/interpolation_xz.hxx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ public:
134134
}
135135
};
136136

137-
138137
template <bool monotonic>
139138
class XZHermiteSplineBase : public XZInterpolation {
140139
protected:
@@ -282,19 +281,15 @@ public:
282281
const std::string& region = "RGN_NOBNDRY") override;
283282
};
284283

285-
286-
class XZMonotonicHermiteSplineLegacy: public XZHermiteSplineBase<false> {
284+
class XZMonotonicHermiteSplineLegacy : public XZHermiteSplineBase<false> {
287285
public:
288286
using XZHermiteSplineBase<false>::interpolate;
289287
virtual Field3D interpolate(const Field3D& f,
290288
const std::string& region = "RGN_NOBNDRY") const override;
291-
template<class... Ts>
292-
XZMonotonicHermiteSplineLegacy(Ts... args) :
293-
XZHermiteSplineBase<false>(args...)
294-
{}
289+
template <class... Ts>
290+
XZMonotonicHermiteSplineLegacy(Ts... args) : XZHermiteSplineBase<false>(args...) {}
295291
};
296292

297-
298293
class XZInterpolationFactory
299294
: public Factory<XZInterpolation, XZInterpolationFactory, Mesh*> {
300295
public:

include/bout/mesh.hxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,6 @@ public:
842842
return not coords->getParallelTransform().canToFromFieldAligned();
843843
}
844844

845-
846845
private:
847846
/// Allocates default Coordinates objects
848847
/// By default attempts to read staggered Coordinates from grid data source,

include/bout/petsclib.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private:
156156

157157
#endif // PETSC_VERSION_GE
158158

159-
#if ! PETSC_VERSION_GE(3, 19, 0)
159+
#if !PETSC_VERSION_GE(3, 19, 0)
160160
#define PETSC_SUCCESS ((PetscErrorCode)0)
161161
#endif
162162

include/bout/physicsmodel.hxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ protected:
275275
public:
276276
/// Output additional variables other than the evolving variables
277277
virtual void outputVars(Options& options);
278+
278279
protected:
279280
/// Add additional variables other than the evolving variables to the restart files
280281
virtual void restartVars(Options& options);

src/field/field3d.cxx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Field3D::Field3D(const BoutReal val, Mesh* localmesh) : Field3D(localmesh) {
9696
#if BOUT_USE_FCI_AUTOMAGIC
9797
if (this->isFci()) {
9898
splitParallelSlices();
99-
for (size_t i=0; i<numberParallelSlices(); ++i){
99+
for (size_t i = 0; i < numberParallelSlices(); ++i) {
100100
yup(i) = val;
101101
ydown(i) = val;
102102
}
@@ -363,7 +363,7 @@ Field3D& Field3D::operator=(const BoutReal val) {
363363

364364
#if BOUT_USE_FCI_AUTOMAGIC
365365
if (isFci() && hasParallelSlices()) {
366-
for (size_t i=0; i<numberParallelSlices(); ++i){
366+
for (size_t i = 0; i < numberParallelSlices(); ++i) {
367367
yup(i) = val;
368368
ydown(i) = val;
369369
}
@@ -902,15 +902,9 @@ void Field3D::setRegion(const std::string& region_name) {
902902
regionID = fieldmesh->getRegionID(region_name);
903903
}
904904

905-
void Field3D::resetRegion() {
906-
regionID.reset();
907-
};
908-
void Field3D::setRegion(size_t id) {
909-
regionID = id;
910-
};
911-
void Field3D::setRegion(std::optional<size_t> id) {
912-
regionID = id;
913-
};
905+
void Field3D::resetRegion() { regionID.reset(); };
906+
void Field3D::setRegion(size_t id) { regionID = id; };
907+
void Field3D::setRegion(std::optional<size_t> id) { regionID = id; };
914908

915909
Field3D& Field3D::enableTracking(const std::string& name, Options& _tracking) {
916910
tracking = &_tracking;
@@ -929,9 +923,9 @@ Options* Field3D::track(const T& change, std::string operation) {
929923
const std::string changename = change.name;
930924
#endif
931925
(*tracking)[outname].setAttributes({
932-
{"operation", operation},
926+
{"operation", operation},
933927
#if BOUT_USE_TRACK
934-
{"rhs.name", changename},
928+
{"rhs.name", changename},
935929
#endif
936930
});
937931
return &(*tracking)[outname];

0 commit comments

Comments
 (0)