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

more clang-tidy fixes #415

Merged
merged 6 commits into from
Mar 26, 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
17 changes: 15 additions & 2 deletions Source/BaseState.H
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ class BaseState {
/// copy constructor. This makes a deep copy of the src.
BaseState(const BaseState<T>& src);

// destructor
~BaseState() = default;

// no copy assignment
BaseState& operator= (const BaseState<T>& src) = delete;

// default move constructor -- we might want to explicitly
// implement this, since the compiler might default to copy
BaseState(BaseState<T>&& src) = default;

// no move assignment
BaseState& operator= (BaseState<T>&& src) = delete;

/// return a BaseStateArray object to allow for accessing
/// the underlying data
[[nodiscard]] AMREX_FORCE_INLINE
Expand Down Expand Up @@ -221,7 +234,7 @@ class BaseState {
void toVector(amrex::Gpu::ManagedVector<T>& vec) const;

/// swap the data with src
void swap(BaseState<T>& src);
void swap(BaseState<T>& src) noexcept;

T* dataPtr() noexcept { return base_data.dataPtr(); };

Expand Down Expand Up @@ -478,7 +491,7 @@ void BaseState<T>::toVector(amrex::Gpu::ManagedVector<T>& vec) const {
}

template <class T>
void BaseState<T>::swap(BaseState<T>& src) {
void BaseState<T>::swap(BaseState<T>& src) noexcept {
AMREX_ASSERT(nlev == src.nlev);
AMREX_ASSERT(nvar == src.nvar);
AMREX_ASSERT(len == src.len);
Expand Down
2 changes: 1 addition & 1 deletion Source/BaseStateGeometry.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class BaseStateGeometry {
public:
BaseStateGeometry() noexcept {};
BaseStateGeometry() noexcept = default;

void Init(const int max_radial_level_in, const int nr_fine_in,
const amrex::Real dr_fine_in, const int nr_irreg_in,
Expand Down
17 changes: 15 additions & 2 deletions Source/Maestro.H
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,21 @@ class Maestro : public amrex::AmrCore {

/// constructor
Maestro();

/// destructor
~Maestro();
~Maestro() override;

// copy constructor
Maestro(Maestro& other) = delete;

// move constructor
Maestro(Maestro&& other) = delete;

// copy assignment
Maestro& operator= (const Maestro& other) = delete;

// move assignment
Maestro& operator= (Maestro&& other) = delete;

// in `MaestroSetup.cpp`
/// Setup the simulation.
Expand Down Expand Up @@ -771,7 +784,7 @@ class Maestro : public amrex::AmrCore {
/// finer levels. This function creates a new fine
/// level that did not exist before by interpolating from the coarser level
/// overrides the pure virtual function in `AmrCore`
virtual void MakeNewLevelFromScratch(
void MakeNewLevelFromScratch(
int lev, amrex::Real time, const amrex::BoxArray& ba,
const amrex::DistributionMapping& dm) override;

Expand Down
2 changes: 1 addition & 1 deletion Source/PhysBCFunctMaestro.H
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ typedef void (*BndryFuncDefaultMaestro)(
/// This version calls function working on array
class BndryFuncArrayMaestro : public amrex::BndryFuncArray {
public:
BndryFuncArrayMaestro() noexcept {}
BndryFuncArrayMaestro() = default;
BndryFuncArrayMaestro(BndryFuncDefaultMaestro inFunc) noexcept
: m_func(inFunc) {}

Expand Down
4 changes: 2 additions & 2 deletions Util/model_parser/ModelParser.H
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ typedef amrex::Vector<int> IntVector;

class ModelParser {
public:
ModelParser() { model_initialized = false; };
ModelParser() = default;

void ReadFile(const std::string& model_file);

Expand All @@ -33,7 +33,7 @@ class ModelParser {

int npts_model;

bool model_initialized;
bool model_initialized{false};

// integer keys for indexing the model_state array
static constexpr int idens_model = 0;
Expand Down