Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to clang-format 18 #1291

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- name: Clone
uses: actions/checkout@v4
- name: Check formatting
uses: DoozyX/clang-format-lint-action@v0.17
uses: DoozyX/clang-format-lint-action@v0.18.2
with:
source: 'nalu.C unit_tests.C ./include ./src ./unit_tests'
extensions: 'H,h,cpp,C'
clangFormatVersion: 17
clangFormatVersion: 18
CPU-Trilinos:
needs: Formatting
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions include/AlgorithmDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class AlgorithmDriver
AlgorithmDriver(Realm& realm);
virtual ~AlgorithmDriver();

virtual void pre_work(){};
virtual void pre_work() {};
virtual void execute();
virtual void post_work(){};
virtual void post_work() {};

Realm& realm_;
std::map<AlgorithmType, Algorithm*> algMap_;
Expand Down
2 changes: 1 addition & 1 deletion include/EquationSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class EquationSystem
virtual double provide_norm() const;
virtual double provide_norm_increment() const;
virtual bool system_is_converged() const;
virtual void post_external_data_transfer_work(){};
virtual void post_external_data_transfer_work() {};

virtual void register_wall_bc(
stk::mesh::Part* /* part */,
Expand Down
2 changes: 1 addition & 1 deletion include/LinearSolverConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class HypreLinearSolverConfig : public LinearSolverConfig
public:
HypreLinearSolverConfig();

virtual ~HypreLinearSolverConfig(){};
virtual ~HypreLinearSolverConfig() {};

//! Process and validate the user inputs and register calls to appropriate
//! Hypre functions to configure the solver and preconditioner.
Expand Down
2 changes: 1 addition & 1 deletion include/MaterialPropertys.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MaterialPropertys

void load(const YAML::Node& node);

void breadboard(){};
void breadboard() {};

// ease of access methods to particular initial condition
size_t size() { return materialPropertyVector_.size(); }
Expand Down
16 changes: 8 additions & 8 deletions include/NaluParsing.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,19 +274,19 @@ struct NonConformalUserData : public UserData

struct WallBoundaryConditionData : public BoundaryCondition
{
WallBoundaryConditionData(){};
WallBoundaryConditionData() {};
WallUserData userData_;
};

struct InflowBoundaryConditionData : public BoundaryCondition
{
InflowBoundaryConditionData(){};
InflowBoundaryConditionData() {};
InflowUserData userData_;
};

struct OpenBoundaryConditionData : public BoundaryCondition
{
OpenBoundaryConditionData(){};
OpenBoundaryConditionData() {};
OpenUserData userData_;
};

Expand All @@ -297,34 +297,34 @@ struct OversetBoundaryConditionData : public BoundaryCondition
OVERSET_NONE = 1 ///< Guard for error messages
};

OversetBoundaryConditionData(){};
OversetBoundaryConditionData() {};
OversetUserData userData_;
OversetAPI oversetConnectivityType_;
};

struct SymmetryBoundaryConditionData : public BoundaryCondition
{
SymmetryBoundaryConditionData(){};
SymmetryBoundaryConditionData() {};
SymmetryUserData userData_;
};

struct ABLTopBoundaryConditionData : public BoundaryCondition
{
ABLTopBoundaryConditionData(){};
ABLTopBoundaryConditionData() {};
ABLTopUserData userData_;
SymmetryUserData symmetryUserData_;
};

struct PeriodicBoundaryConditionData : public BoundaryCondition
{
PeriodicBoundaryConditionData(){};
PeriodicBoundaryConditionData() {};
MasterSlave masterSlave_;
PeriodicUserData userData_;
};

