diff --git a/lib/poems/body23joint.cpp b/lib/poems/body23joint.cpp index 2f024a9a58..ef6d888aaf 100644 --- a/lib/poems/body23joint.cpp +++ b/lib/poems/body23joint.cpp @@ -30,8 +30,7 @@ Body23Joint::Body23Joint(){ DimQandU(4,2); } -Body23Joint::~Body23Joint(){ -} +Body23Joint::~Body23Joint() = default; JointType Body23Joint::GetType(){ return BODY23JOINT; 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/freebodyjoint.cpp b/lib/poems/freebodyjoint.cpp index 113440bb08..84e47a25f6 100644 --- a/lib/poems/freebodyjoint.cpp +++ b/lib/poems/freebodyjoint.cpp @@ -30,8 +30,7 @@ FreeBodyJoint::FreeBodyJoint(){ DimQandU(7,6); } -FreeBodyJoint::~FreeBodyJoint(){ -} +FreeBodyJoint::~FreeBodyJoint() = default; JointType FreeBodyJoint::GetType(){ return FREEBODYJOINT; diff --git a/lib/poems/inertialframe.cpp b/lib/poems/inertialframe.cpp index d2939260b0..10d10f777c 100644 --- a/lib/poems/inertialframe.cpp +++ b/lib/poems/inertialframe.cpp @@ -33,8 +33,7 @@ InertialFrame::InertialFrame(){ alpha.Zeros(); alpha_t.Zeros(); } -InertialFrame::~InertialFrame(){ -} +InertialFrame::~InertialFrame() = default; BodyType InertialFrame::GetType(){ return INERTIALFRAME; diff --git a/lib/poems/joint.cpp b/lib/poems/joint.cpp index 6bd5029e1c..37028f3a97 100644 --- a/lib/poems/joint.cpp +++ b/lib/poems/joint.cpp @@ -33,8 +33,7 @@ Joint::Joint(){ pk_C_k.Identity(); } -Joint::~Joint(){ -} +Joint::~Joint() = default; void Joint::SetBodies(Body* b1, Body* b2){ body1 = b1; 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/mixedjoint.cpp b/lib/poems/mixedjoint.cpp index 8597b3bb46..f9aad39615 100644 --- a/lib/poems/mixedjoint.cpp +++ b/lib/poems/mixedjoint.cpp @@ -26,11 +26,9 @@ -MixedJoint::MixedJoint(){ -} +MixedJoint::MixedJoint() = default; -MixedJoint::~MixedJoint(){ -} +MixedJoint::~MixedJoint() = default; JointType MixedJoint::GetType(){ return MIXEDJOINT; diff --git a/lib/poems/particle.cpp b/lib/poems/particle.cpp index 1993136923..0094a81ec0 100644 --- a/lib/poems/particle.cpp +++ b/lib/poems/particle.cpp @@ -19,11 +19,9 @@ #include "particle.h" #include "fixedpoint.h" -Particle::Particle(){ -} +Particle::Particle() = default; -Particle::~Particle(){ -} +Particle::~Particle() = default; BodyType Particle::GetType(){ return PARTICLE; diff --git a/lib/poems/point.cpp b/lib/poems/point.cpp index 680c30598e..a742473669 100644 --- a/lib/poems/point.cpp +++ b/lib/poems/point.cpp @@ -21,8 +21,7 @@ Point::Point(){ position.Zeros(); } -Point::~Point(){ -} +Point::~Point() = default; bool Point::ReadIn(std::istream& in){ return ReadInPointData(in); diff --git a/lib/poems/prismaticjoint.cpp b/lib/poems/prismaticjoint.cpp index e0a0e7b87a..b40705c8dc 100644 --- a/lib/poems/prismaticjoint.cpp +++ b/lib/poems/prismaticjoint.cpp @@ -27,8 +27,7 @@ PrismaticJoint::PrismaticJoint(){ u.Dim(1); udot.Dim(1); } -PrismaticJoint::~PrismaticJoint(){ -} +PrismaticJoint::~PrismaticJoint() = default; JointType PrismaticJoint::GetType(){ return PRISMATICJOINT; diff --git a/lib/poems/revolutejoint.cpp b/lib/poems/revolutejoint.cpp index eef83dc978..5a4ad3edfd 100644 --- a/lib/poems/revolutejoint.cpp +++ b/lib/poems/revolutejoint.cpp @@ -29,8 +29,7 @@ RevoluteJoint::RevoluteJoint(){ SetAxisPK(axis); } -RevoluteJoint::~RevoluteJoint(){ -} +RevoluteJoint::~RevoluteJoint() = default; JointType RevoluteJoint::GetType(){ return REVOLUTEJOINT; diff --git a/lib/poems/rigidbody.cpp b/lib/poems/rigidbody.cpp index 92963f93da..f5063df1e2 100644 --- a/lib/poems/rigidbody.cpp +++ b/lib/poems/rigidbody.cpp @@ -20,10 +20,8 @@ using namespace std; -RigidBody::RigidBody(){ -} -RigidBody::~RigidBody(){ -} +RigidBody::RigidBody() = default; +RigidBody::~RigidBody() = default; BodyType RigidBody::GetType(){ return RIGIDBODY; diff --git a/lib/poems/solver.cpp b/lib/poems/solver.cpp index 8380553d92..f6d0996d88 100644 --- a/lib/poems/solver.cpp +++ b/lib/poems/solver.cpp @@ -19,12 +19,9 @@ #include "system.h" #include "matrices.h" -Solver::Solver(){ +Solver::Solver() = default; -} - -Solver::~Solver(){ -} +Solver::~Solver() = default; void Solver::SetSystem(System* s){ system = s; diff --git a/lib/poems/sphericaljoint.cpp b/lib/poems/sphericaljoint.cpp index aadd3ebd67..e03ee77914 100644 --- a/lib/poems/sphericaljoint.cpp +++ b/lib/poems/sphericaljoint.cpp @@ -30,8 +30,7 @@ SphericalJoint::SphericalJoint(){ DimQandU(4,3); } -SphericalJoint::~SphericalJoint(){ -} +SphericalJoint::~SphericalJoint() = default; JointType SphericalJoint::GetType(){ return SPHERICALJOINT; 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/BOCS/fix_bocs.cpp b/src/BOCS/fix_bocs.cpp index 786ff216b0..61339cd31a 100644 --- a/src/BOCS/fix_bocs.cpp +++ b/src/BOCS/fix_bocs.cpp @@ -637,7 +637,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type ) char line[MAX_F_TABLE_LINE_LENGTH]; std::vector inputLines; while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) { - inputLines.push_back(std::string(line)); + inputLines.emplace_back(line); } fclose(fpi); diff --git a/src/CG-DNA/atom_vec_oxdna.cpp b/src/CG-DNA/atom_vec_oxdna.cpp index e1c99d7ca5..120fe5d9ac 100644 --- a/src/CG-DNA/atom_vec_oxdna.cpp +++ b/src/CG-DNA/atom_vec_oxdna.cpp @@ -52,9 +52,6 @@ AtomVecOxdna::AtomVecOxdna(LAMMPS *lmp) : AtomVec(lmp) error->warning(FLERR, "Write_data command requires newton on to preserve 3'->5' bond polarity"); } -/* ---------------------------------------------------------------------- */ -AtomVecOxdna::~AtomVecOxdna() {} - /* ---------------------------------------------------------------------- set local copies of all grow ptrs used by this class, except defaults needed in replicate when 2 atom classes exist and it calls pack_restart() diff --git a/src/CG-DNA/atom_vec_oxdna.h b/src/CG-DNA/atom_vec_oxdna.h index f05f6d2013..c100abdfff 100644 --- a/src/CG-DNA/atom_vec_oxdna.h +++ b/src/CG-DNA/atom_vec_oxdna.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class AtomVecOxdna : public AtomVec { public: AtomVecOxdna(class LAMMPS *); - ~AtomVecOxdna(); + ~AtomVecOxdna() = default; void grow_pointers(); void data_atom_post(int); diff --git a/src/COMPRESS/dump_atom_gz.cpp b/src/COMPRESS/dump_atom_gz.cpp index 5f799054bb..8bdc025436 100644 --- a/src/COMPRESS/dump_atom_gz.cpp +++ b/src/COMPRESS/dump_atom_gz.cpp @@ -27,10 +27,6 @@ DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, narg, if (!compressed) error->all(FLERR, "Dump atom/gz only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpAtomGZ::~DumpAtomGZ() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_atom_gz.h b/src/COMPRESS/dump_atom_gz.h index 777c34345a..2b87e36f1d 100644 --- a/src/COMPRESS/dump_atom_gz.h +++ b/src/COMPRESS/dump_atom_gz.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DumpAtomGZ : public DumpAtom { public: DumpAtomGZ(class LAMMPS *, int, char **); - virtual ~DumpAtomGZ(); + virtual ~DumpAtomGZ() = default; protected: GzFileWriter writer; diff --git a/src/COMPRESS/dump_atom_zstd.cpp b/src/COMPRESS/dump_atom_zstd.cpp index a23ea2025b..aa1c161d73 100644 --- a/src/COMPRESS/dump_atom_zstd.cpp +++ b/src/COMPRESS/dump_atom_zstd.cpp @@ -33,10 +33,6 @@ DumpAtomZstd::DumpAtomZstd(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, na if (!compressed) error->all(FLERR, "Dump atom/zstd only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpAtomZstd::~DumpAtomZstd() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_atom_zstd.h b/src/COMPRESS/dump_atom_zstd.h index 4a85089167..fb2da0c83b 100644 --- a/src/COMPRESS/dump_atom_zstd.h +++ b/src/COMPRESS/dump_atom_zstd.h @@ -34,7 +34,7 @@ namespace LAMMPS_NS { class DumpAtomZstd : public DumpAtom { public: DumpAtomZstd(class LAMMPS *, int, char **); - virtual ~DumpAtomZstd(); + virtual ~DumpAtomZstd() = default; protected: ZstdFileWriter writer; diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index 8d6347d978..8d85e8cf83 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -29,10 +29,6 @@ DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg if (!compressed) error->all(FLERR, "Dump cfg/gz only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpCFGGZ::~DumpCFGGZ() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_cfg_gz.h b/src/COMPRESS/dump_cfg_gz.h index ccd40141eb..153a4490c6 100644 --- a/src/COMPRESS/dump_cfg_gz.h +++ b/src/COMPRESS/dump_cfg_gz.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DumpCFGGZ : public DumpCFG { public: DumpCFGGZ(class LAMMPS *, int, char **); - virtual ~DumpCFGGZ(); + virtual ~DumpCFGGZ() = default; protected: GzFileWriter writer; diff --git a/src/COMPRESS/dump_cfg_zstd.cpp b/src/COMPRESS/dump_cfg_zstd.cpp index 73ee3e7e11..6d70749479 100644 --- a/src/COMPRESS/dump_cfg_zstd.cpp +++ b/src/COMPRESS/dump_cfg_zstd.cpp @@ -35,10 +35,6 @@ DumpCFGZstd::DumpCFGZstd(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, if (!compressed) error->all(FLERR, "Dump cfg/zstd only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpCFGZstd::~DumpCFGZstd() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_cfg_zstd.h b/src/COMPRESS/dump_cfg_zstd.h index ddcb06f00e..32013b274e 100644 --- a/src/COMPRESS/dump_cfg_zstd.h +++ b/src/COMPRESS/dump_cfg_zstd.h @@ -33,7 +33,7 @@ namespace LAMMPS_NS { class DumpCFGZstd : public DumpCFG { public: DumpCFGZstd(class LAMMPS *, int, char **); - virtual ~DumpCFGZstd(); + virtual ~DumpCFGZstd() = default; protected: ZstdFileWriter writer; diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index f40cf8d3d1..a8ef1ffe7c 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -27,10 +27,6 @@ DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustom(lmp, if (!compressed) error->all(FLERR, "Dump custom/gz only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpCustomGZ::~DumpCustomGZ() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_custom_gz.h b/src/COMPRESS/dump_custom_gz.h index 10455eb8db..660af8bfae 100644 --- a/src/COMPRESS/dump_custom_gz.h +++ b/src/COMPRESS/dump_custom_gz.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DumpCustomGZ : public DumpCustom { public: DumpCustomGZ(class LAMMPS *, int, char **); - virtual ~DumpCustomGZ(); + virtual ~DumpCustomGZ() = default; protected: GzFileWriter writer; diff --git a/src/COMPRESS/dump_custom_zstd.cpp b/src/COMPRESS/dump_custom_zstd.cpp index 347c9c08e2..c6c7e3592e 100644 --- a/src/COMPRESS/dump_custom_zstd.cpp +++ b/src/COMPRESS/dump_custom_zstd.cpp @@ -37,12 +37,6 @@ DumpCustomZstd::DumpCustomZstd(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Dump custom/zstd only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpCustomZstd::~DumpCustomZstd() -{ -} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_custom_zstd.h b/src/COMPRESS/dump_custom_zstd.h index a687cfb928..f179223265 100644 --- a/src/COMPRESS/dump_custom_zstd.h +++ b/src/COMPRESS/dump_custom_zstd.h @@ -34,7 +34,7 @@ namespace LAMMPS_NS { class DumpCustomZstd : public DumpCustom { public: DumpCustomZstd(class LAMMPS *, int, char **); - virtual ~DumpCustomZstd(); + virtual ~DumpCustomZstd() = default; protected: ZstdFileWriter writer; diff --git a/src/COMPRESS/dump_local_gz.cpp b/src/COMPRESS/dump_local_gz.cpp index a23fa1a1ac..c3669e6157 100644 --- a/src/COMPRESS/dump_local_gz.cpp +++ b/src/COMPRESS/dump_local_gz.cpp @@ -27,10 +27,6 @@ DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocal(lmp, nar if (!compressed) error->all(FLERR, "Dump local/gz only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpLocalGZ::~DumpLocalGZ() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_local_gz.h b/src/COMPRESS/dump_local_gz.h index a6b1b118b7..e2e7a028aa 100644 --- a/src/COMPRESS/dump_local_gz.h +++ b/src/COMPRESS/dump_local_gz.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DumpLocalGZ : public DumpLocal { public: DumpLocalGZ(class LAMMPS *, int, char **); - virtual ~DumpLocalGZ(); + virtual ~DumpLocalGZ() = default; protected: GzFileWriter writer; diff --git a/src/COMPRESS/dump_local_zstd.cpp b/src/COMPRESS/dump_local_zstd.cpp index 1d3fc4756e..63af89afcc 100644 --- a/src/COMPRESS/dump_local_zstd.cpp +++ b/src/COMPRESS/dump_local_zstd.cpp @@ -33,10 +33,6 @@ DumpLocalZstd::DumpLocalZstd(LAMMPS *lmp, int narg, char **arg) : DumpLocal(lmp, if (!compressed) error->all(FLERR, "Dump local/zstd only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpLocalZstd::~DumpLocalZstd() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_local_zstd.h b/src/COMPRESS/dump_local_zstd.h index c14e58fd71..fb4f017b3d 100644 --- a/src/COMPRESS/dump_local_zstd.h +++ b/src/COMPRESS/dump_local_zstd.h @@ -34,7 +34,7 @@ namespace LAMMPS_NS { class DumpLocalZstd : public DumpLocal { public: DumpLocalZstd(class LAMMPS *, int, char **); - virtual ~DumpLocalZstd(); + virtual ~DumpLocalZstd() = default; protected: ZstdFileWriter writer; diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index 2d9548bf14..9d38c4673c 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -26,10 +26,6 @@ DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZ(lmp, narg, arg if (!compressed) error->all(FLERR, "Dump xyz/gz only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpXYZGZ::~DumpXYZGZ() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_xyz_gz.h b/src/COMPRESS/dump_xyz_gz.h index 5fe60ced6f..62a25cfc66 100644 --- a/src/COMPRESS/dump_xyz_gz.h +++ b/src/COMPRESS/dump_xyz_gz.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class DumpXYZGZ : public DumpXYZ { public: DumpXYZGZ(class LAMMPS *, int, char **); - virtual ~DumpXYZGZ(); + virtual ~DumpXYZGZ() = default; protected: GzFileWriter writer; diff --git a/src/COMPRESS/dump_xyz_zstd.cpp b/src/COMPRESS/dump_xyz_zstd.cpp index b56488ec09..bcbdc08a24 100644 --- a/src/COMPRESS/dump_xyz_zstd.cpp +++ b/src/COMPRESS/dump_xyz_zstd.cpp @@ -32,10 +32,6 @@ DumpXYZZstd::DumpXYZZstd(LAMMPS *lmp, int narg, char **arg) : DumpXYZ(lmp, narg, if (!compressed) error->all(FLERR, "Dump xyz/zstd only writes compressed files"); } -/* ---------------------------------------------------------------------- */ - -DumpXYZZstd::~DumpXYZZstd() {} - /* ---------------------------------------------------------------------- generic opening of a dump file ASCII or binary or compressed diff --git a/src/COMPRESS/dump_xyz_zstd.h b/src/COMPRESS/dump_xyz_zstd.h index add279c4e7..110e27ab8f 100644 --- a/src/COMPRESS/dump_xyz_zstd.h +++ b/src/COMPRESS/dump_xyz_zstd.h @@ -34,7 +34,7 @@ namespace LAMMPS_NS { class DumpXYZZstd : public DumpXYZ { public: DumpXYZZstd(class LAMMPS *, int, char **); - virtual ~DumpXYZZstd(); + virtual ~DumpXYZZstd() = default; protected: ZstdFileWriter writer; diff --git a/src/DIELECTRIC/fix_polarize_bem_icc.cpp b/src/DIELECTRIC/fix_polarize_bem_icc.cpp index 35171c0a19..7bd6ff25bd 100644 --- a/src/DIELECTRIC/fix_polarize_bem_icc.cpp +++ b/src/DIELECTRIC/fix_polarize_bem_icc.cpp @@ -93,10 +93,6 @@ FixPolarizeBEMICC::FixPolarizeBEMICC(LAMMPS *lmp, int narg, char **arg) : Fix(lm /* ---------------------------------------------------------------------- */ -FixPolarizeBEMICC::~FixPolarizeBEMICC() {} - -/* ---------------------------------------------------------------------- */ - int FixPolarizeBEMICC::setmask() { int mask = 0; diff --git a/src/DIELECTRIC/fix_polarize_bem_icc.h b/src/DIELECTRIC/fix_polarize_bem_icc.h index 6ba6acb1a0..df04b52fdf 100644 --- a/src/DIELECTRIC/fix_polarize_bem_icc.h +++ b/src/DIELECTRIC/fix_polarize_bem_icc.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixPolarizeBEMICC : public Fix { public: FixPolarizeBEMICC(class LAMMPS *, int, char **); - ~FixPolarizeBEMICC(); + ~FixPolarizeBEMICC() = default; virtual int setmask(); virtual void init(); virtual void setup(int); diff --git a/src/DPD-MESO/fix_edpd_source.cpp b/src/DPD-MESO/fix_edpd_source.cpp index 0ad303516a..83ff896ff9 100644 --- a/src/DPD-MESO/fix_edpd_source.cpp +++ b/src/DPD-MESO/fix_edpd_source.cpp @@ -61,12 +61,6 @@ FixEDPDSource::FixEDPDSource(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixEDPDSource::~FixEDPDSource() -{ -} - -/* ---------------------------------------------------------------------- */ - int FixEDPDSource::setmask() { int mask = 0; diff --git a/src/DPD-MESO/fix_edpd_source.h b/src/DPD-MESO/fix_edpd_source.h index 0d6fab1d9d..13eecc7c56 100644 --- a/src/DPD-MESO/fix_edpd_source.h +++ b/src/DPD-MESO/fix_edpd_source.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixEDPDSource : public Fix { public: FixEDPDSource(class LAMMPS *, int, char **); - ~FixEDPDSource(); + ~FixEDPDSource() = default; int setmask(); void init(); void post_force(int); diff --git a/src/DPD-MESO/fix_tdpd_source.cpp b/src/DPD-MESO/fix_tdpd_source.cpp index 5eb7416d5b..80848d553d 100644 --- a/src/DPD-MESO/fix_tdpd_source.cpp +++ b/src/DPD-MESO/fix_tdpd_source.cpp @@ -62,12 +62,6 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ -FixTDPDSource::~FixTDPDSource() -{ -} - -/* ---------------------------------------------------------------------- */ - int FixTDPDSource::setmask() { int mask = 0; diff --git a/src/DPD-MESO/fix_tdpd_source.h b/src/DPD-MESO/fix_tdpd_source.h index fe0a806ac2..8bd9778ed0 100644 --- a/src/DPD-MESO/fix_tdpd_source.h +++ b/src/DPD-MESO/fix_tdpd_source.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixTDPDSource : public Fix { public: FixTDPDSource(class LAMMPS *, int, char **); - ~FixTDPDSource(); + ~FixTDPDSource() = default; int setmask(); void init(); void post_force(int); diff --git a/src/DPD-REACT/nbin_ssa.cpp b/src/DPD-REACT/nbin_ssa.cpp index 993a41b356..c6ef22fe7d 100644 --- a/src/DPD-REACT/nbin_ssa.cpp +++ b/src/DPD-REACT/nbin_ssa.cpp @@ -34,10 +34,6 @@ NBinSSA::NBinSSA(LAMMPS *lmp) : NBinStandard(lmp) } } -NBinSSA::~NBinSSA() -{ -} - /* ---------------------------------------------------------------------- bin owned and ghost atoms for the Shardlow Splitting Algorithm (SSA) local atoms are in distinct bins (binhead[]) from the ghosts diff --git a/src/DPD-REACT/nbin_ssa.h b/src/DPD-REACT/nbin_ssa.h index c09ef7b692..5285c5b44d 100644 --- a/src/DPD-REACT/nbin_ssa.h +++ b/src/DPD-REACT/nbin_ssa.h @@ -41,7 +41,7 @@ class NBinSSA : public NBinStandard { int lbinzhi; // highest local bin z-dim coordinate NBinSSA(class LAMMPS *); - ~NBinSSA(); + virtual ~NBinSSA() = default; void bin_atoms_setup(int); void bin_atoms(); diff --git a/src/KSPACE/ewald_dipole_spin.cpp b/src/KSPACE/ewald_dipole_spin.cpp index 6f093d5d0a..1f08205f21 100644 --- a/src/KSPACE/ewald_dipole_spin.cpp +++ b/src/KSPACE/ewald_dipole_spin.cpp @@ -51,12 +51,6 @@ EwaldDipoleSpin::EwaldDipoleSpin(LAMMPS *lmp) : mub2mu0hbinv = mub2mu0 / hbar; // in rad.THz } -/* ---------------------------------------------------------------------- - free all memory -------------------------------------------------------------------------- */ - -EwaldDipoleSpin::~EwaldDipoleSpin() {} - /* ---------------------------------------------------------------------- called once before run ------------------------------------------------------------------------- */ diff --git a/src/KSPACE/ewald_dipole_spin.h b/src/KSPACE/ewald_dipole_spin.h index eb87c69ae2..4660dde987 100644 --- a/src/KSPACE/ewald_dipole_spin.h +++ b/src/KSPACE/ewald_dipole_spin.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class EwaldDipoleSpin : public EwaldDipole { public: EwaldDipoleSpin(class LAMMPS *); - virtual ~EwaldDipoleSpin(); + virtual ~EwaldDipoleSpin() = default; void init(); void setup(); void compute(int, int); diff --git a/src/LATBOLTZ/fix_lb_viscous.cpp b/src/LATBOLTZ/fix_lb_viscous.cpp index 95e36a98a9..0873a0fc94 100644 --- a/src/LATBOLTZ/fix_lb_viscous.cpp +++ b/src/LATBOLTZ/fix_lb_viscous.cpp @@ -55,13 +55,6 @@ FixLbViscous::FixLbViscous(LAMMPS *lmp, int narg, char **arg) : } -} - -/* ---------------------------------------------------------------------- */ - -FixLbViscous::~FixLbViscous() -{ - } /* ---------------------------------------------------------------------- */ diff --git a/src/LATBOLTZ/fix_lb_viscous.h b/src/LATBOLTZ/fix_lb_viscous.h index 1d08a15463..8c86e47553 100644 --- a/src/LATBOLTZ/fix_lb_viscous.h +++ b/src/LATBOLTZ/fix_lb_viscous.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixLbViscous : public Fix { public: FixLbViscous(class LAMMPS *, int, char **); - ~FixLbViscous(); + virtual ~FixLbViscous() = default; int setmask(); void init(); void setup(int); 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/MANIFOLD/manifold_thylakoid_shared.cpp b/src/MANIFOLD/manifold_thylakoid_shared.cpp index b71cf23e5e..5efc20a298 100644 --- a/src/MANIFOLD/manifold_thylakoid_shared.cpp +++ b/src/MANIFOLD/manifold_thylakoid_shared.cpp @@ -90,11 +90,6 @@ thyla_part::thyla_part( int type, double *args, double xlo, double ylo, double z z0 = (type == THYLA_TYPE_SPHERE) ? params[3] : params[5]; } - - -thyla_part::~thyla_part() -{} - double thyla_part::g(const double *x) { switch(type) { diff --git a/src/MANIFOLD/manifold_thylakoid_shared.h b/src/MANIFOLD/manifold_thylakoid_shared.h index a90d5e8801..67909802b0 100644 --- a/src/MANIFOLD/manifold_thylakoid_shared.h +++ b/src/MANIFOLD/manifold_thylakoid_shared.h @@ -33,7 +33,7 @@ namespace user_manifold { thyla_part(int type, double *args, double xlo, double ylo, double zlo, double xhi, double yhi, double zhi); thyla_part() : type(-1), x0(-1337), y0(-1337), z0(-1337) {} - ~thyla_part(); + ~thyla_part() = default; double g(const double *x); void n(const double *x, double *n); diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp index 2acf58f738..b69d17f0a9 100644 --- a/src/MEAM/pair_meam.cpp +++ b/src/MEAM/pair_meam.cpp @@ -255,7 +255,7 @@ void PairMEAM::coeff(int narg, char **arg) "'maxelt' in meam.h and recompile.", maxelt); for (int i = 0; i < nlibelements; i++) { - libelements.push_back(arg[i+3]); + libelements.emplace_back(arg[i+3]); mass.push_back(0.0); } diff --git a/src/MESONT/pair_mesont_tpm.cpp b/src/MESONT/pair_mesont_tpm.cpp index 64aeeeeadd..425722a569 100644 --- a/src/MESONT/pair_mesont_tpm.cpp +++ b/src/MESONT/pair_mesont_tpm.cpp @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; class MESONTList { public: MESONTList(const Atom* atom, const NeighList* nblist); - ~MESONTList() {}; + ~MESONTList() = default;; //list of segments const std::vector>& get_segments() const; //list of triplets diff --git a/src/ML-IAP/mliap_model_linear.cpp b/src/ML-IAP/mliap_model_linear.cpp index 1323b95aa1..08654783d8 100644 --- a/src/ML-IAP/mliap_model_linear.cpp +++ b/src/ML-IAP/mliap_model_linear.cpp @@ -31,10 +31,6 @@ MLIAPModelLinear::MLIAPModelLinear(LAMMPS* lmp, char* coefffilename) : if (nparams > 0) ndescriptors = nparams - 1; } -/* ---------------------------------------------------------------------- */ - -MLIAPModelLinear::~MLIAPModelLinear() {} - /* ---------------------------------------------------------------------- get number of parameters ---------------------------------------------------------------------- */ diff --git a/src/ML-IAP/mliap_model_linear.h b/src/ML-IAP/mliap_model_linear.h index b485e58eff..d2abaec31e 100644 --- a/src/ML-IAP/mliap_model_linear.h +++ b/src/ML-IAP/mliap_model_linear.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class MLIAPModelLinear : public MLIAPModelSimple { public: MLIAPModelLinear(LAMMPS *, char * = nullptr); - ~MLIAPModelLinear(); + ~MLIAPModelLinear() = default; virtual int get_nparams(); virtual int get_gamma_nnz(class MLIAPData *); virtual void compute_gradients(class MLIAPData *); diff --git a/src/ML-IAP/mliap_model_quadratic.cpp b/src/ML-IAP/mliap_model_quadratic.cpp index a881c7848c..10507adc91 100644 --- a/src/ML-IAP/mliap_model_quadratic.cpp +++ b/src/ML-IAP/mliap_model_quadratic.cpp @@ -34,10 +34,6 @@ MLIAPModelQuadratic::MLIAPModelQuadratic(LAMMPS* lmp, char* coefffilename) : nonlinearflag = 1; } -/* ---------------------------------------------------------------------- */ - -MLIAPModelQuadratic::~MLIAPModelQuadratic() {} - /* ---------------------------------------------------------------------- get number of parameters ---------------------------------------------------------------------- */ diff --git a/src/ML-IAP/mliap_model_quadratic.h b/src/ML-IAP/mliap_model_quadratic.h index c183178339..74234066c8 100644 --- a/src/ML-IAP/mliap_model_quadratic.h +++ b/src/ML-IAP/mliap_model_quadratic.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class MLIAPModelQuadratic : public MLIAPModelSimple { public: MLIAPModelQuadratic(LAMMPS *, char * = nullptr); - ~MLIAPModelQuadratic(); + ~MLIAPModelQuadratic() = default; virtual int get_nparams(); virtual int get_gamma_nnz(class MLIAPData *); virtual void compute_gradients(class MLIAPData *); diff --git a/src/ML-RANN/pair_rann.cpp b/src/ML-RANN/pair_rann.cpp index 60ed776c41..fbc54e745f 100644 --- a/src/ML-RANN/pair_rann.cpp +++ b/src/ML-RANN/pair_rann.cpp @@ -432,7 +432,7 @@ void PairRANN::read_atom_types(std::vector line,char *filename,int int nwords = line.size(); if (nwords < 1) error->one(filename,linenum,"Incorrect syntax for atom types"); nelements = nwords; - line.push_back("all"); + line.emplace_back("all"); allocate(line); } diff --git a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp index 43e2fb15e4..6d013c5f7c 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.cpp @@ -41,10 +41,6 @@ PairLJCutCoulCutDielectricOMP::PairLJCutCoulCutDielectricOMP(LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -PairLJCutCoulCutDielectricOMP::~PairLJCutCoulCutDielectricOMP() {} - -/* ---------------------------------------------------------------------- */ - void PairLJCutCoulCutDielectricOMP::compute(int eflag, int vflag) { ev_init(eflag, vflag); diff --git a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h index 093d0a8a42..5f28aa4d17 100644 --- a/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_cut_dielectric_omp.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PairLJCutCoulCutDielectricOMP : public PairLJCutCoulCutDielectric, public ThrOMP { public: PairLJCutCoulCutDielectricOMP(class LAMMPS *); - virtual ~PairLJCutCoulCutDielectricOMP(); + virtual ~PairLJCutCoulCutDielectricOMP() = default; virtual void compute(int, int); protected: diff --git a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp index 6aa79e18a5..c076501d68 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp +++ b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.cpp @@ -47,10 +47,6 @@ PairLJCutCoulLongDielectricOMP::PairLJCutCoulLongDielectricOMP(LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -PairLJCutCoulLongDielectricOMP::~PairLJCutCoulLongDielectricOMP() {} - -/* ---------------------------------------------------------------------- */ - void PairLJCutCoulLongDielectricOMP::compute(int eflag, int vflag) { ev_init(eflag, vflag); diff --git a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h index 0d13c4a92e..f70809524f 100644 --- a/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h +++ b/src/OPENMP/pair_lj_cut_coul_long_dielectric_omp.h @@ -29,7 +29,7 @@ class PairLJCutCoulLongDielectricOMP : public PairLJCutCoulLongDielectric, publi public: PairLJCutCoulLongDielectricOMP(class LAMMPS *); - virtual ~PairLJCutCoulLongDielectricOMP(); + virtual ~PairLJCutCoulLongDielectricOMP() = default; virtual void compute(int, int); protected: diff --git a/src/OPENMP/pair_lubricate_omp.cpp b/src/OPENMP/pair_lubricate_omp.cpp index 0233ea5a06..f2df1b3ee8 100644 --- a/src/OPENMP/pair_lubricate_omp.cpp +++ b/src/OPENMP/pair_lubricate_omp.cpp @@ -47,11 +47,6 @@ PairLubricateOMP::PairLubricateOMP(LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -PairLubricateOMP::~PairLubricateOMP() -{} - -/* ---------------------------------------------------------------------- */ - void PairLubricateOMP::compute(int eflag, int vflag) { ev_init(eflag,vflag); diff --git a/src/OPENMP/pair_lubricate_omp.h b/src/OPENMP/pair_lubricate_omp.h index 27dbe73dd8..1f5fc340bb 100644 --- a/src/OPENMP/pair_lubricate_omp.h +++ b/src/OPENMP/pair_lubricate_omp.h @@ -33,7 +33,7 @@ class PairLubricateOMP : public PairLubricate, public ThrOMP { public: PairLubricateOMP(class LAMMPS *); - virtual ~PairLubricateOMP(); + virtual ~PairLubricateOMP() = default; virtual void compute(int, int); virtual double memory_usage(); diff --git a/src/OPENMP/pair_lubricate_poly_omp.cpp b/src/OPENMP/pair_lubricate_poly_omp.cpp index d3ad6b926c..669b964c73 100644 --- a/src/OPENMP/pair_lubricate_poly_omp.cpp +++ b/src/OPENMP/pair_lubricate_poly_omp.cpp @@ -47,11 +47,6 @@ PairLubricatePolyOMP::PairLubricatePolyOMP(LAMMPS *lmp) : /* ---------------------------------------------------------------------- */ -PairLubricatePolyOMP::~PairLubricatePolyOMP() -{} - -/* ---------------------------------------------------------------------- */ - void PairLubricatePolyOMP::compute(int eflag, int vflag) { ev_init(eflag,vflag); diff --git a/src/OPENMP/pair_lubricate_poly_omp.h b/src/OPENMP/pair_lubricate_poly_omp.h index 7fdfed6c62..5a36d232b8 100644 --- a/src/OPENMP/pair_lubricate_poly_omp.h +++ b/src/OPENMP/pair_lubricate_poly_omp.h @@ -33,7 +33,7 @@ class PairLubricatePolyOMP : public PairLubricatePoly, public ThrOMP { public: PairLubricatePolyOMP(class LAMMPS *); - virtual ~PairLubricatePolyOMP(); + virtual ~PairLubricatePolyOMP() = default; virtual void compute(int, int); virtual double memory_usage(); 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/src/QMMM/fix_qmmm.cpp b/src/QMMM/fix_qmmm.cpp index 4222a82247..8c59077c7d 100644 --- a/src/QMMM/fix_qmmm.cpp +++ b/src/QMMM/fix_qmmm.cpp @@ -822,7 +822,7 @@ void FixQMMM::post_force(int vflag) /* ---------------------------------------------------------------------- */ /* local memory usage. approximately. */ -double FixQMMM::memory_usage(void) +double FixQMMM::memory_usage() { double bytes; diff --git a/src/REAXFF/fix_acks2_reaxff.cpp b/src/REAXFF/fix_acks2_reaxff.cpp index f9a3b384bd..c54fffa9f1 100644 --- a/src/REAXFF/fix_acks2_reaxff.cpp +++ b/src/REAXFF/fix_acks2_reaxff.cpp @@ -66,28 +66,28 @@ static const char cite_fix_acks2_reax[] = FixACKS2ReaxFF::FixACKS2ReaxFF(LAMMPS *lmp, int narg, char **arg) : FixQEqReaxFF(lmp, narg, arg) { - bcut = NULL; + bcut = nullptr; - X_diag = NULL; - Xdia_inv = NULL; + X_diag = nullptr; + Xdia_inv = nullptr; // BiCGStab - g = NULL; - q_hat = NULL; - r_hat = NULL; - y = NULL; - z = NULL; + g = nullptr; + q_hat = nullptr; + r_hat = nullptr; + y = nullptr; + z = nullptr; // X matrix - X.firstnbr = NULL; - X.numnbrs = NULL; - X.jlist = NULL; - X.val = NULL; + X.firstnbr = nullptr; + X.numnbrs = nullptr; + X.jlist = nullptr; + X.val = nullptr; // Update comm sizes for this fix comm_forward = comm_reverse = 2; - s_hist_X = s_hist_last = NULL; + s_hist_X = s_hist_last = nullptr; last_rows_rank = 0; last_rows_flag = (comm->me == last_rows_rank); @@ -149,8 +149,8 @@ void FixACKS2ReaxFF::pertype_parameters(char *arg) bcut_acks2 = (double *) pair->extract("bcut_acks2",tmp); double* bond_softness_ptr = (double *) pair->extract("bond_softness",tmp); - if (chi == NULL || eta == NULL || gamma == NULL || - bcut_acks2 == NULL || bond_softness_ptr == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr || + bcut_acks2 == nullptr || bond_softness_ptr == nullptr) error->all(FLERR, "Fix acks2/reaxff could not extract params from pair reaxff"); bond_softness = *bond_softness_ptr; @@ -303,7 +303,7 @@ void FixACKS2ReaxFF::init_bondcut() int ntypes; ntypes = atom->ntypes; - if (bcut == NULL) + if (bcut == nullptr) memory->create(bcut,ntypes+1,ntypes+1,"acks2:bondcut"); for (i = 1; i <= ntypes; ++i) @@ -856,7 +856,7 @@ void FixACKS2ReaxFF::more_reverse_comm(double *vec) if (last_rows_flag) MPI_Reduce(MPI_IN_PLACE,&vec[2*NN],2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world); else - MPI_Reduce(&vec[2*NN],NULL,2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world); + MPI_Reduce(&vec[2*NN],nullptr,2,MPI_DOUBLE,MPI_SUM,last_rows_rank,world); } /* ---------------------------------------------------------------------- diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index 9731a447a6..74f7aaaf77 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -53,10 +53,6 @@ PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp), emag(nullptr) lattice_flag = 0; } -/* ---------------------------------------------------------------------- */ - -PairSpin::~PairSpin() {} - /* ---------------------------------------------------------------------- global settings ------------------------------------------------------------------------- */ diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index 91262cdb5d..a9341bcb71 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -23,7 +23,7 @@ class PairSpin : public Pair { public: PairSpin(class LAMMPS *); - virtual ~PairSpin(); + virtual ~PairSpin() = default; virtual void settings(int, char **); virtual void coeff(int, char **) {} virtual void init_style(); diff --git a/src/info.cpp b/src/info.cpp index 3d24f9b56a..41e4e5d63b 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -1011,7 +1011,7 @@ std::vector Info::get_available_styles(const std::string &category) } else if (category == "command") { return get_style_names(input->command_map); } - return std::vector(); + return {}; } template diff --git a/src/lmppython.cpp b/src/lmppython.cpp index b7e65d1f02..daebf23c23 100644 --- a/src/lmppython.cpp +++ b/src/lmppython.cpp @@ -38,10 +38,6 @@ Python::~Python() /* ---------------------------------------------------------------------- */ -PythonInterface::~PythonInterface() {} - -/* ---------------------------------------------------------------------- */ - void Python::init() { #if defined(LMP_PYTHON) diff --git a/src/lmppython.h b/src/lmppython.h index 7ecee915e5..3f0ebecae5 100644 --- a/src/lmppython.h +++ b/src/lmppython.h @@ -20,7 +20,7 @@ namespace LAMMPS_NS { class PythonInterface { public: - virtual ~PythonInterface(); + virtual ~PythonInterface() = default; virtual void command(int, char **) = 0; virtual void invoke_function(int, char *) = 0; virtual int find(const char *) = 0; diff --git a/src/molecule.cpp b/src/molecule.cpp index 1a3acf53ba..2c9b03337d 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -2035,7 +2035,7 @@ std::string Molecule::parse_keyword(int flag, char *line) MPI_Bcast(&eof,1,MPI_INT,0,world); if (eof) { - return std::string(""); + return {""}; } // bcast keyword line to all procs diff --git a/src/platform.cpp b/src/platform.cpp index b057c6415b..555026b2ac 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -415,7 +415,7 @@ std::string platform::mpi_info(int &major, int &minor) major = 1; minor = 0; #endif - return std::string(version); + return {version}; } /* ---------------------------------------------------------------------- @@ -543,8 +543,8 @@ void *platform::dlopen(const std::string &fname) std::string platform::dlerror() { const char *errmesg = ::dlerror(); - if (errmesg) return std::string(errmesg); - else return ""; + if (errmesg) return {errmesg}; + else return {""}; } // close a shared object diff --git a/src/table_file_reader.cpp b/src/table_file_reader.cpp index bcd4e91886..bfbd466ae8 100644 --- a/src/table_file_reader.cpp +++ b/src/table_file_reader.cpp @@ -30,9 +30,6 @@ TableFileReader::TableFileReader(LAMMPS *lmp, { } -TableFileReader::~TableFileReader() { -} - char *TableFileReader::find_section_start(const std::string &keyword) { char *line = nullptr; while ((line = reader->next_line())) { diff --git a/src/table_file_reader.h b/src/table_file_reader.h index 643e1ce93c..832e68a34f 100644 --- a/src/table_file_reader.h +++ b/src/table_file_reader.h @@ -25,7 +25,7 @@ class TableFileReader : public PotentialFileReader { public: TableFileReader(class LAMMPS *lmp, const std::string &filename, const std::string &type, const int auto_convert = 0); - virtual ~TableFileReader(); + virtual ~TableFileReader() = default; char *find_section_start(const std::string &keyword); }; diff --git a/src/text_file_reader.cpp b/src/text_file_reader.cpp index 8fc57d9283..ab1c81efb1 100644 --- a/src/text_file_reader.cpp +++ b/src/text_file_reader.cpp @@ -22,6 +22,7 @@ #include "utils.h" #include +#include using namespace LAMMPS_NS; @@ -68,8 +69,8 @@ This function is useful in combination with :cpp:func:`utils::open_potential`. * \param fp File descriptor of the already opened file * \param filetype Description of file type for error messages */ -TextFileReader::TextFileReader(FILE *fp, const std::string &filetype) : - filetype(filetype), closefp(false), fp(fp), ignore_comments(true) +TextFileReader::TextFileReader(FILE *fp, std::string filetype) : + filetype(std::move(filetype)), closefp(false), fp(fp), ignore_comments(true) { if (fp == nullptr) throw FileReaderException("Invalid file descriptor"); } diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 826f470299..34556d7eb3 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -34,7 +34,7 @@ class TextFileReader { bool ignore_comments; //!< Controls whether comments are ignored TextFileReader(const std::string &filename, const std::string &filetype); - TextFileReader(FILE *fp, const std::string &filetype); + TextFileReader(FILE *fp, std::string filetype); ~TextFileReader(); diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 71b4ad610e..35a313ab3d 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -49,8 +49,8 @@ TokenizerException::TokenizerException(const std::string &msg, const std::string * \param str string to be processed * \param _separators string with separator characters (default: " \t\r\n\f") */ -Tokenizer::Tokenizer(const std::string &str, const std::string &_separators) : - text(str), separators(_separators), start(0), ntokens(std::string::npos) +Tokenizer::Tokenizer(std::string str, std::string _separators) : + text(std::move(str)), separators(std::move(_separators)), start(0), ntokens(std::string::npos) { // replace known UTF-8 characters with ASCII equivalents if (utils::has_utf8(text)) text = utils::utf8_subst(text); @@ -198,9 +198,6 @@ std::vector Tokenizer::as_vector() { ValueTokenizer::ValueTokenizer(const std::string &str, const std::string &separators) : tokens(str, separators) { } -ValueTokenizer::ValueTokenizer(const ValueTokenizer &rhs) : tokens(rhs.tokens) { -} - ValueTokenizer::ValueTokenizer(ValueTokenizer &&rhs) : tokens(std::move(rhs.tokens)) { } diff --git a/src/tokenizer.h b/src/tokenizer.h index ad4f0d3536..247afd0240 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -35,7 +35,7 @@ class Tokenizer { size_t ntokens; public: - Tokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); + Tokenizer(std::string str, std::string separators = TOKENIZER_DEFAULT_SEPARATORS); Tokenizer(Tokenizer &&); Tokenizer(const Tokenizer &); Tokenizer &operator=(const Tokenizer &); @@ -97,7 +97,7 @@ class ValueTokenizer { public: ValueTokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - ValueTokenizer(const ValueTokenizer &); + ValueTokenizer(const ValueTokenizer &) = default; ValueTokenizer(ValueTokenizer &&); ValueTokenizer &operator=(const ValueTokenizer &); ValueTokenizer &operator=(ValueTokenizer &&); diff --git a/src/utils.cpp b/src/utils.cpp index dab56da8d3..25be3f3b02 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -143,7 +143,7 @@ void utils::fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, fmt::format_ar std::string utils::getsyserror() { - return std::string(strerror(errno)); + return {strerror(errno)}; } // read line into buffer. if line is too long keep reading until EOL or EOF @@ -738,7 +738,7 @@ std::string utils::trim_comment(const std::string &line) { auto end = line.find_first_of('#'); if (end != std::string::npos) { return line.substr(0, end); } - return std::string(line); + return {line}; } /* ---------------------------------------------------------------------- diff --git a/tools/lammps-shell/lammps-shell.cpp b/tools/lammps-shell/lammps-shell.cpp index 936b539d43..d03e1da70b 100644 --- a/tools/lammps-shell/lammps-shell.cpp +++ b/tools/lammps-shell/lammps-shell.cpp @@ -21,7 +21,7 @@ #endif #include #else -#include +#include #endif #if defined(_OPENMP) @@ -153,14 +153,14 @@ static int save_history(std::string range, std::string file) std::size_t found = range.find_first_of("-"); if (found == std::string::npos) { // only a single number - int num = strtol(range.c_str(), NULL, 10); + int num = strtol(range.c_str(), nullptr, 10); if ((num >= from) && (num <= to)) { from = to = num; } else return 1; } else { // range of numbers if (found > 0) { // get number before '-' - int num = strtol(range.substr(0, found).c_str(), NULL, 10); + int num = strtol(range.substr(0, found).c_str(), nullptr, 10); if ((num >= from) && (num <= to)) { from = num; } else @@ -168,7 +168,7 @@ static int save_history(std::string range, std::string file) } if (range.size() > found + 1) { // get number after '-' - int num = strtol(range.substr(found + 1).c_str(), NULL, 10); + int num = strtol(range.substr(found + 1).c_str(), nullptr, 10); if ((num >= from) && (num <= to)) { to = num; } else @@ -340,13 +340,13 @@ static char *variable_expand_generator(const char *text, int state) static char *plugin_generator(const char *text, int state) { - const char *subcmd[] = {"load", "unload", "list", "clear", NULL}; + const char *subcmd[] = {"load", "unload", "list", "clear", nullptr}; const char *sub; static std::size_t idx=0, len; if (!state) idx = 0; len = strlen(text); - while ((sub = subcmd[idx]) != NULL) { + while ((sub = subcmd[idx]) != nullptr) { ++idx; if (strncmp(text,sub,len) == 0) return dupstring(sub); @@ -356,12 +356,12 @@ static char *plugin_generator(const char *text, int state) static char *plugin_style_generator(const char *text, int state) { - const char *styles[] = {"pair", "fix", "command", NULL}; + const char *styles[] = {"pair", "fix", "command", nullptr}; const char *s; static std::size_t idx=0, len; if (!state) idx = 0; len = strlen(text); - while ((s = styles[idx]) != NULL) { + while ((s = styles[idx]) != nullptr) { ++idx; if (strncmp(text,s,len) == 0) return dupstring(s); @@ -563,24 +563,24 @@ static void init_commands() // store internal commands int ncmds = sizeof(cmdlist) / sizeof(const char *); for (int i = 0; i < ncmds; ++i) - commands.push_back(cmdlist[i]); + commands.emplace_back(cmdlist[i]); // store optional commands from command styles ncmds = lammps_style_count(lmp, "command"); for (int i = 0; i < ncmds; ++i) { - if (lammps_style_name(lmp, "command", i, buf, BUFLEN)) commands.push_back(buf); + if (lammps_style_name(lmp, "command", i, buf, BUFLEN)) commands.emplace_back(buf); } // store LAMMPS shell specific command names - commands.push_back("help"); - commands.push_back("exit"); - commands.push_back("pwd"); - commands.push_back("cd"); - commands.push_back("mem"); - commands.push_back("source"); - commands.push_back("history"); - commands.push_back("clear_history"); - commands.push_back("save_history"); + commands.emplace_back("help"); + commands.emplace_back("exit"); + commands.emplace_back("pwd"); + commands.emplace_back("cd"); + commands.emplace_back("mem"); + commands.emplace_back("source"); + commands.emplace_back("history"); + commands.emplace_back("clear_history"); + commands.emplace_back("save_history"); // set name so there can be specific entries in ~/.inputrc rl_readline_name = "lammps-shell"; diff --git a/unittest/c-library/test_library_commands.cpp b/unittest/c-library/test_library_commands.cpp index 6c52232a8e..267ee6108e 100644 --- a/unittest/c-library/test_library_commands.cpp +++ b/unittest/c-library/test_library_commands.cpp @@ -19,8 +19,8 @@ const char *cont_input[] = {"create_atoms 1 single &", "0.2 0.1 0.1"}; class LibraryCommands : public ::testing::Test { protected: void *lmp; - LibraryCommands(){}; - ~LibraryCommands() override{}; + LibraryCommands() = default; + ~LibraryCommands() override = default; void SetUp() override { @@ -31,7 +31,7 @@ protected: int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - lmp = lammps_open_no_mpi(argc, argv, NULL); + lmp = lammps_open_no_mpi(argc, argv, nullptr); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; EXPECT_THAT(output, StartsWith("LAMMPS (")); diff --git a/unittest/c-library/test_library_config.cpp b/unittest/c-library/test_library_config.cpp index e5eb044d31..456faff06f 100644 --- a/unittest/c-library/test_library_config.cpp +++ b/unittest/c-library/test_library_config.cpp @@ -22,8 +22,8 @@ protected: void *lmp; std::string INPUT_DIR = STRINGIFY(TEST_INPUT_FOLDER); - LibraryConfig(){}; - ~LibraryConfig() override{}; + LibraryConfig() = default; + ~LibraryConfig() override = default; void SetUp() override { @@ -35,7 +35,7 @@ protected: int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - lmp = lammps_open_no_mpi(argc, argv, NULL); + lmp = lammps_open_no_mpi(argc, argv, nullptr); lammps_command(lmp, "fix charge all property/atom q ghost yes"); lammps_command(lmp, "region box block 0 1 0 1 0 1"); lammps_command(lmp, "create_box 1 box"); diff --git a/unittest/c-library/test_library_external.cpp b/unittest/c-library/test_library_external.cpp index 15edd5f113..57d3bef080 100644 --- a/unittest/c-library/test_library_external.cpp +++ b/unittest/c-library/test_library_external.cpp @@ -69,7 +69,7 @@ TEST(lammps_external, callback) int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - void *handle = lammps_open_no_mpi(argc, argv, NULL); + void *handle = lammps_open_no_mpi(argc, argv, nullptr); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; @@ -136,7 +136,7 @@ TEST(lammps_external, array) int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - void *handle = lammps_open_no_mpi(argc, argv, NULL); + void *handle = lammps_open_no_mpi(argc, argv, nullptr); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; diff --git a/unittest/c-library/test_library_open.cpp b/unittest/c-library/test_library_open.cpp index b7a8016a1a..c75fd3738b 100644 --- a/unittest/c-library/test_library_open.cpp +++ b/unittest/c-library/test_library_open.cpp @@ -18,7 +18,7 @@ using ::testing::StartsWith; TEST(lammps_open, null_args) { ::testing::internal::CaptureStdout(); - void *handle = lammps_open(0, NULL, MPI_COMM_WORLD, NULL); + void *handle = lammps_open(0, nullptr, MPI_COMM_WORLD, nullptr); std::string output = ::testing::internal::GetCapturedStdout(); EXPECT_THAT(output, StartsWith("LAMMPS (")); if (verbose) std::cout << output; @@ -175,7 +175,7 @@ TEST(lammps_open_fortran, no_args) MPI_Comm_split(MPI_COMM_WORLD, 0, 1, &mycomm); int fcomm = MPI_Comm_c2f(mycomm); ::testing::internal::CaptureStdout(); - void *handle = lammps_open_fortran(0, NULL, fcomm); + void *handle = lammps_open_fortran(0, nullptr, fcomm); std::string output = ::testing::internal::GetCapturedStdout(); EXPECT_THAT(output, StartsWith("LAMMPS (")); if (verbose) std::cout << output; diff --git a/unittest/c-library/test_library_properties.cpp b/unittest/c-library/test_library_properties.cpp index 57c0153c65..754c6df77f 100644 --- a/unittest/c-library/test_library_properties.cpp +++ b/unittest/c-library/test_library_properties.cpp @@ -23,8 +23,8 @@ protected: void *lmp; std::string INPUT_DIR = STRINGIFY(TEST_INPUT_FOLDER); - LibraryProperties(){}; - ~LibraryProperties() override{}; + LibraryProperties() = default; + ~LibraryProperties() override = default; void SetUp() override { @@ -36,7 +36,7 @@ protected: int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - lmp = lammps_open_no_mpi(argc, argv, NULL); + lmp = lammps_open_no_mpi(argc, argv, nullptr); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; EXPECT_THAT(output, StartsWith("LAMMPS (")); @@ -436,8 +436,8 @@ class AtomProperties : public ::testing::Test { protected: void *lmp; - AtomProperties(){}; - ~AtomProperties() override{}; + AtomProperties()= default;; + ~AtomProperties() override= default;; void SetUp() override { @@ -447,7 +447,7 @@ protected: int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - lmp = lammps_open_no_mpi(argc, argv, NULL); + lmp = lammps_open_no_mpi(argc, argv, nullptr); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; EXPECT_THAT(output, StartsWith("LAMMPS (")); diff --git a/unittest/c-library/test_library_scatter_gather.cpp b/unittest/c-library/test_library_scatter_gather.cpp index 34022f617e..7ee1cfc9eb 100644 --- a/unittest/c-library/test_library_scatter_gather.cpp +++ b/unittest/c-library/test_library_scatter_gather.cpp @@ -23,8 +23,8 @@ protected: void *lmp; std::string INPUT_DIR = STRINGIFY(TEST_INPUT_FOLDER); - GatherProperties(){}; - ~GatherProperties() override{}; + GatherProperties() = default; + ~GatherProperties() override = default; void SetUp() override { @@ -36,7 +36,7 @@ protected: int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - lmp = lammps_open_no_mpi(argc, argv, NULL); + lmp = lammps_open_no_mpi(argc, argv, nullptr); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; EXPECT_THAT(output, StartsWith("LAMMPS (")); diff --git a/unittest/cplusplus/test_input_class.cpp b/unittest/cplusplus/test_input_class.cpp index db11a91d88..4af7450ed8 100644 --- a/unittest/cplusplus/test_input_class.cpp +++ b/unittest/cplusplus/test_input_class.cpp @@ -29,7 +29,7 @@ protected: MPI_Initialized(&flag); if (!flag) MPI_Init(&argc, &argv); } - ~Input_commands() override {} + ~Input_commands() override = default; void SetUp() override { diff --git a/unittest/force-styles/test_config_reader.cpp b/unittest/force-styles/test_config_reader.cpp index 726bd90a93..945c16c649 100644 --- a/unittest/force-styles/test_config_reader.cpp +++ b/unittest/force-styles/test_config_reader.cpp @@ -86,7 +86,7 @@ void TestConfigReader::prerequisites(const yaml_event_t &event) while (1) { data >> key >> value; if (data.eof()) break; - config.prerequisites.push_back(std::make_pair(key, value)); + config.prerequisites.emplace_back(key, value); } } @@ -141,7 +141,7 @@ void TestConfigReader::extract(const yaml_event_t &event) while (1) { data >> name >> value; if (data.eof()) break; - config.extract.push_back(make_pair(name, value)); + config.extract.emplace_back(name, value); } } diff --git a/unittest/force-styles/test_pair_style.cpp b/unittest/force-styles/test_pair_style.cpp index 2eda7bea9f..a2c8424024 100644 --- a/unittest/force-styles/test_pair_style.cpp +++ b/unittest/force-styles/test_pair_style.cpp @@ -1252,7 +1252,7 @@ TEST(PairStyle, single) int argc = sizeof(args) / sizeof(char *); // need to add this dependency - test_config.prerequisites.push_back(std::make_pair("atom", "full")); + test_config.prerequisites.emplace_back("atom", "full"); // create a LAMMPS instance with standard settings to detect the number of atom types if (!verbose) ::testing::internal::CaptureStdout(); 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 {