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

Second chunk of semi-automatic refactoring with clang-tidy #2994

Merged
merged 6 commits into from Oct 14, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/poems/body23joint.cpp
Expand Up @@ -30,8 +30,7 @@
Body23Joint::Body23Joint(){
DimQandU(4,2);
}
Body23Joint::~Body23Joint(){
}
Body23Joint::~Body23Joint() = default;

JointType Body23Joint::GetType(){
return BODY23JOINT;
Expand Down
5 changes: 0 additions & 5 deletions lib/poems/fixedpoint.cpp
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/poems/fixedpoint.h
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/freebodyjoint.cpp
Expand Up @@ -30,8 +30,7 @@ FreeBodyJoint::FreeBodyJoint(){
DimQandU(7,6);
}

FreeBodyJoint::~FreeBodyJoint(){
}
FreeBodyJoint::~FreeBodyJoint() = default;

JointType FreeBodyJoint::GetType(){
return FREEBODYJOINT;
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/inertialframe.cpp
Expand Up @@ -33,8 +33,7 @@ InertialFrame::InertialFrame(){
alpha.Zeros();
alpha_t.Zeros();
}
InertialFrame::~InertialFrame(){
}
InertialFrame::~InertialFrame() = default;

BodyType InertialFrame::GetType(){
return INERTIALFRAME;
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/joint.cpp
Expand Up @@ -33,8 +33,7 @@ Joint::Joint(){
pk_C_k.Identity();
}

Joint::~Joint(){
}
Joint::~Joint() = default;

void Joint::SetBodies(Body* b1, Body* b2){
body1 = b1;
Expand Down
2 changes: 0 additions & 2 deletions lib/poems/mat3x3.cpp
Expand Up @@ -24,8 +24,6 @@ using namespace std;
Mat3x3::Mat3x3(){
numrows = numcols = 3;
}
Mat3x3::~Mat3x3(){
}

Mat3x3::Mat3x3(const Mat3x3& A){
numrows = numcols = 3;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/mat3x3.h
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions lib/poems/mat4x4.cpp
Expand Up @@ -23,8 +23,6 @@ using namespace std;
Mat4x4::Mat4x4(){
numrows = numcols = 4;
}
Mat4x4::~Mat4x4(){
}

Mat4x4::Mat4x4(const Mat4x4& A){
numrows = numcols = 4;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/mat4x4.h
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions lib/poems/mat6x6.cpp
Expand Up @@ -23,8 +23,6 @@ using namespace std;
Mat6x6::Mat6x6(){
numrows = numcols = 6;
}
Mat6x6::~Mat6x6(){
}

Mat6x6::Mat6x6(const Mat6x6& A){
numrows = numcols = 6;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/mat6x6.h
Expand Up @@ -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

Expand Down
6 changes: 2 additions & 4 deletions lib/poems/mixedjoint.cpp
Expand Up @@ -26,11 +26,9 @@



MixedJoint::MixedJoint(){
}
MixedJoint::MixedJoint() = default;

MixedJoint::~MixedJoint(){
}
MixedJoint::~MixedJoint() = default;

JointType MixedJoint::GetType(){
return MIXEDJOINT;
Expand Down
6 changes: 2 additions & 4 deletions lib/poems/particle.cpp
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/point.cpp
Expand Up @@ -21,8 +21,7 @@
Point::Point(){
position.Zeros();
}
Point::~Point(){
}
Point::~Point() = default;

bool Point::ReadIn(std::istream& in){
return ReadInPointData(in);
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/prismaticjoint.cpp
Expand Up @@ -27,8 +27,7 @@ PrismaticJoint::PrismaticJoint(){
u.Dim(1);
udot.Dim(1);
}
PrismaticJoint::~PrismaticJoint(){
}
PrismaticJoint::~PrismaticJoint() = default;

JointType PrismaticJoint::GetType(){
return PRISMATICJOINT;
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/revolutejoint.cpp
Expand Up @@ -29,8 +29,7 @@ RevoluteJoint::RevoluteJoint(){
SetAxisPK(axis);
}

RevoluteJoint::~RevoluteJoint(){
}
RevoluteJoint::~RevoluteJoint() = default;

JointType RevoluteJoint::GetType(){
return REVOLUTEJOINT;
Expand Down
6 changes: 2 additions & 4 deletions lib/poems/rigidbody.cpp
Expand Up @@ -20,10 +20,8 @@

using namespace std;

RigidBody::RigidBody(){
}
RigidBody::~RigidBody(){
}
RigidBody::RigidBody() = default;
RigidBody::~RigidBody() = default;

BodyType RigidBody::GetType(){
return RIGIDBODY;
Expand Down
7 changes: 2 additions & 5 deletions lib/poems/solver.cpp
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/sphericaljoint.cpp
Expand Up @@ -30,8 +30,7 @@
SphericalJoint::SphericalJoint(){
DimQandU(4,3);
}
SphericalJoint::~SphericalJoint(){
}
SphericalJoint::~SphericalJoint() = default;

JointType SphericalJoint::GetType(){
return SPHERICALJOINT;
Expand Down
2 changes: 0 additions & 2 deletions lib/poems/vect3.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/vect3.h
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions lib/poems/vect4.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/vect4.h
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions lib/poems/vect6.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/vect6.h
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions lib/poems/virtualcolmatrix.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/virtualcolmatrix.h
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions lib/poems/virtualmatrix.cpp
Expand Up @@ -26,8 +26,7 @@ VirtualMatrix::VirtualMatrix(){
numrows = numcols = 0;
}

VirtualMatrix::~VirtualMatrix(){
}
VirtualMatrix::~VirtualMatrix()= default;

int VirtualMatrix::GetNumRows() const {
return numrows;
Expand Down
3 changes: 0 additions & 3 deletions lib/poems/virtualrowmatrix.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/poems/virtualrowmatrix.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/BOCS/fix_bocs.cpp
Expand Up @@ -637,7 +637,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
char line[MAX_F_TABLE_LINE_LENGTH];
std::vector<std::string> inputLines;
while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {
inputLines.push_back(std::string(line));
inputLines.emplace_back(line);
}
fclose(fpi);

Expand Down
3 changes: 0 additions & 3 deletions src/CG-DNA/atom_vec_oxdna.cpp
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/CG-DNA/atom_vec_oxdna.h
Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions src/COMPRESS/dump_atom_gz.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/COMPRESS/dump_atom_gz.h
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/COMPRESS/dump_atom_zstd.cpp
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/COMPRESS/dump_atom_zstd.h
Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/COMPRESS/dump_cfg_gz.cpp
Expand Up @@ -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
Expand Down