From c7e95dced3bbcf411b750d238808dd74fe1ce64f Mon Sep 17 00:00:00 2001 From: svchb Date: Fri, 12 Aug 2022 17:49:00 +0200 Subject: [PATCH] reformat code --- src/cartesiangrid.h | 16 +++++++--------- src/cartesiangrid_base.h | 16 ++++++++-------- src/common/IO.h | 8 ++++---- src/config.h.in | 6 +++--- src/geometry.h | 22 ++++++++++++---------- src/lbm/bnd/bnd_neumann.h | 6 +++--- src/lbm/equilibrium_func.h | 4 ++-- src/lbm/solver.h | 6 +++--- src/loadbalancing_weights.h | 20 ++++++++++---------- src/lpt/solver.h | 8 ++++---- 10 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/cartesiangrid.h b/src/cartesiangrid.h index fa1152c..5a021e4 100644 --- a/src/cartesiangrid.h +++ b/src/cartesiangrid.h @@ -51,12 +51,12 @@ class CartesianGrid : public BaseCartesianGrid { using BaseCartesianGrid::maxLvl; using BaseCartesianGrid::transformMaxLvl; - CartesianGrid() = default; - ~CartesianGrid() override = default; - CartesianGrid(const CartesianGrid&) = delete; - CartesianGrid(CartesianGrid&&) = delete; + CartesianGrid() = default; + ~CartesianGrid() override = default; + CartesianGrid(const CartesianGrid&) = delete; + CartesianGrid(CartesianGrid&&) = delete; auto operator=(const CartesianGrid&) -> CartesianGrid& = delete; - auto operator=(CartesianGrid&&) -> CartesianGrid& = delete; + auto operator=(CartesianGrid&&) -> CartesianGrid& = delete; inline auto child(const GInt id, const GInt pos) -> GInt& { if(DEBUG_LEVEL >= Debug_Level::debug) { @@ -387,7 +387,7 @@ class CartesianGrid : public BaseCartesianGrid { for(auto& [linkedCell, value] : allPossibleBndryGhosts) { ASSERT(value.dir.size() <= 2, "Unsupported!" + std::to_string(value.dir.size())); - const GString surfId = value.linkedSurfaces[0]; + const GString surfId = value.linkedSurfaces[0]; // GInt ghostId = INVALID_CELLID; if(value.dir.size() == 1) { @@ -496,9 +496,7 @@ class CartesianGrid : public BaseCartesianGrid { auto totalSize() const -> GInt { return size() + m_noGhostsCells; } - auto isBndryCell(const GInt cellId) const -> GBool { - return property(cellId, CellProperties::bndry); - } + auto isBndryCell(const GInt cellId) const -> GBool { return property(cellId, CellProperties::bndry); } private: void setProperties() { diff --git a/src/cartesiangrid_base.h b/src/cartesiangrid_base.h index a485fb6..4aea06f 100644 --- a/src/cartesiangrid_base.h +++ b/src/cartesiangrid_base.h @@ -4,8 +4,8 @@ #include #include -//#include "celltree.h" -//#include "common/IO.h" +// #include "celltree.h" +// #include "common/IO.h" #include "geometry.h" #include "globaltimers.h" #include "gridcell_properties.h" @@ -115,12 +115,12 @@ class BaseCartesianGrid : public GridInterface { /// Underlying enum type for property access using Cell = CellProperties; - BaseCartesianGrid() = default; - ~BaseCartesianGrid() override = default; - BaseCartesianGrid(const BaseCartesianGrid&) = delete; - BaseCartesianGrid(BaseCartesianGrid&&) = delete; + BaseCartesianGrid() = default; + ~BaseCartesianGrid() override = default; + BaseCartesianGrid(const BaseCartesianGrid&) = delete; + BaseCartesianGrid(BaseCartesianGrid&&) = delete; auto operator=(const BaseCartesianGrid&) -> BaseCartesianGrid& = delete; - auto operator=(BaseCartesianGrid&&) -> BaseCartesianGrid& = delete; + auto operator=(BaseCartesianGrid&&) -> BaseCartesianGrid& = delete; void setBoundingBox(const BoundingBoxInterface& bbox) override { if(bbox.size() != NDIM) { @@ -185,7 +185,7 @@ class BaseCartesianGrid : public GridInterface { [[nodiscard]] inline auto currentHighestLvl() const -> GInt override { return m_currentHighestLvl; } [[nodiscard]] inline auto dim() const -> GInt override { return NDIM; } - inline auto property(const GInt id, CellProperties p) -> auto { + inline auto property(const GInt id, CellProperties p) -> auto{ if(DEBUG_LEVEL >= Debug_Level::debug) { // checkBounds(id); checkProperty(p); diff --git a/src/common/IO.h b/src/common/IO.h index 9938eec..24eb734 100644 --- a/src/common/IO.h +++ b/src/common/IO.h @@ -5,7 +5,7 @@ #include #include #include "../cell_filter.h" -//#include +// #include namespace hidden::_detail { const std::function defaultTrue = [](GInt /*ignored*/) { return true; }; @@ -423,9 +423,9 @@ inline void writePoints(const GString& fileName, const GInt maxNoValues, const s cerr0 << SP1 << "Writing " << fileName << ".vtp with #" << noOutCells << " cells" << std::endl; logger << SP1 << "Writing " << fileName << ".vtp with #" << noOutCells << " cells" << std::endl; - ofstream pointFile; - static constexpr unsigned int no_kbs_buffer = 64; - static constexpr unsigned int buffer_size = 1024 * no_kbs_buffer; + ofstream pointFile; + static constexpr unsigned int no_kbs_buffer = 64; + static constexpr unsigned int buffer_size = 1024 * no_kbs_buffer; // static constexpr std::array padders = {"", "=", "==", "==="}; std::array buffer{}; diff --git a/src/config.h.in b/src/config.h.in index 76ddba3..2e7f1f5 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -8,7 +8,7 @@ inline std::ostream cerr0(nullptr); // NOLINT(cppcoreguidelines-avoid-non-const- /// The default max number of offsprings allowed for a partitioning cell. -static constexpr GInt DEFAULT_MAXNOOFFSPRINGS = 100000; +static constexpr GInt DEFAULT_MAXNOOFFSPRINGS = 100000; /// arbitrary maximum cell level static constexpr GInt MAX_LVL = 100; @@ -30,13 +30,13 @@ static constexpr GInt MAX_DIM = 4; #define LOG_MIN_FLUSH_SIZE 0 // activate asserts (will reduce performance) -//#define USE_ASSERTS +// #define USE_ASSERTS // average timer results over all ranks #define TIMER_RANK_AVG // synchronize timers -//#define TIMER_SYNC +// #define TIMER_SYNC // enable backtracing using LLVMSupport library #define ENABLE_BACKTRACE diff --git a/src/geometry.h b/src/geometry.h index 606677b..b79c71a 100644 --- a/src/geometry.h +++ b/src/geometry.h @@ -22,11 +22,11 @@ enum class BoundaryConditionType { Wall }; class GeometryInterface { public: GeometryInterface(const MPI_Comm comm) : m_comm(comm){}; - virtual ~GeometryInterface() = default; - GeometryInterface(const GeometryInterface&) = delete; - GeometryInterface(GeometryInterface&&) = delete; + virtual ~GeometryInterface() = default; + GeometryInterface(const GeometryInterface&) = delete; + GeometryInterface(GeometryInterface&&) = delete; auto operator=(const GeometryInterface&) -> GeometryInterface& = delete; - auto operator=(GeometryInterface&&) -> GeometryInterface& = delete; + auto operator=(GeometryInterface&&) -> GeometryInterface& = delete; virtual void setup(const json& geometry) = 0; virtual inline auto pointIsInside(const GDouble* x) const -> GBool = 0; @@ -45,12 +45,12 @@ class GeometryRepresentation { public: GeometryRepresentation(const json& geom) : m_body(config::opt_config_value(geom, "body", GString("unique"))), m_subtract(config::opt_config_value(geom, "subtract", false)){}; - GeometryRepresentation() = default; - virtual ~GeometryRepresentation() = default; - GeometryRepresentation(const GeometryRepresentation&) = delete; - GeometryRepresentation(GeometryRepresentation&&) = delete; + GeometryRepresentation() = default; + virtual ~GeometryRepresentation() = default; + GeometryRepresentation(const GeometryRepresentation&) = delete; + GeometryRepresentation(GeometryRepresentation&&) = delete; auto operator=(const GeometryRepresentation&) -> GeometryRepresentation& = delete; - auto operator=(GeometryRepresentation&&) -> GeometryRepresentation& = delete; + auto operator=(GeometryRepresentation&&) -> GeometryRepresentation& = delete; [[nodiscard]] virtual inline auto pointIsInside(const Point& x) const -> GBool = 0; [[nodiscard]] virtual inline auto cutWithCell(const Point& center, GDouble cellLength) const -> GBool = 0; @@ -518,7 +518,9 @@ class GeometrySTL : public GeometryRepresentation { using namespace std; // data in an binary STL file normal, vertex1, vertex2, vertex3 - using facet_t = struct { std::array n, v1, v2, v3; }; + using facet_t = struct { + std::array n, v1, v2, v3; + }; facet_t facet; // open file in binary format diff --git a/src/lbm/bnd/bnd_neumann.h b/src/lbm/bnd/bnd_neumann.h index 37060d1..818f3b1 100644 --- a/src/lbm/bnd/bnd_neumann.h +++ b/src/lbm/bnd/bnd_neumann.h @@ -28,10 +28,10 @@ class LBMBnd_NeumannNEEM : public LBMBnd_DirichletNEEM ~LBMBnd_NeumannNEEM() override = default; // deleted constructors not needed - LBMBnd_NeumannNEEM(const LBMBnd_NeumannNEEM&) = delete; - LBMBnd_NeumannNEEM(LBMBnd_NeumannNEEM&&) = delete; + LBMBnd_NeumannNEEM(const LBMBnd_NeumannNEEM&) = delete; + LBMBnd_NeumannNEEM(LBMBnd_NeumannNEEM&&) = delete; auto operator=(const LBMBnd_NeumannNEEM&) -> LBMBnd_NeumannNEEM& = delete; - auto operator=(LBMBnd_NeumannNEEM&&) -> LBMBnd_NeumannNEEM& = delete; + auto operator=(LBMBnd_NeumannNEEM&&) -> LBMBnd_NeumannNEEM& = delete; void initCnd(const std::function& /*vars*/) override {} diff --git a/src/lbm/equilibrium_func.h b/src/lbm/equilibrium_func.h index 9c71441..2ad2c60 100644 --- a/src/lbm/equilibrium_func.h +++ b/src/lbm/equilibrium_func.h @@ -86,7 +86,7 @@ static inline void defaultEq(GDouble* feq, const GDouble density, const GDouble* template static inline auto defaultEq(const GInt dist, const GDouble density, const GDouble* const velocity) -> GDouble { // static constexpr GInt NDIST = LBMethod::m_noDists; - static constexpr GInt NDIM = LBMethod::m_dim; + static constexpr GInt NDIM = LBMethod::m_dim; GDouble vsq = 0; for(GInt dir = 0; dir < NDIM; ++dir) { @@ -132,7 +132,7 @@ static inline void symmEq(GDouble* feq, const GDouble density, const GDouble* co template static inline auto symmEq(const GInt dist, const GDouble density, const GDouble* const velocity) -> GDouble { // static constexpr GInt NDIST = LBMethod::m_noDists; - static constexpr GInt NDIM = LBMethod::m_dim; + static constexpr GInt NDIM = LBMethod::m_dim; GDouble vsq = 0; for(GInt dir = 0; dir < NDIM; ++dir) { diff --git a/src/lbm/solver.h b/src/lbm/solver.h index 1f50377..c1d1eb8 100644 --- a/src/lbm/solver.h +++ b/src/lbm/solver.h @@ -34,10 +34,10 @@ class LBMSolver : public Runnable, LBMSolver(GInt32 domainId, GInt32 noDomains) : POST(), m_domainId(domainId), m_noDomains(noDomains){}; ~LBMSolver() override = default; - LBMSolver(const LBMSolver&) = delete; - LBMSolver(LBMSolver&&) = delete; + LBMSolver(const LBMSolver&) = delete; + LBMSolver(LBMSolver&&) = delete; auto operator=(const LBMSolver&) -> LBMSolver& = delete; - auto operator=(LBMSolver&&) -> LBMSolver& = delete; + auto operator=(LBMSolver&&) -> LBMSolver& = delete; void init(int argc, GChar** argv, GString config_file) override; void initBenchmark(int argc, GChar** argv) override; diff --git a/src/loadbalancing_weights.h b/src/loadbalancing_weights.h index 620487a..76c7118 100644 --- a/src/loadbalancing_weights.h +++ b/src/loadbalancing_weights.h @@ -7,23 +7,23 @@ class WeightMethod { public: virtual auto weight(GInt id) -> GFloat = 0; - WeightMethod() = default; - virtual ~WeightMethod() = default; - WeightMethod(const WeightMethod&) = delete; - WeightMethod(WeightMethod&&) = delete; + WeightMethod() = default; + virtual ~WeightMethod() = default; + WeightMethod(const WeightMethod&) = delete; + WeightMethod(WeightMethod&&) = delete; auto operator=(const WeightMethod&) -> WeightMethod& = delete; - auto operator=(WeightMethod&&) -> WeightMethod& = delete; + auto operator=(WeightMethod&&) -> WeightMethod& = delete; }; class WeightUniform : public WeightMethod { public: - WeightUniform() = default; - ~WeightUniform() override = default; - WeightUniform(const WeightUniform&) = delete; - WeightUniform(WeightUniform&&) = delete; + WeightUniform() = default; + ~WeightUniform() override = default; + WeightUniform(const WeightUniform&) = delete; + WeightUniform(WeightUniform&&) = delete; auto operator=(const WeightUniform&) -> WeightUniform& = delete; - auto operator=(WeightUniform&&) -> WeightUniform& = delete; + auto operator=(WeightUniform&&) -> WeightUniform& = delete; auto weight(GInt /*id*/) -> GFloat override { return 1.0; } }; diff --git a/src/lpt/solver.h b/src/lpt/solver.h index 836968f..16419bf 100644 --- a/src/lpt/solver.h +++ b/src/lpt/solver.h @@ -30,11 +30,11 @@ class LPTSolver : public Runnable, private Configuration, private RandomGenerato m_gravity.fill(NAN); m_velo_a_infty.fill(0); }; - ~LPTSolver() override = default; - LPTSolver(const LPTSolver&) = delete; - LPTSolver(LPTSolver&&) = delete; + ~LPTSolver() override = default; + LPTSolver(const LPTSolver&) = delete; + LPTSolver(LPTSolver&&) = delete; auto operator=(const LPTSolver&) -> LPTSolver& = delete; - auto operator=(LPTSolver&&) -> LPTSolver& = delete; + auto operator=(LPTSolver&&) -> LPTSolver& = delete; void init(int argc, GChar** argv, GString config_file) override; void initBenchmark(int argc, GChar** argv) override;