struct NonConformalBoundaryConditionData : public BoundaryCondition
{
NonConformalBoundaryConditionData(){};
NonConformalBoundaryConditionData() {};
std::vector<std::string> currentPartNameVec_;
std::vector<std::string> opposingPartNameVec_;
NonConformalUserData userData_;
Expand Down
2 changes: 1 addition & 1 deletion include/Realm.h
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ class Realm
bool doBalanceNodes_;
struct BalanceNodeOptions
{
BalanceNodeOptions() : target(1.0), numIters(5){};
BalanceNodeOptions() : target(1.0), numIters(5) {};

double target;
int numIters;
Expand Down
2 changes: 1 addition & 1 deletion include/TpetraLinearSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class TpetraLinearSystem : public LinearSystem
const SharedMemView<const double**, DeviceShmem>& lhs,
const char* trace_tag);

void free_device_pointer(){};
void free_device_pointer() {};

sierra::nalu::CoeffApplier* device_pointer() { return nullptr; };

Expand Down
2 changes: 1 addition & 1 deletion include/TpetraLinearSystemHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace nalu {

class LocalGraphArrays;

#define GID_(gid, ndof, idof) ((ndof) * ((gid)-1) + (idof) + 1)
#define GID_(gid, ndof, idof) ((ndof) * ((gid) - 1) + (idof) + 1)

enum DOFStatus {
DS_NotSet = 0,
Expand Down
2 changes: 1 addition & 1 deletion include/aero/actuator/ActuatorExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ActuatorExecutor
public:
ActuatorExecutor(const ActuatorMeta& actMeta, ActuatorBulk& actBulk);
ActuatorExecutor() = delete;
virtual ~ActuatorExecutor(){};
virtual ~ActuatorExecutor() {};
virtual void operator()() = 0;
void compute_fllc();
void apply_fllc(ActuatorBulk& actBulk);
Expand Down
4 changes: 2 additions & 2 deletions include/aero/actuator/ActuatorExecutorsFASTNgp.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ActuatorLineFastNGP : public ActuatorExecutor
ActuatorBulkFAST& actBulk,
stk::mesh::BulkData& stkBulk);

virtual ~ActuatorLineFastNGP(){};
virtual ~ActuatorLineFastNGP() {};

void operator()() final;

Expand All @@ -45,7 +45,7 @@ class ActuatorDiskFastNGP : public ActuatorExecutor
ActuatorBulkDiskFAST& actBulk,
stk::mesh::BulkData& stkBulk);

virtual ~ActuatorDiskFastNGP(){};
virtual ~ActuatorDiskFastNGP() {};

void operator()() final;

Expand Down
2 changes: 1 addition & 1 deletion include/aero/actuator/ActuatorExecutorsSimpleNgp.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ActuatorLineSimpleNGP : public ActuatorExecutor
ActuatorBulkSimple& actBulk,
stk::mesh::BulkData& stkBulk);

virtual ~ActuatorLineSimpleNGP(){};
virtual ~ActuatorLineSimpleNGP() {};
void operator()() final;

private:
Expand Down
2 changes: 1 addition & 1 deletion include/aero/actuator/ActuatorFLLC.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FilteredLiftingLineCorrection
const ActuatorMeta& actMeta, ActuatorBulk& actBulk);
FilteredLiftingLineCorrection() = delete;

virtual ~FilteredLiftingLineCorrection(){};
virtual ~FilteredLiftingLineCorrection() {};

