Skip to content

Commit

Permalink
reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
svchb committed Aug 12, 2022
1 parent 2147d8a commit c7e95dc
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 56 deletions.
16 changes: 7 additions & 9 deletions src/cartesiangrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ class CartesianGrid : public BaseCartesianGrid<DEBUG_LEVEL, NDIM> {
using BaseCartesianGrid<DEBUG_LEVEL, NDIM>::maxLvl;
using BaseCartesianGrid<DEBUG_LEVEL, NDIM>::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) {
Expand Down Expand Up @@ -387,7 +387,7 @@ class CartesianGrid : public BaseCartesianGrid<DEBUG_LEVEL, NDIM> {
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) {
Expand Down Expand Up @@ -496,9 +496,7 @@ class CartesianGrid : public BaseCartesianGrid<DEBUG_LEVEL, NDIM> {

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() {
Expand Down
16 changes: 8 additions & 8 deletions src/cartesiangrid_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#include <gcem.hpp>

#include <sfcmm_common.h>
//#include "celltree.h"
//#include "common/IO.h"
// #include "celltree.h"
// #include "common/IO.h"
#include "geometry.h"
#include "globaltimers.h"
#include "gridcell_properties.h"
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/common/IO.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <iostream>
#include <sfcmm_common.h>
#include "../cell_filter.h"
//#include <csv/csv.hpp>
// #include <csv/csv.hpp>

namespace hidden::_detail {
const std::function<GBool(GInt)> defaultTrue = [](GInt /*ignored*/) { return true; };
Expand Down Expand Up @@ -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<std::string_view, 4> padders = {"", "=", "==", "==="};

std::array<char, buffer_size> buffer{};
Expand Down
6 changes: 3 additions & 3 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down
22 changes: 12 additions & 10 deletions src/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<NDIM>& x) const -> GBool = 0;
[[nodiscard]] virtual inline auto cutWithCell(const Point<NDIM>& center, GDouble cellLength) const -> GBool = 0;
Expand Down Expand Up @@ -518,7 +518,9 @@ class GeometrySTL : public GeometryRepresentation<DEBUG_LEVEL, NDIM> {
using namespace std;

// data in an binary STL file normal, vertex1, vertex2, vertex3
using facet_t = struct { std::array<float, NDIM> n, v1, v2, v3; };
using facet_t = struct {
std::array<float, NDIM> n, v1, v2, v3;
};
facet_t facet;

// open file in binary format
Expand Down
6 changes: 3 additions & 3 deletions src/lbm/bnd/bnd_neumann.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class LBMBnd_NeumannNEEM : public LBMBnd_DirichletNEEM<DEBUG_LEVEL, LBTYPE, EQ>
~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<GDouble&(GInt, GInt)>& /*vars*/) override {}

Expand Down
4 changes: 2 additions & 2 deletions src/lbm/equilibrium_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static inline void defaultEq(GDouble* feq, const GDouble density, const GDouble*
template <LBMethodType LBTYPE>
static inline auto defaultEq(const GInt dist, const GDouble density, const GDouble* const velocity) -> GDouble {
// static constexpr GInt NDIST = LBMethod<LBTYPE>::m_noDists;
static constexpr GInt NDIM = LBMethod<LBTYPE>::m_dim;
static constexpr GInt NDIM = LBMethod<LBTYPE>::m_dim;

GDouble vsq = 0;
for(GInt dir = 0; dir < NDIM; ++dir) {
Expand Down Expand Up @@ -132,7 +132,7 @@ static inline void symmEq(GDouble* feq, const GDouble density, const GDouble* co
template <LBMethodType LBTYPE>
static inline auto symmEq(const GInt dist, const GDouble density, const GDouble* const velocity) -> GDouble {
// static constexpr GInt NDIST = LBMethod<LBTYPE>::m_noDists;
static constexpr GInt NDIM = LBMethod<LBTYPE>::m_dim;
static constexpr GInt NDIM = LBMethod<LBTYPE>::m_dim;

GDouble vsq = 0;
for(GInt dir = 0; dir < NDIM; ++dir) {
Expand Down
6 changes: 3 additions & 3 deletions src/lbm/solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions src/loadbalancing_weights.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
};
Expand Down
8 changes: 4 additions & 4 deletions src/lpt/solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c7e95dc

Please sign in to comment.