Skip to content

Commit ef476b4

Browse files
clang tidy again
1 parent e212a6f commit ef476b4

File tree

8 files changed

+46
-20
lines changed

8 files changed

+46
-20
lines changed

Source/FieldSolver/ImplicitSolvers/ImplicitSolver.H

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ public:
2626
ImplicitSolver() = default;
2727

2828
virtual ~ImplicitSolver() = default;
29+
30+
// Default move and copy operations
31+
ImplicitSolver(const ImplicitSolver&) = default;
32+
ImplicitSolver& operator=(const ImplicitSolver&) = default;
33+
ImplicitSolver(ImplicitSolver&&) = default;
34+
ImplicitSolver& operator=(ImplicitSolver&&) = default;
2935

3036
//
3137
// the following routines are called by WarpX

Source/FieldSolver/ImplicitSolvers/SemiImplicitEM.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public:
3232
// malloc_consolidate(): unaligned fastbin chunk detected
3333
WarpXSolverVec::clearDotMask();
3434
}
35-
35+
3636
void Define ( WarpX* a_WarpX ) override;
3737

3838
[[nodiscard]] bool IsDefined () const override { return m_is_defined; }

Source/FieldSolver/ImplicitSolvers/ThetaImplicitEM.H

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public:
6363
// malloc_consolidate(): unaligned fastbin chunk detected
6464
WarpXSolverVec::clearDotMask();
6565
}
66-
66+
6767
void Define ( WarpX* a_WarpX ) override;
6868

6969
[[nodiscard]] bool IsDefined () const override { return m_is_defined; }
@@ -113,8 +113,8 @@ private:
113113
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > > m_Bold;
114114

115115
void UpdateWarpXState ( const WarpXSolverVec& a_E,
116-
const amrex::Real a_time,
117-
const amrex::Real a_dt );
116+
amrex::Real a_time,
117+
amrex::Real a_dt );
118118

119119
};
120120

Source/FieldSolver/ImplicitSolvers/ThetaImplicitEM.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,16 @@ void ThetaImplicitEM::PreRHSOp ( const WarpXSolverVec& a_E,
158158

159159
void ThetaImplicitEM::ComputeRHS ( WarpXSolverVec& a_Erhs,
160160
const WarpXSolverVec& a_E,
161-
const amrex::Real a_time,
162-
const amrex::Real a_dt )
161+
amrex::Real a_time,
162+
amrex::Real a_dt )
163163
{
164164
amrex::ignore_unused(a_E, a_time);
165165
m_WarpX->ComputeRHSE(m_theta*a_dt, a_Erhs);
166166
}
167167

168168
void ThetaImplicitEM::UpdateWarpXState ( const WarpXSolverVec& a_E,
169-
const amrex::Real a_time,
170-
const amrex::Real a_dt )
169+
amrex::Real a_time,
170+
amrex::Real a_dt )
171171
{
172172
using namespace amrex::literals;
173173
amrex::ignore_unused(a_time);

Source/FieldSolver/ImplicitSolvers/WarpXSolverVec.H

+17-6
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ class WarpXSolverVec
4848
{
4949
public:
5050

51-
WarpXSolverVec()
52-
{
53-
}
51+
WarpXSolverVec() = default;
5452

5553
WarpXSolverVec(const WarpXSolverVec& a_vec)
5654
{
@@ -116,12 +114,24 @@ public:
116114
Copy(field_vec);
117115
}
118116

119-
inline
120-
void operator= ( const WarpXSolverVec& a_vec )
117+
// Copy assignment operator
118+
WarpXSolverVec& operator= ( const WarpXSolverVec& a_vec )
119+
{
120+
if (this != &a_vec) { Copy(a_vec); }
121+
return *this;
122+
}
123+
124+
// Move assignment operator
125+
WarpXSolverVec& operator= ( WarpXSolverVec&& a_vec ) noexcept
121126
{
122-
Copy(a_vec);
127+
if (this != &a_vec) {
128+
m_is_defined = std::move(a_vec.m_is_defined);
129+
m_field_vec = std::move(a_vec.m_field_vec);
130+
}
131+
return *this;
123132
}
124133

134+
125135
inline
126136
void operator+= ( const WarpXSolverVec& a_vec )
127137
{
@@ -226,6 +236,7 @@ private:
226236

227237
bool m_is_defined = false;
228238
amrex::Vector<std::array< std::unique_ptr<amrex::MultiFab>, 3 > > m_field_vec;
239+
229240
static constexpr int m_ncomp = 1;
230241
static constexpr int m_num_amr_levels = 1;
231242

Source/NonlinearSolvers/JacobianFunctionMF.H

+7-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ class JacobianFunctionMF
2020

2121
using RT = typename T::value_type;
2222

23-
JacobianFunctionMF<T,Ops>()
24-
{
25-
}
26-
23+
JacobianFunctionMF<T,Ops>() = default;
2724
~JacobianFunctionMF<T,Ops>() = default;
25+
26+
// Default move and copy operations
27+
JacobianFunctionMF(const JacobianFunctionMF&) = default;
28+
JacobianFunctionMF& operator=(const JacobianFunctionMF&) = default;
29+
JacobianFunctionMF(JacobianFunctionMF&&) = default;
30+
JacobianFunctionMF& operator=(JacobianFunctionMF&&) = default;
2831

2932
void apply ( T& a_dF, const T& a_dU );
3033

Source/NonlinearSolvers/NewtonSolver.H

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public:
3131
Ops* a_ops ) override;
3232

3333
void Solve ( Vec& a_U,
34-
const Vec& a_R,
34+
const Vec& a_b,
3535
amrex::Real a_time,
3636
amrex::Real a_dt ) const override;
3737

Source/NonlinearSolvers/NonlinearSolver.H

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class NonlinearSolver
2020

2121
NonlinearSolver<Vec,Ops>() = default;
2222
virtual ~NonlinearSolver<Vec,Ops>() = default;
23+
24+
// Default move and copy operations
25+
NonlinearSolver(const NonlinearSolver&) = default;
26+
NonlinearSolver& operator=(const NonlinearSolver&) = default;
27+
NonlinearSolver(NonlinearSolver&&) = default;
28+
NonlinearSolver& operator=(NonlinearSolver&&) = default;
2329

2430
virtual void Define ( const Vec&,
2531
Ops* ) = 0;
@@ -29,7 +35,7 @@ class NonlinearSolver
2935
amrex::Real,
3036
amrex::Real ) const = 0;
3137

32-
virtual bool IsDefined () const = 0;
38+
[[nodiscard]] virtual bool IsDefined () const = 0;
3339
virtual void PrintParams () const = 0;
3440
virtual void GetParams (amrex::Real&, amrex::Real&, int&) = 0;
3541

0 commit comments

Comments
 (0)