/**
* @brief Compute the lift force distribution (G)
Expand Down
2 changes: 1 addition & 1 deletion include/aero/actuator/ActuatorModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct ActuatorModel
std::shared_ptr<ActuatorExecutor> actExec_;

ActuatorModel() = default;
virtual ~ActuatorModel(){};
virtual ~ActuatorModel() {};

void parse(const YAML::Node& actuatorNode);
void setup(double timeStep, stk::mesh::BulkData& stkBulk);
Expand Down
6 changes: 3 additions & 3 deletions include/tabular_props/Converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class Converter;
class ConverterFactory
{
public:
ConverterFactory(){};
~ConverterFactory(){};
ConverterFactory() {};
~ConverterFactory() {};

Converter* create(const std::string& converterType) const;
};
Expand All @@ -44,7 +44,7 @@ class Converter
public:
explicit Converter(const std::string& converterType);

virtual ~Converter(){};
virtual ~Converter() {};

/** Get the name of the variable returned by this Converter */
const std::string& name() const { return name_; }
Expand Down
6 changes: 3 additions & 3 deletions include/tabular_props/Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ double F_chi(const double Z);
class FChi
{
public:
FChi(){};
~FChi(){};
FChi() {};
~FChi() {};

double query(const double Z);
};
Expand All @@ -81,7 +81,7 @@ class FGamma
{
public:
explicit FGamma(const int nMixFrac) { zBuf_.resize(nMixFrac, 0.0); }
~FGamma(){};
~FGamma() {};

void setZStoich(const std::vector<std::vector<double>>& zStoich)
{
Expand Down
2 changes: 1 addition & 1 deletion include/xfer/FromMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class FromMesh
// nothing to do
}

~FromMesh(){};
~FromMesh() {};

struct BoundingBoxCompare
{
Expand Down
2 changes: 1 addition & 1 deletion include/xfer/ToMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class ToMesh
// nothing to do
}

~ToMesh(){};
~ToMesh() {};

struct BoundingBoxCompare
{
Expand Down
3 changes: 1 addition & 2 deletions src/matrix_free/ContinuityOperator.C
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ namespace {
void
remove_constant(Kokkos::View<double*> x, double value)
{
Kokkos::parallel_for(
x.extent(0), KOKKOS_LAMBDA(int n) { x(n) -= value; });
Kokkos::parallel_for(x.extent(0), KOKKOS_LAMBDA(int n) { x(n) -= value; });
}

void
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/UnitTestHexElementPromotion.C
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ count_nodes(
class PromoteElementHexTest : public ::testing::Test
{
protected:
PromoteElementHexTest() : comm(MPI_COMM_WORLD), nDim(3){};
PromoteElementHexTest() : comm(MPI_COMM_WORLD), nDim(3) {};

void init(int nx, int ny, int nz, int in_polyOrder)
{
Expand Down
3 changes: 1 addition & 2 deletions unit_tests/UnitTestSmartField.C
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ template <typename T>
void
lambda_ordinal(T& ptr)
{
Kokkos::parallel_for(
1, KOKKOS_LAMBDA(int) { ptr.get_ordinal(); });
Kokkos::parallel_for(1, KOKKOS_LAMBDA(int) { ptr.get_ordinal(); });
}

template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/UnitTestUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ perturb_coord_hex_8(stk::mesh::BulkData& bulk, double perturbSize)
// ensure that the rng isn't machine/compiler dependent.
struct Lcg
{
Lcg(uint32_t seed) : prev(seed){};
Lcg(uint32_t seed) : prev(seed) {};

double operator()()
{
Expand Down
8 changes: 4 additions & 4 deletions unit_tests/mesh_motion/UnitTestCompositeFrames.C
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ TEST(meshMotion, NGP_initialize)
cxyz(node)[d] = mxyz(node)[d];
}
} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts
}

// create mesh transformation algorithm class
Expand Down Expand Up @@ -247,7 +247,7 @@ TEST(meshMotion, NGP_initialize)
EXPECT_NEAR(vel(node)[1], gold_norm_vel[1], testTol);
EXPECT_NEAR(vel(node)[2], gold_norm_vel[2], testTol);
} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts
}
}

Expand Down Expand Up @@ -308,7 +308,7 @@ TEST(meshMotion, NGP_execute)
cxyz[d] = mxyz[d];
}
} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts

// create mesh transformation algorithm class
std::unique_ptr<sierra::nalu::MeshTransformationAlg> meshTransformationAlg;
Expand Down Expand Up @@ -364,5 +364,5 @@ TEST(meshMotion, NGP_execute)
EXPECT_NEAR(vel[1], gold_norm_vel[1], testTol);
EXPECT_NEAR(vel[2], gold_norm_vel[2], testTol);
} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts
}
4 changes: 2 additions & 2 deletions unit_tests/mesh_motion/UnitTestComputeCentroid.C
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ TEST(meshMotion, NGP_compute_centroid)
for (int d = 0; d < nDim; ++d)
gxyz[d] = mxyz[d];
} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts

// create mesh transformation algorithm class
sierra::nalu::MeshTransformationAlg meshTransformationAlg(
Expand All @@ -170,5 +170,5 @@ TEST(meshMotion, NGP_compute_centroid)
EXPECT_NEAR(mxyz[1], gold_norm_xyz[1], testTol);
EXPECT_NEAR(mxyz[2], gold_norm_xyz[2], testTol);
} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts
}
4 changes: 2 additions & 2 deletions unit_tests/utils/UnitTestComputeVectorDivergence.C
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ TEST(utils, compute_vector_divergence)
vecField[d] = vecCoeff[d] * xyz[d];

} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts

// compute divergence
stk::mesh::PartVector partVec;
Expand All @@ -145,5 +145,5 @@ TEST(utils, compute_vector_divergence)
EXPECT_NEAR(divVal[0], coeffSum, testTol);

} // end for loop - in index
} // end for loop - bkts
} // end for loop - bkts
}
Loading