From 27145d27896c2bcfd52160d79f1c8785b7e62770 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 14 Oct 2021 01:12:04 -0400 Subject: [PATCH] catch up on refactoring default destructors that were missed previously --- lib/poems/fixedpoint.cpp | 5 ----- lib/poems/fixedpoint.h | 4 ++-- lib/poems/mat3x3.cpp | 2 -- lib/poems/mat3x3.h | 2 +- lib/poems/mat4x4.cpp | 2 -- lib/poems/mat4x4.h | 2 +- lib/poems/mat6x6.cpp | 2 -- lib/poems/mat6x6.h | 2 +- lib/poems/vect3.cpp | 2 -- lib/poems/vect3.h | 2 +- lib/poems/vect4.cpp | 2 -- lib/poems/vect4.h | 2 +- lib/poems/vect6.cpp | 2 -- lib/poems/vect6.h | 2 +- lib/poems/virtualcolmatrix.cpp | 3 --- lib/poems/virtualcolmatrix.h | 2 +- lib/poems/virtualmatrix.cpp | 3 +-- lib/poems/virtualrowmatrix.cpp | 3 --- lib/poems/virtualrowmatrix.h | 2 +- src/MACHDYN/fix_smd_move_triangulated_surface.cpp | 9 --------- src/MACHDYN/fix_smd_move_triangulated_surface.h | 2 +- src/OPENMP/thr_omp.cpp | 7 ------- src/OPENMP/thr_omp.h | 2 +- unittest/fortran/wrap_commands.cpp | 4 ++-- 24 files changed, 15 insertions(+), 55 deletions(-) diff --git a/lib/poems/fixedpoint.cpp b/lib/poems/fixedpoint.cpp index 54191622c0..58034989d5 100644 --- a/lib/poems/fixedpoint.cpp +++ b/lib/poems/fixedpoint.cpp @@ -22,11 +22,6 @@ using namespace std; -FixedPoint::FixedPoint(){ -} -FixedPoint::~FixedPoint(){ -} - FixedPoint::FixedPoint(double x, double y, double z){ position(1) = x; position(2) = y; diff --git a/lib/poems/fixedpoint.h b/lib/poems/fixedpoint.h index 4717f7dba9..cd9f7b8546 100644 --- a/lib/poems/fixedpoint.h +++ b/lib/poems/fixedpoint.h @@ -24,8 +24,8 @@ class FixedPoint : public Point { public: - FixedPoint(); - ~FixedPoint(); + FixedPoint() = default; + ~FixedPoint() = default; FixedPoint(double x, double y, double z); FixedPoint(Vect3& v); PointType GetType(); diff --git a/lib/poems/mat3x3.cpp b/lib/poems/mat3x3.cpp index f8dc8928bb..8f56e9e386 100644 --- a/lib/poems/mat3x3.cpp +++ b/lib/poems/mat3x3.cpp @@ -24,8 +24,6 @@ using namespace std; Mat3x3::Mat3x3(){ numrows = numcols = 3; } -Mat3x3::~Mat3x3(){ -} Mat3x3::Mat3x3(const Mat3x3& A){ numrows = numcols = 3; diff --git a/lib/poems/mat3x3.h b/lib/poems/mat3x3.h index b7c0e2dffa..43ce0f6eb9 100644 --- a/lib/poems/mat3x3.h +++ b/lib/poems/mat3x3.h @@ -30,7 +30,7 @@ class Mat3x3 : public VirtualMatrix { double elements[3][3]; public: Mat3x3(); - ~Mat3x3(); + ~Mat3x3() = default; Mat3x3(const Mat3x3& A); // copy constructor Mat3x3(const VirtualMatrix& A); // copy constructor diff --git a/lib/poems/mat4x4.cpp b/lib/poems/mat4x4.cpp index 086637282b..5ee621059d 100644 --- a/lib/poems/mat4x4.cpp +++ b/lib/poems/mat4x4.cpp @@ -23,8 +23,6 @@ using namespace std; Mat4x4::Mat4x4(){ numrows = numcols = 4; } -Mat4x4::~Mat4x4(){ -} Mat4x4::Mat4x4(const Mat4x4& A){ numrows = numcols = 4; diff --git a/lib/poems/mat4x4.h b/lib/poems/mat4x4.h index aac09a67af..7b0332153b 100644 --- a/lib/poems/mat4x4.h +++ b/lib/poems/mat4x4.h @@ -28,7 +28,7 @@ class Mat4x4 : public VirtualMatrix { double elements[4][4]; public: Mat4x4(); - ~Mat4x4(); + ~Mat4x4() = default; Mat4x4(const Mat4x4& A); // copy constructor Mat4x4(const VirtualMatrix& A); // copy constructor diff --git a/lib/poems/mat6x6.cpp b/lib/poems/mat6x6.cpp index b79c0490fc..f3998aa130 100644 --- a/lib/poems/mat6x6.cpp +++ b/lib/poems/mat6x6.cpp @@ -23,8 +23,6 @@ using namespace std; Mat6x6::Mat6x6(){ numrows = numcols = 6; } -Mat6x6::~Mat6x6(){ -} Mat6x6::Mat6x6(const Mat6x6& A){ numrows = numcols = 6; diff --git a/lib/poems/mat6x6.h b/lib/poems/mat6x6.h index 35f0974657..dd22032d46 100644 --- a/lib/poems/mat6x6.h +++ b/lib/poems/mat6x6.h @@ -29,7 +29,7 @@ class Mat6x6 : public VirtualMatrix { double elements[6][6]; public: Mat6x6(); - ~Mat6x6(); + ~Mat6x6() = default; Mat6x6(const Mat6x6& A); // copy constructor Mat6x6(const VirtualMatrix& A); // copy constructor diff --git a/lib/poems/vect3.cpp b/lib/poems/vect3.cpp index d0cb53ff15..2836c1a9d3 100644 --- a/lib/poems/vect3.cpp +++ b/lib/poems/vect3.cpp @@ -23,8 +23,6 @@ using namespace std; Vect3::Vect3(){ numrows = 3; numcols = 1; } -Vect3::~Vect3(){ -} Vect3::Vect3(const Vect3& A){ // copy constructor numrows = 3; numcols = 1; diff --git a/lib/poems/vect3.h b/lib/poems/vect3.h index 0eb4450174..041de608fb 100644 --- a/lib/poems/vect3.h +++ b/lib/poems/vect3.h @@ -30,7 +30,7 @@ class Vect3 : public VirtualColMatrix { double elements[3]; public: Vect3(); - ~Vect3(); + ~Vect3() = default; Vect3(const Vect3& A); // copy constructor Vect3(const VirtualMatrix& A); // copy constructor diff --git a/lib/poems/vect4.cpp b/lib/poems/vect4.cpp index 86b014d129..249eccf1e1 100644 --- a/lib/poems/vect4.cpp +++ b/lib/poems/vect4.cpp @@ -23,8 +23,6 @@ using namespace std; Vect4::Vect4(){ numrows = 4; numcols = 1; } -Vect4::~Vect4(){ -} Vect4::Vect4(const Vect4& A){ // copy constructor numrows = 4; numcols = 1; diff --git a/lib/poems/vect4.h b/lib/poems/vect4.h index 81a3c2143c..28d37313f1 100644 --- a/lib/poems/vect4.h +++ b/lib/poems/vect4.h @@ -28,7 +28,7 @@ class Vect4 : public VirtualColMatrix { double elements[4]; public: Vect4(); - ~Vect4(); + ~Vect4() = default; Vect4(const Vect4& A); // copy constructor Vect4(const VirtualMatrix& A); // copy constructor diff --git a/lib/poems/vect6.cpp b/lib/poems/vect6.cpp index e3fe07e1ea..611a701198 100644 --- a/lib/poems/vect6.cpp +++ b/lib/poems/vect6.cpp @@ -23,8 +23,6 @@ using namespace std; Vect6::Vect6(){ numrows = 6; numcols = 1; } -Vect6::~Vect6(){ -} Vect6::Vect6(const Vect6& A){ // copy constructor numrows = 6; numcols = 1; diff --git a/lib/poems/vect6.h b/lib/poems/vect6.h index 1127daf80e..16ed576ee8 100644 --- a/lib/poems/vect6.h +++ b/lib/poems/vect6.h @@ -29,7 +29,7 @@ class Vect6 : public VirtualColMatrix { double elements[6]; public: Vect6(); - ~Vect6(); + ~Vect6() = default; Vect6(const Vect6& A); // copy constructor Vect6(const VirtualMatrix& A); // copy constructor diff --git a/lib/poems/virtualcolmatrix.cpp b/lib/poems/virtualcolmatrix.cpp index e004458731..adf7bab3fb 100644 --- a/lib/poems/virtualcolmatrix.cpp +++ b/lib/poems/virtualcolmatrix.cpp @@ -25,9 +25,6 @@ VirtualColMatrix::VirtualColMatrix(){ numcols = 1; } -VirtualColMatrix::~VirtualColMatrix(){ -} - double& VirtualColMatrix::operator_2int(int i, int j){ if(j!=1){ cerr << "matrix index invalid in operator ()" << endl; diff --git a/lib/poems/virtualcolmatrix.h b/lib/poems/virtualcolmatrix.h index e0af8b4ae7..e8e348d9d1 100644 --- a/lib/poems/virtualcolmatrix.h +++ b/lib/poems/virtualcolmatrix.h @@ -25,7 +25,7 @@ class VirtualColMatrix : public VirtualMatrix { public: VirtualColMatrix(); - ~VirtualColMatrix(); + ~VirtualColMatrix() = default; double& operator_2int (int i, int j); // array access double Get_2int (int i, int j) const; void Set_2int (int i, int j, double value); diff --git a/lib/poems/virtualmatrix.cpp b/lib/poems/virtualmatrix.cpp index 938c69c037..89e595e648 100644 --- a/lib/poems/virtualmatrix.cpp +++ b/lib/poems/virtualmatrix.cpp @@ -26,8 +26,7 @@ VirtualMatrix::VirtualMatrix(){ numrows = numcols = 0; } -VirtualMatrix::~VirtualMatrix(){ -} +VirtualMatrix::~VirtualMatrix()= default; int VirtualMatrix::GetNumRows() const { return numrows; diff --git a/lib/poems/virtualrowmatrix.cpp b/lib/poems/virtualrowmatrix.cpp index 6d2976a584..9d52de73f4 100644 --- a/lib/poems/virtualrowmatrix.cpp +++ b/lib/poems/virtualrowmatrix.cpp @@ -26,9 +26,6 @@ VirtualRowMatrix::VirtualRowMatrix(){ numrows = 1; } -VirtualRowMatrix::~VirtualRowMatrix(){ -} - double& VirtualRowMatrix::operator_2int (int i, int j){ if(i!=1){ cerr << "matrix index invalid in operator ()" << endl; diff --git a/lib/poems/virtualrowmatrix.h b/lib/poems/virtualrowmatrix.h index 9b1a3bbc44..122ba910da 100644 --- a/lib/poems/virtualrowmatrix.h +++ b/lib/poems/virtualrowmatrix.h @@ -24,7 +24,7 @@ class VirtualRowMatrix : public VirtualMatrix { public: VirtualRowMatrix(); - ~VirtualRowMatrix(); + ~VirtualRowMatrix() = default; double& operator_2int (int i, int j); // array access double Get_2int(int i, int j) const; void Set_2int(int i, int j, double value); diff --git a/src/MACHDYN/fix_smd_move_triangulated_surface.cpp b/src/MACHDYN/fix_smd_move_triangulated_surface.cpp index c790720e99..6fc8a1dadc 100644 --- a/src/MACHDYN/fix_smd_move_triangulated_surface.cpp +++ b/src/MACHDYN/fix_smd_move_triangulated_surface.cpp @@ -215,15 +215,6 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixSMDMoveTriSurf::~FixSMDMoveTriSurf() -{ - // unregister callbacks to this fix from Atom class - //atom->delete_callback(id,Atom::GROW); - //atom->delete_callback(id,Atom::RESTART); -} - -/* ---------------------------------------------------------------------- */ - int FixSMDMoveTriSurf::setmask() { int mask = 0; mask |= INITIAL_INTEGRATE; diff --git a/src/MACHDYN/fix_smd_move_triangulated_surface.h b/src/MACHDYN/fix_smd_move_triangulated_surface.h index aec2fcb688..e64d2fc409 100644 --- a/src/MACHDYN/fix_smd_move_triangulated_surface.h +++ b/src/MACHDYN/fix_smd_move_triangulated_surface.h @@ -39,7 +39,7 @@ namespace LAMMPS_NS { class FixSMDMoveTriSurf : public Fix { public: FixSMDMoveTriSurf(class LAMMPS *, int, char **); - ~FixSMDMoveTriSurf(); + ~FixSMDMoveTriSurf() = default; int setmask(); virtual void init(); virtual void initial_integrate(int); diff --git a/src/OPENMP/thr_omp.cpp b/src/OPENMP/thr_omp.cpp index 7f4bc95e8c..73a5f97ca2 100644 --- a/src/OPENMP/thr_omp.cpp +++ b/src/OPENMP/thr_omp.cpp @@ -53,13 +53,6 @@ ThrOMP::ThrOMP(LAMMPS *ptr, int style) fix = static_cast(lmp->modify->fix[ifix]); } -/* ---------------------------------------------------------------------- */ - -ThrOMP::~ThrOMP() -{ - // nothing to do? -} - /* ---------------------------------------------------------------------- Hook up per thread per atom arrays into the tally infrastructure ---------------------------------------------------------------------- */ diff --git a/src/OPENMP/thr_omp.h b/src/OPENMP/thr_omp.h index c35ca9a056..78d93bd55f 100644 --- a/src/OPENMP/thr_omp.h +++ b/src/OPENMP/thr_omp.h @@ -46,7 +46,7 @@ class ThrOMP { public: ThrOMP(LAMMPS *, int); - virtual ~ThrOMP(); + virtual ~ThrOMP() = default; double memory_usage_thr(); diff --git a/unittest/fortran/wrap_commands.cpp b/unittest/fortran/wrap_commands.cpp index bdf38144c5..2605cb7295 100644 --- a/unittest/fortran/wrap_commands.cpp +++ b/unittest/fortran/wrap_commands.cpp @@ -21,8 +21,8 @@ double f_lammps_get_natoms(); class LAMMPS_commands : public ::testing::Test { protected: LAMMPS_NS::LAMMPS *lmp; - LAMMPS_commands(){}; - ~LAMMPS_commands() override{}; + LAMMPS_commands() = default; + ~LAMMPS_commands() override = default; void SetUp() override {