diff --git a/src/ASPHERE/compute_erotate_asphere.h b/src/ASPHERE/compute_erotate_asphere.h index 998c1d43c7..ac3c3f120c 100644 --- a/src/ASPHERE/compute_erotate_asphere.h +++ b/src/ASPHERE/compute_erotate_asphere.h @@ -37,7 +37,7 @@ class ComputeERotateAsphere : public Compute { class AtomVecTri *avec_tri; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/compute_temp_asphere.h b/src/ASPHERE/compute_temp_asphere.h index 3365cf9562..52c97a7b0d 100644 --- a/src/ASPHERE/compute_temp_asphere.h +++ b/src/ASPHERE/compute_temp_asphere.h @@ -42,13 +42,13 @@ class ComputeTempAsphere : public Compute { int mode; double tfactor; char *id_bias; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute class AtomVecEllipsoid *avec; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nh_asphere.h b/src/ASPHERE/fix_nh_asphere.h index 4c82a1b83c..83508f327e 100644 --- a/src/ASPHERE/fix_nh_asphere.h +++ b/src/ASPHERE/fix_nh_asphere.h @@ -33,7 +33,7 @@ class FixNHAsphere : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/ASPHERE/fix_nph_asphere.h b/src/ASPHERE/fix_nph_asphere.h index 5591181cf1..c0ba3d6bb5 100644 --- a/src/ASPHERE/fix_nph_asphere.h +++ b/src/ASPHERE/fix_nph_asphere.h @@ -30,7 +30,7 @@ class FixNPHAsphere : public FixNHAsphere { ~FixNPHAsphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_npt_asphere.h b/src/ASPHERE/fix_npt_asphere.h index ea1cecd3c5..63538b8607 100644 --- a/src/ASPHERE/fix_npt_asphere.h +++ b/src/ASPHERE/fix_npt_asphere.h @@ -30,7 +30,7 @@ class FixNPTAsphere : public FixNHAsphere { ~FixNPTAsphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_asphere.h b/src/ASPHERE/fix_nve_asphere.h index 1b53f61999..5dc9b75e5c 100644 --- a/src/ASPHERE/fix_nve_asphere.h +++ b/src/ASPHERE/fix_nve_asphere.h @@ -36,7 +36,7 @@ class FixNVEAsphere : public FixNVE { class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_asphere_noforce.h b/src/ASPHERE/fix_nve_asphere_noforce.h index 3d65740725..c6b0f7119f 100644 --- a/src/ASPHERE/fix_nve_asphere_noforce.h +++ b/src/ASPHERE/fix_nve_asphere_noforce.h @@ -35,7 +35,7 @@ class FixNVEAsphereNoforce : public FixNVENoforce { class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_line.h b/src/ASPHERE/fix_nve_line.h index 215d91947b..ee084e99a9 100644 --- a/src/ASPHERE/fix_nve_line.h +++ b/src/ASPHERE/fix_nve_line.h @@ -34,11 +34,11 @@ class FixNVELine : public FixNVE { void final_integrate(); private: - double MINUSPI,TWOPI; + double MINUSPI, TWOPI; class AtomVecLine *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nve_tri.h b/src/ASPHERE/fix_nve_tri.h index 24e7243029..3122f18b14 100644 --- a/src/ASPHERE/fix_nve_tri.h +++ b/src/ASPHERE/fix_nve_tri.h @@ -38,7 +38,7 @@ class FixNVETri : public FixNVE { class AtomVecTri *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/fix_nvt_asphere.h b/src/ASPHERE/fix_nvt_asphere.h index 4f315932a2..8e40314294 100644 --- a/src/ASPHERE/fix_nvt_asphere.h +++ b/src/ASPHERE/fix_nvt_asphere.h @@ -30,7 +30,7 @@ class FixNVTAsphere : public FixNHAsphere { ~FixNVTAsphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_gayberne.h b/src/ASPHERE/pair_gayberne.h index 00329d38f1..98006b36af 100644 --- a/src/ASPHERE/pair_gayberne.h +++ b/src/ASPHERE/pair_gayberne.h @@ -41,38 +41,35 @@ class PairGayBerne : public Pair { void write_data_all(FILE *); protected: - enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; + enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE }; double cut_global; double **cut; - double gamma,upsilon,mu; // Gay-Berne parameters - double **shape1; // per-type radii in x, y and z - double **shape2; // per-type radii in x, y and z SQUARED - double *lshape; // precalculation based on the shape - double **well; // well depth scaling along each axis ^ -1.0/mu - double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs + double gamma, upsilon, mu; // Gay-Berne parameters + double **shape1; // per-type radii in x, y and z + double **shape2; // per-type radii in x, y and z SQUARED + double *lshape; // precalculation based on the shape + double **well; // well depth scaling along each axis ^ -1.0/mu + double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs int **form; - double **lj1,**lj2,**lj3,**lj4; + double **lj1, **lj2, **lj3, **lj4; double **offset; int *setwell; class AtomVecEllipsoid *avec; void allocate(); - double gayberne_analytic(const int i, const int j, double a1[3][3], - double a2[3][3], double b1[3][3], double b2[3][3], - double g1[3][3], double g2[3][3], double *r12, - const double rsq, double *fforce, double *ttor, + double gayberne_analytic(const int i, const int j, double a1[3][3], double a2[3][3], + double b1[3][3], double b2[3][3], double g1[3][3], double g2[3][3], + double *r12, const double rsq, double *fforce, double *ttor, double *rtor); - double gayberne_lj(const int i, const int j, double a1[3][3], - double b1[3][3],double g1[3][3],double *r12, - const double rsq, double *fforce, double *ttor); - void compute_eta_torque(double m[3][3], double m2[3][3], - double *s, double ans[3][3]); + double gayberne_lj(const int i, const int j, double a1[3][3], double b1[3][3], double g1[3][3], + double *r12, const double rsq, double *fforce, double *ttor); + void compute_eta_torque(double m[3][3], double m2[3][3], double *s, double ans[3][3]); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_line_lj.h b/src/ASPHERE/pair_line_lj.h index 1e22a95434..042f39d13c 100644 --- a/src/ASPHERE/pair_line_lj.h +++ b/src/ASPHERE/pair_line_lj.h @@ -37,28 +37,28 @@ class PairLineLJ : public Pair { protected: double cut_global; double *subsize; - double **epsilon,**sigma,**cutsub,**cutsubsq; + double **epsilon, **sigma, **cutsub, **cutsubsq; double **cut; - double **lj1,**lj2,**lj3,**lj4; // for sphere/sphere interactions + double **lj1, **lj2, **lj3, **lj4; // for sphere/sphere interactions class AtomVecLine *avec; - double *size; // per-type size of sub-particles to tile line segment + double *size; // per-type size of sub-particles to tile line segment struct Discrete { - double dx,dy; + double dx, dy; }; - Discrete *discrete; // list of all discretes for all lines - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + Discrete *discrete; // list of all discretes for all lines + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors void allocate(); void discretize(int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_resquared.h b/src/ASPHERE/pair_resquared.h index f0c0319628..9bd883c4be 100644 --- a/src/ASPHERE/pair_resquared.h +++ b/src/ASPHERE/pair_resquared.h @@ -39,19 +39,19 @@ class PairRESquared : public Pair { void read_restart_settings(FILE *); protected: - enum{SPHERE_SPHERE,SPHERE_ELLIPSE,ELLIPSE_SPHERE,ELLIPSE_ELLIPSE}; + enum { SPHERE_SPHERE, SPHERE_ELLIPSE, ELLIPSE_SPHERE, ELLIPSE_ELLIPSE }; double cut_global; double **cut; - double **shape1; // per-type radii in x, y and z - double **shape2; // per-type radii in x, y and z SQUARED - double *lshape; // product of the radii - double **well; // well depth scaling along each axis - double **epsilon,**sigma; // epsilon and sigma values for atom-type pairs + double **shape1; // per-type radii in x, y and z + double **shape2; // per-type radii in x, y and z SQUARED + double *lshape; // product of the radii + double **well; // well depth scaling along each axis + double **epsilon, **sigma; // epsilon and sigma values for atom-type pairs int **form; - double **lj1,**lj2,**lj3,**lj4; + double **lj1, **lj2, **lj3, **lj4; double **offset; int *setwell; class AtomVecEllipsoid *avec; @@ -61,38 +61,35 @@ class PairRESquared : public Pair { struct RE2Vars { // per particle precomputations for energy, force, torque - double A[3][3]; // Rotation matrix (lab->body) - double aTe[3][3]; // A'*E - double gamma[3][3]; // A'*S^2*A + double A[3][3]; // Rotation matrix (lab->body) + double aTe[3][3]; // A'*E + double gamma[3][3]; // A'*S^2*A // per particle precomputations for torque - double sa[3][3]; // S^2*A; - double lA[3][3][3]; // -A*rotation generator (x,y, or z) - double lAtwo[3][3][3]; // A'*S^2*lA - double lAsa[3][3][3]; // lAtwo+lA'*sa + double sa[3][3]; // S^2*A; + double lA[3][3][3]; // -A*rotation generator (x,y, or z) + double lAtwo[3][3][3]; // A'*S^2*lA + double lAsa[3][3][3]; // lAtwo+lA'*sa }; void allocate(); - void precompute_i(const int i,RE2Vars &ws); + void precompute_i(const int i, RE2Vars &ws); double det_prime(const double m[3][3], const double m2[3][3]); - double resquared_analytic(const int i, const int j, - const RE2Vars &wi, const RE2Vars &wj, - const double *r, const double rsq, - double *fforce, double *ttor, + double resquared_analytic(const int i, const int j, const RE2Vars &wi, const RE2Vars &wj, + const double *r, const double rsq, double *fforce, double *ttor, double *rtor); - double resquared_lj(const int i, const int j, const RE2Vars &wi, - const double *r, const double rsq, double *fforce, - double *ttor, bool calc_torque); + double resquared_lj(const int i, const int j, const RE2Vars &wi, const double *r, + const double rsq, double *fforce, double *ttor, bool calc_torque); - double cr60; // 60^1/3 - double b_alpha; // 45/56 - double solv_f_a; // 3.0/(4.0*PI*-36) - double solv_f_r; // 3.0/(4.0*PI*2025) + double cr60; // 60^1/3 + double b_alpha; // 45/56 + double solv_f_a; // 3.0/(4.0*PI*-36) + double solv_f_r; // 3.0/(4.0*PI*2025) }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ASPHERE/pair_tri_lj.h b/src/ASPHERE/pair_tri_lj.h index 1246ae6b18..ea59e86329 100644 --- a/src/ASPHERE/pair_tri_lj.h +++ b/src/ASPHERE/pair_tri_lj.h @@ -37,26 +37,26 @@ class PairTriLJ : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; class AtomVecTri *avec; struct Discrete { - double dx,dy,dz; + double dx, dy, dz; double sigma; }; - Discrete *discrete; // list of all discretes for all lines - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + Discrete *discrete; // list of all discretes for all lines + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors void allocate(); void discretize(int, double, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/body_nparticle.h b/src/BODY/body_nparticle.h index 822b920c74..670a185534 100644 --- a/src/BODY/body_nparticle.h +++ b/src/BODY/body_nparticle.h @@ -20,8 +20,8 @@ BodyStyle(nparticle,BodyNparticle); #ifndef LMP_BODY_NPARTICLE_H #define LMP_BODY_NPARTICLE_H -#include "body.h" #include "atom_vec_body.h" +#include "body.h" namespace LAMMPS_NS { @@ -49,7 +49,7 @@ class BodyNparticle : public Body { double **imdata; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/body_rounded_polygon.h b/src/BODY/body_rounded_polygon.h index d10135f641..27890848c7 100644 --- a/src/BODY/body_rounded_polygon.h +++ b/src/BODY/body_rounded_polygon.h @@ -20,8 +20,8 @@ BodyStyle(rounded/polygon,BodyRoundedPolygon); #ifndef LMP_BODY_ROUNDED_POLYGON_H #define LMP_BODY_ROUNDED_POLYGON_H -#include "body.h" #include "atom_vec_body.h" +#include "body.h" namespace LAMMPS_NS { @@ -53,7 +53,7 @@ class BodyRoundedPolygon : public Body { double **imdata; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/body_rounded_polyhedron.h b/src/BODY/body_rounded_polyhedron.h index f2c5a770fb..f73aa96aff 100644 --- a/src/BODY/body_rounded_polyhedron.h +++ b/src/BODY/body_rounded_polyhedron.h @@ -20,8 +20,8 @@ BodyStyle(rounded/polyhedron,BodyRoundedPolyhedron); #ifndef LMP_BODY_ROUNDED_POLYHEDRON_H #define LMP_BODY_ROUNDED_POLYHEDRON_H -#include "body.h" #include "atom_vec_body.h" +#include "body.h" namespace LAMMPS_NS { @@ -55,7 +55,7 @@ class BodyRoundedPolyhedron : public Body { double **imdata; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/compute_body_local.h b/src/BODY/compute_body_local.h index 72dddb4b80..b59c6357d2 100644 --- a/src/BODY/compute_body_local.h +++ b/src/BODY/compute_body_local.h @@ -34,7 +34,7 @@ class ComputeBodyLocal : public Compute { private: int nvalues; - int *which,*index; + int *which, *index; int nmax; @@ -45,7 +45,7 @@ class ComputeBodyLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/compute_temp_body.h b/src/BODY/compute_temp_body.h index 0847eb33f5..9931a99be7 100644 --- a/src/BODY/compute_temp_body.h +++ b/src/BODY/compute_temp_body.h @@ -40,13 +40,13 @@ class ComputeTempBody : public Compute { int mode; double tfactor; char *id_bias; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute class AtomVecBody *avec; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_nh_body.h b/src/BODY/fix_nh_body.h index 8a80dd4148..577f4410ac 100644 --- a/src/BODY/fix_nh_body.h +++ b/src/BODY/fix_nh_body.h @@ -33,7 +33,7 @@ class FixNHBody : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/BODY/fix_nph_body.h b/src/BODY/fix_nph_body.h index ead72561e9..2737bc2ca8 100644 --- a/src/BODY/fix_nph_body.h +++ b/src/BODY/fix_nph_body.h @@ -30,7 +30,7 @@ class FixNPHBody : public FixNHBody { ~FixNPHBody() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_npt_body.h b/src/BODY/fix_npt_body.h index 665362b291..52d8ef8a02 100644 --- a/src/BODY/fix_npt_body.h +++ b/src/BODY/fix_npt_body.h @@ -30,7 +30,7 @@ class FixNPTBody : public FixNHBody { ~FixNPTBody() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_nve_body.h b/src/BODY/fix_nve_body.h index b28f2cd399..ec2b905eab 100644 --- a/src/BODY/fix_nve_body.h +++ b/src/BODY/fix_nve_body.h @@ -36,7 +36,7 @@ class FixNVEBody : public FixNVE { class AtomVecBody *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_nvt_body.h b/src/BODY/fix_nvt_body.h index ab45cf8fad..fc0b718e12 100644 --- a/src/BODY/fix_nvt_body.h +++ b/src/BODY/fix_nvt_body.h @@ -30,7 +30,7 @@ class FixNVTBody : public FixNHBody { ~FixNVTBody() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_wall_body_polygon.h b/src/BODY/fix_wall_body_polygon.h index 0cb3e05e21..09ac962b57 100644 --- a/src/BODY/fix_wall_body_polygon.h +++ b/src/BODY/fix_wall_body_polygon.h @@ -35,66 +35,61 @@ class FixWallBodyPolygon : public Fix { void reset_dt(); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int vertex; // vertex of the first polygon - int edge; // edge of the second polygon - double xv[3]; // coordinates of the vertex - double xe[3]; // coordinates of the projection of the vertex on the edge - double separation;// separation at contact + int ibody, jbody; // body (i.e. atom) indices (not tags) + int vertex; // vertex of the first polygon + int edge; // edge of the second polygon + double xv[3]; // coordinates of the vertex + double xe[3]; // coordinates of the projection of the vertex on the edge + double separation; // separation at contact }; protected: - int wallstyle,pairstyle,wiggle,axis; - double kn; // normal repulsion strength - double c_n; // normal damping coefficient - double c_t; // tangential damping coefficient - double lo,hi,cylradius; - double amplitude,period,omega; + int wallstyle, pairstyle, wiggle, axis; + double kn; // normal repulsion strength + double c_n; // normal damping coefficient + double c_t; // tangential damping coefficient + double lo, hi, cylradius; + double amplitude, period, omega; double dt; int time_origin; class AtomVecBody *avec; class BodyRoundedPolygon *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies void body2space(int); - int vertex_against_wall(int ibody, double wall_pos, double** x, - double** f, double** torque, int side, - Contact* contact_list, int &num_contacts, - double* facc); - - int compute_distance_to_wall(double* x0, double rradi, double wall_pos, - int side, double &d, double hi[3], int &contact); - double contact_separation(const Contact& c1, const Contact& c2); - void contact_forces(Contact& contact, double j_a, double** x, - double** v, double** angmom, double** f, double** torque, - double* vwall, double* facc); - void sum_torque(double* xm, double *x, double fx, - double fy, double fz, double* torque); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); - void distance(const double* x2, const double* x1, double& r); + int vertex_against_wall(int ibody, double wall_pos, double **x, double **f, double **torque, + int side, Contact *contact_list, int &num_contacts, double *facc); + int compute_distance_to_wall(double *x0, double rradi, double wall_pos, int side, double &d, + double hi[3], int &contact); + double contact_separation(const Contact &c1, const Contact &c2); + void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom, + double **f, double **torque, double *vwall, double *facc); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); + void distance(const double *x2, const double *x1, double &r); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/fix_wall_body_polyhedron.h b/src/BODY/fix_wall_body_polyhedron.h index 193f333511..8e1e7b7a44 100644 --- a/src/BODY/fix_wall_body_polyhedron.h +++ b/src/BODY/fix_wall_body_polyhedron.h @@ -35,78 +35,72 @@ class FixWallBodyPolyhedron : public Fix { void reset_dt(); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int vertex; // vertex of the first polygon - int edge; // edge of the second polygon - double xv[3]; // coordinates of the vertex - double xe[3]; // coordinates of the projection of the vertex on the edge - double separation;// separation at contact + int ibody, jbody; // body (i.e. atom) indices (not tags) + int vertex; // vertex of the first polygon + int edge; // edge of the second polygon + double xv[3]; // coordinates of the vertex + double xe[3]; // coordinates of the projection of the vertex on the edge + double separation; // separation at contact }; protected: - int wallstyle,pairstyle,wiggle,axis; - double kn,c_n,c_t; - double lo,hi,cylradius; - double amplitude,period,omega; + int wallstyle, pairstyle, wiggle, axis; + double kn, c_n, c_t; + double lo, hi, cylradius; + double amplitude, period, omega; double dt; int time_origin; class AtomVecBody *avec; class BodyRoundedPolyhedron *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double **face; // list of all edge for all bodies - int nface; // number of faces in list - int facmax; // allocated size of face list - int *facnum; // number of faces per line, 0 if uninit - int *facfirst; // index of first face per each line - int facnummax; // allocated size of facnum,facfirst vectors + double **face; // list of all edge for all bodies + int nface; // number of faces in list + int facmax; // allocated size of face list + int *facnum; // number of faces per line, 0 if uninit + int *facfirst; // index of first face per each line + int facnummax; // allocated size of facnum,facfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies void body2space(int); - int edge_against_wall(int ibody, double wall_pos, int side, double* vwall, - double** x, double** f, double** torque, Contact* contact_list, - int &num_contacts, double* facc); - int sphere_against_wall(int i, double wall_pos, int side, double* vwall, - double** x, double** v, double** f, double** angmom, double** torque); + int edge_against_wall(int ibody, double wall_pos, int side, double *vwall, double **x, double **f, + double **torque, Contact *contact_list, int &num_contacts, double *facc); + int sphere_against_wall(int i, double wall_pos, int side, double *vwall, double **x, double **v, + double **f, double **angmom, double **torque); - int compute_distance_to_wall(int ibody, int edge_index, double *xmi, - double rounded_radius_i, double wall_pos, int side, - double* vwall, int &contact); - double contact_separation(const Contact& c1, const Contact& c2); - void contact_forces(int ibody, double j_a, double *xi, double *xj, - double delx, double dely, double delz, - double fx, double fy, double fz, double** x, double** v, - double** angmom, double** f, double** torque, double* vwall); - - void contact_forces(Contact& contact, double j_a, double** x, - double** v, double** angmom, double** f, double** torque, - double* vwall, double* facc); - void sum_torque(double* xm, double *x, double fx, - double fy, double fz, double* torque); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); - void distance(const double* x2, const double* x1, double& r); + int compute_distance_to_wall(int ibody, int edge_index, double *xmi, double rounded_radius_i, + double wall_pos, int side, double *vwall, int &contact); + double contact_separation(const Contact &c1, const Contact &c2); + void contact_forces(int ibody, double j_a, double *xi, double *xj, double delx, double dely, + double delz, double fx, double fy, double fz, double **x, double **v, + double **angmom, double **f, double **torque, double *vwall); + void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom, + double **f, double **torque, double *vwall, double *facc); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); + void distance(const double *x2, const double *x1, double &r); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/pair_body_nparticle.h b/src/BODY/pair_body_nparticle.h index b228553ab7..052454d236 100644 --- a/src/BODY/pair_body_nparticle.h +++ b/src/BODY/pair_body_nparticle.h @@ -37,24 +37,24 @@ class PairBodyNparticle : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; class AtomVecBody *avec; class BodyNparticle *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors void allocate(); void body2space(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/pair_body_rounded_polygon.h b/src/BODY/pair_body_rounded_polygon.h index 8bda39982b..4bc92bb048 100644 --- a/src/BODY/pair_body_rounded_polygon.h +++ b/src/BODY/pair_body_rounded_polygon.h @@ -35,81 +35,76 @@ class PairBodyRoundedPolygon : public Pair { double init_one(int, int); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int vertex; // vertex of the first polygon - int edge; // edge of the second polygon - double xv[3]; // coordinates of the vertex - double xe[3]; // coordinates of the projection of the vertex on the edge - double separation;// separation at contact + int ibody, jbody; // body (i.e. atom) indices (not tags) + int vertex; // vertex of the first polygon + int edge; // edge of the second polygon + double xv[3]; // coordinates of the vertex + double xe[3]; // coordinates of the projection of the vertex on the edge + double separation; // separation at contact }; protected: - double **k_n; // normal repulsion strength - double **k_na; // normal attraction strength - double c_n; // normal damping coefficient - double c_t; // tangential damping coefficient - double mu; // normal friction coefficient during gross sliding - double delta_ua; // contact line (area for 3D models) modification factor - double cut_inner; // cutoff for interaction between vertex-edge surfaces + double **k_n; // normal repulsion strength + double **k_na; // normal attraction strength + double c_n; // normal damping coefficient + double c_t; // tangential damping coefficient + double mu; // normal friction coefficient during gross sliding + double delta_ua; // contact line (area for 3D models) modification factor + double cut_inner; // cutoff for interaction between vertex-edge surfaces class AtomVecBody *avec; class BodyRoundedPolygon *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies - double *maxerad; // per-type maximum enclosing radius + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies + double *maxerad; // per-type maximum enclosing radius void allocate(); void body2space(int); // sphere-sphere interaction - void sphere_against_sphere(int i, int j, double delx, double dely, double delz, - double rsq, double k_n, double k_na, - double** x, double** v, double** f, int evflag); + void sphere_against_sphere(int i, int j, double delx, double dely, double delz, double rsq, + double k_n, double k_na, double **x, double **v, double **f, + int evflag); // vertex-edge interaction - int vertex_against_edge(int i, int j, double k_n, double k_na, - double** x, double** f, double** torque, - tagint* tag, Contact* contact_list, - int &num_contacts, double &evdwl, double* facc); + int vertex_against_edge(int i, int j, double k_n, double k_na, double **x, double **f, + double **torque, tagint *tag, Contact *contact_list, int &num_contacts, + double &evdwl, double *facc); // compute distance between a point and an edge from another body - int compute_distance_to_vertex(int ibody, int edge_index, double* xmi, - double rounded_radius, double* x0, - double x0_rounded_radius, double cut_inner, - double &d, double hi[3], double &t, - int &contact); + int compute_distance_to_vertex(int ibody, int edge_index, double *xmi, double rounded_radius, + double *x0, double x0_rounded_radius, double cut_inner, double &d, + double hi[3], double &t, int &contact); // compute contact forces if contact points are detected - void contact_forces(Contact& contact, double j_a, - double** x, double** v, double** angmom, double** f, - double** torque, double &evdwl, double* facc); + void contact_forces(Contact &contact, double j_a, double **x, double **v, double **angmom, + double **f, double **torque, double &evdwl, double *facc); // compute the separation between two contacts - double contact_separation(const Contact& c1, const Contact& c2); + double contact_separation(const Contact &c1, const Contact &c2); // accumulate torque to a body given a force at a given point - void sum_torque(double* xm, double *x, double fx, - double fy, double fz, double* torque); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); // helper functions - int opposite_sides(double* x1, double* x2, double* a, double* b); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); - inline void distance(const double* x2, const double* x1, double& r); + int opposite_sides(double *x1, double *x2, double *a, double *b); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); + inline void distance(const double *x2, const double *x1, double &r); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/BODY/pair_body_rounded_polyhedron.h b/src/BODY/pair_body_rounded_polyhedron.h index 58a3c5e7f9..3acf0987d3 100644 --- a/src/BODY/pair_body_rounded_polyhedron.h +++ b/src/BODY/pair_body_rounded_polyhedron.h @@ -34,145 +34,131 @@ class PairBodyRoundedPolyhedron : public Pair { void init_style(); double init_one(int, int); - virtual void kernel_force(double R, int itype, int jtype, - double& energy, double& fpair); + virtual void kernel_force(double R, int itype, int jtype, double &energy, double &fpair); struct Contact { - int ibody, jbody; // body (i.e. atom) indices (not tags) - int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE - double fx,fy,fz; // unscaled cohesive forces at contact - double xi[3]; // coordinates of the contact point on ibody - double xj[3]; // coordinates of the contact point on jbody - double separation; // contact surface separation + int ibody, jbody; // body (i.e. atom) indices (not tags) + int type; // 0 = VERTEX-FACE; 1 = EDGE-EDGE + double fx, fy, fz; // unscaled cohesive forces at contact + double xi[3]; // coordinates of the contact point on ibody + double xj[3]; // coordinates of the contact point on jbody + double separation; // contact surface separation int unique; }; protected: - double **k_n; // normal repulsion strength - double **k_na; // normal attraction strength - double c_n; // normal damping coefficient - double c_t; // tangential damping coefficient - double mu; // normal friction coefficient during gross sliding - double A_ua; // characteristic contact area - double cut_inner; // cutoff for interaction between vertex-edge surfaces + double **k_n; // normal repulsion strength + double **k_na; // normal attraction strength + double c_n; // normal damping coefficient + double c_t; // tangential damping coefficient + double mu; // normal friction coefficient during gross sliding + double A_ua; // characteristic contact area + double cut_inner; // cutoff for interaction between vertex-edge surfaces class AtomVecBody *avec; class BodyRoundedPolyhedron *bptr; - double **discrete; // list of all sub-particles for all bodies - int ndiscrete; // number of discretes in list - int dmax; // allocated size of discrete list - int *dnum; // number of discretes per line, 0 if uninit - int *dfirst; // index of first discrete per each line - int nmax; // allocated size of dnum,dfirst vectors + double **discrete; // list of all sub-particles for all bodies + int ndiscrete; // number of discretes in list + int dmax; // allocated size of discrete list + int *dnum; // number of discretes per line, 0 if uninit + int *dfirst; // index of first discrete per each line + int nmax; // allocated size of dnum,dfirst vectors - double **edge; // list of all edge for all bodies - int nedge; // number of edge in list - int edmax; // allocated size of edge list - int *ednum; // number of edges per line, 0 if uninit - int *edfirst; // index of first edge per each line - int ednummax; // allocated size of ednum,edfirst vectors + double **edge; // list of all edge for all bodies + int nedge; // number of edge in list + int edmax; // allocated size of edge list + int *ednum; // number of edges per line, 0 if uninit + int *edfirst; // index of first edge per each line + int ednummax; // allocated size of ednum,edfirst vectors - double **face; // list of all edge for all bodies - int nface; // number of faces in list - int facmax; // allocated size of face list - int *facnum; // number of faces per line, 0 if uninit - int *facfirst; // index of first face per each line - int facnummax; // allocated size of facnum,facfirst vectors + double **face; // list of all edge for all bodies + int nface; // number of faces in list + int facmax; // allocated size of face list + int *facnum; // number of faces per line, 0 if uninit + int *facfirst; // index of first face per each line + int facnummax; // allocated size of facnum,facfirst vectors - double *enclosing_radius; // enclosing radii for all bodies - double *rounded_radius; // rounded radii for all bodies - double *maxerad; // per-type maximum enclosing radius + double *enclosing_radius; // enclosing radii for all bodies + double *rounded_radius; // rounded radii for all bodies + double *maxerad; // per-type maximum enclosing radius void allocate(); void body2space(int); // sphere-sphere interaction - void sphere_against_sphere(int ibody, int jbody, int itype, int jtype, - double delx, double dely, double delz, double rsq, - double** v, double** f, int evflag); + void sphere_against_sphere(int ibody, int jbody, int itype, int jtype, double delx, double dely, + double delz, double rsq, double **v, double **f, int evflag); // sphere-edge interaction - void sphere_against_edge(int ibody, int jbody, int itype, int jtype, - double** x, double** v, double** f, double** torque, - double** angmom, int evflag); + void sphere_against_edge(int ibody, int jbody, int itype, int jtype, double **x, double **v, + double **f, double **torque, double **angmom, int evflag); // sphere-face interaction - void sphere_against_face(int ibody, int jbody, int itype, int jtype, - double** x, double** v, double** f, double** torque, - double** angmom, int evflag); + void sphere_against_face(int ibody, int jbody, int itype, int jtype, double **x, double **v, + double **f, double **torque, double **angmom, int evflag); // edge-edge interactions - int edge_against_edge(int ibody, int jbody, int itype, int jtype, - double** x,Contact* contact_list, int &num_contacts, - double &evdwl, double* facc); + int edge_against_edge(int ibody, int jbody, int itype, int jtype, double **x, + Contact *contact_list, int &num_contacts, double &evdwl, double *facc); // edge-face interactions - int edge_against_face(int ibody, int jbody, int itype, int jtype, - double** x, Contact* contact_list, int &num_contacts, - double &evdwl, double* facc); + int edge_against_face(int ibody, int jbody, int itype, int jtype, double **x, + Contact *contact_list, int &num_contacts, double &evdwl, double *facc); // a face vs. a single edge - int interaction_face_to_edge(int ibody, int face_index, double* xmi, - double rounded_radius_i, int jbody, int edge_index, - double* xmj, double rounded_radius_j, - int itype, int jtype, double cut_inner, - Contact* contact_list, int &num_contacts, - double& energy, double* facc); + int interaction_face_to_edge(int ibody, int face_index, double *xmi, double rounded_radius_i, + int jbody, int edge_index, double *xmj, double rounded_radius_j, + int itype, int jtype, double cut_inner, Contact *contact_list, + int &num_contacts, double &energy, double *facc); // an edge vs. an edge from another body - int interaction_edge_to_edge(int ibody, int edge_index_i, double* xmi, - double rounded_radius_i, int jbody, int edge_index_j, - double* xmj, double rounded_radius_j, - int itype, int jtype, double cut_inner, - Contact* contact_list, int &num_contacts, - double& energy, double* facc); + int interaction_edge_to_edge(int ibody, int edge_index_i, double *xmi, double rounded_radius_i, + int jbody, int edge_index_j, double *xmj, double rounded_radius_j, + int itype, int jtype, double cut_inner, Contact *contact_list, + int &num_contacts, double &energy, double *facc); // compute contact forces if contact points are detected - void contact_forces(int ibody, int jbody, double *xi, double *xj, - double delx, double dely, double delz, double fx, double fy, double fz, - double** x, double** v, double** angmom, double** f, double** torque, - double* facc); + void contact_forces(int ibody, int jbody, double *xi, double *xj, double delx, double dely, + double delz, double fx, double fy, double fz, double **x, double **v, + double **angmom, double **f, double **torque, double *facc); // compute force and torque between two bodies given a pair of interacting points - void pair_force_and_torque(int ibody, int jbody, double* pi, double* pj, - double r, double contact_dist, int itype, int jtype, - double** x, double** v, double** f, double** torque, - double** angmom, int jflag, double& energy, double* facc); + void pair_force_and_torque(int ibody, int jbody, double *pi, double *pj, double r, + double contact_dist, int itype, int jtype, double **x, double **v, + double **f, double **torque, double **angmom, int jflag, + double &energy, double *facc); // rescale the cohesive forces if a contact area is detected - void rescale_cohesive_forces(double** x, double** f, double** torque, - Contact* contact_list, int &num_contacts, - int itype, int jtype, double* facc); + void rescale_cohesive_forces(double **x, double **f, double **torque, Contact *contact_list, + int &num_contacts, int itype, int jtype, double *facc); // compute the separation between two contacts - double contact_separation(const Contact& c1, const Contact& c2); + double contact_separation(const Contact &c1, const Contact &c2); // detect the unique contact points (as there may be double counts) - void find_unique_contacts(Contact* contact_list, int& num_contacts); + void find_unique_contacts(Contact *contact_list, int &num_contacts); // accumulate torque to a body given a force at a given point - void sum_torque(double* xm, double *x, double fx, double fy, double fz, double* torque); + void sum_torque(double *xm, double *x, double fx, double fy, double fz, double *torque); // find the intersection point (if any) between an edge and a face - int edge_face_intersect(double* x1, double* x2, double* x3, double* a, double* b, - double* hi1, double* hi2, double& d1, double& d2, - int& inside_a, int& inside_b); + int edge_face_intersect(double *x1, double *x2, double *x3, double *a, double *b, double *hi1, + double *hi2, double &d1, double &d2, int &inside_a, int &inside_b); // helper functions - int opposite_sides(double* n, double* x0, double* a, double* b); - void project_pt_plane(const double* q, const double* p, - const double* n, double* q_proj, double &d); - void project_pt_plane(const double* q, const double* x1, const double* x2, - const double* x3, double* q_proj, double &d, int& inside); - void project_pt_line(const double* q, const double* xi1, const double* xi2, - double* h, double& d, double& t); - void inside_polygon(int ibody, int face_index, double* xmi, - const double* q1, const double* q2, int& inside1, int& inside2); + int opposite_sides(double *n, double *x0, double *a, double *b); + void project_pt_plane(const double *q, const double *p, const double *n, double *q_proj, + double &d); + void project_pt_plane(const double *q, const double *x1, const double *x2, const double *x3, + double *q_proj, double &d, int &inside); + void project_pt_line(const double *q, const double *xi1, const double *xi2, double *h, double &d, + double &t); + void inside_polygon(int ibody, int face_index, double *xmi, const double *q1, const double *q2, + int &inside1, int &inside2); - void distance_bt_edges(const double* x1, const double* x2, - const double* x3, const double* x4, - double* h1, double* h2, double& t1, double& t2, double& r); - void total_velocity(double* p, double *xcm, double* vcm, double *angmom, - double *inertia, double *quat, double* vi); + void distance_bt_edges(const double *x1, const double *x2, const double *x3, const double *x4, + double *h1, double *h2, double &t1, double &t2, double &r); + void total_velocity(double *p, double *xcm, double *vcm, double *angmom, double *inertia, + double *quat, double *vi); void sanity_check(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/angle_class2.h b/src/CLASS2/angle_class2.h index 94f997f32d..169bcdde59 100644 --- a/src/CLASS2/angle_class2.h +++ b/src/CLASS2/angle_class2.h @@ -37,15 +37,15 @@ class AngleClass2 : public Angle { double single(int, int, int, int); protected: - double *theta0,*k2,*k3,*k4; - double *bb_k,*bb_r1,*bb_r2; - double *ba_k1,*ba_k2,*ba_r1,*ba_r2; - int *setflag_a,*setflag_bb,*setflag_ba; + double *theta0, *k2, *k3, *k4; + double *bb_k, *bb_r1, *bb_r2; + double *ba_k1, *ba_k2, *ba_r1, *ba_r2; + int *setflag_a, *setflag_bb, *setflag_ba; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/bond_class2.h b/src/CLASS2/bond_class2.h index a39d2adcf7..14c35086c8 100644 --- a/src/CLASS2/bond_class2.h +++ b/src/CLASS2/bond_class2.h @@ -38,12 +38,12 @@ class BondClass2 : public Bond { virtual void *extract(const char *, int &); protected: - double *r0,*k2,*k3,*k4; + double *r0, *k2, *k3, *k4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/dihedral_class2.h b/src/CLASS2/dihedral_class2.h index edfe37b4b9..e49839660e 100644 --- a/src/CLASS2/dihedral_class2.h +++ b/src/CLASS2/dihedral_class2.h @@ -35,22 +35,22 @@ class DihedralClass2 : public Dihedral { void write_data(FILE *); protected: - double *k1,*k2,*k3; - double *phi1,*phi2,*phi3; - double *mbt_f1,*mbt_f2,*mbt_f3,*mbt_r0; - double *ebt_f1_1,*ebt_f2_1,*ebt_f3_1,*ebt_r0_1; - double *ebt_f1_2,*ebt_f2_2,*ebt_f3_2,*ebt_r0_2; - double *at_f1_1,*at_f2_1,*at_f3_1,*at_theta0_1; - double *at_f1_2,*at_f2_2,*at_f3_2,*at_theta0_2; - double *aat_k,*aat_theta0_1,*aat_theta0_2; - double *bb13t_k,*bb13t_r10,*bb13t_r30; - int *setflag_d,*setflag_mbt,*setflag_ebt; - int *setflag_at,*setflag_aat,*setflag_bb13t; + double *k1, *k2, *k3; + double *phi1, *phi2, *phi3; + double *mbt_f1, *mbt_f2, *mbt_f3, *mbt_r0; + double *ebt_f1_1, *ebt_f2_1, *ebt_f3_1, *ebt_r0_1; + double *ebt_f1_2, *ebt_f2_2, *ebt_f3_2, *ebt_r0_2; + double *at_f1_1, *at_f2_1, *at_f3_1, *at_theta0_1; + double *at_f1_2, *at_f2_2, *at_f3_2, *at_theta0_2; + double *aat_k, *aat_theta0_1, *aat_theta0_2; + double *bb13t_k, *bb13t_r10, *bb13t_r30; + int *setflag_d, *setflag_mbt, *setflag_ebt; + int *setflag_at, *setflag_aat, *setflag_bb13t; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/improper_class2.h b/src/CLASS2/improper_class2.h index 30242e6b16..4b271d9071 100644 --- a/src/CLASS2/improper_class2.h +++ b/src/CLASS2/improper_class2.h @@ -35,9 +35,9 @@ class ImproperClass2 : public Improper { void write_data(FILE *); protected: - double *k0,*chi0; - double *aa_k1,*aa_k2,*aa_k3,*aa_theta0_1,*aa_theta0_2,*aa_theta0_3; - int *setflag_i,*setflag_aa; + double *k0, *chi0; + double *aa_k1, *aa_k2, *aa_k3, *aa_theta0_1, *aa_theta0_2, *aa_theta0_3; + int *setflag_i, *setflag_aa; void allocate(); void angleangle(int, int); @@ -45,7 +45,7 @@ class ImproperClass2 : public Improper { double dot(double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/pair_lj_class2.h b/src/CLASS2/pair_lj_class2.h index 585a82e17d..877f36308b 100644 --- a/src/CLASS2/pair_lj_class2.h +++ b/src/CLASS2/pair_lj_class2.h @@ -47,14 +47,14 @@ class PairLJClass2 : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/pair_lj_class2_coul_cut.h b/src/CLASS2/pair_lj_class2_coul_cut.h index 06452260f0..5ef5bd1169 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.h +++ b/src/CLASS2/pair_lj_class2_coul_cut.h @@ -43,16 +43,16 @@ class PairLJClass2CoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CLASS2/pair_lj_class2_coul_long.h b/src/CLASS2/pair_lj_class2_coul_long.h index 30291ce7a4..9ef27e0228 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.h +++ b/src/CLASS2/pair_lj_class2_coul_long.h @@ -48,17 +48,17 @@ class PairLJClass2CoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double g_ewald; double *cut_respa; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/fix_wall_colloid.h b/src/COLLOID/fix_wall_colloid.h index b35b96995e..49df4fad6d 100644 --- a/src/COLLOID/fix_wall_colloid.h +++ b/src/COLLOID/fix_wall_colloid.h @@ -32,10 +32,10 @@ class FixWallColloid : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_brownian.h b/src/COLLOID/pair_brownian.h index eb08ce5412..b88bb04621 100644 --- a/src/COLLOID/pair_brownian.h +++ b/src/COLLOID/pair_brownian.h @@ -39,9 +39,9 @@ class PairBrownian : public Pair { void read_restart_settings(FILE *); protected: - double cut_inner_global,cut_global; - double t_target,mu; - int flaglog,flagfld; + double cut_inner_global, cut_global; + double t_target, mu; + int flaglog, flagfld; int flagHI, flagVF; int flagdeform, flagwall; double vol_P; @@ -49,16 +49,16 @@ class PairBrownian : public Pair { class FixWall *wallfix; int seed; - double **cut_inner,**cut; - double R0,RT0; + double **cut_inner, **cut; + double R0, RT0; class RanMars *random; - void set_3_orthogonal_vectors(double*,double*,double*); + void set_3_orthogonal_vectors(double *, double *, double *); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_brownian_poly.h b/src/COLLOID/pair_brownian_poly.h index a52d394b55..3a963e70c4 100644 --- a/src/COLLOID/pair_brownian_poly.h +++ b/src/COLLOID/pair_brownian_poly.h @@ -33,7 +33,7 @@ class PairBrownianPoly : public PairBrownian { void init_style(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_colloid.h b/src/COLLOID/pair_colloid.h index 75ac2c4165..2702de0978 100644 --- a/src/COLLOID/pair_colloid.h +++ b/src/COLLOID/pair_colloid.h @@ -41,19 +41,19 @@ class PairColloid : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - enum {SMALL_SMALL,SMALL_LARGE,LARGE_LARGE}; + enum { SMALL_SMALL, SMALL_LARGE, LARGE_LARGE }; double cut_global; double **cut; - double **a12,**d1,**d2,**diameter,**a1,**a2,**offset; - double **sigma,**sigma3,**sigma6; - double **lj1,**lj2,**lj3,**lj4; + double **a12, **d1, **d2, **diameter, **a1, **a2, **offset; + double **sigma, **sigma3, **sigma6; + double **lj1, **lj2, **lj3, **lj4; int **form; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricate.h b/src/COLLOID/pair_lubricate.h index 5e83808889..89b96cc522 100644 --- a/src/COLLOID/pair_lubricate.h +++ b/src/COLLOID/pair_lubricate.h @@ -44,22 +44,22 @@ class PairLubricate : public Pair { void unpack_forward_comm(int, int, double *); protected: - double mu,cut_inner_global,cut_global; + double mu, cut_inner_global, cut_global; double rad; - int flaglog,flagfld,shearing; + int flaglog, flagfld, shearing; int flagdeform, flagwall; double vol_P; class FixWall *wallfix; int flagVF, flagHI; double Ef[3][3]; - double R0,RT0,RS0; - double **cut_inner,**cut; + double R0, RT0, RS0; + double **cut_inner, **cut; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricateU.h b/src/COLLOID/pair_lubricateU.h index ee9e9465b8..5515a7d6e8 100644 --- a/src/COLLOID/pair_lubricateU.h +++ b/src/COLLOID/pair_lubricateU.h @@ -41,7 +41,7 @@ class PairLubricateU : public Pair { void unpack_forward_comm(int, int, double *); protected: - double cut_inner_global,cut_global; + double cut_inner_global, cut_global; double mu; double rad; int flaglog; @@ -50,16 +50,16 @@ class PairLubricateU : public Pair { double vol_P; class FixWall *wallfix; - double gdot,Ef[3][3]; - double **cut_inner,**cut; + double gdot, Ef[3][3]; + double **cut_inner, **cut; void allocate(); - double R0,RT0,RS0; + double R0, RT0, RS0; int nmax; - double **fl,**Tl,**xl; + double **fl, **Tl, **xl; int cgmax; - double *bcg,*xcg,*rcg,*rcg1,*pcg,*RU; + double *bcg, *xcg, *rcg, *rcg1, *pcg, *RU; void compute_RE(); virtual void compute_RE(double **); @@ -71,10 +71,10 @@ class PairLubricateU : public Pair { void stage_two(double **); void copy_vec_uo(int, double *, double **, double **); void copy_uo_vec(int, double **, double **, double *); - double dot_vec_vec(int , double *, double *); + double dot_vec_vec(int, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricateU_poly.h b/src/COLLOID/pair_lubricateU_poly.h index 9f18708c9b..37fe83dd28 100644 --- a/src/COLLOID/pair_lubricateU_poly.h +++ b/src/COLLOID/pair_lubricateU_poly.h @@ -43,7 +43,7 @@ class PairLubricateUPoly : public PairLubricateU { void compute_Fh(double **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_lubricate_poly.h b/src/COLLOID/pair_lubricate_poly.h index b76f28a557..814591505b 100644 --- a/src/COLLOID/pair_lubricate_poly.h +++ b/src/COLLOID/pair_lubricate_poly.h @@ -32,7 +32,7 @@ class PairLubricatePoly : public PairLubricate { void init_style(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COLLOID/pair_yukawa_colloid.h b/src/COLLOID/pair_yukawa_colloid.h index 7e379c07d9..4372a4ce6d 100644 --- a/src/COLLOID/pair_yukawa_colloid.h +++ b/src/COLLOID/pair_yukawa_colloid.h @@ -34,7 +34,7 @@ class PairYukawaColloid : public PairYukawa { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_atom_gz.h b/src/COMPRESS/dump_atom_gz.h index 4a255dba13..226283b4ef 100644 --- a/src/COMPRESS/dump_atom_gz.h +++ b/src/COMPRESS/dump_atom_gz.h @@ -41,7 +41,7 @@ class DumpAtomGZ : public DumpAtom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_atom_zstd.h b/src/COMPRESS/dump_atom_zstd.h index 827fefce36..214e8209f9 100644 --- a/src/COMPRESS/dump_atom_zstd.h +++ b/src/COMPRESS/dump_atom_zstd.h @@ -47,7 +47,7 @@ class DumpAtomZstd : public DumpAtom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_cfg_gz.h b/src/COMPRESS/dump_cfg_gz.h index 2c4ef3bffa..02cbc61a47 100644 --- a/src/COMPRESS/dump_cfg_gz.h +++ b/src/COMPRESS/dump_cfg_gz.h @@ -41,7 +41,7 @@ class DumpCFGGZ : public DumpCFG { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_cfg_zstd.h b/src/COMPRESS/dump_cfg_zstd.h index 3c56c321d2..d80b10c268 100644 --- a/src/COMPRESS/dump_cfg_zstd.h +++ b/src/COMPRESS/dump_cfg_zstd.h @@ -46,7 +46,7 @@ class DumpCFGZstd : public DumpCFG { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_custom_gz.h b/src/COMPRESS/dump_custom_gz.h index 9c172df09a..ce208e107d 100644 --- a/src/COMPRESS/dump_custom_gz.h +++ b/src/COMPRESS/dump_custom_gz.h @@ -41,7 +41,7 @@ class DumpCustomGZ : public DumpCustom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_custom_zstd.h b/src/COMPRESS/dump_custom_zstd.h index 053bf52935..ad5bd7ccbf 100644 --- a/src/COMPRESS/dump_custom_zstd.h +++ b/src/COMPRESS/dump_custom_zstd.h @@ -48,7 +48,7 @@ class DumpCustomZstd : public DumpCustom { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_local_gz.h b/src/COMPRESS/dump_local_gz.h index f5d29f0d3f..e7be36915f 100644 --- a/src/COMPRESS/dump_local_gz.h +++ b/src/COMPRESS/dump_local_gz.h @@ -41,7 +41,7 @@ class DumpLocalGZ : public DumpLocal { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_local_zstd.h b/src/COMPRESS/dump_local_zstd.h index 6aaca15495..0c8e4e74f4 100644 --- a/src/COMPRESS/dump_local_zstd.h +++ b/src/COMPRESS/dump_local_zstd.h @@ -47,7 +47,7 @@ class DumpLocalZstd : public DumpLocal { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_xyz_gz.h b/src/COMPRESS/dump_xyz_gz.h index 5588ad3d10..fab79c616b 100644 --- a/src/COMPRESS/dump_xyz_gz.h +++ b/src/COMPRESS/dump_xyz_gz.h @@ -41,7 +41,7 @@ class DumpXYZGZ : public DumpXYZ { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/dump_xyz_zstd.h b/src/COMPRESS/dump_xyz_zstd.h index e5db9e763d..c358d35a84 100644 --- a/src/COMPRESS/dump_xyz_zstd.h +++ b/src/COMPRESS/dump_xyz_zstd.h @@ -47,7 +47,7 @@ class DumpXYZZstd : public DumpXYZ { virtual int modify_param(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/COMPRESS/gz_file_writer.h b/src/COMPRESS/gz_file_writer.h index 669931399b..7e65fd1792 100644 --- a/src/COMPRESS/gz_file_writer.h +++ b/src/COMPRESS/gz_file_writer.h @@ -29,18 +29,18 @@ namespace LAMMPS_NS { class GzFileWriter : public FileWriter { int compression_level; - gzFile gzFp; // file pointer for the compressed output stream -public: - GzFileWriter(); - virtual ~GzFileWriter(); - virtual void open(const std::string &path, bool append = false) override; - virtual void close() override; - virtual void flush() override; - virtual size_t write(const void * buffer, size_t length) override; - virtual bool isopen() const override; + gzFile gzFp; // file pointer for the compressed output stream + public: + GzFileWriter(); + virtual ~GzFileWriter(); + virtual void open(const std::string &path, bool append = false) override; + virtual void close() override; + virtual void flush() override; + virtual size_t write(const void *buffer, size_t length) override; + virtual bool isopen() const override; - void setCompressionLevel(int level); + void setCompressionLevel(int level); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/COMPRESS/zstd_file_writer.h b/src/COMPRESS/zstd_file_writer.h index 030a01690a..739482e6b9 100644 --- a/src/COMPRESS/zstd_file_writer.h +++ b/src/COMPRESS/zstd_file_writer.h @@ -31,23 +31,24 @@ class ZstdFileWriter : public FileWriter { int compression_level; int checksum_flag; - ZSTD_CCtx * cctx; - FILE * fp; - char * out_buffer; + ZSTD_CCtx *cctx; + FILE *fp; + char *out_buffer; size_t out_buffer_size; -public: - ZstdFileWriter(); - virtual ~ZstdFileWriter(); - virtual void open(const std::string &path, bool append = false) override; - virtual void close() override; - virtual void flush() override; - virtual size_t write(const void * buffer, size_t length) override; - virtual bool isopen() const override; - void setCompressionLevel(int level); - void setChecksum(bool enabled); + public: + ZstdFileWriter(); + virtual ~ZstdFileWriter(); + virtual void open(const std::string &path, bool append = false) override; + virtual void close() override; + virtual void flush() override; + virtual size_t write(const void *buffer, size_t length) override; + virtual bool isopen() const override; + + void setCompressionLevel(int level); + void setChecksum(bool enabled); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/compute_temp_cs.h b/src/CORESHELL/compute_temp_cs.h index 47da61a79b..059f1023db 100644 --- a/src/CORESHELL/compute_temp_cs.h +++ b/src/CORESHELL/compute_temp_cs.h @@ -44,11 +44,11 @@ class ComputeTempCS : public Compute { void unpack_reverse_comm(int, int *, double *); private: - int groupbit_c,groupbit_s; + int groupbit_c, groupbit_s; int nshells; int firstflag; int maxatom; - int cgroup,sgroup; + int cgroup, sgroup; double tfactor; double **vint; @@ -60,7 +60,7 @@ class ComputeTempCS : public Compute { void vcm_pairs(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_born_coul_dsf_cs.h b/src/CORESHELL/pair_born_coul_dsf_cs.h index 2666445d44..39c51301b4 100644 --- a/src/CORESHELL/pair_born_coul_dsf_cs.h +++ b/src/CORESHELL/pair_born_coul_dsf_cs.h @@ -30,7 +30,7 @@ class PairBornCoulDSFCS : public PairBornCoulDSF { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_born_coul_long_cs.h b/src/CORESHELL/pair_born_coul_long_cs.h index f239c11d15..54e13a1edf 100644 --- a/src/CORESHELL/pair_born_coul_long_cs.h +++ b/src/CORESHELL/pair_born_coul_long_cs.h @@ -30,7 +30,7 @@ class PairBornCoulLongCS : public PairBornCoulLong { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_born_coul_wolf_cs.h b/src/CORESHELL/pair_born_coul_wolf_cs.h index 72bc3d2037..ce3e134f9b 100644 --- a/src/CORESHELL/pair_born_coul_wolf_cs.h +++ b/src/CORESHELL/pair_born_coul_wolf_cs.h @@ -30,7 +30,7 @@ class PairBornCoulWolfCS : public PairBornCoulWolf { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_buck_coul_long_cs.h b/src/CORESHELL/pair_buck_coul_long_cs.h index 49a4bbc2f8..548c290a7f 100644 --- a/src/CORESHELL/pair_buck_coul_long_cs.h +++ b/src/CORESHELL/pair_buck_coul_long_cs.h @@ -30,7 +30,7 @@ class PairBuckCoulLongCS : public PairBuckCoulLong { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_coul_long_cs.h b/src/CORESHELL/pair_coul_long_cs.h index 8a58936e2b..e427eaa47d 100644 --- a/src/CORESHELL/pair_coul_long_cs.h +++ b/src/CORESHELL/pair_coul_long_cs.h @@ -30,7 +30,7 @@ class PairCoulLongCS : public PairCoulLong { virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_coul_wolf_cs.h b/src/CORESHELL/pair_coul_wolf_cs.h index 2049ff4b64..8803bf21f7 100644 --- a/src/CORESHELL/pair_coul_wolf_cs.h +++ b/src/CORESHELL/pair_coul_wolf_cs.h @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class PairCoulWolfCS : public PairCoulWolf { public: - PairCoulWolfCS( class LAMMPS *); - virtual void compute( int, int); + PairCoulWolfCS(class LAMMPS *); + virtual void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif /* LMP_PAIR_COUL_WOLF_CS_H_ */ diff --git a/src/CORESHELL/pair_lj_class2_coul_long_cs.h b/src/CORESHELL/pair_lj_class2_coul_long_cs.h index 0152d8e724..8fa8df8586 100644 --- a/src/CORESHELL/pair_lj_class2_coul_long_cs.h +++ b/src/CORESHELL/pair_lj_class2_coul_long_cs.h @@ -34,7 +34,7 @@ class PairLJClass2CoulLongCS : public PairLJClass2CoulLong { void compute_outer(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/CORESHELL/pair_lj_cut_coul_long_cs.h b/src/CORESHELL/pair_lj_cut_coul_long_cs.h index f0dc27b8a1..77be113f69 100644 --- a/src/CORESHELL/pair_lj_cut_coul_long_cs.h +++ b/src/CORESHELL/pair_lj_cut_coul_long_cs.h @@ -34,7 +34,7 @@ class PairLJCutCoulLongCS : public PairLJCutCoulLong { virtual void compute_outer(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h index b238343f6d..913ac626d4 100644 --- a/src/DIPOLE/atom_vec_dipole.h +++ b/src/DIPOLE/atom_vec_dipole.h @@ -35,7 +35,7 @@ class AtomVecDipole : public AtomVec { double **mu; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.h b/src/DIPOLE/pair_lj_cut_dipole_cut.h index b73d36dfc5..e6b34635df 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.h +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.h @@ -39,16 +39,16 @@ class PairLJCutDipoleCut : public Pair { void read_restart_settings(FILE *); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.h b/src/DIPOLE/pair_lj_cut_dipole_long.h index 1aa2d9215b..26ff54f73e 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.h +++ b/src/DIPOLE/pair_lj_cut_dipole_long.h @@ -43,10 +43,10 @@ class PairLJCutDipoleLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; + double **cut_lj, **cut_ljsq; double cut_coulsq; double **epsilon; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; double g_ewald; int ewald_order; virtual void *extract(const char *, int &); @@ -54,7 +54,7 @@ class PairLJCutDipoleLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/DIPOLE/pair_lj_long_dipole_long.h b/src/DIPOLE/pair_lj_long_dipole_long.h index b39eabdd6c..b5130ee33f 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.h +++ b/src/DIPOLE/pair_lj_long_dipole_long.h @@ -56,7 +56,7 @@ class PairLJLongDipoleLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_gpu.h b/src/GPU/fix_gpu.h index 804eb3fba7..a89c15c1d9 100644 --- a/src/GPU/fix_gpu.h +++ b/src/GPU/fix_gpu.h @@ -37,8 +37,8 @@ class FixGPU : public Fix { void post_force_respa(int, int, int); double memory_usage(); - double binsize(const double subx, const double suby, - const double subz, const int nlocal, const double cut); + double binsize(const double subx, const double suby, const double subz, const int nlocal, + const double cut); private: int _gpu_mode; @@ -47,7 +47,7 @@ class FixGPU : public Fix { double _binsize; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nh_gpu.h b/src/GPU/fix_nh_gpu.h index 6c764b7687..da966aa629 100644 --- a/src/GPU/fix_nh_gpu.h +++ b/src/GPU/fix_nh_gpu.h @@ -42,7 +42,7 @@ class FixNHGPU : public FixNH { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/GPU/fix_npt_gpu.h b/src/GPU/fix_npt_gpu.h index 0b28b5d14c..e9cf98539b 100644 --- a/src/GPU/fix_npt_gpu.h +++ b/src/GPU/fix_npt_gpu.h @@ -34,7 +34,7 @@ class FixNPTGPU : public FixNHGPU { ~FixNPTGPU() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nve_asphere_gpu.h b/src/GPU/fix_nve_asphere_gpu.h index ba37dd7673..21934f8caf 100644 --- a/src/GPU/fix_nve_asphere_gpu.h +++ b/src/GPU/fix_nve_asphere_gpu.h @@ -46,7 +46,7 @@ class FixNVEAsphereGPU : public FixNVE { class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nve_gpu.h b/src/GPU/fix_nve_gpu.h index 3ed88d87a4..8066aecdc6 100644 --- a/src/GPU/fix_nve_gpu.h +++ b/src/GPU/fix_nve_gpu.h @@ -44,7 +44,7 @@ class FixNVEGPU : public FixNVE { int _nlocal_max, _respa_on; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/fix_nvt_gpu.h b/src/GPU/fix_nvt_gpu.h index af1a45e116..a912f2bdd2 100644 --- a/src/GPU/fix_nvt_gpu.h +++ b/src/GPU/fix_nvt_gpu.h @@ -34,7 +34,7 @@ class FixNVTGPU : public FixNHGPU { ~FixNVTGPU() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/gpu_extra.h b/src/GPU/gpu_extra.h index 81d2a6a511..9115135b1b 100644 --- a/src/GPU/gpu_extra.h +++ b/src/GPU/gpu_extra.h @@ -18,90 +18,79 @@ #ifndef LMP_GPU_EXTRA_H #define LMP_GPU_EXTRA_H -#include "modify.h" #include "error.h" +#include "modify.h" // ---------------------- OPENMP PREPROCESSOR STUFF ------------------ #if defined(_OPENMP) - #if !defined(LAL_USE_OMP) - #define LAL_USE_OMP 1 - #endif +#if !defined(LAL_USE_OMP) +#define LAL_USE_OMP 1 +#endif - #if !defined(LAL_USE_OMP_SIMD) - #if (_OPENMP >= 201307) - #define LAL_USE_OMP_SIMD 1 - #else - #define LAL_USE_OMP_SIMD 0 - #endif - #endif +#if !defined(LAL_USE_OMP_SIMD) +#if (_OPENMP >= 201307) +#define LAL_USE_OMP_SIMD 1 #else - #if !defined(LAL_USE_OMP) - #define LAL_USE_OMP 0 - #endif +#define LAL_USE_OMP_SIMD 0 +#endif +#endif +#else +#if !defined(LAL_USE_OMP) +#define LAL_USE_OMP 0 +#endif - #if !defined(LAL_USE_OMP_SIMD) - #define LAL_USE_OMP_SIMD 0 - #endif +#if !defined(LAL_USE_OMP_SIMD) +#define LAL_USE_OMP_SIMD 0 +#endif #endif namespace GPU_EXTRA { - inline void check_flag(int error_flag, LAMMPS_NS::Error *error, - MPI_Comm &world) { - int all_success; - MPI_Allreduce(&error_flag, &all_success, 1, MPI_INT, MPI_MIN, world); - if (all_success != 0) { - if (all_success == -1) - error->all(FLERR, - "The package gpu command is required for gpu styles"); - else if (all_success == -2) - error->all(FLERR, - "Could not find/initialize a specified accelerator device"); - else if (all_success == -3) - error->all(FLERR,"Insufficient memory on accelerator"); - else if (all_success == -4) - error->all(FLERR,"GPU library not compiled for this accelerator"); - else if (all_success == -5) - error->all(FLERR, - "Double precision is not supported on this accelerator"); - else if (all_success == -6) - error->all(FLERR,"Unable to initialize accelerator for use"); - else if (all_success == -7) - error->all(FLERR, - "Accelerator sharing is not currently supported on system"); - else if (all_success == -8) - error->all(FLERR, - "GPU particle split must be set to 1 for this pair style."); - else if (all_success == -9) - error->all(FLERR, - "CPU neighbor lists must be used for ellipsoid/sphere mix."); - else if (all_success == -10) - error->all(FLERR, - "Invalid threads_per_atom specified."); - else if (all_success == -11) - error->all(FLERR, - "Invalid custom OpenCL parameter string."); - else if (all_success == -12) - error->all(FLERR, - "Invalid OpenCL platform ID."); - else if (all_success == -13) - error->all(FLERR, - "Invalid device configuration."); - else if (all_success == -15) - error->all(FLERR, - "P3M built for FP64 and GPU device is FP32 only."); - else - error->all(FLERR,"Unknown error in GPU library"); - } - } - - inline void gpu_ready(LAMMPS_NS::Modify *modify, LAMMPS_NS::Error *error) { - int ifix = modify->find_fix("package_gpu"); - if (ifix < 0) - error->all(FLERR,"The package gpu command is required for gpu styles"); +inline void check_flag(int error_flag, LAMMPS_NS::Error *error, MPI_Comm &world) +{ + int all_success; + MPI_Allreduce(&error_flag, &all_success, 1, MPI_INT, MPI_MIN, world); + if (all_success != 0) { + if (all_success == -1) + error->all(FLERR, "The package gpu command is required for gpu styles"); + else if (all_success == -2) + error->all(FLERR, "Could not find/initialize a specified accelerator device"); + else if (all_success == -3) + error->all(FLERR, "Insufficient memory on accelerator"); + else if (all_success == -4) + error->all(FLERR, "GPU library not compiled for this accelerator"); + else if (all_success == -5) + error->all(FLERR, "Double precision is not supported on this accelerator"); + else if (all_success == -6) + error->all(FLERR, "Unable to initialize accelerator for use"); + else if (all_success == -7) + error->all(FLERR, "Accelerator sharing is not currently supported on system"); + else if (all_success == -8) + error->all(FLERR, "GPU particle split must be set to 1 for this pair style."); + else if (all_success == -9) + error->all(FLERR, "CPU neighbor lists must be used for ellipsoid/sphere mix."); + else if (all_success == -10) + error->all(FLERR, "Invalid threads_per_atom specified."); + else if (all_success == -11) + error->all(FLERR, "Invalid custom OpenCL parameter string."); + else if (all_success == -12) + error->all(FLERR, "Invalid OpenCL platform ID."); + else if (all_success == -13) + error->all(FLERR, "Invalid device configuration."); + else if (all_success == -15) + error->all(FLERR, "P3M built for FP64 and GPU device is FP32 only."); + else + error->all(FLERR, "Unknown error in GPU library"); } } +inline void gpu_ready(LAMMPS_NS::Modify *modify, LAMMPS_NS::Error *error) +{ + int ifix = modify->find_fix("package_gpu"); + if (ifix < 0) error->all(FLERR, "The package gpu command is required for gpu styles"); +} +} // namespace GPU_EXTRA + #endif /* ERROR/WARNING messages: diff --git a/src/GPU/pair_beck_gpu.h b/src/GPU/pair_beck_gpu.h index 4c4d172387..875a1c8881 100644 --- a/src/GPU/pair_beck_gpu.h +++ b/src/GPU/pair_beck_gpu.h @@ -33,14 +33,14 @@ class PairBeckGPU : public PairBeck { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_long_cs_gpu.h b/src/GPU/pair_born_coul_long_cs_gpu.h index 5c197691db..858049bf52 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.h +++ b/src/GPU/pair_born_coul_long_cs_gpu.h @@ -33,14 +33,14 @@ class PairBornCoulLongCSGPU : public PairBornCoulLongCS { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_long_gpu.h b/src/GPU/pair_born_coul_long_gpu.h index 010677011d..bf15e7b936 100644 --- a/src/GPU/pair_born_coul_long_gpu.h +++ b/src/GPU/pair_born_coul_long_gpu.h @@ -33,14 +33,14 @@ class PairBornCoulLongGPU : public PairBornCoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_wolf_cs_gpu.h b/src/GPU/pair_born_coul_wolf_cs_gpu.h index 27bc387f99..1ed5bf330b 100644 --- a/src/GPU/pair_born_coul_wolf_cs_gpu.h +++ b/src/GPU/pair_born_coul_wolf_cs_gpu.h @@ -33,14 +33,14 @@ class PairBornCoulWolfCSGPU : public PairBornCoulWolfCS { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_coul_wolf_gpu.h b/src/GPU/pair_born_coul_wolf_gpu.h index ab0580e8a3..df02d65fa3 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.h +++ b/src/GPU/pair_born_coul_wolf_gpu.h @@ -33,14 +33,14 @@ class PairBornCoulWolfGPU : public PairBornCoulWolf { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_born_gpu.h b/src/GPU/pair_born_gpu.h index 27a21a3159..3cd9e9e8d9 100644 --- a/src/GPU/pair_born_gpu.h +++ b/src/GPU/pair_born_gpu.h @@ -34,14 +34,14 @@ class PairBornGPU : public PairBorn { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_buck_coul_cut_gpu.h b/src/GPU/pair_buck_coul_cut_gpu.h index 2fae4d4e3d..369f399b54 100644 --- a/src/GPU/pair_buck_coul_cut_gpu.h +++ b/src/GPU/pair_buck_coul_cut_gpu.h @@ -33,14 +33,14 @@ class PairBuckCoulCutGPU : public PairBuckCoulCut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_buck_coul_long_gpu.h b/src/GPU/pair_buck_coul_long_gpu.h index 8809d07497..f8b9994662 100644 --- a/src/GPU/pair_buck_coul_long_gpu.h +++ b/src/GPU/pair_buck_coul_long_gpu.h @@ -33,14 +33,14 @@ class PairBuckCoulLongGPU : public PairBuckCoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_buck_gpu.h b/src/GPU/pair_buck_gpu.h index 79cd545987..66caf5a606 100644 --- a/src/GPU/pair_buck_gpu.h +++ b/src/GPU/pair_buck_gpu.h @@ -34,14 +34,14 @@ class PairBuckGPU : public PairBuck { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_colloid_gpu.h b/src/GPU/pair_colloid_gpu.h index 7bcdbaa6b9..a7d463f918 100644 --- a/src/GPU/pair_colloid_gpu.h +++ b/src/GPU/pair_colloid_gpu.h @@ -33,14 +33,14 @@ class PairColloidGPU : public PairColloid { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_cut_gpu.h b/src/GPU/pair_coul_cut_gpu.h index b50814b897..4255c78751 100644 --- a/src/GPU/pair_coul_cut_gpu.h +++ b/src/GPU/pair_coul_cut_gpu.h @@ -34,14 +34,14 @@ class PairCoulCutGPU : public PairCoulCut { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_debye_gpu.h b/src/GPU/pair_coul_debye_gpu.h index 70c48a5f62..6d8c44e92b 100644 --- a/src/GPU/pair_coul_debye_gpu.h +++ b/src/GPU/pair_coul_debye_gpu.h @@ -34,14 +34,14 @@ class PairCoulDebyeGPU : public PairCoulDebye { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_dsf_gpu.h b/src/GPU/pair_coul_dsf_gpu.h index 629f9c3c39..5db16fd3bb 100644 --- a/src/GPU/pair_coul_dsf_gpu.h +++ b/src/GPU/pair_coul_dsf_gpu.h @@ -33,14 +33,14 @@ class PairCoulDSFGPU : public PairCoulDSF { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_long_cs_gpu.h b/src/GPU/pair_coul_long_cs_gpu.h index 500ef5e44b..9c73bb7c68 100644 --- a/src/GPU/pair_coul_long_cs_gpu.h +++ b/src/GPU/pair_coul_long_cs_gpu.h @@ -34,14 +34,14 @@ class PairCoulLongCSGPU : public PairCoulLongCS { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_coul_long_gpu.h b/src/GPU/pair_coul_long_gpu.h index 3089d15db6..335cd82540 100644 --- a/src/GPU/pair_coul_long_gpu.h +++ b/src/GPU/pair_coul_long_gpu.h @@ -34,14 +34,14 @@ class PairCoulLongGPU : public PairCoulLong { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_dpd_gpu.h b/src/GPU/pair_dpd_gpu.h index be19d5a06d..222e3b5387 100644 --- a/src/GPU/pair_dpd_gpu.h +++ b/src/GPU/pair_dpd_gpu.h @@ -33,14 +33,14 @@ class PairDPDGPU : public PairDPD { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_dpd_tstat_gpu.h b/src/GPU/pair_dpd_tstat_gpu.h index cbca8d1828..c830cf9c12 100644 --- a/src/GPU/pair_dpd_tstat_gpu.h +++ b/src/GPU/pair_dpd_tstat_gpu.h @@ -33,14 +33,14 @@ class PairDPDTstatGPU : public PairDPDTstat { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_eam_alloy_gpu.h b/src/GPU/pair_eam_alloy_gpu.h index 1f5c905157..4c8616bd0c 100644 --- a/src/GPU/pair_eam_alloy_gpu.h +++ b/src/GPU/pair_eam_alloy_gpu.h @@ -25,7 +25,7 @@ PairStyle(eam/alloy/gpu,PairEAMAlloyGPU); namespace LAMMPS_NS { class PairEAMAlloyGPU : public PairEAM { -public: + public: PairEAMAlloyGPU(class LAMMPS *); virtual ~PairEAMAlloyGPU(); void coeff(int, char **); @@ -38,7 +38,7 @@ public: int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void read_file(char *); @@ -50,7 +50,7 @@ public: bool fp_single; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_eam_fs_gpu.h b/src/GPU/pair_eam_fs_gpu.h index eadd283139..39c101ff66 100644 --- a/src/GPU/pair_eam_fs_gpu.h +++ b/src/GPU/pair_eam_fs_gpu.h @@ -25,7 +25,7 @@ PairStyle(eam/fs/gpu,PairEAMFSGPU); namespace LAMMPS_NS { class PairEAMFSGPU : public PairEAM { -public: + public: PairEAMFSGPU(class LAMMPS *); virtual ~PairEAMFSGPU(); void coeff(int, char **); @@ -38,7 +38,7 @@ public: int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void read_file(char *); @@ -50,7 +50,7 @@ public: bool fp_single; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h index 91476440a2..fb99241c4d 100644 --- a/src/GPU/pair_eam_gpu.h +++ b/src/GPU/pair_eam_gpu.h @@ -26,7 +26,6 @@ namespace LAMMPS_NS { class PairEAMGPU : public PairEAM { public: - PairEAMGPU(class LAMMPS *); virtual ~PairEAMGPU(); void compute(int, int); @@ -38,7 +37,7 @@ class PairEAMGPU : public PairEAM { int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: int gpu_mode; @@ -47,7 +46,7 @@ class PairEAMGPU : public PairEAM { bool fp_single; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_gauss_gpu.h b/src/GPU/pair_gauss_gpu.h index fa4fbb642d..2f80ca5cc1 100644 --- a/src/GPU/pair_gauss_gpu.h +++ b/src/GPU/pair_gauss_gpu.h @@ -34,14 +34,14 @@ class PairGaussGPU : public PairGauss { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_gayberne_gpu.h b/src/GPU/pair_gayberne_gpu.h index c8aba590a4..289234a62b 100644 --- a/src/GPU/pair_gayberne_gpu.h +++ b/src/GPU/pair_gayberne_gpu.h @@ -42,7 +42,7 @@ class PairGayBerneGPU : public PairGayBerne { double **quat; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj96_cut_gpu.h b/src/GPU/pair_lj96_cut_gpu.h index 6acc333e2e..1629d300f7 100644 --- a/src/GPU/pair_lj96_cut_gpu.h +++ b/src/GPU/pair_lj96_cut_gpu.h @@ -33,14 +33,14 @@ class PairLJ96CutGPU : public PairLJ96Cut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_charmm_coul_charmm_gpu.h b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h index 8746d3e9e6..92048ad088 100644 --- a/src/GPU/pair_lj_charmm_coul_charmm_gpu.h +++ b/src/GPU/pair_lj_charmm_coul_charmm_gpu.h @@ -33,14 +33,14 @@ class PairLJCharmmCoulCharmmGPU : public PairLJCharmmCoulCharmm { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.h b/src/GPU/pair_lj_charmm_coul_long_gpu.h index 7531273553..df742bad10 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.h +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.h @@ -33,14 +33,14 @@ class PairLJCharmmCoulLongGPU : public PairLJCharmmCoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.h b/src/GPU/pair_lj_class2_coul_long_gpu.h index ac89c1c431..c0917e0c59 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.h +++ b/src/GPU/pair_lj_class2_coul_long_gpu.h @@ -33,14 +33,14 @@ class PairLJClass2CoulLongGPU : public PairLJClass2CoulLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_class2_gpu.h b/src/GPU/pair_lj_class2_gpu.h index 3a73d2916c..0ebbf841d9 100644 --- a/src/GPU/pair_lj_class2_gpu.h +++ b/src/GPU/pair_lj_class2_gpu.h @@ -33,14 +33,14 @@ class PairLJClass2GPU : public PairLJClass2 { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cubic_gpu.h b/src/GPU/pair_lj_cubic_gpu.h index 4fca08f677..d8f4bbf34b 100644 --- a/src/GPU/pair_lj_cubic_gpu.h +++ b/src/GPU/pair_lj_cubic_gpu.h @@ -33,14 +33,14 @@ class PairLJCubicGPU : public PairLJCubic { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.h b/src/GPU/pair_lj_cut_coul_cut_gpu.h index 71fda8a9ed..353b288941 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.h +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.h @@ -33,14 +33,14 @@ class PairLJCutCoulCutGPU : public PairLJCutCoulCut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.h b/src/GPU/pair_lj_cut_coul_debye_gpu.h index e048cbe16d..af1a488784 100644 --- a/src/GPU/pair_lj_cut_coul_debye_gpu.h +++ b/src/GPU/pair_lj_cut_coul_debye_gpu.h @@ -33,14 +33,14 @@ class PairLJCutCoulDebyeGPU : public PairLJCutCoulDebye { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.h b/src/GPU/pair_lj_cut_coul_dsf_gpu.h index 49fa37cd46..eabfaf4bc9 100644 --- a/src/GPU/pair_lj_cut_coul_dsf_gpu.h +++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.h @@ -33,14 +33,14 @@ class PairLJCutCoulDSFGPU : public PairLJCutCoulDSF { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.h b/src/GPU/pair_lj_cut_coul_long_gpu.h index 46ad42967e..bd283d546f 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.h +++ b/src/GPU/pair_lj_cut_coul_long_gpu.h @@ -34,14 +34,14 @@ class PairLJCutCoulLongGPU : public PairLJCutCoulLong { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.h b/src/GPU/pair_lj_cut_coul_msm_gpu.h index 0869ab47b5..b4aeaedbd4 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.h +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.h @@ -33,14 +33,14 @@ class PairLJCutCoulMSMGPU : public PairLJCutCoulMSM { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.h b/src/GPU/pair_lj_cut_dipole_cut_gpu.h index ef0f69a4ee..6284da8ae4 100644 --- a/src/GPU/pair_lj_cut_dipole_cut_gpu.h +++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.h @@ -33,14 +33,14 @@ class PairLJCutDipoleCutGPU : public PairLJCutDipoleCut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.h b/src/GPU/pair_lj_cut_dipole_long_gpu.h index f2b280ab35..e484593dd9 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.h +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.h @@ -33,14 +33,14 @@ class PairLJCutDipoleLongGPU : public PairLJCutDipoleLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_gpu.h b/src/GPU/pair_lj_cut_gpu.h index 57ac0a3721..5cc8ab5c6a 100644 --- a/src/GPU/pair_lj_cut_gpu.h +++ b/src/GPU/pair_lj_cut_gpu.h @@ -34,14 +34,14 @@ class PairLJCutGPU : public PairLJCut { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.h b/src/GPU/pair_lj_cut_tip4p_long_gpu.h index b7d9ce2bb1..6fdeccbffe 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.h +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.h @@ -36,13 +36,13 @@ class PairLJCutTIP4PLongGPU : public PairLJCutTIP4PLong { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.h b/src/GPU/pair_lj_expand_coul_long_gpu.h index 11d8e5a974..9307b468c5 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.h +++ b/src/GPU/pair_lj_expand_coul_long_gpu.h @@ -34,14 +34,14 @@ class PairLJExpandCoulLongGPU : public PairLJExpandCoulLong { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_expand_gpu.h b/src/GPU/pair_lj_expand_gpu.h index 8bfa59cf2b..66bcbb3e82 100644 --- a/src/GPU/pair_lj_expand_gpu.h +++ b/src/GPU/pair_lj_expand_gpu.h @@ -34,14 +34,14 @@ class PairLJExpandGPU : public PairLJExpand { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_gromacs_gpu.h b/src/GPU/pair_lj_gromacs_gpu.h index f5a487059c..d625fa8d00 100644 --- a/src/GPU/pair_lj_gromacs_gpu.h +++ b/src/GPU/pair_lj_gromacs_gpu.h @@ -33,14 +33,14 @@ class PairLJGromacsGPU : public PairLJGromacs { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.h b/src/GPU/pair_lj_sdk_coul_long_gpu.h index 7027449535..ff71268ec6 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.h +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.h @@ -28,20 +28,19 @@ class PairLJSDKCoulLongGPU : public PairLJSDKCoulLong { public: PairLJSDKCoulLongGPU(LAMMPS *lmp); ~PairLJSDKCoulLongGPU(); - template - void cpu_compute(int, int, int *, int *, int **); + template void cpu_compute(int, int, int *, int *, int **); void compute(int, int); void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_sdk_gpu.h b/src/GPU/pair_lj_sdk_gpu.h index c654cb59fa..acbc2b042b 100644 --- a/src/GPU/pair_lj_sdk_gpu.h +++ b/src/GPU/pair_lj_sdk_gpu.h @@ -28,20 +28,19 @@ class PairLJSDKGPU : public PairLJSDK { public: PairLJSDKGPU(LAMMPS *lmp); ~PairLJSDKGPU(); - template - void cpu_compute(int, int, int *, int *, int **); + template void cpu_compute(int, int, int *, int *, int **); void compute(int, int); void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.h b/src/GPU/pair_lj_sf_dipole_sf_gpu.h index e710ef8b95..dac80487d8 100644 --- a/src/GPU/pair_lj_sf_dipole_sf_gpu.h +++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.h @@ -33,14 +33,14 @@ class PairLJSFDipoleSFGPU : public PairLJSFDipoleSF { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_mie_cut_gpu.h b/src/GPU/pair_mie_cut_gpu.h index efe85c3538..21d5d18e78 100644 --- a/src/GPU/pair_mie_cut_gpu.h +++ b/src/GPU/pair_mie_cut_gpu.h @@ -33,14 +33,14 @@ class PairMIECutGPU : public PairMIECut { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_morse_gpu.h b/src/GPU/pair_morse_gpu.h index ad14ea49bf..5aa484697d 100644 --- a/src/GPU/pair_morse_gpu.h +++ b/src/GPU/pair_morse_gpu.h @@ -33,14 +33,14 @@ class PairMorseGPU : public PairMorse { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_resquared_gpu.h b/src/GPU/pair_resquared_gpu.h index 033432fae5..fa0d645fe2 100644 --- a/src/GPU/pair_resquared_gpu.h +++ b/src/GPU/pair_resquared_gpu.h @@ -42,7 +42,7 @@ class PairRESquaredGPU : public PairRESquared { double **quat; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_soft_gpu.h b/src/GPU/pair_soft_gpu.h index 23d9b8e384..d5f247d65b 100644 --- a/src/GPU/pair_soft_gpu.h +++ b/src/GPU/pair_soft_gpu.h @@ -34,14 +34,14 @@ class PairSoftGPU : public PairSoft { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_sw_gpu.h b/src/GPU/pair_sw_gpu.h index 842dfbf690..13d5fad3c8 100644 --- a/src/GPU/pair_sw_gpu.h +++ b/src/GPU/pair_sw_gpu.h @@ -32,7 +32,7 @@ class PairSWGPU : public PairSW { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -41,7 +41,7 @@ class PairSWGPU : public PairSW { double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_table_gpu.h b/src/GPU/pair_table_gpu.h index dbc033669f..64b72a8459 100644 --- a/src/GPU/pair_table_gpu.h +++ b/src/GPU/pair_table_gpu.h @@ -33,14 +33,14 @@ class PairTableGPU : public PairTable { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_tersoff_gpu.h b/src/GPU/pair_tersoff_gpu.h index 143d24ad55..a8b1f67189 100644 --- a/src/GPU/pair_tersoff_gpu.h +++ b/src/GPU/pair_tersoff_gpu.h @@ -32,7 +32,7 @@ class PairTersoffGPU : public PairTersoff { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -42,7 +42,7 @@ class PairTersoffGPU : public PairTersoff { int *gpulist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_tersoff_mod_gpu.h b/src/GPU/pair_tersoff_mod_gpu.h index 989e2a1d6f..d594160176 100644 --- a/src/GPU/pair_tersoff_mod_gpu.h +++ b/src/GPU/pair_tersoff_mod_gpu.h @@ -32,7 +32,7 @@ class PairTersoffMODGPU : public PairTersoffMOD { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -42,7 +42,7 @@ class PairTersoffMODGPU : public PairTersoffMOD { int *gpulist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_tersoff_zbl_gpu.h b/src/GPU/pair_tersoff_zbl_gpu.h index 05a2d5dad4..8e3e4457bf 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.h +++ b/src/GPU/pair_tersoff_zbl_gpu.h @@ -32,7 +32,7 @@ class PairTersoffZBLGPU : public PairTersoffZBL { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -42,7 +42,7 @@ class PairTersoffZBLGPU : public PairTersoffZBL { int *gpulist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_ufm_gpu.h b/src/GPU/pair_ufm_gpu.h index 77e3aaa576..becf2c469b 100644 --- a/src/GPU/pair_ufm_gpu.h +++ b/src/GPU/pair_ufm_gpu.h @@ -40,14 +40,14 @@ class PairUFMGPU : public PairUFM { void reinit(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_vashishta_gpu.h b/src/GPU/pair_vashishta_gpu.h index e26e4211a6..cc2b11a7d9 100644 --- a/src/GPU/pair_vashishta_gpu.h +++ b/src/GPU/pair_vashishta_gpu.h @@ -32,7 +32,7 @@ class PairVashishtaGPU : public PairVashishta { double init_one(int, int); void init_style(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; protected: void allocate(); @@ -41,7 +41,7 @@ class PairVashishtaGPU : public PairVashishta { double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_yukawa_colloid_gpu.h b/src/GPU/pair_yukawa_colloid_gpu.h index 5f9c8b8c53..c9e83d3a59 100644 --- a/src/GPU/pair_yukawa_colloid_gpu.h +++ b/src/GPU/pair_yukawa_colloid_gpu.h @@ -33,14 +33,14 @@ class PairYukawaColloidGPU : public PairYukawaColloid { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_yukawa_gpu.h b/src/GPU/pair_yukawa_gpu.h index dfe3822384..9da7f5d9a9 100644 --- a/src/GPU/pair_yukawa_gpu.h +++ b/src/GPU/pair_yukawa_gpu.h @@ -33,14 +33,14 @@ class PairYukawaGPU : public PairYukawa { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pair_zbl_gpu.h b/src/GPU/pair_zbl_gpu.h index 492abf9d37..e1d5c4fd3f 100644 --- a/src/GPU/pair_zbl_gpu.h +++ b/src/GPU/pair_zbl_gpu.h @@ -33,14 +33,14 @@ class PairZBLGPU : public PairZBL { void init_style(); double memory_usage(); - enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; + enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH }; private: int gpu_mode; double cpu_time; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GPU/pppm_gpu.h b/src/GPU/pppm_gpu.h index 1fd4145830..316e6a4ed6 100644 --- a/src/GPU/pppm_gpu.h +++ b/src/GPU/pppm_gpu.h @@ -51,12 +51,11 @@ class PPPMGPU : public PPPM { void pack_reverse_grid(int, void *, int, int *); void unpack_reverse_grid(int, void *, int, int *); - FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *, - FFT_SCALAR *, int); + FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *, FFT_SCALAR *, int); void destroy_3d_offset(FFT_SCALAR ***, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_freeze.h b/src/GRANULAR/fix_freeze.h index cf84fc9e62..87462953f8 100644 --- a/src/GRANULAR/fix_freeze.h +++ b/src/GRANULAR/fix_freeze.h @@ -36,10 +36,10 @@ class FixFreeze : public Fix { protected: int force_flag; - double foriginal[3],foriginal_all[3]; + double foriginal[3], foriginal_all[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_pour.h b/src/GRANULAR/fix_pour.h index e56599a3f6..0dcc2a6799 100644 --- a/src/GRANULAR/fix_pour.h +++ b/src/GRANULAR/fix_pour.h @@ -36,39 +36,39 @@ class FixPour : public Fix { void *extract(const char *, int &); private: - int ninsert,ntype,seed; - int iregion,mode,idnext,dstyle,npoly,rigidflag,shakeflag; - int ignoreflag,ignoreline,ignoretri; - double radius_one,radius_max; - double radius_lo,radius_hi; - double *radius_poly,*frac_poly; - double density_lo,density_hi; + int ninsert, ntype, seed; + int iregion, mode, idnext, dstyle, npoly, rigidflag, shakeflag; + int ignoreflag, ignoreline, ignoretri; + double radius_one, radius_max; + double radius_lo, radius_hi; + double *radius_poly, *frac_poly; + double density_lo, density_hi; double volfrac; int maxattempt; int region_style; double rate; - double vxlo,vxhi,vylo,vyhi,vy,vz; - double xlo,xhi,ylo,yhi,zlo,zhi; - double xc,yc,rc; + double vxlo, vxhi, vylo, vyhi, vy, vz; + double xlo, xhi, ylo, yhi, zlo, zhi; + double xc, yc, rc; double grav; - char *idrigid,*idshake; + char *idrigid, *idshake; class Molecule **onemols; - int nmol,natom_max; + int nmol, natom_max; double molradius_max; double *molfrac; double **coords; imageint *imageflags; - class Fix *fixrigid,*fixshake; + class Fix *fixrigid, *fixshake; double oneradius; - int me,nprocs; - int *recvcounts,*displs; - int nfreq,ninserted,nper; + int me, nprocs; + int *recvcounts, *displs; + int nfreq, ninserted, nper; bigint nfirst; - double lo_current,hi_current; - tagint maxtag_all,maxmol_all; - class RanPark *random,*random2; + double lo_current, hi_current; + tagint maxtag_all, maxmol_all; + class RanPark *random, *random2; void find_maxid(); int overlap(int); @@ -78,7 +78,7 @@ class FixPour : public Fix { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 6cc95a72e1..e924c75a41 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -26,9 +26,8 @@ namespace LAMMPS_NS { class FixWallGran : public Fix { public: - - enum {HOOKE,HOOKE_HISTORY,HERTZ_HISTORY,GRANULAR}; - enum {NORMAL_NONE, NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR}; + enum { HOOKE, HOOKE_HISTORY, HERTZ_HISTORY, GRANULAR }; + enum { NORMAL_NONE, NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR }; FixWallGran(class LAMMPS *, int, char **); virtual ~FixWallGran(); @@ -50,25 +49,22 @@ class FixWallGran : public Fix { virtual int maxsize_restart(); void reset_dt(); - void hooke(double, double, double, double, double *, double *, - double *, double *, double *, double, double, double*); - void hooke_history(double, double, double, double, double *, - double *, double *, double *, double *, double, - double, double *, double *); - void hertz_history(double, double, double, double, double *, - double, double *, double *, double *, double *, - double, double, double *, double *); - void granular(double, double, double, double, double *, double, - double *, double *, double *, double *, double, - double, double *, double *); + void hooke(double, double, double, double, double *, double *, double *, double *, double *, + double, double, double *); + void hooke_history(double, double, double, double, double *, double *, double *, double *, + double *, double, double, double *, double *); + void hertz_history(double, double, double, double, double *, double, double *, double *, double *, + double *, double, double, double *, double *); + void granular(double, double, double, double, double *, double, double *, double *, double *, + double *, double, double, double *, double *); double pulloff_distance(double); protected: - int wallstyle,wiggle,wshear,axis; - int pairstyle,nlevels_respa; + int wallstyle, wiggle, wshear, axis; + int pairstyle, nlevels_respa; bigint time_origin; - double kn,kt,gamman,gammat,xmu; + double kn, kt, gamman, gammat, xmu; // for granular model choices int normal_model, damping_model; @@ -93,8 +89,8 @@ class FixWallGran : public Fix { double roll_coeffs[3]; double twist_coeffs[3]; - double lo,hi,cylradius; - double amplitude,period,omega,vshear; + double lo, hi, cylradius; + double amplitude, period, omega, vshear; double dt; char *idregion; @@ -119,7 +115,7 @@ class FixWallGran : public Fix { void clear_stored_contacts(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/fix_wall_gran_region.h b/src/GRANULAR/fix_wall_gran_region.h index 55bf6a95ea..0e2711886f 100644 --- a/src/GRANULAR/fix_wall_gran_region.h +++ b/src/GRANULAR/fix_wall_gran_region.h @@ -30,7 +30,7 @@ class FixWallGranRegion : public FixWallGran { ~FixWallGranRegion(); void post_force(int); void write_restart(FILE *); - void restart(char* ); + void restart(char *); void init(); double memory_usage(); @@ -51,20 +51,20 @@ class FixWallGranRegion : public FixWallGran { // shear history for multiple contacts per particle - int tmax; // max # of region walls one particle can touch - int *ncontact; // # of shear contacts per particle - int **walls; // which wall each contact is with - double ***history_many; // history per particle per contact - int *c2r; // contact to region mapping - // c2r[i] = index of Ith contact in - // region-contact[] list of contacts - int motion_resetflag; // used by restart to indicate that region - // vel info is to be reset + int tmax; // max # of region walls one particle can touch + int *ncontact; // # of shear contacts per particle + int **walls; // which wall each contact is with + double ***history_many; // history per particle per contact + int *c2r; // contact to region mapping + // c2r[i] = index of Ith contact in + // region-contact[] list of contacts + int motion_resetflag; // used by restart to indicate that region + // vel info is to be reset void update_contacts(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_gran_hertz_history.h b/src/GRANULAR/pair_gran_hertz_history.h index 71624ded80..f30537b413 100644 --- a/src/GRANULAR/pair_gran_hertz_history.h +++ b/src/GRANULAR/pair_gran_hertz_history.h @@ -32,7 +32,7 @@ class PairGranHertzHistory : public PairGranHookeHistory { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_gran_hooke.h b/src/GRANULAR/pair_gran_hooke.h index c418a1ffa5..dd75ee5441 100644 --- a/src/GRANULAR/pair_gran_hooke.h +++ b/src/GRANULAR/pair_gran_hooke.h @@ -31,7 +31,7 @@ class PairGranHooke : public PairGranHookeHistory { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index 0614d771d4..7dde26bf5c 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -43,10 +43,10 @@ class PairGranHookeHistory : public Pair { void unpack_forward_comm(int, int, double *); double memory_usage(); double atom2cut(int); - double radii2cut(double,double); + double radii2cut(double, double); protected: - double kn,kt,gamman,gammat,xmu; + double kn, kt, gamman, gammat, xmu; int dampflag; double dt; int freeze_group_bit; @@ -54,8 +54,8 @@ class PairGranHookeHistory : public Pair { int limit_damping; int neighprev; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; int size_history; @@ -71,7 +71,7 @@ class PairGranHookeHistory : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index 2f1a074d96..7149f8f960 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -41,7 +41,7 @@ class PairGranular : public Pair { void unpack_forward_comm(int, int, double *); double memory_usage(); double atom2cut(int); - double radii2cut(double,double); + double radii2cut(double, double); protected: double dt; @@ -49,8 +49,8 @@ class PairGranular : public Pair { int use_history; int neighprev; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; double **cut; class FixDummy *fix_dummy; @@ -63,7 +63,7 @@ class PairGranular : public Pair { int nmax; // allocated size of mass_rigid void allocate(); - void transfer_history(double*, double*); + void transfer_history(double *, double *); private: int size_history; @@ -102,7 +102,7 @@ class PairGranular : public Pair { double pulloff_distance(double, double, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index b35e7f13ad..bf5fb7dd5d 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -74,17 +74,17 @@ class FixStoreKIM : public Fix { ~FixStoreKIM(); int setmask(); - void setptr(const std::string &, void *); + void setptr(const std::string &, void *); void *getptr(const std::string &); private: - void *simulator_model; // pointer to KIM simulator model class - void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or null pointer - void *user_units; // string of unit conversion target or null pointer + void *simulator_model; // pointer to KIM simulator model class + void *model_name; // string of KIM model name + void *model_units; // string of unit conversion origin or null pointer + void *user_units; // string of unit conversion target or null pointer }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KIM/kim_command.h b/src/KIM/kim_command.h index f0e5960dab..5f7bae8238 100644 --- a/src/KIM/kim_command.h +++ b/src/KIM/kim_command.h @@ -68,11 +68,11 @@ namespace LAMMPS_NS { class KimCommand : public Command { public: - KimCommand(class LAMMPS *lmp) : Command(lmp) {}; + KimCommand(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KIM/kim_init.h b/src/KIM/kim_init.h index 866744e236..7d2e924b84 100644 --- a/src/KIM/kim_init.h +++ b/src/KIM/kim_init.h @@ -68,10 +68,11 @@ namespace LAMMPS_NS { class KimInit : protected Pointers { public: - KimInit(class LAMMPS *lmp) : Pointers(lmp) {}; + KimInit(class LAMMPS *lmp) : Pointers(lmp){}; void command(int, char **); - enum model_type_enum {MO, SM}; + enum model_type_enum { MO, SM }; static void write_log_cite(class LAMMPS *, model_type_enum, char *); + private: model_type_enum model_type; bool unit_conversion_mode; @@ -81,7 +82,7 @@ class KimInit : protected Pointers { void do_variables(const std::string &, const std::string &); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_interactions.h b/src/KIM/kim_interactions.h index 46fc95bff9..99aeb0ca21 100644 --- a/src/KIM/kim_interactions.h +++ b/src/KIM/kim_interactions.h @@ -65,15 +65,16 @@ namespace LAMMPS_NS { class KimInteractions : protected Pointers { public: - KimInteractions(class LAMMPS *lmp) : Pointers(lmp) {}; + KimInteractions(class LAMMPS *lmp) : Pointers(lmp){}; void command(int, char **); + private: void do_setup(int, char **); int species_to_atomic_no(const std::string &species) const; void KIM_SET_TYPE_PARAMETERS(const std::string &input_line) const; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_param.h b/src/KIM/kim_param.h index b19d2c507b..52c34cc09d 100644 --- a/src/KIM/kim_param.h +++ b/src/KIM/kim_param.h @@ -60,17 +60,15 @@ #include "pointers.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { -class KimParam : protected Pointers -{ -public: +class KimParam : protected Pointers { + public: KimParam(class LAMMPS *lmp); void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_property.h b/src/KIM/kim_property.h index 7b5c999c66..e4dea679d3 100644 --- a/src/KIM/kim_property.h +++ b/src/KIM/kim_property.h @@ -58,17 +58,15 @@ #include "pointers.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { -class KimProperty : protected Pointers -{ -public: +class KimProperty : protected Pointers { + public: KimProperty(class LAMMPS *lmp); void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_query.h b/src/KIM/kim_query.h index 5d71856ee0..403fa7acc3 100644 --- a/src/KIM/kim_query.h +++ b/src/KIM/kim_query.h @@ -64,11 +64,11 @@ namespace LAMMPS_NS { class KimQuery : protected Pointers { public: - KimQuery(class LAMMPS *lmp) : Pointers(lmp) {}; + KimQuery(class LAMMPS *lmp) : Pointers(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KIM/kim_units.h b/src/KIM/kim_units.h index caf88d7c76..adf3dde1d2 100644 --- a/src/KIM/kim_units.h +++ b/src/KIM/kim_units.h @@ -57,8 +57,6 @@ #include -int lammps_unit_conversion(const std::string &unit_type_str, - const std::string &from_system_str, - const std::string &to_system_str, - double &conversion_factor); +int lammps_unit_conversion(const std::string &unit_type_str, const std::string &from_system_str, + const std::string &to_system_str, double &conversion_factor); #endif diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index ae6d0ea3bb..0ca8bf282f 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -74,24 +74,25 @@ namespace LAMMPS_NS { class PairKIM : public Pair { public: - PairKIM(class LAMMPS*); + PairKIM(class LAMMPS *); ~PairKIM(); // LAMMPS Pair class virtual function prototypes virtual void compute(int, int); - virtual void settings(int, char**); - virtual void coeff(int, char**); + virtual void settings(int, char **); + virtual void coeff(int, char **); virtual void init_style(); virtual void init_list(int id, NeighList *ptr); virtual double init_one(int, int); - virtual int pack_reverse_comm(int, int, double*); - virtual void unpack_reverse_comm(int, int*, double*); + virtual int pack_reverse_comm(int, int, double *); + virtual void unpack_reverse_comm(int, int *, double *); virtual double memory_usage(); // Get the KIM_Model object KIM_Model *get_kim_model(); // Get the atom type list std::string get_atom_type_list(); + protected: // (nearly) all bool flags are not initialized in constructor, but set // explicitly in the indicated function. All other data members are @@ -100,7 +101,7 @@ class PairKIM : public Pair { int init_style_call_count; // values set in settings() - char* kim_modelname; + char *kim_modelname; // list of args that map atom species to KIM elements std::string atom_type_list; @@ -109,17 +110,17 @@ class PairKIM : public Pair { // values set in allocate(), called by coeff() virtual void allocate(); - int* lmps_map_species_to_unique; + int *lmps_map_species_to_unique; // values set in coeff(), after calling allocate() - char** lmps_unique_elements; // names of unique elements given - // in pair_coeff command + char **lmps_unique_elements; // names of unique elements given + // in pair_coeff command int lmps_num_unique_elements; // values set in set_lmps_flags(), called from init_style() bool lmps_using_newton; bool lmps_using_molecular; - enum unit_sys {REAL, METAL, SI, CGS, ELECTRON}; + enum unit_sys { REAL, METAL, SI, CGS, ELECTRON }; unit_sys lmps_units; KIM_LengthUnit lengthUnit; KIM_EnergyUnit energyUnit; @@ -127,8 +128,8 @@ class PairKIM : public Pair { KIM_TemperatureUnit temperatureUnit; KIM_TimeUnit timeUnit; - KIM_Model * pkim; - KIM_ComputeArguments * pargs; + KIM_Model *pkim; + KIM_ComputeArguments *pargs; // values set in set_kim_model_has_flags(), called by kim_init() KIM_SupportStatus kim_model_support_for_energy; @@ -139,23 +140,23 @@ class PairKIM : public Pair { // values set in kim_init() bool kim_init_ok; int lmps_local_tot_num_atoms; - double kim_global_influence_distance; // KIM Model cutoff value + double kim_global_influence_distance; // KIM Model cutoff value int kim_number_of_neighbor_lists; - double const * kim_cutoff_values; - int const * modelWillNotRequestNeighborsOfNoncontributingParticles; - class NeighList ** neighborLists; + double const *kim_cutoff_values; + int const *modelWillNotRequestNeighborsOfNoncontributingParticles; + class NeighList **neighborLists; // values set in init_style() bool kim_particle_codes_ok; int *kim_particle_codes; // values set in compute() - int lmps_maxalloc; // max allocated memory value - int* kim_particleSpecies; // array of KIM particle species - int* kim_particleContributing; // array of KIM particle contributing - int* lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS - // is in molecular mode - int** lmps_stripped_neigh_ptr; // pointer into lists + int lmps_maxalloc; // max allocated memory value + int *kim_particleSpecies; // array of KIM particle species + int *kim_particleContributing; // array of KIM particle contributing + int *lmps_stripped_neigh_list; // neighbors of one atom, used when LAMMPS + // is in molecular mode + int **lmps_stripped_neigh_ptr; // pointer into lists // KIM specific helper functions virtual void set_contributing(); @@ -166,14 +167,12 @@ class PairKIM : public Pair { virtual void set_kim_model_has_flags(); virtual int check_for_routine_compatibility(); // static methods used as callbacks from KIM - static int get_neigh( - void const * const dataObject, - int const numberOfCutoffs, double const * const cutoffs, - int const neighborListIndex, int const particleNumber, - int * const numberOfNeighbors, - int const ** const neighborsOfParticle); + static int get_neigh(void const *const dataObject, int const numberOfCutoffs, + double const *const cutoffs, int const neighborListIndex, + int const particleNumber, int *const numberOfNeighbors, + int const **const neighborsOfParticle); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KOKKOS/angle_charmm_kokkos.h b/src/KOKKOS/angle_charmm_kokkos.h index 1276d69a76..298055a52f 100644 --- a/src/KOKKOS/angle_charmm_kokkos.h +++ b/src/KOKKOS/angle_charmm_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/angle_class2_kokkos.h b/src/KOKKOS/angle_class2_kokkos.h index a61af5a428..12dbf2570e 100644 --- a/src/KOKKOS/angle_class2_kokkos.h +++ b/src/KOKKOS/angle_class2_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/angle_cosine_kokkos.h b/src/KOKKOS/angle_cosine_kokkos.h index e8f6d76dc0..35bd103119 100644 --- a/src/KOKKOS/angle_cosine_kokkos.h +++ b/src/KOKKOS/angle_cosine_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/angle_harmonic_kokkos.h b/src/KOKKOS/angle_harmonic_kokkos.h index 424ebf97ce..a7f41e79c9 100644 --- a/src/KOKKOS/angle_harmonic_kokkos.h +++ b/src/KOKKOS/angle_harmonic_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_kokkos.h b/src/KOKKOS/atom_kokkos.h index c4845173f2..fca3bf784f 100644 --- a/src/KOKKOS/atom_kokkos.h +++ b/src/KOKKOS/atom_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_angle_kokkos.h b/src/KOKKOS/atom_vec_angle_kokkos.h index 33d48f1d9a..ae6557e7b9 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.h +++ b/src/KOKKOS/atom_vec_angle_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.h b/src/KOKKOS/atom_vec_atomic_kokkos.h index c46aaac96a..fb05455acd 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.h +++ b/src/KOKKOS/atom_vec_atomic_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale AtomicKokkos/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_bond_kokkos.h b/src/KOKKOS/atom_vec_bond_kokkos.h index 38fbf95147..99b47fb734 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.h +++ b/src/KOKKOS/atom_vec_bond_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_charge_kokkos.h b/src/KOKKOS/atom_vec_charge_kokkos.h index be8334d909..978c62a8c3 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.h +++ b/src/KOKKOS/atom_vec_charge_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.h b/src/KOKKOS/atom_vec_dpd_kokkos.h index d0acf8a654..e83e50b915 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.h +++ b/src/KOKKOS/atom_vec_dpd_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale AtomicKokkos/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_full_kokkos.h b/src/KOKKOS/atom_vec_full_kokkos.h index 65a587a894..9d826d7842 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.h +++ b/src/KOKKOS/atom_vec_full_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.h b/src/KOKKOS/atom_vec_hybrid_kokkos.h index 611bc13ee1..1f166027d7 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.h +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_kokkos.h b/src/KOKKOS/atom_vec_kokkos.h index 55ebf3d960..cf7fdf7439 100644 --- a/src/KOKKOS/atom_vec_kokkos.h +++ b/src/KOKKOS/atom_vec_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.h b/src/KOKKOS/atom_vec_molecular_kokkos.h index 52506f11d5..aed013dc8f 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.h +++ b/src/KOKKOS/atom_vec_molecular_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.h b/src/KOKKOS/atom_vec_sphere_kokkos.h index 6716cad63d..107fe424cb 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.h +++ b/src/KOKKOS/atom_vec_sphere_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/atom_vec_spin_kokkos.h b/src/KOKKOS/atom_vec_spin_kokkos.h index 755471d1b9..63e7340e9c 100644 --- a/src/KOKKOS/atom_vec_spin_kokkos.h +++ b/src/KOKKOS/atom_vec_spin_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/bond_class2_kokkos.h b/src/KOKKOS/bond_class2_kokkos.h index 2374680b42..8287cacd2c 100644 --- a/src/KOKKOS/bond_class2_kokkos.h +++ b/src/KOKKOS/bond_class2_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/bond_fene_kokkos.h b/src/KOKKOS/bond_fene_kokkos.h index 2d606474f9..2e81bb856e 100644 --- a/src/KOKKOS/bond_fene_kokkos.h +++ b/src/KOKKOS/bond_fene_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/bond_harmonic_kokkos.h b/src/KOKKOS/bond_harmonic_kokkos.h index ce436aaa06..8f95cfe2c3 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.h +++ b/src/KOKKOS/bond_harmonic_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/comm_kokkos.h b/src/KOKKOS/comm_kokkos.h index b66de5a0d0..c0f17ade86 100644 --- a/src/KOKKOS/comm_kokkos.h +++ b/src/KOKKOS/comm_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/comm_tiled_kokkos.h b/src/KOKKOS/comm_tiled_kokkos.h index 28f88de7b3..50583d4e99 100644 --- a/src/KOKKOS/comm_tiled_kokkos.h +++ b/src/KOKKOS/comm_tiled_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/compute_coord_atom_kokkos.h b/src/KOKKOS/compute_coord_atom_kokkos.h index 3fcd5cb1f4..ec2c369e51 100644 --- a/src/KOKKOS/compute_coord_atom_kokkos.h +++ b/src/KOKKOS/compute_coord_atom_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.h b/src/KOKKOS/compute_orientorder_atom_kokkos.h index d55f7dc264..c561b73e28 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.h +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/compute_temp_kokkos.h b/src/KOKKOS/compute_temp_kokkos.h index 4016bfadfd..88f1250eb9 100644 --- a/src/KOKKOS/compute_temp_kokkos.h +++ b/src/KOKKOS/compute_temp_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/dihedral_charmm_kokkos.h b/src/KOKKOS/dihedral_charmm_kokkos.h index 5e26ce08fd..457cc14465 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.h +++ b/src/KOKKOS/dihedral_charmm_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/dihedral_class2_kokkos.h b/src/KOKKOS/dihedral_class2_kokkos.h index e6410dbe09..48cf97c1a3 100644 --- a/src/KOKKOS/dihedral_class2_kokkos.h +++ b/src/KOKKOS/dihedral_class2_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/dihedral_harmonic_kokkos.h b/src/KOKKOS/dihedral_harmonic_kokkos.h index 26d5d8f91a..c0e0048f6a 100644 --- a/src/KOKKOS/dihedral_harmonic_kokkos.h +++ b/src/KOKKOS/dihedral_harmonic_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/dihedral_opls_kokkos.h b/src/KOKKOS/dihedral_opls_kokkos.h index dd5579a678..9ccd06a7bb 100644 --- a/src/KOKKOS/dihedral_opls_kokkos.h +++ b/src/KOKKOS/dihedral_opls_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/domain_kokkos.h b/src/KOKKOS/domain_kokkos.h index be0a036d06..e32c890288 100644 --- a/src/KOKKOS/domain_kokkos.h +++ b/src/KOKKOS/domain_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fft3d_kokkos.h b/src/KOKKOS/fft3d_kokkos.h index 9a20580d4a..9955cc8a88 100644 --- a/src/KOKKOS/fft3d_kokkos.h +++ b/src/KOKKOS/fft3d_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fftdata_kokkos.h b/src/KOKKOS/fftdata_kokkos.h index ba62670bdf..97a419c88e 100644 --- a/src/KOKKOS/fftdata_kokkos.h +++ b/src/KOKKOS/fftdata_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_deform_kokkos.h b/src/KOKKOS/fix_deform_kokkos.h index 3d30813b76..c8e052ab5f 100644 --- a/src/KOKKOS/fix_deform_kokkos.h +++ b/src/KOKKOS/fix_deform_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_dpd_energy_kokkos.h b/src/KOKKOS/fix_dpd_energy_kokkos.h index d209bf3592..a70cc56c2e 100644 --- a/src/KOKKOS/fix_dpd_energy_kokkos.h +++ b/src/KOKKOS/fix_dpd_energy_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_enforce2d_kokkos.h b/src/KOKKOS/fix_enforce2d_kokkos.h index a89cc57e84..bb5abd87df 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.h +++ b/src/KOKKOS/fix_enforce2d_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_eos_table_rx_kokkos.h b/src/KOKKOS/fix_eos_table_rx_kokkos.h index 97c0c4b252..e18209a63a 100644 --- a/src/KOKKOS/fix_eos_table_rx_kokkos.h +++ b/src/KOKKOS/fix_eos_table_rx_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_freeze_kokkos.h b/src/KOKKOS/fix_freeze_kokkos.h index 03ccbdc634..2f582ca38d 100644 --- a/src/KOKKOS/fix_freeze_kokkos.h +++ b/src/KOKKOS/fix_freeze_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_gravity_kokkos.h b/src/KOKKOS/fix_gravity_kokkos.h index b7f9508aa3..78d437c958 100644 --- a/src/KOKKOS/fix_gravity_kokkos.h +++ b/src/KOKKOS/fix_gravity_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_langevin_kokkos.h b/src/KOKKOS/fix_langevin_kokkos.h index 61ead51b6c..77a31ba5d0 100644 --- a/src/KOKKOS/fix_langevin_kokkos.h +++ b/src/KOKKOS/fix_langevin_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_minimize_kokkos.h b/src/KOKKOS/fix_minimize_kokkos.h index b8412d4b0e..b036103b12 100644 --- a/src/KOKKOS/fix_minimize_kokkos.h +++ b/src/KOKKOS/fix_minimize_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_momentum_kokkos.h b/src/KOKKOS/fix_momentum_kokkos.h index 5e96ef7235..d3fa57644a 100644 --- a/src/KOKKOS/fix_momentum_kokkos.h +++ b/src/KOKKOS/fix_momentum_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_neigh_history_kokkos.h b/src/KOKKOS/fix_neigh_history_kokkos.h index 63ba997aa3..4c241ae209 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.h +++ b/src/KOKKOS/fix_neigh_history_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_nh_kokkos.h b/src/KOKKOS/fix_nh_kokkos.h index 06c4fecab1..3fe64b4b6f 100644 --- a/src/KOKKOS/fix_nh_kokkos.h +++ b/src/KOKKOS/fix_nh_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_nph_kokkos.h b/src/KOKKOS/fix_nph_kokkos.h index 09e5240472..3c23d5bb9d 100644 --- a/src/KOKKOS/fix_nph_kokkos.h +++ b/src/KOKKOS/fix_nph_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_npt_kokkos.h b/src/KOKKOS/fix_npt_kokkos.h index 30e0c17e66..bf54dc31e8 100644 --- a/src/KOKKOS/fix_npt_kokkos.h +++ b/src/KOKKOS/fix_npt_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_nve_kokkos.h b/src/KOKKOS/fix_nve_kokkos.h index ea8c54324b..989768a1c0 100644 --- a/src/KOKKOS/fix_nve_kokkos.h +++ b/src/KOKKOS/fix_nve_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.h b/src/KOKKOS/fix_nve_sphere_kokkos.h index 88edc2a586..c28f453360 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.h +++ b/src/KOKKOS/fix_nve_sphere_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_nvt_kokkos.h b/src/KOKKOS/fix_nvt_kokkos.h index 0db4f65b46..38db81392b 100644 --- a/src/KOKKOS/fix_nvt_kokkos.h +++ b/src/KOKKOS/fix_nvt_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_property_atom_kokkos.h b/src/KOKKOS/fix_property_atom_kokkos.h index 4b10d4b4aa..77068e3601 100644 --- a/src/KOKKOS/fix_property_atom_kokkos.h +++ b/src/KOKKOS/fix_property_atom_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.h b/src/KOKKOS/fix_qeq_reax_kokkos.h index 5fbac65d80..7cabc967e2 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.h +++ b/src/KOKKOS/fix_qeq_reax_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.h b/src/KOKKOS/fix_reaxc_bonds_kokkos.h index 31a7b6e714..5246371055 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.h +++ b/src/KOKKOS/fix_reaxc_bonds_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.h b/src/KOKKOS/fix_reaxc_species_kokkos.h index eb9dd99187..b30312139a 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.h +++ b/src/KOKKOS/fix_reaxc_species_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 1a4f74eda0..bdfa3f556d 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_setforce_kokkos.h b/src/KOKKOS/fix_setforce_kokkos.h index 25ccc2bab9..86239d7d0b 100644 --- a/src/KOKKOS/fix_setforce_kokkos.h +++ b/src/KOKKOS/fix_setforce_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_shake_kokkos.h b/src/KOKKOS/fix_shake_kokkos.h index 601e287252..1b265147c4 100644 --- a/src/KOKKOS/fix_shake_kokkos.h +++ b/src/KOKKOS/fix_shake_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_shardlow_kokkos.h b/src/KOKKOS/fix_shardlow_kokkos.h index 1f55d25b0e..6805101378 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.h +++ b/src/KOKKOS/fix_shardlow_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_wall_lj93_kokkos.h b/src/KOKKOS/fix_wall_lj93_kokkos.h index 21ce6db6f0..fc7557c162 100644 --- a/src/KOKKOS/fix_wall_lj93_kokkos.h +++ b/src/KOKKOS/fix_wall_lj93_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/fix_wall_reflect_kokkos.h b/src/KOKKOS/fix_wall_reflect_kokkos.h index 0733096047..135216ed12 100644 --- a/src/KOKKOS/fix_wall_reflect_kokkos.h +++ b/src/KOKKOS/fix_wall_reflect_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/gridcomm_kokkos.h b/src/KOKKOS/gridcomm_kokkos.h index 270ad98ad0..68981c1832 100644 --- a/src/KOKKOS/gridcomm_kokkos.h +++ b/src/KOKKOS/gridcomm_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/improper_class2_kokkos.h b/src/KOKKOS/improper_class2_kokkos.h index 3f57a3c5ac..9eafce55df 100644 --- a/src/KOKKOS/improper_class2_kokkos.h +++ b/src/KOKKOS/improper_class2_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/improper_harmonic_kokkos.h b/src/KOKKOS/improper_harmonic_kokkos.h index 4f2ff10126..8dcad725de 100644 --- a/src/KOKKOS/improper_harmonic_kokkos.h +++ b/src/KOKKOS/improper_harmonic_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/kissfft_kokkos.h b/src/KOKKOS/kissfft_kokkos.h index 89e132e85a..97ec5749a8 100644 --- a/src/KOKKOS/kissfft_kokkos.h +++ b/src/KOKKOS/kissfft_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index 0994ff6e01..a83f7ba435 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/kokkos_base.h b/src/KOKKOS/kokkos_base.h index 855ccf9108..4e51b7c53d 100644 --- a/src/KOKKOS/kokkos_base.h +++ b/src/KOKKOS/kokkos_base.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/kokkos_base_fft.h b/src/KOKKOS/kokkos_base_fft.h index c087a4d3f6..1f1430e363 100644 --- a/src/KOKKOS/kokkos_base_fft.h +++ b/src/KOKKOS/kokkos_base_fft.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/kokkos_few.h b/src/KOKKOS/kokkos_few.h index 4c62b13fea..48f6ed7390 100644 --- a/src/KOKKOS/kokkos_few.h +++ b/src/KOKKOS/kokkos_few.h @@ -1,3 +1,4 @@ +// clang-format off #ifndef KOKKOS_FEW_H #define KOKKOS_FEW_H diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index a00c43bd2d..a63ca5f8f5 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/math_special_kokkos.h b/src/KOKKOS/math_special_kokkos.h index 02b05739ee..5d919925f4 100644 --- a/src/KOKKOS/math_special_kokkos.h +++ b/src/KOKKOS/math_special_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 186168b9b1..86cce893c0 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/min_cg_kokkos.h b/src/KOKKOS/min_cg_kokkos.h index 62cf16e3af..ee74deb31c 100644 --- a/src/KOKKOS/min_cg_kokkos.h +++ b/src/KOKKOS/min_cg_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/min_kokkos.h b/src/KOKKOS/min_kokkos.h index 8cfb3c7c24..312da6247d 100644 --- a/src/KOKKOS/min_kokkos.h +++ b/src/KOKKOS/min_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/min_linesearch_kokkos.h b/src/KOKKOS/min_linesearch_kokkos.h index 6a82c43b93..69042c85c0 100644 --- a/src/KOKKOS/min_linesearch_kokkos.h +++ b/src/KOKKOS/min_linesearch_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/modify_kokkos.h b/src/KOKKOS/modify_kokkos.h index 99fbb26c5c..f15ea6d9e2 100644 --- a/src/KOKKOS/modify_kokkos.h +++ b/src/KOKKOS/modify_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/nbin_kokkos.h b/src/KOKKOS/nbin_kokkos.h index 1cfd930030..5882111d1e 100644 --- a/src/KOKKOS/nbin_kokkos.h +++ b/src/KOKKOS/nbin_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/nbin_ssa_kokkos.h b/src/KOKKOS/nbin_ssa_kokkos.h index 559b793288..3eafcecb27 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.h +++ b/src/KOKKOS/nbin_ssa_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/neigh_bond_kokkos.h b/src/KOKKOS/neigh_bond_kokkos.h index ed62a5d859..3226407fe9 100644 --- a/src/KOKKOS/neigh_bond_kokkos.h +++ b/src/KOKKOS/neigh_bond_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/neigh_list_kokkos.h b/src/KOKKOS/neigh_list_kokkos.h index 727295ead1..f97633c8c7 100644 --- a/src/KOKKOS/neigh_list_kokkos.h +++ b/src/KOKKOS/neigh_list_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/neighbor_kokkos.h b/src/KOKKOS/neighbor_kokkos.h index 74b82e88ce..2d656b825b 100644 --- a/src/KOKKOS/neighbor_kokkos.h +++ b/src/KOKKOS/neighbor_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/npair_copy_kokkos.h b/src/KOKKOS/npair_copy_kokkos.h index 88b2b792d5..6217a29144 100644 --- a/src/KOKKOS/npair_copy_kokkos.h +++ b/src/KOKKOS/npair_copy_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/npair_halffull_kokkos.h b/src/KOKKOS/npair_halffull_kokkos.h index cc26d36989..a977801ca2 100644 --- a/src/KOKKOS/npair_halffull_kokkos.h +++ b/src/KOKKOS/npair_halffull_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/npair_kokkos.h b/src/KOKKOS/npair_kokkos.h index 2fcf106a99..fb832b50dc 100644 --- a/src/KOKKOS/npair_kokkos.h +++ b/src/KOKKOS/npair_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/npair_skip_kokkos.h b/src/KOKKOS/npair_skip_kokkos.h index 11e9fc79cf..ac962336bc 100644 --- a/src/KOKKOS/npair_skip_kokkos.h +++ b/src/KOKKOS/npair_skip_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/npair_ssa_kokkos.h b/src/KOKKOS/npair_ssa_kokkos.h index ab0894a676..e6025c06cf 100644 --- a/src/KOKKOS/npair_ssa_kokkos.h +++ b/src/KOKKOS/npair_ssa_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pack_kokkos.h b/src/KOKKOS/pack_kokkos.h index 3baad002b6..244af8f796 100644 --- a/src/KOKKOS/pack_kokkos.h +++ b/src/KOKKOS/pack_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- SPARTA - Stochastic PArallel Rarefied-gas Time-accurate Analyzer http://sparta.sandia.gov diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.h b/src/KOKKOS/pair_buck_coul_cut_kokkos.h index 893ad4beda..2467d94d27 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.h b/src/KOKKOS/pair_buck_coul_long_kokkos.h index 44d3adf3b4..17aa0f5692 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_buck_kokkos.h b/src/KOKKOS/pair_buck_kokkos.h index 65878f9839..f79f33c77d 100644 --- a/src/KOKKOS/pair_buck_kokkos.h +++ b/src/KOKKOS/pair_buck_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_coul_cut_kokkos.h b/src/KOKKOS/pair_coul_cut_kokkos.h index 3f268f472e..ef17a2343c 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_coul_cut_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_coul_debye_kokkos.h b/src/KOKKOS/pair_coul_debye_kokkos.h index 0b91a09578..8bb2a5c2e8 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_coul_debye_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_coul_dsf_kokkos.h b/src/KOKKOS/pair_coul_dsf_kokkos.h index 976bc8516c..c69335d455 100644 --- a/src/KOKKOS/pair_coul_dsf_kokkos.h +++ b/src/KOKKOS/pair_coul_dsf_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_coul_long_kokkos.h b/src/KOKKOS/pair_coul_long_kokkos.h index 4d94885a01..a2598959e5 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.h +++ b/src/KOKKOS/pair_coul_long_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_coul_wolf_kokkos.h b/src/KOKKOS/pair_coul_wolf_kokkos.h index 480129af02..295e4eeb5f 100644 --- a/src/KOKKOS/pair_coul_wolf_kokkos.h +++ b/src/KOKKOS/pair_coul_wolf_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h index a494322963..2cfc21d0dd 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.h b/src/KOKKOS/pair_eam_alloy_kokkos.h index 48b33501e2..abe5d38db2 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.h +++ b/src/KOKKOS/pair_eam_alloy_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator diff --git a/src/KOKKOS/pair_eam_fs_kokkos.h b/src/KOKKOS/pair_eam_fs_kokkos.h index 6fc69a5c26..1e7c630a8c 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.h +++ b/src/KOKKOS/pair_eam_fs_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator diff --git a/src/KOKKOS/pair_eam_kokkos.h b/src/KOKKOS/pair_eam_kokkos.h index 8a1abd8755..1534522362 100644 --- a/src/KOKKOS/pair_eam_kokkos.h +++ b/src/KOKKOS/pair_eam_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.h b/src/KOKKOS/pair_exp6_rx_kokkos.h index 920caef4ca..3d35e1f2fc 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.h +++ b/src/KOKKOS/pair_exp6_rx_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.h b/src/KOKKOS/pair_gran_hooke_history_kokkos.h index 351913d2ef..def0891592 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.h +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_hybrid_kokkos.h b/src/KOKKOS/pair_hybrid_kokkos.h index baf141d4ca..3e31136521 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.h +++ b/src/KOKKOS/pair_hybrid_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_hybrid_overlay_kokkos.h b/src/KOKKOS/pair_hybrid_overlay_kokkos.h index 423bd48ea1..30674bd8bb 100644 --- a/src/KOKKOS/pair_hybrid_overlay_kokkos.h +++ b/src/KOKKOS/pair_hybrid_overlay_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 08c33ca04c..d8c9aa97d6 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h index 7122584b29..910cdecc8c 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h index f13a641b1b..4114ab3ac8 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h index 089fcb9ebb..987104072b 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h index 756fb5d896..c75d0d6f8a 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h index 3a7b9f6066..e92a94a54a 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_class2_kokkos.h b/src/KOKKOS/pair_lj_class2_kokkos.h index cc7304a8ee..275a48cfc9 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h index b6e16bb1a8..9b7d8ae01a 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h index 0f903d0474..27190b3f5d 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h index 71e8ed60df..d1f64dd060 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h index 1cd6904770..6638680687 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_kokkos.h index 2ddeb48289..25c88588e7 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_expand_kokkos.h b/src/KOKKOS/pair_lj_expand_kokkos.h index fa3ec3908b..c44744357c 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.h +++ b/src/KOKKOS/pair_lj_expand_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h index 0c3cd86acf..512631b0dd 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_kokkos.h index a89362533f..c1506c1e00 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.h b/src/KOKKOS/pair_lj_sdk_kokkos.h index 51c60cb796..031991c94c 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.h +++ b/src/KOKKOS/pair_lj_sdk_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_morse_kokkos.h b/src/KOKKOS/pair_morse_kokkos.h index b4e2a8d7a7..617c207103 100644 --- a/src/KOKKOS/pair_morse_kokkos.h +++ b/src/KOKKOS/pair_morse_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h index 1db4d61c52..c811e8aea6 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.h +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_reaxc_kokkos.h b/src/KOKKOS/pair_reaxc_kokkos.h index b7e99d914b..585e2ffb4e 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.h +++ b/src/KOKKOS/pair_reaxc_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index 000b9fb38b..94b692a031 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index 379140288f..278bf52821 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_sw_kokkos.h b/src/KOKKOS/pair_sw_kokkos.h index fbe676a35a..be4b798d19 100644 --- a/src/KOKKOS/pair_sw_kokkos.h +++ b/src/KOKKOS/pair_sw_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_table_kokkos.h b/src/KOKKOS/pair_table_kokkos.h index d1cc7705b9..d5c23bb2c4 100644 --- a/src/KOKKOS/pair_table_kokkos.h +++ b/src/KOKKOS/pair_table_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_table_rx_kokkos.h b/src/KOKKOS/pair_table_rx_kokkos.h index c1d79ab96a..c80d145a22 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.h +++ b/src/KOKKOS/pair_table_rx_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_tersoff_kokkos.h b/src/KOKKOS/pair_tersoff_kokkos.h index 88cf8fcd04..f2e9d4ba8e 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.h +++ b/src/KOKKOS/pair_tersoff_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.h b/src/KOKKOS/pair_tersoff_mod_kokkos.h index f3a8d1c655..cb866a6655 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.h +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.h b/src/KOKKOS/pair_tersoff_zbl_kokkos.h index 5b19e5f325..6785ba4b44 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.h +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator diff --git a/src/KOKKOS/pair_vashishta_kokkos.h b/src/KOKKOS/pair_vashishta_kokkos.h index 79ec7e5454..7da26a1637 100644 --- a/src/KOKKOS/pair_vashishta_kokkos.h +++ b/src/KOKKOS/pair_vashishta_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_yukawa_kokkos.h b/src/KOKKOS/pair_yukawa_kokkos.h index 52de7fa1d8..6dbf7eedb0 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.h +++ b/src/KOKKOS/pair_yukawa_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pair_zbl_kokkos.h b/src/KOKKOS/pair_zbl_kokkos.h index fa33e7db2a..f8dcdebd28 100644 --- a/src/KOKKOS/pair_zbl_kokkos.h +++ b/src/KOKKOS/pair_zbl_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/pppm_kokkos.h b/src/KOKKOS/pppm_kokkos.h index aa4f46235a..4590a298f3 100644 --- a/src/KOKKOS/pppm_kokkos.h +++ b/src/KOKKOS/pppm_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.h b/src/KOKKOS/rand_pool_wrap_kokkos.h index fd7f773ca6..65c93034c4 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.h +++ b/src/KOKKOS/rand_pool_wrap_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/region_block_kokkos.h b/src/KOKKOS/region_block_kokkos.h index 1e5f6d063c..f326ae6770 100644 --- a/src/KOKKOS/region_block_kokkos.h +++ b/src/KOKKOS/region_block_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/remap_kokkos.h b/src/KOKKOS/remap_kokkos.h index c77301503f..336a3a9419 100644 --- a/src/KOKKOS/remap_kokkos.h +++ b/src/KOKKOS/remap_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/sna_kokkos.h b/src/KOKKOS/sna_kokkos.h index 72baa32c7c..2d1b8148c2 100644 --- a/src/KOKKOS/sna_kokkos.h +++ b/src/KOKKOS/sna_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/sna_kokkos_impl.h b/src/KOKKOS/sna_kokkos_impl.h index db710780ba..8f28c2ada6 100644 --- a/src/KOKKOS/sna_kokkos_impl.h +++ b/src/KOKKOS/sna_kokkos_impl.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KOKKOS/verlet_kokkos.h b/src/KOKKOS/verlet_kokkos.h index e10d65f7d2..4f87e39e9b 100644 --- a/src/KOKKOS/verlet_kokkos.h +++ b/src/KOKKOS/verlet_kokkos.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/KSPACE/ewald.h b/src/KSPACE/ewald.h index 86212eb084..843261760e 100644 --- a/src/KSPACE/ewald.h +++ b/src/KSPACE/ewald.h @@ -37,25 +37,25 @@ class Ewald : public KSpace { void compute_group_group(int, int, int); protected: - int kxmax,kymax,kzmax; - int kcount,kmax,kmax3d,kmax_created; - double gsqmx,volume; + int kxmax, kymax, kzmax; + int kcount, kmax, kmax3d, kmax_created; + double gsqmx, volume; int nmax; double unitk[3]; - int *kxvecs,*kyvecs,*kzvecs; - int kxmax_orig,kymax_orig,kzmax_orig; + int *kxvecs, *kyvecs, *kzvecs; + int kxmax_orig, kymax_orig, kzmax_orig; double *ug; - double **eg,**vg; + double **eg, **vg; double **ek; - double *sfacrl,*sfacim,*sfacrl_all,*sfacim_all; - double ***cs,***sn; + double *sfacrl, *sfacim, *sfacrl_all, *sfacim_all; + double ***cs, ***sn; // group-group interactions int group_allocate_flag; - double *sfacrl_A,*sfacim_A,*sfacrl_A_all,*sfacim_A_all; - double *sfacrl_B,*sfacim_B,*sfacrl_B_all,*sfacim_B_all; + double *sfacrl_A, *sfacim_A, *sfacrl_A_all, *sfacim_A_all; + double *sfacrl_B, *sfacim_B, *sfacrl_B_all, *sfacim_B_all; double rms(int, double, bigint, double); virtual void eik_dot_r(); @@ -72,12 +72,12 @@ class Ewald : public KSpace { // group-group interactions - void slabcorr_groups(int,int,int); + void slabcorr_groups(int, int, int); void allocate_groups(); void deallocate_groups(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/ewald_dipole.h b/src/KSPACE/ewald_dipole.h index 14b9870de1..a86b0fea91 100644 --- a/src/KSPACE/ewald_dipole.h +++ b/src/KSPACE/ewald_dipole.h @@ -33,9 +33,9 @@ class EwaldDipole : public Ewald { virtual void compute(int, int); protected: - double musum,musqsum,mu2; - double **tk; // field for torque - double **vc; // virial per k + double musum, musqsum, mu2; + double **tk; // field for torque + double **vc; // virial per k void musum_musq(); double rms_dipole(int, double, bigint); @@ -44,10 +44,9 @@ class EwaldDipole : public Ewald { double NewtonSolve(double, double, bigint, double, double); double f(double, double, bigint, double, double); double derivf(double, double, bigint, double, double); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/ewald_dipole_spin.h b/src/KSPACE/ewald_dipole_spin.h index 34e673f11e..795275780a 100644 --- a/src/KSPACE/ewald_dipole_spin.h +++ b/src/KSPACE/ewald_dipole_spin.h @@ -33,19 +33,18 @@ class EwaldDipoleSpin : public EwaldDipole { void compute(int, int); protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force void spsum_musq(); virtual void eik_dot_r(); void slabcorr(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/ewald_disp.h b/src/KSPACE/ewald_disp.h index f932a98af1..28bd05becc 100644 --- a/src/KSPACE/ewald_disp.h +++ b/src/KSPACE/ewald_disp.h @@ -24,10 +24,13 @@ KSpaceStyle(ewald/disp,EwaldDisp); namespace LAMMPS_NS { -#define EWALD_NORDER 6 -#define EWALD_NFUNCS 4 -#define EWALD_MAX_NSUMS 10 -#define EWALD_NSUMS {1, 1, 7, 1} +#define EWALD_NORDER 6 +#define EWALD_NFUNCS 4 +#define EWALD_MAX_NSUMS 10 +#define EWALD_NSUMS \ + { \ + 1, 1, 7, 1 \ + } class EwaldDisp : public KSpace { public: @@ -37,18 +40,17 @@ class EwaldDisp : public KSpace { void setup(); void settings(int, char **); void compute(int, int); - double memory_usage() {return bytes;} + double memory_usage() { return bytes; } private: double unit[6]; int function[EWALD_NFUNCS], first_output; - int nkvec, nkvec_max, nevec, nevec_max, - nbox, nfunctions, nsums, sums; + int nkvec, nkvec_max, nevec, nevec_max, nbox, nfunctions, nsums, sums; int peratom_allocate_flag; int nmax; double bytes; - double gsqmx,q2,b2,M2; + double gsqmx, q2, b2, M2; double *kenergy, energy_self[EWALD_NFUNCS]; double *kvirial, virial_self[EWALD_NFUNCS]; double **energy_self_peratom; @@ -58,7 +60,9 @@ class EwaldDisp : public KSpace { struct kvector *kvec; double mumurd2e, dielectric, *B, volume; - struct Sum { double x, x2; } sum[EWALD_MAX_NSUMS]; + struct Sum { + double x, x2; + } sum[EWALD_MAX_NSUMS]; struct complex *cek_local, *cek_global; double rms(int, double, bigint, double, double, double); @@ -86,7 +90,7 @@ class EwaldDisp : public KSpace { double derivf(double, double, bigint, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/fft3d.h b/src/KSPACE/fft3d.h index 478cbb05e5..87e9d2fb52 100644 --- a/src/KSPACE/fft3d.h +++ b/src/KSPACE/fft3d.h @@ -46,7 +46,7 @@ typedef float _Complex FFT_DATA; #elif defined(FFT_FFTW3) #include "fftw3.h" typedef fftwf_complex FFT_DATA; -#define FFTW_API(function) fftwf_ ## function +#define FFTW_API(function) fftwf_##function #else @@ -57,12 +57,12 @@ typedef fftwf_complex FFT_DATA; #endif #define kiss_fft_scalar float typedef struct { - kiss_fft_scalar re; - kiss_fft_scalar im; + kiss_fft_scalar re; + kiss_fft_scalar im; } FFT_DATA; struct kiss_fft_state; -typedef struct kiss_fft_state* kiss_fft_cfg; +typedef struct kiss_fft_state *kiss_fft_cfg; #endif // ------------------------------------------------------------------------- @@ -79,7 +79,7 @@ typedef double _Complex FFT_DATA; #elif defined(FFT_FFTW3) #include "fftw3.h" typedef fftw_complex FFT_DATA; -#define FFTW_API(function) fftw_ ## function +#define FFTW_API(function) fftw_##function #else @@ -89,12 +89,12 @@ typedef fftw_complex FFT_DATA; #endif #define kiss_fft_scalar double typedef struct { - kiss_fft_scalar re; - kiss_fft_scalar im; + kiss_fft_scalar re; + kiss_fft_scalar im; } FFT_DATA; struct kiss_fft_state; -typedef struct kiss_fft_state* kiss_fft_cfg; +typedef struct kiss_fft_state *kiss_fft_cfg; #endif #else @@ -106,21 +106,21 @@ typedef struct kiss_fft_state* kiss_fft_cfg; // details of how to do a 3d FFT struct fft_plan_3d { - struct remap_plan_3d *pre_plan; // remap from input -> 1st FFTs - struct remap_plan_3d *mid1_plan; // remap from 1st -> 2nd FFTs - struct remap_plan_3d *mid2_plan; // remap from 2nd -> 3rd FFTs - struct remap_plan_3d *post_plan; // remap from 3rd FFTs -> output - FFT_DATA *copy; // memory for remap results (if needed) - FFT_DATA *scratch; // scratch space for remaps - int total1,total2,total3; // # of 1st,2nd,3rd FFTs (times length) - int length1,length2,length3; // length of 1st,2nd,3rd FFTs - int pre_target; // where to put remap results - int mid1_target,mid2_target; - int scaled; // whether to scale FFT results - int normnum; // # of values to rescale - double norm; // normalization factor for rescaling + struct remap_plan_3d *pre_plan; // remap from input -> 1st FFTs + struct remap_plan_3d *mid1_plan; // remap from 1st -> 2nd FFTs + struct remap_plan_3d *mid2_plan; // remap from 2nd -> 3rd FFTs + struct remap_plan_3d *post_plan; // remap from 3rd FFTs -> output + FFT_DATA *copy; // memory for remap results (if needed) + FFT_DATA *scratch; // scratch space for remaps + int total1, total2, total3; // # of 1st,2nd,3rd FFTs (times length) + int length1, length2, length3; // length of 1st,2nd,3rd FFTs + int pre_target; // where to put remap results + int mid1_target, mid2_target; + int scaled; // whether to scale FFT results + int normnum; // # of values to rescale + double norm; // normalization factor for rescaling - // system specific 1d FFT info + // system specific 1d FFT info #if defined(FFT_MKL) DFTI_DESCRIPTOR *handle_fast; DFTI_DESCRIPTOR *handle_mid; @@ -145,15 +145,13 @@ struct fft_plan_3d { // function prototypes extern "C" { - void fft_3d(FFT_DATA *, FFT_DATA *, int, struct fft_plan_3d *); - struct fft_plan_3d *fft_3d_create_plan(MPI_Comm, int, int, int, - int, int, int, int, int, - int, int, int, int, int, int, int, - int, int, int *, int); - void fft_3d_destroy_plan(struct fft_plan_3d *); - void factor(int, int *, int *); - void bifactor(int, int *, int *); - void fft_1d_only(FFT_DATA *, int, int, struct fft_plan_3d *); +void fft_3d(FFT_DATA *, FFT_DATA *, int, struct fft_plan_3d *); +struct fft_plan_3d *fft_3d_create_plan(MPI_Comm, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int *, int); +void fft_3d_destroy_plan(struct fft_plan_3d *); +void factor(int, int *, int *); +void bifactor(int, int *, int *); +void fft_1d_only(FFT_DATA *, int, int, struct fft_plan_3d *); } /* ERROR/WARNING messages: diff --git a/src/KSPACE/fft3d_wrap.h b/src/KSPACE/fft3d_wrap.h index 6deb9baf03..97e9dce82f 100644 --- a/src/KSPACE/fft3d_wrap.h +++ b/src/KSPACE/fft3d_wrap.h @@ -14,17 +14,17 @@ #ifndef LMP_FFT3D_WRAP_H #define LMP_FFT3D_WRAP_H -#include "pointers.h" #include "fft3d.h" +#include "pointers.h" namespace LAMMPS_NS { class FFT3d : protected Pointers { public: - enum{FORWARD=1,BACKWARD=-1}; + enum { FORWARD = 1, BACKWARD = -1 }; - FFT3d(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,int,int,int, - int,int,int,int,int,int,int,int,int *,int); + FFT3d(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int *, int); ~FFT3d(); void compute(FFT_SCALAR *, FFT_SCALAR *, int); void timing1d(FFT_SCALAR *, int, int); @@ -33,7 +33,7 @@ class FFT3d : protected Pointers { struct fft_plan_3d *plan; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KSPACE/fix_tune_kspace.h b/src/KSPACE/fix_tune_kspace.h index b5e8fe8237..cbf9cef846 100644 --- a/src/KSPACE/fix_tune_kspace.h +++ b/src/KSPACE/fix_tune_kspace.h @@ -22,7 +22,6 @@ FixStyle(tune/kspace,FixTuneKspace); #include "fix.h" - namespace LAMMPS_NS { class FixTuneKspace : public Fix { @@ -45,12 +44,12 @@ class FixTuneKspace : public Fix { private: int nevery; - int last_step; // previous timestep when timing info was collected - double last_spcpu; // old elapsed CPU time value - int firststep; // 0 if this is the first time timing info is collected - int niter; // number of kspace switches + int last_step; // previous timestep when timing info was collected + double last_spcpu; // old elapsed CPU time value + int firststep; // 0 if this is the first time timing info is collected + int niter; // number of kspace switches - double ewald_time,pppm_time,msm_time; + double ewald_time, pppm_time, msm_time; double pair_cut_coul; std::string acc_str; std::string kspace_style; @@ -62,25 +61,25 @@ class FixTuneKspace : public Fix { double old_slab_volfactor; int niter_adjust_rcut; - double ax_brent,bx_brent,cx_brent,dx_brent; - double fa_brent,fb_brent,fc_brent,fd_brent; - double v_brent,w_brent,x_brent; - double fv_brent,fw_brent,fx_brent; - double a_brent,b_brent; + double ax_brent, bx_brent, cx_brent, dx_brent; + double fa_brent, fb_brent, fc_brent, fd_brent; + double v_brent, w_brent, x_brent; + double fv_brent, fw_brent, fx_brent; + double a_brent, b_brent; double fd2_brent; double dxlim; - bool keep_bracketing,first_brent_pass; - bool converged,need_fd2_brent; + bool keep_bracketing, first_brent_pass; + bool converged, need_fd2_brent; inline void shft3(double &a, double &b, double &c, const double d) { - a=b; - b=c; - c=d; + a = b; + b = c; + c = d; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/gridcomm.h b/src/KSPACE/gridcomm.h index 4cadfdbf29..0d086273f1 100644 --- a/src/KSPACE/gridcomm.h +++ b/src/KSPACE/gridcomm.h @@ -20,51 +20,46 @@ namespace LAMMPS_NS { class GridComm : protected Pointers { public: - GridComm(class LAMMPS *, MPI_Comm, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); - GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); + GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int); + GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int, int, int); virtual ~GridComm(); void setup(int &, int &); int ghost_adjacent(); - void forward_comm_kspace(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void reverse_comm_kspace(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); + void forward_comm_kspace(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void reverse_comm_kspace(class KSpace *, int, int, int, void *, void *, MPI_Datatype); protected: - int me,nprocs; - int layout; // REGULAR or TILED - MPI_Comm gridcomm; // communicator for this class - // usually world, but MSM calls with subset + int me, nprocs; + int layout; // REGULAR or TILED + MPI_Comm gridcomm; // communicator for this class + // usually world, but MSM calls with subset // inputs from caller via constructor - int nx,ny,nz; // size of global grid in all 3 dims - int inxlo,inxhi; // inclusive extent of my grid chunk - int inylo,inyhi; // 0 <= in <= N-1 - int inzlo,inzhi; - int outxlo,outxhi; // inclusive extent of my grid chunk plus - int outylo,outyhi; // ghost cells in all 6 directions - int outzlo,outzhi; // lo indices can be < 0, hi indices can be >= N - int fullxlo,fullxhi; // extent of grid chunk that caller stores - int fullylo,fullyhi; // can be same as out indices or larger - int fullzlo,fullzhi; + int nx, ny, nz; // size of global grid in all 3 dims + int inxlo, inxhi; // inclusive extent of my grid chunk + int inylo, inyhi; // 0 <= in <= N-1 + int inzlo, inzhi; + int outxlo, outxhi; // inclusive extent of my grid chunk plus + int outylo, outyhi; // ghost cells in all 6 directions + int outzlo, outzhi; // lo indices can be < 0, hi indices can be >= N + int fullxlo, fullxhi; // extent of grid chunk that caller stores + int fullylo, fullyhi; // can be same as out indices or larger + int fullzlo, fullzhi; // ------------------------------------------- // internal variables for REGULAR layout // ------------------------------------------- - int procxlo,procxhi; // 6 neighbor procs that adjoin me - int procylo,procyhi; // not used for comm_style = tiled - int proczlo,proczhi; + int procxlo, procxhi; // 6 neighbor procs that adjoin me + int procylo, procyhi; // not used for comm_style = tiled + int proczlo, proczhi; - int ghostxlo,ghostxhi; // # of my owned grid planes needed - int ghostylo,ghostyhi; // by neighobr procs in each dir as their ghost planes - int ghostzlo,ghostzhi; + int ghostxlo, ghostxhi; // # of my owned grid planes needed + int ghostylo, ghostyhi; // by neighobr procs in each dir as their ghost planes + int ghostzlo, ghostzhi; // swap = exchange of owned and ghost grid cells between 2 procs, including self @@ -77,22 +72,22 @@ class GridComm : protected Pointers { int *unpacklist; // 3d array offsets to unpack }; - int nswap,maxswap; + int nswap, maxswap; Swap *swap; // ------------------------------------------- // internal variables for TILED layout // ------------------------------------------- - int *overlap_procs; // length of Nprocs in communicator - MPI_Request *requests; // length of max messages this proc receives + int *overlap_procs; // length of Nprocs in communicator + MPI_Request *requests; // length of max messages this proc receives // RCB tree of cut info // each proc contributes one value, except proc 0 struct RCBinfo { - int dim; // 0,1,2 = which dim the cut is in - int cut; // grid index of lowest cell in upper half of cut + int dim; // 0,1,2 = which dim the cut is in + int cut; // grid index of lowest cell in upper half of cut }; RCBinfo *rcbinfo; @@ -101,37 +96,37 @@ class GridComm : protected Pointers { // includes overlaps across periodic boundaries, can also be self struct Overlap { - int proc; // proc whose owned cells overlap my ghost cells - int box[6]; // box that overlaps otherproc's owned cells - // this box is wholly contained within global grid - int pbc[3]; // PBC offsets to convert box to a portion of my ghost box - // my ghost box may extend beyond global grid + int proc; // proc whose owned cells overlap my ghost cells + int box[6]; // box that overlaps otherproc's owned cells + // this box is wholly contained within global grid + int pbc[3]; // PBC offsets to convert box to a portion of my ghost box + // my ghost box may extend beyond global grid }; - int noverlap,maxoverlap; + int noverlap, maxoverlap; Overlap *overlap; // request = sent to each proc whose owned cells overlap my ghost cells struct Request { - int sender; // sending proc - int index; // index of overlap on sender - int box[6]; // box that overlaps receiver's owned cells - // wholly contained within global grid + int sender; // sending proc + int index; // index of overlap on sender + int box[6]; // box that overlaps receiver's owned cells + // wholly contained within global grid }; - Request *srequest,*rrequest; + Request *srequest, *rrequest; // response = reply from each proc whose owned cells overlap my ghost cells struct Response { - int index; // index of my overlap for the initial request - int box[6]; // box that overlaps responder's owned cells - // wholly contained within global grid - // has to unwrapped by PBC to map to my ghost cells + int index; // index of my overlap for the initial request + int box[6]; // box that overlaps responder's owned cells + // wholly contained within global grid + // has to unwrapped by PBC to map to my ghost cells }; - Response *sresponse,*rresponse; + Response *sresponse, *rresponse; // send = proc to send a subset of my owned cells to, for forward comm // for reverse comm, proc I receive ghost overlaps with my owned cells from @@ -155,7 +150,7 @@ class GridComm : protected Pointers { int offset; }; - int adjacent; // 0 on a proc who receives ghosts from a non-neighbor proc + int adjacent; // 0 on a proc who receives ghosts from a non-neighbor proc // copy = subset of my owned cells to copy into subset of my ghost cells // that describes forward comm, for reverse comm it is the opposite @@ -167,7 +162,7 @@ class GridComm : protected Pointers { int *unpacklist; }; - int nsend,nrecv,ncopy; + int nsend, nrecv, ncopy; Send *send; Recv *recv; Copy *copy; @@ -176,11 +171,8 @@ class GridComm : protected Pointers { // internal methods // ------------------------------------------- - void initialize(MPI_Comm, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); + void initialize(MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int, int, int, int, int, int); virtual void setup_regular(int &, int &); virtual void setup_tiled(int &, int &); void ghost_box_drop(int *, int *); @@ -189,14 +181,10 @@ class GridComm : protected Pointers { int ghost_adjacent_regular(); int ghost_adjacent_tiled(); - void forward_comm_kspace_regular(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void forward_comm_kspace_tiled(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void reverse_comm_kspace_regular(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); - void reverse_comm_kspace_tiled(class KSpace *, int, int, int, - void *, void *, MPI_Datatype); + void forward_comm_kspace_regular(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void forward_comm_kspace_tiled(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void reverse_comm_kspace_regular(class KSpace *, int, int, int, void *, void *, MPI_Datatype); + void reverse_comm_kspace_tiled(class KSpace *, int, int, int, void *, void *, MPI_Datatype); virtual void grow_swap(); void grow_overlap(); @@ -204,6 +192,6 @@ class GridComm : protected Pointers { int indices(int *&, int, int, int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/KSPACE/kissfft.h b/src/KSPACE/kissfft.h index 8cb6dec820..d519214ef4 100644 --- a/src/KSPACE/kissfft.h +++ b/src/KSPACE/kissfft.h @@ -17,9 +17,9 @@ #ifndef LMP_FFT_KISSFFT #define LMP_FFT_KISSFFT +#include #include #include -#include #if defined(_OPENMP) #include @@ -69,10 +69,10 @@ /* e.g. an fft of length 128 has 4 factors as far as kissfft is concerned: 4*4*4*2 */ struct kiss_fft_state { - int nfft; - int inverse; - int factors[2*MAXFACTORS]; - FFT_DATA twiddles[1]; + int nfft; + int inverse; + int factors[2 * MAXFACTORS]; + FFT_DATA twiddles[1]; }; #ifdef KISS_FFT_USE_ALLOCA @@ -81,15 +81,15 @@ struct kiss_fft_state { // 1. FFT sizes that have "bad" factors. i.e. not 2,3 and 5 // 2. "in-place" FFTs. Notice the quotes, since kissfft does not really do an in-place transform. #include -#define KISS_FFT_TMP_ALLOC(nbytes) alloca(nbytes) -#define KISS_FFT_TMP_FREE(ptr) +#define KISS_FFT_TMP_ALLOC(nbytes) alloca(nbytes) +#define KISS_FFT_TMP_FREE(ptr) #else -#define KISS_FFT_TMP_ALLOC(nbytes) KISS_FFT_MALLOC(nbytes) -#define KISS_FFT_TMP_FREE(ptr) KISS_FFT_FREE(ptr) +#define KISS_FFT_TMP_ALLOC(nbytes) KISS_FFT_MALLOC(nbytes) +#define KISS_FFT_TMP_FREE(ptr) KISS_FFT_FREE(ptr) #endif -static kiss_fft_cfg kiss_fft_alloc(int,int,void *,size_t *); -static void kiss_fft(kiss_fft_cfg,const FFT_DATA *,FFT_DATA *); +static kiss_fft_cfg kiss_fft_alloc(int, int, void *, size_t *); +static void kiss_fft(kiss_fft_cfg, const FFT_DATA *, FFT_DATA *); /* Explanation of macros dealing with complex math: @@ -101,285 +101,311 @@ static void kiss_fft(kiss_fft_cfg,const FFT_DATA *,FFT_DATA *); C_ADDTO( res , a) : res += a * */ -#define S_MUL(a,b) ( (a)*(b) ) -#define C_MUL(m,a,b) \ - do{ (m).re = (a).re*(b).re - (a).im*(b).im;\ - (m).im = (a).re*(b).im + (a).im*(b).re; }while(0) -#define C_FIXDIV(c,div) /* NOOP */ -#define C_MULBYSCALAR( c, s ) \ - do{ (c).re *= (s);\ - (c).im *= (s); }while(0) +#define S_MUL(a, b) ((a) * (b)) +#define C_MUL(m, a, b) \ + do { \ + (m).re = (a).re * (b).re - (a).im * (b).im; \ + (m).im = (a).re * (b).im + (a).im * (b).re; \ + } while (0) +#define C_FIXDIV(c, div) /* NOOP */ +#define C_MULBYSCALAR(c, s) \ + do { \ + (c).re *= (s); \ + (c).im *= (s); \ + } while (0) #ifndef CHECK_OVERFLOW_OP -# define CHECK_OVERFLOW_OP(a,op,b) /* noop */ +#define CHECK_OVERFLOW_OP(a, op, b) /* noop */ #endif -#define C_ADD( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).re,+,(b).re)\ - CHECK_OVERFLOW_OP((a).im,+,(b).im)\ - (res).re=(a).re+(b).re; (res).im=(a).im+(b).im; \ - }while(0) -#define C_SUB( res, a,b)\ - do { \ - CHECK_OVERFLOW_OP((a).re,-,(b).re)\ - CHECK_OVERFLOW_OP((a).im,-,(b).im)\ - (res).re=(a).re-(b).re; (res).im=(a).im-(b).im; \ - }while(0) -#define C_ADDTO( res , a)\ - do { \ - CHECK_OVERFLOW_OP((res).re,+,(a).re)\ - CHECK_OVERFLOW_OP((res).im,+,(a).im)\ - (res).re += (a).re; (res).im += (a).im;\ - }while(0) - -#define C_SUBFROM( res , a)\ - do {\ - CHECK_OVERFLOW_OP((res).re,-,(a).re)\ - CHECK_OVERFLOW_OP((res).im,-,(a).im)\ - (res).re -= (a).re; (res).im -= (a).im; \ - }while(0) +#define C_ADD(res, a, b) \ + do { \ + CHECK_OVERFLOW_OP((a).re, +, (b).re) \ + CHECK_OVERFLOW_OP((a).im, +, (b).im) \ + (res).re = (a).re + (b).re; \ + (res).im = (a).im + (b).im; \ + } while (0) +#define C_SUB(res, a, b) \ + do { \ + CHECK_OVERFLOW_OP((a).re, -, (b).re) \ + CHECK_OVERFLOW_OP((a).im, -, (b).im) \ + (res).re = (a).re - (b).re; \ + (res).im = (a).im - (b).im; \ + } while (0) +#define C_ADDTO(res, a) \ + do { \ + CHECK_OVERFLOW_OP((res).re, +, (a).re) \ + CHECK_OVERFLOW_OP((res).im, +, (a).im) \ + (res).re += (a).re; \ + (res).im += (a).im; \ + } while (0) +#define C_SUBFROM(res, a) \ + do { \ + CHECK_OVERFLOW_OP((res).re, -, (a).re) \ + CHECK_OVERFLOW_OP((res).im, -, (a).im) \ + (res).re -= (a).re; \ + (res).im -= (a).im; \ + } while (0) #define KISS_FFT_COS(phase) (kiss_fft_scalar) cos(phase) #define KISS_FFT_SIN(phase) (kiss_fft_scalar) sin(phase) -#define HALF_OF(x) ((x)*.5) +#define HALF_OF(x) ((x) *.5) -#define kf_cexp(x,phase) \ - do{ \ - (x)->re = KISS_FFT_COS(phase);\ - (x)->im = KISS_FFT_SIN(phase);\ - }while(0) +#define kf_cexp(x, phase) \ + do { \ + (x)->re = KISS_FFT_COS(phase); \ + (x)->im = KISS_FFT_SIN(phase); \ + } while (0) -static void kf_bfly2(FFT_DATA *Fout, const size_t fstride, - const kiss_fft_cfg st, int m) +static void kf_bfly2(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, int m) { - FFT_DATA *Fout2; - FFT_DATA *tw1 = st->twiddles; - FFT_DATA t; + FFT_DATA *Fout2; + FFT_DATA *tw1 = st->twiddles; + FFT_DATA t; - Fout2 = Fout + m; - do { - C_FIXDIV(*Fout,2); C_FIXDIV(*Fout2,2); + Fout2 = Fout + m; + do { + C_FIXDIV(*Fout, 2); + C_FIXDIV(*Fout2, 2); - C_MUL (t, *Fout2 , *tw1); - tw1 += fstride; - C_SUB( *Fout2 , *Fout , t ); - C_ADDTO( *Fout , t ); - ++Fout2; - ++Fout; - } while(--m); + C_MUL(t, *Fout2, *tw1); + tw1 += fstride; + C_SUB(*Fout2, *Fout, t); + C_ADDTO(*Fout, t); + ++Fout2; + ++Fout; + } while (--m); } -static void kf_bfly4(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, const size_t m) +static void kf_bfly4(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, const size_t m) { - FFT_DATA *tw1, *tw2, *tw3; - FFT_DATA scratch[6]; - size_t k=m; - const size_t m2=2*m; - const size_t m3=3*m; + FFT_DATA *tw1, *tw2, *tw3; + FFT_DATA scratch[6]; + size_t k = m; + const size_t m2 = 2 * m; + const size_t m3 = 3 * m; - tw3 = tw2 = tw1 = st->twiddles; + tw3 = tw2 = tw1 = st->twiddles; - do { - C_FIXDIV(*Fout,4); C_FIXDIV(Fout[m],4); C_FIXDIV(Fout[m2],4); C_FIXDIV(Fout[m3],4); + do { + C_FIXDIV(*Fout, 4); + C_FIXDIV(Fout[m], 4); + C_FIXDIV(Fout[m2], 4); + C_FIXDIV(Fout[m3], 4); - C_MUL(scratch[0],Fout[m] , *tw1 ); - C_MUL(scratch[1],Fout[m2] , *tw2 ); - C_MUL(scratch[2],Fout[m3] , *tw3 ); + C_MUL(scratch[0], Fout[m], *tw1); + C_MUL(scratch[1], Fout[m2], *tw2); + C_MUL(scratch[2], Fout[m3], *tw3); - C_SUB( scratch[5] , *Fout, scratch[1] ); - C_ADDTO(*Fout, scratch[1]); - C_ADD( scratch[3] , scratch[0] , scratch[2] ); - C_SUB( scratch[4] , scratch[0] , scratch[2] ); - C_SUB( Fout[m2], *Fout, scratch[3] ); - tw1 += fstride; - tw2 += fstride*2; - tw3 += fstride*3; - C_ADDTO( *Fout , scratch[3] ); + C_SUB(scratch[5], *Fout, scratch[1]); + C_ADDTO(*Fout, scratch[1]); + C_ADD(scratch[3], scratch[0], scratch[2]); + C_SUB(scratch[4], scratch[0], scratch[2]); + C_SUB(Fout[m2], *Fout, scratch[3]); + tw1 += fstride; + tw2 += fstride * 2; + tw3 += fstride * 3; + C_ADDTO(*Fout, scratch[3]); - if (st->inverse) { - Fout[m].re = scratch[5].re - scratch[4].im; - Fout[m].im = scratch[5].im + scratch[4].re; - Fout[m3].re = scratch[5].re + scratch[4].im; - Fout[m3].im = scratch[5].im - scratch[4].re; - } else{ - Fout[m].re = scratch[5].re + scratch[4].im; - Fout[m].im = scratch[5].im - scratch[4].re; - Fout[m3].re = scratch[5].re - scratch[4].im; - Fout[m3].im = scratch[5].im + scratch[4].re; - } - ++Fout; - } while(--k); -} - -static void kf_bfly3(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, size_t m) -{ - size_t k=m; - const size_t m2 = 2*m; - FFT_DATA *tw1, *tw2; - FFT_DATA scratch[5]; - FFT_DATA epi3; - epi3 = st->twiddles[fstride*m]; - - tw1=tw2=st->twiddles; - - do { - C_FIXDIV(*Fout,3); C_FIXDIV(Fout[m],3); C_FIXDIV(Fout[m2],3); - - C_MUL(scratch[1],Fout[m] , *tw1); - C_MUL(scratch[2],Fout[m2] , *tw2); - - C_ADD(scratch[3],scratch[1],scratch[2]); - C_SUB(scratch[0],scratch[1],scratch[2]); - tw1 += fstride; - tw2 += fstride*2; - - Fout[m].re = Fout->re - HALF_OF(scratch[3].re); - Fout[m].im = Fout->im - HALF_OF(scratch[3].im); - - C_MULBYSCALAR( scratch[0] , epi3.im ); - - C_ADDTO(*Fout,scratch[3]); - - Fout[m2].re = Fout[m].re + scratch[0].im; - Fout[m2].im = Fout[m].im - scratch[0].re; - - Fout[m].re -= scratch[0].im; - Fout[m].im += scratch[0].re; - - ++Fout; - } while(--k); -} - -static void kf_bfly5(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, int m) -{ - FFT_DATA *Fout0, *Fout1, *Fout2, *Fout3, *Fout4; - int u; - FFT_DATA scratch[13]; - FFT_DATA * twiddles = st->twiddles; - FFT_DATA *tw; - FFT_DATA ya,yb; - ya = twiddles[fstride*m]; - yb = twiddles[fstride*2*m]; - - Fout0=Fout; - Fout1=Fout0+m; - Fout2=Fout0+2*m; - Fout3=Fout0+3*m; - Fout4=Fout0+4*m; - - tw=st->twiddles; - for ( u=0; ure += scratch[7].re + scratch[8].re; - Fout0->im += scratch[7].im + scratch[8].im; - - scratch[5].re = scratch[0].re + S_MUL(scratch[7].re,ya.re) + S_MUL(scratch[8].re,yb.re); - scratch[5].im = scratch[0].im + S_MUL(scratch[7].im,ya.re) + S_MUL(scratch[8].im,yb.re); - - scratch[6].re = S_MUL(scratch[10].im,ya.im) + S_MUL(scratch[9].im,yb.im); - scratch[6].im = -S_MUL(scratch[10].re,ya.im) - S_MUL(scratch[9].re,yb.im); - - C_SUB(*Fout1,scratch[5],scratch[6]); - C_ADD(*Fout4,scratch[5],scratch[6]); - - scratch[11].re = scratch[0].re + S_MUL(scratch[7].re,yb.re) + S_MUL(scratch[8].re,ya.re); - scratch[11].im = scratch[0].im + S_MUL(scratch[7].im,yb.re) + S_MUL(scratch[8].im,ya.re); - scratch[12].re = - S_MUL(scratch[10].im,yb.im) + S_MUL(scratch[9].im,ya.im); - scratch[12].im = S_MUL(scratch[10].re,yb.im) - S_MUL(scratch[9].re,ya.im); - - C_ADD(*Fout2,scratch[11],scratch[12]); - C_SUB(*Fout3,scratch[11],scratch[12]); - - ++Fout0;++Fout1;++Fout2;++Fout3;++Fout4; + if (st->inverse) { + Fout[m].re = scratch[5].re - scratch[4].im; + Fout[m].im = scratch[5].im + scratch[4].re; + Fout[m3].re = scratch[5].re + scratch[4].im; + Fout[m3].im = scratch[5].im - scratch[4].re; + } else { + Fout[m].re = scratch[5].re + scratch[4].im; + Fout[m].im = scratch[5].im - scratch[4].re; + Fout[m3].re = scratch[5].re - scratch[4].im; + Fout[m3].im = scratch[5].im + scratch[4].re; } + ++Fout; + } while (--k); +} + +static void kf_bfly3(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, size_t m) +{ + size_t k = m; + const size_t m2 = 2 * m; + FFT_DATA *tw1, *tw2; + FFT_DATA scratch[5]; + FFT_DATA epi3; + epi3 = st->twiddles[fstride * m]; + + tw1 = tw2 = st->twiddles; + + do { + C_FIXDIV(*Fout, 3); + C_FIXDIV(Fout[m], 3); + C_FIXDIV(Fout[m2], 3); + + C_MUL(scratch[1], Fout[m], *tw1); + C_MUL(scratch[2], Fout[m2], *tw2); + + C_ADD(scratch[3], scratch[1], scratch[2]); + C_SUB(scratch[0], scratch[1], scratch[2]); + tw1 += fstride; + tw2 += fstride * 2; + + Fout[m].re = Fout->re - HALF_OF(scratch[3].re); + Fout[m].im = Fout->im - HALF_OF(scratch[3].im); + + C_MULBYSCALAR(scratch[0], epi3.im); + + C_ADDTO(*Fout, scratch[3]); + + Fout[m2].re = Fout[m].re + scratch[0].im; + Fout[m2].im = Fout[m].im - scratch[0].re; + + Fout[m].re -= scratch[0].im; + Fout[m].im += scratch[0].re; + + ++Fout; + } while (--k); +} + +static void kf_bfly5(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, int m) +{ + FFT_DATA *Fout0, *Fout1, *Fout2, *Fout3, *Fout4; + int u; + FFT_DATA scratch[13]; + FFT_DATA *twiddles = st->twiddles; + FFT_DATA *tw; + FFT_DATA ya, yb; + ya = twiddles[fstride * m]; + yb = twiddles[fstride * 2 * m]; + + Fout0 = Fout; + Fout1 = Fout0 + m; + Fout2 = Fout0 + 2 * m; + Fout3 = Fout0 + 3 * m; + Fout4 = Fout0 + 4 * m; + + tw = st->twiddles; + for (u = 0; u < m; ++u) { + C_FIXDIV(*Fout0, 5); + C_FIXDIV(*Fout1, 5); + C_FIXDIV(*Fout2, 5); + C_FIXDIV(*Fout3, 5); + C_FIXDIV(*Fout4, 5); + scratch[0] = *Fout0; + + C_MUL(scratch[1], *Fout1, tw[u * fstride]); + C_MUL(scratch[2], *Fout2, tw[2 * u * fstride]); + C_MUL(scratch[3], *Fout3, tw[3 * u * fstride]); + C_MUL(scratch[4], *Fout4, tw[4 * u * fstride]); + + C_ADD(scratch[7], scratch[1], scratch[4]); + C_SUB(scratch[10], scratch[1], scratch[4]); + C_ADD(scratch[8], scratch[2], scratch[3]); + C_SUB(scratch[9], scratch[2], scratch[3]); + + Fout0->re += scratch[7].re + scratch[8].re; + Fout0->im += scratch[7].im + scratch[8].im; + + scratch[5].re = scratch[0].re + S_MUL(scratch[7].re, ya.re) + S_MUL(scratch[8].re, yb.re); + scratch[5].im = scratch[0].im + S_MUL(scratch[7].im, ya.re) + S_MUL(scratch[8].im, yb.re); + + scratch[6].re = S_MUL(scratch[10].im, ya.im) + S_MUL(scratch[9].im, yb.im); + scratch[6].im = -S_MUL(scratch[10].re, ya.im) - S_MUL(scratch[9].re, yb.im); + + C_SUB(*Fout1, scratch[5], scratch[6]); + C_ADD(*Fout4, scratch[5], scratch[6]); + + scratch[11].re = scratch[0].re + S_MUL(scratch[7].re, yb.re) + S_MUL(scratch[8].re, ya.re); + scratch[11].im = scratch[0].im + S_MUL(scratch[7].im, yb.re) + S_MUL(scratch[8].im, ya.re); + scratch[12].re = -S_MUL(scratch[10].im, yb.im) + S_MUL(scratch[9].im, ya.im); + scratch[12].im = S_MUL(scratch[10].re, yb.im) - S_MUL(scratch[9].re, ya.im); + + C_ADD(*Fout2, scratch[11], scratch[12]); + C_SUB(*Fout3, scratch[11], scratch[12]); + + ++Fout0; + ++Fout1; + ++Fout2; + ++Fout3; + ++Fout4; + } } /* perform the butterfly for one stage of a mixed radix FFT */ -static void kf_bfly_generic(FFT_DATA * Fout, const size_t fstride, - const kiss_fft_cfg st, int m, int p) +static void kf_bfly_generic(FFT_DATA *Fout, const size_t fstride, const kiss_fft_cfg st, int m, + int p) { - int u,k,q1,q; - FFT_DATA * twiddles = st->twiddles; - FFT_DATA t; - int Norig = st->nfft; + int u, k, q1, q; + FFT_DATA *twiddles = st->twiddles; + FFT_DATA t; + int Norig = st->nfft; - FFT_DATA * scratch = (FFT_DATA*)KISS_FFT_TMP_ALLOC(sizeof(FFT_DATA)*p); - for ( u=0; u=Norig) twidx-=Norig; - C_MUL(t,scratch[q] , twiddles[twidx] ); - C_ADDTO( Fout[ k ] ,t); - } - k += m; - } + FFT_DATA *scratch = (FFT_DATA *) KISS_FFT_TMP_ALLOC(sizeof(FFT_DATA) * p); + for (u = 0; u < m; ++u) { + k = u; + for (q1 = 0; q1 < p; ++q1) { + scratch[q1] = Fout[k]; + C_FIXDIV(scratch[q1], p); + k += m; } - KISS_FFT_TMP_FREE(scratch); + + k = u; + for (q1 = 0; q1 < p; ++q1) { + int twidx = 0; + Fout[k] = scratch[0]; + for (q = 1; q < p; ++q) { + twidx += fstride * k; + if (twidx >= Norig) twidx -= Norig; + C_MUL(t, scratch[q], twiddles[twidx]); + C_ADDTO(Fout[k], t); + } + k += m; + } + } + KISS_FFT_TMP_FREE(scratch); } -static void kf_work(FFT_DATA * Fout, const FFT_DATA *f, - const size_t fstride, int in_stride, - int * factors, const kiss_fft_cfg st) +static void kf_work(FFT_DATA *Fout, const FFT_DATA *f, const size_t fstride, int in_stride, + int *factors, const kiss_fft_cfg st) { - FFT_DATA * Fout_beg=Fout; - const int p=*factors++; /* the radix */ - const int m=*factors++; /* stage's fft length/p */ - const FFT_DATA * Fout_end = Fout + p*m; + FFT_DATA *Fout_beg = Fout; + const int p = *factors++; /* the radix */ + const int m = *factors++; /* stage's fft length/p */ + const FFT_DATA *Fout_end = Fout + p * m; - if (m==1) { - do { - *Fout = *f; - f += fstride*in_stride; - } while (++Fout != Fout_end); - } else { - do { - /* recursive call: + if (m == 1) { + do { + *Fout = *f; + f += fstride * in_stride; + } while (++Fout != Fout_end); + } else { + do { + /* recursive call: DFT of size m*p performed by doing p instances of smaller DFTs of size m, each one takes a decimated version of the input */ - kf_work( Fout , f, fstride*p, in_stride, factors,st); - f += fstride*in_stride; - } while( (Fout += m) != Fout_end); - } + kf_work(Fout, f, fstride * p, in_stride, factors, st); + f += fstride * in_stride; + } while ((Fout += m) != Fout_end); + } - Fout=Fout_beg; + Fout = Fout_beg; - /* recombine the p smaller DFTs */ - switch (p) { - case 2: kf_bfly2(Fout,fstride,st,m); break; - case 3: kf_bfly3(Fout,fstride,st,m); break; - case 4: kf_bfly4(Fout,fstride,st,m); break; - case 5: kf_bfly5(Fout,fstride,st,m); break; - default: kf_bfly_generic(Fout,fstride,st,m,p); break; - } + /* recombine the p smaller DFTs */ + switch (p) { + case 2: + kf_bfly2(Fout, fstride, st, m); + break; + case 3: + kf_bfly3(Fout, fstride, st, m); + break; + case 4: + kf_bfly4(Fout, fstride, st, m); + break; + case 5: + kf_bfly5(Fout, fstride, st, m); + break; + default: + kf_bfly_generic(Fout, fstride, st, m, p); + break; + } } /* facbuf is populated by p1,m1,p2,m2, ... @@ -388,28 +414,33 @@ static void kf_work(FFT_DATA * Fout, const FFT_DATA *f, m0 = n */ static void kf_factor(int n, int *facbuf) { - int p=4, nf=0; - double floor_sqrt; - floor_sqrt = floor( sqrt((double)n) ); + int p = 4, nf = 0; + double floor_sqrt; + floor_sqrt = floor(sqrt((double) n)); - /* factor out the remaining powers of 4, powers of 2, + /* factor out the remaining powers of 4, powers of 2, and then any other remaining primes */ - do { - if (nf == MAXFACTORS) p = n; /* make certain that we don't run out of space */ - while (n % p) { - switch (p) { - case 4: p = 2; break; - case 2: p = 3; break; - default: p += 2; break; - } - if (p > floor_sqrt) - p = n; /* no more factors, skip to end */ - } - n /= p; - *facbuf++ = p; - *facbuf++ = n; - ++nf; - } while (n > 1); + do { + if (nf == MAXFACTORS) p = n; /* make certain that we don't run out of space */ + while (n % p) { + switch (p) { + case 4: + p = 2; + break; + case 2: + p = 3; + break; + default: + p += 2; + break; + } + if (p > floor_sqrt) p = n; /* no more factors, skip to end */ + } + n /= p; + *facbuf++ = p; + *facbuf++ = n; + ++nf; + } while (n > 1); } /* @@ -420,50 +451,49 @@ static void kf_factor(int n, int *facbuf) */ static kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem) { - kiss_fft_cfg st=nullptr; - size_t memneeded = sizeof(struct kiss_fft_state) - + sizeof(FFT_DATA)*(nfft-1); /* twiddle factors */ + kiss_fft_cfg st = nullptr; + size_t memneeded = + sizeof(struct kiss_fft_state) + sizeof(FFT_DATA) * (nfft - 1); /* twiddle factors */ - if (lenmem==nullptr) { - st=(kiss_fft_cfg)KISS_FFT_MALLOC( memneeded ); - } else { - if (mem != nullptr && *lenmem >= memneeded) - st = (kiss_fft_cfg)mem; - *lenmem = memneeded; + if (lenmem == nullptr) { + st = (kiss_fft_cfg) KISS_FFT_MALLOC(memneeded); + } else { + if (mem != nullptr && *lenmem >= memneeded) st = (kiss_fft_cfg) mem; + *lenmem = memneeded; + } + + if (st) { + int i; + st->nfft = nfft; + st->inverse = inverse_fft; + + for (i = 0; i < nfft; ++i) { + const double phase = (st->inverse ? 2.0 * M_PI : -2.0 * M_PI) * i / nfft; + kf_cexp(st->twiddles + i, phase); } - if (st) { - int i; - st->nfft=nfft; - st->inverse = inverse_fft; - - for (i=0;iinverse ? 2.0*M_PI:-2.0*M_PI)*i / nfft; - kf_cexp(st->twiddles+i, phase ); - } - - kf_factor(nfft,st->factors); - } - return st; + kf_factor(nfft, st->factors); + } + return st; } static void kiss_fft_stride(kiss_fft_cfg st, const FFT_DATA *fin, FFT_DATA *fout, int in_stride) { - if (fin == fout) { - // NOTE: this is not really an in-place FFT algorithm. - // It just performs an out-of-place FFT into a temp buffer - FFT_DATA * tmpbuf = (FFT_DATA*)KISS_FFT_TMP_ALLOC( sizeof(FFT_DATA)*st->nfft); - kf_work(tmpbuf,fin,1,in_stride, st->factors,st); - memcpy(fout,tmpbuf,sizeof(FFT_DATA)*st->nfft); - KISS_FFT_TMP_FREE(tmpbuf); - }else{ - kf_work( fout, fin, 1,in_stride, st->factors,st ); - } + if (fin == fout) { + // NOTE: this is not really an in-place FFT algorithm. + // It just performs an out-of-place FFT into a temp buffer + FFT_DATA *tmpbuf = (FFT_DATA *) KISS_FFT_TMP_ALLOC(sizeof(FFT_DATA) * st->nfft); + kf_work(tmpbuf, fin, 1, in_stride, st->factors, st); + memcpy(fout, tmpbuf, sizeof(FFT_DATA) * st->nfft); + KISS_FFT_TMP_FREE(tmpbuf); + } else { + kf_work(fout, fin, 1, in_stride, st->factors, st); + } } static void kiss_fft(kiss_fft_cfg cfg, const FFT_DATA *fin, FFT_DATA *fout) { - kiss_fft_stride(cfg,fin,fout,1); + kiss_fft_stride(cfg, fin, fout, 1); } #endif diff --git a/src/KSPACE/msm.h b/src/KSPACE/msm.h index 7ef5171dea..32a5e36f24 100644 --- a/src/KSPACE/msm.h +++ b/src/KSPACE/msm.h @@ -35,30 +35,30 @@ class MSM : public KSpace { virtual double memory_usage(); protected: - int me,nprocs; + int me, nprocs; double precision; int nfactors; int *factors; double qqrd2e; double cutoff; double volume; - double *delxinv,*delyinv,*delzinv; - double h_x,h_y,h_z; + double *delxinv, *delyinv, *delzinv; + double h_x, h_y, h_z; double C_p; - int *nx_msm,*ny_msm,*nz_msm; - int *nxlo_in,*nylo_in,*nzlo_in; - int *nxhi_in,*nyhi_in,*nzhi_in; - int *nxlo_out,*nylo_out,*nzlo_out; - int *nxhi_out,*nyhi_out,*nzhi_out; - int *ngrid,*active_flag; - int *alpha,*betax,*betay,*betaz; - int nxlo_out_all,nylo_out_all,nzlo_out_all; - int nxhi_out_all,nyhi_out_all,nzhi_out_all; - int nxlo_direct,nxhi_direct,nylo_direct; - int nyhi_direct,nzlo_direct,nzhi_direct; + int *nx_msm, *ny_msm, *nz_msm; + int *nxlo_in, *nylo_in, *nzlo_in; + int *nxhi_in, *nyhi_in, *nzhi_in; + int *nxlo_out, *nylo_out, *nzlo_out; + int *nxhi_out, *nyhi_out, *nzhi_out; + int *ngrid, *active_flag; + int *alpha, *betax, *betay, *betaz; + int nxlo_out_all, nylo_out_all, nzlo_out_all; + int nxhi_out_all, nyhi_out_all, nzhi_out_all; + int nxlo_direct, nxhi_direct, nylo_direct; + int nyhi_direct, nzlo_direct, nzhi_direct; int nmax_direct; - int nlower,nupper; + int nlower, nupper; int peratom_allocate_flag; int levels; @@ -66,32 +66,32 @@ class MSM : public KSpace { double ****qgrid; double ****egrid; - double ****v0grid,****v1grid,****v2grid; - double ****v3grid,****v4grid,****v5grid; + double ****v0grid, ****v1grid, ****v2grid; + double ****v3grid, ****v4grid, ****v5grid; double **g_direct; - double **v0_direct,**v1_direct,**v2_direct; - double **v3_direct,**v4_direct,**v5_direct; + double **v0_direct, **v1_direct, **v2_direct; + double **v3_direct, **v4_direct, **v5_direct; double *g_direct_top; - double *v0_direct_top,*v1_direct_top,*v2_direct_top; - double *v3_direct_top,*v4_direct_top,*v5_direct_top; + double *v0_direct_top, *v1_direct_top, *v2_direct_top; + double *v3_direct_top, *v4_direct_top, *v5_direct_top; - double **phi1d,**dphi1d; + double **phi1d, **dphi1d; - int procgrid[3]; // procs assigned in each dim of 3d grid - int myloc[3]; // which proc I am in each dim - int ***procneigh_levels; // my 6 neighboring procs, 0/1 = left/right + int procgrid[3]; // procs assigned in each dim of 3d grid + int myloc[3]; // which proc I am in each dim + int ***procneigh_levels; // my 6 neighboring procs, 0/1 = left/right - class GridComm *gcall; // GridComm class for finest level grid - class GridComm **gc; // GridComm classes for each hierarchical level + class GridComm *gcall; // GridComm class for finest level grid + class GridComm **gc; // GridComm classes for each hierarchical level - double *gcall_buf1,*gcall_buf2; - double **gc_buf1,**gc_buf2; - int ngcall_buf1,ngcall_buf2,npergrid; - int *ngc_buf1,*ngc_buf2; + double *gcall_buf1, *gcall_buf2; + double **gc_buf1, **gc_buf2; + int ngcall_buf1, ngcall_buf2, npergrid; + int *ngc_buf1, *ngc_buf2; int current_level; - int **part2grid; // storage for particle -> grid mapping + int **part2grid; // storage for particle -> grid mapping int nmax; int triclinic; @@ -101,7 +101,7 @@ class MSM : public KSpace { void set_proc_grid(int); void set_grid_local(); void setup_grid(); - double estimate_1d_error(double,double); + double estimate_1d_error(double, double); double estimate_3d_error(); double estimate_total_error(); void allocate(); @@ -110,7 +110,7 @@ class MSM : public KSpace { void deallocate_peratom(); void allocate_levels(); void deallocate_levels(); - int factorable(int,int&,int&); + int factorable(int, int &, int &); void particle_map(); void make_rho(); virtual void direct(int); @@ -119,8 +119,8 @@ class MSM : public KSpace { void direct_peratom_top(int); void restriction(int); void prolongation(int); - void grid_swap_forward(int,double*** &); - void grid_swap_reverse(int,double*** &); + void grid_swap_forward(int, double ***&); + void grid_swap_reverse(int, double ***&); void fieldforce(); void fieldforce_peratom(); void compute_phis(const double &, const double &, const double &); @@ -140,7 +140,7 @@ class MSM : public KSpace { void unpack_reverse_grid(int, void *, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/msm_cg.h b/src/KSPACE/msm_cg.h index 5fbba79244..03085092f2 100644 --- a/src/KSPACE/msm_cg.h +++ b/src/KSPACE/msm_cg.h @@ -44,7 +44,7 @@ class MSMCG : public MSM { virtual void fieldforce_peratom(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_born_coul_long.h b/src/KSPACE/pair_born_coul_long.h index 221ac69b56..b92b89dcec 100644 --- a/src/KSPACE/pair_born_coul_long.h +++ b/src/KSPACE/pair_born_coul_long.h @@ -44,17 +44,17 @@ class PairBornCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**sigma,**c,**d; - double **rhoinv,**born1,**born2,**born3,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; double *cut_respa; double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_born_coul_msm.h b/src/KSPACE/pair_born_coul_msm.h index 15ae294bd7..38bc187adc 100644 --- a/src/KSPACE/pair_born_coul_msm.h +++ b/src/KSPACE/pair_born_coul_msm.h @@ -31,13 +31,13 @@ class PairBornCoulMSM : public PairBornCoulLong { virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_buck_coul_long.h b/src/KSPACE/pair_buck_coul_long.h index 82db847d48..46499aac9c 100644 --- a/src/KSPACE/pair_buck_coul_long.h +++ b/src/KSPACE/pair_buck_coul_long.h @@ -44,10 +44,10 @@ class PairBuckCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; double *cut_respa; double g_ewald; @@ -55,7 +55,7 @@ class PairBuckCoulLong : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_buck_coul_msm.h b/src/KSPACE/pair_buck_coul_msm.h index b4c615419c..043758bbe3 100644 --- a/src/KSPACE/pair_buck_coul_msm.h +++ b/src/KSPACE/pair_buck_coul_msm.h @@ -31,12 +31,13 @@ class PairBuckCoulMSM : public PairBuckCoulLong { virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_buck_long_coul_long.h b/src/KSPACE/pair_buck_long_coul_long.h index 3b620a07ac..7e0f6d243f 100644 --- a/src/KSPACE/pair_buck_long_coul_long.h +++ b/src/KSPACE/pair_buck_long_coul_long.h @@ -64,7 +64,7 @@ class PairBuckLongCoulLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_coul_long.h b/src/KSPACE/pair_coul_long.h index 2774309669..3db2c41f6b 100644 --- a/src/KSPACE/pair_coul_long.h +++ b/src/KSPACE/pair_coul_long.h @@ -41,7 +41,7 @@ class PairCoulLong : public Pair { virtual void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq,qdist; + double cut_coul, cut_coulsq, qdist; double *cut_respa; double g_ewald; double **scale; @@ -49,7 +49,7 @@ class PairCoulLong : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_coul_msm.h b/src/KSPACE/pair_coul_msm.h index ef52a90e4e..52a5a79c9d 100644 --- a/src/KSPACE/pair_coul_msm.h +++ b/src/KSPACE/pair_coul_msm.h @@ -27,13 +27,13 @@ namespace LAMMPS_NS { class PairCoulMSM : public PairCoulLong { public: PairCoulMSM(class LAMMPS *); - virtual ~PairCoulMSM() {}; + virtual ~PairCoulMSM(){}; virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_charmm_coul_long.h b/src/KSPACE/pair_lj_charmm_coul_long.h index 7bec7892ac..25f79dd431 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.h +++ b/src/KSPACE/pair_lj_charmm_coul_long.h @@ -49,25 +49,25 @@ class PairLJCharmmCoulLong : public Pair { protected: int implicit; - double cut_lj_inner,cut_lj; - double cut_lj_innersq,cut_ljsq; - double cut_coul,cut_coulsq; + double cut_lj_inner, cut_lj; + double cut_lj_innersq, cut_ljsq; + double cut_coul, cut_coulsq; double cut_bothsq; double cut_in_off, cut_in_on, cut_out_off, cut_out_on; double cut_in_diff, cut_out_diff; double cut_in_diff_inv, cut_out_diff_inv; double cut_in_off_sq, cut_in_on_sq, cut_out_off_sq, cut_out_on_sq; double denom_lj, denom_lj_inv; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4,**offset; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4, **offset; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; double *cut_respa; double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_charmm_coul_msm.h b/src/KSPACE/pair_lj_charmm_coul_msm.h index 1101e35fb6..6ba02f2eb4 100644 --- a/src/KSPACE/pair_lj_charmm_coul_msm.h +++ b/src/KSPACE/pair_lj_charmm_coul_msm.h @@ -32,12 +32,13 @@ class PairLJCharmmCoulMSM : public PairLJCharmmCoulLong { virtual double single(int, int, int, int, double, double, double, double &); virtual void compute_outer(int, int); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.h b/src/KSPACE/pair_lj_charmmfsw_coul_long.h index c67d374441..cdd13cb1cd 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.h +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.h @@ -51,23 +51,23 @@ class PairLJCharmmfswCoulLong : public Pair { int implicit; int dihedflag; - double cut_lj_inner,cut_lj,cut_ljinv,cut_lj_innerinv; - double cut_lj_innersq,cut_ljsq; - double cut_lj3inv,cut_lj_inner3inv,cut_lj3,cut_lj_inner3; - double cut_lj6inv,cut_lj_inner6inv,cut_lj6,cut_lj_inner6; - double cut_coul,cut_coulsq; + double cut_lj_inner, cut_lj, cut_ljinv, cut_lj_innerinv; + double cut_lj_innersq, cut_ljsq; + double cut_lj3inv, cut_lj_inner3inv, cut_lj3, cut_lj_inner3; + double cut_lj6inv, cut_lj_inner6inv, cut_lj6, cut_lj_inner6; + double cut_coul, cut_coulsq; double cut_bothsq; - double denom_lj,denom_lj12,denom_lj6; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4,**offset; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double denom_lj, denom_lj12, denom_lj6; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4, **offset; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; double *cut_respa; double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_cut_coul_long.h b/src/KSPACE/pair_lj_cut_coul_long.h index c6f71dea71..c9a8409505 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.h +++ b/src/KSPACE/pair_lj_cut_coul_long.h @@ -49,18 +49,18 @@ class PairLJCutCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_cut_coul_msm.h b/src/KSPACE/pair_lj_cut_coul_msm.h index b2dc1546f5..ae5aa427bf 100644 --- a/src/KSPACE/pair_lj_cut_coul_msm.h +++ b/src/KSPACE/pair_lj_cut_coul_msm.h @@ -32,12 +32,13 @@ class PairLJCutCoulMSM : public PairLJCutCoulLong { virtual double single(int, int, int, int, double, double, double, double &); virtual void compute_outer(int, int); virtual void *extract(const char *, int &); + protected: int nmax; double **ftmp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.h b/src/KSPACE/pair_lj_cut_tip4p_long.h index 207134060f..5644bfd326 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.h +++ b/src/KSPACE/pair_lj_cut_tip4p_long.h @@ -38,19 +38,19 @@ class PairLJCutTIP4PLong : public PairLJCutCoulLong { double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_long_coul_long.h b/src/KSPACE/pair_lj_long_coul_long.h index fd43753cd4..2b9d4a98bd 100644 --- a/src/KSPACE/pair_lj_long_coul_long.h +++ b/src/KSPACE/pair_lj_long_coul_long.h @@ -64,7 +64,7 @@ class PairLJLongCoulLong : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_lj_long_tip4p_long.h b/src/KSPACE/pair_lj_long_tip4p_long.h index a65ebf67fb..c1ba123b9b 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.h +++ b/src/KSPACE/pair_lj_long_tip4p_long.h @@ -40,21 +40,20 @@ class PairLJLongTIP4PLong : public PairLJLongCoulLong { void *extract(const char *, int &); double memory_usage(); - protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pair_tip4p_long.h b/src/KSPACE/pair_tip4p_long.h index 40ab2a8d7e..3e971536e5 100644 --- a/src/KSPACE/pair_tip4p_long.h +++ b/src/KSPACE/pair_tip4p_long.h @@ -38,19 +38,19 @@ class PairTIP4PLong : public PairCoulLong { double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm.h b/src/KSPACE/pppm.h index d1c1e8f863..0a732e48e5 100644 --- a/src/KSPACE/pppm.h +++ b/src/KSPACE/pppm.h @@ -61,64 +61,64 @@ class PPPM : public KSpace { virtual void compute_group_group(int, int, int); protected: - int me,nprocs; + int me, nprocs; int nfactors; int *factors; double cutoff; double volume; - double delxinv,delyinv,delzinv,delvolinv; - double h_x,h_y,h_z; - double shift,shiftone; + double delxinv, delyinv, delzinv, delvolinv; + double h_x, h_y, h_z; + double shift, shiftone; int peratom_allocate_flag; - int nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in; - int nxlo_out,nylo_out,nzlo_out,nxhi_out,nyhi_out,nzhi_out; - int nxlo_ghost,nxhi_ghost,nylo_ghost,nyhi_ghost,nzlo_ghost,nzhi_ghost; - int nxlo_fft,nylo_fft,nzlo_fft,nxhi_fft,nyhi_fft,nzhi_fft; - int nlower,nupper; - int ngrid,nfft,nfft_both; + int nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in; + int nxlo_out, nylo_out, nzlo_out, nxhi_out, nyhi_out, nzhi_out; + int nxlo_ghost, nxhi_ghost, nylo_ghost, nyhi_ghost, nzlo_ghost, nzhi_ghost; + int nxlo_fft, nylo_fft, nzlo_fft, nxhi_fft, nyhi_fft, nzhi_fft; + int nlower, nupper; + int ngrid, nfft, nfft_both; FFT_SCALAR ***density_brick; - FFT_SCALAR ***vdx_brick,***vdy_brick,***vdz_brick; + FFT_SCALAR ***vdx_brick, ***vdy_brick, ***vdz_brick; FFT_SCALAR ***u_brick; - FFT_SCALAR ***v0_brick,***v1_brick,***v2_brick; - FFT_SCALAR ***v3_brick,***v4_brick,***v5_brick; + FFT_SCALAR ***v0_brick, ***v1_brick, ***v2_brick; + FFT_SCALAR ***v3_brick, ***v4_brick, ***v5_brick; double *greensfn; double **vg; - double *fkx,*fky,*fkz; + double *fkx, *fky, *fkz; FFT_SCALAR *density_fft; - FFT_SCALAR *work1,*work2; + FFT_SCALAR *work1, *work2; double *gf_b; - FFT_SCALAR **rho1d,**rho_coeff,**drho1d,**drho_coeff; + FFT_SCALAR **rho1d, **rho_coeff, **drho1d, **drho_coeff; double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3; double *sf_precoeff4, *sf_precoeff5, *sf_precoeff6; - double sf_coeff[6]; // coefficients for calculating ad self-forces + double sf_coeff[6]; // coefficients for calculating ad self-forces double **acons; // FFTs and grid communication - class FFT3d *fft1,*fft2; + class FFT3d *fft1, *fft2; class Remap *remap; class GridComm *gc; - FFT_SCALAR *gc_buf1,*gc_buf2; - int ngc_buf1,ngc_buf2,npergrid; + FFT_SCALAR *gc_buf1, *gc_buf2; + int ngc_buf1, ngc_buf2, npergrid; // group-group interactions int group_allocate_flag; - FFT_SCALAR ***density_A_brick,***density_B_brick; - FFT_SCALAR *density_A_fft,*density_B_fft; + FFT_SCALAR ***density_A_brick, ***density_B_brick; + FFT_SCALAR *density_A_fft, *density_B_fft; - int **part2grid; // storage for particle -> grid mapping + int **part2grid; // storage for particle -> grid mapping int nmax; double *boxlo; - // TIP4P settings - int typeH,typeO; // atom types of TIP4P water H and O atoms - double qdist; // distance from O site to negative charge - double alpha; // geometric factor + // TIP4P settings + int typeH, typeO; // atom types of TIP4P water H and O atoms + double qdist; // distance from O site to negative charge + double alpha; // geometric factor virtual void set_grid_global(); void set_grid_local(); @@ -154,11 +154,9 @@ class PPPM : public KSpace { virtual void poisson_peratom(); virtual void fieldforce_peratom(); - void procs2grid2d(int,int,int,int *, int*); - void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &); - void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &); + void procs2grid2d(int, int, int, int *, int *); + void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &); + void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &); void compute_rho_coeff(); virtual void slabcorr(); @@ -171,7 +169,7 @@ class PPPM : public KSpace { // triclinic - int triclinic; // domain settings, orthog or triclinic + int triclinic; // domain settings, orthog or triclinic void setup_triclinic(); void compute_gf_ik_triclinic(); void poisson_ik_triclinic(); @@ -183,9 +181,9 @@ class PPPM : public KSpace { virtual void deallocate_groups(); virtual void make_rho_groups(int, int, int); virtual void poisson_groups(int); - virtual void slabcorr_groups(int,int,int); + virtual void slabcorr_groups(int, int, int); -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- denominator for Hockney-Eastwood Green's function of x,y,z = sin(kx*deltax/2), etc @@ -197,21 +195,21 @@ class PPPM : public KSpace { gf_b = denominator expansion coeffs ------------------------------------------------------------------------- */ - inline double gf_denom(const double &x, const double &y, - const double &z) const { - double sx,sy,sz; + inline double gf_denom(const double &x, const double &y, const double &z) const + { + double sx, sy, sz; sz = sy = sx = 0.0; - for (int l = order-1; l >= 0; l--) { - sx = gf_b[l] + sx*x; - sy = gf_b[l] + sy*y; - sz = gf_b[l] + sz*z; + for (int l = order - 1; l >= 0; l--) { + sx = gf_b[l] + sx * x; + sy = gf_b[l] + sy * y; + sz = gf_b[l] + sz * z; } - double s = sx*sy*sz; - return s*s; + double s = sx * sy * sz; + return s * s; }; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_cg.h b/src/KSPACE/pppm_cg.h index f84a28615a..fb6898faea 100644 --- a/src/KSPACE/pppm_cg.h +++ b/src/KSPACE/pppm_cg.h @@ -46,7 +46,7 @@ class PPPMCG : public PPPM { virtual void make_rho_groups(int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_dipole.h b/src/KSPACE/pppm_dipole.h index f1783c5e07..cdc86df793 100644 --- a/src/KSPACE/pppm_dipole.h +++ b/src/KSPACE/pppm_dipole.h @@ -57,23 +57,23 @@ class PPPMDipole : public PPPM { // dipole - FFT_SCALAR ***densityx_brick_dipole,***densityy_brick_dipole,***densityz_brick_dipole; - FFT_SCALAR ***vdxx_brick_dipole,***vdyy_brick_dipole,***vdzz_brick_dipole; - FFT_SCALAR ***vdxy_brick_dipole,***vdxz_brick_dipole,***vdyz_brick_dipole; - FFT_SCALAR ***ux_brick_dipole,***uy_brick_dipole,***uz_brick_dipole; - FFT_SCALAR ***v0x_brick_dipole,***v1x_brick_dipole,***v2x_brick_dipole; - FFT_SCALAR ***v3x_brick_dipole,***v4x_brick_dipole,***v5x_brick_dipole; - FFT_SCALAR ***v0y_brick_dipole,***v1y_brick_dipole,***v2y_brick_dipole; - FFT_SCALAR ***v3y_brick_dipole,***v4y_brick_dipole,***v5y_brick_dipole; - FFT_SCALAR ***v0z_brick_dipole,***v1z_brick_dipole,***v2z_brick_dipole; - FFT_SCALAR ***v3z_brick_dipole,***v4z_brick_dipole,***v5z_brick_dipole; - FFT_SCALAR *work3,*work4; - FFT_SCALAR *densityx_fft_dipole,*densityy_fft_dipole,*densityz_fft_dipole; + FFT_SCALAR ***densityx_brick_dipole, ***densityy_brick_dipole, ***densityz_brick_dipole; + FFT_SCALAR ***vdxx_brick_dipole, ***vdyy_brick_dipole, ***vdzz_brick_dipole; + FFT_SCALAR ***vdxy_brick_dipole, ***vdxz_brick_dipole, ***vdyz_brick_dipole; + FFT_SCALAR ***ux_brick_dipole, ***uy_brick_dipole, ***uz_brick_dipole; + FFT_SCALAR ***v0x_brick_dipole, ***v1x_brick_dipole, ***v2x_brick_dipole; + FFT_SCALAR ***v3x_brick_dipole, ***v4x_brick_dipole, ***v5x_brick_dipole; + FFT_SCALAR ***v0y_brick_dipole, ***v1y_brick_dipole, ***v2y_brick_dipole; + FFT_SCALAR ***v3y_brick_dipole, ***v4y_brick_dipole, ***v5y_brick_dipole; + FFT_SCALAR ***v0z_brick_dipole, ***v1z_brick_dipole, ***v2z_brick_dipole; + FFT_SCALAR ***v3z_brick_dipole, ***v4z_brick_dipole, ***v5z_brick_dipole; + FFT_SCALAR *work3, *work4; + FFT_SCALAR *densityx_fft_dipole, *densityy_fft_dipole, *densityz_fft_dipole; class GridComm *gc_dipole; int only_dipole_flag; - double musum,musqsum,mu2; + double musum, musqsum, mu2; double find_gewald_dipole(double, double, bigint, double, double); double newton_raphson_f_dipole(double, double, bigint, double, double); @@ -91,7 +91,7 @@ class PPPMDipole : public PPPM { void musum_musq(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_dipole_spin.h b/src/KSPACE/pppm_dipole_spin.h index f9fb5ffa20..fd91fea71a 100644 --- a/src/KSPACE/pppm_dipole_spin.h +++ b/src/KSPACE/pppm_dipole_spin.h @@ -32,11 +32,11 @@ class PPPMDipoleSpin : public PPPMDipole { void compute(int, int); protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force void slabcorr(); @@ -48,7 +48,7 @@ class PPPMDipoleSpin : public PPPMDipole { void spsum_spsq(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_disp.h b/src/KSPACE/pppm_disp.h index f4c5e3c6a9..f8f55adb24 100644 --- a/src/KSPACE/pppm_disp.h +++ b/src/KSPACE/pppm_disp.h @@ -42,8 +42,8 @@ typedef double FFT_SCALAR; namespace LAMMPS_NS { -#define EWALD_MAXORDER 6 -#define EWALD_FUNCS 4 +#define EWALD_MAXORDER 6 +#define EWALD_FUNCS 4 class PPPMDisp : public KSpace { public: @@ -59,12 +59,12 @@ class PPPMDisp : public KSpace { virtual double memory_usage(); protected: - int me,nprocs; + int me, nprocs; int nfactors; int *factors; double csumij; double csum; - double *csumi; //needed as correction term for per atom calculations! + double *csumi; //needed as correction term for per atom calculations! double *cii; int csumflag; double cutoff, cutoff_lj; @@ -78,84 +78,93 @@ class PPPMDisp : public KSpace { int nsplit_alloc; int function[EWALD_FUNCS]; - double delxinv,delyinv,delzinv,delvolinv; - double delxinv_6,delyinv_6,delzinv_6,delvolinv_6; + double delxinv, delyinv, delzinv, delvolinv; + double delxinv_6, delyinv_6, delzinv_6, delvolinv_6; - double shift,shiftone; - int nxlo_in,nylo_in,nzlo_in,nxhi_in,nyhi_in,nzhi_in; - int nxlo_out,nylo_out,nzlo_out,nxhi_out,nyhi_out,nzhi_out; - int nxlo_fft,nylo_fft,nzlo_fft,nxhi_fft,nyhi_fft,nzhi_fft; - int nlower,nupper; - int ngrid,nfft,nfft_both; + double shift, shiftone; + int nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in; + int nxlo_out, nylo_out, nzlo_out, nxhi_out, nyhi_out, nzhi_out; + int nxlo_fft, nylo_fft, nzlo_fft, nxhi_fft, nyhi_fft, nzhi_fft; + int nlower, nupper; + int ngrid, nfft, nfft_both; - double shift_6,shiftone_6; - int nxlo_in_6,nylo_in_6,nzlo_in_6,nxhi_in_6,nyhi_in_6,nzhi_in_6; - int nxlo_out_6,nylo_out_6,nzlo_out_6,nxhi_out_6,nyhi_out_6,nzhi_out_6; - int nxlo_fft_6,nylo_fft_6,nzlo_fft_6,nxhi_fft_6,nyhi_fft_6,nzhi_fft_6; - int nlower_6,nupper_6; - int ngrid_6,nfft_6,nfft_both_6; + double shift_6, shiftone_6; + int nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6; + int nxlo_out_6, nylo_out_6, nzlo_out_6, nxhi_out_6, nyhi_out_6, nzhi_out_6; + int nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, nyhi_fft_6, nzhi_fft_6; + int nlower_6, nupper_6; + int ngrid_6, nfft_6, nfft_both_6; // the following variables are needed for every structure factor FFT_SCALAR ***density_brick; - FFT_SCALAR ***vdx_brick,***vdy_brick,***vdz_brick; + FFT_SCALAR ***vdx_brick, ***vdy_brick, ***vdz_brick; FFT_SCALAR *density_fft; FFT_SCALAR ***u_brick; - FFT_SCALAR ***v0_brick,***v1_brick,***v2_brick,***v3_brick,***v4_brick,***v5_brick; + FFT_SCALAR ***v0_brick, ***v1_brick, ***v2_brick, ***v3_brick, ***v4_brick, ***v5_brick; FFT_SCALAR ***density_brick_g; - FFT_SCALAR ***vdx_brick_g,***vdy_brick_g,***vdz_brick_g; + FFT_SCALAR ***vdx_brick_g, ***vdy_brick_g, ***vdz_brick_g; FFT_SCALAR *density_fft_g; FFT_SCALAR ***u_brick_g; - FFT_SCALAR ***v0_brick_g,***v1_brick_g,***v2_brick_g,***v3_brick_g,***v4_brick_g,***v5_brick_g; + FFT_SCALAR ***v0_brick_g, ***v1_brick_g, ***v2_brick_g, ***v3_brick_g, ***v4_brick_g, + ***v5_brick_g; FFT_SCALAR ***density_brick_a0; - FFT_SCALAR ***vdx_brick_a0,***vdy_brick_a0,***vdz_brick_a0; + FFT_SCALAR ***vdx_brick_a0, ***vdy_brick_a0, ***vdz_brick_a0; FFT_SCALAR *density_fft_a0; FFT_SCALAR ***u_brick_a0; - FFT_SCALAR ***v0_brick_a0,***v1_brick_a0,***v2_brick_a0,***v3_brick_a0,***v4_brick_a0,***v5_brick_a0; + FFT_SCALAR ***v0_brick_a0, ***v1_brick_a0, ***v2_brick_a0, ***v3_brick_a0, ***v4_brick_a0, + ***v5_brick_a0; FFT_SCALAR ***density_brick_a1; - FFT_SCALAR ***vdx_brick_a1,***vdy_brick_a1,***vdz_brick_a1; + FFT_SCALAR ***vdx_brick_a1, ***vdy_brick_a1, ***vdz_brick_a1; FFT_SCALAR *density_fft_a1; FFT_SCALAR ***u_brick_a1; - FFT_SCALAR ***v0_brick_a1,***v1_brick_a1,***v2_brick_a1,***v3_brick_a1,***v4_brick_a1,***v5_brick_a1; + FFT_SCALAR ***v0_brick_a1, ***v1_brick_a1, ***v2_brick_a1, ***v3_brick_a1, ***v4_brick_a1, + ***v5_brick_a1; FFT_SCALAR ***density_brick_a2; - FFT_SCALAR ***vdx_brick_a2,***vdy_brick_a2,***vdz_brick_a2; + FFT_SCALAR ***vdx_brick_a2, ***vdy_brick_a2, ***vdz_brick_a2; FFT_SCALAR *density_fft_a2; FFT_SCALAR ***u_brick_a2; - FFT_SCALAR ***v0_brick_a2,***v1_brick_a2,***v2_brick_a2,***v3_brick_a2,***v4_brick_a2,***v5_brick_a2; + FFT_SCALAR ***v0_brick_a2, ***v1_brick_a2, ***v2_brick_a2, ***v3_brick_a2, ***v4_brick_a2, + ***v5_brick_a2; FFT_SCALAR ***density_brick_a3; - FFT_SCALAR ***vdx_brick_a3,***vdy_brick_a3,***vdz_brick_a3; + FFT_SCALAR ***vdx_brick_a3, ***vdy_brick_a3, ***vdz_brick_a3; FFT_SCALAR *density_fft_a3; FFT_SCALAR ***u_brick_a3; - FFT_SCALAR ***v0_brick_a3,***v1_brick_a3,***v2_brick_a3,***v3_brick_a3,***v4_brick_a3,***v5_brick_a3; + FFT_SCALAR ***v0_brick_a3, ***v1_brick_a3, ***v2_brick_a3, ***v3_brick_a3, ***v4_brick_a3, + ***v5_brick_a3; FFT_SCALAR ***density_brick_a4; - FFT_SCALAR ***vdx_brick_a4,***vdy_brick_a4,***vdz_brick_a4; + FFT_SCALAR ***vdx_brick_a4, ***vdy_brick_a4, ***vdz_brick_a4; FFT_SCALAR *density_fft_a4; FFT_SCALAR ***u_brick_a4; - FFT_SCALAR ***v0_brick_a4,***v1_brick_a4,***v2_brick_a4,***v3_brick_a4,***v4_brick_a4,***v5_brick_a4; + FFT_SCALAR ***v0_brick_a4, ***v1_brick_a4, ***v2_brick_a4, ***v3_brick_a4, ***v4_brick_a4, + ***v5_brick_a4; FFT_SCALAR ***density_brick_a5; - FFT_SCALAR ***vdx_brick_a5,***vdy_brick_a5,***vdz_brick_a5; + FFT_SCALAR ***vdx_brick_a5, ***vdy_brick_a5, ***vdz_brick_a5; FFT_SCALAR *density_fft_a5; FFT_SCALAR ***u_brick_a5; - FFT_SCALAR ***v0_brick_a5,***v1_brick_a5,***v2_brick_a5,***v3_brick_a5,***v4_brick_a5,***v5_brick_a5; + FFT_SCALAR ***v0_brick_a5, ***v1_brick_a5, ***v2_brick_a5, ***v3_brick_a5, ***v4_brick_a5, + ***v5_brick_a5; FFT_SCALAR ***density_brick_a6; - FFT_SCALAR ***vdx_brick_a6,***vdy_brick_a6,***vdz_brick_a6; + FFT_SCALAR ***vdx_brick_a6, ***vdy_brick_a6, ***vdz_brick_a6; FFT_SCALAR *density_fft_a6; FFT_SCALAR ***u_brick_a6; - FFT_SCALAR ***v0_brick_a6,***v1_brick_a6,***v2_brick_a6,***v3_brick_a6,***v4_brick_a6,***v5_brick_a6; + FFT_SCALAR ***v0_brick_a6, ***v1_brick_a6, ***v2_brick_a6, ***v3_brick_a6, ***v4_brick_a6, + ***v5_brick_a6; FFT_SCALAR ****density_brick_none; - FFT_SCALAR ****vdx_brick_none,****vdy_brick_none,****vdz_brick_none; + FFT_SCALAR ****vdx_brick_none, ****vdy_brick_none, ****vdz_brick_none; FFT_SCALAR **density_fft_none; FFT_SCALAR ****u_brick_none; - FFT_SCALAR ****v0_brick_none,****v1_brick_none,****v2_brick_none,****v3_brick_none,****v4_brick_none,****v5_brick_none; + FFT_SCALAR ****v0_brick_none, ****v1_brick_none, ****v2_brick_none, ****v3_brick_none, + ****v4_brick_none, ****v5_brick_none; //// needed for each interaction type double *greensfn; @@ -166,61 +175,56 @@ class PPPMDisp : public KSpace { double **vg_6; double **vg2_6; - double *fkx,*fky,*fkz; + double *fkx, *fky, *fkz; double *fkx2, *fky2, *fkz2; double *fkx_6, *fky_6, *fkz_6; double *fkx2_6, *fky2_6, *fkz2_6; double *gf_b; double *gf_b_6; - double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3, *sf_precoeff4, - *sf_precoeff5, *sf_precoeff6; - double *sf_precoeff1_6, *sf_precoeff2_6, *sf_precoeff3_6, - *sf_precoeff4_6, *sf_precoeff5_6, *sf_precoeff6_6; - FFT_SCALAR **rho1d,**rho_coeff; + double *sf_precoeff1, *sf_precoeff2, *sf_precoeff3, *sf_precoeff4, *sf_precoeff5, *sf_precoeff6; + double *sf_precoeff1_6, *sf_precoeff2_6, *sf_precoeff3_6, *sf_precoeff4_6, *sf_precoeff5_6, + *sf_precoeff6_6; + FFT_SCALAR **rho1d, **rho_coeff; FFT_SCALAR **drho1d, **drho_coeff; FFT_SCALAR **rho1d_6, **rho_coeff_6; FFT_SCALAR **drho1d_6, **drho_coeff_6; - FFT_SCALAR *work1,*work2; + FFT_SCALAR *work1, *work2; FFT_SCALAR *work1_6, *work2_6; - class FFT3d *fft1,*fft2 ; - class FFT3d *fft1_6,*fft2_6; - class Remap *remap,*remap_6; - class GridComm *gc,*gc6; + class FFT3d *fft1, *fft2; + class FFT3d *fft1_6, *fft2_6; + class Remap *remap, *remap_6; + class GridComm *gc, *gc6; - FFT_SCALAR *gc_buf1,*gc_buf2,*gc6_buf1,*gc6_buf2; - int ngc_buf1,ngc_buf2,npergrid; - int ngc6_buf1,ngc6_buf2,npergrid6; + FFT_SCALAR *gc_buf1, *gc_buf2, *gc6_buf1, *gc6_buf2; + int ngc_buf1, ngc_buf2, npergrid; + int ngc6_buf1, ngc6_buf2, npergrid6; - int **part2grid; // storage for particle -> grid mapping + int **part2grid; // storage for particle -> grid mapping int **part2grid_6; int nmax; - int triclinic; // domain settings, orthog or triclinic + int triclinic; // domain settings, orthog or triclinic double *boxlo; - // TIP4P settings - int typeH,typeO; // atom types of TIP4P water H and O atoms - double qdist; // distance from O site to negative charge - double alpha; // geometric factor + // TIP4P settings + int typeH, typeO; // atom types of TIP4P water H and O atoms + double qdist; // distance from O site to negative charge + double alpha; // geometric factor void init_coeffs(); - int qr_alg(double**, double**, int); - void hessenberg(double**, double**, int); - void qr_tri(double**, double**, int); - void mmult(double**, double**, double**, int); - int check_convergence(double**, double**, double**, - double**, double**, double**, int); + int qr_alg(double **, double **, int); + void hessenberg(double **, double **, int); + void qr_tri(double **, double **, int); + void mmult(double **, double **, double **, int); + int check_convergence(double **, double **, double **, double **, double **, double **, int); void set_grid(); void set_grid_6(); void set_init_g6(); - void set_fft_parameters(int&, int&, int&, int&, int&,int&, - int&, int&,int&, int&, int&,int&, - int&, int&,int&, int&, int&,int&, - int&, int&,int&, int&, int&, - int&, int&, int&, - double&, double&, int&); + void set_fft_parameters(int &, int &, int &, int &, int &, int &, int &, int &, int &, int &, + int &, int &, int &, int &, int &, int &, int &, int &, int &, int &, + int &, int &, int &, int &, int &, int &, double &, double &, int &); void set_n_pppm_6(); void adjust_gewald(); void adjust_gewald_6(); @@ -229,7 +233,7 @@ class PPPMDisp : public KSpace { double f_6(); double derivf_6(); double final_accuracy(); - void final_accuracy_6(double&, double&, double&); + void final_accuracy_6(double &, double &, double &); double lj_rspace_error(); double compute_qopt(); double compute_qopt_6(); @@ -247,104 +251,73 @@ class PPPMDisp : public KSpace { int factorable(int); double rms(double, double, bigint, double, double **); double diffpr(double, double, double, double, double **); - void compute_gf_denom(double*, int); - double gf_denom(double, double, double, double*, int); + void compute_gf_denom(double *, int); + double gf_denom(double, double, double, double *, int); - void compute_sf_precoeff(int, int, int, int, - int, int, int, - int, int, int, - double*, double*, double*, - double*, double*, double*); + void compute_sf_precoeff(int, int, int, int, int, int, int, int, int, int, double *, double *, + double *, double *, double *, double *); void compute_gf(); void compute_sf_coeff(); void compute_gf_6(); void compute_sf_coeff_6(); - virtual void particle_map(double, double, double, - double, int **, int, int, - int, int, int, - int, int, int); - virtual void particle_map_c(double, double, double, - double, int **, int, int, - int, int, int, - int, int, int ); + virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int); + virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int); virtual void make_rho_c(); virtual void make_rho_g(); virtual void make_rho_a(); virtual void make_rho_none(); - virtual void brick2fft(int, int, int, int, int, int, - FFT_SCALAR ***, FFT_SCALAR *, FFT_SCALAR *, + virtual void brick2fft(int, int, int, int, int, int, FFT_SCALAR ***, FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::Remap *); virtual void brick2fft_a(); virtual void brick2fft_none(); - virtual void poisson_ik(FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR *, LAMMPS_NS::FFT3d *,LAMMPS_NS::FFT3d *, - int, int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, double&, double *, - double *, double *, double *, - double *, double *, double *, - FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, double *, double **, double **, - FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, + virtual void poisson_ik(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::FFT3d *, + LAMMPS_NS::FFT3d *, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, double &, double *, double *, double *, double *, + double *, double *, double *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, double *, double **, double **, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***); + + virtual void poisson_ad(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::FFT3d *, + LAMMPS_NS::FFT3d *, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, double &, double *, double *, double **, + double **, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_ad(FFT_SCALAR*, FFT_SCALAR*, - FFT_SCALAR*, LAMMPS_NS::FFT3d*,LAMMPS_NS::FFT3d*, - int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - double&, double*, - double*, double**, double**, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); + virtual void poisson_peratom(FFT_SCALAR *, FFT_SCALAR *, LAMMPS_NS::FFT3d *, double **, double **, + int, int, int, int, int, int, int, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); + virtual void poisson_2s_ik(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***); + virtual void poisson_2s_ad(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_peratom(FFT_SCALAR*, FFT_SCALAR*, LAMMPS_NS::FFT3d*, - double**, double**, int, - int, int, int, int, int, int, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); - virtual void poisson_2s_ik(FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_2s_ad(FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); + virtual void poisson_2s_peratom(FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); - virtual void poisson_2s_peratom(FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); - - virtual void poisson_none_ad(int, int, FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, + virtual void poisson_none_ad(int, int, FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, + FFT_SCALAR ****, FFT_SCALAR ****); + virtual void poisson_none_ik(int, int, FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****); - virtual void poisson_none_ik(int, int, FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, - FFT_SCALAR ****, - FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****); - virtual void poisson_none_peratom(int, int, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, - FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); - + virtual void poisson_none_peratom(int, int, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***); virtual void fieldforce_c_ik(); virtual void fieldforce_c_ad(); @@ -358,12 +331,12 @@ class PPPMDisp : public KSpace { virtual void fieldforce_none_ik(); virtual void fieldforce_none_ad(); virtual void fieldforce_none_peratom(); - void procs2grid2d(int,int,int,int *, int*); - void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &, int, FFT_SCALAR **, FFT_SCALAR **); - void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, - const FFT_SCALAR &, int, FFT_SCALAR **, FFT_SCALAR **); - void compute_rho_coeff(FFT_SCALAR **,FFT_SCALAR **, int); + void procs2grid2d(int, int, int, int *, int *); + void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &, int, FFT_SCALAR **, + FFT_SCALAR **); + void compute_drho1d(const FFT_SCALAR &, const FFT_SCALAR &, const FFT_SCALAR &, int, + FFT_SCALAR **, FFT_SCALAR **); + void compute_rho_coeff(FFT_SCALAR **, FFT_SCALAR **, int); void slabcorr(int); // grid communication @@ -374,7 +347,7 @@ class PPPMDisp : public KSpace { void unpack_reverse_grid(int, void *, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_disp_tip4p.h b/src/KSPACE/pppm_disp_tip4p.h index 462ccb0c96..809788ee13 100644 --- a/src/KSPACE/pppm_disp_tip4p.h +++ b/src/KSPACE/pppm_disp_tip4p.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class PPPMDispTIP4P : public PPPMDisp { public: PPPMDispTIP4P(class LAMMPS *); - virtual ~PPPMDispTIP4P () {}; + virtual ~PPPMDispTIP4P(){}; void init(); protected: - virtual void particle_map_c(double, double, double, - double, int **, int, int, - int, int, int, int, int, int); + virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int); virtual void make_rho_c(); virtual void fieldforce_c_ik(); virtual void fieldforce_c_ad(); @@ -43,7 +42,7 @@ class PPPMDispTIP4P : public PPPMDisp { void find_M(int, int &, int &, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_stagger.h b/src/KSPACE/pppm_stagger.h index c0d4b7d413..6307e383ba 100644 --- a/src/KSPACE/pppm_stagger.h +++ b/src/KSPACE/pppm_stagger.h @@ -50,31 +50,30 @@ class PPPMStagger : public PPPM { virtual void fieldforce_ad(); virtual void fieldforce_peratom(); - inline double gf_denom2(const double &x, const double &y, - const double &z) const + inline double gf_denom2(const double &x, const double &y, const double &z) const { - double sx,sy,sz; - double x2 = x*x; - double y2 = y*y; - double z2 = z*z; + double sx, sy, sz; + double x2 = x * x; + double y2 = y * y; + double z2 = z * z; double xl = x; double yl = y; double zl = z; sx = sy = sz = 0.0; for (int l = 0; l < order; l++) { - sx += gf_b2[order][l]*xl; - sy += gf_b2[order][l]*yl; - sz += gf_b2[order][l]*zl; + sx += gf_b2[order][l] * xl; + sy += gf_b2[order][l] * yl; + sz += gf_b2[order][l] * zl; xl *= x2; yl *= y2; zl *= z2; } - double s = sx*sy*sz; - return s*s; + double s = sx * sy * sz; + return s * s; }; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/pppm_tip4p.h b/src/KSPACE/pppm_tip4p.h index 1347fe99d2..1eaee0e833 100644 --- a/src/KSPACE/pppm_tip4p.h +++ b/src/KSPACE/pppm_tip4p.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class PPPMTIP4P : public PPPM { public: PPPMTIP4P(class LAMMPS *); - virtual ~PPPMTIP4P () {}; + virtual ~PPPMTIP4P(){}; void init(); protected: @@ -41,7 +41,7 @@ class PPPMTIP4P : public PPPM { void find_M(int, int &, int &, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/KSPACE/remap.h b/src/KSPACE/remap.h index 0d5a01e39a..8357155e51 100644 --- a/src/KSPACE/remap.h +++ b/src/KSPACE/remap.h @@ -24,47 +24,44 @@ typedef double FFT_SCALAR; // details of how to do a 3d remap struct remap_plan_3d { - FFT_SCALAR *sendbuf; // buffer for MPI sends - FFT_SCALAR *scratch; // scratch buffer for MPI recvs + FFT_SCALAR *sendbuf; // buffer for MPI sends + FFT_SCALAR *scratch; // scratch buffer for MPI recvs void (*pack)(FFT_SCALAR *, FFT_SCALAR *, struct pack_plan_3d *); - // which pack function to use + // which pack function to use void (*unpack)(FFT_SCALAR *, FFT_SCALAR *, struct pack_plan_3d *); - // which unpack function to use - int *send_offset; // extraction loc for each send - int *send_size; // size of each send message - int *send_proc; // proc to send each message to - struct pack_plan_3d *packplan; // pack plan for each send message - int *recv_offset; // insertion loc for each recv - int *recv_size; // size of each recv message - int *recv_proc; // proc to recv each message from - int *recv_bufloc; // offset in scratch buf for each recv - MPI_Request *request; // MPI request for each posted recv - struct pack_plan_3d *unpackplan; // unpack plan for each recv message - int nrecv; // # of recvs from other procs - int nsend; // # of sends to other procs - int self; // whether I send/recv with myself - int memory; // user provides scratch space or not - MPI_Comm comm; // group of procs performing remap - int usecollective; // use collective or point-to-point MPI - int commringlen; // length of commringlist - int *commringlist; // ranks on communication ring of this plan + // which unpack function to use + int *send_offset; // extraction loc for each send + int *send_size; // size of each send message + int *send_proc; // proc to send each message to + struct pack_plan_3d *packplan; // pack plan for each send message + int *recv_offset; // insertion loc for each recv + int *recv_size; // size of each recv message + int *recv_proc; // proc to recv each message from + int *recv_bufloc; // offset in scratch buf for each recv + MPI_Request *request; // MPI request for each posted recv + struct pack_plan_3d *unpackplan; // unpack plan for each recv message + int nrecv; // # of recvs from other procs + int nsend; // # of sends to other procs + int self; // whether I send/recv with myself + int memory; // user provides scratch space or not + MPI_Comm comm; // group of procs performing remap + int usecollective; // use collective or point-to-point MPI + int commringlen; // length of commringlist + int *commringlist; // ranks on communication ring of this plan }; // collision between 2 regions struct extent_3d { - int ilo,ihi,isize; - int jlo,jhi,jsize; - int klo,khi,ksize; + int ilo, ihi, isize; + int jlo, jhi, jsize; + int klo, khi, ksize; }; // function prototypes void remap_3d(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *, struct remap_plan_3d *); -struct remap_plan_3d *remap_3d_create_plan(MPI_Comm, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int); +struct remap_plan_3d *remap_3d_create_plan(MPI_Comm, int, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int); void remap_3d_destroy_plan(struct remap_plan_3d *); -int remap_3d_collide(struct extent_3d *, - struct extent_3d *, struct extent_3d *); +int remap_3d_collide(struct extent_3d *, struct extent_3d *, struct extent_3d *); diff --git a/src/KSPACE/remap_wrap.h b/src/KSPACE/remap_wrap.h index f2e69e995f..abae5f9201 100644 --- a/src/KSPACE/remap_wrap.h +++ b/src/KSPACE/remap_wrap.h @@ -21,8 +21,8 @@ namespace LAMMPS_NS { class Remap : protected Pointers { public: - Remap(class LAMMPS *, MPI_Comm,int,int,int,int,int,int, - int,int,int,int,int,int,int,int,int,int,int); + Remap(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, + int, int, int, int); ~Remap(); void perform(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *); @@ -30,7 +30,7 @@ class Remap : protected Pointers { struct remap_plan_3d *plan; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/LATTE/fix_latte.h b/src/LATTE/fix_latte.h index ff986c0e66..c2d5bb2747 100644 --- a/src/LATTE/fix_latte.h +++ b/src/LATTE/fix_latte.h @@ -45,10 +45,10 @@ class FixLatte : public Fix { protected: char *id_pe; - int coulomb,pbcflag,pe_peratom,virial_global,virial_peratom,neighflag; + int coulomb, pbcflag, pe_peratom, virial_global, virial_peratom, neighflag; int eflag_caller; - int nmax,newsystem; + int nmax, newsystem; double *qpotential; double **flatte; double latte_energy; @@ -57,7 +57,7 @@ class FixLatte : public Fix { class Compute *c_pe; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/fix_qeq_comb.h b/src/MANYBODY/fix_qeq_comb.h index 6196f30bba..7e8df4eb32 100644 --- a/src/MANYBODY/fix_qeq_comb.h +++ b/src/MANYBODY/fix_qeq_comb.h @@ -32,15 +32,15 @@ class FixQEQComb : public Fix { virtual void init(); void setup(int); virtual void post_force(int); - void post_force_respa(int,int,int); + void post_force_respa(int, int, int); double memory_usage(); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); void min_post_force(int); protected: - int me,firstflag; + int me, firstflag; double precision; int ilevel_respa; bigint ngroup; @@ -49,10 +49,10 @@ class FixQEQComb : public Fix { class PairComb *comb; class PairComb3 *comb3; int nmax; - double *qf,*q1,*q2; + double *qf, *q1, *q2; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_adp.h b/src/MANYBODY/pair_adp.h index 0e0e711379..aa715485a8 100644 --- a/src/MANYBODY/pair_adp.h +++ b/src/MANYBODY/pair_adp.h @@ -41,38 +41,38 @@ class PairADP : public Pair { double memory_usage(); protected: - int nmax; // allocated size of per-atom arrays - double cutforcesq,cutmax; + int nmax; // allocated size of per-atom arrays + double cutforcesq, cutmax; // per-atom arrays - double *rho,*fp; + double *rho, *fp; double **mu, **lambda; // potentials as array data - int nrho,nr; - int nfrho,nrhor,nz2r; + int nrho, nr; + int nfrho, nrhor, nz2r; int nu2r, nw2r; - double **frho,**rhor,**z2r; + double **frho, **rhor, **z2r; double **u2r, **w2r; - int *type2frho,**type2rhor,**type2z2r; - int **type2u2r,**type2w2r; + int *type2frho, **type2rhor, **type2z2r; + int **type2u2r, **type2w2r; // potentials in spline form used for force computation - double dr,rdr,drho,rdrho; - double ***rhor_spline,***frho_spline,***z2r_spline; + double dr, rdr, drho, rdrho; + double ***rhor_spline, ***frho_spline, ***z2r_spline; double ***u2r_spline, ***w2r_spline; // potentials as file data struct Setfl { char **elements; - int nelements,nrho,nr; - double drho,dr,cut; + int nelements, nrho, nr; + double drho, dr, cut; double *mass; - double **frho,**rhor,***z2r; + double **frho, **rhor, ***z2r; double ***u2r, ***w2r; }; Setfl *setfl; @@ -85,7 +85,7 @@ class PairADP : public Pair { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index aafeffe253..3d77553143 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -20,9 +20,9 @@ PairStyle(airebo,PairAIREBO); #ifndef LMP_PAIR_AIREBO_H #define LMP_PAIR_AIREBO_H +#include "math_const.h" #include "pair.h" #include -#include "math_const.h" namespace LAMMPS_NS { @@ -37,63 +37,63 @@ class PairAIREBO : public Pair { double init_one(int, int); double memory_usage(); - enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code + enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code -protected: - int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type + protected: + int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type int variant; - int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included - int morseflag; // 1 if Morse instead of LJ for non-bonded + int ljflag, torflag; // 0/1 if LJ/Morse,torsion terms included + int morseflag; // 1 if Morse instead of LJ for non-bonded - double cutlj; // user-specified LJ cutoff - double sigcut,sigwid,sigmin; // corresponding cutoff function - double cutljrebosq; // cut for when to compute - // REBO neighs of ghost atoms + double cutlj; // user-specified LJ cutoff + double sigcut, sigwid, sigmin; // corresponding cutoff function + double cutljrebosq; // cut for when to compute + // REBO neighs of ghost atoms - double **cutljsq; // LJ cutoffs for C,H types - double **lj1,**lj2,**lj3,**lj4; // pre-computed LJ coeffs for C,H types - double cut3rebo; // maximum distance for 3rd REBO neigh + double **cutljsq; // LJ cutoffs for C,H types + double **lj1, **lj2, **lj3, **lj4; // pre-computed LJ coeffs for C,H types + double cut3rebo; // maximum distance for 3rd REBO neigh - int maxlocal; // size of numneigh, firstneigh arrays - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *REBO_numneigh; // # of pair neighbors for each atom - int **REBO_firstneigh; // ptr to 1st neighbor of each atom + int maxlocal; // size of numneigh, firstneigh arrays + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *REBO_numneigh; // # of pair neighbors for each atom + int **REBO_firstneigh; // ptr to 1st neighbor of each atom - double *closestdistsq; // closest owned atom dist to each ghost - double *nC,*nH; // sum of weighting fns with REBO neighs + double *closestdistsq; // closest owned atom dist to each ghost + double *nC, *nH; // sum of weighting fns with REBO neighs - double smin,Nmin,Nmax,NCmin,NCmax,thmin,thmax; - double rcmin[2][2],rcmax[2][2],rcmaxsq[2][2],rcmaxp[2][2]; - double Q[2][2],alpha[2][2],A[2][2],rho[2][2],BIJc[2][2][3],Beta[2][2][3]; - double rcLJmin[2][2],rcLJmax[2][2],rcLJmaxsq[2][2],bLJmin[2][2],bLJmax[2][2]; - double epsilon[2][2],sigma[2][2],epsilonT[2][2]; + double smin, Nmin, Nmax, NCmin, NCmax, thmin, thmax; + double rcmin[2][2], rcmax[2][2], rcmaxsq[2][2], rcmaxp[2][2]; + double Q[2][2], alpha[2][2], A[2][2], rho[2][2], BIJc[2][2][3], Beta[2][2][3]; + double rcLJmin[2][2], rcLJmax[2][2], rcLJmaxsq[2][2], bLJmin[2][2], bLJmax[2][2]; + double epsilon[2][2], sigma[2][2], epsilonT[2][2]; // parameters for Morse variant - double epsilonM[2][2],alphaM[2][2],reqM[2][2]; + double epsilonM[2][2], alphaM[2][2], reqM[2][2]; // spline coefficients - double gCdom[5],gC1[4][6],gC2[4][6],gHdom[4],gH[3][6]; - double pCCdom[2][2],pCHdom[2][2],pCC[4][4][16],pCH[4][4][16]; - double piCCdom[3][2],piCHdom[3][2],piHHdom[3][2]; - double piCC[4][4][9][64],piCH[4][4][9][64],piHH[4][4][9][64]; - double Tijdom[3][2],Tijc[4][4][9][64]; + double gCdom[5], gC1[4][6], gC2[4][6], gHdom[4], gH[3][6]; + double pCCdom[2][2], pCHdom[2][2], pCC[4][4][16], pCH[4][4][16]; + double piCCdom[3][2], piCHdom[3][2], piHHdom[3][2]; + double piCC[4][4][9][64], piCH[4][4][9][64], piHH[4][4][9][64]; + double Tijdom[3][2], Tijc[4][4][9][64]; // spline knot values - double PCCf[5][5],PCCdfdx[5][5],PCCdfdy[5][5],PCHf[5][5]; - double PCHdfdx[5][5],PCHdfdy[5][5]; - double piCCf[5][5][11],piCCdfdx[5][5][11]; - double piCCdfdy[5][5][11],piCCdfdz[5][5][11]; - double piCHf[5][5][11],piCHdfdx[5][5][11]; - double piCHdfdy[5][5][11],piCHdfdz[5][5][11]; - double piHHf[5][5][11],piHHdfdx[5][5][11]; - double piHHdfdy[5][5][11],piHHdfdz[5][5][11]; - double Tf[5][5][10],Tdfdx[5][5][10],Tdfdy[5][5][10],Tdfdz[5][5][10]; + double PCCf[5][5], PCCdfdx[5][5], PCCdfdy[5][5], PCHf[5][5]; + double PCHdfdx[5][5], PCHdfdy[5][5]; + double piCCf[5][5][11], piCCdfdx[5][5][11]; + double piCCdfdy[5][5][11], piCCdfdz[5][5][11]; + double piCHf[5][5][11], piCHdfdx[5][5][11]; + double piCHdfdy[5][5][11], piCHdfdz[5][5][11]; + double piHHf[5][5][11], piHHdfdx[5][5][11]; + double piHHdfdy[5][5][11], piHHdfdz[5][5][11]; + double Tf[5][5][10], Tdfdx[5][5][10], Tdfdy[5][5][10], Tdfdz[5][5][10]; void REBO_neigh(); void FREBO(int, int); @@ -101,8 +101,7 @@ protected: void TORSION(int, int); double bondorder(int, int, double *, double, double, double **, int); - double bondorderLJ(int, int, double *, double, double, - double *, double, double **, int); + double bondorderLJ(int, int, double *, double, double, double *, double, double **, int); double gSpline(double, double, int, double *, double *); double PijSpline(double, double, int, int, double *); @@ -115,11 +114,11 @@ protected: double Spbicubic(double, double, double *, double *); double Sptricubic(double, double, double, double *, double *); void Sptricubic_patch_adjust(double *, double, double, char); - void Sptricubic_patch_coeffs(double, double, double, double, double, double, - double*, double*, double*, double*, double*); + void Sptricubic_patch_coeffs(double, double, double, double, double, double, double *, double *, + double *, double *, double *); void Spbicubic_patch_adjust(double *, double, double, char); - void Spbicubic_patch_coeffs(double, double, double, double, double *, - double *, double *, double *); + void Spbicubic_patch_coeffs(double, double, double, double, double *, double *, double *, + double *); virtual void spline_init(); void allocate(); @@ -135,10 +134,11 @@ protected: no side effects ------------------------------------------------------------------------- */ - inline double Sp(double Xij, double Xmin, double Xmax, double &dX) const { + inline double Sp(double Xij, double Xmin, double Xmax, double &dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; dX = 0.0; @@ -146,8 +146,8 @@ protected: cutoff = 0.0; dX = 0.0; } else { - cutoff = 0.5 * (1.0+cos(t*MathConst::MY_PI)); - dX = (-0.5*MathConst::MY_PI*sin(t*MathConst::MY_PI)) / (Xmax-Xmin); + cutoff = 0.5 * (1.0 + cos(t * MathConst::MY_PI)); + dX = (-0.5 * MathConst::MY_PI * sin(t * MathConst::MY_PI)) / (Xmax - Xmin); } return cutoff; }; @@ -158,10 +158,11 @@ protected: no side effects ------------------------------------------------------------------------- */ - inline double Sp2(double Xij, double Xmin, double Xmax, double &dX) const { + inline double Sp2(double Xij, double Xmin, double Xmax, double &dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; dX = 0.0; @@ -169,21 +170,18 @@ protected: cutoff = 0.0; dX = 0.0; } else { - cutoff = (1.0-(t*t*(3.0-2.0*t))); - dX = 6.0*(t*t-t) / (Xmax-Xmin); + cutoff = (1.0 - (t * t * (3.0 - 2.0 * t))); + dX = 6.0 * (t * t - t) / (Xmax - Xmin); } return cutoff; }; /* kronecker delta function returning a double */ - inline double kronecker(const int a, const int b) const { - return (a == b) ? 1.0 : 0.0; - }; - + inline double kronecker(const int a, const int b) const { return (a == b) ? 1.0 : 0.0; }; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_airebo_morse.h b/src/MANYBODY/pair_airebo_morse.h index 408f4a98c1..d5044d3672 100644 --- a/src/MANYBODY/pair_airebo_morse.h +++ b/src/MANYBODY/pair_airebo_morse.h @@ -30,7 +30,7 @@ class PairAIREBOMorse : public PairAIREBO { void settings(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_atm.h b/src/MANYBODY/pair_atm.h index 8141797489..1957842808 100644 --- a/src/MANYBODY/pair_atm.h +++ b/src/MANYBODY/pair_atm.h @@ -39,15 +39,15 @@ class PairATM : public Pair { void read_restart_settings(FILE *); protected: - double cut_global,cut_triple; + double cut_global, cut_triple; double ***nu; void allocate(); - void interaction_ddd(double, double, double, double, double, double *, - double *, double *, double *, double *, int, double &); + void interaction_ddd(double, double, double, double, double, double *, double *, double *, + double *, double *, int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_bop.h b/src/MANYBODY/pair_bop.h index 7ab73a0d20..f5cff9a050 100644 --- a/src/MANYBODY/pair_bop.h +++ b/src/MANYBODY/pair_bop.h @@ -28,7 +28,7 @@ PairStyle(bop,PairBOP); #include "pair.h" namespace LAMMPS_NS { - class TabularFunction; +class TabularFunction; class PairBOP : public Pair { @@ -43,7 +43,6 @@ class PairBOP : public Pair { double memory_usage(); private: - struct PairParameters { double cutB, cutBsq, cutL, cutLsq; TabularFunction *betaS; @@ -106,13 +105,13 @@ class PairBOP : public Pair { double *sigma_f, *sigma_k, *small3; double *pro_delta, *pro; - int bop_types; // number of elments in potential file - int npairs; // number of element pairs - int ntriples; // number of all triples - char **bop_elements; // names of elements in potential file + int bop_types; // number of elments in potential file + int npairs; // number of element pairs + int ntriples; // number of all triples + char **bop_elements; // names of elements in potential file double bytes; - int otfly; // = 1 faster, more memory, = 0 slower, less memory + int otfly; // = 1 faster, more memory, = 0 slower, less memory PairList1 *pairlist1; PairList2 *pairlist2; diff --git a/src/MANYBODY/pair_comb.h b/src/MANYBODY/pair_comb.h index a639e9e1ab..7bb486362f 100644 --- a/src/MANYBODY/pair_comb.h +++ b/src/MANYBODY/pair_comb.h @@ -42,28 +42,28 @@ class PairComb : public Pair { protected: struct Param { - double lam11,lam12,lam21,lam22; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga1,biga2,bigb1,bigb2; - double bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - double plp1,plp3,plp6,a123,aconf; - double rlm1,rlm2; - double romiga,romigb,romigc,romigd,addrep; - double QU1,QL1,DU1,DL1,Qo1,dQ1,aB1,bB1,nD1,bD1; - double QU2,QL2,DU2,DL2,Qo2,dQ2,aB2,bB2,nD2,bD2; - double chi,dj,dk,dl,dm,esm1,esm2,cmn1,cmn2,cml1,cml2; + double lam11, lam12, lam21, lam22; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga1, biga2, bigb1, bigb2; + double bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + double plp1, plp3, plp6, a123, aconf; + double rlm1, rlm2; + double romiga, romigb, romigc, romigd, addrep; + double QU1, QL1, DU1, DL1, Qo1, dQ1, aB1, bB1, nD1, bD1; + double QU2, QL2, DU2, DL2, Qo2, dQ2, aB2, bB2, nD2, bD2; + double chi, dj, dk, dl, dm, esm1, esm2, cmn1, cmn2, cml1, cml2; double coulcut, lcut, lcutsq, hfocor; - int ielement,jelement,kelement; + int ielement, jelement, kelement; int powermint; }; - double cutmax; // max cutoff for all elements + double cutmax; // max cutoff for all elements double precision; - Param *params; // parameter set for an I-J-K interaction + Param *params; // parameter set for an I-J-K interaction int nmax; double *qf; @@ -74,84 +74,78 @@ class PairComb : public Pair { int *NCo, cor_flag, cuo_flag, cuo_flag1, cuo_flag2; double **bbij; - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - int *sht_num,**sht_first; // short-range neighbor list - MyPage *ipage; // neighbor list pages + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + int *sht_num, **sht_first; // short-range neighbor list + MyPage *ipage; // neighbor list pages double cutmin; void allocate(); virtual void read_file(char *); void setup_params(); - virtual void repulsive(Param *, double, double &, int, - double &, double, double); + virtual void repulsive(Param *, double, double &, int, double &, double, double); double zeta(Param *, double, double, double *, double *); - void force_zeta(Param *, int, int, int, double, double, double, double, - double &, double &, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + void force_zeta(Param *, int, int, int, double, double, double, double, double &, double &, + double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); double elp(Param *, double, double, double *, double *); - void flp(Param *, double, double, double *, double *, double *, - double *, double *); + void flp(Param *, double, double, double *, double *, double *, double *, double *); double comb_fc(double, Param *); double comb_fc_d(double, Param *); double comb_fc2(double); double comb_fc2_d(double); double comb_fc3(double); double comb_fc3_d(double); - virtual double comb_fa(double, Param *, double,double); - virtual double comb_fa_d(double, Param *, double,double); + virtual double comb_fa(double, Param *, double, double); + virtual double comb_fa_d(double, Param *, double, double); double comb_bij(double, Param *); double comb_bij_d(double, Param *); - inline double comb_gijk(const double costheta, - const Param * const param) const { + inline double comb_gijk(const double costheta, const Param *const param) const + { const double comb_c = param->c * param->c; const double comb_d = param->d * param->d; const double hcth = param->h - costheta; - return param->gamma*(1.0 + comb_c/comb_d - comb_c / (comb_d + hcth*hcth)); + return param->gamma * (1.0 + comb_c / comb_d - comb_c / (comb_d + hcth * hcth)); } - inline double comb_gijk_d(const double costheta, - const Param * const param) const { + inline double comb_gijk_d(const double costheta, const Param *const param) const + { const double comb_c = param->c * param->c; const double comb_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * comb_c * hcth; - const double denominator = 1.0/(comb_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (comb_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } - void comb_zetaterm_d(double, double *, double, double *, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + void comb_zetaterm_d(double, double *, double, double *, double, double *, double *, double *, + Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); double self(Param *, double, double); void sm_table(); void potal_calc(double &, double &, double &); - void tri_point(double, int &, int &, int &, double &, double &, - double &, int &); - void direct(int,int,int,int,double,double,double,double,double,double, - double,double,double,double &,double &); - void field(Param *,double,double,double,double &,double &); + void tri_point(double, int &, int &, int &, double &, double &, double &, int &); + void direct(int, int, int, int, double, double, double, double, double, double, double, double, + double, double &, double &); + void field(Param *, double, double, double, double &, double &); double qfo_self(Param *, double, double); - void qfo_short(Param *, int, int, double, double, double, - double &, double &); - void qfo_direct (int, int, int, int, double, double, double, double, - double, double &); - void qfo_field(Param *, double,double ,double ,double &, double &); + void qfo_short(Param *, int, int, double, double, double, double &, double &); + void qfo_direct(int, int, int, int, double, double, double, double, double, double &); + void qfo_field(Param *, double, double, double, double &, double &); void qsolve(double *); void Over_cor(Param *, double, int, double &, double &); int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); void Short_neigh(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_comb3.h b/src/MANYBODY/pair_comb3.h index 581f3946bf..bd24227b31 100644 --- a/src/MANYBODY/pair_comb3.h +++ b/src/MANYBODY/pair_comb3.h @@ -40,20 +40,20 @@ class PairComb3 : public Pair { static constexpr int NPARAMS_PER_LINE = 74; protected: - // general potential parameters + // general potential parameters struct Param { - int ielement,jelement,kelement,powermint; - int ielementgp,jelementgp,kelementgp; //element group - int ang_flag,pcn_flag,rad_flag,tor_flag; //angle, coordination,radical, torsion flag - double lami,lambda,alfi,alpha1,alpha2,alpha3,beta; - double pcos6,pcos5,pcos4,pcos3,pcos2,pcos1,pcos0; - double gamma,powerm,powern,bigA,bigB1,bigB2,bigB3; - double bigd,bigr,cut,cutsq,c1,c2,c3,c4; - double p6p0,p6p1,p6p2,p6p3,p6p4,p6p5,p6p6; - double ptork1,ptork2; - double addrepr,addrep, vdwflag; - double QU,QL,DU,DL,Qo,dQ,aB,bB,nD,bD,qmin,qmax; - double chi,dj,dk,dl,dm,esm,cmn1,cmn2,pcmn1,pcmn2; + int ielement, jelement, kelement, powermint; + int ielementgp, jelementgp, kelementgp; //element group + int ang_flag, pcn_flag, rad_flag, tor_flag; //angle, coordination,radical, torsion flag + double lami, lambda, alfi, alpha1, alpha2, alpha3, beta; + double pcos6, pcos5, pcos4, pcos3, pcos2, pcos1, pcos0; + double gamma, powerm, powern, bigA, bigB1, bigB2, bigB3; + double bigd, bigr, cut, cutsq, c1, c2, c3, c4; + double p6p0, p6p1, p6p2, p6p3, p6p4, p6p5, p6p6; + double ptork1, ptork2; + double addrepr, addrep, vdwflag; + double QU, QL, DU, DL, Qo, dQ, aB, bB, nD, bD, qmin, qmax; + double chi, dj, dk, dl, dm, esm, cmn1, cmn2, pcmn1, pcmn2; double coulcut, lcut, lcutsq; double veps, vsig, pcna, pcnb, pcnc, pcnd, polz, curl, pcross; double paaa, pbbb; @@ -61,12 +61,12 @@ class PairComb3 : public Pair { }; // general setups - double PI,PI2,PI4,PIsq; // PIs - double cutmin; // min cutoff for all elements - double cutmax; // max cutoff for all elements - double precision; // tolerance for QEq convergence - Param *params; // parameter set for an I-J-K interaction - int debug_eng1, debug_eng2, debug_fq; // logic controlling debugging outputs + double PI, PI2, PI4, PIsq; // PIs + double cutmin; // min cutoff for all elements + double cutmax; // max cutoff for all elements + double precision; // tolerance for QEq convergence + Param *params; // parameter set for an I-J-K interaction + int debug_eng1, debug_eng2, debug_fq; // logic controlling debugging outputs int pack_flag; // Short range neighbor list @@ -77,7 +77,7 @@ class PairComb3 : public Pair { // loop up tables and flags int nmax, **intype; - int pol_flag, polar; + int pol_flag, polar; double *qf, **bbij, *charge, *NCo; double *esm, **fafb, **dfafb, **ddfafb, **phin, **dphin, **erpaw; double **vvdw, **vdvdw; @@ -87,21 +87,21 @@ class PairComb3 : public Pair { // additional carbon parameters int cflag; - int nsplpcn,nsplrad,nspltor; - int maxx,maxy,maxz,maxxc,maxyc,maxconj; + int nsplpcn, nsplrad, nspltor; + int maxx, maxy, maxz, maxxc, maxyc, maxconj; int maxxcn[4]; - double vmaxxcn[4],dvmaxxcn[4]; + double vmaxxcn[4], dvmaxxcn[4]; int ntab; - double iin2[16][2],iin3[64][3]; + double iin2[16][2], iin3[64][3]; double brad[4], btor[4], bbtor, ptorr; double fi_tor[3], fj_tor[3], fk_tor[3], fl_tor[3]; double radtmp, fi_rad[3], fj_rad[3], fk_rad[3]; - double ccutoff[6],ch_a[7]; + double ccutoff[6], ch_a[7]; //COMB3-v18 arrays for CHO - // We wanna dynamic arrays - // C angle arrays, size = ntab+1 + // We wanna dynamic arrays + // C angle arrays, size = ntab+1 double pang[20001]; double dpang[20001]; double ddpang[20001]; @@ -147,54 +147,42 @@ class PairComb3 : public Pair { double comb_fcsw(double); // short range terms - void attractive(Param *, Param *, Param *, double, double, double, double, - double, double, double, double *, double *, double *, - double *, double *, int, double); - virtual void comb_fa(double, Param *, Param *, double, double, - double &, double &); - virtual void repulsive(Param *, Param *,double, double &, int, - double &, double, double); + void attractive(Param *, Param *, Param *, double, double, double, double, double, double, double, + double *, double *, double *, double *, double *, int, double); + virtual void comb_fa(double, Param *, Param *, double, double, double &, double &); + virtual void repulsive(Param *, Param *, double, double &, int, double &, double, double); // bond order terms double comb_bij(double, Param *, double, int, double); double comb_gijk(double, Param *, double); void comb_gijk_d(double, Param *, double, double &, double &); double zeta(Param *, Param *, double, double, double *, double *, int, double); - void comb_bij_d(double, Param *, double, int, double &, - double &, double &, double &, double &, double &, double); - void coord(Param *, double, int, double &, double &, - double &, double &, double &, double); - void comb_zetaterm_d(double, double, double, double, double, - double *, double, double *, double, double *, double *, - double *, Param *, Param *, Param *, double); - void costheta_d(double *, double, double *, double, - double *, double *, double *); - void force_zeta(Param *, Param *, double, double, double, double &, - double &, double &, double &, double &, double &, double &, - double &, double &, double &, double &, double &, double &, - int, double &, double,double, int, int, int, - double , double , double); - void cntri_int(int, double, double, double, int, int, int, - double &, double &, double &, double &, Param *); + void comb_bij_d(double, Param *, double, int, double &, double &, double &, double &, double &, + double &, double); + void coord(Param *, double, int, double &, double &, double &, double &, double &, double); + void comb_zetaterm_d(double, double, double, double, double, double *, double, double *, double, + double *, double *, double *, Param *, Param *, Param *, double); + void costheta_d(double *, double, double *, double, double *, double *, double *); + void force_zeta(Param *, Param *, double, double, double, double &, double &, double &, double &, + double &, double &, double &, double &, double &, double &, double &, double &, + double &, int, double &, double, double, int, int, int, double, double, double); + void cntri_int(int, double, double, double, int, int, int, double &, double &, double &, double &, + Param *); // Legendre polynomials void selfp6p(Param *, Param *, double, double &, double &); - double ep6p(Param *, Param *, double, double, double *, double * ,double &); - void fp6p(Param *, Param *, double, double, double *, double *, double *, - double *, double *); + double ep6p(Param *, Param *, double, double, double *, double *, double &); + void fp6p(Param *, Param *, double, double, double *, double *, double *, double *, double *); // long range q-dependent terms double self(Param *, double); void tables(); void potal_calc(double &, double &, double &); - void tri_point(double, int &, int &, int &, double &, double &, - double &); - void vdwaals(int,int,int,int,double,double,double,double, - double &, double &); - void direct(Param *, Param *, int,int,int,double,double, - double,double,double,double, double,double,double &,double &, - int, int); - void field(Param *, Param *,double,double,double,double &,double &); + void tri_point(double, int &, int &, int &, double &, double &, double &); + void vdwaals(int, int, int, int, double, double, double, double, double &, double &); + void direct(Param *, Param *, int, int, int, double, double, double, double, double, double, + double, double, double &, double &, int, int); + void field(Param *, Param *, double, double, double, double &, double &); int heaviside(double); double switching(double); double switching_d(double); @@ -202,50 +190,43 @@ class PairComb3 : public Pair { // radical terms double rad_init(double, Param *, int, double &, double); - void rad_calc(double, Param *, Param *, double, double, int, - int, double, double); - void rad_int(int , double, double, double, int, int, int, - double &, double &, double &, double &); - void rad_forceik(Param *, double, double *, double, double); - void rad_force(Param *, double, double *, double); + void rad_calc(double, Param *, Param *, double, double, int, int, double, double); + void rad_int(int, double, double, double, int, int, int, double &, double &, double &, double &); + void rad_forceik(Param *, double, double *, double, double); + void rad_force(Param *, double, double *, double); // torsion terms - double bbtor1(int, Param *, Param *, double, double, double, - double *, double *, double *, double); //modified by TAO - void tor_calc(double, Param *, Param *, double, double, int, - int, double, double); - void tor_int(int , double, double, double, int, int, int, - double &, double &, double &, double &); - void tor_force(int, Param *, Param *, double, double, double, - double, double *, double *, double *); //modified by TAO + double bbtor1(int, Param *, Param *, double, double, double, double *, double *, double *, + double); //modified by TAO + void tor_calc(double, Param *, Param *, double, double, int, int, double, double); + void tor_int(int, double, double, double, int, int, int, double &, double &, double &, double &); + void tor_force(int, Param *, Param *, double, double, double, double, double *, double *, + double *); //modified by TAO // charge force terms double qfo_self(Param *, double); - void qfo_short(Param *, Param *, double, double, double, - double &, double &, int, int, int); - void qfo_direct(Param *, Param *, int, int, int, double, - double, double, double, double, double &, double &, - double, double, int, int); - void qfo_field(Param *, Param *,double,double ,double ,double &, double &); - void qfo_dipole(double, int, int, int, int, double, double *, double, - double, double, double &, double &, int, int); + void qfo_short(Param *, Param *, double, double, double, double &, double &, int, int, int); + void qfo_direct(Param *, Param *, int, int, int, double, double, double, double, double, double &, + double &, double, double, int, int); + void qfo_field(Param *, Param *, double, double, double, double &, double &); + void qfo_dipole(double, int, int, int, int, double, double *, double, double, double, double &, + double &, int, int); void qsolve(double *); // dipole - polarization terms double dipole_self(Param *, int); - void dipole_init(Param *, Param *, double, double *, double, - int, int, int, double, double, double, double, double, int , int); - void dipole_calc(Param *, Param *, double, double, double, double, double, - int, int, int, double, double, double, double, double, int , int, - double &, double &, double *); + void dipole_init(Param *, Param *, double, double *, double, int, int, int, double, double, + double, double, double, int, int); + void dipole_calc(Param *, Param *, double, double, double, double, double, int, int, int, double, + double, double, double, double, int, int, double &, double &, double *); // communication functions int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); - }; -} + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam.h b/src/MANYBODY/pair_eam.h index d38aba85c5..d67322dc98 100644 --- a/src/MANYBODY/pair_eam.h +++ b/src/MANYBODY/pair_eam.h @@ -24,10 +24,9 @@ PairStyle(eam,PairEAM); namespace LAMMPS_NS { - class PairEAM : public Pair { public: - friend class FixSemiGrandCanonicalMC; // Alex Stukowski option + friend class FixSemiGrandCanonicalMC; // Alex Stukowski option // public variables so USER-ATC package can access them @@ -35,15 +34,15 @@ class PairEAM : public Pair { // potentials as array data - int nrho,nr; - int nfrho,nrhor,nz2r; - double **frho,**rhor,**z2r; - int *type2frho,**type2rhor,**type2z2r; + int nrho, nr; + int nfrho, nrhor, nz2r; + double **frho, **rhor, **z2r; + int *type2frho, **type2rhor, **type2z2r; // potentials in spline form used for force computation - double dr,rdr,drho,rdrho,rhomax,rhomin; - double ***rhor_spline,***frho_spline,***z2r_spline; + double dr, rdr, drho, rdrho, rhomax, rhomin; + double ***rhor_spline, ***frho_spline, ***z2r_spline; PairEAM(class LAMMPS *); virtual ~PairEAM(); @@ -63,42 +62,42 @@ class PairEAM : public Pair { void swap_eam(double *, double **); protected: - int nmax; // allocated size of per-atom arrays + int nmax; // allocated size of per-atom arrays double cutforcesq; double **scale; - bigint embedstep; // timestep, the embedding term was computed + bigint embedstep; // timestep, the embedding term was computed // per-atom arrays - double *rho,*fp; + double *rho, *fp; int *numforce; // potentials as file data struct Funcfl { char *file; - int nrho,nr; - double drho,dr,cut,mass; - double *frho,*rhor,*zr; + int nrho, nr; + double drho, dr, cut, mass; + double *frho, *rhor, *zr; }; Funcfl *funcfl; int nfuncfl; struct Setfl { char **elements; - int nelements,nrho,nr; - double drho,dr,cut; + int nelements, nrho, nr; + double drho, dr, cut; double *mass; - double **frho,**rhor,***z2r; + double **frho, **rhor, ***z2r; }; Setfl *setfl; struct Fs { char **elements; - int nelements,nrho,nr; - double drho,dr,cut; + int nelements, nrho, nr; + double drho, dr, cut; double *mass; - double **frho,***rhor,***z2r; + double **frho, ***rhor, ***z2r; }; Fs *fs; @@ -110,7 +109,7 @@ class PairEAM : public Pair { virtual void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_alloy.h b/src/MANYBODY/pair_eam_alloy.h index bb271972fb..e68570ad61 100644 --- a/src/MANYBODY/pair_eam_alloy.h +++ b/src/MANYBODY/pair_eam_alloy.h @@ -37,7 +37,7 @@ class PairEAMAlloy : virtual public PairEAM { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_cd.h b/src/MANYBODY/pair_eam_cd.h index 1d99641a48..7691cc4282 100644 --- a/src/MANYBODY/pair_eam_cd.h +++ b/src/MANYBODY/pair_eam_cd.h @@ -25,11 +25,10 @@ PairStyle(eam/cd/old,PairEAMCD_TwoSite); namespace LAMMPS_NS { -class PairEAMCD : public PairEAMAlloy -{ -public: +class PairEAMCD : public PairEAMAlloy { + public: /// Constructor. - PairEAMCD(class LAMMPS*, int cdeamVersion); + PairEAMCD(class LAMMPS *, int cdeamVersion); /// Destructor. virtual ~PairEAMCD(); @@ -52,26 +51,24 @@ public: void *extract(const char *, int &) { return nullptr; } /// Parses the coefficients of the h polynomial from the end of the EAM file. - void read_h_coeff(char* filename); + void read_h_coeff(char *filename); public: // The public interface exposed by this potential class. // Evaluates the h(x) polynomial for a given local concentration x. - inline double evalH(double x) const { + inline double evalH(double x) const + { double v = 0.0; - for (int i = nhcoeff-1; i >= 1; i--) { - v = (v + hcoeff[i]) * x; - } + for (int i = nhcoeff - 1; i >= 1; i--) { v = (v + hcoeff[i]) * x; } return v + hcoeff[0]; }; // Calculates the derivative of the h(x) polynomial. - inline double evalHprime(double x) const { + inline double evalHprime(double x) const + { double v = 0.0; - for (int i = nhcoeff-1; i >= 2; i--) { - v = (v + (double)i * hcoeff[i]) * x; - } + for (int i = nhcoeff - 1; i >= 2; i--) { v = (v + (double) i * hcoeff[i]) * x; } return v + hcoeff[1]; }; @@ -107,7 +104,6 @@ public: int speciesB; protected: - // Evaluation functions: // This structure specifies an entry in one of the EAM spline tables @@ -118,81 +114,93 @@ public: } EAMTableIndex; // Converts a radius value to an index value to be used in a spline table lookup. - inline EAMTableIndex radiusToTableIndex(double r) const { + inline EAMTableIndex radiusToTableIndex(double r) const + { EAMTableIndex index; - index.p = r*rdr + 1.0; + index.p = r * rdr + 1.0; index.m = static_cast(index.p); - index.m = index.m <= (nr-1) ? index.m : (nr-1); + index.m = index.m <= (nr - 1) ? index.m : (nr - 1); index.p -= index.m; index.p = index.p <= 1.0 ? index.p : 1.0; return index; }; // Converts a density value to an index value to be used in a spline table lookup. - inline EAMTableIndex rhoToTableIndex(double rho) const { + inline EAMTableIndex rhoToTableIndex(double rho) const + { EAMTableIndex index; - index.p = rho*rdrho + 1.0; + index.p = rho * rdrho + 1.0; index.m = static_cast(index.p); - index.m = index.m <= (nrho-1) ? index.m : (nrho-1); + index.m = index.m <= (nrho - 1) ? index.m : (nrho - 1); index.p -= index.m; index.p = index.p <= 1.0 ? index.p : 1.0; return index; }; // Computes the derivative of rho(r) - inline double RhoPrimeOfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; - return (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; + inline double RhoPrimeOfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; + return (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; }; // Computes rho(r) - inline double RhoOfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; - return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + inline double RhoOfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = rhor_spline[type2rhor[itype][jtype]][index.m]; + return ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; }; // Computes the derivative of F(rho) - inline double FPrimeOfRho(const EAMTableIndex& index, int itype) const { - const double* coeff = frho_spline[type2frho[itype]][index.m]; - return (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; + inline double FPrimeOfRho(const EAMTableIndex &index, int itype) const + { + const double *coeff = frho_spline[type2frho[itype]][index.m]; + return (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; }; // Computes F(rho) - inline double FofRho(const EAMTableIndex& index, int itype) const { - const double* coeff = frho_spline[type2frho[itype]][index.m]; - return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + inline double FofRho(const EAMTableIndex &index, int itype) const + { + const double *coeff = frho_spline[type2frho[itype]][index.m]; + return ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; }; // Computes the derivative of z2(r) - inline double Z2PrimeOfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - return (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; + inline double Z2PrimeOfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + return (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; }; // Computes z2(r) - inline double Z2OfR(const EAMTableIndex& index, int itype, int jtype) const { - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + inline double Z2OfR(const EAMTableIndex &index, int itype, int jtype) const + { + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + return ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; }; // Computes pair potential V_ij(r). - inline double PhiOfR(const EAMTableIndex& index, int itype, int jtype, const double oneOverR) const { + inline double PhiOfR(const EAMTableIndex &index, int itype, int jtype, + const double oneOverR) const + { // phi = pair potential energy // z2 = phi * r - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - const double z2 = ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + const double z2 = ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; return z2 * oneOverR; }; // Computes pair potential V_ij(r) and its derivative. - inline double PhiOfR(const EAMTableIndex& index, int itype, int jtype, const double oneOverR, double& phid) const { + inline double PhiOfR(const EAMTableIndex &index, int itype, int jtype, const double oneOverR, + double &phid) const + { // phi = pair potential energy // phip = phi' // z2 = phi * r // z2p = (phi * r)' = (phi' r) + phi - const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; - const double z2p = (coeff[0]*index.p + coeff[1])*index.p + coeff[2]; - const double z2 = ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6]; + const double *coeff = z2r_spline[type2z2r[itype][jtype]][index.m]; + const double z2p = (coeff[0] * index.p + coeff[1]) * index.p + coeff[2]; + const double z2 = ((coeff[3] * index.p + coeff[4]) * index.p + coeff[5]) * index.p + coeff[6]; const double phi = z2 * oneOverR; phid = z2p * oneOverR - phi * oneOverR; return phi; @@ -201,7 +209,7 @@ public: // Parameters // h() polynomial function coefficients - double* hcoeff; + double *hcoeff; // The number of coefficients in the polynomial. int nhcoeff; @@ -211,22 +219,20 @@ public: }; /// The one-site concentration formulation of CD-EAM. - class PairEAMCD_OneSite : public PairEAMCD - { - public: - /// Constructor. - PairEAMCD_OneSite(class LAMMPS* lmp) : PairEAM(lmp), PairEAMCD(lmp, 1) {} - }; +class PairEAMCD_OneSite : public PairEAMCD { + public: + /// Constructor. + PairEAMCD_OneSite(class LAMMPS *lmp) : PairEAM(lmp), PairEAMCD(lmp, 1) {} +}; - /// The two-site concentration formulation of CD-EAM. - class PairEAMCD_TwoSite : public PairEAMCD - { - public: - /// Constructor. - PairEAMCD_TwoSite(class LAMMPS* lmp) : PairEAM(lmp), PairEAMCD(lmp, 2) {} - }; +/// The two-site concentration formulation of CD-EAM. +class PairEAMCD_TwoSite : public PairEAMCD { + public: + /// Constructor. + PairEAMCD_TwoSite(class LAMMPS *lmp) : PairEAM(lmp), PairEAMCD(lmp, 2) {} +}; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_fs.h b/src/MANYBODY/pair_eam_fs.h index 3494eaa1b1..894893d55c 100644 --- a/src/MANYBODY/pair_eam_fs.h +++ b/src/MANYBODY/pair_eam_fs.h @@ -38,7 +38,7 @@ class PairEAMFS : virtual public PairEAM { int he_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eam_he.h b/src/MANYBODY/pair_eam_he.h index 7a18a65ea7..188d48a38f 100644 --- a/src/MANYBODY/pair_eam_he.h +++ b/src/MANYBODY/pair_eam_he.h @@ -33,7 +33,7 @@ class PairEAMHE : public PairEAMFS { void compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_eim.h b/src/MANYBODY/pair_eim.h index af13fff74c..922aa12b7d 100644 --- a/src/MANYBODY/pair_eim.h +++ b/src/MANYBODY/pair_eim.h @@ -44,22 +44,21 @@ class PairEIM : public Pair { double memory_usage(); struct Setfl { - double division,rbig,rsmall; + double division, rbig, rsmall; int nr; - int *ielement,*tp; - double *mass,*negativity,*ra,*ri,*Ec,*q0; - double *rcutphiA,*rcutphiR,*Eb,*r0,*alpha,*beta, - *rcutq,*Asigma,*rq,*rcutsigma,*Ac,*zeta, - *rs; - double dr,cut; - double ***Fij,***Gij,***phiij; + int *ielement, *tp; + double *mass, *negativity, *ra, *ri, *Ec, *q0; + double *rcutphiA, *rcutphiR, *Eb, *r0, *alpha, *beta, *rcutq, *Asigma, *rq, *rcutsigma, *Ac, + *zeta, *rs; + double dr, cut; + double ***Fij, ***Gij, ***phiij; double **cuts; }; protected: - double **cutforcesq,cutmax; + double **cutforcesq, cutmax; int nmax; - double *rho,*fp; + double *rho, *fp; int rhofp; Setfl *setfl; @@ -67,15 +66,15 @@ class PairEIM : public Pair { // potentials as array data int nr; - int nFij,nGij,nphiij; - double **Fij,**Gij,**phiij; - int **type2Fij,**type2Gij,**type2phiij; + int nFij, nGij, nphiij; + double **Fij, **Gij, **phiij; + int **type2Fij, **type2Gij, **type2phiij; // potentials in spline form used for force computation - double dr,rdr; - double *negativity,*q0; - double ***Fij_spline,***Gij_spline,***phiij_spline; + double dr, rdr; + double *negativity, *q0; + double ***Fij_spline, ***Gij_spline, ***phiij_spline; void allocate(); void array2spline(); @@ -99,19 +98,17 @@ class EIMPotentialFileReader : protected Pointers { void parse(FILE *fp); char *next_line(FILE *fp); - std::pair get_pair(const std::string &a, - const std::string &b); + std::pair get_pair(const std::string &a, const std::string &b); -public: - EIMPotentialFileReader(class LAMMPS* lmp, const std::string &filename, - const int auto_convert=0); + public: + EIMPotentialFileReader(class LAMMPS *lmp, const std::string &filename, + const int auto_convert = 0); void get_global(PairEIM::Setfl *setfl); void get_element(PairEIM::Setfl *setfl, int i, const std::string &name); - void get_pair(PairEIM::Setfl *setfl, int ij, - const std::string &elemA, const std::string &elemB); + void get_pair(PairEIM::Setfl *setfl, int ij, const std::string &elemA, const std::string &elemB); -private: + private: // potential parameters double division; double rbig; @@ -145,10 +142,10 @@ private: }; std::map elements; - std::map, PairData> pairs; + std::map, PairData> pairs; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_gw.h b/src/MANYBODY/pair_gw.h index bca785b230..00f89ba1a6 100644 --- a/src/MANYBODY/pair_gw.h +++ b/src/MANYBODY/pair_gw.h @@ -38,31 +38,30 @@ class PairGW : public Pair { protected: struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + int ielement, jelement, kelement; int powermint; - double Z_i,Z_j; - double ZBLcut,ZBLexpscale; + double Z_i, Z_j; + double ZBLcut, ZBLexpscale; }; - Param *params; // parameter set for an I-J-K interaction - double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements - int **pages; // neighbor list pages - int maxlocal; // size of numneigh, firstneigh arrays - int maxpage; // # of pages currently allocated - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom + int **pages; // neighbor list pages + int maxlocal; // size of numneigh, firstneigh arrays + int maxpage; // # of pages currently allocated + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom - - int *GW_numneigh; // # of pair neighbors for each atom - int **GW_firstneigh; // ptr to 1st neighbor of each atom + int *GW_numneigh; // # of pair neighbors for each atom + int **GW_firstneigh; // ptr to 1st neighbor of each atom void GW_neigh(); void add_pages(int howmany = 1); @@ -72,10 +71,9 @@ class PairGW : public Pair { void setup_params(); virtual void repulsive(Param *, double, double &, int, double &); double zeta(Param *, double, double, double *, double *); - virtual void force_zeta(Param *, double, double, double &, - double &, int, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + virtual void force_zeta(Param *, double, double, double &, double &, int, double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); double gw_fc(double, Param *); double gw_fc_d(double, Param *); @@ -84,36 +82,35 @@ class PairGW : public Pair { double gw_bij(double, Param *); double gw_bij_d(double, Param *); - void gw_zetaterm_d(double, double *, double, double *, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + void gw_zetaterm_d(double, double *, double, double *, double, double *, double *, double *, + Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); // inlined functions for efficiency - inline double gw_gijk(const double costheta, - const Param * const param) const { + inline double gw_gijk(const double costheta, const Param *const param) const + { const double gw_c = param->c * param->c; const double gw_d = param->d * param->d; const double hcth = param->h - costheta; - //printf("gw_gijk: gw_c=%f gw_d=%f hcth=%f=%f-%f\n", gw_c, gw_d, hcth, param->h, costheta); + //printf("gw_gijk: gw_c=%f gw_d=%f hcth=%f=%f-%f\n", gw_c, gw_d, hcth, param->h, costheta); - return param->gamma*(1.0 + gw_c/gw_d - gw_c / (gw_d + hcth*hcth)); + return param->gamma * (1.0 + gw_c / gw_d - gw_c / (gw_d + hcth * hcth)); } - inline double gw_gijk_d(const double costheta, - const Param * const param) const { + inline double gw_gijk_d(const double costheta, const Param *const param) const + { const double gw_c = param->c * param->c; const double gw_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * gw_c * hcth; - const double denominator = 1.0/(gw_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (gw_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_gw_zbl.h b/src/MANYBODY/pair_gw_zbl.h index dd109bcfc7..6775eca1fb 100644 --- a/src/MANYBODY/pair_gw_zbl.h +++ b/src/MANYBODY/pair_gw_zbl.h @@ -32,9 +32,9 @@ class PairGWZBL : public PairGW { static constexpr int NPARAMS_PER_LINE = 21; private: - double global_a_0; // Bohr radius for Coulomb repulsion - double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion - double global_e; // proton charge (negative of electron charge) + double global_a_0; // Bohr radius for Coulomb repulsion + double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion + double global_e; // proton charge (negative of electron charge) void read_file(char *); void repulsive(Param *, double, double &, int, double &); @@ -46,7 +46,7 @@ class PairGWZBL : public PairGW { double F_fermi_d(double, Param *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index b9e760d9ce..fb6763b87d 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -20,9 +20,9 @@ PairStyle(lcbop,PairLCBOP); #ifndef LMP_PAIR_LCBOP_H #define LMP_PAIR_LCBOP_H +#include "math_const.h" #include "pair.h" #include -#include "math_const.h" namespace LAMMPS_NS { @@ -38,67 +38,55 @@ class PairLCBOP : public Pair { double memory_usage(); protected: - int **pages; // neighbor list pages + int **pages; // neighbor list pages - double cutLR; // LR cutoff + double cutLR; // LR cutoff - double cutLRsq; // LR cutoff squared - double cut3rebo; // maximum distance for 3rd SR neigh + double cutLRsq; // LR cutoff squared + double cut3rebo; // maximum distance for 3rd SR neigh - int maxlocal; // size of numneigh, firstneigh arrays - int maxpage; // # of pages currently allocated - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *SR_numneigh; // # of pair neighbors for each atom - int **SR_firstneigh; // ptr to 1st neighbor of each atom + int maxlocal; // size of numneigh, firstneigh arrays + int maxpage; // # of pages currently allocated + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *SR_numneigh; // # of pair neighbors for each atom + int **SR_firstneigh; // ptr to 1st neighbor of each atom - double *N; // sum of cutoff fns ( f_C ) with SR neighs - double *M; // sum_j f_C_ij*F(N_j - f_C_ij) + double *N; // sum of cutoff fns ( f_C ) with SR neighs + double *M; // sum_j f_C_ij*F(N_j - f_C_ij) - double - r_1, r_2, gamma_1, A, B_1, B_2, alpha, beta_1, beta_2, - d, C_1, C_4, C_6, L, kappa, R_0, R_1, - r_0, r_1_LR, r_2_LR, - v_1, v_2, eps_1, eps_2, lambda_1, lambda_2, eps, delta; + double r_1, r_2, gamma_1, A, B_1, B_2, alpha, beta_1, beta_2, d, C_1, C_4, C_6, L, kappa, R_0, + R_1, r_0, r_1_LR, r_2_LR, v_1, v_2, eps_1, eps_2, lambda_1, lambda_2, eps, delta; double r_2_sq; // splines coefficients struct TF_conj_field { - double - f_00, - f_01, - f_10, - f_11, - f_x_00, - f_x_01, - f_x_10, - f_x_11, - f_y_00, - f_y_01, - f_y_10, - f_y_11; + double f_00, f_01, f_10, f_11, f_x_00, f_x_01, f_x_10, f_x_11, f_y_00, f_y_01, f_y_10, f_y_11; } F_conj_field[3][3][2]; - double F_conj_data[4][4][2][3]; // temporary data from file - double gX[6]; // x coordinates for described points[# of points]; - double gC[5+1][6-1]; // coefficients for each period between described points [degree of polynomial+1][# of points-1] + double F_conj_data[4][4][2][3]; // temporary data from file + double gX[6]; // x coordinates for described points[# of points]; + double gC + [5 + 1] + [6 - + 1]; // coefficients for each period between described points [degree of polynomial+1][# of points-1] void SR_neigh(); void FSR(int, int); void FLR(int, int); - void FNij( int, int, double, double**, int ); - void FMij( int, int, double, double**, int ); - double bondorder( int, int, double*, double, double, double**, int ); - double b ( int, int, double*, double, double, double**, int ); + void FNij(int, int, double, double **, int); + void FMij(int, int, double, double **, int); + double bondorder(int, int, double *, double, double, double **, int); + double b(int, int, double *, double, double, double **, int); - double gSpline( double, double* ); - double hSpline( double, double* ); - void g_decompose_x( double, size_t*, double* ); - double F_conj( double, double, double, double*, double*, double* ); + double gSpline(double, double *); + double hSpline(double, double *); + void g_decompose_x(double, size_t *, double *); + double F_conj(double, double, double, double *, double *, double *); - void read_file( char * ); + void read_file(char *); void spline_init(); @@ -115,10 +103,11 @@ class PairLCBOP : public Pair { no side effects ------------------------------------------------------------------------- */ - inline double f_c(double Xij, double Xmin, double Xmax, double *dX) const { + inline double f_c(double Xij, double Xmin, double Xmax, double *dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; *dX = 0.0; @@ -126,9 +115,9 @@ class PairLCBOP : public Pair { cutoff = 0.0; *dX = 0.0; } else { - double z = t*t*t-1; - cutoff = exp( gamma_1*t*t*t/z ); - *dX = cutoff * (-3*gamma_1*t*t)/z/z / (Xmax-Xmin); + double z = t * t * t - 1; + cutoff = exp(gamma_1 * t * t * t / z); + *dX = cutoff * (-3 * gamma_1 * t * t) / z / z / (Xmax - Xmin); } return cutoff; }; @@ -139,10 +128,11 @@ class PairLCBOP : public Pair { no side effects ------------------------------------------------------------------------- */ - inline double f_c_LR(double Xij, double Xmin, double Xmax, double *dX) const { + inline double f_c_LR(double Xij, double Xmin, double Xmax, double *dX) const + { double cutoff; - double t = (Xij-Xmin) / (Xmax-Xmin); + double t = (Xij - Xmin) / (Xmax - Xmin); if (t <= 0.0) { cutoff = 1.0; //dX = 0.0; this way the derivative is inherited from previous cut off function call @@ -150,15 +140,14 @@ class PairLCBOP : public Pair { cutoff = 0.0; *dX = 0.0; } else { - cutoff = ( 1.0+cos(MathConst::MY_PI*t) )/2.0; - *dX = -MathConst::MY_PI*sin(MathConst::MY_PI*t)/2/(Xmax-Xmin); + cutoff = (1.0 + cos(MathConst::MY_PI * t)) / 2.0; + *dX = -MathConst::MY_PI * sin(MathConst::MY_PI * t) / 2 / (Xmax - Xmin); } return cutoff; }; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_nb3b_harmonic.h b/src/MANYBODY/pair_nb3b_harmonic.h index 70e317115d..c0b8dca9dc 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.h +++ b/src/MANYBODY/pair_nb3b_harmonic.h @@ -39,22 +39,22 @@ class PairNb3bHarmonic : public Pair { protected: struct Param { double k_theta, theta0, cutoff; - double cut,cutsq; - int ielement,jelement,kelement; + double cut, cutsq; + int ielement, jelement, kelement; }; - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); void read_file(char *); void setup_params(); void twobody(Param *, double, double &, int, double &); - void threebody(Param *, Param *, Param *, double, double, double *, double *, - double *, double *, int, double &); + void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, + int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_polymorphic.h b/src/MANYBODY/pair_polymorphic.h index a60a002981..f492ac4b94 100644 --- a/src/MANYBODY/pair_polymorphic.h +++ b/src/MANYBODY/pair_polymorphic.h @@ -23,12 +23,11 @@ PairStyle(polymorphic,PairPolymorphic); #include "pair.h" namespace LAMMPS_NS { - // forward declaration - class TabularFunction; +// forward declaration +class TabularFunction; class PairPolymorphic : public Pair { public: - PairPolymorphic(class LAMMPS *); virtual ~PairPolymorphic(); virtual void compute(int, int); @@ -38,7 +37,6 @@ class PairPolymorphic : public Pair { double init_one(int, int); protected: - struct PairParameters { double cut; double cutsq; @@ -60,21 +58,21 @@ class PairPolymorphic : public Pair { double epsilon; int eta; - int nx,nr,ng; // table sizes + int nx, nr, ng; // table sizes double maxX; // parameter sets - PairParameters * pairParameters; // for I-J interaction - TripletParameters * tripletParameters; // for I-J-K interaction + PairParameters *pairParameters; // for I-J interaction + TripletParameters *tripletParameters; // for I-J-K interaction - int neighsize,numneighV,numneighW,numneighW1; - int *firstneighV,*firstneighW,*firstneighW1; - double *delxV,*delyV,*delzV,*drV; - double *delxW,*delyW,*delzW,*drW; + int neighsize, numneighV, numneighW, numneighW1; + int *firstneighV, *firstneighW, *firstneighW1; + double *delxV, *delyV, *delzV, *drV; + double *delxW, *delyW, *delzW, *drW; - double cutmax; // max cutoff for all elements + double cutmax; // max cutoff for all elements double cutmaxsq; - int npair,ntriple; + int npair, ntriple; int *match; void allocate(); @@ -84,17 +82,14 @@ class PairPolymorphic : public Pair { #if defined(LMP_POLYMORPHIC_WRITE_TABLES) void write_tables(int); #endif - void attractive(PairParameters *, PairParameters *, TripletParameters *, - double, double, double, double *, double *, double *, - double *, double *); + void attractive(PairParameters *, PairParameters *, TripletParameters *, double, double, double, + double *, double *, double *, double *, double *); - void ters_zetaterm_d(double, double *, double, double *, double, double *, - double *, double *, PairParameters *, PairParameters *, - TripletParameters *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + void ters_zetaterm_d(double, double *, double, double *, double, double *, double *, double *, + PairParameters *, PairParameters *, TripletParameters *); + void costheta_d(double *, double, double *, double, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_rebo.h b/src/MANYBODY/pair_rebo.h index 89896a9a24..df15bff9bd 100644 --- a/src/MANYBODY/pair_rebo.h +++ b/src/MANYBODY/pair_rebo.h @@ -31,7 +31,7 @@ class PairREBO : public PairAIREBO { void spline_init(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_sw.h b/src/MANYBODY/pair_sw.h index cf3f9ae86a..259c059e26 100644 --- a/src/MANYBODY/pair_sw.h +++ b/src/MANYBODY/pair_sw.h @@ -37,32 +37,32 @@ class PairSW : public Pair { static constexpr int NPARAMS_PER_LINE = 14; struct Param { - double epsilon,sigma; - double littlea,lambda,gamma,costheta; - double biga,bigb; - double powerp,powerq; + double epsilon, sigma; + double littlea, lambda, gamma, costheta; + double biga, bigb; + double powerp, powerq; double tol; - double cut,cutsq; - double sigma_gamma,lambda_epsilon,lambda_epsilon2; - double c1,c2,c3,c4,c5,c6; - int ielement,jelement,kelement; + double cut, cutsq; + double sigma_gamma, lambda_epsilon, lambda_epsilon2; + double c1, c2, c3, c4, c5, c6; + int ielement, jelement, kelement; }; protected: - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction - int maxshort; // size of short neighbor list array - int *neighshort; // short neighbor list array + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + int maxshort; // size of short neighbor list array + int *neighshort; // short neighbor list array virtual void allocate(); void read_file(char *); virtual void setup_params(); void twobody(Param *, double, double &, int, double &); - void threebody(Param *, Param *, Param *, double, double, double *, double *, - double *, double *, int, double &); + void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, + int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff.h b/src/MANYBODY/pair_tersoff.h index 7244f7ed61..a49c2c3535 100644 --- a/src/MANYBODY/pair_tersoff.h +++ b/src/MANYBODY/pair_tersoff.h @@ -34,47 +34,44 @@ class PairTersoff : public Pair { virtual void init_style(); double init_one(int, int); - template - void eval(); + template void eval(); static constexpr int NPARAMS_PER_LINE = 17; protected: - struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + int ielement, jelement, kelement; int powermint; - double Z_i,Z_j; // added for TersoffZBL - double ZBLcut,ZBLexpscale; - double c5,ca1,ca4; // added for TersoffMOD + double Z_i, Z_j; // added for TersoffZBL + double ZBLcut, ZBLexpscale; + double c5, ca1, ca4; // added for TersoffMOD double powern_del; - double c0; // added for TersoffMODC + double c0; // added for TersoffMODC }; - Param *params; // parameter set for an I-J-K interaction - double cutmax; // max cutoff for all elements - int maxshort; // size of short neighbor list array - int *neighshort; // short neighbor list array + Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + int maxshort; // size of short neighbor list array + int *neighshort; // short neighbor list array - int shift_flag; // flag to turn on/off shift - double shift; // negative change in equilibrium bond length + int shift_flag; // flag to turn on/off shift + double shift; // negative change in equilibrium bond length virtual void allocate(); virtual void read_file(char *); virtual void setup_params(); virtual void repulsive(Param *, double, double &, int, double &); virtual double zeta(Param *, double, double, double *, double *); - virtual void force_zeta(Param *, double, double, double &, - double &, int, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + virtual void force_zeta(Param *, double, double, double &, double &, int, double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); virtual double ters_fc(double, Param *); virtual double ters_fc_d(double, Param *); @@ -83,35 +80,33 @@ class PairTersoff : public Pair { virtual double ters_bij(double, Param *); virtual double ters_bij_d(double, Param *); - virtual void ters_zetaterm_d(double, double *, double, double, - double *, double, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + virtual void ters_zetaterm_d(double, double *, double, double, double *, double, double, double *, + double *, double *, Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); // inlined functions for efficiency - inline double ters_gijk(const double costheta, - const Param * const param) const { + inline double ters_gijk(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; - return param->gamma*(1.0 + ters_c/ters_d - ters_c / (ters_d + hcth*hcth)); + return param->gamma * (1.0 + ters_c / ters_d - ters_c / (ters_d + hcth * hcth)); } - inline double ters_gijk_d(const double costheta, - const Param * const param) const { + inline double ters_gijk_d(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * ters_c * hcth; - const double denominator = 1.0/(ters_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (ters_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff_mod.h b/src/MANYBODY/pair_tersoff_mod.h index 56a5e95477..224b22852b 100644 --- a/src/MANYBODY/pair_tersoff_mod.h +++ b/src/MANYBODY/pair_tersoff_mod.h @@ -41,43 +41,42 @@ class PairTersoffMOD : public PairTersoff { double ters_fc_d(double, Param *); double ters_bij(double, Param *); double ters_bij_d(double, Param *); - void ters_zetaterm_d(double, double *, double, double, - double *, double, double, - double *, double *, double *, Param *); + void ters_zetaterm_d(double, double *, double, double, double *, double, double, double *, + double *, double *, Param *); // inlined functions for efficiency // these replace but do not override versions in PairTersoff // since overriding virtual inlined functions is best avoided - inline double ters_gijk_mod(const double costheta, - const Param * const param) const { + inline double ters_gijk_mod(const double costheta, const Param *const param) const + { const double ters_c1 = param->c1; const double ters_c2 = param->c2; const double ters_c3 = param->c3; const double ters_c4 = param->c4; const double ters_c5 = param->c5; - const double tmp_h = (param->h - costheta)*(param->h - costheta); + const double tmp_h = (param->h - costheta) * (param->h - costheta); - return ters_c1 + (ters_c2*tmp_h/(ters_c3 + tmp_h)) * - (1.0 + ters_c4*exp(-ters_c5*tmp_h)); + return ters_c1 + + (ters_c2 * tmp_h / (ters_c3 + tmp_h)) * (1.0 + ters_c4 * exp(-ters_c5 * tmp_h)); } - inline double ters_gijk_d_mod(const double costheta, - const Param * const param) const { + inline double ters_gijk_d_mod(const double costheta, const Param *const param) const + { const double ters_c2 = param->c2; const double ters_c3 = param->c3; const double ters_c4 = param->c4; const double ters_c5 = param->c5; - const double tmp_h = (param->h - costheta)*(param->h - costheta); - const double g1 = (param->h - costheta)/(ters_c3 + tmp_h); - const double g2 = exp(-ters_c5*tmp_h); + const double tmp_h = (param->h - costheta) * (param->h - costheta); + const double g1 = (param->h - costheta) / (ters_c3 + tmp_h); + const double g2 = exp(-ters_c5 * tmp_h); - return -2.0*ters_c2*g1*((1 + ters_c4*g2)*(1 + g1*(costheta - param->h)) - - tmp_h*ters_c4*ters_c5*g2); + return -2.0 * ters_c2 * g1 * + ((1 + ters_c4 * g2) * (1 + g1 * (costheta - param->h)) - tmp_h * ters_c4 * ters_c5 * g2); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff_mod_c.h b/src/MANYBODY/pair_tersoff_mod_c.h index 1bf5d64cbf..2a53a7a0d7 100644 --- a/src/MANYBODY/pair_tersoff_mod_c.h +++ b/src/MANYBODY/pair_tersoff_mod_c.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class PairTersoffMODC : public PairTersoffMOD { public: - PairTersoffMODC(class LAMMPS *lmp) : PairTersoffMOD(lmp) {}; + PairTersoffMODC(class LAMMPS *lmp) : PairTersoffMOD(lmp){}; ~PairTersoffMODC() {} static constexpr int NPARAMS_PER_LINE = 21; @@ -36,7 +36,7 @@ class PairTersoffMODC : public PairTersoffMOD { void repulsive(Param *, double, double &, int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_tersoff_zbl.h b/src/MANYBODY/pair_tersoff_zbl.h index d2f41e962f..66102bc4f8 100644 --- a/src/MANYBODY/pair_tersoff_zbl.h +++ b/src/MANYBODY/pair_tersoff_zbl.h @@ -32,9 +32,9 @@ class PairTersoffZBL : public PairTersoff { static constexpr int NPARAMS_PER_LINE = 21; protected: - double global_a_0; // Bohr radius for Coulomb repulsion - double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion - double global_e; // proton charge (negative of electron charge) + double global_a_0; // Bohr radius for Coulomb repulsion + double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion + double global_e; // proton charge (negative of electron charge) void read_file(char *); void repulsive(Param *, double, double &, int, double &); @@ -46,7 +46,7 @@ class PairTersoffZBL : public PairTersoff { double F_fermi_d(double, Param *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_vashishta.h b/src/MANYBODY/pair_vashishta.h index 99ffec4be4..dfae5118e0 100644 --- a/src/MANYBODY/pair_vashishta.h +++ b/src/MANYBODY/pair_vashishta.h @@ -37,31 +37,32 @@ class PairVashishta : public Pair { static constexpr int NPARAMS_PER_LINE = 17; struct Param { - double bigb,gamma,r0,bigc,costheta; - double bigh,eta,zi,zj; - double lambda1,bigd,mbigd,lambda4,bigw,cut; - double lam1inv,lam4inv,zizj,heta,big2b,big6w; - double rcinv,rc2inv,rc4inv,rc6inv,rceta; - double cutsq2,cutsq; - double lam1rc,lam4rc,vrcc2,vrcc3,vrc,dvrc,c0; - int ielement,jelement,kelement; + double bigb, gamma, r0, bigc, costheta; + double bigh, eta, zi, zj; + double lambda1, bigd, mbigd, lambda4, bigw, cut; + double lam1inv, lam4inv, zizj, heta, big2b, big6w; + double rcinv, rc2inv, rc4inv, rc6inv, rceta; + double cutsq2, cutsq; + double lam1rc, lam4rc, vrcc2, vrcc3, vrc, dvrc, c0; + int ielement, jelement, kelement; }; + protected: - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction - double r0max; // largest value of r0 - int maxshort; // size of short neighbor list array - int *neighshort; // short neighbor list array + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + double r0max; // largest value of r0 + int maxshort; // size of short neighbor list array + int *neighshort; // short neighbor list array void allocate(); void read_file(char *); virtual void setup_params(); void twobody(Param *, double, double &, int, double &); - void threebody(Param *, Param *, Param *, double, double, double *, double *, - double *, double *, int, double &); + void threebody(Param *, Param *, Param *, double, double, double *, double *, double *, double *, + int, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MANYBODY/pair_vashishta_table.h b/src/MANYBODY/pair_vashishta_table.h index 16e7de1704..8734f596fb 100644 --- a/src/MANYBODY/pair_vashishta_table.h +++ b/src/MANYBODY/pair_vashishta_table.h @@ -36,15 +36,15 @@ class PairVashishtaTable : public PairVashishta { int ntable; double deltaR2; double oneOverDeltaR2; - double ***forceTable; // table of forces per element pair - double ***potentialTable; // table of potential energies + double ***forceTable; // table of forces per element pair + double ***potentialTable; // table of potential energies void twobody_table(const Param &, double, double &, int, double &); void setup_params(); void create_tables(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_atom_swap.h b/src/MC/fix_atom_swap.h index 8617634c59..126ac9a4f9 100644 --- a/src/MC/fix_atom_swap.h +++ b/src/MC/fix_atom_swap.h @@ -47,21 +47,21 @@ class FixAtomSwap : public Fix { void restart(char *); private: - int nevery,seed; - int conserve_ke_flag; // yes = conserve ke, no = do not conserve ke - int semi_grand_flag; // yes = semi-grand canonical, no = constant composition + int nevery, seed; + int conserve_ke_flag; // yes = conserve ke, no = do not conserve ke + int semi_grand_flag; // yes = semi-grand canonical, no = constant composition int ncycles; - int niswap,njswap; // # of i,j swap atoms on all procs - int niswap_local,njswap_local; // # of swap atoms on this proc - int niswap_before,njswap_before; // # of swap atoms on procs < this proc - int nswap; // # of swap atoms on all procs - int nswap_local; // # of swap atoms on this proc - int nswap_before; // # of swap atoms on procs < this proc - int regionflag; // 0 = anywhere in box, 1 = specific region - int iregion; // swap region - char *idregion; // swap region id + int niswap, njswap; // # of i,j swap atoms on all procs + int niswap_local, njswap_local; // # of swap atoms on this proc + int niswap_before, njswap_before; // # of swap atoms on procs < this proc + int nswap; // # of swap atoms on all procs + int nswap_local; // # of swap atoms on this proc + int nswap_before; // # of swap atoms on procs < this proc + int regionflag; // 0 = anywhere in box, 1 = specific region + int iregion; // swap region + char *idregion; // swap region id - int nswaptypes,nmutypes; + int nswaptypes, nmutypes; int *type_list; double *mu; @@ -87,7 +87,7 @@ class FixAtomSwap : public Fix { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h index 4f08e4e240..f5685a25f4 100644 --- a/src/MC/fix_bond_break.h +++ b/src/MC/fix_bond_break.h @@ -31,7 +31,7 @@ class FixBondBreak : public Fix { int setmask(); void init(); void post_integrate(); - void post_integrate_respa(int,int); + void post_integrate_respa(int, int); int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); @@ -41,18 +41,18 @@ class FixBondBreak : public Fix { double memory_usage(); private: - int me,nprocs; - int btype,seed; - double cutoff,cutsq,fraction; - int angleflag,dihedralflag,improperflag; + int me, nprocs; + int btype, seed; + double cutoff, cutsq, fraction; + int angleflag, dihedralflag, improperflag; bigint lastcheck; - int breakcount,breakcounttotal; + int breakcount, breakcounttotal; int nmax; - tagint *partner,*finalpartner; - double *distsq,*probability; + tagint *partner, *finalpartner; + double *distsq, *probability; - int nbreak,maxbreak; + int nbreak, maxbreak; tagint **broken; tagint *copy; @@ -62,7 +62,7 @@ class FixBondBreak : public Fix { int commflag; int nbroken; - int nangles,ndihedrals,nimpropers; + int nangles, ndihedrals, nimpropers; void check_ghosts(); void update_topology(); @@ -78,7 +78,7 @@ class FixBondBreak : public Fix { void print_copy(const char *, tagint, int, int, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h index 0a459c8517..b3787da508 100644 --- a/src/MC/fix_bond_create.h +++ b/src/MC/fix_bond_create.h @@ -48,26 +48,26 @@ class FixBondCreate : public Fix { protected: int me; - int iatomtype,jatomtype; - int btype,seed; - int imaxbond,jmaxbond; - int inewtype,jnewtype; - int constrainflag,constrainpass; - double amin,amax; - double cutsq,fraction; - int atype,dtype,itype; - int angleflag,dihedralflag,improperflag; + int iatomtype, jatomtype; + int btype, seed; + int imaxbond, jmaxbond; + int inewtype, jnewtype; + int constrainflag, constrainpass; + double amin, amax; + double cutsq, fraction; + int atype, dtype, itype; + int angleflag, dihedralflag, improperflag; int overflow; tagint lastcheck; int *bondcount; - int createcount,createcounttotal; + int createcount, createcounttotal; int nmax; - tagint *partner,*finalpartner; - double *distsq,*probability; + tagint *partner, *finalpartner; + double *distsq, *probability; - int ncreate,maxcreate; + int ncreate, maxcreate; tagint **created; tagint *copy; @@ -75,9 +75,9 @@ class FixBondCreate : public Fix { class RanMars *random; class NeighList *list; - int countflag,commflag; + int countflag, commflag; int nlevels_respa; - int nangles,ndihedrals,nimpropers; + int nangles, ndihedrals, nimpropers; void check_ghosts(); void update_topology(); @@ -87,7 +87,7 @@ class FixBondCreate : public Fix { void create_impropers(int); int dedup(int, int, tagint *); - virtual int constrain(int, int, double, double) {return 1;} + virtual int constrain(int, int, double, double) { return 1; } // DEBUG @@ -95,7 +95,7 @@ class FixBondCreate : public Fix { void print_copy(const char *, tagint, int, int, int, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_create_angle.h b/src/MC/fix_bond_create_angle.h index f3de10b3ff..9c0d977af4 100644 --- a/src/MC/fix_bond_create_angle.h +++ b/src/MC/fix_bond_create_angle.h @@ -32,7 +32,7 @@ class FixBondCreateAngle : public FixBondCreate { int constrain(int, int, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_bond_swap.h b/src/MC/fix_bond_swap.h index 8843414e37..7c9495e378 100644 --- a/src/MC/fix_bond_swap.h +++ b/src/MC/fix_bond_swap.h @@ -37,10 +37,10 @@ class FixBondSwap : public Fix { double memory_usage(); private: - double fraction,cutsq; - int nmax,tflag; + double fraction, cutsq; + int nmax, tflag; int *alist; - int naccept,foursome; + int naccept, foursome; int angleflag; char *id_temp; int *type; @@ -56,7 +56,7 @@ class FixBondSwap : public Fix { double angle_eng(int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_charge_regulation.h b/src/MC/fix_charge_regulation.h index fcf9129ea3..5328961f43 100644 --- a/src/MC/fix_charge_regulation.h +++ b/src/MC/fix_charge_regulation.h @@ -28,79 +28,84 @@ FixStyle(charge/regulation,FixChargeRegulation); namespace LAMMPS_NS { - class FixChargeRegulation : public Fix { - public: - FixChargeRegulation(class LAMMPS *, int, char **); - ~FixChargeRegulation(); - int setmask(); - void init(); - void pre_exchange(); - void forward_acid(); - void backward_acid(); - void forward_base(); - void backward_base(); - void forward_ions(); - void forward_ions_multival(); - void backward_ions(); - void backward_ions_multival(); - int get_random_particle(int, double, double, double *); - int insert_particle(int, double, double, double *); - double energy_full(); - int particle_number(int, double); - int particle_number_xrd(int, double, double, double *); - double compute_vector(int n); - void assign_tags(); - void options(int, char **); - void setThermoTemperaturePointer(); - double memory_usage(); +class FixChargeRegulation : public Fix { + public: + FixChargeRegulation(class LAMMPS *, int, char **); + ~FixChargeRegulation(); + int setmask(); + void init(); + void pre_exchange(); + void forward_acid(); + void backward_acid(); + void forward_base(); + void backward_base(); + void forward_ions(); + void forward_ions_multival(); + void backward_ions(); + void backward_ions_multival(); + int get_random_particle(int, double, double, double *); + int insert_particle(int, double, double, double *); + double energy_full(); + int particle_number(int, double); + int particle_number_xrd(int, double, double, double *); + double compute_vector(int n); + void assign_tags(); + void options(int, char **); + void setThermoTemperaturePointer(); + double memory_usage(); - private: - int exclusion_group, exclusion_group_bit; - int nevery, seed; // begin MC cycle every nevery MD timesteps, random seed - int nmc; // MC move attempts per cycle - double llength_unit_in_nm ; // LAMMPS unit of length in nm, needed since chemical potentials are in units of mol/l - double pH, pKa, pKb, pKs, pI_plus, pI_minus; // chemical potentials and equilibrium constant in log10 base - double c10pH, c10pKa, c10pKb, c10pOH, c10pI_plus, c10pI_minus; // 10 raised to chemical potential value, in units of concentration [mol/liter] - double pmcmoves[3]; // mc move attempt probability: acid, base, ion pair exchange - double pmcc; // mc move cumulative attempt probability - int npart_xrd; // # of particles (ions) within xrd - int npart_xrd2; // # of particles (ions) within xrd - double vlocal_xrd; // # local volume within xrd - bool only_salt_flag; // true if performing only salt insertion/deletion, no acid/base dissociation. - bool add_tags_flag; // true if each inserted atom gets its unique atom tag - int groupbitall; // group bitmask for inserted atoms - int ngroups; // number of group-ids for inserted atoms - char **groupstrings; // list of group-ids for inserted atoms + private: + int exclusion_group, exclusion_group_bit; + int nevery, seed; // begin MC cycle every nevery MD timesteps, random seed + int nmc; // MC move attempts per cycle + double + llength_unit_in_nm; // LAMMPS unit of length in nm, needed since chemical potentials are in units of mol/l + double pH, pKa, pKb, pKs, pI_plus, + pI_minus; // chemical potentials and equilibrium constant in log10 base + double c10pH, c10pKa, c10pKb, c10pOH, c10pI_plus, + c10pI_minus; // 10 raised to chemical potential value, in units of concentration [mol/liter] + double pmcmoves[3]; // mc move attempt probability: acid, base, ion pair exchange + double pmcc; // mc move cumulative attempt probability + int npart_xrd; // # of particles (ions) within xrd + int npart_xrd2; // # of particles (ions) within xrd + double vlocal_xrd; // # local volume within xrd + bool + only_salt_flag; // true if performing only salt insertion/deletion, no acid/base dissociation. + bool add_tags_flag; // true if each inserted atom gets its unique atom tag + int groupbitall; // group bitmask for inserted atoms + int ngroups; // number of group-ids for inserted atoms + char **groupstrings; // list of group-ids for inserted atoms - // counters - unsigned long int nacid_attempts, nacid_successes, nbase_attempts, nbase_successes, nsalt_attempts, nsalt_successes; - int nacid_neutral, nacid_charged, nbase_neutral, nbase_charged, ncation, nanion; // particle type counts - int cr_nmax; // max number of local particles - double reservoir_temperature; - double beta, sigma, volume, volume_rx; // inverse temperature, speed, total volume, reacting volume - int salt_charge[2]; // charge of salt ions: [0] - cation, [1] - anion - int salt_charge_ratio; // charge ratio when using multivalent ion exchange - double xlo, xhi, ylo, yhi, zlo, zhi; // box size - double energy_stored; // full energy of old/current configuration - int triclinic; // 0 = orthog box, 1 = triclinic - double *sublo, *subhi; // triclinic size - int *ptype_ID; // particle ID array - double overlap_cutoffsq; // square distance cutoff for overlap - int overlap_flag; - int acid_type, cation_type, base_type, anion_type; // reacting atom types - int reaction_distance_flag; // radial reaction restriction flag - double reaction_distance; // max radial distance from acid/base for ion insertion + // counters + unsigned long int nacid_attempts, nacid_successes, nbase_attempts, nbase_successes, + nsalt_attempts, nsalt_successes; + int nacid_neutral, nacid_charged, nbase_neutral, nbase_charged, ncation, + nanion; // particle type counts + int cr_nmax; // max number of local particles + double reservoir_temperature; + double beta, sigma, volume, + volume_rx; // inverse temperature, speed, total volume, reacting volume + int salt_charge[2]; // charge of salt ions: [0] - cation, [1] - anion + int salt_charge_ratio; // charge ratio when using multivalent ion exchange + double xlo, xhi, ylo, yhi, zlo, zhi; // box size + double energy_stored; // full energy of old/current configuration + int triclinic; // 0 = orthog box, 1 = triclinic + double *sublo, *subhi; // triclinic size + int *ptype_ID; // particle ID array + double overlap_cutoffsq; // square distance cutoff for overlap + int overlap_flag; + int acid_type, cation_type, base_type, anion_type; // reacting atom types + int reaction_distance_flag; // radial reaction restriction flag + double reaction_distance; // max radial distance from acid/base for ion insertion - - class Pair *pair; - class Compute *c_pe; // energy compute pointer - class RanPark *random_equal; // random number generator - class RanPark *random_unequal; // random number generator - char *idftemp; // pointer to the temperature fix - double *target_temperature_tcp; // current temperature of the thermostat - - }; -} + class Pair *pair; + class Compute *c_pe; // energy compute pointer + class RanPark *random_equal; // random number generator + class RanPark *random_unequal; // random number generator + char *idftemp; // pointer to the temperature fix + double *target_temperature_tcp; // current temperature of the thermostat +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_gcmc.h b/src/MC/fix_gcmc.h index 3ff653a88d..0ba7e25b20 100644 --- a/src/MC/fix_gcmc.h +++ b/src/MC/fix_gcmc.h @@ -59,34 +59,34 @@ class FixGCMC : public Fix { void grow_molecule_arrays(int); private: - int molecule_group,molecule_group_bit; + int molecule_group, molecule_group_bit; int molecule_group_inversebit; - int exclusion_group,exclusion_group_bit; - int ngcmc_type,nevery,seed; - int ncycles,nexchanges,nmcmoves; + int exclusion_group, exclusion_group_bit; + int ngcmc_type, nevery, seed; + int ncycles, nexchanges, nmcmoves; double patomtrans, pmoltrans, pmolrotate, pmctot; - int ngas; // # of gas atoms on all procs - int ngas_local; // # of gas atoms on this proc - int ngas_before; // # of gas atoms on procs < this proc - int exchmode; // exchange ATOM or MOLECULE - int movemode; // move ATOM or MOLECULE - int regionflag; // 0 = anywhere in box, 1 = specific region - int iregion; // gcmc region - char *idregion; // gcmc region id - bool pressure_flag; // true if user specified reservoir pressure - bool charge_flag; // true if user specified atomic charge - bool full_flag; // true if doing full system energy calculations + int ngas; // # of gas atoms on all procs + int ngas_local; // # of gas atoms on this proc + int ngas_before; // # of gas atoms on procs < this proc + int exchmode; // exchange ATOM or MOLECULE + int movemode; // move ATOM or MOLECULE + int regionflag; // 0 = anywhere in box, 1 = specific region + int iregion; // gcmc region + char *idregion; // gcmc region id + bool pressure_flag; // true if user specified reservoir pressure + bool charge_flag; // true if user specified atomic charge + bool full_flag; // true if doing full system energy calculations - int natoms_per_molecule; // number of atoms in each inserted molecule - int nmaxmolatoms; // number of atoms allocated for molecule arrays + int natoms_per_molecule; // number of atoms in each inserted molecule + int nmaxmolatoms; // number of atoms allocated for molecule arrays - int groupbitall; // group bitmask for inserted atoms - int ngroups; // number of group-ids for inserted atoms - char** groupstrings; // list of group-ids for inserted atoms - int ngrouptypes; // number of type-based group-ids for inserted atoms - char** grouptypestrings; // list of type-based group-ids for inserted atoms - int* grouptypebits; // list of type-based group bitmasks - int* grouptypes; // list of type-based group types + int groupbitall; // group bitmask for inserted atoms + int ngroups; // number of group-ids for inserted atoms + char **groupstrings; // list of group-ids for inserted atoms + int ngrouptypes; // number of type-based group-ids for inserted atoms + char **grouptypestrings; // list of type-based group-ids for inserted atoms + int *grouptypebits; // list of type-based group bitmasks + int *grouptypes; // list of type-based group types double ntranslation_attempts; double ntranslation_successes; double nrotation_attempts; @@ -104,20 +104,20 @@ class FixGCMC : public Fix { double chemical_potential; double displace; double max_rotation_angle; - double beta,zz,sigma,volume; - double pressure,fugacity_coeff,charge; - double xlo,xhi,ylo,yhi,zlo,zhi; - double region_xlo,region_xhi,region_ylo,region_yhi,region_zlo,region_zhi; + double beta, zz, sigma, volume; + double pressure, fugacity_coeff, charge; + double xlo, xhi, ylo, yhi, zlo, zhi; + double region_xlo, region_xhi, region_ylo, region_yhi, region_zlo, region_zhi; double region_volume; - double energy_stored; // full energy of old/current configuration - double *sublo,*subhi; + double energy_stored; // full energy of old/current configuration + double *sublo, *subhi; int *local_gas_list; double **cutsq; double **molcoords; double *molq; imageint *molimage; imageint imagezero; - double overlap_cutoffsq; // square distance cutoff for overlap + double overlap_cutoffsq; // square distance cutoff for overlap int overlap_flag; int max_ngas; int min_ngas; @@ -132,18 +132,18 @@ class FixGCMC : public Fix { class Atom *model_atom; class Molecule **onemols; - int imol,nmol; + int imol, nmol; class Fix *fixrigid, *fixshake; int rigidflag, shakeflag; char *idrigid, *idshake; - int triclinic; // 0 = orthog box, 1 = triclinic + int triclinic; // 0 = orthog box, 1 = triclinic class Compute *c_pe; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_tfmc.h b/src/MC/fix_tfmc.h index ada50f8677..156e8ea38b 100644 --- a/src/MC/fix_tfmc.h +++ b/src/MC/fix_tfmc.h @@ -44,7 +44,7 @@ class FixTFMC : public Fix { class RanMars *random_num; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/fix_widom.h b/src/MC/fix_widom.h index af91846844..dc8ddc6a62 100644 --- a/src/MC/fix_widom.h +++ b/src/MC/fix_widom.h @@ -48,23 +48,23 @@ class FixWidom : public Fix { void grow_molecule_arrays(int); private: - int molecule_group,molecule_group_bit; + int molecule_group, molecule_group_bit; int molecule_group_inversebit; - int exclusion_group,exclusion_group_bit; - int nwidom_type,nevery,seed; + int exclusion_group, exclusion_group_bit; + int nwidom_type, nevery, seed; int ninsertions; - int ngas; // # of gas atoms on all procs - int ngas_local; // # of gas atoms on this proc - int exchmode; // exchange ATOM or MOLECULE - int movemode; // move ATOM or MOLECULE - int regionflag; // 0 = anywhere in box, 1 = specific region - int iregion; // widom region - char *idregion; // widom region id - bool charge_flag; // true if user specified atomic charge - bool full_flag; // true if doing full system energy calculations + int ngas; // # of gas atoms on all procs + int ngas_local; // # of gas atoms on this proc + int exchmode; // exchange ATOM or MOLECULE + int movemode; // move ATOM or MOLECULE + int regionflag; // 0 = anywhere in box, 1 = specific region + int iregion; // widom region + char *idregion; // widom region id + bool charge_flag; // true if user specified atomic charge + bool full_flag; // true if doing full system energy calculations - int natoms_per_molecule; // number of atoms in each inserted molecule - int nmaxmolatoms; // number of atoms allocated for molecule arrays + int natoms_per_molecule; // number of atoms in each inserted molecule + int nmaxmolatoms; // number of atoms allocated for molecule arrays double ave_widom_chemical_potential; @@ -72,13 +72,13 @@ class FixWidom : public Fix { int max_region_attempts; double gas_mass; double insertion_temperature; - double beta,sigma,volume; + double beta, sigma, volume; double charge; - double xlo,xhi,ylo,yhi,zlo,zhi; - double region_xlo,region_xhi,region_ylo,region_yhi,region_zlo,region_zhi; + double xlo, xhi, ylo, yhi, zlo, zhi; + double region_xlo, region_xhi, region_ylo, region_yhi, region_zlo, region_zhi; double region_volume; - double energy_stored; // full energy of old/current configuration - double *sublo,*subhi; + double energy_stored; // full energy of old/current configuration + double *sublo, *subhi; int *local_gas_list; double **cutsq; double **molcoords; @@ -95,15 +95,15 @@ class FixWidom : public Fix { class Atom *model_atom; class Molecule **onemols; - int imol,nmol; - int triclinic; // 0 = orthog box, 1 = triclinic + int imol, nmol; + int triclinic; // 0 = orthog box, 1 = triclinic class Compute *c_pe; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MC/pair_dsmc.h b/src/MC/pair_dsmc.h index 4c21e5ae70..e5c764bc7a 100644 --- a/src/MC/pair_dsmc.h +++ b/src/MC/pair_dsmc.h @@ -92,18 +92,20 @@ class PairDSMC : public Pair { void scatter_random(int, int, int); int convert_double_to_equivalent_int(double); - inline void subtract3d(const double *v1, const double *v2, double *v3) { + inline void subtract3d(const double *v1, const double *v2, double *v3) + { v3[0] = v2[0] - v1[0]; v3[1] = v2[1] - v1[1]; v3[2] = v2[2] - v1[2]; } - inline double dot3d(const double *v1, const double *v2) { - return( v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] ); + inline double dot3d(const double *v1, const double *v2) + { + return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/fix_client_md.h b/src/MESSAGE/fix_client_md.h index 0360ba5beb..7abe950bfa 100644 --- a/src/MESSAGE/fix_client_md.h +++ b/src/MESSAGE/fix_client_md.h @@ -37,10 +37,10 @@ class FixClientMD : public Fix { double compute_scalar(); private: - int maxatom,units,server_error; + int maxatom, units, server_error; double eng; double inv_nprocs; - double fconvert,econvert,pconvert; + double fconvert, econvert, pconvert; double box[3][3]; double *xpbc; @@ -49,7 +49,7 @@ class FixClientMD : public Fix { void receive_fev(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/message.h b/src/MESSAGE/message.h index 129d3be31f..13ab2f1d06 100644 --- a/src/MESSAGE/message.h +++ b/src/MESSAGE/message.h @@ -26,14 +26,14 @@ namespace LAMMPS_NS { class Message : public Command { public: - Message(class LAMMPS *lmp) : Command(lmp) {}; + Message(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); private: void quit(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/server.h b/src/MESSAGE/server.h index d9c47c7b1d..f9a04fbb35 100644 --- a/src/MESSAGE/server.h +++ b/src/MESSAGE/server.h @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class Server : public Command { public: - Server(class LAMMPS *lmp) : Command(lmp) {}; + Server(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MESSAGE/server_mc.h b/src/MESSAGE/server_mc.h index 286a5ab465..f28138011b 100644 --- a/src/MESSAGE/server_mc.h +++ b/src/MESSAGE/server_mc.h @@ -24,6 +24,6 @@ class ServerMC : protected Pointers { void loop(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MESSAGE/server_md.h b/src/MESSAGE/server_md.h index 1f15eccbec..e9a99dcb93 100644 --- a/src/MESSAGE/server_md.h +++ b/src/MESSAGE/server_md.h @@ -26,13 +26,13 @@ class ServerMD : protected Pointers { private: int units; - double fconvert,econvert,pconvert; + double fconvert, econvert, pconvert; double **fcopy; void box_change(double *, double *); void send_fev(int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MISC/compute_msd_nongauss.h b/src/MISC/compute_msd_nongauss.h index eb14bd0790..d997fa2f26 100644 --- a/src/MISC/compute_msd_nongauss.h +++ b/src/MISC/compute_msd_nongauss.h @@ -31,7 +31,7 @@ class ComputeMSDNonGauss : public ComputeMSD { void compute_vector(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/compute_ti.h b/src/MISC/compute_ti.h index 257f9ddbf8..46bd95ce07 100644 --- a/src/MISC/compute_ti.h +++ b/src/MISC/compute_ti.h @@ -34,14 +34,14 @@ class ComputeTI : public Compute { private: int nterms; int *which; - int *ivar1,*ivar2; + int *ivar1, *ivar2; int *ilo, *ihi; - char **var1,**var2; + char **var1, **var2; class Pair **pptr; char **pstyle; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/dump_xtc.h b/src/MISC/dump_xtc.h index 205d8731ab..24ae8f9fe1 100644 --- a/src/MISC/dump_xtc.h +++ b/src/MISC/dump_xtc.h @@ -27,16 +27,16 @@ namespace LAMMPS_NS { class DumpXTC : public Dump { public: - DumpXTC(class LAMMPS *, int, char**); + DumpXTC(class LAMMPS *, int, char **); virtual ~DumpXTC(); private: - int natoms,ntotal; + int natoms, ntotal; int nevery_save; - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no - float precision; // user-adjustable precision setting + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no + float precision; // user-adjustable precision setting float *coords; - double sfactor,tfactor; // scaling factors for positions and time unit + double sfactor, tfactor; // scaling factors for positions and time unit XDR xd; void init_style(); @@ -50,7 +50,7 @@ class DumpXTC : public Dump { void write_frame(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_deposit.h b/src/MISC/fix_deposit.h index 71ba15685f..0323b0d9f2 100644 --- a/src/MISC/fix_deposit.h +++ b/src/MISC/fix_deposit.h @@ -37,34 +37,34 @@ class FixDeposit : public Fix { void *extract(const char *, int &); private: - int ninsert,ntype,nfreq,seed; - int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag; - int mode,rigidflag,shakeflag,idnext,distflag,orientflag; - double lo,hi,deltasq,nearsq,rate,sigma; - double vxlo,vxhi,vylo,vyhi,vzlo,vzhi; - double xlo,xhi,ylo,yhi,zlo,zhi,xmid,ymid,zmid; - double rx,ry,rz,tx,ty,tz; + int ninsert, ntype, nfreq, seed; + int iregion, globalflag, localflag, maxattempt, rateflag, scaleflag, targetflag; + int mode, rigidflag, shakeflag, idnext, distflag, orientflag; + double lo, hi, deltasq, nearsq, rate, sigma; + double vxlo, vxhi, vylo, vyhi, vzlo, vzhi; + double xlo, xhi, ylo, yhi, zlo, zhi, xmid, ymid, zmid; + double rx, ry, rz, tx, ty, tz; char *idregion; - char *idrigid,*idshake; + char *idrigid, *idshake; class Molecule **onemols; - int nmol,natom_max; + int nmol, natom_max; double *molfrac; double **coords; imageint *imageflags; - class Fix *fixrigid,*fixshake; + class Fix *fixrigid, *fixshake; double oneradius; int ninserted; bigint nfirst; - tagint maxtag_all,maxmol_all; + tagint maxtag_all, maxmol_all; class RanPark *random; void find_maxid(); void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_efield.h b/src/MISC/fix_efield.h index 5be15a8176..564c30b3c4 100644 --- a/src/MISC/fix_efield.h +++ b/src/MISC/fix_efield.h @@ -40,23 +40,23 @@ class FixEfield : public Fix { double compute_vector(int); private: - double ex,ey,ez; - int varflag,iregion; - char *xstr,*ystr,*zstr,*estr; + double ex, ey, ez; + int varflag, iregion; + char *xstr, *ystr, *zstr, *estr; char *idregion; - int xvar,yvar,zvar,evar,xstyle,ystyle,zstyle,estyle; + int xvar, yvar, zvar, evar, xstyle, ystyle, zstyle, estyle; int ilevel_respa; double qe2f; - int qflag,muflag; + int qflag, muflag; int maxatom; double **efield; int force_flag; - double fsum[4],fsum_all[4]; + double fsum[4], fsum_all[4]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_evaporate.h b/src/MISC/fix_evaporate.h index e7c004ff29..6d5fca81a7 100644 --- a/src/MISC/fix_evaporate.h +++ b/src/MISC/fix_evaporate.h @@ -35,18 +35,18 @@ class FixEvaporate : public Fix { double memory_usage(); private: - int nevery,nflux,iregion; + int nevery, nflux, iregion; int molflag; int ndeleted; char *idregion; int nmax; - int *list,*mark; + int *list, *mark; class RanPark *random; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_gld.h b/src/MISC/fix_gld.h index bbe79da976..6dea771026 100644 --- a/src/MISC/fix_gld.h +++ b/src/MISC/fix_gld.h @@ -49,7 +49,7 @@ class FixGLD : public Fix { void init_s_gld(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; int freezeflag, zeroflag; @@ -65,7 +65,7 @@ class FixGLD : public Fix { class RanMars *random; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_oneway.h b/src/MISC/fix_oneway.h index 131aee1e57..8ffe6961d1 100644 --- a/src/MISC/fix_oneway.h +++ b/src/MISC/fix_oneway.h @@ -38,7 +38,7 @@ class FixOneWay : public Fix { char *regionstr; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_orient_bcc.h b/src/MISC/fix_orient_bcc.h index 42b9a5d2f5..e9d0e0e453 100644 --- a/src/MISC/fix_orient_bcc.h +++ b/src/MISC/fix_orient_bcc.h @@ -26,21 +26,21 @@ namespace LAMMPS_NS { class FixOrientBCC : public Fix { public: - struct Nbr { // neighbor info for each owned and ghost atom - int n; // # of closest neighbors (up to 8) - tagint id[8]; // IDs of each neighbor - // if center atom is owned, these are local IDs - // if center atom is ghost, these are global IDs - double xismooth[8]; // distance weighting factor for each neighbors - double dxi[8][3]; // d order-parameter / dx for each neighbor - double duxi; // d Energy / d order-parameter for atom + struct Nbr { // neighbor info for each owned and ghost atom + int n; // # of closest neighbors (up to 8) + tagint id[8]; // IDs of each neighbor + // if center atom is owned, these are local IDs + // if center atom is ghost, these are global IDs + double xismooth[8]; // distance weighting factor for each neighbors + double dxi[8][3]; // d order-parameter / dx for each neighbor + double duxi; // d Energy / d order-parameter for atom }; - struct Sort { // data structure for sorting to find 8 closest - int id; // local ID of neighbor atom - double rsq; // distance between center and neighbor atom - double delta[3]; // displacement between center and neighbor atom - double xismooth; // distance weighting factor + struct Sort { // data structure for sorting to find 8 closest + int id; // local ID of neighbor atom + double rsq; // distance between center and neighbor atom + double delta[3]; // displacement between center and neighbor atom + double xismooth; // distance weighting factor }; FixOrientBCC(class LAMMPS *, int, char **); @@ -60,21 +60,21 @@ class FixOrientBCC : public Fix { int me; int ilevel_respa; - int direction_of_motion; // 1 = center shrinks, 0 = center grows - int nstats; // stats output every this many steps - double a; // lattice parameter - double Vxi; // potential value - double uxif_low; // cut-off fraction, low order parameter - double uxif_high; // cut-off fraction, high order parameter - char *xifilename, *chifilename; // file names for 2 crystal orientations + int direction_of_motion; // 1 = center shrinks, 0 = center grows + int nstats; // stats output every this many steps + double a; // lattice parameter + double Vxi; // potential value + double uxif_low; // cut-off fraction, low order parameter + double uxif_high; // cut-off fraction, high order parameter + char *xifilename, *chifilename; // file names for 2 crystal orientations bool use_xismooth; - double Rxi[8][3],Rchi[8][3],half_xi_chi_vec[2][4][3]; - double xiid,xi0,xi1,xicutoffsq,cutsq,added_energy; + double Rxi[8][3], Rchi[8][3], half_xi_chi_vec[2][4][3]; + double xiid, xi0, xi1, xicutoffsq, cutsq, added_energy; int half_bcc_nn; - int nmax; // expose 2 per-atom quantities - double **order; // order param and normalized order param + int nmax; // expose 2 per-atom quantities + double **order; // order param and normalized order param Nbr *nbr; Sort *sort; @@ -84,7 +84,7 @@ class FixOrientBCC : public Fix { static int compare(const void *, const void *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_orient_fcc.h b/src/MISC/fix_orient_fcc.h index 4b551be561..e25925b446 100644 --- a/src/MISC/fix_orient_fcc.h +++ b/src/MISC/fix_orient_fcc.h @@ -36,11 +36,11 @@ class FixOrientFCC : public Fix { double duxi; // d Energy / d order-parameter for atom }; - struct Sort { // data structure for sorting to find 12 closest - int id; // local ID of neighbor atom - double rsq; // distance between center and neighbor atom - double delta[3]; // displacement between center and neighbor atom - double xismooth; // distance weighting factor + struct Sort { // data structure for sorting to find 12 closest + int id; // local ID of neighbor atom + double rsq; // distance between center and neighbor atom + double delta[3]; // displacement between center and neighbor atom + double xismooth; // distance weighting factor }; FixOrientFCC(class LAMMPS *, int, char **); @@ -60,21 +60,21 @@ class FixOrientFCC : public Fix { int me; int ilevel_respa; - int direction_of_motion; // 1 = center shrinks, 0 = center grows - int nstats; // stats output every this many steps - double a; // lattice parameter - double Vxi; // potential value - double uxif_low; // cut-off fraction, low order parameter - double uxif_high; // cut-off fraction, high order parameter - char *xifilename, *chifilename; // file names for 2 crystal orientations + int direction_of_motion; // 1 = center shrinks, 0 = center grows + int nstats; // stats output every this many steps + double a; // lattice parameter + double Vxi; // potential value + double uxif_low; // cut-off fraction, low order parameter + double uxif_high; // cut-off fraction, high order parameter + char *xifilename, *chifilename; // file names for 2 crystal orientations bool use_xismooth; - double Rxi[12][3],Rchi[12][3],half_xi_chi_vec[2][6][3]; - double xiid,xi0,xi1,xicutoffsq,cutsq,added_energy; + double Rxi[12][3], Rchi[12][3], half_xi_chi_vec[2][6][3]; + double xiid, xi0, xi1, xicutoffsq, cutsq, added_energy; int half_fcc_nn; - int nmax; // expose 2 per-atom quantities - double **order; // order param and normalized order param + int nmax; // expose 2 per-atom quantities + double **order; // order param and normalized order param Nbr *nbr; Sort *sort; @@ -84,7 +84,7 @@ class FixOrientFCC : public Fix { static int compare(const void *, const void *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_thermal_conductivity.h b/src/MISC/fix_thermal_conductivity.h index 77f888480a..5934326833 100644 --- a/src/MISC/fix_thermal_conductivity.h +++ b/src/MISC/fix_thermal_conductivity.h @@ -35,18 +35,18 @@ class FixThermalConductivity : public Fix { private: int me; - int edim,nbin,periodicity; + int edim, nbin, periodicity; int nswap; - double prd,boxlo,boxhi; - double slablo_lo,slablo_hi,slabhi_lo,slabhi_hi; + double prd, boxlo, boxhi; + double slablo_lo, slablo_hi, slabhi_lo, slabhi_hi; double e_exchange; - int nlo,nhi; - int *index_lo,*index_hi; - double *ke_lo,*ke_hi; + int nlo, nhi; + int *index_lo, *index_hi; + double *ke_lo, *ke_hi; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_ttm.h b/src/MISC/fix_ttm.h index 522eeff2f5..882feb0b2e 100644 --- a/src/MISC/fix_ttm.h +++ b/src/MISC/fix_ttm.h @@ -53,22 +53,22 @@ class FixTTM : public Fix { int seed; class RanMars *random; FILE *fp; - int nxnodes,nynodes,nznodes; + int nxnodes, nynodes, nznodes; bigint total_nnodes; int ***nsum, ***nsum_all; - double *gfactor1,*gfactor2,*ratio,**flangevin; - double ***T_electron,***T_electron_old; - double ***sum_vsq,***sum_mass_vsq; - double ***sum_vsq_all,***sum_mass_vsq_all; - double ***net_energy_transfer,***net_energy_transfer_all; - double electronic_specific_heat,electronic_density; + double *gfactor1, *gfactor2, *ratio, **flangevin; + double ***T_electron, ***T_electron_old; + double ***sum_vsq, ***sum_mass_vsq; + double ***sum_vsq_all, ***sum_mass_vsq_all; + double ***net_energy_transfer, ***net_energy_transfer_all; + double electronic_specific_heat, electronic_density; double electronic_thermal_conductivity; - double gamma_p,gamma_s,v_0,v_0_sq; + double gamma_p, gamma_s, v_0, v_0_sq; void read_initial_electron_temperatures(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/fix_viscosity.h b/src/MISC/fix_viscosity.h index 58d456cd99..80bad883e8 100644 --- a/src/MISC/fix_viscosity.h +++ b/src/MISC/fix_viscosity.h @@ -35,19 +35,19 @@ class FixViscosity : public Fix { private: int me; - int vdim,pdim,nbin,periodicity; + int vdim, pdim, nbin, periodicity; int nswap; double vtarget; - double prd,boxlo,boxhi; - double slablo_lo,slablo_hi,slabhi_lo,slabhi_hi; + double prd, boxlo, boxhi; + double slablo_lo, slablo_hi, slabhi_lo, slabhi_hi; double p_exchange; - int npositive,nnegative; - int *pos_index,*neg_index; - double *pos_delta,*neg_delta; + int npositive, nnegative; + int *pos_index, *neg_index; + double *pos_delta, *neg_delta; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/pair_nm_cut.h b/src/MISC/pair_nm_cut.h index e1f1680bb5..3070c57b7b 100644 --- a/src/MISC/pair_nm_cut.h +++ b/src/MISC/pair_nm_cut.h @@ -45,13 +45,13 @@ class PairNMCut : public Pair { protected: double cut_global; double **cut; - double **e0,**r0,**nn, **mm; - double **nm,**e0nm,**r0n,**r0m,**offset; + double **e0, **r0, **nn, **mm; + double **nm, **e0nm, **r0n, **r0m, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/pair_nm_cut_coul_cut.h b/src/MISC/pair_nm_cut_coul_cut.h index 12c876ac3e..cdf1218a3b 100644 --- a/src/MISC/pair_nm_cut_coul_cut.h +++ b/src/MISC/pair_nm_cut_coul_cut.h @@ -44,16 +44,16 @@ class PairNMCutCoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **e0,**r0,**nn, **mm; - double **nm,**e0nm,**r0n,**r0m,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **e0, **r0, **nn, **mm; + double **nm, **e0nm, **r0n, **r0m, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/pair_nm_cut_coul_long.h b/src/MISC/pair_nm_cut_coul_long.h index e41f9f9688..f35c2f93e5 100644 --- a/src/MISC/pair_nm_cut_coul_long.h +++ b/src/MISC/pair_nm_cut_coul_long.h @@ -46,17 +46,17 @@ class PairNMCutCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **e0,**r0,**nn, **mm; - double **nm,**e0nm,**r0n,**r0m,**offset; - double qdist; // TIP4P distance from O site to negative charge + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **e0, **r0, **nn, **mm; + double **nm, **e0nm, **r0n, **r0m, **offset; + double qdist; // TIP4P distance from O site to negative charge double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MISC/xdr_compat.h b/src/MISC/xdr_compat.h index 60cae1662e..30aecbcb62 100644 --- a/src/MISC/xdr_compat.h +++ b/src/MISC/xdr_compat.h @@ -59,8 +59,9 @@ extern "C" { typedef int bool_t; -#if defined(__MINGW32__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__) -typedef char * caddr_t; +#if defined(__MINGW32__) || defined(__APPLE__) || defined(__FreeBSD__) || \ + defined(__DragonFly__) || defined(__OpenBSD__) || defined(__NetBSD__) +typedef char *caddr_t; typedef unsigned int u_int; #endif @@ -69,35 +70,30 @@ typedef unsigned int u_int; * long or short is 32 bits and die if none of them is :-) */ #if (INT_MAX == 2147483647) - typedef int xdr_int32_t; - typedef unsigned int xdr_uint32_t; +typedef int xdr_int32_t; +typedef unsigned int xdr_uint32_t; #elif (LONG_MAX == 2147483647L) - typedef long xdr_int32_t; - typedef unsigned long xdr_uint32_t; +typedef long xdr_int32_t; +typedef unsigned long xdr_uint32_t; #elif (SHRT_MAX == 2147483647) - typedef short xdr_int32_t; - typedef unsigned short xdr_uint32_t; +typedef short xdr_int32_t; +typedef unsigned short xdr_uint32_t; #else -# error ERROR: No 32 bit wide integer type found! +#error ERROR: No 32 bit wide integer type found! #endif -enum xdr_op { - XDR_ENCODE = 0, - XDR_DECODE = 1, - XDR_FREE = 2 -}; +enum xdr_op { XDR_ENCODE = 0, XDR_DECODE = 1, XDR_FREE = 2 }; #ifndef FALSE -# define FALSE (0) +#define FALSE (0) #endif #ifndef TRUE -# define TRUE (1) +#define TRUE (1) #endif -#define BYTES_PER_XDR_UNIT (4) +#define BYTES_PER_XDR_UNIT (4) /* Macro to round up to units of 4. */ -#define XDR_RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1)) - +#define XDR_RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1)) /* * The XDR handle. @@ -107,38 +103,36 @@ enum xdr_op { */ typedef struct XDR XDR; -struct XDR - { - enum xdr_op x_op; /* operation; fast additional param */ - struct xdr_ops *x_ops; - char *x_public; /* users' data */ - char *x_private; /* pointer to private data */ - char *x_base; /* private used for position info */ - int x_handy; /* extra private word */ - }; +struct XDR { + enum xdr_op x_op; /* operation; fast additional param */ + struct xdr_ops *x_ops; + char *x_public; /* users' data */ + char *x_private; /* pointer to private data */ + char *x_base; /* private used for position info */ + int x_handy; /* extra private word */ +}; -struct xdr_ops - { - bool_t (*x_getbytes) (XDR *__xdrs, char *__addr, unsigned int __len); - /* get some bytes from " */ - bool_t (*x_putbytes) (XDR *__xdrs, char *__addr, unsigned int __len); - /* put some bytes to " */ - unsigned int (*x_getpostn) (XDR *__xdrs); - /* returns bytes off from beginning */ - bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos); - /* lets you reposition the stream */ - xdr_int32_t *(*x_inline) (XDR *__xdrs, int __len); - /* buf quick ptr to buffered data */ - void (*x_destroy) (XDR *__xdrs); - /* free privates of this xdr_stream */ - bool_t (*x_getint32) (XDR *__xdrs, xdr_int32_t *__ip); - /* get a int from underlying stream */ - bool_t (*x_putint32) (XDR *__xdrs, xdr_int32_t *__ip); - /* put a int to " */ - bool_t (*x_getuint32) (XDR *__xdrs, xdr_uint32_t *__ip); - /* get a unsigned int from underlying stream */ - bool_t (*x_putuint32) (XDR *__xdrs, xdr_uint32_t *__ip); - /* put a int to " */ +struct xdr_ops { + bool_t (*x_getbytes)(XDR *__xdrs, char *__addr, unsigned int __len); + /* get some bytes from " */ + bool_t (*x_putbytes)(XDR *__xdrs, char *__addr, unsigned int __len); + /* put some bytes to " */ + unsigned int (*x_getpostn)(XDR *__xdrs); + /* returns bytes off from beginning */ + bool_t (*x_setpostn)(XDR *__xdrs, unsigned int __pos); + /* lets you reposition the stream */ + xdr_int32_t *(*x_inline)(XDR *__xdrs, int __len); + /* buf quick ptr to buffered data */ + void (*x_destroy)(XDR *__xdrs); + /* free privates of this xdr_stream */ + bool_t (*x_getint32)(XDR *__xdrs, xdr_int32_t *__ip); + /* get a int from underlying stream */ + bool_t (*x_putint32)(XDR *__xdrs, xdr_int32_t *__ip); + /* put a int to " */ + bool_t (*x_getuint32)(XDR *__xdrs, xdr_uint32_t *__ip); + /* get a unsigned int from underlying stream */ + bool_t (*x_putuint32)(XDR *__xdrs, xdr_uint32_t *__ip); + /* put a int to " */ }; /* @@ -150,7 +144,7 @@ struct xdr_ops * allocate dynamic storage of the appropriate size and return it. */ -typedef bool_t (*xdrproc_t) (XDR *, void *,...); +typedef bool_t (*xdrproc_t)(XDR *, void *, ...); /* * Operations defined on a XDR handle @@ -163,58 +157,46 @@ typedef bool_t (*xdrproc_t) (XDR *, void *,...); * unsigned int pos; */ +#define xdr_getint32(xdrs, int32p) (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) -#define xdr_getint32(xdrs, int32p) \ - (*(xdrs)->x_ops->x_getint32)(xdrs, int32p) +#define xdr_putint32(xdrs, int32p) (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) -#define xdr_putint32(xdrs, int32p) \ - (*(xdrs)->x_ops->x_putint32)(xdrs, int32p) +#define xdr_getuint32(xdrs, uint32p) (*(xdrs)->x_ops->x_getuint32)(xdrs, uint32p) -#define xdr_getuint32(xdrs, uint32p) \ - (*(xdrs)->x_ops->x_getuint32)(xdrs, uint32p) +#define xdr_putuint32(xdrs, uint32p) (*(xdrs)->x_ops->x_putuint32)(xdrs, uint32p) -#define xdr_putuint32(xdrs, uint32p) \ - (*(xdrs)->x_ops->x_putuint32)(xdrs, uint32p) +#define xdr_getbytes(xdrs, addr, len) (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) -#define xdr_getbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len) +#define xdr_putbytes(xdrs, addr, len) (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) -#define xdr_putbytes(xdrs, addr, len) \ - (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len) +#define xdr_getpos(xdrs) (*(xdrs)->x_ops->x_getpostn)(xdrs) -#define xdr_getpos(xdrs) \ - (*(xdrs)->x_ops->x_getpostn)(xdrs) +#define xdr_setpos(xdrs, pos) (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) -#define xdr_setpos(xdrs, pos) \ - (*(xdrs)->x_ops->x_setpostn)(xdrs, pos) +#define xdr_inline(xdrs, len) (*(xdrs)->x_ops->x_inline)(xdrs, len) -#define xdr_inline(xdrs, len) \ - (*(xdrs)->x_ops->x_inline)(xdrs, len) +#define xdr_destroy(xdrs) \ + do { \ + if ((xdrs)->x_ops->x_destroy) (*(xdrs)->x_ops->x_destroy)(xdrs); \ + } while (0) -#define xdr_destroy(xdrs) \ - do { \ - if ((xdrs)->x_ops->x_destroy) \ - (*(xdrs)->x_ops->x_destroy)(xdrs); \ - } while (0) - - -extern bool_t xdr_int (XDR *__xdrs, int *__ip); -extern bool_t xdr_u_int (XDR *__xdrs, unsigned int *__ip); -extern bool_t xdr_short (XDR *__xdrs, short *__ip); -extern bool_t xdr_u_short (XDR *__xdrs, unsigned short *__ip); -extern bool_t xdr_bool (XDR *__xdrs, int *__bp); -extern bool_t xdr_opaque (XDR *__xdrs, char *__cp, unsigned int __cnt); -extern bool_t xdr_string (XDR *__xdrs, char **__cpp, unsigned int __maxsize); -extern bool_t xdr_char (XDR *__xdrs, char *__cp); -extern bool_t xdr_u_char (XDR *__xdrs, unsigned char *__cp); -extern bool_t xdr_vector (XDR *__xdrs, char *__basep, unsigned int __nelem, - unsigned int __elemsize, xdrproc_t __xdr_elem); -extern bool_t xdr_float (XDR *__xdrs, float *__fp); -extern bool_t xdr_double (XDR *__xdrs, double *__dp); -extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop); +extern bool_t xdr_int(XDR *__xdrs, int *__ip); +extern bool_t xdr_u_int(XDR *__xdrs, unsigned int *__ip); +extern bool_t xdr_short(XDR *__xdrs, short *__ip); +extern bool_t xdr_u_short(XDR *__xdrs, unsigned short *__ip); +extern bool_t xdr_bool(XDR *__xdrs, int *__bp); +extern bool_t xdr_opaque(XDR *__xdrs, char *__cp, unsigned int __cnt); +extern bool_t xdr_string(XDR *__xdrs, char **__cpp, unsigned int __maxsize); +extern bool_t xdr_char(XDR *__xdrs, char *__cp); +extern bool_t xdr_u_char(XDR *__xdrs, unsigned char *__cp); +extern bool_t xdr_vector(XDR *__xdrs, char *__basep, unsigned int __nelem, unsigned int __elemsize, + xdrproc_t __xdr_elem); +extern bool_t xdr_float(XDR *__xdrs, float *__fp); +extern bool_t xdr_double(XDR *__xdrs, double *__dp); +extern void xdrstdio_create(XDR *__xdrs, FILE *__file, enum xdr_op __xop); /* free memory buffers for xdr */ -extern void xdr_free (xdrproc_t __proc, char *__objp); +extern void xdr_free(xdrproc_t __proc, char *__objp); #ifdef __cplusplus } diff --git a/src/MLIAP/compute_mliap.h b/src/MLIAP/compute_mliap.h index 4110d5b32e..2d773d6226 100644 --- a/src/MLIAP/compute_mliap.h +++ b/src/MLIAP/compute_mliap.h @@ -22,7 +22,6 @@ ComputeStyle(mliap,ComputeMLIAP); #include "compute.h" - namespace LAMMPS_NS { class ComputeMLIAP : public Compute { @@ -39,11 +38,11 @@ class ComputeMLIAP : public Compute { private: double **mliaparray, **mliaparrayall; class NeighList *list; - int *map; // map types to [0,nelements) - int ndescriptors; // number of descriptors - int nparams; // number of model parameters per element + int *map; // map types to [0,nelements) + int ndescriptors; // number of descriptors + int nparams; // number of model parameters per element int nelements; - int gradgradflag; // 1 for graddesc, 0 for gamma + int gradgradflag; // 1 for graddesc, 0 for gamma class MLIAPModel *model; class MLIAPDescriptor *descriptor; class MLIAPData *data; @@ -57,7 +56,7 @@ class ComputeMLIAP : public Compute { void dbdotr_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MLIAP/mliap_data.h b/src/MLIAP/mliap_data.h index bfefa53af0..ad95f34b35 100644 --- a/src/MLIAP/mliap_data.h +++ b/src/MLIAP/mliap_data.h @@ -21,11 +21,12 @@ namespace LAMMPS_NS { class MLIAPData : protected Pointers { public: - MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = nullptr); + MLIAPData(class LAMMPS *, int, int *, class MLIAPModel *, class MLIAPDescriptor *, + class PairMLIAP * = nullptr); ~MLIAPData(); void init(); - void generate_neighdata(class NeighList *, int=0, int=0); + void generate_neighdata(class NeighList *, int = 0, int = 0); void grow_neigharrays(); double memory_usage(); @@ -35,52 +36,51 @@ class MLIAPData : protected Pointers { int yoffset, zoffset; int ndims_force, ndims_virial; double **gradforce; - double** betas; // betas for all atoms in list - double** descriptors; // descriptors for all atoms in list - double* eatoms; // energies for all atoms in list - double energy; // energy - int ndescriptors; // number of descriptors - int nparams; // number of model parameters per element - int nelements; // number of elements + double **betas; // betas for all atoms in list + double **descriptors; // descriptors for all atoms in list + double *eatoms; // energies for all atoms in list + double energy; // energy + int ndescriptors; // number of descriptors + int nparams; // number of model parameters per element + int nelements; // number of elements // data structures for grad-grad list (gamma) - int natomgamma_max; // allocated size of gamma - int gamma_nnz; // number of non-zero entries in gamma - double** gamma; // gamma element - int** gamma_row_index; // row (parameter) index - int** gamma_col_index; // column (descriptor) index - double* egradient; // energy gradient w.r.t. parameters + int natomgamma_max; // allocated size of gamma + int gamma_nnz; // number of non-zero entries in gamma + double **gamma; // gamma element + int **gamma_row_index; // row (parameter) index + int **gamma_col_index; // column (descriptor) index + double *egradient; // energy gradient w.r.t. parameters // data structures for mliap neighbor list // only neighbors strictly inside descriptor cutoff - int nlistatoms; // current number of atoms in neighborlist - int nlistatoms_max; // allocated size of descriptor array - int natomneigh_max; // allocated size of atom neighbor arrays - int *numneighs; // neighbors count for each atom - int *iatoms; // index of each atom - int *ielems; // element of each atom - int nneigh_max; // number of ij neighbors allocated - int *jatoms; // index of each neighbor - int *jelems; // element of each neighbor - double **rij; // distance vector of each neighbor - double ***graddesc; // descriptor gradient w.r.t. each neighbor - int eflag; // indicates if energy is needed - int vflag; // indicates if virial is needed - class PairMLIAP *pairmliap; // access to pair tally functions + int nlistatoms; // current number of atoms in neighborlist + int nlistatoms_max; // allocated size of descriptor array + int natomneigh_max; // allocated size of atom neighbor arrays + int *numneighs; // neighbors count for each atom + int *iatoms; // index of each atom + int *ielems; // element of each atom + int nneigh_max; // number of ij neighbors allocated + int *jatoms; // index of each neighbor + int *jelems; // element of each neighbor + double **rij; // distance vector of each neighbor + double ***graddesc; // descriptor gradient w.r.t. each neighbor + int eflag; // indicates if energy is needed + int vflag; // indicates if virial is needed + class PairMLIAP *pairmliap; // access to pair tally functions private: class MLIAPModel *model; class MLIAPDescriptor *descriptor; int nmax; - class NeighList *list; // LAMMPS neighbor list - int *map; // map LAMMPS types to [0,nelements) - int gradgradflag; // 1 for graddesc, 0 for gamma - + class NeighList *list; // LAMMPS neighbor list + int *map; // map LAMMPS types to [0,nelements) + int gradgradflag; // 1 for graddesc, 0 for gamma }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MLIAP/mliap_descriptor.h b/src/MLIAP/mliap_descriptor.h index 7f162d6ee4..d60315e597 100644 --- a/src/MLIAP/mliap_descriptor.h +++ b/src/MLIAP/mliap_descriptor.h @@ -18,27 +18,25 @@ namespace LAMMPS_NS { -class MLIAPDescriptor : protected Pointers { -public: - MLIAPDescriptor(LAMMPS*); +class MLIAPDescriptor : protected Pointers { + public: + MLIAPDescriptor(LAMMPS *); ~MLIAPDescriptor(); - virtual void compute_descriptors(class MLIAPData*)=0; - virtual void compute_forces(class MLIAPData*)=0; - virtual void compute_force_gradients(class MLIAPData*)=0; - virtual void compute_descriptor_gradients(class MLIAPData*)=0; - virtual void init()=0; - virtual double memory_usage()=0; - - int ndescriptors; // number of descriptors - int nelements; // # of unique elements - char **elements; // names of unique elements - double **cutsq; // nelem x nelem rcutsq values - double cutmax; // maximum cutoff needed -protected: + virtual void compute_descriptors(class MLIAPData *) = 0; + virtual void compute_forces(class MLIAPData *) = 0; + virtual void compute_force_gradients(class MLIAPData *) = 0; + virtual void compute_descriptor_gradients(class MLIAPData *) = 0; + virtual void init() = 0; + virtual double memory_usage() = 0; + int ndescriptors; // number of descriptors + int nelements; // # of unique elements + char **elements; // names of unique elements + double **cutsq; // nelem x nelem rcutsq values + double cutmax; // maximum cutoff needed + protected: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_descriptor_snap.h b/src/MLIAP/mliap_descriptor_snap.h index 09cb56f445..d225c849ac 100644 --- a/src/MLIAP/mliap_descriptor_snap.h +++ b/src/MLIAP/mliap_descriptor_snap.h @@ -18,33 +18,32 @@ namespace LAMMPS_NS { -class MLIAPDescriptorSNAP : public MLIAPDescriptor { -public: - MLIAPDescriptorSNAP(LAMMPS*, char*); +class MLIAPDescriptorSNAP : public MLIAPDescriptor { + public: + MLIAPDescriptorSNAP(LAMMPS *, char *); ~MLIAPDescriptorSNAP(); - virtual void compute_descriptors(class MLIAPData*); - virtual void compute_forces(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); - virtual void compute_descriptor_gradients(class MLIAPData*); + virtual void compute_descriptors(class MLIAPData *); + virtual void compute_forces(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); + virtual void compute_descriptor_gradients(class MLIAPData *); virtual void init(); virtual double memory_usage(); double rcutfac; -protected: - class SNA* snaptr; + protected: + class SNA *snaptr; void read_paramfile(char *); - inline int equal(double* x,double* y); - inline double dist2(double* x,double* y); + inline int equal(double *x, double *y); + inline double dist2(double *x, double *y); - double *radelem; // element radii - double *wjelem; // elements weights + double *radelem; // element radii + double *wjelem; // elements weights int twojmax, switchflag, bzeroflag; int chemflag, bnormflag, wselfallflag; double rfac0, rmin0; }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model.h b/src/MLIAP/mliap_model.h index 98bae35d2f..bc64439b39 100644 --- a/src/MLIAP/mliap_model.h +++ b/src/MLIAP/mliap_model.h @@ -19,40 +19,38 @@ namespace LAMMPS_NS { class MLIAPModel : protected Pointers { -public: - MLIAPModel(LAMMPS*, char*); + public: + MLIAPModel(LAMMPS *, char *); ~MLIAPModel(); void set_ndescriptors(int); void set_nelements(int); - virtual int get_nparams()=0; - virtual int get_gamma_nnz(class MLIAPData*)=0; - virtual void compute_gradients(class MLIAPData*)=0; - virtual void compute_gradgrads(class MLIAPData*)=0; - virtual void compute_force_gradients(class MLIAPData*)=0; + virtual int get_nparams() = 0; + virtual int get_gamma_nnz(class MLIAPData *) = 0; + virtual void compute_gradients(class MLIAPData *) = 0; + virtual void compute_gradgrads(class MLIAPData *) = 0; + virtual void compute_force_gradients(class MLIAPData *) = 0; virtual void init(); - virtual double memory_usage()=0; - int nelements; // # of unique elements - int nonlinearflag; // 1 if gradient() requires descriptors - int ndescriptors; // number of descriptors - int nparams; // number of parameters per element + virtual double memory_usage() = 0; + int nelements; // # of unique elements + int nonlinearflag; // 1 if gradient() requires descriptors + int ndescriptors; // number of descriptors + int nparams; // number of parameters per element -protected: - virtual void read_coeffs(char *)=0; + protected: + virtual void read_coeffs(char *) = 0; }; class MLIAPModelSimple : public MLIAPModel { -public: - MLIAPModelSimple(LAMMPS*, char*); + public: + MLIAPModelSimple(LAMMPS *, char *); ~MLIAPModelSimple(); virtual double memory_usage(); -protected: - double **coeffelem; // element coefficients + protected: + double **coeffelem; // element coefficients virtual void read_coeffs(char *); - }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_linear.h b/src/MLIAP/mliap_model_linear.h index 1603f0cb53..f7b4e84a88 100644 --- a/src/MLIAP/mliap_model_linear.h +++ b/src/MLIAP/mliap_model_linear.h @@ -19,18 +19,18 @@ namespace LAMMPS_NS { class MLIAPModelLinear : public MLIAPModelSimple { -public: - MLIAPModelLinear(LAMMPS*, char* = nullptr); + public: + MLIAPModelLinear(LAMMPS *, char * = nullptr); ~MLIAPModelLinear(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); -protected: + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); + + protected: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_nn.h b/src/MLIAP/mliap_model_nn.h index 0f04b09f9a..adbe93e9e2 100644 --- a/src/MLIAP/mliap_model_nn.h +++ b/src/MLIAP/mliap_model_nn.h @@ -19,50 +19,51 @@ namespace LAMMPS_NS { class MLIAPModelNN : public MLIAPModel { -public: - MLIAPModelNN(LAMMPS*, char* = nullptr); + public: + MLIAPModelNN(LAMMPS *, char * = nullptr); ~MLIAPModelNN(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); virtual double memory_usage(); - int nlayers; // number of layers per element + int nlayers; // number of layers per element -protected: - int *activation; // activation functions - int *nnodes; // number of nodes per layer - double ***scale; // element scale values - double **coeffelem; // element coefficients + protected: + int *activation; // activation functions + int *nnodes; // number of nodes per layer + double ***scale; // element scale values + double **coeffelem; // element coefficients virtual void read_coeffs(char *); - inline double sigm(double x, double &deriv) { - double expl = 1./(1.+exp(-x)); - deriv = expl*(1-expl); + inline double sigm(double x, double &deriv) + { + double expl = 1. / (1. + exp(-x)); + deriv = expl * (1 - expl); return expl; } - inline double tanh(double x, double &deriv) { - double expl = 2./(1.+exp(-2.*x))-1; - deriv = 1.-expl*expl; + inline double tanh(double x, double &deriv) + { + double expl = 2. / (1. + exp(-2. * x)) - 1; + deriv = 1. - expl * expl; return expl; } - inline double relu(double x, double &deriv) { + inline double relu(double x, double &deriv) + { if (x > 0) { - deriv = 1.; - return x; + deriv = 1.; + return x; } else { - deriv = 0.; - return 0; + deriv = 0.; + return 0; } } - }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_python.h b/src/MLIAP/mliap_model_python.h index f776b9a795..fc8ebeaa47 100644 --- a/src/MLIAP/mliap_model_python.h +++ b/src/MLIAP/mliap_model_python.h @@ -18,30 +18,27 @@ namespace LAMMPS_NS { - class MLIAPModelPython : public MLIAPModel { -public: - MLIAPModelPython(LAMMPS*, char* = NULL); + public: + MLIAPModelPython(LAMMPS *, char * = NULL); ~MLIAPModelPython(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); virtual double memory_usage(); - void connect_param_counts(); // If possible convert this to protected/private and - // and figure out how to declare cython fn - // load_from_python as a friend. + void connect_param_counts(); // If possible convert this to protected/private and + // and figure out how to declare cython fn + // load_from_python as a friend. int model_loaded; -protected: + protected: virtual void read_coeffs(char *); -private: - + private: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/mliap_model_quadratic.h b/src/MLIAP/mliap_model_quadratic.h index eabb8acfbe..7c664b51cf 100644 --- a/src/MLIAP/mliap_model_quadratic.h +++ b/src/MLIAP/mliap_model_quadratic.h @@ -19,19 +19,18 @@ namespace LAMMPS_NS { class MLIAPModelQuadratic : public MLIAPModelSimple { -public: - MLIAPModelQuadratic(LAMMPS*, char* = nullptr); + public: + MLIAPModelQuadratic(LAMMPS *, char * = nullptr); ~MLIAPModelQuadratic(); virtual int get_nparams(); - virtual int get_gamma_nnz(class MLIAPData*); - virtual void compute_gradients(class MLIAPData*); - virtual void compute_gradgrads(class MLIAPData*); - virtual void compute_force_gradients(class MLIAPData*); + virtual int get_gamma_nnz(class MLIAPData *); + virtual void compute_gradients(class MLIAPData *); + virtual void compute_gradgrads(class MLIAPData *); + virtual void compute_force_gradients(class MLIAPData *); -protected: + protected: }; -} +} // namespace LAMMPS_NS #endif - diff --git a/src/MLIAP/pair_mliap.h b/src/MLIAP/pair_mliap.h index becd5a3b21..0de16d7122 100644 --- a/src/MLIAP/pair_mliap.h +++ b/src/MLIAP/pair_mliap.h @@ -25,29 +25,28 @@ PairStyle(mliap,PairMLIAP); namespace LAMMPS_NS { class PairMLIAP : public Pair { -public: + public: PairMLIAP(class LAMMPS *); ~PairMLIAP(); virtual void compute(int, int); void settings(int, char **); virtual void coeff(int, char **); - void e_tally(class MLIAPData*); - void v_tally(int, int, double*, double*); + void e_tally(class MLIAPData *); + void v_tally(int, int, double *, double *); virtual void init_style(); virtual double init_one(int, int); virtual double memory_usage(); - int *map; // mapping from atom types to elements + int *map; // mapping from atom types to elements -protected: + protected: virtual void allocate(); - class MLIAPModel* model; - class MLIAPDescriptor* descriptor; + class MLIAPModel *model; + class MLIAPDescriptor *descriptor; class MLIAPData *data; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/MOLECULE/angle_charmm.h b/src/MOLECULE/angle_charmm.h index 27cbd902f8..ed376b7c92 100644 --- a/src/MOLECULE/angle_charmm.h +++ b/src/MOLECULE/angle_charmm.h @@ -37,12 +37,12 @@ class AngleCharmm : public Angle { double single(int, int, int, int); protected: - double *k,*theta0,*k_ub,*r_ub; + double *k, *theta0, *k_ub, *r_ub; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine.h b/src/MOLECULE/angle_cosine.h index 401c8314c3..24c58df336 100644 --- a/src/MOLECULE/angle_cosine.h +++ b/src/MOLECULE/angle_cosine.h @@ -42,7 +42,7 @@ class AngleCosine : public Angle { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine_delta.h b/src/MOLECULE/angle_cosine_delta.h index caee53ace6..715f9bb158 100644 --- a/src/MOLECULE/angle_cosine_delta.h +++ b/src/MOLECULE/angle_cosine_delta.h @@ -31,7 +31,7 @@ class AngleCosineDelta : public AngleCosineSquared { double single(int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine_periodic.h b/src/MOLECULE/angle_cosine_periodic.h index 8c12e5ff85..064b5b9886 100644 --- a/src/MOLECULE/angle_cosine_periodic.h +++ b/src/MOLECULE/angle_cosine_periodic.h @@ -38,12 +38,12 @@ class AngleCosinePeriodic : public Angle { protected: double *k; - int *multiplicity,*b; + int *multiplicity, *b; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_cosine_squared.h b/src/MOLECULE/angle_cosine_squared.h index 20ec3e4998..5fb7df3cd9 100644 --- a/src/MOLECULE/angle_cosine_squared.h +++ b/src/MOLECULE/angle_cosine_squared.h @@ -37,12 +37,12 @@ class AngleCosineSquared : public Angle { virtual double single(int, int, int, int); protected: - double *k,*theta0; + double *k, *theta0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_harmonic.h b/src/MOLECULE/angle_harmonic.h index 05f78dc702..5afb3cf40d 100644 --- a/src/MOLECULE/angle_harmonic.h +++ b/src/MOLECULE/angle_harmonic.h @@ -37,12 +37,12 @@ class AngleHarmonic : public Angle { double single(int, int, int, int); protected: - double *k,*theta0; + double *k, *theta0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/angle_table.h b/src/MOLECULE/angle_table.h index 042662a5d8..cc7ce4235e 100644 --- a/src/MOLECULE/angle_table.h +++ b/src/MOLECULE/angle_table.h @@ -39,16 +39,16 @@ class AngleTable : public Angle { double single(int, int, int, int); protected: - int tabstyle,tablength; + int tabstyle, tablength; double *theta0; struct Table { - int ninput,fpflag; - double fplo,fphi,theta0; - double *afile,*efile,*ffile; - double *e2file,*f2file; - double delta,invdelta,deltasq6; - double *ang,*e,*de,*f,*df,*e2,*f2; + int ninput, fpflag; + double fplo, fphi, theta0; + double *afile, *efile, *ffile; + double *e2file, *f2file; + double delta, invdelta, deltasq6; + double *ang, *e, *de, *f, *df, *e2, *f2; }; int ntables; @@ -71,7 +71,7 @@ class AngleTable : public Angle { void u_lookup(int, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_angle.h b/src/MOLECULE/atom_vec_angle.h index 6f4397328c..e0a6b724a2 100644 --- a/src/MOLECULE/atom_vec_angle.h +++ b/src/MOLECULE/atom_vec_angle.h @@ -36,16 +36,16 @@ class AtomVecAngle : public AtomVec { void data_atom_post(int); private: - int *num_bond,*num_angle; - int **bond_type,**angle_type; + int *num_bond, *num_angle; + int **bond_type, **angle_type; int **nspecial; - int any_bond_negative,any_angle_negative; - int bond_per_atom,angle_per_atom; - int *bond_negative,*angle_negative; + int any_bond_negative, any_angle_negative; + int bond_per_atom, angle_per_atom; + int *bond_negative, *angle_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h index e52c55723d..7cfe7fee0f 100644 --- a/src/MOLECULE/atom_vec_bond.h +++ b/src/MOLECULE/atom_vec_bond.h @@ -45,7 +45,7 @@ class AtomVecBond : public AtomVec { int *bond_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_full.h b/src/MOLECULE/atom_vec_full.h index 4c49ea3c82..e44e119e67 100644 --- a/src/MOLECULE/atom_vec_full.h +++ b/src/MOLECULE/atom_vec_full.h @@ -36,17 +36,16 @@ class AtomVecFull : public AtomVec { void data_atom_post(int); private: - int *num_bond,*num_angle,*num_dihedral,*num_improper; - int **bond_type,**angle_type,**dihedral_type,**improper_type; + int *num_bond, *num_angle, *num_dihedral, *num_improper; + int **bond_type, **angle_type, **dihedral_type, **improper_type; int **nspecial; - int any_bond_negative,any_angle_negative, - any_dihedral_negative,any_improper_negative; - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; - int *bond_negative,*angle_negative,*dihedral_negative,*improper_negative; + int any_bond_negative, any_angle_negative, any_dihedral_negative, any_improper_negative; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; + int *bond_negative, *angle_negative, *dihedral_negative, *improper_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_molecular.h b/src/MOLECULE/atom_vec_molecular.h index 02b01e4e12..0a3be0d183 100644 --- a/src/MOLECULE/atom_vec_molecular.h +++ b/src/MOLECULE/atom_vec_molecular.h @@ -36,17 +36,16 @@ class AtomVecMolecular : public AtomVec { void data_atom_post(int); private: - int *num_bond,*num_angle,*num_dihedral,*num_improper; - int **bond_type,**angle_type,**dihedral_type,**improper_type; + int *num_bond, *num_angle, *num_dihedral, *num_improper; + int **bond_type, **angle_type, **dihedral_type, **improper_type; int **nspecial; - int any_bond_negative,any_angle_negative, - any_dihedral_negative,any_improper_negative; - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; - int *bond_negative,*angle_negative,*dihedral_negative,*improper_negative; + int any_bond_negative, any_angle_negative, any_dihedral_negative, any_improper_negative; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; + int *bond_negative, *angle_negative, *dihedral_negative, *improper_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/atom_vec_template.h b/src/MOLECULE/atom_vec_template.h index 24c9e4e472..a9b6e4bb96 100644 --- a/src/MOLECULE/atom_vec_template.h +++ b/src/MOLECULE/atom_vec_template.h @@ -36,10 +36,10 @@ class AtomVecTemplate : public AtomVec { void data_atom_post(int); private: - int *molindex,*molatom; + int *molindex, *molatom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_gromos.h b/src/MOLECULE/bond_gromos.h index 71003d4c70..e3fd810133 100644 --- a/src/MOLECULE/bond_gromos.h +++ b/src/MOLECULE/bond_gromos.h @@ -38,12 +38,12 @@ class BondGromos : public Bond { virtual void *extract(const char *, int &); protected: - double *k,*r0; + double *k, *r0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_harmonic.h b/src/MOLECULE/bond_harmonic.h index 295428e516..472b2eac3f 100644 --- a/src/MOLECULE/bond_harmonic.h +++ b/src/MOLECULE/bond_harmonic.h @@ -38,12 +38,12 @@ class BondHarmonic : public Bond { virtual void *extract(const char *, int &); protected: - double *k,*r0; + double *k, *r0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_morse.h b/src/MOLECULE/bond_morse.h index a1fde70f73..db05bf8d30 100644 --- a/src/MOLECULE/bond_morse.h +++ b/src/MOLECULE/bond_morse.h @@ -38,12 +38,12 @@ class BondMorse : public Bond { virtual void *extract(const char *, int &); protected: - double *d0,*alpha,*r0; + double *d0, *alpha, *r0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_nonlinear.h b/src/MOLECULE/bond_nonlinear.h index b58e163d7b..6262788292 100644 --- a/src/MOLECULE/bond_nonlinear.h +++ b/src/MOLECULE/bond_nonlinear.h @@ -38,12 +38,12 @@ class BondNonlinear : public Bond { virtual void *extract(const char *, int &); protected: - double *epsilon,*r0,*lamda; + double *epsilon, *r0, *lamda; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_quartic.h b/src/MOLECULE/bond_quartic.h index c55bb473f1..bde3353c38 100644 --- a/src/MOLECULE/bond_quartic.h +++ b/src/MOLECULE/bond_quartic.h @@ -39,12 +39,12 @@ class BondQuartic : public Bond { protected: double TWO_1_3; - double *k,*b1,*b2,*rc,*u0; + double *k, *b1, *b2, *rc, *u0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/bond_table.h b/src/MOLECULE/bond_table.h index 7831104467..4ac22c6cdd 100644 --- a/src/MOLECULE/bond_table.h +++ b/src/MOLECULE/bond_table.h @@ -39,17 +39,17 @@ class BondTable : public Bond { double single(int, double, int, int, double &); protected: - int tabstyle,tablength; + int tabstyle, tablength; double *r0; struct Table { - int ninput,fpflag; - double fplo,fphi,r0; - double lo,hi; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double delta,invdelta,deltasq6; - double *r,*e,*de,*f,*df,*e2,*f2; + int ninput, fpflag; + double fplo, fphi, r0; + double lo, hi; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double delta, invdelta, deltasq6; + double *r, *e, *de, *f, *df, *e2, *f2; }; int ntables; @@ -72,7 +72,7 @@ class BondTable : public Bond { void u_lookup(int, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_charmm.h b/src/MOLECULE/dihedral_charmm.h index bbcb1271ae..2da2c8d95d 100644 --- a/src/MOLECULE/dihedral_charmm.h +++ b/src/MOLECULE/dihedral_charmm.h @@ -36,15 +36,15 @@ class DihedralCharmm : public Dihedral { void write_data(FILE *); protected: - double *k,*weight,*cos_shift,*sin_shift; - int *multiplicity,*shift; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; - int implicit,weightflag; + double *k, *weight, *cos_shift, *sin_shift; + int *multiplicity, *shift; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; + int implicit, weightflag; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_charmmfsw.h b/src/MOLECULE/dihedral_charmmfsw.h index ed391ea525..b8b8bcd113 100644 --- a/src/MOLECULE/dihedral_charmmfsw.h +++ b/src/MOLECULE/dihedral_charmmfsw.h @@ -36,19 +36,19 @@ class DihedralCharmmfsw : public Dihedral { void write_data(FILE *); protected: - int implicit,weightflag,dihedflag; - double cut_lj_inner14,cut_lj14,cut_coul14; - double evdwl14_12,evdwl14_6,cut_coulinv14; - double cut_lj_inner3inv,cut_lj_inner6inv,cut_lj3inv,cut_lj6inv; + int implicit, weightflag, dihedflag; + double cut_lj_inner14, cut_lj14, cut_coul14; + double evdwl14_12, evdwl14_6, cut_coulinv14; + double cut_lj_inner3inv, cut_lj_inner6inv, cut_lj3inv, cut_lj6inv; - double *k,*weight,*cos_shift,*sin_shift; - int *multiplicity,*shift; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double *k, *weight, *cos_shift, *sin_shift; + int *multiplicity, *shift; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_harmonic.h b/src/MOLECULE/dihedral_harmonic.h index 950a9711c9..026b7015dd 100644 --- a/src/MOLECULE/dihedral_harmonic.h +++ b/src/MOLECULE/dihedral_harmonic.h @@ -35,13 +35,13 @@ class DihedralHarmonic : public Dihedral { void write_data(FILE *); protected: - double *k,*cos_shift,*sin_shift; - int *sign,*multiplicity; + double *k, *cos_shift, *sin_shift; + int *sign, *multiplicity; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_helix.h b/src/MOLECULE/dihedral_helix.h index 6f82efd0b8..dcc8cb693d 100644 --- a/src/MOLECULE/dihedral_helix.h +++ b/src/MOLECULE/dihedral_helix.h @@ -35,12 +35,12 @@ class DihedralHelix : public Dihedral { void write_data(FILE *); protected: - double *aphi,*bphi,*cphi; + double *aphi, *bphi, *cphi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_multi_harmonic.h b/src/MOLECULE/dihedral_multi_harmonic.h index 6d6768ec95..ecba11dc7b 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.h +++ b/src/MOLECULE/dihedral_multi_harmonic.h @@ -35,12 +35,12 @@ class DihedralMultiHarmonic : public Dihedral { void write_data(FILE *); protected: - double *a1,*a2,*a3,*a4,*a5; + double *a1, *a2, *a3, *a4, *a5; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/dihedral_opls.h b/src/MOLECULE/dihedral_opls.h index 1ed80df7f1..4dc112fb7a 100644 --- a/src/MOLECULE/dihedral_opls.h +++ b/src/MOLECULE/dihedral_opls.h @@ -35,12 +35,12 @@ class DihedralOPLS : public Dihedral { void write_data(FILE *); protected: - double *k1,*k2,*k3,*k4; + double *k1, *k2, *k3, *k4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/fix_cmap.h b/src/MOLECULE/fix_cmap.h index c5e92fdf03..afd6700c04 100644 --- a/src/MOLECULE/fix_cmap.h +++ b/src/MOLECULE/fix_cmap.h @@ -65,10 +65,10 @@ class FixCMAP : public Fix { double memory_usage(); private: - int nprocs,me; - int newton_bond,eflag_caller; - int ctype,ilevel_respa; - int ncrosstermtypes,crossterm_per_atom,maxcrossterm; + int nprocs, me; + int newton_bond, eflag_caller; + int ctype, ilevel_respa; + int ncrosstermtypes, crossterm_per_atom, maxcrossterm; int ncrosstermlist; bigint ncmap; @@ -77,12 +77,12 @@ class FixCMAP : public Fix { int nmax_previous; int *num_crossterm; int **crossterm_type; - tagint **crossterm_atom1,**crossterm_atom2,**crossterm_atom3; - tagint **crossterm_atom4,**crossterm_atom5; + tagint **crossterm_atom1, **crossterm_atom2, **crossterm_atom3; + tagint **crossterm_atom4, **crossterm_atom5; - double E,dEdPhi,dEdPsi; + double E, dEdPhi, dEdPsi; double ecmap; - double fcmap[4],cij[4][4]; + double fcmap[4], cij[4][4]; double *g_axis; // CMAP grid points obtained from external file @@ -91,7 +91,7 @@ class FixCMAP : public Fix { // partial derivatives and cross-derivatives of the grid data - double ***d1cmapgrid,***d2cmapgrid,***d12cmapgrid; + double ***d1cmapgrid, ***d2cmapgrid, ***d12cmapgrid; // read map grid data @@ -112,8 +112,8 @@ class FixCMAP : public Fix { // calculate dihedral angles - double dihedral_angle_atan2(double, double, double, double, double, double, - double, double, double, double); + double dihedral_angle_atan2(double, double, double, double, double, double, double, double, + double, double); // calculate bicubic interpolation coefficient matrix c_ij @@ -121,10 +121,9 @@ class FixCMAP : public Fix { // perform bicubic interpolation at point of interest - void bc_interpol(double, double, int, int, double *, double *, double *, - double *); + void bc_interpol(double, double, int, int, double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/improper_cvff.h b/src/MOLECULE/improper_cvff.h index 6dd9cde021..a4313e66b9 100644 --- a/src/MOLECULE/improper_cvff.h +++ b/src/MOLECULE/improper_cvff.h @@ -36,12 +36,12 @@ class ImproperCvff : public Improper { protected: double *k; - int *sign,*multiplicity; + int *sign, *multiplicity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/improper_harmonic.h b/src/MOLECULE/improper_harmonic.h index 8bbfcd81de..0ac3792e9b 100644 --- a/src/MOLECULE/improper_harmonic.h +++ b/src/MOLECULE/improper_harmonic.h @@ -35,12 +35,12 @@ class ImproperHarmonic : public Improper { void write_data(FILE *); protected: - double *k,*chi; + double *k, *chi; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/improper_umbrella.h b/src/MOLECULE/improper_umbrella.h index 7c74bc1fea..7dfbfb6c0f 100644 --- a/src/MOLECULE/improper_umbrella.h +++ b/src/MOLECULE/improper_umbrella.h @@ -40,7 +40,7 @@ class ImproperUmbrella : public Improper { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.h b/src/MOLECULE/pair_hbond_dreiding_lj.h index 8ca497062b..90f72daccf 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.h +++ b/src/MOLECULE/pair_hbond_dreiding_lj.h @@ -36,31 +36,31 @@ class PairHbondDreidingLJ : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double cut_inner_global,cut_outer_global,cut_angle_global; + double cut_inner_global, cut_outer_global, cut_angle_global; int ap_global; struct Param { - double epsilon,sigma; - double lj1,lj2,lj3,lj4; - double d0,alpha,r0; + double epsilon, sigma; + double lj1, lj2, lj3, lj4; + double d0, alpha, r0; double morse1; double denom_vdw; - double cut_inner,cut_outer,cut_innersq,cut_outersq,cut_angle,offset; + double cut_inner, cut_outer, cut_innersq, cut_outersq, cut_angle, offset; int ap; }; - Param *params; // parameter set for an I-J-K interaction - int nparams; // number of parameters read + Param *params; // parameter set for an I-J-K interaction + int nparams; // number of parameters read int maxparam; - int *donor; // 1 if this type is ever a donor, else 0 - int *acceptor; // 1 if this type is ever an acceptor, else 0 - int ***type2param; // mapping from D,A,H to params, -1 if no map + int *donor; // 1 if this type is ever a donor, else 0 + int *acceptor; // 1 if this type is ever an acceptor, else 0 + int ***type2param; // mapping from D,A,H to params, -1 if no map void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.h b/src/MOLECULE/pair_hbond_dreiding_morse.h index 7a40517407..8a5139a1f0 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.h +++ b/src/MOLECULE/pair_hbond_dreiding_morse.h @@ -27,14 +27,14 @@ namespace LAMMPS_NS { class PairHbondDreidingMorse : public PairHbondDreidingLJ { public: PairHbondDreidingMorse(class LAMMPS *); - virtual ~PairHbondDreidingMorse() {}; + virtual ~PairHbondDreidingMorse(){}; virtual void compute(int, int); void coeff(int, char **); void init_style(); double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.h b/src/MOLECULE/pair_lj_charmm_coul_charmm.h index 4c5bf0acde..5389377739 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.h +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.h @@ -44,17 +44,17 @@ class PairLJCharmmCoulCharmm : public Pair { protected: int implicit; - double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul; - double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq; - double denom_lj,denom_coul; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double cut_lj_inner, cut_lj, cut_coul_inner, cut_coul; + double cut_lj_innersq, cut_ljsq, cut_coul_innersq, cut_coulsq, cut_bothsq; + double denom_lj, denom_coul; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h index 8a761c19c1..c51b95ac6b 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h @@ -31,7 +31,7 @@ class PairLJCharmmCoulCharmmImplicit : public PairLJCharmmCoulCharmm { double single(int, int, int, int, double, double, double, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h index 3c5c21cc84..800440183e 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.h @@ -46,20 +46,20 @@ class PairLJCharmmfswCoulCharmmfsh : public Pair { int implicit; int dihedflag; - double cut_lj_inner,cut_lj,cut_coul,cut_coulinv,cut_ljinv,cut_lj_innerinv; - double cut_lj_innersq,cut_ljsq,cut_coulsq,cut_bothsq; - double cut_lj3inv,cut_lj_inner3inv,cut_lj3,cut_lj_inner3; - double cut_lj6inv,cut_lj_inner6inv,cut_lj6,cut_lj_inner6; - double denom_lj,denom_lj12,denom_lj6; + double cut_lj_inner, cut_lj, cut_coul, cut_coulinv, cut_ljinv, cut_lj_innerinv; + double cut_lj_innersq, cut_ljsq, cut_coulsq, cut_bothsq; + double cut_lj3inv, cut_lj_inner3inv, cut_lj3, cut_lj_inner3; + double cut_lj6inv, cut_lj_inner6inv, cut_lj6, cut_lj_inner6; + double denom_lj, denom_lj12, denom_lj6; - double **epsilon,**sigma,**eps14,**sigma14; - double **lj1,**lj2,**lj3,**lj4; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double **epsilon, **sigma, **eps14, **sigma14; + double **lj1, **lj2, **lj3, **lj4; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.h b/src/MOLECULE/pair_lj_cut_tip4p_cut.h index 45f041dc94..89cc00b32d 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.h +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.h @@ -43,27 +43,27 @@ class PairLJCutTIP4PCut : public Pair { double memory_usage(); protected: - double cut_lj_global,cut_coul_global; - double cut_coul,cut_coulsq; - double cut_coulsqplus; // extended value for cut_coulsq - double **cut_lj,**cut_ljsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double cut_coul, cut_coulsq; + double cut_coulsqplus; // extended value for cut_coulsq + double **cut_lj, **cut_ljsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P double qdist; - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void allocate(); void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MOLECULE/pair_tip4p_cut.h b/src/MOLECULE/pair_tip4p_cut.h index d79e338e40..b5f5c02ede 100644 --- a/src/MOLECULE/pair_tip4p_cut.h +++ b/src/MOLECULE/pair_tip4p_cut.h @@ -41,23 +41,23 @@ class PairTIP4PCut : public Pair { protected: double cut_coul_global; - double cut_coul,cut_coulsq; - double cut_coulsqplus; // extended value for cut_coulsq + double cut_coul, cut_coulsq; + double cut_coulsqplus; // extended value for cut_coulsq - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P double qdist; - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void allocate(); void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_atom_mpiio.h b/src/MPIIO/dump_atom_mpiio.h index 4338ae6203..9ba2a7f0e5 100644 --- a/src/MPIIO/dump_atom_mpiio.h +++ b/src/MPIIO/dump_atom_mpiio.h @@ -31,14 +31,14 @@ class DumpAtomMPIIO : public DumpAtom { virtual ~DumpAtomMPIIO(); protected: - - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) virtual void openfile(); virtual void write_header(bigint); @@ -47,28 +47,26 @@ class DumpAtomMPIIO : public DumpAtom { virtual void init_style(); typedef void (DumpAtomMPIIO::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string - int convert_image_omp(int, double *); // multithreaded version of convert_image - int convert_noimage_omp(int, double *); // multithreaded version of convert_noimage + int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_image_omp(int, double *); // multithreaded version of convert_image + int convert_noimage_omp(int, double *); // multithreaded version of convert_noimage #endif int convert_string(int, double *); typedef void (DumpAtomMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); - - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_cfg_mpiio.h b/src/MPIIO/dump_cfg_mpiio.h index 2599ba77b6..89597e2d1c 100644 --- a/src/MPIIO/dump_cfg_mpiio.h +++ b/src/MPIIO/dump_cfg_mpiio.h @@ -30,16 +30,17 @@ class DumpCFGMPIIO : public DumpCFG { virtual ~DumpCFGMPIIO(); protected: - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_string_omp(int, double *); // multithreaded version of convert_string #endif virtual void openfile(); @@ -49,11 +50,11 @@ class DumpCFGMPIIO : public DumpCFG { virtual void write_data(int, double *); typedef void (DumpCFGMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_string(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_custom_mpiio.h b/src/MPIIO/dump_custom_mpiio.h index 6151a301b1..bd56c105dd 100644 --- a/src/MPIIO/dump_custom_mpiio.h +++ b/src/MPIIO/dump_custom_mpiio.h @@ -30,17 +30,17 @@ class DumpCustomMPIIO : public DumpCustom { virtual ~DumpCustomMPIIO(); protected: - - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_string_omp(int, double *); // multithreaded version of convert_string #endif virtual void openfile(); @@ -50,19 +50,19 @@ class DumpCustomMPIIO : public DumpCustom { virtual void init_style(); typedef void (DumpCustomMPIIO::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); typedef void (DumpCustomMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/dump_xyz_mpiio.h b/src/MPIIO/dump_xyz_mpiio.h index e84077f3d2..e6ed5b60a7 100644 --- a/src/MPIIO/dump_xyz_mpiio.h +++ b/src/MPIIO/dump_xyz_mpiio.h @@ -30,17 +30,17 @@ class DumpXYZMPIIO : public DumpXYZ { virtual ~DumpXYZMPIIO(); protected: - - bigint sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data - char *headerBuffer; // buffer for holding header data + bigint + sumFileSize; // size in bytes of the file up through this rank offset from the end of the header data + char *headerBuffer; // buffer for holding header data MPI_File mpifh; - MPI_Offset mpifo,offsetFromHeader,headerSize, currentFileSize; - int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data - char *filecurrent; // name of file for this round (with % and * replaced) + MPI_Offset mpifo, offsetFromHeader, headerSize, currentFileSize; + int performEstimate; // switch for write_data and write_header methods to use for gathering data and detemining filesize for preallocation vs actually writing the data + char *filecurrent; // name of file for this round (with % and * replaced) #if defined(_OPENMP) - int convert_string_omp(int, double *); // multithreaded version of convert_string + int convert_string_omp(int, double *); // multithreaded version of convert_string #endif virtual void openfile(); @@ -51,12 +51,11 @@ class DumpXYZMPIIO : public DumpXYZ { virtual void init_style(); typedef void (DumpXYZMPIIO::*FnPtrData)(int, double *); - FnPtrData write_choice; // ptr to write data functions + FnPtrData write_choice; // ptr to write data functions void write_string(int, double *); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/MPIIO/restart_mpiio.h b/src/MPIIO/restart_mpiio.h index f3594573be..73e2cb3636 100644 --- a/src/MPIIO/restart_mpiio.h +++ b/src/MPIIO/restart_mpiio.h @@ -18,10 +18,10 @@ namespace LAMMPS_NS { -class RestartMPIIO : protected Pointers { +class RestartMPIIO : protected Pointers { private: - MPI_File mpifh; - int nprocs, myrank; + MPI_File mpifh; + int nprocs, myrank; public: int mpiio_exists; @@ -35,7 +35,7 @@ class RestartMPIIO : protected Pointers { void close(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/MSCG/fix_mscg.h b/src/MSCG/fix_mscg.h index be2c9b36a9..9d6c392f5a 100644 --- a/src/MSCG/fix_mscg.h +++ b/src/MSCG/fix_mscg.h @@ -35,18 +35,18 @@ class FixMSCG : public Fix { void post_run(); private: - int range_flag,name_flag,me,nprocs; - int nframes,n_frames,block_size,n_cg_sites,n_cg_types,*cg_site_types; - int max_partners_bond,max_partners_angle,max_partners_dihedral; - unsigned *n_partners_bond,*n_partners_angle,*n_partners_dihedral; - unsigned **partners_bond,**partners_angle,**partners_dihedral; - double *x1d,*f1d,**f; + int range_flag, name_flag, me, nprocs; + int nframes, n_frames, block_size, n_cg_sites, n_cg_types, *cg_site_types; + int max_partners_bond, max_partners_angle, max_partners_dihedral; + unsigned *n_partners_bond, *n_partners_angle, *n_partners_dihedral; + unsigned **partners_bond, **partners_angle, **partners_dihedral; + double *x1d, *f1d, **f; double box_half_lengths[3]; char **type_names; void *mscg_struct; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_eam_alloy_opt.h b/src/OPT/pair_eam_alloy_opt.h index 381c74ed72..c2f12c5a9c 100644 --- a/src/OPT/pair_eam_alloy_opt.h +++ b/src/OPT/pair_eam_alloy_opt.h @@ -31,7 +31,7 @@ class PairEAMAlloyOpt : public PairEAMAlloy, public PairEAMOpt { virtual ~PairEAMAlloyOpt() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_eam_fs_opt.h b/src/OPT/pair_eam_fs_opt.h index ebbdb058b1..4a11309a7a 100644 --- a/src/OPT/pair_eam_fs_opt.h +++ b/src/OPT/pair_eam_fs_opt.h @@ -31,7 +31,7 @@ class PairEAMFSOpt : public PairEAMFS, public PairEAMOpt { virtual ~PairEAMFSOpt() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_eam_opt.h b/src/OPT/pair_eam_opt.h index 6ba3f04a49..e00e4ec842 100644 --- a/src/OPT/pair_eam_opt.h +++ b/src/OPT/pair_eam_opt.h @@ -33,10 +33,10 @@ class PairEAMOpt : virtual public PairEAM { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.h b/src/OPT/pair_lj_charmm_coul_long_opt.h index 5c4fb0c380..db03cfc9af 100644 --- a/src/OPT/pair_lj_charmm_coul_long_opt.h +++ b/src/OPT/pair_lj_charmm_coul_long_opt.h @@ -30,10 +30,10 @@ class PairLJCharmmCoulLongOpt : public PairLJCharmmCoulLong { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_cut_coul_long_opt.h b/src/OPT/pair_lj_cut_coul_long_opt.h index d800311a33..101223131f 100644 --- a/src/OPT/pair_lj_cut_coul_long_opt.h +++ b/src/OPT/pair_lj_cut_coul_long_opt.h @@ -30,12 +30,10 @@ class PairLJCutCoulLongOpt : public PairLJCutCoulLong { virtual void compute(int, int); protected: - template - void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_cut_opt.h b/src/OPT/pair_lj_cut_opt.h index 1c7051ecb8..710455aa93 100644 --- a/src/OPT/pair_lj_cut_opt.h +++ b/src/OPT/pair_lj_cut_opt.h @@ -30,10 +30,10 @@ class PairLJCutOpt : public PairLJCut { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_cut_tip4p_long_opt.h b/src/OPT/pair_lj_cut_tip4p_long_opt.h index 1ddcaa66e1..823ff6f3af 100644 --- a/src/OPT/pair_lj_cut_tip4p_long_opt.h +++ b/src/OPT/pair_lj_cut_tip4p_long_opt.h @@ -24,22 +24,20 @@ PairStyle(lj/cut/tip4p/long/opt,PairLJCutTIP4PLongOpt); namespace LAMMPS_NS { - class PairLJCutTIP4PLongOpt : public PairLJCutTIP4PLong { +class PairLJCutTIP4PLongOpt : public PairLJCutTIP4PLong { public: - PairLJCutTIP4PLongOpt(class LAMMPS *); - virtual ~PairLJCutTIP4PLongOpt() {}; + PairLJCutTIP4PLongOpt(class LAMMPS *); + virtual ~PairLJCutTIP4PLongOpt(){}; virtual void compute(int, int); virtual double memory_usage(); protected: - template < const int, const int, const int, const int > - void eval(); - void compute_newsite_opt(const double *, const double *, - const double *, double *) const; + template void eval(); + void compute_newsite_opt(const double *, const double *, const double *, double *) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_lj_long_coul_long_opt.h b/src/OPT/pair_lj_long_coul_long_opt.h index 97288ad4d2..c9e2c8b78e 100644 --- a/src/OPT/pair_lj_long_coul_long_opt.h +++ b/src/OPT/pair_lj_long_coul_long_opt.h @@ -28,21 +28,19 @@ class PairLJLongCoulLongOpt : public PairLJLongCoulLong { public: PairLJLongCoulLongOpt(class LAMMPS *); virtual void compute(int, int); - virtual void compute_outer(int,int); + virtual void compute_outer(int, int); protected: - template + template void eval(); - template + template void eval_outer(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_morse_opt.h b/src/OPT/pair_morse_opt.h index f96922879d..8fe942550b 100644 --- a/src/OPT/pair_morse_opt.h +++ b/src/OPT/pair_morse_opt.h @@ -30,10 +30,10 @@ class PairMorseOpt : public PairMorse { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/OPT/pair_ufm_opt.h b/src/OPT/pair_ufm_opt.h index 09be6fe0f6..1758d06131 100644 --- a/src/OPT/pair_ufm_opt.h +++ b/src/OPT/pair_ufm_opt.h @@ -36,10 +36,10 @@ class PairUFMOpt : public PairUFM { void compute(int, int); private: - template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval(); + template void eval(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h index 7c287f3392..6a1571574c 100644 --- a/src/PERI/atom_vec_peri.h +++ b/src/PERI/atom_vec_peri.h @@ -35,12 +35,11 @@ class AtomVecPeri : public AtomVec { void pack_property_atom(int, double *, int, int); private: - double *rmass,*vfrac,*s0; + double *rmass, *vfrac, *s0; double **x0; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/compute_damage_atom.h b/src/PERI/compute_damage_atom.h index 433c1d5de8..5a24f5e015 100644 --- a/src/PERI/compute_damage_atom.h +++ b/src/PERI/compute_damage_atom.h @@ -38,7 +38,7 @@ class ComputeDamageAtom : public Compute { int ifix_peri; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/compute_dilatation_atom.h b/src/PERI/compute_dilatation_atom.h index f905a2b5b9..142d581968 100644 --- a/src/PERI/compute_dilatation_atom.h +++ b/src/PERI/compute_dilatation_atom.h @@ -29,6 +29,7 @@ class ComputeDilatationAtom : public Compute { friend class PairPeriLPS; friend class PairPeriVES; friend class PairPeriEPS; + public: ComputeDilatationAtom(class LAMMPS *, int, char **); ~ComputeDilatationAtom(); @@ -39,10 +40,10 @@ class ComputeDilatationAtom : public Compute { private: int nmax; double *dilatation; - int isPMB,isLPS,isVES,isEPS; + int isPMB, isLPS, isVES, isEPS; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/compute_plasticity_atom.h b/src/PERI/compute_plasticity_atom.h index 9d550eabae..d63de39f91 100644 --- a/src/PERI/compute_plasticity_atom.h +++ b/src/PERI/compute_plasticity_atom.h @@ -38,7 +38,7 @@ class ComputePlasticityAtom : public Compute { int ifix_peri; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/fix_peri_neigh.h b/src/PERI/fix_peri_neigh.h index 7a6e34d708..d7f393cb9a 100644 --- a/src/PERI/fix_peri_neigh.h +++ b/src/PERI/fix_peri_neigh.h @@ -35,7 +35,7 @@ class FixPeriNeigh : public Fix { friend class ComputePlasticityAtom; public: - FixPeriNeigh(class LAMMPS *,int, char **); + FixPeriNeigh(class LAMMPS *, int, char **); virtual ~FixPeriNeigh(); int setmask(); void init(); @@ -57,27 +57,26 @@ class FixPeriNeigh : public Fix { int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); - protected: - int first; // flag for first time initialization - int maxpartner; // max # of peridynamic neighs for any atom - int *npartner; // # of neighbors for each atom - tagint **partner; // neighs for each atom, stored as global IDs - double **deviatorextention; // Deviatoric extension - double **deviatorBackextention; // Deviatoric back extension - double **deviatorPlasticextension; // Deviatoric plastic extension + int first; // flag for first time initialization + int maxpartner; // max # of peridynamic neighs for any atom + int *npartner; // # of neighbors for each atom + tagint **partner; // neighs for each atom, stored as global IDs + double **deviatorextention; // Deviatoric extension + double **deviatorBackextention; // Deviatoric back extension + double **deviatorPlasticextension; // Deviatoric plastic extension double *lambdaValue; - double **r0; // initial distance to partners - double **r1; // instanteneous distance to partners - double *thetaValue; // dilatation - double *vinter; // sum of vfrac for bonded neighbors - double *wvolume; // weighted volume of particle - int isPMB,isLPS,isVES,isEPS; // which flavor of PD + double **r0; // initial distance to partners + double **r1; // instanteneous distance to partners + double *thetaValue; // dilatation + double *vinter; // sum of vfrac for bonded neighbors + double *wvolume; // weighted volume of particle + int isPMB, isLPS, isVES, isEPS; // which flavor of PD class NeighList *list; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_eps.h b/src/PERI/pair_peri_eps.h index 2cd687ba29..d8463af5ae 100644 --- a/src/PERI/pair_peri_eps.h +++ b/src/PERI/pair_peri_eps.h @@ -53,7 +53,7 @@ class PairPeriEPS : public Pair { double **bulkmodulus; double **shearmodulus; double **s00, **alpha; - double **cut, **m_yieldstress; //NEW: **m_yieldstress + double **cut, **m_yieldstress; //NEW: **m_yieldstress double *s0_new; int nmax; @@ -61,7 +61,7 @@ class PairPeriEPS : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_lps.h b/src/PERI/pair_peri_lps.h index d0218c6c2f..35bcfdb9aa 100644 --- a/src/PERI/pair_peri_lps.h +++ b/src/PERI/pair_peri_lps.h @@ -51,7 +51,7 @@ class PairPeriLPS : public Pair { int ifix_peri; double **bulkmodulus; double **shearmodulus; - double **s00,**alpha; + double **s00, **alpha; double **cut; double *s0_new; @@ -60,7 +60,7 @@ class PairPeriLPS : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_pmb.h b/src/PERI/pair_peri_pmb.h index 89025181a9..37b9f22255 100644 --- a/src/PERI/pair_peri_pmb.h +++ b/src/PERI/pair_peri_pmb.h @@ -52,7 +52,7 @@ class PairPeriPMB : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PERI/pair_peri_ves.h b/src/PERI/pair_peri_ves.h index 39b91d88f2..b0733115f1 100644 --- a/src/PERI/pair_peri_ves.h +++ b/src/PERI/pair_peri_ves.h @@ -47,7 +47,6 @@ class PairPeriVES : public Pair { double influence_function(double, double, double); void compute_dilatation(); - protected: int ifix_peri; double **bulkmodulus; @@ -63,7 +62,7 @@ class PairPeriVES : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PLUGIN/plugin.h b/src/PLUGIN/plugin.h index 23594b8789..8bf8c97d5f 100644 --- a/src/PLUGIN/plugin.h +++ b/src/PLUGIN/plugin.h @@ -20,29 +20,28 @@ CommandStyle(plugin,Plugin); #ifndef LMP_PLUGIN_H #define LMP_PLUGIN_H -#include "lammpsplugin.h" #include "command.h" +#include "lammpsplugin.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { - class Plugin : public Command { - public: - Plugin(class LAMMPS *); - void command(int, char **); - }; +class Plugin : public Command { + public: + Plugin(class LAMMPS *); + void command(int, char **); +}; - void plugin_load(const char *, LAMMPS *); - void plugin_register(lammpsplugin_t *, void *); +void plugin_load(const char *, LAMMPS *); +void plugin_register(lammpsplugin_t *, void *); - void plugin_unload(const char *, const char *, LAMMPS *); - void plugin_erase(const char *, const char *); - void plugin_clear(LAMMPS *); +void plugin_unload(const char *, const char *, LAMMPS *); +void plugin_erase(const char *, const char *); +void plugin_clear(LAMMPS *); - int plugin_get_num_plugins(); - int plugin_find(const char *, const char *); - const lammpsplugin_t *plugin_get_info(int); -} +int plugin_get_num_plugins(); +int plugin_find(const char *, const char *); +const lammpsplugin_t *plugin_get_info(int); +} // namespace LAMMPS_NS #endif #endif diff --git a/src/POEMS/fix_poems.h b/src/POEMS/fix_poems.h index 75180e2f26..adf2d5d7e4 100644 --- a/src/POEMS/fix_poems.h +++ b/src/POEMS/fix_poems.h @@ -26,7 +26,7 @@ class Workspace; namespace LAMMPS_NS { -class FixPOEMS : public Fix { +class FixPOEMS : public Fix { public: FixPOEMS(class LAMMPS *, int narg, char **arg); ~FixPOEMS(); @@ -54,7 +54,7 @@ class FixPOEMS : public Fix { private: int me; - double dtv,dtf,dthalf; + double dtv, dtf, dthalf; double *step_respa; int nlevels_respa; double total_ke; @@ -63,36 +63,36 @@ class FixPOEMS : public Fix { // atom assignment to rigid bodies // double count joint atoms as being in multiple bodies - int *natom2body; // # of bodies each atom is part of - int **atom2body; // list of bodies each atom is part of - double **displace; // atom displace in body coords for 1st body it's in + int *natom2body; // # of bodies each atom is part of + int **atom2body; // list of bodies each atom is part of + double **displace; // atom displace in body coords for 1st body it's in // rigid body properties // only nrigid double counts joint atoms as being in multiple bodies // other quantities only count a joint atom as being in 1st body - int nbody; // # of rigid bodies - int *nrigid; // # of atoms in each rigid body - double *masstotal; // total mass of each rigid body - double **xcm; // coords of center-of-mass of each rigid body - double **vcm; // velocity of center-of-mass of each - double **fcm; // force on center-of-mass of each - double **inertia; // 6 inertia components of each (xx,yy,zz,xy,yz,xz) - double **ex_space,**ey_space,**ez_space; - // orientation of each body in space coords - double **angmom; // angular momentum of each in space coords - double **omega; // angular velocity of each in space coords - double **torque; // torque on each rigid body in space coords - double **sum,**all; // work vectors + int nbody; // # of rigid bodies + int *nrigid; // # of atoms in each rigid body + double *masstotal; // total mass of each rigid body + double **xcm; // coords of center-of-mass of each rigid body + double **vcm; // velocity of center-of-mass of each + double **fcm; // force on center-of-mass of each + double **inertia; // 6 inertia components of each (xx,yy,zz,xy,yz,xz) + double **ex_space, **ey_space, **ez_space; + // orientation of each body in space coords + double **angmom; // angular momentum of each in space coords + double **omega; // angular velocity of each in space coords + double **torque; // torque on each rigid body in space coords + double **sum, **all; // work vectors // joint attributes between pairs of rigid bodies - int ncluster; // # of independent clusters of coupled bodies - int njoint; // # of interbody joints - int **jointbody; // indices of 2 rigid bodies in each joint (1-N) - double **xjoint; // coords of each joint point - int nfree; // # of isolated unconnected bodies - int *freelist; // indices of isolated bodies (1-N) + int ncluster; // # of independent clusters of coupled bodies + int njoint; // # of interbody joints + int **jointbody; // indices of 2 rigid bodies in each joint (1-N) + double **xjoint; // coords of each joint point + int nfree; // # of isolated unconnected bodies + int *freelist; // indices of isolated bodies (1-N) // POEMS object @@ -106,13 +106,12 @@ class FixPOEMS : public Fix { void jointbuild(); void sortlist(int, tagint **); int loopcheck(int, int, tagint **); - void omega_from_mq(double *, double *, double *, double *, - double *, double *); + void omega_from_mq(double *, double *, double *, double *, double *, double *); void set_v(); void set_xv(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/fix_python_invoke.h b/src/PYTHON/fix_python_invoke.h index 3e142748a9..351561c05c 100644 --- a/src/PYTHON/fix_python_invoke.h +++ b/src/PYTHON/fix_python_invoke.h @@ -21,7 +21,6 @@ FixStyle(python,FixPythonInvoke); #ifndef LMP_FIX_PYTHON_INVOKE_H #define LMP_FIX_PYTHON_INVOKE_H - #include "fix.h" namespace LAMMPS_NS { @@ -35,12 +34,12 @@ class FixPythonInvoke : public Fix { virtual void post_force(int); private: - void * lmpPtr; - void * pFunc; + void *lmpPtr; + void *pFunc; int selected_callback; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/fix_python_move.h b/src/PYTHON/fix_python_move.h index a182b69a62..e6324b2012 100644 --- a/src/PYTHON/fix_python_move.h +++ b/src/PYTHON/fix_python_move.h @@ -48,10 +48,10 @@ class FixPythonMove : public Fix { virtual void reset_dt(); protected: - void * py_move; + void *py_move; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/pair_python.h b/src/PYTHON/pair_python.h index c68497049c..0296feb787 100644 --- a/src/PYTHON/pair_python.h +++ b/src/PYTHON/pair_python.h @@ -46,14 +46,14 @@ class PairPython : public Pair { protected: double cut_global; - void * py_potential; - int * skip_types; + void *py_potential; + int *skip_types; virtual void allocate(); - void * get_member_function(const char *); + void *get_member_function(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/PYTHON/python_impl.h b/src/PYTHON/python_impl.h index c031eb236c..dff912ca8c 100644 --- a/src/PYTHON/python_impl.h +++ b/src/PYTHON/python_impl.h @@ -14,8 +14,8 @@ #ifndef LMP_PYTHON_IMPL_H #define LMP_PYTHON_IMPL_H -#include "pointers.h" #include "lmppython.h" +#include "pointers.h" namespace LAMMPS_NS { @@ -35,15 +35,15 @@ class PythonImpl : protected Pointers, public PythonInterface { bool has_minimum_version(int major, int minor); private: - int ninput,noutput,length_longstr; + int ninput, noutput, length_longstr; char **istr; - char *ostr,*format; + char *ostr, *format; void *pyMain; struct PyFunc { char *name; - int ninput,noutput; - int *itype,*ivarflag; + int ninput, noutput; + int *itype, *ivarflag; int *ivalue; double *dvalue; char **svalue; @@ -61,7 +61,7 @@ class PythonImpl : protected Pointers, public PythonInterface { void deallocate(int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/PYTHON/python_utils.h b/src/PYTHON/python_utils.h index 45dd58456c..177dd74315 100644 --- a/src/PYTHON/python_utils.h +++ b/src/PYTHON/python_utils.h @@ -20,23 +20,22 @@ namespace LAMMPS_NS { namespace PyUtils { -class GIL { - PyGILState_STATE gstate; -public: - GIL() : gstate(PyGILState_Ensure()) { + class GIL { + PyGILState_STATE gstate; + + public: + GIL() : gstate(PyGILState_Ensure()) {} + ~GIL() { PyGILState_Release(gstate); } + }; + + static void Print_Errors() + { + PyErr_Print(); + PyErr_Clear(); } - ~GIL() { - PyGILState_Release(gstate); - } -}; -static void Print_Errors() { - PyErr_Print(); - PyErr_Clear(); -} +} // namespace PyUtils -} - -} +} // namespace LAMMPS_NS #endif diff --git a/src/QEQ/fix_qeq.h b/src/QEQ/fix_qeq.h index 1ec9df5932..6baa242086 100644 --- a/src/QEQ/fix_qeq.h +++ b/src/QEQ/fix_qeq.h @@ -17,10 +17,10 @@ #include "fix.h" #define EV_TO_KCAL_PER_MOL 14.4 -#define DANGER_ZONE 0.90 -#define MIN_CAP 50 -#define SAFE_ZONE 1.2 -#define MIN_NBRS 100 +#define DANGER_ZONE 0.90 +#define MIN_CAP 50 +#define SAFE_ZONE 1.2 +#define MIN_NBRS 100 namespace LAMMPS_NS { @@ -29,7 +29,7 @@ class FixQEq : public Fix { FixQEq(class LAMMPS *, int, char **); ~FixQEq(); int setmask(); - void init_list(int,class NeighList *); + void init_list(int, class NeighList *); void setup_pre_force(int); void setup_pre_force_respa(int, int); void pre_force_respa(int, int, int); @@ -61,13 +61,13 @@ class FixQEq : public Fix { int matvecs; double qeq_time; - double swa, swb; // lower/upper Taper cutoff radius - double Tap[8]; // Taper function - double tolerance; // tolerance for the norm of the rel residual in CG - int maxiter; // maximum number of QEq iterations - double cutoff, cutoff_sq; // neighbor cutoff + double swa, swb; // lower/upper Taper cutoff radius + double Tap[8]; // Taper function + double tolerance; // tolerance for the norm of the rel residual in CG + int maxiter; // maximum number of QEq iterations + double cutoff, cutoff_sq; // neighbor cutoff - double *chi,*eta,*gamma,*zeta,*zcore; // qeq parameters + double *chi, *eta, *gamma, *zeta, *zcore; // qeq parameters double *chizj; double **shld; int streitz_flag, reax_flag; @@ -80,7 +80,7 @@ class FixQEq : public Fix { double **s_hist, **t_hist; int nprev; - typedef struct{ + typedef struct { int n, m; int *firstnbr; int *numnbrs; @@ -106,15 +106,15 @@ class FixQEq : public Fix { void calculate_Q(); - double parallel_norm(double*, int); - double parallel_dot(double*, double*, int); - double parallel_vector_acc(double*, int); + double parallel_norm(double *, int); + double parallel_dot(double *, double *, int); + double parallel_vector_acc(double *, int); - void vector_sum(double *, double, double *, double, double *,int); + void vector_sum(double *, double, double *, double, double *, int); void vector_add(double *, double, double *, int); void init_storage(); - void read_file(char*); + void read_file(char *); void allocate_storage(); void deallocate_storage(); void reallocate_storage(); @@ -123,10 +123,10 @@ class FixQEq : public Fix { void reallocate_matrix(); virtual int CG(double *, double *); - virtual void sparse_matvec(sparse_matrix *, double *,double *); + virtual void sparse_matvec(sparse_matrix *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/QEQ/fix_qeq_dynamic.h b/src/QEQ/fix_qeq_dynamic.h index c5a707ce52..39de88f3ad 100644 --- a/src/QEQ/fix_qeq_dynamic.h +++ b/src/QEQ/fix_qeq_dynamic.h @@ -40,7 +40,7 @@ class FixQEqDynamic : public FixQEq { double compute_eneg(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_fire.h b/src/QEQ/fix_qeq_fire.h index f24238af51..8689c7f7e5 100644 --- a/src/QEQ/fix_qeq_fire.h +++ b/src/QEQ/fix_qeq_fire.h @@ -43,7 +43,7 @@ class FixQEqFire : public FixQEq { class PairComb3 *comb3; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_point.h b/src/QEQ/fix_qeq_point.h index ca61d3cd2c..55b75ae3d1 100644 --- a/src/QEQ/fix_qeq_point.h +++ b/src/QEQ/fix_qeq_point.h @@ -34,9 +34,8 @@ class FixQEqPoint : public FixQEq { private: void init_matvec(); void compute_H(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_shielded.h b/src/QEQ/fix_qeq_shielded.h index 076240e519..e75a2952a4 100644 --- a/src/QEQ/fix_qeq_shielded.h +++ b/src/QEQ/fix_qeq_shielded.h @@ -36,10 +36,9 @@ class FixQEqShielded : public FixQEq { void init_shielding(); void init_matvec(); void compute_H(); - double calculate_H(double,double); - + double calculate_H(double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/QEQ/fix_qeq_slater.h b/src/QEQ/fix_qeq_slater.h index 9fe973234b..aaf7c5aab3 100644 --- a/src/QEQ/fix_qeq_slater.h +++ b/src/QEQ/fix_qeq_slater.h @@ -33,7 +33,7 @@ class FixQEqSlater : public FixQEq { private: void init_matvec(); - void sparse_matvec(sparse_matrix*,double*,double*); + void sparse_matvec(sparse_matrix *, double *, double *); void compute_H(); double calculate_H(double, double, double, double, double &); double calculate_H_wolf(double, double, double, double, double &); @@ -41,7 +41,7 @@ class FixQEqSlater : public FixQEq { class PairCoulStreitz *streitz; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/compute_event_displace.h b/src/REPLICA/compute_event_displace.h index a20a80b51c..e87410fc54 100644 --- a/src/REPLICA/compute_event_displace.h +++ b/src/REPLICA/compute_event_displace.h @@ -34,7 +34,6 @@ class ComputeEventDisplace : public Compute { int all_events(); void reset_extra_compute_fix(const char *); - private: int triclinic; double displace_distsq; @@ -42,7 +41,7 @@ class ComputeEventDisplace : public Compute { class FixEvent *fix_event; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_event.h b/src/REPLICA/fix_event.h index 96a6626477..a0df0e63a0 100644 --- a/src/REPLICA/fix_event.h +++ b/src/REPLICA/fix_event.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class FixEvent : public Fix { public: FixEvent(class LAMMPS *, int, char **); - virtual ~FixEvent()=0; // use destructor to make base class virtual + virtual ~FixEvent() = 0; // use destructor to make base class virtual int setmask(); double memory_usage(); @@ -42,16 +42,16 @@ class FixEvent : public Fix { void restore_state_dephase(); // restore atoms if dephase had event private: - double **xevent; // atom coords at last event - double **xold; // atom coords for reset/restore - double **vold; // atom vels for reset/restore - imageint *imageold; // image flags for reset/restore - double **xorig; // original atom coords for reset/restore - double **vorig; // original atom vels for reset/restore - imageint *imageorig; // original image flags for reset/restore + double **xevent; // atom coords at last event + double **xold; // atom coords for reset/restore + double **vold; // atom vels for reset/restore + imageint *imageold; // image flags for reset/restore + double **xorig; // original atom coords for reset/restore + double **vorig; // original atom vels for reset/restore + imageint *imageorig; // original image flags for reset/restore }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/REPLICA/fix_event_hyper.h b/src/REPLICA/fix_event_hyper.h index 424df3f2e4..fa36b9fd9c 100644 --- a/src/REPLICA/fix_event_hyper.h +++ b/src/REPLICA/fix_event_hyper.h @@ -26,12 +26,12 @@ namespace LAMMPS_NS { class FixEventHyper : public FixEvent { public: - int event_number; // event counter - bigint event_timestep; // timestep of last event on any replica - bigint clock; // total elapsed timesteps across all replicas - int replica_number; // replica where last event occurred - int correlated_event; // 1 if last event was correlated, 0 otherwise - int ncoincident; // # of simultaneous events on different replicas + int event_number; // event counter + bigint event_timestep; // timestep of last event on any replica + bigint clock; // total elapsed timesteps across all replicas + int replica_number; // replica where last event occurred + int correlated_event; // 1 if last event was correlated, 0 otherwise + int ncoincident; // # of simultaneous events on different replicas FixEventHyper(class LAMMPS *, int, char **); ~FixEventHyper() {} @@ -44,7 +44,7 @@ class FixEventHyper : public FixEvent { void store_event_hyper(bigint, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_event_prd.h b/src/REPLICA/fix_event_prd.h index 197cfcb50b..23e9669059 100644 --- a/src/REPLICA/fix_event_prd.h +++ b/src/REPLICA/fix_event_prd.h @@ -26,12 +26,12 @@ namespace LAMMPS_NS { class FixEventPRD : public FixEvent { public: - int event_number; // event counter - bigint event_timestep; // timestep of last event on any replica - bigint clock; // total elapsed timesteps across all replicas - int replica_number; // replica where last event occurred - int correlated_event; // 1 if last event was correlated, 0 otherwise - int ncoincident; // # of simultaneous events on different replicas + int event_number; // event counter + bigint event_timestep; // timestep of last event on any replica + bigint clock; // total elapsed timesteps across all replicas + int replica_number; // replica where last event occurred + int correlated_event; // 1 if last event was correlated, 0 otherwise + int ncoincident; // # of simultaneous events on different replicas FixEventPRD(class LAMMPS *, int, char **); ~FixEventPRD() {} @@ -44,10 +44,9 @@ class FixEventPRD : public FixEvent { void store_event_prd(bigint, int); private: - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_event_tad.h b/src/REPLICA/fix_event_tad.h index 131b9631e5..6752e13965 100644 --- a/src/REPLICA/fix_event_tad.h +++ b/src/REPLICA/fix_event_tad.h @@ -26,10 +26,10 @@ namespace LAMMPS_NS { class FixEventTAD : public FixEvent { public: - int event_number; // event counter - bigint event_timestep; // timestep of last event - double tlo; // event time at low temperature - double ebarrier; // energy barrier for this event + int event_number; // event counter + bigint event_timestep; // timestep of last event + double tlo; // event time at low temperature + double ebarrier; // energy barrier for this event FixEventTAD(class LAMMPS *, int, char **); ~FixEventTAD() {} @@ -42,10 +42,9 @@ class FixEventTAD : public FixEvent { void store_event_tad(bigint); private: - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_hyper.h b/src/REPLICA/fix_hyper.h index e2ae205649..62915a1633 100644 --- a/src/REPLICA/fix_hyper.h +++ b/src/REPLICA/fix_hyper.h @@ -36,7 +36,7 @@ class FixHyper : public Fix { int hyperflag; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/REPLICA/fix_hyper_global.h b/src/REPLICA/fix_hyper_global.h index ffdc32b7c9..efdee776db 100644 --- a/src/REPLICA/fix_hyper_global.h +++ b/src/REPLICA/fix_hyper_global.h @@ -48,43 +48,43 @@ class FixHyperGlobal : public FixHyper { private: int me; - double cutbond,qfactor,vmax,tequil; + double cutbond, qfactor, vmax, tequil; - int firstflag,bcastflag,owner,nevent,nevent_atom; - double cutbondsq,beta,dt,t_hyper,invqfactorsq; - double outvec[5]; // same as VECLEN in *.cpp - double maxbondlen; // max length of any bond - double maxdriftsq; // max distance any atom drifts from original pos - int nobias; // # of steps when bias = 0, b/c bond too long - int negstrain; // # of steps when biased bond has negative strain - bigint groupatoms; // # of atoms in fix group + int firstflag, bcastflag, owner, nevent, nevent_atom; + double cutbondsq, beta, dt, t_hyper, invqfactorsq; + double outvec[5]; // same as VECLEN in *.cpp + double maxbondlen; // max length of any bond + double maxdriftsq; // max distance any atom drifts from original pos + int nobias; // # of steps when bias = 0, b/c bond too long + int negstrain; // # of steps when biased bond has negative strain + bigint groupatoms; // # of atoms in fix group class NeighList *list; // list of my owned bonds // persists on a proc from one event until the next - int maxbond; // allocated size of blist + int maxbond; // allocated size of blist - struct OneBond { // single IJ bond, atom I is owner - int i,j; // current local indices of 2 bond atoms - int iold,jold; // local indices when bonds were formed - double r0; // relaxed bond length + struct OneBond { // single IJ bond, atom I is owner + int i, j; // current local indices of 2 bond atoms + int iold, jold; // local indices when bonds were formed + double r0; // relaxed bond length }; - OneBond *blist; // list of owned bonds - int nblocal; // # of owned bonds + OneBond *blist; // list of owned bonds + int nblocal; // # of owned bonds // coords and IDs of owned+ghost atoms when bonds were formed // persists on a proc from one event until the next - int nlocal_old; // nlocal for old atoms - int nall_old; // nlocal+nghost for old atoms - int maxold; // allocated size of old atoms + int nlocal_old; // nlocal for old atoms + int nall_old; // nlocal+nghost for old atoms + int maxold; // allocated size of old atoms - double **xold; // coords of atoms when bonds were formed - tagint *tagold; // IDs of atoms when bonds were forme - int *old2now; // o2n[i] = current local index of old atom I + double **xold; // coords of atoms when bonds were formed + tagint *tagold; // IDs of atoms when bonds were forme + int *old2now; // o2n[i] = current local index of old atom I // MPI data struct for finding bond with max strain via Allreduce @@ -92,14 +92,14 @@ class FixHyperGlobal : public FixHyper { double value; int proc; }; - Two pairme,pairall; + Two pairme, pairall; // internal methods void grow_bond(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_hyper_local.h b/src/REPLICA/fix_hyper_local.h index 36d1bc3efe..81c0cb4773 100644 --- a/src/REPLICA/fix_hyper_local.h +++ b/src/REPLICA/fix_hyper_local.h @@ -23,8 +23,8 @@ FixStyle(hyper/local,FixHyperLocal); #include "fix_hyper.h" namespace LAMMPS_NS { - // forward declaration. struct HyperOneCoeff is defined in my_page.h - struct HyperOneCoeff; +// forward declaration. struct HyperOneCoeff is defined in my_page.h +struct HyperOneCoeff; class FixHyperLocal : public FixHyper { public: @@ -60,19 +60,19 @@ class FixHyperLocal : public FixHyper { // inputs and derived quantities - double cutbond,qfactor,vmax,tequil,dcut; - double alpha_user; // timescale to apply boostostat (time units) - double alpha; // unitless dt/alpha_user - double boost_target; // target value of boost - int checkghost,checkbias; // flags for optional stats + double cutbond, qfactor, vmax, tequil, dcut; + double alpha_user; // timescale to apply boostostat (time units) + double alpha; // unitless dt/alpha_user + double boost_target; // target value of boost + int checkghost, checkbias; // flags for optional stats int checkbias_every; int checkbias_flag; - int boundflag,resetfreq; // bias coeff bounding and reset settings + int boundflag, resetfreq; // bias coeff bounding and reset settings double boundfrac; - bigint groupatoms; // # of atoms in fix group - double cutbondsq,dcutsq; - double beta,invvmax,invqfactorsq; + bigint groupatoms; // # of atoms in fix group + double cutbondsq, dcutsq; + double beta, invvmax, invqfactorsq; // two DEBUG quantities // double myboost; @@ -80,95 +80,95 @@ class FixHyperLocal : public FixHyper { // flags - int setupflag; // 1 during setup, 0 during run - int firstflag; // set for first time bond_build takes place - int nostrainyet; // 1 until maxstrain is first compute - bigint starttime; // timestep when this fix was invoked - int commflag; // flag for communication mode + int setupflag; // 1 during setup, 0 during run + int firstflag; // set for first time bond_build takes place + int nostrainyet; // 1 until maxstrain is first compute + bigint starttime; // timestep when this fix was invoked + int commflag; // flag for communication mode // bias coeff bounds and reset - double bound_lower,bound_upper; + double bound_lower, bound_upper; bigint lastreset; // stats - int nbondbuild; // # of rebuilds of bond list - double time_bondbuild; // CPU time for bond builds + int nbondbuild; // # of rebuilds of bond list + double time_bondbuild; // CPU time for bond builds - bigint allbonds; // current total # of bonds - int maxbondperatom; // max # of bonds any atom ever has - int nevent; // # of events that trigger bond rebuild - int nevent_atom; // # of atoms that experienced an event + bigint allbonds; // current total # of bonds + int maxbondperatom; // max # of bonds any atom ever has + int nevent; // # of events that trigger bond rebuild + int nevent_atom; // # of atoms that experienced an event - bigint nnewbond; // running tally of # of new bonds created - bigint nbias_running; // running count of biased bonds - bigint nobias_running; // ditto for bonds with bias = 0, b/c too long - bigint negstrain_running; // ditto for bonds with negative strain + bigint nnewbond; // running tally of # of new bonds created + bigint nbias_running; // running count of biased bonds + bigint nobias_running; // ditto for bonds with bias = 0, b/c too long + bigint negstrain_running; // ditto for bonds with negative strain - double mybias; // sum of bias potentials for biased bonds - double maxbondlen; // cummulative max length of any bond - double maxdriftsq; // max distance any bond atom drifts from quenched x + double mybias; // sum of bias potentials for biased bonds + double maxbondlen; // cummulative max length of any bond + double maxdriftsq; // max distance any bond atom drifts from quenched x - double sumboost; // sum of all bond boosts at each timestep - double aveboost_running; // cummulative sumboost/allbonds across steps - double aveboost_running_output; // most recent output of ab_running - double sumbiascoeff; // sum of all bond bias coeffs at each timestep - double avebiascoeff_running; // cummulative sumbiascoeff/allbonds across steps - double avebiascoeff_running_output; // most recent output of abc_running - double minbiascoeff; // min bias coeff on this step for my bonds - double maxbiascoeff; // max bias coeff on this step for my bonds - double minbiascoeff_running; // cummulative min bias coeff for any bond - double maxbiascoeff_running; // cummulative max bias coeff for any bond + double sumboost; // sum of all bond boosts at each timestep + double aveboost_running; // cummulative sumboost/allbonds across steps + double aveboost_running_output; // most recent output of ab_running + double sumbiascoeff; // sum of all bond bias coeffs at each timestep + double avebiascoeff_running; // cummulative sumbiascoeff/allbonds across steps + double avebiascoeff_running_output; // most recent output of abc_running + double minbiascoeff; // min bias coeff on this step for my bonds + double maxbiascoeff; // max bias coeff on this step for my bonds + double minbiascoeff_running; // cummulative min bias coeff for any bond + double maxbiascoeff_running; // cummulative max bias coeff for any bond - double rmaxever,rmaxeverbig; - int ghost_toofar; // # of ghost atoms not found in Dcut neigh list - int checkbias_count; // count of too-close biased bonds + double rmaxever, rmaxeverbig; + int ghost_toofar; // # of ghost atoms not found in Dcut neigh list + int checkbias_count; // count of too-close biased bonds // 2 neighbor lists - class NeighList *listfull; // full neigh list up to Dcut distance - class NeighList *listhalf; // half neigh list up to pair distance - // both created only when bonds are rebuilt + class NeighList *listfull; // full neigh list up to Dcut distance + class NeighList *listhalf; // half neigh list up to pair distance + // both created only when bonds are rebuilt // list of my owned bonds and bias coeffs // persists on a proc from one event until the next - struct OneBond { // single IJ bond, atom I is owner - int i,j; // current local indices of 2 bond atoms - int iold,jold; // local indices when bonds were formed - double r0; // relaxed bond length + struct OneBond { // single IJ bond, atom I is owner + int i, j; // current local indices of 2 bond atoms + int iold, jold; // local indices when bonds were formed + double r0; // relaxed bond length }; - OneBond *blist; // list of owned bonds - double *biascoeff; // bias coefficient Cij for each bond - int nblocal; // # of owned bonds - int maxbond; // allocated size of blist + OneBond *blist; // list of owned bonds + double *biascoeff; // bias coefficient Cij for each bond + int nblocal; // # of owned bonds + int maxbond; // allocated size of blist // old data from last timestep bonds were formed // persists on a proc from one event until the next // first set of vectors are maxlocal in length // second set of vectors are maxall in length - int nlocal_old; // nlocal for old atoms - int nall_old; // nlocal+nghost for old atoms - int maxlocal; // allocated size of old local atom vecs - int maxall; // allocated size of old all atom vecs + int nlocal_old; // nlocal for old atoms + int nall_old; // nlocal+nghost for old atoms + int maxlocal; // allocated size of old local atom vecs + int maxall; // allocated size of old all atom vecs - int *numbond; // # of bonds owned by old owned atoms - int *maxhalf; // bond index for maxstrain bond of old atoms - int *eligible; // 0/1 flag for bias on one of old atom's bonds - double *maxhalfstrain; // strain value for maxstrain bond of old atoms + int *numbond; // # of bonds owned by old owned atoms + int *maxhalf; // bond index for maxstrain bond of old atoms + int *eligible; // 0/1 flag for bias on one of old atom's bonds + double *maxhalfstrain; // strain value for maxstrain bond of old atoms - int *old2now; // o2n[i] = current local index of old atom I - // may be -1 if ghost atom has drifted - tagint *tagold; // IDs of atoms when bonds were formed - // 0 if a ghost atom is not in Dcut neigh list - double **xold; // coords of atoms when bonds were formed + int *old2now; // o2n[i] = current local index of old atom I + // may be -1 if ghost atom has drifted + tagint *tagold; // IDs of atoms when bonds were formed + // 0 if a ghost atom is not in Dcut neigh list + double **xold; // coords of atoms when bonds were formed // vectors used to find maxstrain bonds within a local domain - int maxatom; // size of these vectors, nlocal + nghost + int maxatom; // size of these vectors, nlocal + nghost double *maxstrain; // max-strain of any bond atom I is part of // for owned and ghost atoms @@ -179,16 +179,16 @@ class FixHyperLocal : public FixHyper { // list of biased bonds this proc owns - int maxbias; // allocated size of bias list - int nbias; // # of biased bonds I own - int *bias; // index of biased bonds in my bond list + int maxbias; // allocated size of bias list + int nbias; // # of biased bonds I own + int *bias; // index of biased bonds in my bond list // data structs for persisting bias coeffs when bond list is reformed - MyPage *cpage;// pages of OneCoeff datums for clist - HyperOneCoeff **clist; // ptrs to vectors of bias coeffs for each atom - int *numcoeff; // # of bias coeffs per atom (one per bond) - int maxcoeff; // allocate sized of clist and numcoeff + MyPage *cpage; // pages of OneCoeff datums for clist + HyperOneCoeff **clist; // ptrs to vectors of bias coeffs for each atom + int *numcoeff; // # of bias coeffs per atom (one per bond) + int maxcoeff; // allocate sized of clist and numcoeff // extra timers @@ -200,7 +200,7 @@ class FixHyperLocal : public FixHyper { void grow_bond(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/fix_neb.h b/src/REPLICA/fix_neb.h index 8ccfc1dec0..7d08ee9cbc 100644 --- a/src/REPLICA/fix_neb.h +++ b/src/REPLICA/fix_neb.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixNEB : public Fix { public: - double veng,plen,nlen,dotpath,dottangrad,gradlen,dotgrad; + double veng, plen, nlen, dotpath, dottangrad, gradlen, dotgrad; int rclimber; FixNEB(class LAMMPS *, int, char **); @@ -37,42 +37,41 @@ class FixNEB : public Fix { void min_post_force(int); private: - int me,nprocs,nprocs_universe; - double kspring,kspringIni,kspringFinal,kspringPerp,EIniIni,EFinalIni; - bool StandardNEB,NEBLongRange,PerpSpring,FreeEndIni,FreeEndFinal; - bool FreeEndFinalWithRespToEIni,FinalAndInterWithRespToEIni; - int ireplica,nreplica; - int procnext,procprev; + int me, nprocs, nprocs_universe; + double kspring, kspringIni, kspringFinal, kspringPerp, EIniIni, EFinalIni; + bool StandardNEB, NEBLongRange, PerpSpring, FreeEndIni, FreeEndFinal; + bool FreeEndFinalWithRespToEIni, FinalAndInterWithRespToEIni; + int ireplica, nreplica; + int procnext, procprev; int cmode; MPI_Comm uworld; MPI_Comm rootworld; - char *id_pe; class Compute *pe; int nebatoms; - int ntotal; // total # of atoms, NEB or not - int maxlocal; // size of xprev,xnext,tangent arrays + int ntotal; // total # of atoms, NEB or not + int maxlocal; // size of xprev,xnext,tangent arrays double *nlenall; - double **xprev,**xnext,**fnext,**springF; + double **xprev, **xnext, **fnext, **springF; double **tangent; - double **xsend,**xrecv; // coords to send/recv to/from other replica - double **fsend,**frecv; // coords to send/recv to/from other replica - tagint *tagsend,*tagrecv; // ditto for atom IDs + double **xsend, **xrecv; // coords to send/recv to/from other replica + double **fsend, **frecv; // coords to send/recv to/from other replica + tagint *tagsend, *tagrecv; // ditto for atom IDs - // info gathered from all procs in my replica - double **xsendall,**xrecvall; // coords to send/recv to/from other replica - double **fsendall,**frecvall; // force to send/recv to/from other replica - tagint *tagsendall,*tagrecvall; // ditto for atom IDs + // info gathered from all procs in my replica + double **xsendall, **xrecvall; // coords to send/recv to/from other replica + double **fsendall, **frecvall; // force to send/recv to/from other replica + tagint *tagsendall, *tagrecvall; // ditto for atom IDs - int *counts,*displacements; // used for MPI_Gather + int *counts, *displacements; // used for MPI_Gather void inter_replica_comm(); void reallocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/hyper.h b/src/REPLICA/hyper.h index 459a266797..1c8975a8c7 100644 --- a/src/REPLICA/hyper.h +++ b/src/REPLICA/hyper.h @@ -31,18 +31,18 @@ class Hyper : public Command { void command(int, char **); private: - int me,nprocs; + int me, nprocs; int t_event; - double etol,ftol; - int maxiter,maxeval; - int stepmode,dumpflag,ndump,rebond; + double etol, ftol; + int maxiter, maxeval; + int stepmode, dumpflag, ndump, rebond; int *dumplist; - int neigh_every,neigh_delay,neigh_dist_check; + int neigh_every, neigh_delay, neigh_dist_check; int quench_reneighbor; - bigint nbuild,ndanger; + bigint nbuild, ndanger; - double time_dynamics,time_quench; + double time_dynamics, time_quench; double time_start; class FixHyper *fix_hyper; @@ -55,7 +55,7 @@ class Hyper : public Command { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/neb.h b/src/REPLICA/neb.h index 11daf45e51..8da8c15e58 100644 --- a/src/REPLICA/neb.h +++ b/src/REPLICA/neb.h @@ -29,38 +29,38 @@ class NEB : public Command { NEB(class LAMMPS *); NEB(class LAMMPS *, double, double, int, int, int, double *, double *); ~NEB(); - void command(int, char **); // process neb command - void run(); // run NEB + void command(int, char **); // process neb command + void run(); // run NEB - double ebf,ebr; // forward and reverse energy barriers + double ebf, ebr; // forward and reverse energy barriers private: - int me,me_universe; // my proc ID in world and universe - int ireplica,nreplica; + int me, me_universe; // my proc ID in world and universe + int ireplica, nreplica; bool verbose; MPI_Comm uworld; - MPI_Comm roots; // MPI comm with 1 root proc from each world + MPI_Comm roots; // MPI comm with 1 root proc from each world FILE *fp; int compressed; - double etol; // energy tolerance convergence criterion - double ftol; // force tolerance convergence criterion - int n1steps, n2steps; // number of steps in stage 1 and 2 - int nevery; // output interval - char *inpfile; // name of file containing final state + double etol; // energy tolerance convergence criterion + double ftol; // force tolerance convergence criterion + int n1steps, n2steps; // number of steps in stage 1 and 2 + int nevery; // output interval + char *inpfile; // name of file containing final state class FixNEB *fneb; - int numall; // per-replica dimension of array all - double **all; // PE,plen,nlen,gradvnorm from each replica - double *rdist; // normalize reaction distance, 0 to 1 - double *freplica; // force on an image - double *fmaxatomInRepl; // force on an image + int numall; // per-replica dimension of array all + double **all; // PE,plen,nlen,gradvnorm from each replica + double *rdist; // normalize reaction distance, 0 to 1 + double *freplica; // force on an image + double *fmaxatomInRepl; // force on an image void readfile(char *, int); void open(char *); void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h index 30d4076430..b33f83ac77 100644 --- a/src/REPLICA/prd.h +++ b/src/REPLICA/prd.h @@ -31,29 +31,29 @@ class PRD : public Command { void command(int, char **); private: - int me,nprocs; - int t_event,n_dephase,t_dephase,t_corr; - double etol,ftol,temp_dephase; - int maxiter,maxeval,temp_flag,stepmode,cmode; - char *loop_setting,*dist_setting; + int me, nprocs; + int t_event, n_dephase, t_dephase, t_corr; + double etol, ftol, temp_dephase; + int maxiter, maxeval, temp_flag, stepmode, cmode; + char *loop_setting, *dist_setting; - int equal_size_replicas,natoms; - int neigh_every,neigh_delay,neigh_dist_check; + int equal_size_replicas, natoms; + int neigh_every, neigh_delay, neigh_dist_check; int quench_reneighbor; - bigint nbuild,ndanger; + bigint nbuild, ndanger; - double time_dephase,time_dynamics,time_quench,time_comm,time_output; + double time_dephase, time_dynamics, time_quench, time_comm, time_output; double time_start; MPI_Comm comm_replica; - int *counts,*displacements; + int *counts, *displacements; tagint *tagall; double **xall; imageint *imageall; int ncoincident; - class RanPark *random_select,*random_clock; + class RanPark *random_select, *random_clock; class RanMars *random_dephase; class Compute *compute_event; class FixEventPRD *fix_event; @@ -71,7 +71,7 @@ class PRD : public Command { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/tad.h b/src/REPLICA/tad.h index 7587d0c195..cd521a9883 100644 --- a/src/REPLICA/tad.h +++ b/src/REPLICA/tad.h @@ -31,38 +31,38 @@ class TAD : public Command { void command(int, char **); private: - int me,nprocs; - int nsteps,t_event; - double templo,temphi,delta_conf,tmax; - double etol,ftol,etol_neb,ftol_neb,dt_neb; - int maxiter,maxeval,n1steps_neb,n2steps_neb,nevery_neb; + int me, nprocs; + int nsteps, t_event; + double templo, temphi, delta_conf, tmax; + double etol, ftol, etol_neb, ftol_neb, dt_neb; + int maxiter, maxeval, n1steps_neb, n2steps_neb, nevery_neb; char *min_style, *min_style_neb; - double delta_beta,ratio_beta; - double deltconf,deltstop,deltfirst; // Times since last event + double delta_beta, ratio_beta; + double deltconf, deltstop, deltfirst; // Times since last event int event_first; - int neigh_every,neigh_delay,neigh_dist_check; + int neigh_every, neigh_delay, neigh_dist_check; int quench_reneighbor; - bigint nbuild,ndanger; + bigint nbuild, ndanger; - double time_dynamics,time_quench,time_neb,time_comm,time_output; + double time_dynamics, time_quench, time_neb, time_comm, time_output; double time_start; - class NEB *neb; // NEB object - class Fix *fix_neb; // FixNEB object - class Compute *compute_event; // compute to detect event - class FixEventTAD *fix_event; // current event/state - class FixStore *fix_revert; // revert state - FixEventTAD **fix_event_list; // list of possible events - int n_event_list; // number of events - int nmax_event_list; // allocated events - int nmin_event_list; // minimum allocation + class NEB *neb; // NEB object + class Fix *fix_neb; // FixNEB object + class Compute *compute_event; // compute to detect event + class FixEventTAD *fix_event; // current event/state + class FixStore *fix_revert; // revert state + FixEventTAD **fix_event_list; // list of possible events + int n_event_list; // number of events + int nmax_event_list; // allocated events + int nmin_event_list; // minimum allocation - char *neb_logfilename; // filename for ulogfile_neb - FILE *uscreen_neb; // neb universe screen output - FILE *ulogfile_neb; // neb universe logfile - FILE *uscreen_lammps; // lammps universe screen output - FILE *ulogfile_lammps; // lammps universe logfile + char *neb_logfilename; // filename for ulogfile_neb + FILE *uscreen_neb; // neb universe screen output + FILE *ulogfile_neb; // neb universe logfile + FILE *uscreen_lammps; // lammps universe screen output + FILE *ulogfile_lammps; // lammps universe logfile class Finish *finish; @@ -83,7 +83,7 @@ class TAD : public Command { void delete_event_list(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/temper.h b/src/REPLICA/temper.h index e75387448b..63d4952433 100644 --- a/src/REPLICA/temper.h +++ b/src/REPLICA/temper.h @@ -31,29 +31,29 @@ class Temper : public Command { void command(int, char **); private: - int me,me_universe; // my proc ID in world and universe - int iworld,nworlds; // world info - double boltz; // copy from output->boltz - MPI_Comm roots; // MPI comm with 1 root proc from each world - class RanPark *ranswap,*ranboltz; // RNGs for swapping and Boltz factor - int nevery; // # of timesteps between swaps - int nswaps; // # of tempering swaps to perform - int seed_swap; // 0 = toggle swaps, n = RNG for swap direction - int seed_boltz; // seed for Boltz factor comparison - int whichfix; // index of temperature fix to use - int fixstyle; // what kind of temperature fix is used + int me, me_universe; // my proc ID in world and universe + int iworld, nworlds; // world info + double boltz; // copy from output->boltz + MPI_Comm roots; // MPI comm with 1 root proc from each world + class RanPark *ranswap, *ranboltz; // RNGs for swapping and Boltz factor + int nevery; // # of timesteps between swaps + int nswaps; // # of tempering swaps to perform + int seed_swap; // 0 = toggle swaps, n = RNG for swap direction + int seed_boltz; // seed for Boltz factor comparison + int whichfix; // index of temperature fix to use + int fixstyle; // what kind of temperature fix is used - int my_set_temp; // which set temp I am simulating - double *set_temp; // static list of replica set temperatures - int *temp2world; // temp2world[i] = world simulating set temp i - int *world2temp; // world2temp[i] = temp simulated by world i - int *world2root; // world2root[i] = root proc of world i + int my_set_temp; // which set temp I am simulating + double *set_temp; // static list of replica set temperatures + int *temp2world; // temp2world[i] = world simulating set temp i + int *world2temp; // world2temp[i] = temp simulated by world i + int *world2root; // world2root[i] = root proc of world i void scale_velocities(int, int); void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h index 9f4ccd6576..29564af539 100644 --- a/src/REPLICA/verlet_split.h +++ b/src/REPLICA/verlet_split.h @@ -35,14 +35,14 @@ class VerletSplit : public Verlet { double memory_usage(); private: - int master; // 1 if an Rspace proc, 0 if Kspace - int me_block; // proc ID within Rspace/Kspace block - int ratio; // ratio of Rspace procs to Kspace procs - int *qsize,*qdisp,*xsize,*xdisp; // MPI gather/scatter params for block comm - MPI_Comm block; // communicator within one block - int tip4p_flag; // 1 if PPPM/tip4p so do extra comm + int master; // 1 if an Rspace proc, 0 if Kspace + int me_block; // proc ID within Rspace/Kspace block + int ratio; // ratio of Rspace procs to Kspace procs + int *qsize, *qdisp, *xsize, *xdisp; // MPI gather/scatter params for block comm + MPI_Comm block; // communicator within one block + int tip4p_flag; // 1 if PPPM/tip4p so do extra comm - double **f_kspace; // copy of Kspace forces on Rspace procs + double **f_kspace; // copy of Kspace forces on Rspace procs int maxatom; void rk_setup(); @@ -50,7 +50,7 @@ class VerletSplit : public Verlet { void k2r_comm(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/compute_erotate_rigid.h b/src/RIGID/compute_erotate_rigid.h index 0d18db054e..3f27ffbf6c 100644 --- a/src/RIGID/compute_erotate_rigid.h +++ b/src/RIGID/compute_erotate_rigid.h @@ -36,7 +36,7 @@ class ComputeERotateRigid : public Compute { char *rfix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/compute_ke_rigid.h b/src/RIGID/compute_ke_rigid.h index 6940628082..d86e77f262 100644 --- a/src/RIGID/compute_ke_rigid.h +++ b/src/RIGID/compute_ke_rigid.h @@ -36,7 +36,7 @@ class ComputeKERigid : public Compute { char *rfix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/compute_rigid_local.h b/src/RIGID/compute_rigid_local.h index 73903d8945..04ccae0455 100644 --- a/src/RIGID/compute_rigid_local.h +++ b/src/RIGID/compute_rigid_local.h @@ -48,7 +48,7 @@ class ComputeRigidLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_ehex.h b/src/RIGID/fix_ehex.h index 056b5a4342..cbbd5a960d 100644 --- a/src/RIGID/fix_ehex.h +++ b/src/RIGID/fix_ehex.h @@ -11,7 +11,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS // clang-format off FixStyle(ehex,FixEHEX); @@ -31,14 +30,14 @@ class FixEHEX : public Fix { public: FixEHEX(class LAMMPS *, int, char **); ~FixEHEX(); - int setmask(); + int setmask(); void init(); void end_of_step(); - void rescale(); + void rescale(); double compute_scalar(); double memory_usage(); void update_scalingmask(); - void com_properties(double *, double *, double *, double*, double *, double*); + void com_properties(double *, double *, double *, double *, double *, double *); bool rescale_atom(int i, class Region *region); virtual void grow_arrays(int nmax); bool check_cluster(tagint *shake_atom, int n, class Region *region); @@ -51,22 +50,22 @@ class FixEHEX : public Fix { char *idregion; int me; - double **x; // coordinates - double **f; // forces - double **v; // velocities - double *mass; // masses - double *rmass; // reduced masses - int *type; // atom types - int nlocal; // number of local atoms - class FixShake * fshake; // pointer to fix_shake/fix_rattle - int constraints; // constraints (0/1) - int cluster; // rescaling entire clusters (0/1) - int hex; // HEX mode (0/1) - bool *scalingmask; // scalingmask[i] determines whether - // the velocity of atom i is to be rescaled + double **x; // coordinates + double **f; // forces + double **v; // velocities + double *mass; // masses + double *rmass; // reduced masses + int *type; // atom types + int nlocal; // number of local atoms + class FixShake *fshake; // pointer to fix_shake/fix_rattle + int constraints; // constraints (0/1) + int cluster; // rescaling entire clusters (0/1) + int hex; // HEX mode (0/1) + bool *scalingmask; // scalingmask[i] determines whether + // the velocity of atom i is to be rescaled }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rattle.h b/src/RIGID/fix_rattle.h index 0c9216304d..4366e1ad84 100644 --- a/src/RIGID/fix_rattle.h +++ b/src/RIGID/fix_rattle.h @@ -26,10 +26,10 @@ namespace LAMMPS_NS { class FixRattle : public FixShake { public: - double **vp; // array for unconstrained velocities - int comm_mode; // mode for communication pack/unpack - double derr_max; // distance error - double verr_max; // velocity error + double **vp; // array for unconstrained velocities + int comm_mode; // mode for communication pack/unpack + double derr_max; // distance error + double verr_max; // velocity error FixRattle(class LAMMPS *, int, char **); ~FixRattle(); @@ -38,7 +38,7 @@ class FixRattle : public FixShake { virtual void post_force(int); virtual void post_force_respa(int, int, int); virtual void final_integrate(); - virtual void final_integrate_respa(int,int); + virtual void final_integrate_respa(int, int); virtual void correct_coordinates(int vflag); virtual void correct_velocities(); @@ -63,7 +63,7 @@ class FixRattle : public FixShake { // debugging methods - bool check3angle(double ** v, int m, bool checkr, bool checkv); + bool check3angle(double **v, int m, bool checkr, bool checkv); bool check2(double **v, int m, bool checkr, bool checkv); bool check3(double **v, int m, bool checkr, bool checkv); bool check4(double **v, int m, bool checkr, bool checkv); @@ -71,7 +71,7 @@ class FixRattle : public FixShake { void end_of_step(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid.h b/src/RIGID/fix_rigid.h index 7433e760b7..c9b1ff5861 100644 --- a/src/RIGID/fix_rigid.h +++ b/src/RIGID/fix_rigid.h @@ -55,85 +55,85 @@ class FixRigid : public Fix { void zero_momentum(); void zero_rotation(); virtual int modify_param(int, char **); - virtual void *extract(const char*, int &); + virtual void *extract(const char *, int &); double extract_ke(); double extract_erotational(); double compute_array(int, int); protected: - int me,nprocs; - double dtv,dtf,dtq; + int me, nprocs; + double dtv, dtf, dtq; double *step_respa; int triclinic; - char *inpfile; // file to read rigid body attributes from + char *inpfile; // file to read rigid body attributes from - int rstyle; // SINGLE,MOLECULE,GROUP - int setupflag; // 1 if body properties are setup, else 0 - int earlyflag; // 1 if forces/torques computed at post_force() + int rstyle; // SINGLE,MOLECULE,GROUP + int setupflag; // 1 if body properties are setup, else 0 + int earlyflag; // 1 if forces/torques computed at post_force() - int dimension; // # of dimensions - int nbody; // # of rigid bodies - int nlinear; // # of linear rigid bodies - int *nrigid; // # of atoms in each rigid body - int *mol2body; // convert mol-ID to rigid body index - int *body2mol; // convert rigid body index to mol-ID - int maxmol; // size of mol2body = max mol-ID + int dimension; // # of dimensions + int nbody; // # of rigid bodies + int nlinear; // # of linear rigid bodies + int *nrigid; // # of atoms in each rigid body + int *mol2body; // convert mol-ID to rigid body index + int *body2mol; // convert rigid body index to mol-ID + int maxmol; // size of mol2body = max mol-ID - int *body; // which body each atom is part of (-1 if none) - double **displace; // displacement of each atom in body coords + int *body; // which body each atom is part of (-1 if none) + double **displace; // displacement of each atom in body coords - double *masstotal; // total mass of each rigid body - double **xcm; // coords of center-of-mass of each rigid body - double **vcm; // velocity of center-of-mass of each - double **fcm; // force on center-of-mass of each - double **inertia; // 3 principal components of inertia of each - double **ex_space,**ey_space,**ez_space; - // principal axes of each in space coords - double **angmom; // angular momentum of each in space coords - double **omega; // angular velocity of each in space coords - double **torque; // torque on each rigid body in space coords - double **quat; // quaternion of each rigid body - imageint *imagebody; // image flags of xcm of each rigid body - double **fflag; // flag for on/off of center-of-mass force - double **tflag; // flag for on/off of center-of-mass torque - double **langextra; // Langevin thermostat forces and torques + double *masstotal; // total mass of each rigid body + double **xcm; // coords of center-of-mass of each rigid body + double **vcm; // velocity of center-of-mass of each + double **fcm; // force on center-of-mass of each + double **inertia; // 3 principal components of inertia of each + double **ex_space, **ey_space, **ez_space; + // principal axes of each in space coords + double **angmom; // angular momentum of each in space coords + double **omega; // angular velocity of each in space coords + double **torque; // torque on each rigid body in space coords + double **quat; // quaternion of each rigid body + imageint *imagebody; // image flags of xcm of each rigid body + double **fflag; // flag for on/off of center-of-mass force + double **tflag; // flag for on/off of center-of-mass torque + double **langextra; // Langevin thermostat forces and torques - double **sum,**all; // work vectors for each rigid body - int **remapflag; // PBC remap flags for each rigid body + double **sum, **all; // work vectors for each rigid body + int **remapflag; // PBC remap flags for each rigid body - int extended; // 1 if any particles have extended attributes - int orientflag; // 1 if particles store spatial orientation - int dorientflag; // 1 if particles store dipole orientation - int reinitflag; // 1 if re-initialize rigid bodies between runs + int extended; // 1 if any particles have extended attributes + int orientflag; // 1 if particles store spatial orientation + int dorientflag; // 1 if particles store dipole orientation + int reinitflag; // 1 if re-initialize rigid bodies between runs - imageint *xcmimage; // internal image flags for atoms in rigid bodies - // set relative to in-box xcm of each body - int *eflags; // flags for extended particles - double **orient; // orientation vector of particle wrt rigid body - double **dorient; // orientation of dipole mu wrt rigid body + imageint *xcmimage; // internal image flags for atoms in rigid bodies + // set relative to in-box xcm of each body + int *eflags; // flags for extended particles + double **orient; // orientation vector of particle wrt rigid body + double **dorient; // orientation of dipole mu wrt rigid body - double tfactor; // scale factor on temperature of rigid bodies - int langflag; // 0/1 = no/yes Langevin thermostat + double tfactor; // scale factor on temperature of rigid bodies + int langflag; // 0/1 = no/yes Langevin thermostat - int tstat_flag; // NVT settings - double t_start,t_stop,t_target; - double t_period,t_freq; - int t_chain,t_iter,t_order; + int tstat_flag; // NVT settings + double t_start, t_stop, t_target; + double t_period, t_freq; + int t_chain, t_iter, t_order; - int pstat_flag; // NPT settings - double p_start[3],p_stop[3]; - double p_period[3],p_freq[3]; + int pstat_flag; // NPT settings + double p_start[3], p_stop[3]; + double p_period[3], p_freq[3]; int p_flag[3]; - int pcouple,pstyle; + int pcouple, pstyle; int p_chain; - int allremap; // remap all atoms - int dilate_group_bit; // mask for dilation group - char *id_dilate; // group name to dilate + int allremap; // remap all atoms + int dilate_group_bit; // mask for dilation group + char *id_dilate; // group name to dilate - char *id_gravity; // ID of fix gravity command to add gravity forces - double *gvec; // ptr to gravity vector inside the fix + char *id_gravity; // ID of fix gravity command to add gravity forces + double *gvec; // ptr to gravity vector inside the fix class RanMars *random; class AtomVecEllipsoid *avec_ellipsoid; @@ -147,11 +147,10 @@ class FixRigid : public Fix { void setup_bodies_dynamic(); void apply_langevin_thermostat(); void compute_forces_and_torques(); - void readfile(int, double *, double **, double **, double **, - imageint *, int *); + void readfile(int, double *, double **, double **, double **, imageint *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nh.h b/src/RIGID/fix_rigid_nh.h index 86492e5531..dc9d4ab513 100644 --- a/src/RIGID/fix_rigid_nh.h +++ b/src/RIGID/fix_rigid_nh.h @@ -34,40 +34,40 @@ class FixRigidNH : public FixRigid { void reset_target(double); protected: - double **conjqm; // conjugate quaternion momentum - double boltz,nktv2p,mvv2e; // boltzman constant, conversion factors + double **conjqm; // conjugate quaternion momentum + double boltz, nktv2p, mvv2e; // boltzman constant, conversion factors - int nf_t,nf_r; // trans/rot degrees of freedom - double *w,*wdti1,*wdti2,*wdti4; // Yoshida-Suzuki coefficients - double *q_t,*q_r; // trans/rot thermostat masses - double *eta_t,*eta_r; // trans/rot thermostat positions - double *eta_dot_t,*eta_dot_r; // trans/rot thermostat velocities - double *f_eta_t,*f_eta_r; // trans/rot thermostat forces + int nf_t, nf_r; // trans/rot degrees of freedom + double *w, *wdti1, *wdti2, *wdti4; // Yoshida-Suzuki coefficients + double *q_t, *q_r; // trans/rot thermostat masses + double *eta_t, *eta_r; // trans/rot thermostat positions + double *eta_dot_t, *eta_dot_r; // trans/rot thermostat velocities + double *f_eta_t, *f_eta_r; // trans/rot thermostat forces - double epsilon_mass[3], *q_b; // baro/thermo masses - double epsilon[3],*eta_b; // baro/thermo positions - double epsilon_dot[3],*eta_dot_b; // baro/thermo velocities - double *f_eta_b; // thermo forces - double akin_t,akin_r; // translational/rotational kinetic energies + double epsilon_mass[3], *q_b; // baro/thermo masses + double epsilon[3], *eta_b; // baro/thermo positions + double epsilon_dot[3], *eta_dot_b; // baro/thermo velocities + double *f_eta_b; // thermo forces + double akin_t, akin_r; // translational/rotational kinetic energies - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigidfix; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigidfix; // number of rigid fixes + int *rfix; // indices of rigid fixes - double vol0; // reference volume - double t0; // reference temperature - int pdim,g_f; // number of barostatted dims, total DoFs - double p_hydro; // hydrostatic target pressure - double p_freq_max; // maximum barostat frequency + double vol0; // reference volume + double t0; // reference temperature + int pdim, g_f; // number of barostatted dims, total DoFs + double p_hydro; // hydrostatic target pressure + double p_freq_max; // maximum barostat frequency - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections double t_current; - double p_current[3],p_target[3]; + double p_current[3], p_target[3]; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix. 0 = external + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix. 0 = external void couple(); void remap(); @@ -88,14 +88,14 @@ class FixRigidNH : public FixRigid { inline double FixRigidNH::maclaurin_series(double x) { - double x2,x4; + double x2, x4; x2 = x * x; x4 = x2 * x2; - return (1.0 + (1.0/6.0) * x2 + (1.0/120.0) * x4 + (1.0/5040.0) * x2 * x4 + - (1.0/362880.0) * x4 * x4); + return (1.0 + (1.0 / 6.0) * x2 + (1.0 / 120.0) * x4 + (1.0 / 5040.0) * x2 * x4 + + (1.0 / 362880.0) * x4 * x4); } -} +} // namespace LAMMPS_NS #endif diff --git a/src/RIGID/fix_rigid_nh_small.h b/src/RIGID/fix_rigid_nh_small.h index 54d5421ceb..0913d03cd3 100644 --- a/src/RIGID/fix_rigid_nh_small.h +++ b/src/RIGID/fix_rigid_nh_small.h @@ -34,40 +34,40 @@ class FixRigidNHSmall : public FixRigidSmall { void reset_target(double); protected: - double boltz,nktv2p,mvv2e; // boltzman constant, conversion factors + double boltz, nktv2p, mvv2e; // boltzman constant, conversion factors - int dimension; // # of dimensions - int nf_t,nf_r; // trans/rot degrees of freedom - double *w,*wdti1,*wdti2,*wdti4; // Yoshida-Suzuki coefficients - double *q_t,*q_r; // trans/rot thermostat masses - double *eta_t,*eta_r; // trans/rot thermostat positions - double *eta_dot_t,*eta_dot_r; // trans/rot thermostat velocities - double *f_eta_t,*f_eta_r; // trans/rot thermostat forces + int dimension; // # of dimensions + int nf_t, nf_r; // trans/rot degrees of freedom + double *w, *wdti1, *wdti2, *wdti4; // Yoshida-Suzuki coefficients + double *q_t, *q_r; // trans/rot thermostat masses + double *eta_t, *eta_r; // trans/rot thermostat positions + double *eta_dot_t, *eta_dot_r; // trans/rot thermostat velocities + double *f_eta_t, *f_eta_r; // trans/rot thermostat forces - double epsilon_mass[3], *q_b; // baro/thermo masses - double epsilon[3],*eta_b; // baro/thermo positions - double epsilon_dot[3],*eta_dot_b; // baro/thermo velocities - double *f_eta_b; // thermo forces - double akin_t,akin_r; // translational/rotational kinetic energies + double epsilon_mass[3], *q_b; // baro/thermo masses + double epsilon[3], *eta_b; // baro/thermo positions + double epsilon_dot[3], *eta_dot_b; // baro/thermo velocities + double *f_eta_b; // thermo forces + double akin_t, akin_r; // translational/rotational kinetic energies - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigidfix; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigidfix; // number of rigid fixes + int *rfix; // indices of rigid fixes - double vol0; // reference volume - double t0; // reference temperature - int pdim,g_f; // number of barostatted dims, total DoFs - double p_hydro; // hydrostatic target pressure - double p_freq_max; // maximum barostat frequency + double vol0; // reference volume + double t0; // reference temperature + int pdim, g_f; // number of barostatted dims, total DoFs + double p_hydro; // hydrostatic target pressure + double p_freq_max; // maximum barostat frequency - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - double t_target,t_current; + double t_target, t_current; double t_freq; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix. 0 = external + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix. 0 = external void couple(); void remap(); @@ -89,14 +89,14 @@ class FixRigidNHSmall : public FixRigidSmall { inline double FixRigidNHSmall::maclaurin_series(double x) { - double x2,x4; + double x2, x4; x2 = x * x; x4 = x2 * x2; - return (1.0 + (1.0/6.0) * x2 + (1.0/120.0) * x4 + (1.0/5040.0) * x2 * x4 + - (1.0/362880.0) * x4 * x4); + return (1.0 + (1.0 / 6.0) * x2 + (1.0 / 120.0) * x4 + (1.0 / 5040.0) * x2 * x4 + + (1.0 / 362880.0) * x4 * x4); } -} +} // namespace LAMMPS_NS #endif diff --git a/src/RIGID/fix_rigid_nph.h b/src/RIGID/fix_rigid_nph.h index 7548674aae..b0fed2659d 100644 --- a/src/RIGID/fix_rigid_nph.h +++ b/src/RIGID/fix_rigid_nph.h @@ -30,8 +30,7 @@ class FixRigidNPH : public FixRigidNH { ~FixRigidNPH() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nph_small.h b/src/RIGID/fix_rigid_nph_small.h index d24017fe8a..8c96deec11 100644 --- a/src/RIGID/fix_rigid_nph_small.h +++ b/src/RIGID/fix_rigid_nph_small.h @@ -30,8 +30,7 @@ class FixRigidNPHSmall : public FixRigidNHSmall { ~FixRigidNPHSmall() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_npt.h b/src/RIGID/fix_rigid_npt.h index e03f07cf93..a9e6702dc8 100644 --- a/src/RIGID/fix_rigid_npt.h +++ b/src/RIGID/fix_rigid_npt.h @@ -30,8 +30,7 @@ class FixRigidNPT : public FixRigidNH { ~FixRigidNPT() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_npt_small.h b/src/RIGID/fix_rigid_npt_small.h index b295d5e67f..e6e2eabf5d 100644 --- a/src/RIGID/fix_rigid_npt_small.h +++ b/src/RIGID/fix_rigid_npt_small.h @@ -30,8 +30,7 @@ class FixRigidNPTSmall : public FixRigidNHSmall { ~FixRigidNPTSmall() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nve.h b/src/RIGID/fix_rigid_nve.h index 1a46ef3b00..61bdbaa229 100644 --- a/src/RIGID/fix_rigid_nve.h +++ b/src/RIGID/fix_rigid_nve.h @@ -30,7 +30,7 @@ class FixRigidNVE : public FixRigidNH { ~FixRigidNVE() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nve_small.h b/src/RIGID/fix_rigid_nve_small.h index 0b02f60aaf..a1c3f9442a 100644 --- a/src/RIGID/fix_rigid_nve_small.h +++ b/src/RIGID/fix_rigid_nve_small.h @@ -30,7 +30,7 @@ class FixRigidNVESmall : public FixRigidNHSmall { ~FixRigidNVESmall() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nvt.h b/src/RIGID/fix_rigid_nvt.h index 548ef7a9d4..b4ad1ff188 100644 --- a/src/RIGID/fix_rigid_nvt.h +++ b/src/RIGID/fix_rigid_nvt.h @@ -30,7 +30,7 @@ class FixRigidNVT : public FixRigidNH { ~FixRigidNVT() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_nvt_small.h b/src/RIGID/fix_rigid_nvt_small.h index 556de6689a..864446e3e4 100644 --- a/src/RIGID/fix_rigid_nvt_small.h +++ b/src/RIGID/fix_rigid_nvt_small.h @@ -30,7 +30,7 @@ class FixRigidNVTSmall : public FixRigidNHSmall { ~FixRigidNVTSmall() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_rigid_small.h b/src/RIGID/fix_rigid_small.h index 8a6df29d55..10b713edb9 100644 --- a/src/RIGID/fix_rigid_small.h +++ b/src/RIGID/fix_rigid_small.h @@ -61,72 +61,72 @@ class FixRigidSmall : public Fix { void zero_momentum(); void zero_rotation(); int modify_param(int, char **); - void *extract(const char*, int &); + void *extract(const char *, int &); double extract_ke(); double extract_erotational(); double compute_scalar(); double memory_usage(); protected: - int me,nprocs; - double dtv,dtf,dtq; + int me, nprocs; + double dtv, dtf, dtq; double *step_respa; int triclinic; - char *inpfile; // file to read rigid body attributes from - int setupflag; // 1 if body properties are setup, else 0 - int earlyflag; // 1 if forces/torques are computed at post_force() - int commflag; // various modes of forward/reverse comm - int customflag; // 1 if custom property/variable define bodies - int nbody; // total # of rigid bodies - int nlinear; // total # of linear rigid bodies - tagint maxmol; // max mol-ID - double maxextent; // furthest distance from body owner to body atom + char *inpfile; // file to read rigid body attributes from + int setupflag; // 1 if body properties are setup, else 0 + int earlyflag; // 1 if forces/torques are computed at post_force() + int commflag; // various modes of forward/reverse comm + int customflag; // 1 if custom property/variable define bodies + int nbody; // total # of rigid bodies + int nlinear; // total # of linear rigid bodies + tagint maxmol; // max mol-ID + double maxextent; // furthest distance from body owner to body atom struct Body { - double mass; // total mass of body - double xcm[3]; // COM position - double vcm[3]; // COM velocity - double fcm[3]; // force on COM - double torque[3]; // torque around COM - double quat[4]; // quaternion for orientation of body - double inertia[3]; // 3 principal components of inertia - double ex_space[3]; // principal axes in space coords + double mass; // total mass of body + double xcm[3]; // COM position + double vcm[3]; // COM velocity + double fcm[3]; // force on COM + double torque[3]; // torque around COM + double quat[4]; // quaternion for orientation of body + double inertia[3]; // 3 principal components of inertia + double ex_space[3]; // principal axes in space coords double ey_space[3]; double ez_space[3]; - double angmom[3]; // space-frame angular momentum of body - double omega[3]; // space-frame omega of body - double conjqm[4]; // conjugate quaternion momentum - imageint image; // image flags of xcm - int remapflag[4]; // PBC remap flags - int ilocal; // index of owning atom + double angmom[3]; // space-frame angular momentum of body + double omega[3]; // space-frame omega of body + double conjqm[4]; // conjugate quaternion momentum + imageint image; // image flags of xcm + int remapflag[4]; // PBC remap flags + int ilocal; // index of owning atom }; - Body *body; // list of rigid bodies, owned and ghost - int nlocal_body; // # of owned rigid bodies - int nghost_body; // # of ghost rigid bodies - int nmax_body; // max # of bodies that body can hold - int bodysize; // sizeof(Body) in doubles + Body *body; // list of rigid bodies, owned and ghost + int nlocal_body; // # of owned rigid bodies + int nghost_body; // # of ghost rigid bodies + int nmax_body; // max # of bodies that body can hold + int bodysize; // sizeof(Body) in doubles // per-atom quantities // only defined for owned atoms, except bodyown for own+ghost - int *bodyown; // index of body if atom owns a body, -1 if not - tagint *bodytag; // ID of body this atom is in, 0 if none - // ID = tag of atom that owns body - int *atom2body; // index of owned/ghost body this atom is in, -1 if not - // can point to original or any image of the body - imageint *xcmimage; // internal image flags for atoms in rigid bodies - // set relative to in-box xcm of each body - double **displace; // displacement of each atom in body coords - int *eflags; // flags for extended particles - double **orient; // orientation vector of particle wrt rigid body - double **dorient; // orientation of dipole mu wrt rigid body + int *bodyown; // index of body if atom owns a body, -1 if not + tagint *bodytag; // ID of body this atom is in, 0 if none + // ID = tag of atom that owns body + int *atom2body; // index of owned/ghost body this atom is in, -1 if not + // can point to original or any image of the body + imageint *xcmimage; // internal image flags for atoms in rigid bodies + // set relative to in-box xcm of each body + double **displace; // displacement of each atom in body coords + int *eflags; // flags for extended particles + double **orient; // orientation vector of particle wrt rigid body + double **dorient; // orientation of dipole mu wrt rigid body - int extended; // 1 if any particles have extended attributes - int orientflag; // 1 if particles store spatial orientation - int dorientflag; // 1 if particles store dipole orientation - int reinitflag; // 1 if re-initialize rigid bodies between runs + int extended; // 1 if any particles have extended attributes + int orientflag; // 1 if particles store spatial orientation + int dorientflag; // 1 if particles store dipole orientation + int reinitflag; // 1 if re-initialize rigid bodies between runs class AtomVecEllipsoid *avec_ellipsoid; class AtomVecLine *avec_line; @@ -134,8 +134,8 @@ class FixRigidSmall : public Fix { // temporary per-body storage - int **counts; // counts of atom types in bodies - double **itensor; // 6 space-frame components of inertia tensor + int **counts; // counts of atom types in bodies + double **itensor; // 6 space-frame components of inertia tensor // mass per body, accessed by granular pair styles @@ -144,30 +144,30 @@ class FixRigidSmall : public Fix { // Langevin thermostatting - int langflag; // 0/1 = no/yes Langevin thermostat - double t_start,t_stop,t_period; // thermostat params - double **langextra; // Langevin thermostat forces and torques - int maxlang; // max size of langextra - class RanMars *random; // RNG + int langflag; // 0/1 = no/yes Langevin thermostat + double t_start, t_stop, t_period; // thermostat params + double **langextra; // Langevin thermostat forces and torques + int maxlang; // max size of langextra + class RanMars *random; // RNG - int tstat_flag,pstat_flag; // 0/1 = no/yes thermostat/barostat + int tstat_flag, pstat_flag; // 0/1 = no/yes thermostat/barostat - int t_chain,t_iter,t_order; + int t_chain, t_iter, t_order; - double p_start[3],p_stop[3]; - double p_period[3],p_freq[3]; + double p_start[3], p_stop[3]; + double p_period[3], p_freq[3]; int p_flag[3]; - int pcouple,pstyle; + int pcouple, pstyle; int p_chain; - int allremap; // remap all atoms - int dilate_group_bit; // mask for dilation group - char *id_dilate; // group name to dilate + int allremap; // remap all atoms + int dilate_group_bit; // mask for dilation group + char *id_dilate; // group name to dilate - char *id_gravity; // ID of fix gravity command to add gravity forces - double *gvec; // ptr to gravity vector inside the fix + char *id_gravity; // ID of fix gravity command to add gravity forces + double *gvec; // ptr to gravity vector inside the fix - double p_current[3],p_target[3]; + double p_current[3], p_target[3]; // molecules added on-the-fly as rigid bodies @@ -179,8 +179,8 @@ class FixRigidSmall : public Fix { double rsqfar; struct InRvous { - int me,ilocal; - tagint atomID,bodyID; + int me, ilocal; + tagint atomID, bodyID; double x[3]; }; @@ -212,7 +212,7 @@ class FixRigidSmall : public Fix { //void check(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/fix_shake.h b/src/RIGID/fix_shake.h index f5c1bf11e9..e70db6eba1 100644 --- a/src/RIGID/fix_shake.h +++ b/src/RIGID/fix_shake.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixShake : public Fix { - friend class FixEHEX; + friend class FixEHEX; public: FixShake(class LAMMPS *, int, char **); @@ -59,64 +59,64 @@ class FixShake : public Fix { void *extract(const char *, int &); protected: - int vflag_post_force; // store the vflag of last post_force call - int respa; // 0 = vel. Verlet, 1 = respa - int me,nprocs; - int rattle; // 0 = SHAKE, 1 = RATTLE - double tolerance; // SHAKE tolerance - int max_iter; // max # of SHAKE iterations - int output_every; // SHAKE stat output every so often - bigint next_output; // timestep for next output + int vflag_post_force; // store the vflag of last post_force call + int respa; // 0 = vel. Verlet, 1 = respa + int me, nprocs; + int rattle; // 0 = SHAKE, 1 = RATTLE + double tolerance; // SHAKE tolerance + int max_iter; // max # of SHAKE iterations + int output_every; // SHAKE stat output every so often + bigint next_output; // timestep for next output - // settings from input command - int *bond_flag,*angle_flag; // bond/angle types to constrain - int *type_flag; // constrain bonds to these types - double *mass_list; // constrain bonds to these masses - int nmass; // # of masses in mass_list + // settings from input command + int *bond_flag, *angle_flag; // bond/angle types to constrain + int *type_flag; // constrain bonds to these types + double *mass_list; // constrain bonds to these masses + int nmass; // # of masses in mass_list - int molecular; // copy of atom->molecular - double *bond_distance,*angle_distance; // constraint distances + int molecular; // copy of atom->molecular + double *bond_distance, *angle_distance; // constraint distances - int ifix_respa; // rRESPA fix needed by SHAKE - int nlevels_respa; // copies of needed rRESPA variables + int ifix_respa; // rRESPA fix needed by SHAKE + int nlevels_respa; // copies of needed rRESPA variables int *loop_respa; double *step_respa; - double **x,**v,**f; // local ptrs to atom class quantities - double **ftmp,**vtmp; // pointers to temporary arrays for f,v + double **x, **v, **f; // local ptrs to atom class quantities + double **ftmp, **vtmp; // pointers to temporary arrays for f,v - double *mass,*rmass; + double *mass, *rmass; int *type; int nlocal; - // atom-based arrays - int *shake_flag; // 0 if atom not in SHAKE cluster - // 1 = size 3 angle cluster - // 2,3,4 = size of bond-only cluster - tagint **shake_atom; // global IDs of atoms in cluster - // central atom is 1st - // lowest global ID is 1st for size 2 - int **shake_type; // bondtype of each bond in cluster - // for angle cluster, 3rd value - // is angletype - double **xshake; // unconstrained atom coords - int *nshake; // count + // atom-based arrays + int *shake_flag; // 0 if atom not in SHAKE cluster + // 1 = size 3 angle cluster + // 2,3,4 = size of bond-only cluster + tagint **shake_atom; // global IDs of atoms in cluster + // central atom is 1st + // lowest global ID is 1st for size 2 + int **shake_type; // bondtype of each bond in cluster + // for angle cluster, 3rd value + // is angletype + double **xshake; // unconstrained atom coords + int *nshake; // count - double dtv,dtfsq; // timesteps for trial move - double dtf_inner,dtf_innerhalf; // timesteps for rRESPA trial move + double dtv, dtfsq; // timesteps for trial move + double dtf_inner, dtf_innerhalf; // timesteps for rRESPA trial move - int *list; // list of clusters to SHAKE - int nlist,maxlist; // size and max-size of list + int *list; // list of clusters to SHAKE + int nlist, maxlist; // size and max-size of list - // stat quantities - int *b_count,*b_count_all; // counts for each bond type - double *b_ave,*b_max,*b_min; // ave/max/min dist for each bond type - double *b_ave_all,*b_max_all,*b_min_all; // MPI summing arrays - int *a_count,*a_count_all; // ditto for angle types - double *a_ave,*a_max,*a_min; - double *a_ave_all,*a_max_all,*a_min_all; + // stat quantities + int *b_count, *b_count_all; // counts for each bond type + double *b_ave, *b_max, *b_min; // ave/max/min dist for each bond type + double *b_ave_all, *b_max_all, *b_min_all; // MPI summing arrays + int *a_count, *a_count_all; // ditto for angle types + double *a_ave, *a_max, *a_min; + double *a_ave_all, *a_max_all, *a_min_all; - class Molecule **atommols; // atom style template pointer - class Molecule **onemols; // molecule added on-the-fly + class Molecule **atommols; // atom style template pointer + class Molecule **onemols; // molecule added on-the-fly int nmol; void find_clusters(); @@ -148,12 +148,12 @@ class FixShake : public Fix { }; struct PartnerInfo { - tagint atomID,partnerID; - int mask,type,massflag,bondtype; + tagint atomID, partnerID; + int mask, type, massflag, bondtype; }; struct NShakeInfo { - tagint atomID,partnerID; + tagint atomID, partnerID; int nshake; }; @@ -172,7 +172,7 @@ class FixShake : public Fix { static int rendezvous_shake(int, char *, int &, int *&, char *&, void *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/RIGID/rigid_const.h b/src/RIGID/rigid_const.h index b37bd9fad2..459e0c3663 100644 --- a/src/RIGID/rigid_const.h +++ b/src/RIGID/rigid_const.h @@ -10,6 +10,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +// clang-format off #ifndef LMP_RIGID_CONST_H #define LMP_RIGID_CONST_H @@ -17,10 +18,10 @@ namespace LAMMPS_NS { namespace RigidConst { - enum{SINGLE,MOLECULE,GROUP}; - enum{NONE,XYZ,XY,YZ,XZ}; - enum{ISO,ANISO,TRICLINIC}; - enum{FULL_BODY,INITIAL,FINAL,FORCE_TORQUE,VCM_ANGMOM,XCM_MASS,ITENSOR,DOF}; + enum{SINGLE, MOLECULE, GROUP}; + enum{NONE, XYZ, XY, YZ, XZ}; + enum{ISO, ANISO, TRICLINIC}; + enum{FULL_BODY, INITIAL, FINAL, FORCE_TORQUE, VCM_ANGMOM, XCM_MASS, ITENSOR, DOF}; enum {POINT = 1<<0, SPHERE = 1<<1, diff --git a/src/SHOCK/fix_append_atoms.h b/src/SHOCK/fix_append_atoms.h index d4022d8ca1..5764e67a59 100644 --- a/src/SHOCK/fix_append_atoms.h +++ b/src/SHOCK/fix_append_atoms.h @@ -44,14 +44,14 @@ class FixAppendAtoms : public Fix { int scaleflag, freq; int nbasis; int *basistype; - int advance,advance_sum; - double size,spatlead; + int advance, advance_sum; + double size, spatlead; char *spatialid; double tfactor; - double *gfactor1,*gfactor2; + double *gfactor1, *gfactor2; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SHOCK/fix_msst.h b/src/SHOCK/fix_msst.h index 4e99813754..2aee1c1847 100644 --- a/src/SHOCK/fix_msst.h +++ b/src/SHOCK/fix_msst.h @@ -41,59 +41,59 @@ class FixMSST : public Fix { double memory_usage(); private: - double dtv,dtf,dthalf; // full and half step sizes - double boltz,nktv2p, mvv2e; // Boltzmann factor and unit conversions - double total_mass; // mass of the computational cell + double dtv, dtf, dthalf; // full and half step sizes + double boltz, nktv2p, mvv2e; // Boltzmann factor and unit conversions + double total_mass; // mass of the computational cell - double omega[3]; // time derivative of the volume - double p_current[3],dilation[3]; - double qmass; // effective cell mass - double mu; // effective cell viscosity - double tscale; // converts thermal energy to compressive - // strain ke at simulation start - int dftb; // flag for use with DFTB+ + double omega[3]; // time derivative of the volume + double p_current[3], dilation[3]; + double qmass; // effective cell mass + double mu; // effective cell viscosity + double tscale; // converts thermal energy to compressive + // strain ke at simulation start + int dftb; // flag for use with DFTB+ - double velocity_sum; // sum of the velocities squared - double damping; // damping function for TS force term at - // small volume difference (v0 - vol) - double T0S0; // initial TS term for DFTB+ simulations - double S_elec,S_elec_1,S_elec_2; // time history of electron entropy - // for DFTB+ simulaitons - double TS_dot; // time derivative of TS term for - // DFTB+ simulations + double velocity_sum; // sum of the velocities squared + double damping; // damping function for TS force term at + // small volume difference (v0 - vol) + double T0S0; // initial TS term for DFTB+ simulations + double S_elec, S_elec_1, S_elec_2; // time history of electron entropy + // for DFTB+ simulaitons + double TS_dot; // time derivative of TS term for + // DFTB+ simulations - double **old_velocity; // saved velocities + double **old_velocity; // saved velocities - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes - char *id_temp,*id_press; // strings with identifiers of - char *id_pe; // created computes + char *id_temp, *id_press; // strings with identifiers of + char *id_pe; // created computes - class Compute *temperature; // computes created to evaluate - class Compute *pressure; // thermodynamic quantities + class Compute *temperature; // computes created to evaluate + class Compute *pressure; // thermodynamic quantities class Compute *pe; - int tflag,pflag,vsflag,peflag; // flags to keep track of computes that - // were created + int tflag, pflag, vsflag, peflag; // flags to keep track of computes that + // were created // shock initial conditions - double e0; // initial energy - double v0; // initial volume - double p0; // initial pressure - double velocity; // velocity of the shock - double lagrangian_position; // Lagrangian location of computational cell - int direction; // direction of shock - int p0_set; // is pressure set - int v0_set; // is volume set - int e0_set; // is energy set - double TS_int; // needed for conserved quantity - // with thermal electronic excitations - double beta; // energy conservation scaling factor + double e0; // initial energy + double v0; // initial volume + double p0; // initial pressure + double velocity; // velocity of the shock + double lagrangian_position; // Lagrangian location of computational cell + int direction; // direction of shock + int p0_set; // is pressure set + int v0_set; // is volume set + int e0_set; // is energy set + double TS_int; // needed for conserved quantity + // with thermal electronic excitations + double beta; // energy conservation scaling factor - int maxold; // allocated size of old_velocity - class FixExternal *fix_external; // ptr to fix external + int maxold; // allocated size of old_velocity + class FixExternal *fix_external; // ptr to fix external // functions @@ -108,7 +108,7 @@ class FixMSST : public Fix { double compute_vsum(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SHOCK/fix_nphug.h b/src/SHOCK/fix_nphug.h index d0679678be..88c3096d51 100644 --- a/src/SHOCK/fix_nphug.h +++ b/src/SHOCK/fix_nphug.h @@ -31,11 +31,11 @@ class FixNPHug : public FixNH { void init(); void setup(int); int modify_param(int, char **); - int pack_restart_data(double *); // pack restart data + int pack_restart_data(double *); // pack restart data void restart(char *); private: - class Compute *pe; // PE compute pointer + class Compute *pe; // PE compute pointer void compute_temp_target(); double compute_vector(int); @@ -47,15 +47,15 @@ class FixNPHug : public FixNH { char *id_pe; int peflag; - int v0_set,p0_set,e0_set; - double v0,p0,e0,rho0; + int v0_set, p0_set, e0_set; + double v0, p0, e0, rho0; int idir; int uniaxial; int size_restart_global(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SHOCK/fix_wall_piston.h b/src/SHOCK/fix_wall_piston.h index 63e7a5c8d5..91a9d301a3 100644 --- a/src/SHOCK/fix_wall_piston.h +++ b/src/SHOCK/fix_wall_piston.h @@ -32,16 +32,18 @@ class FixWallPiston : public Fix { void initial_integrate(int); private: - int xloflag,xhiflag,yloflag,yhiflag,zloflag,zhiflag; - int scaleflag, roughflag, rampflag, rampNL1flag, rampNL2flag, rampNL3flag, rampNL4flag, rampNL5flag; - double roughdist,roughoff,x0,y0,z0,vx,vy,vz,maxvx,maxvy,maxvz,paccelx,paccely,paccelz, angfreq; + int xloflag, xhiflag, yloflag, yhiflag, zloflag, zhiflag; + int scaleflag, roughflag, rampflag, rampNL1flag, rampNL2flag, rampNL3flag, rampNL4flag, + rampNL5flag; + double roughdist, roughoff, x0, y0, z0, vx, vy, vz, maxvx, maxvy, maxvz, paccelx, paccely, + paccelz, angfreq; int tempflag, tseed; double t_target, t_period, t_extent; class RanMars *randomt; - double *gfactor1,*gfactor2; + double *gfactor1, *gfactor2; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_sna_atom.h b/src/SNAP/compute_sna_atom.h index 0a9953b2f0..7049655531 100644 --- a/src/SNAP/compute_sna_atom.h +++ b/src/SNAP/compute_sna_atom.h @@ -42,14 +42,14 @@ class ComputeSNAAtom : public Compute { double rcutfac; double *radelem; double *wjelem; - int * map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; double cutmax; int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_snad_atom.h b/src/SNAP/compute_snad_atom.h index 8d448b613a..ce9fc8f09d 100644 --- a/src/SNAP/compute_snad_atom.h +++ b/src/SNAP/compute_snad_atom.h @@ -44,14 +44,14 @@ class ComputeSNADAtom : public Compute { double rcutfac; double *radelem; double *wjelem; - int *map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; double cutmax; int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_snap.h b/src/SNAP/compute_snap.h index a7230f272a..23364d559f 100644 --- a/src/SNAP/compute_snap.h +++ b/src/SNAP/compute_snap.h @@ -44,9 +44,9 @@ class ComputeSnap : public Compute { double rcutfac; double *radelem; double *wjelem; - int *map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; double cutmax; int quadraticflag; @@ -56,7 +56,7 @@ class ComputeSnap : public Compute { void dbdotr_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/compute_snav_atom.h b/src/SNAP/compute_snav_atom.h index acd13d36e4..d4dfffafe1 100644 --- a/src/SNAP/compute_snav_atom.h +++ b/src/SNAP/compute_snav_atom.h @@ -44,13 +44,13 @@ class ComputeSNAVAtom : public Compute { double rcutfac; double *radelem; double *wjelem; - int *map; // map types to [0,nelements) + int *map; // map types to [0,nelements) int nelements, chemflag; - class SNA* snaptr; + class SNA *snaptr; int quadraticflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/pair_snap.h b/src/SNAP/pair_snap.h index facb75868d..ed9cc7c2fe 100644 --- a/src/SNAP/pair_snap.h +++ b/src/SNAP/pair_snap.h @@ -25,7 +25,7 @@ PairStyle(snap,PairSNAP); namespace LAMMPS_NS { class PairSNAP : public Pair { -public: + public: PairSNAP(class LAMMPS *); ~PairSNAP(); virtual void compute(int, int); @@ -35,35 +35,35 @@ public: virtual double init_one(int, int); virtual double memory_usage(); - double rcutfac, quadraticflag; // declared public to workaround gcc 4.9 - int ncoeff; // compiler bug, manifest in KOKKOS package + double rcutfac, quadraticflag; // declared public to workaround gcc 4.9 + int ncoeff; // compiler bug, manifest in KOKKOS package -protected: + protected: int ncoeffq, ncoeffall; - class SNA* snaptr; + class SNA *snaptr; virtual void allocate(); void read_files(char *, char *); - inline int equal(double* x,double* y); - inline double dist2(double* x,double* y); + inline int equal(double *x, double *y); + inline double dist2(double *x, double *y); void compute_beta(); void compute_bispectrum(); - double rcutmax; // max cutoff for all elements - double *radelem; // element radii - double *wjelem; // elements weights - double **coeffelem; // element bispectrum coefficients - double** beta; // betas for all atoms in list - double** bispectrum; // bispectrum components for all atoms in list + double rcutmax; // max cutoff for all elements + double *radelem; // element radii + double *wjelem; // elements weights + double **coeffelem; // element bispectrum coefficients + double **beta; // betas for all atoms in list + double **bispectrum; // bispectrum components for all atoms in list int twojmax, switchflag, bzeroflag, bnormflag; int chemflag, wselfallflag; int chunksize; double rfac0, rmin0, wj1, wj2; - int rcutfacflag, twojmaxflag; // flags for required parameters - int beta_max; // length of beta + int rcutfacflag, twojmaxflag; // flags for required parameters + int beta_max; // length of beta }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SNAP/sna.h b/src/SNAP/sna.h index 1444fecaf7..5bab5e74fb 100644 --- a/src/SNAP/sna.h +++ b/src/SNAP/sna.h @@ -32,10 +32,10 @@ struct SNA_BINDICES { class SNA : protected Pointers { -public: - SNA(LAMMPS*, double, int, double, int, int, int, int, int, int); + public: + SNA(LAMMPS *, double, int, double, int, int, int, int, int, int); - SNA(LAMMPS* lmp) : Pointers(lmp) {}; + SNA(LAMMPS *lmp) : Pointers(lmp){}; ~SNA(); void build_indexlist(); void init(); @@ -47,58 +47,56 @@ public: void compute_ui(int, int); void compute_zi(); - void compute_yi(const double*); - void compute_yterm(int, int, int, const double*); + void compute_yi(const double *); + void compute_yterm(int, int, int, const double *); void compute_bi(int); // functions for derivatives - void compute_duidrj(double*, double, double, int, int); + void compute_duidrj(double *, double, double, int, int); void compute_dbidrj(); - void compute_deidrj(double*); + void compute_deidrj(double *); double compute_sfac(double, double); double compute_dsfac(double, double); - double* blist; - double** dblist; - double** rij; - int* inside; - double* wj; - double* rcutij; - int* element; // index on [0,nelements) + double *blist; + double **dblist; + double **rij; + int *inside; + double *wj; + double *rcutij; + int *element; // index on [0,nelements) int nmax; void grow_rij(int); int twojmax; - double* ylist_r, * ylist_i; + double *ylist_r, *ylist_i; int idxcg_max, idxu_max, idxz_max, idxb_max; - - -private: + private: double rmin0, rfac0; // data for bispectrum coefficients - SNA_ZINDICES* idxz; - SNA_BINDICES* idxb; + SNA_ZINDICES *idxz; + SNA_BINDICES *idxb; - double** rootpqarray; - double* cglist; - int*** idxcg_block; + double **rootpqarray; + double *cglist; + int ***idxcg_block; - double* ulisttot_r, * ulisttot_i; - double** ulist_r_ij, ** ulist_i_ij; - int* idxu_block; + double *ulisttot_r, *ulisttot_i; + double **ulist_r_ij, **ulist_i_ij; + int *idxu_block; - double* zlist_r, * zlist_i; - int*** idxz_block; + double *zlist_r, *zlist_i; + int ***idxz_block; - int*** idxb_block; + int ***idxb_block; - double** dulist_r, ** dulist_i; - int elem_duarray; // element of j in derivative + double **dulist_r, **dulist_i; + int elem_duarray; // element of j in derivative void create_twojmax_arrays(); void destroy_twojmax_arrays(); @@ -107,12 +105,10 @@ private: void init_rootpqarray(); void zero_uarraytot(int); void add_uarraytot(double, double, double, int, int); - void compute_uarray(double, double, double, - double, double, int); + void compute_uarray(double, double, double, double, double, int); double deltacg(int, int, int); void compute_ncoeff(); - void compute_duarray(double, double, double, - double, double, double, double, double, int); + void compute_duarray(double, double, double, double, double, double, double, double, int); // Sets the style for the switching function // 0 = none @@ -122,17 +118,17 @@ private: // Self-weight double wself; - int bzero_flag; // 1 if bzero subtracted from barray - double* bzero; // array of B values for isolated atoms - int bnorm_flag; // 1 if barray divided by j+1 - int chem_flag; // 1 for multi-element bispectrum components - int wselfall_flag; // 1 for adding wself to all element labelings - int nelements; // number of elements - int ndoubles; // number of multi-element pairs - int ntriples; // number of multi-element triplets + int bzero_flag; // 1 if bzero subtracted from barray + double *bzero; // array of B values for isolated atoms + int bnorm_flag; // 1 if barray divided by j+1 + int chem_flag; // 1 for multi-element bispectrum components + int wselfall_flag; // 1 for adding wself to all element labelings + int nelements; // number of elements + int ndoubles; // number of multi-element pairs + int ntriples; // number of multi-element triplets }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/SPIN/atom_vec_spin.h b/src/SPIN/atom_vec_spin.h index 305ac737e1..cc2b297f02 100644 --- a/src/SPIN/atom_vec_spin.h +++ b/src/SPIN/atom_vec_spin.h @@ -33,10 +33,10 @@ class AtomVecSpin : public AtomVec { void data_atom_post(int); private: - double **sp,**fm,**fm_long; + double **sp, **fm, **fm_long; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/compute_spin.h b/src/SPIN/compute_spin.h index 4127314ca1..f3e6e32d75 100644 --- a/src/SPIN/compute_spin.h +++ b/src/SPIN/compute_spin.h @@ -32,11 +32,11 @@ class ComputeSpin : public Compute { void compute_vector(); private: - int pair_spin_flag; // magnetic pair flags - int long_spin_flag; // magnetic long-range flag - int precession_spin_flag; // magnetic precession flags + int pair_spin_flag; // magnetic pair flags + int long_spin_flag; // magnetic long-range flag + int precession_spin_flag; // magnetic precession flags - double kb,hbar; + double kb, hbar; // pointers to magnetic fixes @@ -44,14 +44,14 @@ class ComputeSpin : public Compute { // pointers to magnetic pair styles - int npairs, npairspin; // # of pairs, and # of spin pairs + int npairs, npairspin; // # of pairs, and # of spin pairs class Pair *pair; - class PairSpin **spin_pairs; // vector of spin pairs + class PairSpin **spin_pairs; // vector of spin pairs void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_langevin_spin.h b/src/SPIN/fix_langevin_spin.h index 91e27c9ed7..9aed228ef8 100644 --- a/src/SPIN/fix_langevin_spin.h +++ b/src/SPIN/fix_langevin_spin.h @@ -26,31 +26,30 @@ namespace LAMMPS_NS { class FixLangevinSpin : public Fix { public: - int tdamp_flag,temp_flag; // damping and temperature flags + int tdamp_flag, temp_flag; // damping and temperature flags FixLangevinSpin(class LAMMPS *, int, char **); virtual ~FixLangevinSpin(); int setmask(); void init(); void setup(int); - void add_tdamping(double *, double *); // add transverse damping + void add_tdamping(double *, double *); // add transverse damping void add_temperature(double[3]); void compute_single_langevin(int, double *, double *); protected: - double alpha_t; // transverse mag. damping - double dts; // magnetic timestep - double temp; // spin bath temperature - double D,sigma; // bath intensity var. - double gil_factor; // gilbert's prefactor + double alpha_t; // transverse mag. damping + double dts; // magnetic timestep + double temp; // spin bath temperature + double D, sigma; // bath intensity var. + double gil_factor; // gilbert's prefactor int nlevels_respa; class RanMars *random; int seed; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_neb_spin.h b/src/SPIN/fix_neb_spin.h index 05820510c7..58db1c60ca 100644 --- a/src/SPIN/fix_neb_spin.h +++ b/src/SPIN/fix_neb_spin.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixNEBSpin : public Fix { public: - double veng,plen,nlen,dotpath,dottangrad,gradlen,dotgrad; + double veng, plen, nlen, dotpath, dottangrad, gradlen, dotgrad; int rclimber; FixNEBSpin(class LAMMPS *, int, char **); @@ -37,50 +37,49 @@ class FixNEBSpin : public Fix { void min_post_force(int); private: - int me,nprocs,nprocs_universe; - double kspring,kspringIni,kspringFinal,kspringPerp,EIniIni,EFinalIni; - bool StandardNEB,NEBLongRange,PerpSpring,FreeEndIni,FreeEndFinal; - bool FreeEndFinalWithRespToEIni,FinalAndInterWithRespToEIni; + int me, nprocs, nprocs_universe; + double kspring, kspringIni, kspringFinal, kspringPerp, EIniIni, EFinalIni; + bool StandardNEB, NEBLongRange, PerpSpring, FreeEndIni, FreeEndFinal; + bool FreeEndFinalWithRespToEIni, FinalAndInterWithRespToEIni; bool SpinLattice; - int ireplica,nreplica; - int procnext,procprev; + int ireplica, nreplica; + int procnext, procprev; int cmode; MPI_Comm uworld; MPI_Comm rootworld; - char *id_pe; class Compute *pe; int nebatoms; - int ntotal; // total # of atoms, NEB or not - int maxlocal; // size of xprev,xnext,tangent arrays + int ntotal; // total # of atoms, NEB or not + int maxlocal; // size of xprev,xnext,tangent arrays double *nlenall; - double **xprev,**xnext,**fnext; - double **spprev,**spnext,**fmnext; + double **xprev, **xnext, **fnext; + double **spprev, **spnext, **fmnext; double **springF; double **tangent; - double **xsend,**xrecv; // coords to send/recv to/from other replica - double **fsend,**frecv; // coords to send/recv to/from other replica - double **spsend,**sprecv; // sp to send/recv to/from other replica - double **fmsend,**fmrecv; // fm to send/recv to/from other replica - tagint *tagsend,*tagrecv; // ditto for atom IDs + double **xsend, **xrecv; // coords to send/recv to/from other replica + double **fsend, **frecv; // coords to send/recv to/from other replica + double **spsend, **sprecv; // sp to send/recv to/from other replica + double **fmsend, **fmrecv; // fm to send/recv to/from other replica + tagint *tagsend, *tagrecv; // ditto for atom IDs - // info gathered from all procs in my replica - double **xsendall,**xrecvall; // coords to send/recv to/from other replica - double **fsendall,**frecvall; // force to send/recv to/from other replica - double **spsendall,**sprecvall; // sp to send/recv to/from other replica - double **fmsendall,**fmrecvall; // fm to send/recv to/from other replica - tagint *tagsendall,*tagrecvall; // ditto for atom IDs + // info gathered from all procs in my replica + double **xsendall, **xrecvall; // coords to send/recv to/from other replica + double **fsendall, **frecvall; // force to send/recv to/from other replica + double **spsendall, **sprecvall; // sp to send/recv to/from other replica + double **fmsendall, **fmrecvall; // fm to send/recv to/from other replica + tagint *tagsendall, *tagrecvall; // ditto for atom IDs - int *counts,*displacements; // used for MPI_Gather + int *counts, *displacements; // used for MPI_Gather double geodesic_distance(double *, double *); void inter_replica_comm(); void reallocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_nve_spin.h b/src/SPIN/fix_nve_spin.h index 95995f1f6a..e4f7e40475 100644 --- a/src/SPIN/fix_nve_spin.h +++ b/src/SPIN/fix_nve_spin.h @@ -25,7 +25,8 @@ FixStyle(nve/spin,FixNVESpin); namespace LAMMPS_NS { class FixNVESpin : public Fix { -friend class PairSpin; + friend class PairSpin; + public: FixNVESpin(class LAMMPS *, int, char **); virtual ~FixNVESpin(); @@ -37,35 +38,35 @@ friend class PairSpin; void ComputeInteractionsSpin(int); // compute and advance single spin functions void AdvanceSingleSpin(int); - void sectoring(); // sectoring operation functions + void sectoring(); // sectoring operation functions int coords2sector(double *); void setup_pre_neighbor(); void pre_neighbor(); - int lattice_flag; // lattice_flag = 0 if spins only - // lattice_flag = 1 if spin-lattice calc. + int lattice_flag; // lattice_flag = 0 if spins only + // lattice_flag = 1 if spin-lattice calc. protected: - int sector_flag; // sector_flag = 0 if serial algorithm - // sector_flag = 1 if parallel algorithm + int sector_flag; // sector_flag = 0 if serial algorithm + // sector_flag = 1 if parallel algorithm - double dtv, dtf, dts; // velocity, force, and spin timesteps + double dtv, dtf, dts; // velocity, force, and spin timesteps - int nlocal_max; // max value of nlocal (for size of lists) + int nlocal_max; // max value of nlocal (for size of lists) - int pair_spin_flag; // magnetic pair flags - int long_spin_flag; // magnetic long-range flag - int precession_spin_flag; // magnetic precession flags - int maglangevin_flag; // magnetic langevin flags + int pair_spin_flag; // magnetic pair flags + int long_spin_flag; // magnetic long-range flag + int precession_spin_flag; // magnetic precession flags + int maglangevin_flag; // magnetic langevin flags int tdamp_flag, temp_flag; int setforce_spin_flag; // pointers to magnetic pair styles - int npairs, npairspin; // # of pairs, and # of spin pairs + int npairs, npairspin; // # of pairs, and # of spin pairs class Pair *pair; - class PairSpin **spin_pairs; // vector of spin pairs + class PairSpin **spin_pairs; // vector of spin pairs // pointers to fix langevin/spin styles @@ -75,7 +76,7 @@ friend class PairSpin; // pointers to fix setforce/spin styles int nsetspin; - class FixSetForceSpin *locksetforcespin; // to be done + class FixSetForceSpin *locksetforcespin; // to be done // pointers to fix precession/spin styles @@ -89,14 +90,13 @@ friend class PairSpin; // stacking variables for sectoring algorithm - int *stack_head; // index of first atom in backward_stacks - int *stack_foot; // index of first atom in forward_stacks - int *backward_stacks; // index of next atom in backward stack - int *forward_stacks; // index of next atom in forward stack - + int *stack_head; // index of first atom in backward_stacks + int *stack_foot; // index of first atom in forward_stacks + int *backward_stacks; // index of next atom in backward stack + int *forward_stacks; // index of next atom in forward stack }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_precession_spin.h b/src/SPIN/fix_precession_spin.h index 92168b1745..3ce286bb78 100644 --- a/src/SPIN/fix_precession_spin.h +++ b/src/SPIN/fix_precession_spin.h @@ -69,11 +69,11 @@ class FixPrecessionSpin : public Fix { // storing magnetic energies - int nlocal_max; // max nlocal (for list size) - double *emag; // energy list + int nlocal_max; // max nlocal (for list size) + double *emag; // energy list protected: - int style; // style of the magnetic precession + int style; // style of the magnetic precession double degree2rad; double hbar; @@ -91,7 +91,7 @@ class FixPrecessionSpin : public Fix { double H_field; double nhx, nhy, nhz; - double hx, hy, hz; // temp. force variables + double hx, hy, hz; // temp. force variables // STT intensity and direction @@ -101,31 +101,30 @@ class FixPrecessionSpin : public Fix { // magnetic anisotropy intensity and direction - double Ka; // aniso const. in eV - double Kah; // aniso const. in rad.THz + double Ka; // aniso const. in eV + double Kah; // aniso const. in rad.THz double nax, nay, naz; - double Kax, Kay, Kaz; // temp. force variables + double Kax, Kay, Kaz; // temp. force variables // cubic anisotropy intensity - double k1c,k2c; // cubic const. in eV - double k1ch,k2ch; // cubic const. in rad.THz - double nc1x,nc1y,nc1z; - double nc2x,nc2y,nc2z; - double nc3x,nc3y,nc3z; + double k1c, k2c; // cubic const. in eV + double k1ch, k2ch; // cubic const. in rad.THz + double nc1x, nc1y, nc1z; + double nc2x, nc2y, nc2z; + double nc3x, nc3y, nc3z; // hexagonal anisotropy double K6; // hexagonal aniso const. in eV - double K6h; // hexagonal aniso const. in rad.THz - double n6x,n6y,n6z; // main axis - double m6x,m6y,m6z; // secondary (perpendicular) axis - double l6x,l6y,l6z; // =(m x n) + double K6h; // hexagonal aniso const. in rad.THz + double n6x, n6y, n6z; // main axis + double m6x, m6y, m6z; // secondary (perpendicular) axis + double l6x, l6y, l6z; // =(m x n) void set_magneticprecession(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/fix_setforce_spin.h b/src/SPIN/fix_setforce_spin.h index f1aaddeae2..aae917e7d8 100644 --- a/src/SPIN/fix_setforce_spin.h +++ b/src/SPIN/fix_setforce_spin.h @@ -32,7 +32,7 @@ class FixSetForceSpin : public FixSetForce { void single_setforce_spin(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/min_spin.h b/src/SPIN/min_spin.h index a31aa8712d..ed354d6cc9 100644 --- a/src/SPIN/min_spin.h +++ b/src/SPIN/min_spin.h @@ -37,22 +37,21 @@ class MinSpin : public Min { void advance_spins(double); private: - // global and spin timesteps double dt; double dts; - double alpha_damp; // damping for spin minimization - double discrete_factor; // factor for spin timestep evaluation + double alpha_damp; // damping for spin minimization + double discrete_factor; // factor for spin timestep evaluation - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/min_spin_cg.h b/src/SPIN/min_spin_cg.h index 41b3cd655b..572e64e6ca 100644 --- a/src/SPIN/min_spin_cg.h +++ b/src/SPIN/min_spin_cg.h @@ -24,7 +24,7 @@ MinimizeStyle(spin/cg, MinSpinCG); namespace LAMMPS_NS { -class MinSpinCG: public Min { +class MinSpinCG : public Min { public: MinSpinCG(class LAMMPS *); virtual ~MinSpinCG(); @@ -35,21 +35,21 @@ class MinSpinCG: public Min { int iterate(int); private: - int local_iter; // for neb - int nlocal_max; // max value of nlocal (for size of lists) - int use_line_search; // use line search or not. - int ireplica,nreplica; // for neb - double dt; // global timestep - double dts; // spin timestep - double discrete_factor; // factor for spin timestep evaluation - double der_e_cur; // current derivative along search dir. - double der_e_pr; // previous derivative along search dir. - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector - double *g_old; // gradient vector at previous step - double *g_cur; // current gradient vector - double *p_s; // search direction vector - double **sp_copy; // copy of the spins + int local_iter; // for neb + int nlocal_max; // max value of nlocal (for size of lists) + int use_line_search; // use line search or not. + int ireplica, nreplica; // for neb + double dt; // global timestep + double dts; // spin timestep + double discrete_factor; // factor for spin timestep evaluation + double der_e_cur; // current derivative along search dir. + double der_e_pr; // previous derivative along search dir. + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector + double *g_old; // gradient vector at previous step + double *g_cur; // current gradient vector + double *p_s; // search direction vector + double **sp_copy; // copy of the spins void advance_spins(); void calc_gradient(); @@ -65,7 +65,7 @@ class MinSpinCG: public Min { bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/min_spin_lbfgs.h b/src/SPIN/min_spin_lbfgs.h index 9274c750fe..4ec3d36544 100644 --- a/src/SPIN/min_spin_lbfgs.h +++ b/src/SPIN/min_spin_lbfgs.h @@ -24,7 +24,7 @@ MinimizeStyle(spin/lbfgs, MinSpinLBFGS); namespace LAMMPS_NS { -class MinSpinLBFGS: public Min { +class MinSpinLBFGS : public Min { public: MinSpinLBFGS(class LAMMPS *); virtual ~MinSpinLBFGS(); @@ -35,18 +35,18 @@ class MinSpinLBFGS: public Min { int iterate(int); private: - int local_iter; // for neb - int use_line_search; // use line search or not. - int nlocal_max; // max value of nlocal (for size of lists) - int ireplica,nreplica; // for neb - double der_e_cur; // current derivative along search dir. - double der_e_pr; // previous derivative along search dir. + int local_iter; // for neb + int use_line_search; // use line search or not. + int nlocal_max; // max value of nlocal (for size of lists) + int ireplica, nreplica; // for neb + double der_e_cur; // current derivative along search dir. + double der_e_pr; // previous derivative along search dir. double maxepsrot; - double *spvec; // variables for atomic dof, as 1d vector - double *fmvec; // variables for atomic dof, as 1d vector - double *g_old; // gradient vector at previous step - double *g_cur; // current gradient vector - double *p_s; // search direction vector + double *spvec; // variables for atomic dof, as 1d vector + double *fmvec; // variables for atomic dof, as 1d vector + double *g_old; // gradient vector at previous step + double *g_cur; // current gradient vector + double *p_s; // search direction vector void advance_spins(); void calc_gradient(); @@ -58,15 +58,15 @@ class MinSpinLBFGS: public Min { int adescent(double, double); double maximum_rotation(double *); - double *rho; // estimation of curvature - double **ds; // change in rotation matrix between two iterations, da - double **dy; // change in gradients between two iterations, dg - double **sp_copy; // copy of the spins - int num_mem; // number of stored steps + double *rho; // estimation of curvature + double **ds; // change in rotation matrix between two iterations, da + double **dy; // change in gradients between two iterations, dg + double **sp_copy; // copy of the spins + int num_mem; // number of stored steps bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/neb_spin.h b/src/SPIN/neb_spin.h index 892593bc26..55c794cd6b 100644 --- a/src/SPIN/neb_spin.h +++ b/src/SPIN/neb_spin.h @@ -28,31 +28,31 @@ class NEBSpin : public Command { public: NEBSpin(class LAMMPS *); ~NEBSpin(); - void command(int, char **); // process neb/spin command - void run(); // run NEBSpin + void command(int, char **); // process neb/spin command + void run(); // run NEBSpin - double ebf,ebr; // forward and reverse energy barriers + double ebf, ebr; // forward and reverse energy barriers private: - int me,me_universe; // my proc ID in world and universe - int ireplica,nreplica; + int me, me_universe; // my proc ID in world and universe + int ireplica, nreplica; bool verbose; MPI_Comm uworld; - MPI_Comm roots; // MPI comm with 1 root proc from each world + MPI_Comm roots; // MPI comm with 1 root proc from each world FILE *fp; int compressed; - double etol; // energy tolerance convergence criterion - double ttol; // torque tolerance convergence criterion - int n1steps, n2steps; // number of steps in stage 1 and 2 - int nevery; // output interval - char *inpfile; // name of file containing final state + double etol; // energy tolerance convergence criterion + double ttol; // torque tolerance convergence criterion + int n1steps, n2steps; // number of steps in stage 1 and 2 + int nevery; // output interval + char *inpfile; // name of file containing final state class FixNEBSpin *fneb; - int numall; // per-replica dimension of array all - double **all; // PE,plen,nlen,gradvnorm from each replica - double *rdist; // normalize reaction distance, 0 to 1 - double *freplica; // force on an image - double *fmaxatomInRepl; // force on an image + int numall; // per-replica dimension of array all + double **all; // PE,plen,nlen,gradvnorm from each replica + double *rdist; // normalize reaction distance, 0 to 1 + double *freplica; // force on an image + double *fmaxatomInRepl; // force on an image void readfile(char *, int); int initial_rotation(double *, double *, double); @@ -60,7 +60,7 @@ class NEBSpin : public Command { void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index 2e115d69f1..ae5fbff324 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -14,37 +14,38 @@ #ifndef LMP_PAIR_SPIN_H #define LMP_PAIR_SPIN_H -#include "pair.h" // IWYU pragma: export +#include "pair.h" // IWYU pragma: export namespace LAMMPS_NS { class PairSpin : public Pair { -friend class FixNVESpin; + friend class FixNVESpin; + public: PairSpin(class LAMMPS *); virtual ~PairSpin(); virtual void settings(int, char **); virtual void coeff(int, char **) {} virtual void init_style(); - virtual double init_one(int, int) {return 0.0;} - virtual void *extract(const char *, int &) {return nullptr;} + virtual double init_one(int, int) { return 0.0; } + virtual void *extract(const char *, int &) { return nullptr; } virtual void compute(int, int) {} virtual void compute_single_pair(int, double *) {} // storing magnetic energies - int nlocal_max; // max nlocal (for list size) - double *emag; // energy list + int nlocal_max; // max nlocal (for list size) + double *emag; // energy list protected: - double hbar; // Planck constant (eV.ps.rad-1) - int lattice_flag; // flag for mech force computation + double hbar; // Planck constant (eV.ps.rad-1) + int lattice_flag; // flag for mech force computation virtual void allocate() {} }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/SPIN/pair_spin_dipole_cut.h b/src/SPIN/pair_spin_dipole_cut.h index 9c793bb63c..abda4bb206 100644 --- a/src/SPIN/pair_spin_dipole_cut.h +++ b/src/SPIN/pair_spin_dipole_cut.h @@ -39,26 +39,24 @@ class PairSpinDipoleCut : public PairSpin { void compute(int, int); void compute_single_pair(int, double *); - void compute_dipolar(int, int, double *, double *, double *, - double *, double); - void compute_dipolar_mech(int, int, double *, double *, double *, - double *, double); + void compute_dipolar(int, int, double *, double *, double *, double *, double); + void compute_dipolar_mech(int, int, double *, double *, double *, double *, double); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_long_global; // global long cutoff distance + double cut_spin_long_global; // global long cutoff distance protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force - double **cut_spin_long; // cutoff distance long + double **cut_spin_long; // cutoff distance long double g_ewald; int ewald_order; @@ -66,7 +64,7 @@ class PairSpinDipoleCut : public PairSpin { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_dipole_long.h b/src/SPIN/pair_spin_dipole_long.h index 588720ba64..c70d23bdd5 100644 --- a/src/SPIN/pair_spin_dipole_long.h +++ b/src/SPIN/pair_spin_dipole_long.h @@ -40,26 +40,24 @@ class PairSpinDipoleLong : public PairSpin { void compute(int, int); void compute_single_pair(int, double *); - void compute_long(int, int, double *, double *, double *, - double *, double *); - void compute_long_mech(int, int, double *, double *, double *, - double *, double *); + void compute_long(int, int, double *, double *, double *, double *, double *); + void compute_long_mech(int, int, double *, double *, double *, double *, double *); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_long_global; // global long cutoff distance + double cut_spin_long_global; // global long cutoff distance protected: - double hbar; // reduced Planck's constant - double mub; // Bohr's magneton - double mu_0; // vacuum permeability - double mub2mu0; // prefactor for mech force - double mub2mu0hbinv; // prefactor for mag force + double hbar; // reduced Planck's constant + double mub; // Bohr's magneton + double mu_0; // vacuum permeability + double mub2mu0; // prefactor for mech force + double mub2mu0hbinv; // prefactor for mag force - double **cut_spin_long; // cutoff distance long + double **cut_spin_long; // cutoff distance long double g_ewald; int ewald_order; @@ -67,7 +65,7 @@ class PairSpinDipoleLong : public PairSpin { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_dmi.h b/src/SPIN/pair_spin_dmi.h index 67b49a68a3..1501d69faf 100644 --- a/src/SPIN/pair_spin_dmi.h +++ b/src/SPIN/pair_spin_dmi.h @@ -44,18 +44,18 @@ class PairSpinDmi : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_dmi_global; // short range pair cutoff + double cut_spin_dmi_global; // short range pair cutoff protected: - double **DM; // dmi coeff in eV - double **v_dmx, **v_dmy, **v_dmz; // dmi direction - double **vmech_dmx, **vmech_dmy, **vmech_dmz; // dmi mech direction - double **cut_spin_dmi; // cutoff distance dmi + double **DM; // dmi coeff in eV + double **v_dmx, **v_dmy, **v_dmz; // dmi direction + double **vmech_dmx, **vmech_dmy, **vmech_dmz; // dmi mech direction + double **cut_spin_dmi; // cutoff distance dmi void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_exchange.h b/src/SPIN/pair_spin_exchange.h index 04461bdd35..f75c25d072 100644 --- a/src/SPIN/pair_spin_exchange.h +++ b/src/SPIN/pair_spin_exchange.h @@ -38,26 +38,26 @@ class PairSpinExchange : public PairSpin { void compute_exchange(int, int, double, double *, double *); void compute_exchange_mech(int, int, double, double *, double *, double *, double *); - double compute_energy(int , int , double , double *, double *); + double compute_energy(int, int, double, double *, double *); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_exchange_global; // global exchange cutoff distance + double cut_spin_exchange_global; // global exchange cutoff distance protected: - int e_offset; // apply energy offset - double **J1_mag; // exchange coeffs in eV - double **J1_mech; // mech exchange coeffs in - double **J2, **J3; // J1 in eV, J2 adim, J3 in Ang - double **cut_spin_exchange; // cutoff distance exchange + int e_offset; // apply energy offset + double **J1_mag; // exchange coeffs in eV + double **J1_mech; // mech exchange coeffs in + double **J2, **J3; // J1 in eV, J2 adim, J3 in Ang + double **cut_spin_exchange; // cutoff distance exchange void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_exchange_biquadratic.h b/src/SPIN/pair_spin_exchange_biquadratic.h index 19079c726b..b3b595e4fc 100644 --- a/src/SPIN/pair_spin_exchange_biquadratic.h +++ b/src/SPIN/pair_spin_exchange_biquadratic.h @@ -38,30 +38,29 @@ class PairSpinExchangeBiquadratic : public PairSpin { void compute_exchange(int, int, double, double *, double *, double *); void compute_exchange_mech(int, int, double, double *, double *, double *, double *); - double compute_energy(int , int , double , double *, double *); + double compute_energy(int, int, double, double *, double *); void write_restart(FILE *); void read_restart(FILE *); void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_exchange_global; // global exchange cutoff distance + double cut_spin_exchange_global; // global exchange cutoff distance protected: - - int e_offset; // apply energy offset - double **J1_mag; // H exchange coeffs in eV - double **J1_mech; // mech exchange coeffs in - double **J2, **J3; // J1 in eV, J2 in Ang-1, J3 in Ang - double **K1_mag; // Bi exchange coeffs in eV - double **K1_mech; // mech exchange coeffs in - double **K2, **K3; // K1 in eV, K2 Ang-1, K3 in Ang - double **cut_spin_exchange; // cutoff distance exchange + int e_offset; // apply energy offset + double **J1_mag; // H exchange coeffs in eV + double **J1_mech; // mech exchange coeffs in + double **J2, **J3; // J1 in eV, J2 in Ang-1, J3 in Ang + double **K1_mag; // Bi exchange coeffs in eV + double **K1_mech; // mech exchange coeffs in + double **K2, **K3; // K1 in eV, K2 Ang-1, K3 in Ang + double **cut_spin_exchange; // cutoff distance exchange void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_magelec.h b/src/SPIN/pair_spin_magelec.h index e79261ad56..3c266df313 100644 --- a/src/SPIN/pair_spin_magelec.h +++ b/src/SPIN/pair_spin_magelec.h @@ -44,17 +44,17 @@ class PairSpinMagelec : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_magelec_global; // global me cutoff + double cut_spin_magelec_global; // global me cutoff protected: - double **ME, **ME_mech; // magelec coeff in eV - double **v_mex, **v_mey, **v_mez; // magelec direction - double **cut_spin_magelec; // magelec cutoff distance + double **ME, **ME_mech; // magelec coeff in eV + double **v_mex, **v_mey, **v_mez; // magelec direction + double **cut_spin_magelec; // magelec cutoff distance void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SPIN/pair_spin_neel.h b/src/SPIN/pair_spin_neel.h index fa0d885c88..e5e007b496 100644 --- a/src/SPIN/pair_spin_neel.h +++ b/src/SPIN/pair_spin_neel.h @@ -45,22 +45,21 @@ class PairSpinNeel : public PairSpin { void write_restart_settings(FILE *); void read_restart_settings(FILE *); - double cut_spin_neel_global; // global neel cutoff distance + double cut_spin_neel_global; // global neel cutoff distance protected: - // pseudo-dipolar and pseudo-quadrupolar coeff. - double **g1, **g1_mech; // neel coeffs gij - double **g2, **g3; // g1 in eV, g2 adim, g3 in Ang - double **q1, **q1_mech; // neel coeffs qij - double **q2, **q3; // q1 in eV, q2 adim, q3 in Ang - double **cut_spin_neel; // cutoff distance exchange + double **g1, **g1_mech; // neel coeffs gij + double **g2, **g3; // g1 in eV, g2 adim, g3 in Ang + double **q1, **q1_mech; // neel coeffs qij + double **q2, **q3; // q1 in eV, q2 adim, q3 in Ang + double **cut_spin_neel; // cutoff distance exchange void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SRD/fix_srd.h b/src/SRD/fix_srd.h index c1c37fd79d..2bfb134e0b 100644 --- a/src/SRD/fix_srd.h +++ b/src/SRD/fix_srd.h @@ -40,27 +40,27 @@ class FixSRD : public Fix { void unpack_reverse_comm(int, int *, double *); private: - int me,nprocs; - int bigexist,biggroup,biggroupbit; - int collidestyle,lamdaflag,overlap,insideflag,exactflag,maxbounceallow; - int cubicflag,shiftuser,shiftseed,shiftflag,tstat; - int rescale_rotate,rescale_collide; - double gridsrd,gridsearch,lamda,radfactor,cubictol; - int triclinic,change_size,change_shape,deformflag; + int me, nprocs; + int bigexist, biggroup, biggroupbit; + int collidestyle, lamdaflag, overlap, insideflag, exactflag, maxbounceallow; + int cubicflag, shiftuser, shiftseed, shiftflag, tstat; + int rescale_rotate, rescale_collide; + double gridsrd, gridsearch, lamda, radfactor, cubictol; + int triclinic, change_size, change_shape, deformflag; - double dt_big,dt_srd; - double mass_big,mass_srd; + double dt_big, dt_srd; + double mass_big, mass_srd; double temperature_srd; double sigma; double srd_per_cell; - double dmax,vmax,vmaxsq; - double maxbigdiam,minbigdiam; - double dist_ghost,dist_srd,dist_srd_reneigh; // explained in code + double dmax, vmax, vmaxsq; + double maxbigdiam, minbigdiam; + double dist_ghost, dist_srd, dist_srd_reneigh; // explained in code - int wallexist,nwall,wallvarflag; + int wallexist, nwall, wallvarflag; class FixWallSRD *wallfix; int *wallwhich; - double *xwall,*xwallhold,*vwall; + double *xwall, *xwallhold, *vwall; double **fwall; double walltrigger; @@ -71,59 +71,59 @@ class FixSRD : public Fix { // for orthogonal box, these are in box units // for triclinic box, these are in lamda units - double srdlo[3],srdhi[3]; // SRDs must stay inside - double srdlo_reneigh[3],srdhi_reneigh[3]; // SRDs trigger a reneigh + double srdlo[3], srdhi[3]; // SRDs must stay inside + double srdlo_reneigh[3], srdhi_reneigh[3]; // SRDs trigger a reneigh int dimension; - int initflag,setupflag,reneighflag; + int initflag, setupflag, reneighflag; class RanMars *random; class RanPark *randomshift; // stats - int ncheck,ncollide,ninside,nrescale,reneighcount; - int nbounce,bouncemaxnum,bouncemax; + int ncheck, ncollide, ninside, nrescale, reneighcount; + int nbounce, bouncemaxnum, bouncemax; int stats_flag; int srd_bin_count; double srd_bin_temp; - double stats[12],stats_all[12]; + double stats[12], stats_all[12]; - double **flocal; // local ptrs to atom force and torque + double **flocal; // local ptrs to atom force and torque double **tlocal; // info to store for each owned and ghost big particle and wall struct Big { - int index; // local index of particle/wall - int type; // SPHERE or ELLIPSOID or LINE or TRI or WALL - double radius,radsq; // radius of sphere - double aradsqinv; // 3 ellipsoid radii + int index; // local index of particle/wall + int type; // SPHERE or ELLIPSOID or LINE or TRI or WALL + double radius, radsq; // radius of sphere + double aradsqinv; // 3 ellipsoid radii double bradsqinv; double cradsqinv; - double length; // length of line segment - double normbody[3]; // normal of tri in body-frame - double cutbinsq; // add big to bin if within this distance - double omega[3]; // current omega for sphere/ellipsoid/tri/line - double ex[3],ey[3],ez[3]; // current orientation vecs for ellipsoid/tri - double norm[3]; // current unit normal of tri in space-frame - double theta; // current orientation of line + double length; // length of line segment + double normbody[3]; // normal of tri in body-frame + double cutbinsq; // add big to bin if within this distance + double omega[3]; // current omega for sphere/ellipsoid/tri/line + double ex[3], ey[3], ez[3]; // current orientation vecs for ellipsoid/tri + double norm[3]; // current unit normal of tri in space-frame + double theta; // current orientation of line }; - Big *biglist; // list of info for each owned & ghost big and wall - int torqueflag; // 1 if any big particle is torqued + Big *biglist; // list of info for each owned & ghost big and wall + int torqueflag; // 1 if any big particle is torqued // current size of particle-based arrays - int nbig; // # of owned/ghost big particles and walls - int maxbig; // max number of owned/ghost big particles and walls - int nmax; // max number of SRD particles + int nbig; // # of owned/ghost big particles and walls + int maxbig; // max number of owned/ghost big particles and walls + int nmax; // max number of SRD particles // bins for SRD velocity remap, shifting and communication // binsize and inv are in lamda units for triclinic - int nbins1,nbin1x,nbin1y,nbin1z; - double binsize1x,binsize1y,binsize1z; - double bininv1x,bininv1y,bininv1z; + int nbins1, nbin1x, nbin1y, nbin1z; + double binsize1x, binsize1y, binsize1z; + double bininv1x, bininv1y, bininv1z; struct BinAve { int owner; // 1 if I am owner of this bin, 0 if not @@ -135,50 +135,50 @@ class FixSRD : public Fix { }; struct BinComm { - int nsend,nrecv; // # of bins to send/recv - int sendproc,recvproc; // who to send/recv to/from - int *sendlist,*recvlist; // list of bins to send/recv + int nsend, nrecv; // # of bins to send/recv + int sendproc, recvproc; // who to send/recv to/from + int *sendlist, *recvlist; // list of bins to send/recv }; struct BinShift { - int commflag; // 1 if this shift requires any comm - int nbins,nbinx,nbiny,nbinz; // extent of my bins - int maxbinsq,maxvbin; - int binlo[3],binhi[3]; // extent of my bins in global array - double corner[3]; // lower,left corner to offset from - // corner is in lamda units for triclinic - BinAve *vbin; // my bins - BinComm bcomm[6]; // bin communication pattern for overlaps + int commflag; // 1 if this shift requires any comm + int nbins, nbinx, nbiny, nbinz; // extent of my bins + int maxbinsq, maxvbin; + int binlo[3], binhi[3]; // extent of my bins in global array + double corner[3]; // lower,left corner to offset from + // corner is in lamda units for triclinic + BinAve *vbin; // my bins + BinComm bcomm[6]; // bin communication pattern for overlaps }; - BinShift shifts[2]; // 0 = no shift, 1 = shift + BinShift shifts[2]; // 0 = no shift, 1 = shift int maxbin1; - int *binhead; // 1st SRD particle in each bin - int *binnext; // next SRD particle in same bin + int *binhead; // 1st SRD particle in each bin + int *binnext; // next SRD particle in same bin int maxbuf; - double *sbuf1,*sbuf2; // buffers for send/recv of velocity bin data - double *rbuf1,*rbuf2; + double *sbuf1, *sbuf2; // buffers for send/recv of velocity bin data + double *rbuf1, *rbuf2; // bins and stencil for collision searching for SRDs & big particles - int nbins2,nbin2x,nbin2y,nbin2z; + int nbins2, nbin2x, nbin2y, nbin2z; int maxbin2; - double binsize2x,binsize2y,binsize2z; - double bininv2x,bininv2y,bininv2z; - double xblo2,yblo2,zblo2; + double binsize2x, binsize2y, binsize2z; + double bininv2x, bininv2y, bininv2z; + double xblo2, yblo2, zblo2; - int *nbinbig; // # of big particles overlapping each bin - int **binbig; // indices of big particles overlapping each bin - int *binsrd; // which bin each SRD particle is in - int nstencil; // # of bins in stencil - int maxstencil; // max # of bins stencil array can hold - int **stencil; // list of 3d bin offsets a big particle can overlap + int *nbinbig; // # of big particles overlapping each bin + int **binbig; // indices of big particles overlapping each bin + int *binsrd; // which bin each SRD particle is in + int nstencil; // # of bins in stencil + int maxstencil; // max # of bins stencil array can hold + int **stencil; // list of 3d bin offsets a big particle can overlap // persistent data for line/tri collision calculations - double tfraction,theta0,theta1; - double xs0[3],xs1[3],xsc[3]; - double xb0[3],xb1[3],xbc[3]; + double tfraction, theta0, theta1; + double xs0[3], xs1[3], xsc[3]; + double xb0[3], xb1[3], xbc[3]; double nbc[3]; // shared data for triangle collision calculations @@ -203,30 +203,24 @@ class FixSRD : public Fix { int inside_tri(double *, double *, double *, double *, Big *, double); int inside_wall(double *, int); - double collision_sphere_exact(double *, double *, double *, double *, - Big *, double *, double *, double *); - void collision_sphere_inexact(double *, double *, - Big *, double *, double *, double *); - double collision_ellipsoid_exact(double *, double *, double *, double *, - Big *, double *, double *, double *); - void collision_ellipsoid_inexact(double *, double *, - Big *, double *, double *, double *); - double collision_line_exact(double *, double *, double *, double *, - Big *, double, double *, double *, double *); - double collision_tri_exact(double *, double *, double *, double *, - Big *, double, double *, double *, double *); - double collision_wall_exact(double *, int, double *, - double *, double *, double *); + double collision_sphere_exact(double *, double *, double *, double *, Big *, double *, double *, + double *); + void collision_sphere_inexact(double *, double *, Big *, double *, double *, double *); + double collision_ellipsoid_exact(double *, double *, double *, double *, Big *, double *, + double *, double *); + void collision_ellipsoid_inexact(double *, double *, Big *, double *, double *, double *); + double collision_line_exact(double *, double *, double *, double *, Big *, double, double *, + double *, double *); + double collision_tri_exact(double *, double *, double *, double *, Big *, double, double *, + double *, double *); + double collision_wall_exact(double *, int, double *, double *, double *, double *); void collision_wall_inexact(double *, int, double *, double *, double *); - void slip(double *, double *, double *, Big *, - double *, double *, double *); + void slip(double *, double *, double *, Big *, double *, double *, double *); void slip_wall(double *, int, double *, double *); - void noslip(double *, double *, double *, Big *, int, - double *, double *, double *); + void noslip(double *, double *, double *, Big *, int, double *, double *, double *); - void force_torque(double *, double *, double *, - double *, double *, double *); + void force_torque(double *, double *, double *, double *, double *, double *); void force_wall(double *, double *, int); int update_srd(int, double, double *, double *, double *, double *); @@ -249,11 +243,10 @@ class FixSRD : public Fix { void triside(double, double &, double &); double distance(int, int); - void print_collision(int, int, int, double, double, - double *, double *, double *, int); + void print_collision(int, int, int, double, double, double *, double *, double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/SRD/fix_wall_srd.h b/src/SRD/fix_wall_srd.h index 8aa2cf925d..9cd439048f 100644 --- a/src/SRD/fix_wall_srd.h +++ b/src/SRD/fix_wall_srd.h @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class FixWallSRD : public Fix { public: - int nwall,varflag,overlap; + int nwall, varflag, overlap; int wallwhich[6]; - double xwall[6],xwallhold[6],vwall[6]; + double xwall[6], xwallhold[6], vwall[6]; double **fwall; FixWallSRD(class LAMMPS *, int, char **); @@ -53,7 +53,7 @@ class FixWallSRD : public Fix { int force_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/STUBS/mpi.cpp b/src/STUBS/mpi.cpp index 94f6197e4b..4262d2ec16 100644 --- a/src/STUBS/mpi.cpp +++ b/src/STUBS/mpi.cpp @@ -232,8 +232,7 @@ int MPI_Request_free(MPI_Request *request) /* ---------------------------------------------------------------------- */ -int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm) +int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { static int callcount = 0; if (callcount == 0) { @@ -245,8 +244,8 @@ int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, /* ---------------------------------------------------------------------- */ -int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, - int tag, MPI_Comm comm, MPI_Request *request) +int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request) { static int callcount = 0; if (callcount == 0) { @@ -258,8 +257,7 @@ int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, /* ---------------------------------------------------------------------- */ -int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm) +int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm) { static int callcount = 0; if (callcount == 0) { @@ -271,8 +269,8 @@ int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, /* ---------------------------------------------------------------------- */ -int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, - MPI_Comm comm, MPI_Status *status) +int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Status *status) { static int callcount = 0; if (callcount == 0) { @@ -284,8 +282,8 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, /* ---------------------------------------------------------------------- */ -int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, - MPI_Comm comm, MPI_Request *request) +int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request) { static int callcount = 0; if (callcount == 0) { @@ -333,9 +331,9 @@ int MPI_Waitany(int count, MPI_Request *request, int *index, MPI_Status *status) /* ---------------------------------------------------------------------- */ -int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int dest, - int stag, void *rbuf, int rcount, MPI_Datatype rdatatype, - int source, int rtag, MPI_Comm comm, MPI_Status *status) +int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int dest, int stag, + void *rbuf, int rcount, MPI_Datatype rdatatype, int source, int rtag, + MPI_Comm comm, MPI_Status *status) { static int callcount = 0; if (callcount == 0) { @@ -422,8 +420,8 @@ int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup) } /* ---------------------------------------------------------------------- */ -int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, - int reorder, MPI_Comm *comm_cart) +int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, int reorder, + MPI_Comm *comm_cart) { *comm_cart = comm_old; return 0; @@ -431,8 +429,7 @@ int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, /* ---------------------------------------------------------------------- */ -int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, - int *coords) +int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords) { dims[0] = dims[1] = dims[2] = 1; periods[0] = periods[1] = periods[2] = 1; @@ -442,8 +439,7 @@ int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, /* ---------------------------------------------------------------------- */ -int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, int *source, - int *dest) +int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, int *source, int *dest) { *source = *dest = 0; return 0; @@ -525,8 +521,7 @@ int MPI_Barrier(MPI_Comm comm) /* ---------------------------------------------------------------------- */ -int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, - MPI_Comm comm) +int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm) { return 0; } @@ -535,51 +530,10 @@ int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, /* copy values from data1 to data2 */ -int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) -{ - int n = count * stubtypesize(datatype); - - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf, sendbuf, n); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -/* copy values from data1 to data2 */ - -int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, int root, MPI_Comm comm) -{ - int n = count * stubtypesize(datatype); - - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf, sendbuf, n); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, MPI_Comm comm) -{ - int n = count * stubtypesize(datatype); - - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf, sendbuf, n); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -/* copy values from data1 to data2 */ - -int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, +int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { - int n = sendcount * stubtypesize(sendtype); + int n = count * stubtypesize(datatype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; memcpy(recvbuf, sendbuf, n); @@ -590,9 +544,34 @@ int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, - MPI_Datatype recvtype, MPI_Comm comm) +int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, + MPI_Comm comm) +{ + int n = count * stubtypesize(datatype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + MPI_Comm comm) +{ + int n = count * stubtypesize(datatype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/* copy values from data1 to data2 */ + +int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm) { int n = sendcount * stubtypesize(sendtype); @@ -605,8 +584,22 @@ int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, + int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm) +{ + int n = sendcount * stubtypesize(sendtype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/* copy values from data1 to data2 */ + +int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm) { int n = *recvcounts * stubtypesize(datatype); @@ -619,9 +612,8 @@ int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, /* copy values from data1 to data2 */ -int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, - MPI_Comm comm) +int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int root, MPI_Comm comm) { int n = sendcount * stubtypesize(sendtype); @@ -634,11 +626,24 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, +int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, + int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm) +{ + int n = sendcount * stubtypesize(sendtype); + + if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; + memcpy(recvbuf, sendbuf, n); + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/* copy values from data1 to data2 */ + +int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { - int n = sendcount * stubtypesize(sendtype); + int n = recvcount * stubtypesize(recvtype); if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; memcpy(recvbuf, sendbuf, n); @@ -649,9 +654,8 @@ int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, - MPI_Comm comm) +int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, + int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { int n = recvcount * stubtypesize(recvtype); @@ -664,24 +668,8 @@ int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, - MPI_Datatype sendtype, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int root, MPI_Comm comm) -{ - int n = recvcount * stubtypesize(recvtype); - - if (sendbuf == MPI_IN_PLACE || recvbuf == MPI_IN_PLACE) return 0; - memcpy(recvbuf, sendbuf, n); - return 0; -} - -/* ---------------------------------------------------------------------- */ - -/* copy values from data1 to data2 */ - -int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm) +int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm) { int n = sendcount * stubtypesize(sendtype); @@ -694,9 +682,9 @@ int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, /* copy values from data1 to data2 */ -int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, - MPI_Datatype sendtype, void *recvbuf, int *recvcounts, - int *rdispls, MPI_Datatype recvtype, MPI_Comm comm) +int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, + MPI_Comm comm) { int n = *sendcounts * stubtypesize(sendtype); diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h index 5697d64b88..a39dadd484 100644 --- a/src/STUBS/mpi.h +++ b/src/STUBS/mpi.h @@ -69,8 +69,7 @@ #define MPI_MAX_PROCESSOR_NAME 128 #define MPI_MAX_LIBRARY_VERSION_STRING 128 -typedef void MPI_User_function(void *invec, void *inoutvec, int *len, - MPI_Datatype *datatype); +typedef void MPI_User_function(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype); /* MPI data structs */ @@ -97,23 +96,20 @@ double MPI_Wtime(); int MPI_Type_size(int, int *); int MPI_Request_free(MPI_Request *request); -int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm); -int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, - int tag, MPI_Comm comm, MPI_Request *request); -int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, - int tag, MPI_Comm comm); -int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, - MPI_Comm comm, MPI_Status *status); -int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, - MPI_Comm comm, MPI_Request *request); +int MPI_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +int MPI_Isend(const void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request); +int MPI_Rsend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); +int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Status *status); +int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, + MPI_Request *request); int MPI_Wait(MPI_Request *request, MPI_Status *status); int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status); -int MPI_Waitany(int count, MPI_Request *request, int *index, - MPI_Status *status); -int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int dest, - int stag, void *rbuf, int rcount, MPI_Datatype rdatatype, - int source, int rtag, MPI_Comm comm, MPI_Status *status); +int MPI_Waitany(int count, MPI_Request *request, int *index, MPI_Status *status); +int MPI_Sendrecv(const void *sbuf, int scount, MPI_Datatype sdatatype, int dest, int stag, + void *rbuf, int rcount, MPI_Datatype rdatatype, int source, int rtag, + MPI_Comm comm, MPI_Status *status); int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count); int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out); @@ -125,12 +121,10 @@ int MPI_Comm_group(MPI_Comm comm, MPI_Group *group); int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm); int MPI_Group_incl(MPI_Group group, int n, int *ranks, MPI_Group *newgroup); -int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, - int reorder, MPI_Comm *comm_cart); -int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, - int *coords); -int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, int *source, - int *dest); +int MPI_Cart_create(MPI_Comm comm_old, int ndims, int *dims, int *periods, int reorder, + MPI_Comm *comm_cart); +int MPI_Cart_get(MPI_Comm comm, int maxdims, int *dims, int *periods, int *coords); +int MPI_Cart_shift(MPI_Comm comm, int direction, int displ, int *source, int *dest); int MPI_Cart_rank(MPI_Comm comm, int *coords, int *rank); int MPI_Type_contiguous(int count, MPI_Datatype oldtype, MPI_Datatype *newtype); @@ -141,40 +135,32 @@ int MPI_Op_create(MPI_User_function *function, int commute, MPI_Op *op); int MPI_Op_free(MPI_Op *op); int MPI_Barrier(MPI_Comm comm); -int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, - MPI_Comm comm); -int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, int root, MPI_Comm comm); -int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, - MPI_Op op, MPI_Comm comm); -int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, +int MPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm); +int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, - MPI_Datatype recvtype, MPI_Comm comm); -int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, - MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, +int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); -int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, +int MPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + MPI_Comm comm); +int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm); +int MPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, + int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm); +int MPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, + MPI_Op op, MPI_Comm comm); +int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, + int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); -int MPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, - MPI_Comm comm); -int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, - MPI_Datatype sendtype, void *recvbuf, int recvcount, - MPI_Datatype recvtype, int root, MPI_Comm comm); -int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int recvcount, MPI_Datatype recvtype, - MPI_Comm comm); -int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, - MPI_Datatype sendtype, void *recvbuf, int *recvcounts, - int *rdispls, MPI_Datatype recvtype, MPI_Comm comm); +int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, + int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); +int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, + MPI_Datatype recvtype, MPI_Comm comm); +int MPI_Alltoallv(void *sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, + void *recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, + MPI_Comm comm); /* ---------------------------------------------------------------------- */ #endif diff --git a/src/USER-ADIOS/dump_atom_adios.h b/src/USER-ADIOS/dump_atom_adios.h index d50f116d37..67fdbe942c 100644 --- a/src/USER-ADIOS/dump_atom_adios.h +++ b/src/USER-ADIOS/dump_atom_adios.h @@ -22,32 +22,30 @@ DumpStyle(atom/adios, DumpAtomADIOS); #include "dump_atom.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { class DumpAtomADIOSInternal; -class DumpAtomADIOS : public DumpAtom -{ +class DumpAtomADIOS : public DumpAtom { -public: - DumpAtomADIOS(class LAMMPS *, int, char **); - virtual ~DumpAtomADIOS(); + public: + DumpAtomADIOS(class LAMMPS *, int, char **); + virtual ~DumpAtomADIOS(); -protected: - virtual void openfile(); - virtual void write(); - virtual void init_style(); + protected: + virtual void openfile(); + virtual void write(); + virtual void init_style(); -private: - DumpAtomADIOSInternal *internal; + private: + DumpAtomADIOSInternal *internal; }; -} +} // namespace LAMMPS_NS #endif #endif - /* ERROR/WARNING messages: +/* ERROR/WARNING messages: E: Cannot open dump file %s diff --git a/src/USER-ADIOS/dump_custom_adios.h b/src/USER-ADIOS/dump_custom_adios.h index 0693db234e..ddab775b64 100644 --- a/src/USER-ADIOS/dump_custom_adios.h +++ b/src/USER-ADIOS/dump_custom_adios.h @@ -22,31 +22,29 @@ DumpStyle(custom/adios, DumpCustomADIOS); #include "dump_custom.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { class DumpCustomADIOSInternal; -class DumpCustomADIOS : public DumpCustom -{ -public: - DumpCustomADIOS(class LAMMPS *, int, char **); - virtual ~DumpCustomADIOS(); +class DumpCustomADIOS : public DumpCustom { + public: + DumpCustomADIOS(class LAMMPS *, int, char **); + virtual ~DumpCustomADIOS(); -protected: - virtual void openfile(); - virtual void write(); - virtual void init_style(); + protected: + virtual void openfile(); + virtual void write(); + virtual void init_style(); -private: - DumpCustomADIOSInternal *internal; + private: + DumpCustomADIOSInternal *internal; }; -} +} // namespace LAMMPS_NS #endif #endif - /* ERROR/WARNING messages: +/* ERROR/WARNING messages: E: Cannot open dump file %s diff --git a/src/USER-ADIOS/reader_adios.h b/src/USER-ADIOS/reader_adios.h index a018bcefce..0e7d08048e 100644 --- a/src/USER-ADIOS/reader_adios.h +++ b/src/USER-ADIOS/reader_adios.h @@ -28,45 +28,42 @@ ReaderStyle(adios, ReaderADIOS); #include #include -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { class ReadADIOSInternal; -class ReaderADIOS : public Reader -{ -public: - ReaderADIOS(class LAMMPS *); - virtual ~ReaderADIOS(); +class ReaderADIOS : public Reader { + public: + ReaderADIOS(class LAMMPS *); + virtual ~ReaderADIOS(); - virtual void settings(int, char **); + virtual void settings(int, char **); - virtual int read_time(bigint &); - virtual void skip(); - virtual bigint read_header(double[3][3], int &, int &, int, int, int *, - char **, int, int, int &, int &, int &, int &); - virtual void read_atoms(int, int, double **); + virtual int read_time(bigint &); + virtual void skip(); + virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &); + virtual void read_atoms(int, int, double **); - virtual void open_file(const char *); - virtual void close_file(); + virtual void open_file(const char *); + virtual void close_file(); -private: - int *fieldindex; // mapping of input fields to dump - uint64_t nAtomsTotal; // current number of atoms in entire dump step - uint64_t nAtoms; // current number of atoms for this process - // (Sum(nAtoms)=nAtomsTotal) - uint64_t atomOffset; // starting atom position for this process to read + private: + int *fieldindex; // mapping of input fields to dump + uint64_t nAtomsTotal; // current number of atoms in entire dump step + uint64_t nAtoms; // current number of atoms for this process + // (Sum(nAtoms)=nAtomsTotal) + uint64_t atomOffset; // starting atom position for this process to read - bigint nstep; // current (time) step number - bigint nid; // current atom id. + bigint nstep; // current (time) step number + bigint nid; // current atom id. - int me; - ReadADIOSInternal *internal; + int me; + ReadADIOSInternal *internal; - int find_label(const std::string &label, - const std::map &labels); + int find_label(const std::string &label, const std::map &labels); }; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-ATC/fix_atc.h b/src/USER-ATC/fix_atc.h index 329fec28cf..c24dd43311 100644 --- a/src/USER-ATC/fix_atc.h +++ b/src/USER-ATC/fix_atc.h @@ -23,120 +23,120 @@ FixStyle(atc,FixATC); #include "fix.h" namespace ATC { - class ATC_Method; +class ATC_Method; } namespace LAMMPS_NS { - class NeighList; +class NeighList; - /** +/** * @class FixATC * @brief Class for an atom-to-continuum (ATC) LAMMPS fix. */ - class FixATC : public Fix { - public: - /** constructor & destructor */ - FixATC(class LAMMPS *, int, char **); - ~FixATC(); +class FixATC : public Fix { + public: + /** constructor & destructor */ + FixATC(class LAMMPS *, int, char **); + ~FixATC(); - /** initialization functions */ - void init(); - void init_list(int id, NeighList *ptr) ; - void setup(int vflag); - void min_setup(int vflag); + /** initialization functions */ + void init(); + void init_list(int id, NeighList *ptr); + void setup(int vflag); + void min_setup(int vflag); - /** setmask: tell LAMMPS which fix methods to call */ - int setmask(); + /** setmask: tell LAMMPS which fix methods to call */ + int setmask(); - /** initial_integrate */ - void initial_integrate(int vflag); + /** initial_integrate */ + void initial_integrate(int vflag); - /** after first integrate phase */ - void post_integrate(); + /** after first integrate phase */ + void post_integrate(); - /** final_integrate */ - void final_integrate(); + /** final_integrate */ + void final_integrate(); - /** end of step for run or minimize */ - void end_of_step(); + /** end of step for run or minimize */ + void end_of_step(); - /** pre_exchange is used to modify fix-specific data + /** pre_exchange is used to modify fix-specific data and is called before domain->pbc() and comm->exchange(). */ - void setup_pre_exchange(); - void pre_exchange(); - void min_pre_exchange(); + void setup_pre_exchange(); + void pre_exchange(); + void min_pre_exchange(); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); + double memory_usage(); + void grow_arrays(int); + void copy_arrays(int, int, int); - /** pack_exchange called from atom_vec->pack_exchange() + /** pack_exchange called from atom_vec->pack_exchange() and packs fix-specific data for a given real (local) atom being sent to another processor. */ - int pack_exchange(int, double *); + int pack_exchange(int, double *); - /** unpack_exchange called from atom_vec->unpack_exchange() + /** unpack_exchange called from atom_vec->unpack_exchange() and unpacks fix-specific data for a given real (local) atom received from another processor. */ - int unpack_exchange(int, double *); + int unpack_exchange(int, double *); - /** pack_comm called from comm->forward_comm_fix and + /** pack_comm called from comm->forward_comm_fix and packs fix-specific data for a given ghost atom from exchange with another proc */ - int pack_forward_comm(int , int *, double *, int, int *); + int pack_forward_comm(int, int *, double *, int, int *); - /** unpack_comm called from comm->forward_comm_fix and + /** unpack_comm called from comm->forward_comm_fix and unpacks fix-specific data for a given ghost atom from exchange with another proc */ - void unpack_forward_comm(int, int, double *); + void unpack_forward_comm(int, int, double *); - /** pre_neighbor is used to modify fix-specific data + /** pre_neighbor is used to modify fix-specific data and is called before neighbor list is built in neighbor->build(). */ - void pre_neighbor(); - void setup_pre_neighbor(); + void pre_neighbor(); + void setup_pre_neighbor(); - /** pre/post_force is used to modify fix-specific data + /** pre/post_force is used to modify fix-specific data and is before/after the various force computations. */ - void pre_force(int vflag); - void post_force(int vflag); + void pre_force(int vflag); + void post_force(int vflag); - /** post_run is called after a run completes */ - void post_run(); + /** post_run is called after a run completes */ + void post_run(); - /** min_pre_force is called before forces are calculated in minimize */ - void min_pre_force(int vflag); + /** min_pre_force is called before forces are calculated in minimize */ + void min_pre_force(int vflag); - /** min_post_force is called after forces are calculated in minimize */ - void min_post_force(int vflag); + /** min_post_force is called after forces are calculated in minimize */ + void min_post_force(int vflag); - /** modify atc parameters (parser) */ - int modify_param(int narg, char** arg); + /** modify atc parameters (parser) */ + int modify_param(int narg, char **arg); - /** calls ATC_Method to handle restarting/checkpointing */ - /** these four methods are for writing per-atom quantities */ - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); - /** these two methods are for writing all other quantities */ - void write_restart(FILE *); - void restart(char *); + /** calls ATC_Method to handle restarting/checkpointing */ + /** these four methods are for writing per-atom quantities */ + int pack_restart(int, double *); + void unpack_restart(int, int); + int size_restart(int); + int maxsize_restart(); + /** these two methods are for writing all other quantities */ + void write_restart(FILE *); + void restart(char *); - /** accessor function for ATC_Method class pointer */ - const ATC::ATC_Method* atc() { return atc_; } + /** accessor function for ATC_Method class pointer */ + const ATC::ATC_Method *atc() { return atc_; } - protected: - LAMMPS * lammps_; + protected: + LAMMPS *lammps_; - /** functions for "thermo" output */ - virtual double compute_scalar() ; - virtual double compute_vector(int n) ; - virtual double compute_array(int irow, int icol) ; - double dtv,dtf; - ATC::ATC_Method *atc_; - }; -} + /** functions for "thermo" output */ + virtual double compute_scalar(); + virtual double compute_vector(int n); + virtual double compute_array(int irow, int icol); + double dtv, dtf; + ATC::ATC_Method *atc_; +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-AWPMD/atom_vec_wavepacket.h b/src/USER-AWPMD/atom_vec_wavepacket.h index edc97f2d6b..d79d0db011 100644 --- a/src/USER-AWPMD/atom_vec_wavepacket.h +++ b/src/USER-AWPMD/atom_vec_wavepacket.h @@ -25,7 +25,7 @@ AtomStyle(wavepacket,AtomVecWavepacket); namespace LAMMPS_NS { class AtomVecWavepacket : public AtomVec { -public: + public: AtomVecWavepacket(class LAMMPS *); void grow_pointers(); @@ -37,10 +37,10 @@ public: private: int *spin; - double *q,*eradius,*ervel,*erforce; + double *q, *eradius, *ervel, *erforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-AWPMD/fix_nve_awpmd.h b/src/USER-AWPMD/fix_nve_awpmd.h index 5824d52ba1..64a16b4a8e 100644 --- a/src/USER-AWPMD/fix_nve_awpmd.h +++ b/src/USER-AWPMD/fix_nve_awpmd.h @@ -40,14 +40,14 @@ class FixNVEAwpmd : public Fix { void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; class PairAWPMDCut *awpmd_pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-AWPMD/pair_awpmd_cut.h b/src/USER-AWPMD/pair_awpmd_cut.h index 3cb2f6a803..9ab5004658 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.h +++ b/src/USER-AWPMD/pair_awpmd_cut.h @@ -14,7 +14,6 @@ Contributing author: Ilya Valuev (JIHT RAS) ------------------------------------------------------------------------- */ - #ifdef PAIR_CLASS // clang-format off PairStyle(awpmd/cut,PairAWPMDCut); @@ -26,14 +25,13 @@ PairStyle(awpmd/cut,PairAWPMDCut); #include "pair.h" - class AWPMD_split; - namespace LAMMPS_NS { class PairAWPMDCut : public Pair { friend class FixNVEAwpmd; + public: PairAWPMDCut(class LAMMPS *); virtual ~PairAWPMDCut(); @@ -54,28 +52,24 @@ class PairAWPMDCut : public Pair { double memory_usage(); private: - - int flexible_pressure_flag; double cut_global; double **cut; - - int nmax; // number of additional variables for minimizer - double *min_var,*min_varforce; // additional variables for minimizer + int nmax; // number of additional variables for minimizer + double *min_var, *min_varforce; // additional variables for minimizer void allocate(); void virial_eradius_compute(); - - AWPMD_split *wpmd; // solver object - double ermscale; // scale of width mass for motion - double width_pbc; // setting for width pbc - double half_box_length; // calculated by coeff function + AWPMD_split *wpmd; // solver object + double ermscale; // scale of width mass for motion + double width_pbc; // setting for width pbc + double half_box_length; // calculated by coeff function }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BOCS/compute_pressure_bocs.h b/src/USER-BOCS/compute_pressure_bocs.h index 961eab52d5..deebb6d6e9 100644 --- a/src/USER-BOCS/compute_pressure_bocs.h +++ b/src/USER-BOCS/compute_pressure_bocs.h @@ -20,22 +20,21 @@ ComputeStyle(PRESSURE/BOCS,ComputePressureBocs); // clang-format on #else - #ifndef LMP_COMPUTE_PRESSURE_BOCS_H #define LMP_COMPUTE_PRESSURE_BOCS_H #include "compute.h" namespace LAMMPS_NS { - // Enumerate the p_basis_type magic values to improve readability: - enum{BASIS_ANALYTIC, BASIS_LINEAR_SPLINE, BASIS_CUBIC_SPLINE}; - // Enumerate the data file column names to improve readability - enum{VOLUME, PRESSURE_CORRECTION}; - // Declare names for the number of columns in the splines data structure to improve readability - const int NUM_LINEAR_SPLINE_COLUMNS = 2; // linear spline columns passed to compute - const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to compute +// Enumerate the p_basis_type magic values to improve readability: +enum { BASIS_ANALYTIC, BASIS_LINEAR_SPLINE, BASIS_CUBIC_SPLINE }; +// Enumerate the data file column names to improve readability +enum { VOLUME, PRESSURE_CORRECTION }; +// Declare names for the number of columns in the splines data structure to improve readability +const int NUM_LINEAR_SPLINE_COLUMNS = 2; // linear spline columns passed to compute +const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to compute - // ComputePressure -> ComputePressureBocs MRD NJD +// ComputePressure -> ComputePressureBocs MRD NJD class ComputePressureBocs : public Compute { public: ComputePressureBocs(class LAMMPS *, int, char **); @@ -48,36 +47,36 @@ class ComputePressureBocs : public Compute { double compute_cg_scalar(); double get_cg_p_corr(int, double *, int, double, double); double get_cg_fluct(double, double); - void send_cg_info(int, int, double*, int, double); + void send_cg_info(int, int, double *, int, double); void send_cg_info(int, double **, int); double get_cg_p_corr(double **, int, double); - double find_index(double* , double); + double find_index(double *, double); protected: - double boltz,nktv2p,inv_volume; - int nvirial,dimension; + double boltz, nktv2p, inv_volume; + int nvirial, dimension; double **vptr; double *kspace_virial; Compute *temperature; char *id_temp; double virial[6]; - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int fixflag,kspaceflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int fixflag, kspaceflag; -// NJD MRD + // NJD MRD int p_basis_type; int p_match_flag; double vavg; int N_mol; int N_basis; double *phi_coeff; - double ** splines; + double **splines; int spline_length; void virial_compute(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BOCS/fix_bocs.h b/src/USER-BOCS/fix_bocs.h index af9024617b..8d885652e9 100644 --- a/src/USER-BOCS/fix_bocs.h +++ b/src/USER-BOCS/fix_bocs.h @@ -14,7 +14,6 @@ from The Pennsylvania State University ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS // clang-format off FixStyle(bocs,FixBocs); @@ -30,8 +29,8 @@ namespace LAMMPS_NS { class FixBocs : public Fix { public: - FixBocs(class LAMMPS *, int, char **); // MRD NJD - virtual ~FixBocs(); // MRD NJD + FixBocs(class LAMMPS *, int, char **); // MRD NJD + virtual ~FixBocs(); // MRD NJD int setmask(); virtual void init(); virtual void setup(int); @@ -43,106 +42,104 @@ class FixBocs : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); void reset_dt(); - virtual void *extract(const char*,int &); + virtual void *extract(const char *, int &); double memory_usage(); - protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target,ke_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target, ke_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple,allremap; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple, allremap; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - double drag,tdrag_factor; // drag factor on particle thermostat - double pdrag_factor; // drag factor on barostat - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int dilate_group_bit; // mask for dilation group - int *rfix; // indices of rigid fixes - char *id_dilate; // group name to dilate - class Irregular *irregular; // for migrating atoms after box flips + double drag, tdrag_factor; // drag factor on particle thermostat + double pdrag_factor; // drag factor on barostat + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int dilate_group_bit; // mask for dilation group + int *rfix; // indices of rigid fixes + char *id_dilate; // group name to dilate + class Irregular *irregular; // for migrating atoms after box flips -// MRD NJD + // MRD NJD int p_basis_type; int p_match_flag; double vavg; int N_mol; int N_p_match; double *p_match_coeffs; - double ** splines; + double **splines; int spline_length; - int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally - double *eta,*eta_dot; // chain thermostat for particles + double *eta, *eta_dot; // chain thermostat for particles double *eta_dotdot; double *eta_mass; - int mtchain; // length of chain - int mtchain_default_flag; // 1 = mtchain is default + int mtchain; // length of chain + int mtchain_default_flag; // 1 = mtchain is default - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mpchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; + int nc_tchain, nc_pchain; double factor_eta; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int eta_mass_flag; // 1 if eta_mass updated, 0 if not. - int omega_mass_flag; // 1 if omega_mass updated, 0 if not. - int etap_mass_flag; // 1 if etap_mass updated, 0 if not. - int dipole_flag; // 1 if dipole is updated, 0 if not. - int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not + int eta_mass_flag; // 1 if eta_mass updated, 0 if not. + int omega_mass_flag; // 1 if omega_mass updated, 0 if not. + int etap_mass_flag; // 1 if etap_mass updated, 0 if not. + int dipole_flag; // 1 if dipole is updated, 0 if not. + int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); @@ -153,7 +150,7 @@ class FixBocs : public Fix { int build_linear_splines(double **); int build_cubic_splines(double **); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -167,7 +164,7 @@ class FixBocs : public Fix { void nh_omega_dot(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-BROWNIAN/fix_brownian.h b/src/USER-BROWNIAN/fix_brownian.h index 97705f4f48..7c0d8bb3ff 100644 --- a/src/USER-BROWNIAN/fix_brownian.h +++ b/src/USER-BROWNIAN/fix_brownian.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class FixBrownian : public FixBrownianBase { public: FixBrownian(class LAMMPS *, int, char **); - virtual ~FixBrownian() {}; + virtual ~FixBrownian(){}; void init(); void initial_integrate(int); private: - template - void initial_integrate_templated(); + template void initial_integrate_templated(); }; } // namespace LAMMPS_NS diff --git a/src/USER-BROWNIAN/fix_brownian_asphere.h b/src/USER-BROWNIAN/fix_brownian_asphere.h index 23a88ddaba..6558ad9f69 100644 --- a/src/USER-BROWNIAN/fix_brownian_asphere.h +++ b/src/USER-BROWNIAN/fix_brownian_asphere.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class FixBrownianAsphere : public FixBrownianBase { public: FixBrownianAsphere(class LAMMPS *, int, char **); - virtual ~FixBrownianAsphere() {}; + virtual ~FixBrownianAsphere(){}; void initial_integrate(int); void init(); diff --git a/src/USER-BROWNIAN/fix_brownian_sphere.h b/src/USER-BROWNIAN/fix_brownian_sphere.h index 19e86204ad..91a58b1532 100644 --- a/src/USER-BROWNIAN/fix_brownian_sphere.h +++ b/src/USER-BROWNIAN/fix_brownian_sphere.h @@ -27,13 +27,12 @@ namespace LAMMPS_NS { class FixBrownianSphere : public FixBrownianBase { public: FixBrownianSphere(class LAMMPS *, int, char **); - virtual ~FixBrownianSphere() {}; + virtual ~FixBrownianSphere(){}; void init(); void initial_integrate(int); private: - template - void initial_integrate_templated(); + template void initial_integrate_templated(); double g3, g4; }; } // namespace LAMMPS_NS diff --git a/src/USER-BROWNIAN/fix_propel_self.h b/src/USER-BROWNIAN/fix_propel_self.h index 9874635818..9a23c33ff0 100644 --- a/src/USER-BROWNIAN/fix_propel_self.h +++ b/src/USER-BROWNIAN/fix_propel_self.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixPropelSelf : public Fix { public: FixPropelSelf(class LAMMPS *, int, char **); - virtual ~FixPropelSelf() {}; + virtual ~FixPropelSelf(){}; void init(); void post_force(int); void setup(int); diff --git a/src/USER-CGDNA/bond_oxdna2_fene.h b/src/USER-CGDNA/bond_oxdna2_fene.h index da48b5d8bb..d8a34b0756 100644 --- a/src/USER-CGDNA/bond_oxdna2_fene.h +++ b/src/USER-CGDNA/bond_oxdna2_fene.h @@ -28,11 +28,10 @@ class BondOxdna2Fene : public BondOxdnaFene { public: BondOxdna2Fene(class LAMMPS *); virtual ~BondOxdna2Fene(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/bond_oxdna_fene.h b/src/USER-CGDNA/bond_oxdna_fene.h index 76513ddc45..b9145b34c8 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.h +++ b/src/USER-CGDNA/bond_oxdna_fene.h @@ -28,8 +28,7 @@ class BondOxdnaFene : public Bond { public: BondOxdnaFene(class LAMMPS *); virtual ~BondOxdnaFene(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); virtual void compute(int, int); void coeff(int, char **); void init_style(); @@ -40,13 +39,13 @@ class BondOxdnaFene : public Bond { double single(int, double, int, int, double &); protected: - double *k,*Delta,*r0; // FENE + double *k, *Delta, *r0; // FENE void allocate(); void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/bond_oxrna2_fene.h b/src/USER-CGDNA/bond_oxrna2_fene.h index a3f2c97854..349f0dee0a 100644 --- a/src/USER-CGDNA/bond_oxrna2_fene.h +++ b/src/USER-CGDNA/bond_oxrna2_fene.h @@ -28,11 +28,10 @@ class BondOxrna2Fene : public BondOxdnaFene { public: BondOxrna2Fene(class LAMMPS *); virtual ~BondOxrna2Fene(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/fix_nve_dot.h b/src/USER-CGDNA/fix_nve_dot.h index 6b7c4c9f06..080ed215c8 100644 --- a/src/USER-CGDNA/fix_nve_dot.h +++ b/src/USER-CGDNA/fix_nve_dot.h @@ -32,26 +32,26 @@ class FixNVEDot : public FixNVE { void final_integrate(); private: - double dt,dthlf,dthlfm; + double dt, dthlf, dthlfm; class AtomVecEllipsoid *avec; // conversion from 3-vector in space frame to 4-vector in body frame - inline void vec3_to_vec4(const double * q, const double * v3, double * v4) + inline void vec3_to_vec4(const double *q, const double *v3, double *v4) { - v4[0] = -q[1]*v3[0] - q[2]*v3[1] - q[3]*v3[2]; - v4[1] = q[0]*v3[0] + q[3]*v3[1] - q[2]*v3[2]; - v4[2] = -q[3]*v3[0] + q[0]*v3[1] + q[1]*v3[2]; - v4[3] = q[2]*v3[0] - q[1]*v3[1] + q[0]*v3[2]; + v4[0] = -q[1] * v3[0] - q[2] * v3[1] - q[3] * v3[2]; + v4[1] = q[0] * v3[0] + q[3] * v3[1] - q[2] * v3[2]; + v4[2] = -q[3] * v3[0] + q[0] * v3[1] + q[1] * v3[2]; + v4[3] = q[2] * v3[0] - q[1] * v3[1] + q[0] * v3[2]; } // conversion from 4-vector in body frame to 3-vector in space frame - inline void vec4_to_vec3(const double * q, const double * v4, double * v3) + inline void vec4_to_vec3(const double *q, const double *v4, double *v3) { - v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3]; - v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3]; - v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3]; + v3[0] = -q[1] * v4[0] + q[0] * v4[1] - q[3] * v4[2] + q[2] * v4[3]; + v3[1] = -q[2] * v4[0] + q[3] * v4[1] + q[0] * v4[2] - q[1] * v4[3]; + v3[2] = -q[3] * v4[0] - q[2] * v4[1] + q[1] * v4[2] + q[0] * v4[3]; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/fix_nve_dotc_langevin.h b/src/USER-CGDNA/fix_nve_dotc_langevin.h index 7355b1f944..7e1fc1c206 100644 --- a/src/USER-CGDNA/fix_nve_dotc_langevin.h +++ b/src/USER-CGDNA/fix_nve_dotc_langevin.h @@ -33,34 +33,35 @@ class FixNVEDotcLangevin : public FixNVE { void final_integrate(); private: - double dt,dthlf,dthlfm,dtqrt; + double dt, dthlf, dthlfm, dtqrt; // conversion from 3-vector in space frame to 4-vector in body frame - inline void vec3_to_vec4(const double * q, const double * v3, double * v4) + inline void vec3_to_vec4(const double *q, const double *v3, double *v4) { - v4[0] = -q[1]*v3[0] - q[2]*v3[1] - q[3]*v3[2]; - v4[1] = q[0]*v3[0] + q[3]*v3[1] - q[2]*v3[2]; - v4[2] = -q[3]*v3[0] + q[0]*v3[1] + q[1]*v3[2]; - v4[3] = q[2]*v3[0] - q[1]*v3[1] + q[0]*v3[2]; + v4[0] = -q[1] * v3[0] - q[2] * v3[1] - q[3] * v3[2]; + v4[1] = q[0] * v3[0] + q[3] * v3[1] - q[2] * v3[2]; + v4[2] = -q[3] * v3[0] + q[0] * v3[1] + q[1] * v3[2]; + v4[3] = q[2] * v3[0] - q[1] * v3[1] + q[0] * v3[2]; } // conversion from 4-vector in body frame to 3-vector in space frame - inline void vec4_to_vec3(const double * q, const double * v4, double * v3) + inline void vec4_to_vec3(const double *q, const double *v4, double *v3) { - v3[0] = -q[1]*v4[0] + q[0]*v4[1] - q[3]*v4[2] + q[2]*v4[3]; - v3[1] = -q[2]*v4[0] + q[3]*v4[1] + q[0]*v4[2] - q[1]*v4[3]; - v3[2] = -q[3]*v4[0] - q[2]*v4[1] + q[1]*v4[2] + q[0]*v4[3]; + v3[0] = -q[1] * v4[0] + q[0] * v4[1] - q[3] * v4[2] + q[2] * v4[3]; + v3[1] = -q[2] * v4[0] + q[3] * v4[1] + q[0] * v4[2] - q[1] * v4[3]; + v3[2] = -q[3] * v4[0] - q[2] * v4[1] + q[1] * v4[2] + q[0] * v4[3]; } + protected: int seed; class AtomVecEllipsoid *avec; - double t_start,t_stop,t_period,t_target,tsqrt; - double gamma,Gamma,ascale; - double M,gfactor1,gfactor2; - double gfactor3[3],gfactor4[3],gfactor5[3]; + double t_start, t_stop, t_period, t_target, tsqrt; + double gamma, Gamma, ascale; + double M, gfactor1, gfactor2; + double gfactor3[3], gfactor4[3], gfactor5[3]; class RanMars *random; void compute_target(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/mf_oxdna.h b/src/USER-CGDNA/mf_oxdna.h index 05bf5eae8f..0d502d0876 100644 --- a/src/USER-CGDNA/mf_oxdna.h +++ b/src/USER-CGDNA/mf_oxdna.h @@ -18,141 +18,118 @@ namespace MFOxdna { - inline double F1(double, double, double, double, double, double, double, double, double, double, double); - inline double DF1(double, double, double, double, double, double, double, double, double, double); - inline double F2(double, double, double, double, double, double, double, double, double, double); - inline double DF2(double, double, double, double, double, double, double, double, double); - inline double F3(double, double, double, double, double, double, double, double &); - inline double F4(double, double, double, double, double, double); - inline double DF4(double, double, double, double, double, double); - inline double F5(double, double, double, double, double); - inline double DF5(double, double, double, double, double); - inline double F6(double, double, double); - inline double DF6(double, double, double); - inline double is_3pto5p(const double *, const double *); +inline double F1(double, double, double, double, double, double, double, double, double, double, + double); +inline double DF1(double, double, double, double, double, double, double, double, double, double); +inline double F2(double, double, double, double, double, double, double, double, double, double); +inline double DF2(double, double, double, double, double, double, double, double, double); +inline double F3(double, double, double, double, double, double, double, double &); +inline double F4(double, double, double, double, double, double); +inline double DF4(double, double, double, double, double, double); +inline double F5(double, double, double, double, double); +inline double DF5(double, double, double, double, double); +inline double F6(double, double, double); +inline double DF6(double, double, double); +inline double is_3pto5p(const double *, const double *); -} +} // namespace MFOxdna /* ---------------------------------------------------------------------- f1 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F1(double r, double eps, double a, double cut_0, - double cut_lc, double cut_hc, double cut_lo, - double cut_hi, double b_lo, double b_hi, +inline double MFOxdna::F1(double r, double eps, double a, double cut_0, double cut_lc, + double cut_hc, double cut_lo, double cut_hi, double b_lo, double b_hi, double shift) { if (r > cut_hc) { return 0.0; - } - else if (r > cut_hi) { - return eps * b_hi * (r-cut_hc) * (r-cut_hc); - } - else if (r > cut_lo) { - double tmp = 1 - exp(-(r-cut_0) * a); + } else if (r > cut_hi) { + return eps * b_hi * (r - cut_hc) * (r - cut_hc); + } else if (r > cut_lo) { + double tmp = 1 - exp(-(r - cut_0) * a); return eps * tmp * tmp - shift; - } - else if (r > cut_lc) { - return eps * b_lo * (r-cut_lc) * (r-cut_lc); - } - else { + } else if (r > cut_lc) { + return eps * b_lo * (r - cut_lc) * (r - cut_lc); + } else { return 0.0; } - } /* ---------------------------------------------------------------------- derivative of f1 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::DF1(double r, double eps, double a, double cut_0, - double cut_lc, double cut_hc, double cut_lo, - double cut_hi, double b_lo, double b_hi) +inline double MFOxdna::DF1(double r, double eps, double a, double cut_0, double cut_lc, + double cut_hc, double cut_lo, double cut_hi, double b_lo, double b_hi) { if (r > cut_hc) { return 0.0; - } - else if (r > cut_hi) { + } else if (r > cut_hi) { return 2 * eps * b_hi * (1 - cut_hc / r); - } - else if (r > cut_lo) { - double tmp = exp(-(r-cut_0) * a); + } else if (r > cut_lo) { + double tmp = exp(-(r - cut_0) * a); return 2 * eps * (1 - tmp) * tmp * a / r; - } - else if (r > cut_lc) { + } else if (r > cut_lc) { return 2 * eps * b_lo * (1 - cut_lc / r); - } - else { + } else { return 0.0; } - } /* ---------------------------------------------------------------------- f2 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F2(double r, double k, double cut_0, double cut_lc, - double cut_hc, double cut_lo, double cut_hi, - double b_lo, double b_hi, double cut_c) +inline double MFOxdna::F2(double r, double k, double cut_0, double cut_lc, double cut_hc, + double cut_lo, double cut_hi, double b_lo, double b_hi, double cut_c) { if (r < cut_lc || r > cut_hc) { return 0; - } - else if (r < cut_lo) { - return k * b_lo * (cut_lc - r)*(cut_lc-r); - } - else if (r < cut_hi) { - return k * 0.5 * ((r - cut_0)*(r-cut_0) - (cut_0 - cut_c)*(cut_0 - cut_c)); - } - else{ + } else if (r < cut_lo) { + return k * b_lo * (cut_lc - r) * (cut_lc - r); + } else if (r < cut_hi) { + return k * 0.5 * ((r - cut_0) * (r - cut_0) - (cut_0 - cut_c) * (cut_0 - cut_c)); + } else { return k * b_hi * (cut_hc - r) * (cut_hc - r); } - } /* ---------------------------------------------------------------------- derivative of f2 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::DF2(double r, double k, double cut_0, double cut_lc, - double cut_hc, double cut_lo, double cut_hi, - double b_lo, double b_hi) +inline double MFOxdna::DF2(double r, double k, double cut_0, double cut_lc, double cut_hc, + double cut_lo, double cut_hi, double b_lo, double b_hi) { if (r < cut_lc || r > cut_hc) { return 0; - } - else if (r < cut_lo) { - return 2*k * b_lo * (r - cut_lc); - } - else if (r < cut_hi) { + } else if (r < cut_lo) { + return 2 * k * b_lo * (r - cut_lc); + } else if (r < cut_hi) { return k * (r - cut_0); + } else { + return 2 * k * b_hi * (r - cut_hc); } - else{ - return 2*k * b_hi * (r - cut_hc); - } - } /* ---------------------------------------------------------------------- f3 modulation factor, force and energy calculation ------------------------------------------------------------------------- */ -inline double MFOxdna::F3(double rsq, double cutsq_ast, double cut_c, - double lj1, double lj2, double eps, double b, - double & fpair) +inline double MFOxdna::F3(double rsq, double cutsq_ast, double cut_c, double lj1, double lj2, + double eps, double b, double &fpair) { double evdwl = 0.0; if (rsq < cutsq_ast) { - double r2inv = 1.0/rsq; - double r6inv = r2inv*r2inv*r2inv; - fpair = r2inv*r6inv*(12*lj1*r6inv - 6*lj2); - evdwl = r6inv*(lj1*r6inv-lj2); - } - else { + double r2inv = 1.0 / rsq; + double r6inv = r2inv * r2inv * r2inv; + fpair = r2inv * r6inv * (12 * lj1 * r6inv - 6 * lj2); + evdwl = r6inv * (lj1 * r6inv - lj2); + } else { double r = sqrt(rsq); - double rinv = 1.0/r; - fpair = 2*eps*b*(cut_c*rinv - 1); - evdwl = eps*b*(cut_c-r)*(cut_c-r); + double rinv = 1.0 / r; + fpair = 2 * eps * b * (cut_c * rinv - 1); + evdwl = eps * b * (cut_c - r) * (cut_c - r); } return evdwl; } @@ -160,24 +137,20 @@ inline double MFOxdna::F3(double rsq, double cutsq_ast, double cut_c, /* ---------------------------------------------------------------------- f4 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F4(double theta, double a, double theta_0, - double dtheta_ast, double b, double dtheta_c) +inline double MFOxdna::F4(double theta, double a, double theta_0, double dtheta_ast, double b, + double dtheta_c) { - double dtheta = theta-theta_0; + double dtheta = theta - theta_0; if (fabs(dtheta) > dtheta_c) { return 0.0; + } else if (dtheta > dtheta_ast) { + return b * (dtheta - dtheta_c) * (dtheta - dtheta_c); + } else if (dtheta > -dtheta_ast) { + return 1 - a * dtheta * dtheta; + } else { + return b * (dtheta + dtheta_c) * (dtheta + dtheta_c); } - else if (dtheta > dtheta_ast) { - return b * (dtheta-dtheta_c)*(dtheta-dtheta_c); - } - else if (dtheta > -dtheta_ast) { - return 1 - a * dtheta*dtheta; - } - else { - return b * (dtheta+dtheta_c)*(dtheta+dtheta_c); - } - } /* ---------------------------------------------------------------------- @@ -188,43 +161,35 @@ inline double MFOxdna::F4(double theta, double a, double theta_0, because the sign of DF4 depends on the sign of theta in the function call. It is also more efficient to store sin(theta). ------------------------------------------------------------------------- */ -inline double MFOxdna::DF4(double theta, double a, double theta_0, - double dtheta_ast, double b, double dtheta_c) +inline double MFOxdna::DF4(double theta, double a, double theta_0, double dtheta_ast, double b, + double dtheta_c) { - double dtheta = theta-theta_0; + double dtheta = theta - theta_0; if (fabs(dtheta) > dtheta_c) { return 0.0; + } else if (dtheta > dtheta_ast) { + return 2 * b * (dtheta - dtheta_c); + } else if (dtheta > -dtheta_ast) { + return -2 * a * dtheta; + } else { + return 2 * b * (dtheta + dtheta_c); } - else if (dtheta > dtheta_ast) { - return 2*b* (dtheta-dtheta_c); - } - else if (dtheta > -dtheta_ast) { - return -2*a * dtheta; - } - else { - return 2*b* (dtheta+dtheta_c); - } - } /* ---------------------------------------------------------------------- f5 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::F5(double x, double a, double x_ast, - double b, double x_c) +inline double MFOxdna::F5(double x, double a, double x_ast, double b, double x_c) { if (x >= 0) { return 1.0; - } - else if (x > x_ast) { + } else if (x > x_ast) { return 1 - a * x * x; - } - else if (x > x_c) { - return b * (x-x_c) * (x-x_c); - } - else { + } else if (x > x_c) { + return b * (x - x_c) * (x - x_c); + } else { return 0.0; } } @@ -232,19 +197,15 @@ inline double MFOxdna::F5(double x, double a, double x_ast, /* ---------------------------------------------------------------------- derivative of f5 modulation factor ------------------------------------------------------------------------- */ -inline double MFOxdna::DF5(double x, double a, double x_ast, - double b, double x_c) +inline double MFOxdna::DF5(double x, double a, double x_ast, double b, double x_c) { if (x >= 0) { return 0.0; - } - else if (x > x_ast) { + } else if (x > x_ast) { return -2 * a * x; - } - else if (x > x_c) { - return 2 * b * (x-x_c); - } - else { + } else if (x > x_c) { + return 2 * b * (x - x_c); + } else { return 0.0; } return 0; @@ -257,9 +218,8 @@ inline double MFOxdna::F6(double theta, double a, double b) { if (theta < b) { return 0.0; - } - else { - return 0.5 * a * (theta-b)*(theta-b); + } else { + return 0.5 * a * (theta - b) * (theta - b); } } @@ -270,9 +230,8 @@ inline double MFOxdna::DF6(double theta, double a, double b) { if (theta < b) { return 0.0; - } - else { - return a * (theta-b); + } else { + return a * (theta - b); } } @@ -280,8 +239,8 @@ inline double MFOxdna::DF6(double theta, double a, double b) test for directionality by projecting base normal n onto delr = a - b, returns 1 if nucleotide b to nucleotide a is 3' to 5', otherwise -1 ------------------------------------------------------------------------- */ -inline double MFOxdna::is_3pto5p(const double * delr, const double * n) +inline double MFOxdna::is_3pto5p(const double *delr, const double *n) { - return copysign(1.0,MathExtra::dot3(delr,n)); + return copysign(1.0, MathExtra::dot3(delr, n)); } #endif diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.h b/src/USER-CGDNA/pair_oxdna2_coaxstk.h index 22ff5907d2..0d53a10076 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.h +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.h @@ -64,7 +64,7 @@ class PairOxdna2Coaxstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna2_dh.h b/src/USER-CGDNA/pair_oxdna2_dh.h index c6097e7ed7..7fb6506453 100644 --- a/src/USER-CGDNA/pair_oxdna2_dh.h +++ b/src/USER-CGDNA/pair_oxdna2_dh.h @@ -28,8 +28,7 @@ class PairOxdna2Dh : public Pair { public: PairOxdna2Dh(class LAMMPS *); virtual ~PairOxdna2Dh(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); + virtual void compute_interaction_sites(double *, double *, double *, double *); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); @@ -44,15 +43,13 @@ class PairOxdna2Dh : public Pair { void *extract(const char *, int &); protected: - - double **qeff_dh_pf,**kappa_dh; - double **b_dh,**cut_dh_ast,**cutsq_dh_ast,**cut_dh_c,**cutsq_dh_c; + double **qeff_dh_pf, **kappa_dh; + double **b_dh, **cut_dh_ast, **cutsq_dh_ast, **cut_dh_c, **cutsq_dh_c; virtual void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna2_excv.h b/src/USER-CGDNA/pair_oxdna2_excv.h index f4da0abade..affc0072dd 100644 --- a/src/USER-CGDNA/pair_oxdna2_excv.h +++ b/src/USER-CGDNA/pair_oxdna2_excv.h @@ -28,11 +28,10 @@ class PairOxdna2Excv : public PairOxdnaExcv { public: PairOxdna2Excv(class LAMMPS *); virtual ~PairOxdna2Excv(); - virtual void compute_interaction_sites(double *, double *, - double *, double *, double *); + virtual void compute_interaction_sites(double *, double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_coaxstk.h b/src/USER-CGDNA/pair_oxdna_coaxstk.h index 49c2647e04..c98a61dc16 100644 --- a/src/USER-CGDNA/pair_oxdna_coaxstk.h +++ b/src/USER-CGDNA/pair_oxdna_coaxstk.h @@ -66,7 +66,7 @@ class PairOxdnaCoaxstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_excv.h b/src/USER-CGDNA/pair_oxdna_excv.h index c26e61407a..966e2526a6 100644 --- a/src/USER-CGDNA/pair_oxdna_excv.h +++ b/src/USER-CGDNA/pair_oxdna_excv.h @@ -28,8 +28,7 @@ class PairOxdnaExcv : public Pair { public: PairOxdnaExcv(class LAMMPS *); virtual ~PairOxdnaExcv(); - virtual void compute_interaction_sites(double *, double *, double *, - double *, double *); + virtual void compute_interaction_sites(double *, double *, double *, double *, double *); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); @@ -55,10 +54,9 @@ class PairOxdnaExcv : public Pair { double **lj1_bb, **lj2_bb, **b_bb, **cut_bb_c, **cutsq_bb_c; virtual void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_hbond.h b/src/USER-CGDNA/pair_oxdna_hbond.h index 60b465f498..cdc0aaef1f 100644 --- a/src/USER-CGDNA/pair_oxdna_hbond.h +++ b/src/USER-CGDNA/pair_oxdna_hbond.h @@ -72,7 +72,7 @@ class PairOxdnaHbond : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_stk.h b/src/USER-CGDNA/pair_oxdna_stk.h index b339f79140..f76985d426 100644 --- a/src/USER-CGDNA/pair_oxdna_stk.h +++ b/src/USER-CGDNA/pair_oxdna_stk.h @@ -65,7 +65,7 @@ class PairOxdnaStk : public Pair { void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxdna_xstk.h b/src/USER-CGDNA/pair_oxdna_xstk.h index c45afa2f6c..ecf4a337d6 100644 --- a/src/USER-CGDNA/pair_oxdna_xstk.h +++ b/src/USER-CGDNA/pair_oxdna_xstk.h @@ -69,7 +69,7 @@ class PairOxdnaXstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_dh.h b/src/USER-CGDNA/pair_oxrna2_dh.h index e9c734211f..1a55f40b27 100644 --- a/src/USER-CGDNA/pair_oxrna2_dh.h +++ b/src/USER-CGDNA/pair_oxrna2_dh.h @@ -28,12 +28,10 @@ class PairOxrna2Dh : public PairOxdna2Dh { public: PairOxrna2Dh(class LAMMPS *); virtual ~PairOxrna2Dh(); - virtual void compute_interaction_sites(double *, double *, double *, - double *); - + virtual void compute_interaction_sites(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_excv.h b/src/USER-CGDNA/pair_oxrna2_excv.h index f8434fcced..5d12db870f 100644 --- a/src/USER-CGDNA/pair_oxrna2_excv.h +++ b/src/USER-CGDNA/pair_oxrna2_excv.h @@ -28,11 +28,10 @@ class PairOxrna2Excv : public PairOxdnaExcv { public: PairOxrna2Excv(class LAMMPS *); virtual ~PairOxrna2Excv(); - virtual void compute_interaction_sites(double *, double *, - double *, double *, double *); + virtual void compute_interaction_sites(double *, double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_hbond.h b/src/USER-CGDNA/pair_oxrna2_hbond.h index 62832f2d61..ef5ebda239 100644 --- a/src/USER-CGDNA/pair_oxrna2_hbond.h +++ b/src/USER-CGDNA/pair_oxrna2_hbond.h @@ -30,7 +30,7 @@ class PairOxrna2Hbond : public PairOxdnaHbond { virtual ~PairOxrna2Hbond(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_stk.h b/src/USER-CGDNA/pair_oxrna2_stk.h index 8471fd9ca2..0fe1b49353 100644 --- a/src/USER-CGDNA/pair_oxrna2_stk.h +++ b/src/USER-CGDNA/pair_oxrna2_stk.h @@ -66,7 +66,7 @@ class PairOxrna2Stk : public Pair { void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGDNA/pair_oxrna2_xstk.h b/src/USER-CGDNA/pair_oxrna2_xstk.h index 6c1b0aca29..d9b3d9a3cb 100644 --- a/src/USER-CGDNA/pair_oxrna2_xstk.h +++ b/src/USER-CGDNA/pair_oxrna2_xstk.h @@ -65,7 +65,7 @@ class PairOxrna2Xstk : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/angle_sdk.h b/src/USER-CGSDK/angle_sdk.h index 622351e680..28140d8022 100644 --- a/src/USER-CGSDK/angle_sdk.h +++ b/src/USER-CGSDK/angle_sdk.h @@ -38,24 +38,23 @@ class AngleSDK : public Angle { double single(int, int, int, int); protected: - double *k,*theta0; + double *k, *theta0; // scaling factor for repulsive 1-3 interaction double *repscale; // parameters from SDK pair style int **lj_type; - double **lj1,**lj2, **lj3, **lj4; - double **rminsq,**emin; + double **lj1, **lj2, **lj3, **lj4; + double **rminsq, **emin; - int repflag; // 1 if we have to handle 1-3 repulsion + int repflag; // 1 if we have to handle 1-3 repulsion - void ev_tally13(int, int, int, int, double, double, - double, double, double); + void ev_tally13(int, int, int, int, double, double, double, double, double); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/lj_sdk_common.h b/src/USER-CGSDK/lj_sdk_common.h index d09fd9f439..3036e6610a 100644 --- a/src/USER-CGSDK/lj_sdk_common.h +++ b/src/USER-CGSDK/lj_sdk_common.h @@ -25,21 +25,24 @@ namespace LAMMPS_NS { namespace LJSDKParms { // LJ type flags. list of supported LJ exponent combinations - enum {LJ_NOT_SET=0, LJ9_6, LJ12_4, LJ12_6, NUM_LJ_TYPES}; + enum { LJ_NOT_SET = 0, LJ9_6, LJ12_4, LJ12_6, NUM_LJ_TYPES }; #if defined(LMP_NEED_SDK_FIND_LJ_TYPE) - static int find_lj_type(const char *label, - const char * const * const list) { - for (int i=0; i < NUM_LJ_TYPES; ++i) - if (strcmp(label,list[i]) == 0) return i; + static int find_lj_type(const char *label, const char *const *const list) + { + for (int i = 0; i < NUM_LJ_TYPES; ++i) + if (strcmp(label, list[i]) == 0) return i; return LJ_NOT_SET; } #endif - static const char * const lj_type_list[] = {"none", "lj9_6", "lj12_4", "lj12_6"}; - static const double lj_prefact[] = {0.0, 6.75, 2.59807621135332, 4.0}; - static const double lj_pow1[] = {0.0, 9.00, 12.0, 12.0}; - static const double lj_pow2[] = {0.0, 6.00, 4.0, 6.0}; -}} + // clang-format off + static const char *const lj_type_list[] = {"none", "lj9_6", "lj12_4", "lj12_6"}; + static constexpr double lj_prefact[] = {0.0, 6.75, 2.59807621135332, 4.0}; + static constexpr double lj_pow1[] = {0.0, 9.00, 12.0, 12.0}; + static constexpr double lj_pow2[] = {0.0, 6.00, 4.0, 6.0}; + // clang-format on +} // namespace LJSDKParms +} // namespace LAMMPS_NS #endif diff --git a/src/USER-CGSDK/pair_lj_sdk.h b/src/USER-CGSDK/pair_lj_sdk.h index 3431da1a07..10443c4db3 100644 --- a/src/USER-CGSDK/pair_lj_sdk.h +++ b/src/USER-CGSDK/pair_lj_sdk.h @@ -47,11 +47,11 @@ class PairLJSDK : public Pair { virtual double memory_usage(); protected: - int **lj_type; // type of lennard jones potential + int **lj_type; // type of lennard jones potential double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; // cutoff and offset for minimum of LJ potential // to be used in SDK angle potential, which @@ -65,10 +65,9 @@ class PairLJSDK : public Pair { private: template void eval(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.h b/src/USER-CGSDK/pair_lj_sdk_coul_long.h index 083fcdb218..6900d13b5d 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.h +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.h @@ -48,10 +48,10 @@ class PairLJSDKCoulLong : public Pair { virtual double memory_usage(); protected: - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; int **lj_type; // cutoff and offset for minimum of LJ potential @@ -67,10 +67,9 @@ class PairLJSDKCoulLong : public Pair { private: template void eval(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_msm.h b/src/USER-CGSDK/pair_lj_sdk_coul_msm.h index e42878d9a3..6670c69ec4 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_msm.h +++ b/src/USER-CGSDK/pair_lj_sdk_coul_msm.h @@ -31,17 +31,16 @@ namespace LAMMPS_NS { class PairLJSDKCoulMSM : public PairLJSDKCoulLong { public: PairLJSDKCoulMSM(class LAMMPS *); - virtual ~PairLJSDKCoulMSM() {}; + virtual ~PairLJSDKCoulMSM(){}; virtual void compute(int, int); virtual double single(int, int, int, int, double, double, double, double &); virtual void *extract(const char *, int &); -private: + private: template void eval_msm(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-COLVARS/colvarproxy_lammps.h b/src/USER-COLVARS/colvarproxy_lammps.h index aee268932e..b7b2799802 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.h +++ b/src/USER-COLVARS/colvarproxy_lammps.h @@ -10,10 +10,10 @@ #ifndef COLVARPROXY_LAMMPS_H #define COLVARPROXY_LAMMPS_H -#include "colvarproxy_lammps_version.h" // IWYU pragma: export +#include "colvarproxy_lammps_version.h" // IWYU pragma: export -#include #include +#include #include #include @@ -21,11 +21,11 @@ #include "colvarproxy.h" #include "colvartypes.h" +#include "domain.h" // IWYU pragma: keep +#include "force.h" // IWYU pragma: keep +#include "lammps.h" // IWYU pragma: keep #include "random_park.h" -#include "lammps.h" // IWYU pragma: keep -#include "domain.h" // IWYU pragma: keep -#include "force.h" // IWYU pragma: keep -#include "update.h" // IWYU pragma: keep +#include "update.h" // IWYU pragma: keep /// \brief Communication between colvars and LAMMPS /// (implementation of \link colvarproxy \endlink) @@ -33,7 +33,6 @@ class colvarproxy_lammps : public colvarproxy { // LAMMPS specific data objects and flags protected: - // pointers to LAMMPS class instances LAMMPS_NS::LAMMPS *_lmp; LAMMPS_NS::RanPark *_random; @@ -41,28 +40,28 @@ class colvarproxy_lammps : public colvarproxy { // state of LAMMPS properties double t_target, my_timestep, my_boltzmann, my_angstrom; double bias_energy; - int previous_step; + int previous_step; bool first_timestep; bool do_exit; - std::vector atoms_types; + std::vector atoms_types; - MPI_Comm inter_comm; // MPI comm with 1 root proc from each world - int inter_me, inter_num; // rank for the inter replica comm + MPI_Comm inter_comm; // MPI comm with 1 root proc from each world + int inter_me, inter_num; // rank for the inter replica comm public: friend class cvm::atom; - colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, const char *, - const char *, const int, const double, MPI_Comm); + colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, const char *, const char *, const int, const double, + MPI_Comm); virtual ~colvarproxy_lammps(); - void init(const char*); + void init(const char *); virtual int setup(); - // disable default and copy constructor + // disable default and copy constructor private: - colvarproxy_lammps() {}; - colvarproxy_lammps(const colvarproxy_lammps &) {}; + colvarproxy_lammps(){}; + colvarproxy_lammps(const colvarproxy_lammps &){}; // methods for lammps to move data or trigger actions in the proxy public: @@ -96,7 +95,10 @@ class colvarproxy_lammps : public colvarproxy { inline cvm::real boltzmann() { return my_boltzmann; }; inline cvm::real temperature() { return t_target; }; - inline cvm::real dt() { return my_timestep; }; // return _lmp->update->dt * _lmp->force->femtosecond; }; + inline cvm::real dt() + { + return my_timestep; + }; // return _lmp->update->dt * _lmp->force->femtosecond; }; void add_energy(cvm::real energy) { bias_energy += energy; }; void request_total_force(bool yesno) { total_force_requested = yesno; }; @@ -104,8 +106,7 @@ class colvarproxy_lammps : public colvarproxy { void log(std::string const &message); void error(std::string const &message); - cvm::rvector position_distance(cvm::atom_pos const &pos1, - cvm::atom_pos const &pos2) const; + cvm::rvector position_distance(cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const; int backup_file(char const *filename); @@ -121,9 +122,8 @@ class colvarproxy_lammps : public colvarproxy { virtual int num_replicas(); virtual void replica_comm_barrier(); - virtual int replica_comm_recv(char* msg_data, int buf_len, int src_rep); - virtual int replica_comm_send(char* msg_data, int msg_len, int dest_rep); + virtual int replica_comm_recv(char *msg_data, int buf_len, int src_rep); + virtual int replica_comm_send(char *msg_data, int msg_len, int dest_rep); }; #endif - diff --git a/src/USER-COLVARS/fix_colvars.h b/src/USER-COLVARS/fix_colvars.h index 38a05a5ada..d77fcd847e 100644 --- a/src/USER-COLVARS/fix_colvars.h +++ b/src/USER-COLVARS/fix_colvars.h @@ -49,7 +49,7 @@ class FixColvars : public Fix { virtual void init(); virtual void setup(int); virtual int modify_param(int, char **); - virtual void min_setup(int vflag) {setup(vflag);}; + virtual void min_setup(int vflag) { setup(vflag); }; virtual void min_post_force(int); virtual void post_force(int); virtual void post_force_respa(int, int, int); @@ -62,38 +62,38 @@ class FixColvars : public Fix { virtual void restart(char *); protected: - colvarproxy_lammps *proxy; // pointer to the colvars proxy class - char *conf_file; // name of colvars config file - char *inp_name; // name/prefix of colvars restart file - char *out_name; // prefix string for all output files - char *tmp_name; // name of thermostat fix. - int rng_seed; // seed to initialize random number generator - int tstat_id; // id of the thermostat fix - double energy; // biasing energy of the fix + colvarproxy_lammps *proxy; // pointer to the colvars proxy class + char *conf_file; // name of colvars config file + char *inp_name; // name/prefix of colvars restart file + char *out_name; // prefix string for all output files + char *tmp_name; // name of thermostat fix. + int rng_seed; // seed to initialize random number generator + int tstat_id; // id of the thermostat fix + double energy; // biasing energy of the fix - int me; // my MPI rank in this "world". - int num_coords; // total number of atoms controlled by this fix - tagint *taglist; // list of all atom IDs referenced by colvars. + int me; // my MPI rank in this "world". + int num_coords; // total number of atoms controlled by this fix + tagint *taglist; // list of all atom IDs referenced by colvars. - int nmax; // size of atom communication buffer. - int size_one; // bytes per atom in communication buffer. - struct commdata *comm_buf; // communication buffer - double *force_buf; // communication buffer + int nmax; // size of atom communication buffer. + int size_one; // bytes per atom in communication buffer. + struct commdata *comm_buf; // communication buffer + double *force_buf; // communication buffer - void *idmap; // hash for mapping atom indices to consistent order. - int *rev_idmap; // list of the hash keys for reverse mapping. + void *idmap; // hash for mapping atom indices to consistent order. + int *rev_idmap; // list of the hash keys for reverse mapping. - int nlevels_respa; // flag to determine respa levels. - int store_forces; // flag to determine whether to store total forces - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if not - int init_flag; // 1 if initialized, 0 if not - static int instances; // count fix instances, since colvars currently - // only supports one instance at a time - MPI_Comm root2root; // inter-root communicator for multi-replica support - void one_time_init(); // one time initialization + int nlevels_respa; // flag to determine respa levels. + int store_forces; // flag to determine whether to store total forces + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if not + int init_flag; // 1 if initialized, 0 if not + static int instances; // count fix instances, since colvars currently + // only supports one instance at a time + MPI_Comm root2root; // inter-root communicator for multi-replica support + void one_time_init(); // one time initialization }; -} +} // namespace LAMMPS_NS #endif #endif @@ -149,4 +149,3 @@ Some error condition happened inside the colvars library that prohibits it from continuing. Please examine the output for additional information. */ - diff --git a/src/USER-COLVARS/group_ndx.h b/src/USER-COLVARS/group_ndx.h index 520e57d0d5..4d3f760b00 100644 --- a/src/USER-COLVARS/group_ndx.h +++ b/src/USER-COLVARS/group_ndx.h @@ -28,13 +28,14 @@ namespace LAMMPS_NS { class Group2Ndx : public Command { public: - Group2Ndx(class LAMMPS *lmp) : Command(lmp) {}; + Group2Ndx(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); + private: void write_group(FILE *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-COLVARS/ndx_group.h b/src/USER-COLVARS/ndx_group.h index ab4fbf9fd2..41baff656f 100644 --- a/src/USER-COLVARS/ndx_group.h +++ b/src/USER-COLVARS/ndx_group.h @@ -29,13 +29,14 @@ namespace LAMMPS_NS { class Ndx2Group : public Command { public: - Ndx2Group(class LAMMPS *lmp) : Command(lmp) {}; + Ndx2Group(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); + private: void create(const std::string &, const std::vector &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DIFFRACTION/compute_saed.h b/src/USER-DIFFRACTION/compute_saed.h index 3d93c24384..62c67b842d 100644 --- a/src/USER-DIFFRACTION/compute_saed.h +++ b/src/USER-DIFFRACTION/compute_saed.h @@ -28,36 +28,35 @@ class ComputeSAED : public Compute { public: ComputeSAED(class LAMMPS *, int, char **); ~ComputeSAED(); - void init(); - void compute_vector(); - double memory_usage(); -//testing - double saed_var[10]; + void init(); + void compute_vector(); + double memory_usage(); + //testing + double saed_var[10]; private: - int me; - int *ztype; // Atomic number of the different atom types - double c[3]; // Parameters controlling resolution of reciprocal space explored - double dR_Ewald; // Thickness of Ewald sphere slice - double prd_inv[3]; // Inverse spacing of unit cell - bool echo; // echo compute_array progress - bool manual; // Turn on manual recpiprocal map - int nRows; // Number of relp explored + int me; + int *ztype; // Atomic number of the different atom types + double c[3]; // Parameters controlling resolution of reciprocal space explored + double dR_Ewald; // Thickness of Ewald sphere slice + double prd_inv[3]; // Inverse spacing of unit cell + bool echo; // echo compute_array progress + bool manual; // Turn on manual recpiprocal map + int nRows; // Number of relp explored - double Zone[3]; // Zone axis to view SAED - double R_Ewald; // Radius of Ewald sphere (distance units) - double lambda; // Radiation wavelenght (distance units) - double dK[3]; // spacing of reciprocal points in each dimension - int Knmax[3]; // maximum integer value for K points in each dimension - double Kmax; // Maximum reciprocal distance to explore + double Zone[3]; // Zone axis to view SAED + double R_Ewald; // Radius of Ewald sphere (distance units) + double lambda; // Radiation wavelenght (distance units) + double dK[3]; // spacing of reciprocal points in each dimension + int Knmax[3]; // maximum integer value for K points in each dimension + double Kmax; // Maximum reciprocal distance to explore int ntypes; int nlocalgroup; int *store_tmp; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DIFFRACTION/compute_saed_consts.h b/src/USER-DIFFRACTION/compute_saed_consts.h index 63743d0d9a..0762a36f92 100644 --- a/src/USER-DIFFRACTION/compute_saed_consts.h +++ b/src/USER-DIFFRACTION/compute_saed_consts.h @@ -31,428 +31,219 @@ Acta Crystallogr.A 52 25776 // list of element types associated with atomic scattering factor constants static const char *SAEDtypeList[SAEDmaxType] = { - "H", "He", "Li", "Be", "B", - "C", "N", "O", "F", "Ne", - "Na", "Mg", "Al", "Si", "P", - "S", "Cl", "Ar", "K", "Ca", - "Sc", "Ti", "V", "Cr", "Mn", - "Fe", "Co", "Ni", "Cu", "Zn", - "Ga", "Ge", "As", "Se", "Br", - "Kr", "Rb", "Sr", "Y", "Zr", - "Nb", "Mo", "Tc", "Ru", "Rh", - "Pd", "Ag", "Cd", "In", "Sn", - "Sb", "Te", "I", "Xe", "Cs", - "Ba", "La", "Ce", "Pr", "Nd", - "Pm", "Sm", "Eu", "Gd", "Tb", - "Dy", "Ho", "Er", "Tm", "Yb", - "Lu", "Hf", "Ta", "W", "Re", - "Os", "Ir", "Pt", "Au", "Hg", - "Tl", "Pb", "Bi", "Po", "At", - "Rn", "Fr", "Ra", "Ac", "Th", - "Pa", "U", "Np", "Pu", "Am", - "Cm", "Bk", "Cf"}; + "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", "Si", + "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", + "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", "Zr", "Nb", "Mo", + "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", + "La", "Ce", "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", "Yb", + "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", "Tl", "Pb", "Bi", "Po", + "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf"}; // list of atomic scattering factor constants for electron diffraction static const double ASFSAED[SAEDmaxType][20] = { - /* Each set of four rows in this file represents a single row in the matrix + /* Each set of four rows in this file represents a single row in the matrix First two rows are constants for 0 < sin(theta)/lambda < 2 Z-number A1 A2 A3 A4 A5 B1 B2 B3 B4 B5 Second two rows are constants for 2 < sin(theta)/lambda < 6 A1 A2 A3 A4 A5 B1 B2 B3 B4 B5*/ - /* 1*/ { 0.0349, 0.1201, 0.1970, 0.0573, 0.1195, - 0.5347, 3.5867, 12.3471, 18.9525, 38.6269, - 0.0088, 0.0449, 0.1481, 0.2356, 0.0914, - 0.1152, 1.0867, 4.9755, 16.5591, 43.2743}, - /* 2*/ { 0.0317, 0.0838, 0.1526, 0.1334, 0.0164, - 0.2507, 1.4751, 4.4938, 12.6646, 31.1653, - 0.0084, 0.0443, 0.1314, 0.1671, 0.0666, - 0.0596, 0.5360, 2.4274, 7.7852, 20.3126}, - /* 3*/ { 0.0750, 0.2249, 0.5548, 1.4954, 0.9354, - 0.3864, 2.9383, 15.3829, 53.5545, 138.7337, - 0.0478, 0.2048, 0.5253, 1.5225, 0.9853, - 0.2258, 2.1032, 12.9349, 50.7501, 136.6280}, - /* 4*/ { 0.0780, 0.2210, 0.6740, 1.3867, 0.6925, - 0.3131, 2.2381, 10.1517, 30.9061, 78.3273, - 0.0423, 0.1874, 0.6019, 1.4311, 0.7891, - 0.1445, 1.4180, 8.1165, 27.9705, 74.8684}, - /* 5*/ { 0.0909, 0.2551, 0.7738, 1.2136, 0.4606, - 0.2995, 2.1155, 8.3816, 24.1292, 63.1314, - 0.0436, 0.1898, 0.6788, 1.3273, 0.5544, - 0.1207, 1.1595, 6.2474, 21.0460, 59.3619}, - /* 6*/ { 0.0893, 0.2563, 0.7570, 1.0487, 0.3575, - 0.2465, 1.7100, 6.4094, 18.6113, 50.2523, - 0.0489, 0.2091, 0.7537, 1.1420, 0.3555, - 0.1140, 1.0825, 5.4281, 17.8811, 51.1341}, - /* 7*/ { 0.1022, 0.3219, 0.7982, 0.8197, 0.1715, - 0.2451, 1.7481, 6.1925, 17.3894, 48.1431, - 0.0267, 0.1328, 0.5301, 1.1020, 0.4215, - 0.0541, 0.5165, 2.8207, 10.6297, 34.3764}, - /* 8*/ { 0.0974, 0.2921, 0.6910, 0.6990, 0.2039, - 0.2067, 1.3815, 4.6943, 12.7105, 32.4726, - 0.0365, 0.1729, 0.5805, 0.8814, 0.3121, - 0.0652, 0.6184, 2.9449, 9.6298, 28.2194}, - /* 9*/ { 0.1083, 0.3175, 0.6487, 0.5846, 0.1421, - 0.2057, 1.3439, 4.2788, 11.3932, 28.7881, - 0.0382, 0.1822, 0.5972, 0.7707, 0.2130, - 0.0613, 0.5753, 2.6858, 8.8214, 25.6668}, - /* 10*/ { 0.1269, 0.3535, 0.5582, 0.4674, 0.1460, - 0.2200, 1.3779, 4.0203, 9.4934, 23.1278, - 0.0380, 0.1785, 0.5494, 0.6942, 0.1918, - 0.0554, 0.5087, 2.2639, 7.3316, 21.6912}, - /* 11*/ { 0.2142, 0.6853, 0.7692, 1.6589, 1.4482, - 0.3334, 2.3446, 10.0830, 48.3037, 138.2700, - 0.1260, 0.6442, 0.8893, 1.8197, 1.2988, - 0.1684, 1.7150, 8.8386, 50.8265, 147.2073}, - /* 12*/ { 0.2314, 0.6866, 0.9677, 2.1882, 1.1339, - 0.3278, 2.2720, 10.9241, 39.2898, 101.9748, - 0.1130, 0.5575, 0.9046, 2.1580, 1.4735, - 0.1356, 1.3579, 6.9255, 32.3165, 92.1138}, - /* 13*/ { 0.2390, 0.6573, 1.2011, 2.5586, 1.2312, - 0.3138, 2.1063, 10.4163, 34.4552, 98.5344, - 0.1165, 0.5504, 1.0179, 2.6295, 1.5711, - 0.1295, 1.2619, 6.8242, 28.4577, 88.4750}, - /* 14*/ { 0.2519, 0.6372, 1.3795, 2.5082, 1.0500, - 0.3075, 2.0174, 9.6746, 29.3744, 80.4732, - 0.0567, 0.3365, 0.8104, 2.4960, 2.1186, - 0.0582, 0.6155, 3.2522, 16.7929, 57.6767}, - /* 15*/ { 0.2548, 0.6106, 1.4541, 2.3204, 0.8477, - 0.2908, 1.8740, 8.5176, 24.3434, 63.2996, - 0.1005, 0.4615, 1.0663, 2.5854, 1.2725, - 0.0977, 0.9084, 4.9654, 18.5471, 54.3648}, - /* 16*/ { 0.2497, 0.5628, 1.3899, 2.1865, 0.7715, - 0.2681, 1.6711, 7.0267, 19.5377, 50.3888, - 0.0915, 0.4312, 1.0847, 2.4671, 1.0852, - 0.0838, 0.7788, 4.3462, 15.5846, 44.6365}, - /* 17*/ { 0.2443, 0.5397, 1.3919, 2.0197, 0.6621, - 0.2468, 1.5242, 6.1537, 16.6687, 42.3086, - 0.0799, 0.3891, 1.0037, 2.3332, 1.0507, - 0.0694, 0.6443, 3.5351, 12.5058, 35.8633}, - /* 18*/ { 0.2385, 0.5017, 1.3428, 1.8899, 0.6079, - 0.2289, 1.3694, 5.2561, 14.0928, 35.5361, - 0.1044, 0.4551, 1.4232, 2.1533, 0.4459, - 0.0853, 0.7701, 4.4684, 14.5864, 41.2474}, - /* 19*/ { 0.4115, 1.4031, 2.2784, 2.6742, 2.2162, - 0.3703, 3.3874, 13.1029, 68.9592, 194.4329, - 0.2149, 0.8703, 2.4999, 2.3591, 3.0318, - 0.1660, 1.6906, 8.7447, 46.7825, 165.6923}, - /* 20*/ { 0.4054, 1.3880, 2.1602, 3.7532, 2.2063, - 0.3499, 3.0991, 11.9608, 53.9353, 142.3892, - 0.2355, 0.9916, 2.3959, 3.7252, 2.5647, - 0.1742, 1.8329, 8.8407, 47.4583, 134.9613}, - /* 21*/ { 0.3787, 1.2181, 2.0594, 3.2618, 2.3870, - 0.3133, 2.5856, 9.5813, 41.7688, 116.7282, - 0.4636, 2.0802, 2.9003, 1.4193, 2.4323, - 0.3682, 4.0312, 22.6493, 71.8200, 103.3691}, - /* 22*/ { 0.3825, 1.2598, 2.0008, 3.0617, 2.0694, - 0.3040, 2.4863, 9.2783, 39.0751, 109.4583, - 0.2123, 0.8960, 2.1765, 3.0436, 2.4439, - 0.1399, 1.4568, 6.7534, 33.1168, 101.8238}, - /* 23*/ { 0.3876, 1.2750, 1.9109, 2.8314, 1.8979, - 0.2967, 2.3780, 8.7981, 35.9528, 101.7201, - 0.2369, 1.0774, 2.1894, 3.0825, 1.7190, - 0.1505, 1.6392, 7.5691, 36.8741, 107.8517}, - /* 24*/ { 0.4046, 1.3696, 1.8941, 2.0800, 1.2196, - 0.2986, 2.3958, 9.1406, 37.4701, 113.7121, - 0.1970, 0.8228, 2.0200, 2.1717, 1.7516, - 0.1197, 1.1985, 5.4097, 25.2361, 94.4290}, - /* 25*/ { 0.3796, 1.2094, 1.7815, 2.5420, 1.5937, - 0.2699, 2.0455, 7.4726, 31.0604, 91.5622, - 0.1943, 0.8190, 1.9296, 2.4968, 2.0625, - 0.1135, 1.1313, 5.0341, 24.1798, 80.5598}, - /* 26*/ { 0.3946, 1.2725, 1.7031, 2.3140, 1.4795, - 0.2717, 2.0443, 7.6007, 29.9714, 86.2265, - 0.1929, 0.8239, 1.8689, 2.3694, 1.9060, - 0.1087, 1.0806, 4.7637, 22.8500, 76.7309}, - /* 27*/ { 0.4118, 1.3161, 1.6493, 2.1930, 1.2830, - 0.2742, 2.0372, 7.7205, 29.9680, 84.9383, - 0.2186, 0.9861, 1.8540, 2.3258, 1.4685, - 0.1182, 1.2300, 5.4177, 25.7602, 80.8542}, - /* 28*/ { 0.3860, 1.1765, 1.5451, 2.0730, 1.3814, - 0.2478, 1.7660, 6.3107, 25.2204, 74.3146, - 0.2313, 1.0657, 1.8229, 2.2609, 1.1883, - 0.1210, 1.2691, 5.6870, 27.0917, 83.0285}, - /* 29*/ { 0.4314, 1.3208, 1.5236, 1.4671, 0.8562, - 0.2694, 1.9223, 7.3474, 28.9892, 90.6246, - 0.3501, 1.6558, 1.9582, 0.2134, 1.4109, - 0.1867, 1.9917, 11.3396, 53.2619, 63.2520}, - /* 30*/ { 0.4288, 1.2646, 1.4472, 1.8294, 1.0934, - 0.2593, 1.7998, 6.7500, 25.5860, 73.5284, - 0.1780, 0.8096, 1.6744, 1.9499, 1.4495, - 0.0876, 0.8650, 3.8612, 18.8726, 64.7016}, - /* 31*/ { 0.4818, 1.4032, 1.6561, 2.4605, 1.1054, - 0.2825, 1.9785, 8.7546, 32.5238, 98.5523, - 0.2135, 0.9768, 1.6669, 2.5662, 1.6790, - 0.1020, 1.0219, 4.6275, 22.8742, 80.1535}, - /* 32*/ { 0.4655, 1.3014, 1.6088, 2.6998, 1.3003, - 0.2647, 1.7926, 7.6071, 26.5541, 77.5238, - 0.2135, 0.9761, 1.6555, 2.8938, 1.6356, - 0.0989, 0.9845, 4.5527, 21.5563, 70.3903}, - /* 33*/ { 0.4517, 1.2229, 1.5852, 2.7958, 1.2638, - 0.2493, 1.6436, 6.8154, 22.3681, 62.0390, - 0.2059, 0.9518, 1.6372, 3.0490, 1.4756, - 0.0926, 0.9182, 4.3291, 19.2996, 58.9329}, - /* 34*/ { 0.4477, 1.1678, 1.5843, 2.8087, 1.1956, - 0.2405, 1.5442, 6.3231, 19.4610, 52.0233, - 0.1574, 0.7614, 1.4834, 3.0016, 1.7978, - 0.0686, 0.6808, 3.1163, 14.3458, 44.0455}, - /* 35*/ { 0.4798, 1.1948, 1.8695, 2.6953, 0.8203, - 0.2504, 1.5963, 6.9653, 19.8492, 50.3233, - 0.1899, 0.8983, 1.6358, 3.1845, 1.1518, - 0.0810, 0.7957, 3.9054, 15.7701, 45.6124}, - /* 36*/ { 0.4546, 1.0993, 1.7696, 2.7068, 0.8672, - 0.2309, 1.4279, 5.9449, 16.6752, 42.2243, - 0.1742, 0.8447, 1.5944, 3.1507, 1.1338, - 0.0723, 0.7123, 3.5192, 13.7724, 39.1148}, - /* 37*/ { 1.0160, 2.8528, 3.5466, -7.7804, 12.1148, - 0.4853, 5.0925, 25.7851, 130.4510, 138.6775, - 0.3781, 1.4904, 3.5753, 3.0031, 3.3272, - 0.1557, 1.5347, 9.9947, 51.4251, 185.9828}, - /* 38*/ { 0.6703, 1.4926, 3.3368, 4.4600, 3.1501, - 0.3190, 2.2287, 10.3504, 52.3291, 151.2216, - 0.3723, 1.4598, 3.5124, 4.4612, 3.3031, - 0.1480, 1.4643, 9.2320, 49.8807, 148.0937}, - /* 39*/ { 0.6894, 1.5474, 3.2450, 4.2126, 2.9764, - 0.3189, 2.2904, 10.0062, 44.0771, 125.0120, - 0.3234, 1.2737, 3.2115, 4.0563, 3.7962, - 0.1244, 1.1948, 7.2756, 34.1430, 111.2079}, - /* 40*/ { 0.6719, 1.4684, 3.1668, 3.9557, 2.8920, - 0.3036, 2.1249, 8.9236, 36.8458, 108.2049, - 0.2997, 1.1879, 3.1075, 3.9740, 3.5769, - 0.1121, 1.0638, 6.3891, 28.7081, 97.4289}, - /* 41*/ { 0.6123, 1.2677, 3.0348, 3.3841, 2.3683, - 0.2709, 1.7683, 7.2489, 27.9465, 98.5624, - 0.1680, 0.9370, 2.7300, 3.8150, 3.0053, - 0.0597, 0.6524, 4.4317, 19.5540, 85.5011}, - /* 42*/ { 0.6773, 1.4798, 3.1788, 3.0824, 1.8384, - 0.2920, 2.0606, 8.1129, 30.5336, 100.0658, - 0.3069, 1.1714, 3.2293, 3.4254, 2.1224, - 0.1101, 1.0222, 5.9613, 25.1965, 93.5831}, - /* 43*/ { 0.7082, 1.6392, 3.1993, 3.4327, 1.8711, - 0.2976, 2.2106, 8.5246, 33.1456, 96.6377, - 0.2928, 1.1267, 3.1675, 3.6619, 2.5942, - 0.1020, 0.9481, 5.4713, 23.8153, 82.8991}, - /* 44*/ { 0.6735, 1.4934, 3.0966, 2.7254, 1.5597, - 0.2773, 1.9716, 7.3249, 26.6891, 90.5581, - 0.2604, 1.0442, 3.0761, 3.2175, 1.9448, - 0.0887, 0.8240, 4.8278, 19.8977, 80.4566}, - /* 45*/ { 0.6413, 1.3690, 2.9854, 2.6952, 1.5433, - 0.2580, 1.7721, 6.3854, 23.2549, 85.1517, - 0.2713, 1.0556, 3.1416, 3.0451, 1.7179, - 0.0907, 0.8324, 4.7702, 19.7862, 80.2540}, - /* 46*/ { 0.5904, 1.1775, 2.6519, 2.2875, 0.8689, - 0.2324, 1.5019, 5.1591, 15.5428, 46.8213, - 0.2003, 0.8779, 2.6135, 2.8594, 1.0258, - 0.0659, 0.6111, 3.5563, 12.7638, 44.4283}, - /* 47*/ { 0.6377, 1.3790, 2.8294, 2.3631, 1.4553, - 0.2466, 1.6974, 5.7656, 20.0943, 76.7372, - 0.2739, 1.0503, 3.1564, 2.7543, 1.4328, - 0.0881, 0.8028, 4.4451, 18.7011, 79.2633}, - /* 48*/ { 0.6364, 1.4247, 2.7802, 2.5973, 1.7886, - 0.2407, 1.6823, 5.6588, 20.7219, 69.1109, - 0.3072, 1.1303, 3.2046, 2.9329, 1.6560, - 0.0966, 0.8856, 4.6273, 20.6789, 73.4723}, - /* 49*/ { 0.6768, 1.6589, 2.7740, 3.1835, 2.1326, - 0.2522, 1.8545, 6.2936, 25.1457, 84.5448, - 0.3564, 1.3011, 3.2424, 3.4839, 2.0459, - 0.1091, 1.0452, 5.0900, 24.6578, 88.0513}, - /* 50*/ { 0.7224, 1.9610, 2.7161, 3.5603, 1.8972, - 0.2651, 2.0604, 7.3011, 27.5493, 81.3349, - 0.2966, 1.1157, 3.0973, 3.8156, 2.5281, - 0.0896, 0.8268, 4.2242, 20.6900, 71.3399}, - /* 51*/ { 0.7106, 1.9247, 2.6149, 3.8322, 1.8899, - 0.2562, 1.9646, 6.8852, 24.7648, 68.9168, - 0.2725, 1.0651, 2.9940, 4.0697, 2.5682, - 0.0809, 0.7488, 3.8710, 18.8800, 60.6499}, - /* 52*/ { 0.6947, 1.8690, 2.5356, 4.0013, 1.8955, - 0.2459, 1.8542, 6.4411, 22.1730, 59.2206, - 0.2422, 0.9692, 2.8114, 4.1509, 2.8161, - 0.0708, 0.6472, 3.3609, 16.0752, 50.1724}, - /* 53*/ { 0.7047, 1.9484, 2.5940, 4.1526, 1.5057, - 0.2455, 1.8638, 6.7639, 21.8007, 56.4395, - 0.2617, 1.0325, 2.8097, 4.4809, 2.3190, - 0.0749, 0.6914, 3.4634, 16.3603, 48.2522}, - /* 54*/ { 0.6737, 1.7908, 2.4129, 4.2100, 1.7058, - 0.2305, 1.6890, 5.8218, 18.3928, 47.2496, - 0.2334, 0.9496, 2.6381, 4.4680, 2.5020, - 0.0655, 0.6050, 3.0389, 14.0809, 41.0005}, - /* 55*/ { 1.2704, 3.8018, 5.6618, 0.9205, 4.8105, - 0.4356, 4.2058, 23.4342, 136.7780, 171.7561, - 0.5713, 2.4866, 4.9795, 4.0198, 4.4403, - 0.1626, 1.8213, 11.1049, 49.0568, 202.9987}, - /* 56*/ { 0.9049, 2.6076, 4.8498, 5.1603, 4.7388, - 0.3066, 2.4363, 12.1821, 54.6135, 161.9978, - 0.5229, 2.2874, 4.7243, 5.0807, 5.6389, - 0.1434, 1.6019, 9.4511, 42.7685, 148.4969}, - /* 57*/ { 0.8405, 2.3863, 4.6139, 5.1514, 4.7949, - 0.2791, 2.1410, 10.3400, 41.9148, 132.0204, - 0.5461, 2.3856, 5.0653, 5.7601, 4.0463, - 0.1479, 1.6552, 10.0059, 47.3245, 145.8464}, - /* 58*/ { 0.8551, 2.3915, 4.5772, 5.0278, 4.5118, - 0.2805, 2.1200, 10.1808, 42.0633, 130.9893, - 0.2227, 1.0760, 2.9482, 5.8496, 7.1834, - 0.0571, 0.5946, 3.2022, 16.4253, 95.7030}, - /* 59*/ { 0.9096, 2.5313, 4.5266, 4.6376, 4.3690, - 0.2939, 2.2471, 10.8266, 48.8842, 147.6020, - 0.5237, 2.2913, 4.6161, 4.7233, 4.8173, - 0.1360, 1.5068, 8.8213, 41.9536, 141.2424}, - /* 60*/ { 0.8807, 2.4183, 4.4448, 4.6858, 4.1725, - 0.2802, 2.0836, 10.0357, 47.4506, 146.9976, - 0.5368, 2.3301, 4.6058, 4.6621, 4.4622, - 0.1378, 1.5140, 8.8719, 43.5967, 141.8065}, - /* 61*/ { 0.9471, 2.5463, 4.3523, 4.4789, 3.9080, - 0.2977, 2.2276, 10.5762, 49.3619, 145.3580, - 0.5232, 2.2627, 4.4552, 4.4787, 4.5073, - 0.1317, 1.4336, 8.3087, 40.6010, 135.9196}, - /* 62*/ { 0.9699, 2.5837, 4.2778, 4.4575, 3.5985, - 0.3003, 2.2447, 10.6487, 50.7994, 146.4179, - 0.5162, 2.2302, 4.3449, 4.3598, 4.4292, - 0.1279, 1.3811, 7.9629, 39.1213, 132.7846}, - /* 63*/ { 0.8694, 2.2413, 3.9196, 3.9694, 4.5498, - 0.2653, 1.8590, 8.3998, 36.7397, 125.7089, - 0.5272, 2.2844, 4.3361, 4.3178, 4.0908, - 0.1285, 1.3943, 8.1081, 40.9631, 134.1233}, - /* 64*/ { 0.9673, 2.4702, 4.1148, 4.4972, 3.2099, - 0.2909, 2.1014, 9.7067, 43.4270, 125.9474, - 0.9664, 3.4052, 5.0803, 1.4991, 4.2528, - 0.2641, 2.6586, 16.2213, 80.2060, 92.5359}, - /* 65*/ { 0.9325, 2.3673, 3.8791, 3.9674, 3.7996, - 0.2761, 1.9511, 8.9296, 41.5937, 131.0122, - 0.5110, 2.1570, 4.0308, 3.9936, 4.2466, - 0.1210, 1.2704, 7.1368, 35.0354, 123.5062}, - /* 66*/ { 0.9505, 2.3705, 3.8218, 4.0471, 3.4451, - 0.2773, 1.9469, 8.8862, 43.0938, 133.1396, - 0.4974, 2.1097, 3.8906, 3.8100, 4.3084, - 0.1157, 1.2108, 6.7377, 32.4150, 116.9225}, - /* 67*/ { 0.9248, 2.2428, 3.6182, 3.7910, 3.7912, - 0.2660, 1.8183, 7.9655, 33.1129, 101.8139, - 0.4679, 1.9693, 3.7191, 3.9632, 4.2432, - 0.1069, 1.0994, 5.9769, 27.1491, 96.3119}, - /* 68*/ { 1.0373, 2.4824, 3.6558, 3.8925, 3.0056, - 0.2944, 2.0797, 9.4156, 45.8056, 132.7720, - 0.5034, 2.1088, 3.8232, 3.7299, 3.8963, - 0.1141, 1.1769, 6.6087, 33.4332, 116.4913}, - /* 69*/ { 1.0075, 2.3787, 3.5440, 3.6932, 3.1759, - 0.2816, 1.9486, 8.7162, 41.8420, 125.0320, - 0.4839, 2.0262, 3.6851, 3.5874, 4.0037, - 0.1081, 1.1012, 6.1114, 30.3728, 110.5988}, - /* 70*/ { 1.0347, 2.3911, 3.4619, 3.6556, 3.0052, - 0.2855, 1.9679, 8.7619, 42.3304, 125.6499, - 0.5221, 2.1695, 3.7567, 3.6685, 3.4274, - 0.1148, 1.1860, 6.7520, 35.6807, 118.0692}, - /* 71*/ { 0.9927, 2.2436, 3.3554, 3.7813, 3.0994, - 0.2701, 1.8073, 7.8112, 34.4849, 103.3526, - 0.4680, 1.9466, 3.5428, 3.8490, 3.6594, - 0.1015, 1.0195, 5.6058, 27.4899, 95.2846}, - /* 72*/ { 1.0295, 2.2911, 3.4110, 3.9497, 2.4925, - 0.2761, 1.8625, 8.0961, 34.2712, 98.5295, - 0.4048, 1.7370, 3.3399, 3.9448, 3.7293, - 0.0868, 0.8585, 4.6378, 21.6900, 80.2408}, - /* 73*/ { 1.0190, 2.2291, 3.4097, 3.9252, 2.2679, - 0.2694, 1.7962, 7.6944, 31.0942, 91.1089, - 0.3835, 1.6747, 3.2986, 4.0462, 3.4303, - 0.0810, 0.8020, 4.3545, 19.9644, 73.6337}, - /* 74*/ { 0.9853, 2.1167, 3.3570, 3.7981, 2.2798, - 0.2569, 1.6745, 7.0098, 26.9234, 81.3910, - 0.3661, 1.6191, 3.2455, 4.0856, 3.2064, - 0.0761, 0.7543, 4.0952, 18.2886, 68.0967}, - /* 75*/ { 0.9914, 2.0858, 3.4531, 3.8812, 1.8526, - 0.2548, 1.6518, 6.8845, 26.7234, 81.7215, - 0.3933, 1.6973, 3.4202, 4.1274, 2.6158, - 0.0806, 0.7972, 4.4237, 19.5692, 68.7477}, - /* 76*/ { 0.9813, 2.0322, 3.3665, 3.6235, 1.9741, - 0.2487, 1.5973, 6.4737, 23.2817, 70.9254, - 0.3854, 1.6555, 3.4129, 4.1111, 2.4106, - 0.0787, 0.7638, 4.2441, 18.3700, 65.1071}, - /* 77*/ { 1.0194, 2.0645, 3.4425, 3.4914, 1.6976, - 0.2554, 1.6475, 6.5966, 23.2269, 70.0272, - 0.3510, 1.5620, 3.2946, 4.0615, 2.4382, - 0.0706, 0.6904, 3.8266, 16.0812, 58.7638}, - /* 78*/ { 0.9148, 1.8096, 3.2134, 3.2953, 1.5754, - 0.2263, 1.3813, 5.3243, 17.5987, 60.0171, - 0.3083, 1.4158, 2.9662, 3.9349, 2.1709, - 0.0609, 0.5993, 3.1921, 12.5285, 49.7675}, - /* 79*/ { 0.9674, 1.8916, 3.3993, 3.0524, 1.2607, - 0.2358, 1.4712, 5.6758, 18.7119, 61.5286, - 0.3055, 1.3945, 2.9617, 3.8990, 2.0026, - 0.0596, 0.5827, 3.1035, 11.9693, 47.9106}, - /* 80*/ { 1.0033, 1.9469, 3.4396, 3.1548, 1.4180, - 0.2413, 1.5298, 5.8009, 19.4520, 60.5753, - 0.3593, 1.5736, 3.5237, 3.8109, 1.6953, - 0.0694, 0.6758, 3.8457, 15.6203, 56.6614}, - /* 81*/ { 1.0689, 2.1038, 3.6039, 3.4927, 1.8283, - 0.2540, 1.6715, 6.3509, 23.1531, 78.7099, - 0.3511, 1.5489, 3.5676, 4.0900, 2.5251, - 0.0672, 0.6522, 3.7420, 15.9791, 65.1354}, - /* 82*/ { 1.0891, 2.1867, 3.6160, 3.8031, 1.8994, - 0.2552, 1.7174, 6.5131, 23.9170, 74.7039, - 0.3540, 1.5453, 3.5975, 4.3152, 2.7743, - 0.0668, 0.6465, 3.6968, 16.2056, 61.4909}, - /* 83*/ { 1.1007, 2.2306, 3.5689, 4.1549, 2.0382, - 0.2546, 1.7351, 6.4948, 23.6464, 70.3780, - 0.3530, 1.5258, 3.5815, 4.5532, 3.0714, - 0.0661, 0.6324, 3.5906, 15.9962, 57.5760}, - /* 84*/ { 1.1568, 2.4353, 3.6459, 4.4064, 1.7179, - 0.2648, 1.8786, 7.1749, 25.1766, 69.2821, - 0.3673, 1.5772, 3.7079, 4.8582, 2.8440, - 0.0678, 0.6527, 3.7396, 17.0668, 55.9789}, - /* 85*/ { 1.0909, 2.1976, 3.3831, 4.6700, 2.1277, - 0.2466, 1.6707, 6.0197, 20.7657, 57.2663, - 0.3547, 1.5206, 3.5621, 5.0184, 3.0075, - 0.0649, 0.6188, 3.4696, 15.6090, 49.4818}, - /* 86*/ { 1.0756, 2.1630, 3.3178, 4.8852, 2.0489, - 0.2402, 1.6169, 5.7644, 19.4568, 52.5009, - 0.4586, 1.7781, 3.9877, 5.7273, 1.5460, - 0.0831, 0.7840, 4.3599, 20.0128, 62.1535}, - /* 87*/ { 1.4282, 3.5081, 5.6767, 4.1964, 3.8946, - 0.3183, 2.6889, 13.4816, 54.3866, 200.8321, - 0.8282, 2.9941, 5.6597, 4.9292, 4.2889, - 0.1515, 1.6163, 9.7752, 42.8480, 190.7366}, - /* 88*/ { 1.3127, 3.1243, 5.2988, 5.3891, 5.4133, - 0.2887, 2.2897, 10.8276, 43.5389, 145.6109, - 1.4129, 4.4269, 7.0460, -1.0573, 8.6430, - 0.2921, 3.1381, 19.6767, 102.0430, 113.9798}, - /* 89*/ { 1.3128, 3.1021, 5.3385, 5.9611, 4.7562, - 0.2861, 2.2509, 10.5287, 41.7796, 128.2973, - 0.7169, 2.5710, 5.1791, 6.3484, 5.6474, - 0.1263, 1.2900, 7.3686, 32.4490, 118.0558}, - /* 90*/ { 1.2553, 2.9178, 5.0862, 6.1206, 4.7122, - 0.2701, 2.0636, 9.3051, 34.5977, 107.9200, - 0.6958, 2.4936, 5.1269, 6.6988, 5.0799, - 0.1211, 1.2247, 6.9398, 30.0991, 105.1960}, - /* 91*/ { 1.3218, 3.1444, 5.4371, 5.6444, 4.0107, - 0.2827, 2.2250, 10.2454, 41.1162, 124.4449, - 1.2502, 4.2284, 7.0489, 1.1390, 5.8222, - 0.2415, 2.6442, 16.3313, 73.5757, 91.9401}, - /* 92*/ { 1.3382, 3.2043, 5.4558, 5.4839, 3.6342, - 0.2838, 2.2452, 10.2519, 41.7251, 124.9023, - 0.6410, 2.2643, 4.8713, 5.9287, 5.3935, - 0.1097, 1.0644, 5.7907, 25.0261, 101.3899}, - /* 93*/ { 1.5193, 4.0053, 6.5327, -0.1402, 6.7489, - 0.3213, 2.8206, 14.8878, 68.9103, 81.7257, - 0.6938, 2.4652, 5.1227, 5.5965, 4.8543, - 0.1171, 1.1757, 6.4053, 27.5217, 103.0482}, - /* 94*/ { 1.3517, 3.2937, 5.3213, 4.6466, 3.5714, - 0.2813, 2.2418, 9.9952, 42.7939, 132.1739, - 0.6902, 2.4509, 5.1284, 5.0339, 4.8575, - 0.1153, 1.1545, 6.2291, 27.0741, 111.3150}, - /* 95*/ { 1.2135, 2.7962, 4.7545, 4.5731, 4.4786, - 0.2483, 1.8437, 7.5421, 29.3841, 112.4579, - 0.7577, 2.7264, 5.4184, 4.8198, 4.1013, - 0.1257, 1.3044, 7.1035, 32.4649, 118.8647}, - /* 96*/ { 1.2937, 3.1100, 5.0393, 4.7546, 3.5031, - 0.2638, 2.0341, 8.7101, 35.2992, 109.4972, - 0.7567, 2.7565, 5.4364, 5.1918, 3.5643, - 0.1239, 1.2979, 7.0798, 32.7871, 110.1512}, - /* 97*/ { 1.2915, 3.1023, 4.9309, 4.6009, 3.4661, - 0.2611, 2.0023, 8.4377, 34.1559, 105.8911, - 0.7492, 2.7267, 5.3521, 5.0369, 3.5321, - 0.1217, 1.2651, 6.8101, 31.6088, 106.4853}, - /* 98*/ { 1.2089, 2.7391, 4.3482, 4.0047, 4.6497, - 0.2421, 1.7487, 6.7262, 23.2153, 80.3108, - 0.8100, 3.0001, 5.4635, 4.1756, 3.5066, - 0.1310, 1.4038, 7.6057, 34.0186, 90.5226}, - }; + /* 1*/ {0.0349, 0.1201, 0.1970, 0.0573, 0.1195, 0.5347, 3.5867, 12.3471, 18.9525, 38.6269, + 0.0088, 0.0449, 0.1481, 0.2356, 0.0914, 0.1152, 1.0867, 4.9755, 16.5591, 43.2743}, + /* 2*/ {0.0317, 0.0838, 0.1526, 0.1334, 0.0164, 0.2507, 1.4751, 4.4938, 12.6646, 31.1653, + 0.0084, 0.0443, 0.1314, 0.1671, 0.0666, 0.0596, 0.5360, 2.4274, 7.7852, 20.3126}, + /* 3*/ {0.0750, 0.2249, 0.5548, 1.4954, 0.9354, 0.3864, 2.9383, 15.3829, 53.5545, 138.7337, + 0.0478, 0.2048, 0.5253, 1.5225, 0.9853, 0.2258, 2.1032, 12.9349, 50.7501, 136.6280}, + /* 4*/ {0.0780, 0.2210, 0.6740, 1.3867, 0.6925, 0.3131, 2.2381, 10.1517, 30.9061, 78.3273, + 0.0423, 0.1874, 0.6019, 1.4311, 0.7891, 0.1445, 1.4180, 8.1165, 27.9705, 74.8684}, + /* 5*/ {0.0909, 0.2551, 0.7738, 1.2136, 0.4606, 0.2995, 2.1155, 8.3816, 24.1292, 63.1314, + 0.0436, 0.1898, 0.6788, 1.3273, 0.5544, 0.1207, 1.1595, 6.2474, 21.0460, 59.3619}, + /* 6*/ {0.0893, 0.2563, 0.7570, 1.0487, 0.3575, 0.2465, 1.7100, 6.4094, 18.6113, 50.2523, + 0.0489, 0.2091, 0.7537, 1.1420, 0.3555, 0.1140, 1.0825, 5.4281, 17.8811, 51.1341}, + /* 7*/ {0.1022, 0.3219, 0.7982, 0.8197, 0.1715, 0.2451, 1.7481, 6.1925, 17.3894, 48.1431, + 0.0267, 0.1328, 0.5301, 1.1020, 0.4215, 0.0541, 0.5165, 2.8207, 10.6297, 34.3764}, + /* 8*/ {0.0974, 0.2921, 0.6910, 0.6990, 0.2039, 0.2067, 1.3815, 4.6943, 12.7105, 32.4726, + 0.0365, 0.1729, 0.5805, 0.8814, 0.3121, 0.0652, 0.6184, 2.9449, 9.6298, 28.2194}, + /* 9*/ {0.1083, 0.3175, 0.6487, 0.5846, 0.1421, 0.2057, 1.3439, 4.2788, 11.3932, 28.7881, + 0.0382, 0.1822, 0.5972, 0.7707, 0.2130, 0.0613, 0.5753, 2.6858, 8.8214, 25.6668}, + /* 10*/ {0.1269, 0.3535, 0.5582, 0.4674, 0.1460, 0.2200, 1.3779, 4.0203, 9.4934, 23.1278, + 0.0380, 0.1785, 0.5494, 0.6942, 0.1918, 0.0554, 0.5087, 2.2639, 7.3316, 21.6912}, + /* 11*/ {0.2142, 0.6853, 0.7692, 1.6589, 1.4482, 0.3334, 2.3446, 10.0830, 48.3037, 138.2700, + 0.1260, 0.6442, 0.8893, 1.8197, 1.2988, 0.1684, 1.7150, 8.8386, 50.8265, 147.2073}, + /* 12*/ {0.2314, 0.6866, 0.9677, 2.1882, 1.1339, 0.3278, 2.2720, 10.9241, 39.2898, 101.9748, + 0.1130, 0.5575, 0.9046, 2.1580, 1.4735, 0.1356, 1.3579, 6.9255, 32.3165, 92.1138}, + /* 13*/ {0.2390, 0.6573, 1.2011, 2.5586, 1.2312, 0.3138, 2.1063, 10.4163, 34.4552, 98.5344, + 0.1165, 0.5504, 1.0179, 2.6295, 1.5711, 0.1295, 1.2619, 6.8242, 28.4577, 88.4750}, + /* 14*/ {0.2519, 0.6372, 1.3795, 2.5082, 1.0500, 0.3075, 2.0174, 9.6746, 29.3744, 80.4732, + 0.0567, 0.3365, 0.8104, 2.4960, 2.1186, 0.0582, 0.6155, 3.2522, 16.7929, 57.6767}, + /* 15*/ {0.2548, 0.6106, 1.4541, 2.3204, 0.8477, 0.2908, 1.8740, 8.5176, 24.3434, 63.2996, + 0.1005, 0.4615, 1.0663, 2.5854, 1.2725, 0.0977, 0.9084, 4.9654, 18.5471, 54.3648}, + /* 16*/ {0.2497, 0.5628, 1.3899, 2.1865, 0.7715, 0.2681, 1.6711, 7.0267, 19.5377, 50.3888, + 0.0915, 0.4312, 1.0847, 2.4671, 1.0852, 0.0838, 0.7788, 4.3462, 15.5846, 44.6365}, + /* 17*/ {0.2443, 0.5397, 1.3919, 2.0197, 0.6621, 0.2468, 1.5242, 6.1537, 16.6687, 42.3086, + 0.0799, 0.3891, 1.0037, 2.3332, 1.0507, 0.0694, 0.6443, 3.5351, 12.5058, 35.8633}, + /* 18*/ {0.2385, 0.5017, 1.3428, 1.8899, 0.6079, 0.2289, 1.3694, 5.2561, 14.0928, 35.5361, + 0.1044, 0.4551, 1.4232, 2.1533, 0.4459, 0.0853, 0.7701, 4.4684, 14.5864, 41.2474}, + /* 19*/ {0.4115, 1.4031, 2.2784, 2.6742, 2.2162, 0.3703, 3.3874, 13.1029, 68.9592, 194.4329, + 0.2149, 0.8703, 2.4999, 2.3591, 3.0318, 0.1660, 1.6906, 8.7447, 46.7825, 165.6923}, + /* 20*/ {0.4054, 1.3880, 2.1602, 3.7532, 2.2063, 0.3499, 3.0991, 11.9608, 53.9353, 142.3892, + 0.2355, 0.9916, 2.3959, 3.7252, 2.5647, 0.1742, 1.8329, 8.8407, 47.4583, 134.9613}, + /* 21*/ {0.3787, 1.2181, 2.0594, 3.2618, 2.3870, 0.3133, 2.5856, 9.5813, 41.7688, 116.7282, + 0.4636, 2.0802, 2.9003, 1.4193, 2.4323, 0.3682, 4.0312, 22.6493, 71.8200, 103.3691}, + /* 22*/ {0.3825, 1.2598, 2.0008, 3.0617, 2.0694, 0.3040, 2.4863, 9.2783, 39.0751, 109.4583, + 0.2123, 0.8960, 2.1765, 3.0436, 2.4439, 0.1399, 1.4568, 6.7534, 33.1168, 101.8238}, + /* 23*/ {0.3876, 1.2750, 1.9109, 2.8314, 1.8979, 0.2967, 2.3780, 8.7981, 35.9528, 101.7201, + 0.2369, 1.0774, 2.1894, 3.0825, 1.7190, 0.1505, 1.6392, 7.5691, 36.8741, 107.8517}, + /* 24*/ {0.4046, 1.3696, 1.8941, 2.0800, 1.2196, 0.2986, 2.3958, 9.1406, 37.4701, 113.7121, + 0.1970, 0.8228, 2.0200, 2.1717, 1.7516, 0.1197, 1.1985, 5.4097, 25.2361, 94.4290}, + /* 25*/ {0.3796, 1.2094, 1.7815, 2.5420, 1.5937, 0.2699, 2.0455, 7.4726, 31.0604, 91.5622, + 0.1943, 0.8190, 1.9296, 2.4968, 2.0625, 0.1135, 1.1313, 5.0341, 24.1798, 80.5598}, + /* 26*/ {0.3946, 1.2725, 1.7031, 2.3140, 1.4795, 0.2717, 2.0443, 7.6007, 29.9714, 86.2265, + 0.1929, 0.8239, 1.8689, 2.3694, 1.9060, 0.1087, 1.0806, 4.7637, 22.8500, 76.7309}, + /* 27*/ {0.4118, 1.3161, 1.6493, 2.1930, 1.2830, 0.2742, 2.0372, 7.7205, 29.9680, 84.9383, + 0.2186, 0.9861, 1.8540, 2.3258, 1.4685, 0.1182, 1.2300, 5.4177, 25.7602, 80.8542}, + /* 28*/ {0.3860, 1.1765, 1.5451, 2.0730, 1.3814, 0.2478, 1.7660, 6.3107, 25.2204, 74.3146, + 0.2313, 1.0657, 1.8229, 2.2609, 1.1883, 0.1210, 1.2691, 5.6870, 27.0917, 83.0285}, + /* 29*/ {0.4314, 1.3208, 1.5236, 1.4671, 0.8562, 0.2694, 1.9223, 7.3474, 28.9892, 90.6246, + 0.3501, 1.6558, 1.9582, 0.2134, 1.4109, 0.1867, 1.9917, 11.3396, 53.2619, 63.2520}, + /* 30*/ {0.4288, 1.2646, 1.4472, 1.8294, 1.0934, 0.2593, 1.7998, 6.7500, 25.5860, 73.5284, + 0.1780, 0.8096, 1.6744, 1.9499, 1.4495, 0.0876, 0.8650, 3.8612, 18.8726, 64.7016}, + /* 31*/ {0.4818, 1.4032, 1.6561, 2.4605, 1.1054, 0.2825, 1.9785, 8.7546, 32.5238, 98.5523, + 0.2135, 0.9768, 1.6669, 2.5662, 1.6790, 0.1020, 1.0219, 4.6275, 22.8742, 80.1535}, + /* 32*/ {0.4655, 1.3014, 1.6088, 2.6998, 1.3003, 0.2647, 1.7926, 7.6071, 26.5541, 77.5238, + 0.2135, 0.9761, 1.6555, 2.8938, 1.6356, 0.0989, 0.9845, 4.5527, 21.5563, 70.3903}, + /* 33*/ {0.4517, 1.2229, 1.5852, 2.7958, 1.2638, 0.2493, 1.6436, 6.8154, 22.3681, 62.0390, + 0.2059, 0.9518, 1.6372, 3.0490, 1.4756, 0.0926, 0.9182, 4.3291, 19.2996, 58.9329}, + /* 34*/ {0.4477, 1.1678, 1.5843, 2.8087, 1.1956, 0.2405, 1.5442, 6.3231, 19.4610, 52.0233, + 0.1574, 0.7614, 1.4834, 3.0016, 1.7978, 0.0686, 0.6808, 3.1163, 14.3458, 44.0455}, + /* 35*/ {0.4798, 1.1948, 1.8695, 2.6953, 0.8203, 0.2504, 1.5963, 6.9653, 19.8492, 50.3233, + 0.1899, 0.8983, 1.6358, 3.1845, 1.1518, 0.0810, 0.7957, 3.9054, 15.7701, 45.6124}, + /* 36*/ {0.4546, 1.0993, 1.7696, 2.7068, 0.8672, 0.2309, 1.4279, 5.9449, 16.6752, 42.2243, + 0.1742, 0.8447, 1.5944, 3.1507, 1.1338, 0.0723, 0.7123, 3.5192, 13.7724, 39.1148}, + /* 37*/ {1.0160, 2.8528, 3.5466, -7.7804, 12.1148, 0.4853, 5.0925, 25.7851, 130.4510, 138.6775, + 0.3781, 1.4904, 3.5753, 3.0031, 3.3272, 0.1557, 1.5347, 9.9947, 51.4251, 185.9828}, + /* 38*/ {0.6703, 1.4926, 3.3368, 4.4600, 3.1501, 0.3190, 2.2287, 10.3504, 52.3291, 151.2216, + 0.3723, 1.4598, 3.5124, 4.4612, 3.3031, 0.1480, 1.4643, 9.2320, 49.8807, 148.0937}, + /* 39*/ {0.6894, 1.5474, 3.2450, 4.2126, 2.9764, 0.3189, 2.2904, 10.0062, 44.0771, 125.0120, + 0.3234, 1.2737, 3.2115, 4.0563, 3.7962, 0.1244, 1.1948, 7.2756, 34.1430, 111.2079}, + /* 40*/ {0.6719, 1.4684, 3.1668, 3.9557, 2.8920, 0.3036, 2.1249, 8.9236, 36.8458, 108.2049, + 0.2997, 1.1879, 3.1075, 3.9740, 3.5769, 0.1121, 1.0638, 6.3891, 28.7081, 97.4289}, + /* 41*/ {0.6123, 1.2677, 3.0348, 3.3841, 2.3683, 0.2709, 1.7683, 7.2489, 27.9465, 98.5624, + 0.1680, 0.9370, 2.7300, 3.8150, 3.0053, 0.0597, 0.6524, 4.4317, 19.5540, 85.5011}, + /* 42*/ {0.6773, 1.4798, 3.1788, 3.0824, 1.8384, 0.2920, 2.0606, 8.1129, 30.5336, 100.0658, + 0.3069, 1.1714, 3.2293, 3.4254, 2.1224, 0.1101, 1.0222, 5.9613, 25.1965, 93.5831}, + /* 43*/ {0.7082, 1.6392, 3.1993, 3.4327, 1.8711, 0.2976, 2.2106, 8.5246, 33.1456, 96.6377, + 0.2928, 1.1267, 3.1675, 3.6619, 2.5942, 0.1020, 0.9481, 5.4713, 23.8153, 82.8991}, + /* 44*/ {0.6735, 1.4934, 3.0966, 2.7254, 1.5597, 0.2773, 1.9716, 7.3249, 26.6891, 90.5581, + 0.2604, 1.0442, 3.0761, 3.2175, 1.9448, 0.0887, 0.8240, 4.8278, 19.8977, 80.4566}, + /* 45*/ {0.6413, 1.3690, 2.9854, 2.6952, 1.5433, 0.2580, 1.7721, 6.3854, 23.2549, 85.1517, + 0.2713, 1.0556, 3.1416, 3.0451, 1.7179, 0.0907, 0.8324, 4.7702, 19.7862, 80.2540}, + /* 46*/ {0.5904, 1.1775, 2.6519, 2.2875, 0.8689, 0.2324, 1.5019, 5.1591, 15.5428, 46.8213, + 0.2003, 0.8779, 2.6135, 2.8594, 1.0258, 0.0659, 0.6111, 3.5563, 12.7638, 44.4283}, + /* 47*/ {0.6377, 1.3790, 2.8294, 2.3631, 1.4553, 0.2466, 1.6974, 5.7656, 20.0943, 76.7372, + 0.2739, 1.0503, 3.1564, 2.7543, 1.4328, 0.0881, 0.8028, 4.4451, 18.7011, 79.2633}, + /* 48*/ {0.6364, 1.4247, 2.7802, 2.5973, 1.7886, 0.2407, 1.6823, 5.6588, 20.7219, 69.1109, + 0.3072, 1.1303, 3.2046, 2.9329, 1.6560, 0.0966, 0.8856, 4.6273, 20.6789, 73.4723}, + /* 49*/ {0.6768, 1.6589, 2.7740, 3.1835, 2.1326, 0.2522, 1.8545, 6.2936, 25.1457, 84.5448, + 0.3564, 1.3011, 3.2424, 3.4839, 2.0459, 0.1091, 1.0452, 5.0900, 24.6578, 88.0513}, + /* 50*/ {0.7224, 1.9610, 2.7161, 3.5603, 1.8972, 0.2651, 2.0604, 7.3011, 27.5493, 81.3349, + 0.2966, 1.1157, 3.0973, 3.8156, 2.5281, 0.0896, 0.8268, 4.2242, 20.6900, 71.3399}, + /* 51*/ {0.7106, 1.9247, 2.6149, 3.8322, 1.8899, 0.2562, 1.9646, 6.8852, 24.7648, 68.9168, + 0.2725, 1.0651, 2.9940, 4.0697, 2.5682, 0.0809, 0.7488, 3.8710, 18.8800, 60.6499}, + /* 52*/ {0.6947, 1.8690, 2.5356, 4.0013, 1.8955, 0.2459, 1.8542, 6.4411, 22.1730, 59.2206, + 0.2422, 0.9692, 2.8114, 4.1509, 2.8161, 0.0708, 0.6472, 3.3609, 16.0752, 50.1724}, + /* 53*/ {0.7047, 1.9484, 2.5940, 4.1526, 1.5057, 0.2455, 1.8638, 6.7639, 21.8007, 56.4395, + 0.2617, 1.0325, 2.8097, 4.4809, 2.3190, 0.0749, 0.6914, 3.4634, 16.3603, 48.2522}, + /* 54*/ {0.6737, 1.7908, 2.4129, 4.2100, 1.7058, 0.2305, 1.6890, 5.8218, 18.3928, 47.2496, + 0.2334, 0.9496, 2.6381, 4.4680, 2.5020, 0.0655, 0.6050, 3.0389, 14.0809, 41.0005}, + /* 55*/ {1.2704, 3.8018, 5.6618, 0.9205, 4.8105, 0.4356, 4.2058, 23.4342, 136.7780, 171.7561, + 0.5713, 2.4866, 4.9795, 4.0198, 4.4403, 0.1626, 1.8213, 11.1049, 49.0568, 202.9987}, + /* 56*/ {0.9049, 2.6076, 4.8498, 5.1603, 4.7388, 0.3066, 2.4363, 12.1821, 54.6135, 161.9978, + 0.5229, 2.2874, 4.7243, 5.0807, 5.6389, 0.1434, 1.6019, 9.4511, 42.7685, 148.4969}, + /* 57*/ {0.8405, 2.3863, 4.6139, 5.1514, 4.7949, 0.2791, 2.1410, 10.3400, 41.9148, 132.0204, + 0.5461, 2.3856, 5.0653, 5.7601, 4.0463, 0.1479, 1.6552, 10.0059, 47.3245, 145.8464}, + /* 58*/ {0.8551, 2.3915, 4.5772, 5.0278, 4.5118, 0.2805, 2.1200, 10.1808, 42.0633, 130.9893, + 0.2227, 1.0760, 2.9482, 5.8496, 7.1834, 0.0571, 0.5946, 3.2022, 16.4253, 95.7030}, + /* 59*/ {0.9096, 2.5313, 4.5266, 4.6376, 4.3690, 0.2939, 2.2471, 10.8266, 48.8842, 147.6020, + 0.5237, 2.2913, 4.6161, 4.7233, 4.8173, 0.1360, 1.5068, 8.8213, 41.9536, 141.2424}, + /* 60*/ {0.8807, 2.4183, 4.4448, 4.6858, 4.1725, 0.2802, 2.0836, 10.0357, 47.4506, 146.9976, + 0.5368, 2.3301, 4.6058, 4.6621, 4.4622, 0.1378, 1.5140, 8.8719, 43.5967, 141.8065}, + /* 61*/ {0.9471, 2.5463, 4.3523, 4.4789, 3.9080, 0.2977, 2.2276, 10.5762, 49.3619, 145.3580, + 0.5232, 2.2627, 4.4552, 4.4787, 4.5073, 0.1317, 1.4336, 8.3087, 40.6010, 135.9196}, + /* 62*/ {0.9699, 2.5837, 4.2778, 4.4575, 3.5985, 0.3003, 2.2447, 10.6487, 50.7994, 146.4179, + 0.5162, 2.2302, 4.3449, 4.3598, 4.4292, 0.1279, 1.3811, 7.9629, 39.1213, 132.7846}, + /* 63*/ {0.8694, 2.2413, 3.9196, 3.9694, 4.5498, 0.2653, 1.8590, 8.3998, 36.7397, 125.7089, + 0.5272, 2.2844, 4.3361, 4.3178, 4.0908, 0.1285, 1.3943, 8.1081, 40.9631, 134.1233}, + /* 64*/ {0.9673, 2.4702, 4.1148, 4.4972, 3.2099, 0.2909, 2.1014, 9.7067, 43.4270, 125.9474, + 0.9664, 3.4052, 5.0803, 1.4991, 4.2528, 0.2641, 2.6586, 16.2213, 80.2060, 92.5359}, + /* 65*/ {0.9325, 2.3673, 3.8791, 3.9674, 3.7996, 0.2761, 1.9511, 8.9296, 41.5937, 131.0122, + 0.5110, 2.1570, 4.0308, 3.9936, 4.2466, 0.1210, 1.2704, 7.1368, 35.0354, 123.5062}, + /* 66*/ {0.9505, 2.3705, 3.8218, 4.0471, 3.4451, 0.2773, 1.9469, 8.8862, 43.0938, 133.1396, + 0.4974, 2.1097, 3.8906, 3.8100, 4.3084, 0.1157, 1.2108, 6.7377, 32.4150, 116.9225}, + /* 67*/ {0.9248, 2.2428, 3.6182, 3.7910, 3.7912, 0.2660, 1.8183, 7.9655, 33.1129, 101.8139, + 0.4679, 1.9693, 3.7191, 3.9632, 4.2432, 0.1069, 1.0994, 5.9769, 27.1491, 96.3119}, + /* 68*/ {1.0373, 2.4824, 3.6558, 3.8925, 3.0056, 0.2944, 2.0797, 9.4156, 45.8056, 132.7720, + 0.5034, 2.1088, 3.8232, 3.7299, 3.8963, 0.1141, 1.1769, 6.6087, 33.4332, 116.4913}, + /* 69*/ {1.0075, 2.3787, 3.5440, 3.6932, 3.1759, 0.2816, 1.9486, 8.7162, 41.8420, 125.0320, + 0.4839, 2.0262, 3.6851, 3.5874, 4.0037, 0.1081, 1.1012, 6.1114, 30.3728, 110.5988}, + /* 70*/ {1.0347, 2.3911, 3.4619, 3.6556, 3.0052, 0.2855, 1.9679, 8.7619, 42.3304, 125.6499, + 0.5221, 2.1695, 3.7567, 3.6685, 3.4274, 0.1148, 1.1860, 6.7520, 35.6807, 118.0692}, + /* 71*/ {0.9927, 2.2436, 3.3554, 3.7813, 3.0994, 0.2701, 1.8073, 7.8112, 34.4849, 103.3526, + 0.4680, 1.9466, 3.5428, 3.8490, 3.6594, 0.1015, 1.0195, 5.6058, 27.4899, 95.2846}, + /* 72*/ {1.0295, 2.2911, 3.4110, 3.9497, 2.4925, 0.2761, 1.8625, 8.0961, 34.2712, 98.5295, + 0.4048, 1.7370, 3.3399, 3.9448, 3.7293, 0.0868, 0.8585, 4.6378, 21.6900, 80.2408}, + /* 73*/ {1.0190, 2.2291, 3.4097, 3.9252, 2.2679, 0.2694, 1.7962, 7.6944, 31.0942, 91.1089, + 0.3835, 1.6747, 3.2986, 4.0462, 3.4303, 0.0810, 0.8020, 4.3545, 19.9644, 73.6337}, + /* 74*/ {0.9853, 2.1167, 3.3570, 3.7981, 2.2798, 0.2569, 1.6745, 7.0098, 26.9234, 81.3910, + 0.3661, 1.6191, 3.2455, 4.0856, 3.2064, 0.0761, 0.7543, 4.0952, 18.2886, 68.0967}, + /* 75*/ {0.9914, 2.0858, 3.4531, 3.8812, 1.8526, 0.2548, 1.6518, 6.8845, 26.7234, 81.7215, + 0.3933, 1.6973, 3.4202, 4.1274, 2.6158, 0.0806, 0.7972, 4.4237, 19.5692, 68.7477}, + /* 76*/ {0.9813, 2.0322, 3.3665, 3.6235, 1.9741, 0.2487, 1.5973, 6.4737, 23.2817, 70.9254, + 0.3854, 1.6555, 3.4129, 4.1111, 2.4106, 0.0787, 0.7638, 4.2441, 18.3700, 65.1071}, + /* 77*/ {1.0194, 2.0645, 3.4425, 3.4914, 1.6976, 0.2554, 1.6475, 6.5966, 23.2269, 70.0272, + 0.3510, 1.5620, 3.2946, 4.0615, 2.4382, 0.0706, 0.6904, 3.8266, 16.0812, 58.7638}, + /* 78*/ {0.9148, 1.8096, 3.2134, 3.2953, 1.5754, 0.2263, 1.3813, 5.3243, 17.5987, 60.0171, + 0.3083, 1.4158, 2.9662, 3.9349, 2.1709, 0.0609, 0.5993, 3.1921, 12.5285, 49.7675}, + /* 79*/ {0.9674, 1.8916, 3.3993, 3.0524, 1.2607, 0.2358, 1.4712, 5.6758, 18.7119, 61.5286, + 0.3055, 1.3945, 2.9617, 3.8990, 2.0026, 0.0596, 0.5827, 3.1035, 11.9693, 47.9106}, + /* 80*/ {1.0033, 1.9469, 3.4396, 3.1548, 1.4180, 0.2413, 1.5298, 5.8009, 19.4520, 60.5753, + 0.3593, 1.5736, 3.5237, 3.8109, 1.6953, 0.0694, 0.6758, 3.8457, 15.6203, 56.6614}, + /* 81*/ {1.0689, 2.1038, 3.6039, 3.4927, 1.8283, 0.2540, 1.6715, 6.3509, 23.1531, 78.7099, + 0.3511, 1.5489, 3.5676, 4.0900, 2.5251, 0.0672, 0.6522, 3.7420, 15.9791, 65.1354}, + /* 82*/ {1.0891, 2.1867, 3.6160, 3.8031, 1.8994, 0.2552, 1.7174, 6.5131, 23.9170, 74.7039, + 0.3540, 1.5453, 3.5975, 4.3152, 2.7743, 0.0668, 0.6465, 3.6968, 16.2056, 61.4909}, + /* 83*/ {1.1007, 2.2306, 3.5689, 4.1549, 2.0382, 0.2546, 1.7351, 6.4948, 23.6464, 70.3780, + 0.3530, 1.5258, 3.5815, 4.5532, 3.0714, 0.0661, 0.6324, 3.5906, 15.9962, 57.5760}, + /* 84*/ {1.1568, 2.4353, 3.6459, 4.4064, 1.7179, 0.2648, 1.8786, 7.1749, 25.1766, 69.2821, + 0.3673, 1.5772, 3.7079, 4.8582, 2.8440, 0.0678, 0.6527, 3.7396, 17.0668, 55.9789}, + /* 85*/ {1.0909, 2.1976, 3.3831, 4.6700, 2.1277, 0.2466, 1.6707, 6.0197, 20.7657, 57.2663, + 0.3547, 1.5206, 3.5621, 5.0184, 3.0075, 0.0649, 0.6188, 3.4696, 15.6090, 49.4818}, + /* 86*/ {1.0756, 2.1630, 3.3178, 4.8852, 2.0489, 0.2402, 1.6169, 5.7644, 19.4568, 52.5009, + 0.4586, 1.7781, 3.9877, 5.7273, 1.5460, 0.0831, 0.7840, 4.3599, 20.0128, 62.1535}, + /* 87*/ {1.4282, 3.5081, 5.6767, 4.1964, 3.8946, 0.3183, 2.6889, 13.4816, 54.3866, 200.8321, + 0.8282, 2.9941, 5.6597, 4.9292, 4.2889, 0.1515, 1.6163, 9.7752, 42.8480, 190.7366}, + /* 88*/ {1.3127, 3.1243, 5.2988, 5.3891, 5.4133, 0.2887, 2.2897, 10.8276, 43.5389, 145.6109, + 1.4129, 4.4269, 7.0460, -1.0573, 8.6430, 0.2921, 3.1381, 19.6767, 102.0430, 113.9798}, + /* 89*/ {1.3128, 3.1021, 5.3385, 5.9611, 4.7562, 0.2861, 2.2509, 10.5287, 41.7796, 128.2973, + 0.7169, 2.5710, 5.1791, 6.3484, 5.6474, 0.1263, 1.2900, 7.3686, 32.4490, 118.0558}, + /* 90*/ {1.2553, 2.9178, 5.0862, 6.1206, 4.7122, 0.2701, 2.0636, 9.3051, 34.5977, 107.9200, + 0.6958, 2.4936, 5.1269, 6.6988, 5.0799, 0.1211, 1.2247, 6.9398, 30.0991, 105.1960}, + /* 91*/ {1.3218, 3.1444, 5.4371, 5.6444, 4.0107, 0.2827, 2.2250, 10.2454, 41.1162, 124.4449, + 1.2502, 4.2284, 7.0489, 1.1390, 5.8222, 0.2415, 2.6442, 16.3313, 73.5757, 91.9401}, + /* 92*/ {1.3382, 3.2043, 5.4558, 5.4839, 3.6342, 0.2838, 2.2452, 10.2519, 41.7251, 124.9023, + 0.6410, 2.2643, 4.8713, 5.9287, 5.3935, 0.1097, 1.0644, 5.7907, 25.0261, 101.3899}, + /* 93*/ {1.5193, 4.0053, 6.5327, -0.1402, 6.7489, 0.3213, 2.8206, 14.8878, 68.9103, 81.7257, + 0.6938, 2.4652, 5.1227, 5.5965, 4.8543, 0.1171, 1.1757, 6.4053, 27.5217, 103.0482}, + /* 94*/ {1.3517, 3.2937, 5.3213, 4.6466, 3.5714, 0.2813, 2.2418, 9.9952, 42.7939, 132.1739, + 0.6902, 2.4509, 5.1284, 5.0339, 4.8575, 0.1153, 1.1545, 6.2291, 27.0741, 111.3150}, + /* 95*/ {1.2135, 2.7962, 4.7545, 4.5731, 4.4786, 0.2483, 1.8437, 7.5421, 29.3841, 112.4579, + 0.7577, 2.7264, 5.4184, 4.8198, 4.1013, 0.1257, 1.3044, 7.1035, 32.4649, 118.8647}, + /* 96*/ {1.2937, 3.1100, 5.0393, 4.7546, 3.5031, 0.2638, 2.0341, 8.7101, 35.2992, 109.4972, + 0.7567, 2.7565, 5.4364, 5.1918, 3.5643, 0.1239, 1.2979, 7.0798, 32.7871, 110.1512}, + /* 97*/ {1.2915, 3.1023, 4.9309, 4.6009, 3.4661, 0.2611, 2.0023, 8.4377, 34.1559, 105.8911, + 0.7492, 2.7267, 5.3521, 5.0369, 3.5321, 0.1217, 1.2651, 6.8101, 31.6088, 106.4853}, + /* 98*/ {1.2089, 2.7391, 4.3482, 4.0047, 4.6497, 0.2421, 1.7487, 6.7262, 23.2153, 80.3108, + 0.8100, 3.0001, 5.4635, 4.1756, 3.5066, 0.1310, 1.4038, 7.6057, 34.0186, 90.5226}, +}; #endif diff --git a/src/USER-DIFFRACTION/compute_xrd.h b/src/USER-DIFFRACTION/compute_xrd.h index 8d1c113adf..636ad58028 100644 --- a/src/USER-DIFFRACTION/compute_xrd.h +++ b/src/USER-DIFFRACTION/compute_xrd.h @@ -33,28 +33,27 @@ class ComputeXRD : public Compute { double memory_usage(); private: - int me; - int *ztype; // Atomic number of the different atom types - double Min2Theta; // Minimum 2theta value (input in 2theta rad) - double Max2Theta; // Maximum 2theta value (input in 2theta rad) - double Kmax; // Maximum reciprocal distance to explore - double c[3]; // Resolution parameters for reciprocal space explored - int Knmax[3]; // maximum integer value for K points in each dimension - double dK[3]; // Parameters controlling resolution of reciprocal space explored - double prd_inv[3]; // Inverse spacing of unit cell - int LP; // Switch to turn on Lorentz-Polarization factor 1=on - bool echo; // echo compute_array progress - bool manual; // Turn on manual recpiprocal map + int me; + int *ztype; // Atomic number of the different atom types + double Min2Theta; // Minimum 2theta value (input in 2theta rad) + double Max2Theta; // Maximum 2theta value (input in 2theta rad) + double Kmax; // Maximum reciprocal distance to explore + double c[3]; // Resolution parameters for reciprocal space explored + int Knmax[3]; // maximum integer value for K points in each dimension + double dK[3]; // Parameters controlling resolution of reciprocal space explored + double prd_inv[3]; // Inverse spacing of unit cell + int LP; // Switch to turn on Lorentz-Polarization factor 1=on + bool echo; // echo compute_array progress + bool manual; // Turn on manual recpiprocal map int ntypes; int nlocalgroup; - double lambda; // Radiation wavelenght (distance units) + double lambda; // Radiation wavelenght (distance units) int radflag; int *store_tmp; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DIFFRACTION/compute_xrd_consts.h b/src/USER-DIFFRACTION/compute_xrd_consts.h index 945f0c51b7..b969600d26 100644 --- a/src/USER-DIFFRACTION/compute_xrd_consts.h +++ b/src/USER-DIFFRACTION/compute_xrd_consts.h @@ -28,479 +28,245 @@ x-ray and electron atomic scattering factors at high angles Acta Crystallogr. A 45 78693 */ -#define XRDmaxType 210 +#define XRDmaxType 210 static const char *XRDtypeList[XRDmaxType] = { - "H", "He1-", "He", "Li", "Li1+", - "Be", "Be2+", "B", "C", "Cval", - "N", "O", "O1-", "F", "F1-", - "Ne", "Na", "Na1+", "Mg", "Mg2+", - "Al", "Al3+", "Si", "Sival", "Si4+", - "P", "S", "Cl", "Cl1-", "Ar", - "K", "Ca", "Ca2+", "Sc", "Sc3+", - "Ti", "Ti2+", "Ti3+", "Ti4+", "V", - "V2+", "V3+", "V5+", "Cr", "Cr2+", - "Cr3+", "Mn", "Mn2+", "Mn3+", "Mn4+", - "Fe", "Fe2+", "Fe3+", "Co", "Co2+", - "Co", "Ni", "Ni2+", "Ni3+", "Cu", - "Cu1+", "Cu2+", "Zn", "Zn2+", "Ga", - "Ga3+", "Ge", "Ge4+", "As", "Se", - "Br", "Br1-", "Kr", "Rb", "Rb1+", - "Sr", "Sr2+", "Y", "Y3+", "Zr", - "Zr4+", "Nb", "Nb3+", "Nb5+", "Mo", - "Mo3+", "Mo5+", "Mo6+", "Tc", "Ru", - "Ru3+", "Ru4+", "Rh", "Rh3+", "Rh4+", - "Pd", "Pd2+", "Pd4+", "Ag", "Ag1+", - "Ag2+", "Cd", "Cd2+", "In", "In3+", - "Sn", "Sn2+", "Sn4+", "Sb", "Sb3+", - "Sb5+", "Te", "I", "I1-", "Xe", - "Cs", "Cs1+", "Ba", "Ba2+", "La", - "La3+", "Ce", "Ce3+", "Ce4+", "Pr", - "Pr3+", "Pr4+", "Nd", "Nd3+", "Pm", - "Pm3+", "Sm", "Sm3+", "Eu", "Eu2+", - "Eu3+", "Gd", "Gd3+", "Tb", "Tb3+", - "Dy", "Dy3+", "Ho", "Ho3+", "Er", - "Er3+", "Tm", "Tm3+", "Yb", "Yb2+", - "Yb3+", "Lu", "Lu3+", "Hf", "Hf4+", - "Ta", "Ta5+", "W", "W6+", "Re", - "Os", "Os4+", "Ir", "Ir3+", "Ir4+", - "Pt", "Pt2+", "Pt4+", "Au", "Au1+", - "Au3+", "Hg", "Hg1+", "Hg2+", "Tl", - "Tl1+", "Tl3+", "Pb", "Pb2+", "Pb4+", - "Bi", "Bi3+", "Bi5+", "Po", "At", - "Rn", "Fr", "Ra", "Ra2+", "Ac", - "Ac3+", "Th", "Th4+", "Pa", "U", - "U3+", "U4+", "U6+", "Np", "Np3+", - "Np4+", "Np6+", "Pu", "Pu3+", "Pu4+", - "Pu6+", "Am", "Cm", "Bk", "Cf"}; + "H", "He1-", "He", "Li", "Li1+", "Be", "Be2+", "B", "C", "Cval", "N", "O", + "O1-", "F", "F1-", "Ne", "Na", "Na1+", "Mg", "Mg2+", "Al", "Al3+", "Si", "Sival", + "Si4+", "P", "S", "Cl", "Cl1-", "Ar", "K", "Ca", "Ca2+", "Sc", "Sc3+", "Ti", + "Ti2+", "Ti3+", "Ti4+", "V", "V2+", "V3+", "V5+", "Cr", "Cr2+", "Cr3+", "Mn", "Mn2+", + "Mn3+", "Mn4+", "Fe", "Fe2+", "Fe3+", "Co", "Co2+", "Co", "Ni", "Ni2+", "Ni3+", "Cu", + "Cu1+", "Cu2+", "Zn", "Zn2+", "Ga", "Ga3+", "Ge", "Ge4+", "As", "Se", "Br", "Br1-", + "Kr", "Rb", "Rb1+", "Sr", "Sr2+", "Y", "Y3+", "Zr", "Zr4+", "Nb", "Nb3+", "Nb5+", + "Mo", "Mo3+", "Mo5+", "Mo6+", "Tc", "Ru", "Ru3+", "Ru4+", "Rh", "Rh3+", "Rh4+", "Pd", + "Pd2+", "Pd4+", "Ag", "Ag1+", "Ag2+", "Cd", "Cd2+", "In", "In3+", "Sn", "Sn2+", "Sn4+", + "Sb", "Sb3+", "Sb5+", "Te", "I", "I1-", "Xe", "Cs", "Cs1+", "Ba", "Ba2+", "La", + "La3+", "Ce", "Ce3+", "Ce4+", "Pr", "Pr3+", "Pr4+", "Nd", "Nd3+", "Pm", "Pm3+", "Sm", + "Sm3+", "Eu", "Eu2+", "Eu3+", "Gd", "Gd3+", "Tb", "Tb3+", "Dy", "Dy3+", "Ho", "Ho3+", + "Er", "Er3+", "Tm", "Tm3+", "Yb", "Yb2+", "Yb3+", "Lu", "Lu3+", "Hf", "Hf4+", "Ta", + "Ta5+", "W", "W6+", "Re", "Os", "Os4+", "Ir", "Ir3+", "Ir4+", "Pt", "Pt2+", "Pt4+", + "Au", "Au1+", "Au3+", "Hg", "Hg1+", "Hg2+", "Tl", "Tl1+", "Tl3+", "Pb", "Pb2+", "Pb4+", + "Bi", "Bi3+", "Bi5+", "Po", "At", "Rn", "Fr", "Ra", "Ra2+", "Ac", "Ac3+", "Th", + "Th4+", "Pa", "U", "U3+", "U4+", "U6+", "Np", "Np3+", "Np4+", "Np6+", "Pu", "Pu3+", + "Pu4+", "Pu6+", "Am", "Cm", "Bk", "Cf"}; // a list of atomic scattering factor constants for x-ray diffraction static const double ASFXRD[XRDmaxType][9] = { - /* Each set of two rows in this file contains the constants + /* Each set of two rows in this file contains the constants for 0 < sin(theta)/lambda < 2 A1, B1, A2, B2, A3, B3, A4, B4, C */ - {0.489918, 20.6593, 0.262003, 7.74039, 0.196767, - 49.5519, 0.049879, 2.20159, 0.001305}, - {0.897661, 53.1368, 0.565616, 15.187, 0.415815, - 186.576, 0.116973, 3.56709, 0.002389}, - { 0.8734, 9.1037, 0.6309, 3.3568, 0.3112, - 22.9276, 0.178, 0.9821, 0.0064}, - { 1.1282, 3.9546, 0.7508, 1.0524, 0.6175, - 85.3905, 0.4653, 68.261, 0.0377}, - { 0.6968, 4.6237, 0.7888, 1.9557, 0.3414, - 0.6316, 0.7029, 0.542, 0.0167}, - { 1.5919, 43.6427, 1.1278, 1.8623, 0.5391, - 103.483, 0.7029, 0.542, 0.0385}, - { 6.2603, 0.0027, 0.8849, 0.8313, 0.7993, - 2.2758, 0.1647, 5.1146, -6.1092}, - { 2.0545, 23.2185, 1.3326, 1.021, 1.0979, - 60.3498, 0.7068, 0.1403, -0.1932}, - { 2.31, 20.8439, 1.02, 10.2075, 1.5886, - 0.5687, 0.865, 51.6512, 0.2156}, - { 2.26069, 22.6907, 1.56165, 0.656665, 1.05075, - 9.75618, 0.839259, 55.5949, 0.286977}, - { 12.2126, 0.0057, 3.1322, 9.8933, 2.0125, - 28.9975, 1.1663, 0.5826, -11.529}, - { 3.0485, 13.2771, 2.2868, 5.7011, 1.5463, - 0.3239, 0.867, 32.9089, 0.2508}, - { 4.1916, 12.8573, 1.63969, 4.17236, 1.52673, - -47.0179, 20.307, -0.01404, 21.9412}, - { 3.5392, 10.2825, 2.6412, 4.2944, 1.517, - 0.2615, 1.0243, 26.1476, 0.2776}, - { 3.6322, 5.27756, 3.51057, 14.7353, 1.26064, - 0.442258, 0.940706, 47.3437, 0.653396}, - { 3.9553, 8.4042, 3.1125, 3.4262, 1.4546, - 0.2306, 1.1251, 21.7184, 0.3515}, - { 4.7626, 3.285, 3.1736, 8.8422, 1.2674, - 0.3136, 1.1128, 129.424, 0.676}, - { 3.2565, 2.6671, 3.9362, 6.1153, 1.3998, - 0.2001, 1.0032, 14.039, 0.404}, - { 5.4204, 2.8275, 2.1735, 79.2611, 1.2269, - 0.3808, 2.3073, 7.1937, 0.8584}, - { 3.4988, 2.1676, 3.8378, 4.7542, 1.3284, - 0.185, 0.8497, 10.1411, 0.4853}, - { 6.4202, 3.0387, 1.9002, 0.7426, 1.5936, - 31.5472, 1.9646, 85.0886, 1.1151}, - { 4.17448, 1.93816, 3.3876, 4.14553, 1.20296, - 0.228753, 0.528137, 8.28524, 0.706786}, - { 6.2915, 2.4386, 3.0353, 32.3337, 1.9891, - 0.6785, 1.541, 81.6937, 1.1407}, - { 5.66269, 2.6652, 3.07164, 38.6634, 2.62446, - 0.916946, 1.3932, 93.5458, 1.24707}, - { 4.43918, 1.64167, 3.20345, 3.43757, 1.19453, - 0.2149, 0.41653, 6.65365, 0.746297}, - { 6.4345, 1.9067, 4.1791, 27.157, 1.78, - 0.526, 1.4908, 68.1645, 1.1149}, - { 6.9053, 1.4679, 5.2034, 22.2151, 1.4379, - 0.2536, 1.5863, 56.172, 0.8669}, - { 11.4604, 0.0104, 7.1964, 1.1662, 6.2556, - 18.5194, 1.6455, 47.7784, -9.5574}, - { 18.2915, 0.0066, 7.2084, 1.1717, 6.5337, - 19.5424, 2.3386, 60.4486, -16.378}, - { 7.4845, 0.9072, 6.7723, 14.8407, 0.6539, - 43.8983, 1.6442, 33.3929, 1.4445}, - { 8.2186, 12.7949, 7.4398, 0.7748, 1.0519, - 213.187, 0.8659, 41.6841, 1.4228}, - { 8.6266, 10.4421, 7.3873, 0.6599, 1.5899, - 85.7484, 1.0211, 178.437, 1.3751}, - { 15.6348, -0.0074, 7.9518, 0.6089, 8.4372, - 10.3116, 0.8537, 25.9905, -14.875}, - { 9.189, 9.0213, 7.3679, 0.5729, 1.6409, - 136.108, 1.468, 51.3531, 1.3329}, - { 13.4008, 0.29854, 8.0273, 7.9629, 1.65943, - -0.28604, 1.57936, 16.0662, -6.6667}, - { 9.7595, 7.8508, 7.3558, 0.5, 1.6991, - 35.6338, 1.9021, 116.105, 1.2807}, - { 9.11423, 7.5243, 7.62174, 0.457585, 2.2793, - 19.5361, 0.087899, 61.6558, 0.897155}, - { 17.7344, 0.22061, 8.73816, 7.04716, 5.25691, - -0.15762, 1.92134, 15.9768, -14.652}, - { 19.5114, 0.178847, 8.23473, 6.67018, 2.01341, - -0.29263, 1.5208, 12.9464, -13.28}, - { 10.2971, 6.8657, 7.3511, 0.4385, 2.0703, - 26.8938, 2.0571, 102.478, 1.2199}, - { 10.106, 6.8818, 7.3541, 0.4409, 2.2884, - 20.3004, 0.0223, 115.122, 1.2298}, - { 9.43141, 6.39535, 7.7419, 0.383349, 2.15343, - 15.1908, 0.016865, 63.969, 0.656565}, - { 15.6887, 0.679003, 8.14208, 5.40135, 2.03081, - 9.97278, -9.576, 0.940464, 1.7143}, - { 10.6406, 6.1038, 7.3537, 0.392, 3.324, - 20.2626, 1.4922, 98.7399, 1.1832}, - { 9.54034, 5.66078, 7.7509, 0.344261, 3.58274, - 13.3075, 0.509107, 32.4224, 0.616898}, - { 9.6809, 5.59463, 7.81136, 0.334393, 2.87603, - 12.8288, 0.113575, 32.8761, 0.518275}, - { 11.2819, 5.3409, 7.3573, 0.3432, 3.0193, - 17.8674, 2.2441, 83.7543, 1.0896}, - { 10.8061, 5.2796, 7.362, 0.3435, 3.5268, - 14.343, 0.2184, 41.3235, 1.0874}, - { 9.84521, 4.91797, 7.87194, 0.294393, 3.56531, - 10.8171, 0.323613, 24.1281, 0.393974}, - { 9.96253, 4.8485, 7.97057, 0.283303, 2.76067, - 10.4852, 0.054447, 27.573, 0.251877}, - { 11.7695, 4.7611, 7.3573, 0.3072, 3.5222, - 15.3535, 2.3045, 76.8805, 1.0369}, - { 11.0424, 4.6538, 7.374, 0.3053, 4.1346, - 12.0546, 0.4399, 31.2809, 1.0097}, - { 11.1764, 4.6147, 7.3863, 0.3005, 3.3948, - 11.6729, 0.0724, 38.5566, 0.9707}, - { 12.2841, 4.2791, 7.3409, 0.2784, 4.0034, - 13.5359, 2.3488, 71.1692, 1.0118}, - { 11.2296, 4.1231, 7.3883, 0.2726, 4.7393, - 10.2443, 0.7108, 25.6466, 0.9324}, - { 10.338, 3.90969, 7.88173, 0.238668, 4.76795, - 8.35583, 0.725591, 18.3491, 0.286667}, - { 12.8376, 3.8785, 7.292, 0.2565, 4.4438, - 12.1763, 2.38, 66.3421, 1.0341}, - { 11.4166, 3.6766, 7.4005, 0.2449, 5.3442, - 8.873, 0.9773, 22.1626, 0.8614}, - { 10.7806, 3.5477, 7.75868, 0.22314, 5.22746, - 7.64468, 0.847114, 16.9673, 0.386044}, - { 13.338, 3.5828, 7.1676, 0.247, 5.6158, - 11.3966, 1.6735, 64.8126, 1.191}, - { 11.9475, 3.3669, 7.3573, 0.2274, 6.2455, - 8.6625, 1.5578, 25.8487, 0.89}, - { 11.8168, 3.37484, 7.11181, 0.244078, 5.78135, - 7.9876, 1.14523, 19.897, 1.14431}, - { 14.0743, 3.2655, 7.0318, 0.2333, 5.1652, - 10.3163, 2.41, 58.7097, 1.3041}, - { 11.9719, 2.9946, 7.3862, 0.2031, 6.4668, - 7.0826, 1.394, 18.0995, 0.7807}, - { 15.2354, 3.0669, 6.7006, 0.2412, 4.3591, - 10.7805, 2.9623, 61.4135, 1.7189}, - { 12.692, 2.81262, 6.69883, 0.22789, 6.06692, - 6.36441, 1.0066, 14.4122, 1.53545}, - { 16.0816, 2.8509, 6.3747, 0.2516, 3.7068, - 11.4468, 3.683, 54.7625, 2.1313}, - { 12.9172, 2.53718, 6.70003, 0.205855, 6.06791, - 5.47913, 0.859041, 11.603, 1.45572}, - { 16.6723, 2.6345, 6.0701, 0.2647, 3.4313, - 12.9479, 4.2779, 47.7972, 2.531}, - { 17.0006, 2.4098, 5.8196, 0.2726, 3.9731, - 15.2372, 4.3543, 43.8163, 2.8409}, - { 17.1789, 2.1723, 5.2358, 16.5796, 5.6377, - 0.2609, 3.9851, 41.4328, 2.9557}, - { 17.1718, 2.2059, 6.3338, 19.3345, 5.5754, - 0.2871, 3.7272, 58.1535, 3.1776}, - { 17.3555, 1.9384, 6.7286, 16.5623, 5.5493, - 0.2261, 3.5375, 39.3972, 2.825}, - { 17.1784, 1.7888, 9.6435, 17.3151, 5.1399, - 0.2748, 1.5292, 164.934, 3.4873}, - { 17.5816, 1.7139, 7.6598, 14.7957, 5.8981, - 0.1603, 2.7817, 31.2087, 2.0782}, - { 17.5663, 1.5564, 9.8184, 14.0988, 5.422, - 0.1664, 2.6694, 132.376, 2.5064}, - { 18.0874, 1.4907, 8.1373, 12.6963, 2.5654, - -24.5651, 34.193, -0.0138, 41.4025}, - { 17.776, 1.4029, 10.2946, 12.8006, 5.72629, - 0.125599, 3.26588, 104.354, 1.91213}, - { 17.9268, 1.35417, 9.1531, 11.2145, 1.76795, - -22.6599, 33.108, -0.01319, 40.2602}, - { 17.8765, 1.27618, 10.948, 11.916, 5.41732, - 0.117622, 3.65721, 87.6627, 2.06929}, - { 18.1668, 1.2148, 10.0562, 10.1483, 1.01118, - 21.6054, -2.6479, -0.10276, 9.41454}, - { 17.6142, 1.18865, 12.0144, 11.766, 4.04183, - 0.204785, 3.53346, 69.7957, 3.75591}, - { 19.8812, 0.019175, 18.0653, 1.13305, 11.0177, - 10.1621, 1.94715, 28.3389, -12.912}, - { 17.9163, 1.12446, 13.3417, 0.028781, 10.799, - 9.28206, 0.337905, 25.7228, -6.3934}, - { 3.7025, 0.2772, 17.2356, 1.0958, 12.8876, - 11.004, 3.7429, 61.6584, 4.3875}, - { 21.1664, 0.014734, 18.2017, 1.03031, 11.7423, - 9.53659, 2.30951, 26.6307, -14.421}, - { 21.0149, 0.014345, 18.0992, 1.02238, 11.4632, - 8.78809, 0.740625, 23.3452, -14.316}, - { 17.8871, 1.03649, 11.175, 8.48061, 6.57891, - 0.058881, 0, 0, 0.344941}, - { 19.1301, 0.864132, 11.0948, 8.14487, 4.64901, - 21.5707, 2.71263, 86.8472, 5.40428}, - { 19.2674, 0.80852, 12.9182, 8.43467, 4.86337, - 24.7997, 1.56756, 94.2928, 5.37814}, - { 18.5638, 0.847329, 13.2885, 8.37164, 9.32602, - 0.017662, 3.00964, 22.887, -3.1892}, - { 18.5003, 0.844582, 13.1787, 8.12534, 4.71304, - 0.36495, 2.18535, 20.8504, 1.42357}, - { 19.2957, 0.751536, 14.3501, 8.21758, 4.73425, - 25.8749, 1.28918, 98.6062, 5.328}, - { 18.8785, 0.764252, 14.1259, 7.84438, 3.32515, - 21.2487, -6.1989, -0.01036, 11.8678}, - { 18.8545, 0.760825, 13.9806, 7.62436, 2.53464, - 19.3317, -5.6526, -0.0102, 11.2835}, - { 19.3319, 0.698655, 15.5017, 7.98929, 5.29537, - 25.2052, 0.605844, 76.8986, 5.26593}, - { 19.1701, 0.696219, 15.2096, 7.55573, 4.32234, - 22.5057, 0, 0, 5.2916}, - { 19.2493, 0.683839, 14.79, 7.14833, 2.89289, - 17.9144, -7.9492, 0.005127, 13.0174}, - { 19.2808, 0.6446, 16.6885, 7.4726, 4.8045, - 24.6605, 1.0463, 99.8156, 5.179}, - { 19.1812, 0.646179, 15.9719, 7.19123, 5.27475, - 21.7326, 0.357534, 66.1147, 5.21572}, - { 19.1643, 0.645643, 16.2456, 7.18544, 4.3709, - 21.4072, 0, 0, 5.21404}, - { 19.2214, 0.5946, 17.6444, 6.9089, 4.461, - 24.7008, 1.6029, 87.4825, 5.0694}, - { 19.1514, 0.597922, 17.2535, 6.80639, 4.47128, - 20.2521, 0, 0, 5.11937}, - { 19.1624, 0.5476, 18.5596, 6.3776, 4.2948, - 25.8499, 2.0396, 92.8029, 4.9391}, - { 19.1045, 0.551522, 18.1108, 6.3247, 3.78897, - 17.3595, 0, 0, 4.99635}, - { 19.1889, 5.8303, 19.1005, 0.5031, 4.4585, - 26.8909, 2.4663, 83.9571, 4.7821}, - { 19.1094, 0.5036, 19.0548, 5.8378, 4.5648, - 23.3752, 0.487, 62.2061, 4.7861}, - { 18.9333, 5.764, 19.7131, 0.4655, 3.4182, - 14.0049, 0.0193, -0.7583, 3.9182}, - { 19.6418, 5.3034, 19.0455, 0.4607, 5.0371, - 27.9074, 2.6827, 75.2825, 4.5909}, - { 18.9755, 0.467196, 18.933, 5.22126, 5.10789, - 19.5902, 0.288753, 55.5113, 4.69626}, - { 19.8685, 5.44853, 19.0302, 0.467973, 2.41253, - 14.1259, 0, 0, 4.69263}, - { 19.9644, 4.81742, 19.0138, 0.420885, 6.14487, - 28.5284, 2.5239, 70.8403, 4.352}, - { 20.1472, 4.347, 18.9949, 0.3814, 7.5138, - 27.766, 2.2735, 66.8776, 4.0712}, - { 20.2332, 4.3579, 18.997, 0.3815, 7.8069, - 29.5259, 2.8868, 84.9304, 4.0714}, - { 20.2933, 3.9282, 19.0298, 0.344, 8.9767, - 26.4659, 1.99, 64.2658, 3.7118}, - { 20.3892, 3.569, 19.1062, 0.3107, 10.662, - 24.3879, 1.4953, 213.904, 3.3352}, - { 20.3524, 3.552, 19.1278, 0.3086, 10.2821, - 23.7128, 0.9615, 59.4565, 3.2791}, - { 20.3361, 3.216, 19.297, 0.2756, 10.888, - 20.2073, 2.6959, 167.202, 2.7731}, - { 20.1807, 3.21367, 19.1136, 0.28331, 10.9054, - 20.0558, 0.77634, 51.746, 3.02902}, - { 20.578, 2.94817, 19.599, 0.244475, 11.3727, - 18.7726, 3.28719, 133.124, 2.14678}, - { 20.2489, 2.9207, 19.3763, 0.250698, 11.6323, - 17.8211, 0.336048, 54.9453, 2.4086}, - { 21.1671, 2.81219, 19.7695, 0.226836, 11.8513, - 17.6083, 3.33049, 127.113, 1.86264}, - { 20.8036, 2.77691, 19.559, 0.23154, 11.9369, - 16.5408, 0.612376, 43.1692, 2.09013}, - { 20.3235, 2.65941, 19.8186, 0.21885, 12.1233, - 15.7992, 0.144583, 62.2355, 1.5918}, - { 22.044, 2.77393, 19.6697, 0.222087, 12.3856, - 16.7669, 2.82428, 143.644, 2.0583}, - { 21.3727, 2.6452, 19.7491, 0.214299, 12.1329, - 15.323, 0.97518, 36.4065, 1.77132}, - { 20.9413, 2.54467, 20.0539, 0.202481, 12.4668, - 14.8137, 0.296689, 45.4643, 1.24285}, - { 22.6845, 2.66248, 19.6847, 0.210628, 12.774, - 15.885, 2.85137, 137.903, 1.98486}, - { 21.961, 2.52722, 19.9339, 0.199237, 12.12, - 14.1783, 1.51031, 30.8717, 1.47588}, - { 23.3405, 2.5627, 19.6095, 0.202088, 13.1235, - 15.1009, 2.87516, 132.721, 2.02876}, - { 22.5527, 2.4174, 20.1108, 0.185769, 12.0671, - 13.1275, 2.07492, 27.4491, 1.19499}, - { 24.0042, 2.47274, 19.4258, 0.196451, 13.4396, - 14.3996, 2.89604, 128.007, 2.20963}, - { 23.1504, 2.31641, 20.2599, 0.174081, 11.9202, - 12.1571, 2.71488, 24.8242, 0.954586}, - { 24.6274, 2.3879, 19.0886, 0.1942, 13.7603, - 13.7546, 2.9227, 123.174, 2.5745}, - { 24.0063, 2.27783, 19.9504, 0.17353, 11.8034, - 11.6096, 3.87243, 26.5156, 1.36389}, - { 23.7497, 2.22258, 20.3745, 0.16394, 11.8509, - 11.311, 3.26503, 22.9966, 0.759344}, - { 25.0709, 2.25341, 19.0798, 0.181951, 13.8518, - 12.9331, 3.54545, 101.398, 2.4196}, - { 24.3466, 2.13553, 20.4208, 0.155525, 11.8708, - 10.5782, 3.7149, 21.7029, 0.645089}, - { 25.8976, 2.24256, 18.2185, 0.196143, 14.3167, - 12.6648, 2.95354, 115.362, 3.58324}, - { 24.9559, 2.05601, 20.3271, 0.149525, 12.2471, - 10.0499, 3.773, 21.2773, 0.691967}, - { 26.507, 2.1802, 17.6383, 0.202172, 14.5596, - 12.1899, 2.96577, 111.874, 4.29728}, - { 25.5395, 1.9804, 20.2861, 0.143384, 11.9812, - 9.34972, 4.50073, 19.581, 0.68969}, - { 26.9049, 2.07051, 17.294, 0.19794, 14.5583, - 11.4407, 3.63837, 92.6566, 4.56796}, - { 26.1296, 1.91072, 20.0994, 0.139358, 11.9788, - 8.80018, 4.93676, 18.5908, 0.852795}, - { 27.6563, 2.07356, 16.4285, 0.223545, 14.9779, - 11.3604, 2.98233, 105.703, 5.92046}, - { 26.722, 1.84659, 19.7748, 0.13729, 12.1506, - 8.36225, 5.17379, 17.8974, 1.17613}, - { 28.1819, 2.02859, 15.8851, 0.238849, 15.1542, - 10.9975, 2.98706, 102.961, 1.63929}, - { 27.3083, 1.78711, 19.332, 0.136974, 12.3339, - 7.96778, 5.38348, 17.2922, 1.63929}, - { 28.6641, 1.9889, 15.4345, 0.257119, 15.3087, - 10.6647, 2.98963, 100.417, 7.56672}, - { 28.1209, 1.78503, 17.6817, 0.15997, 13.3335, - 8.18304, 5.14657, 20.39, 3.70983}, - { 27.8917, 1.73272, 18.7614, 0.13879, 12.6072, - 7.64412, 5.47647, 16.8153, 2.26001}, - { 28.9476, 1.90182, 15.2208, 9.98519, 15.1, - 0.261033, 3.71601, 84.3298, 7.97628}, - { 28.4628, 1.68216, 18.121, 0.142292, 12.8429, - 7.33727, 5.59415, 16.3535, 2.97573}, - { 29.144, 1.83262, 15.1726, 9.5999, 14.7586, - 0.275116, 4.30013, 72.029, 8.58154}, - { 28.8131, 1.59136, 18.4601, 0.128903, 12.7285, - 6.76232, 5.59927, 14.0366, 2.39699}, - { 29.2024, 1.77333, 15.2293, 9.37046, 14.5135, - 0.295977, 4.76492, 63.3644, 9.24354}, - { 29.1587, 1.50711, 18.8407, 0.116741, 12.8268, - 6.31524, 5.38695, 12.4244, 1.78555}, - { 29.0818, 1.72029, 15.43, 9.2259, 14.4327, - 0.321703, 5.11982, 57.056, 9.8875}, - { 29.4936, 1.42755, 19.3763, 0.104621, 13.0544, - 5.93667, 5.06412, 11.1972, 1.01074}, - { 28.7621, 1.67191, 15.7189, 9.09227, 14.5564, - 0.3505, 5.44174, 52.0861, 10.472}, - { 28.1894, 1.62903, 16.155, 8.97948, 14.9305, - 0.382661, 5.67589, 48.1647, 11.0005}, - { 30.419, 1.37113, 15.2637, 6.84706, 14.7458, - 0.165191, 5.06795, 18.003, 6.49804}, - { 27.3049, 1.59279, 16.7296, 8.86553, 15.6115, - 0.417916, 5.83377, 45.0011, 11.4722}, - { 30.4156, 1.34323, 15.862, 7.10909, 13.6145, - 0.204633, 5.82008, 20.3254, 8.27903}, - { 30.7058, 1.30923, 15.5512, 6.71983, 14.2326, - 0.167252, 5.53672, 17.4911, 6.96824}, - { 27.0059, 1.51293, 17.7639, 8.81174, 15.7131, - 0.424593, 5.7837, 38.6103, 11.6883}, - { 29.8429, 1.32927, 16.7224, 7.38979, 13.2153, - 0.263297, 6.35234, 22.9426, 9.85329}, - { 30.9612, 1.24813, 15.9829, 6.60834, 13.7348, - 0.16864, 5.92034, 16.9392, 7.39534}, - { 16.8819, 0.4611, 18.5913, 8.6216, 25.5582, - 1.4826, 5.86, 36.3956, 12.0658}, - { 28.0109, 1.35321, 17.8204, 7.7395, 14.3359, - 0.356752, 6.58077, 26.4043, 11.2299}, - { 30.6886, 1.2199, 16.9029, 6.82872, 12.7801, - 0.212867, 6.52354, 18.659, 9.0968}, - { 20.6809, 0.545, 19.0417, 8.4484, 21.6575, - 1.5729, 5.9676, 38.3246, 12.6089}, - { 25.0853, 1.39507, 18.4973, 7.65105, 16.8883, - 0.443378, 6.48216, 28.2262, 12.0205}, - { 29.5641, 1.21152, 18.06, 7.05639, 12.8374, - 0.284738, 6.89912, 20.7482, 10.6268}, - { 27.5446, 0.65515, 19.1584, 8.70751, 15.538, - 1.96347, 5.52593, 45.8149, 13.1746}, - { 21.3985, 1.4711, 20.4723, 0.517394, 18.7478, - 7.43463, 6.82847, 28.8482, 12.5258}, - { 30.8695, 1.1008, 18.3481, 6.53852, 11.9328, - 0.219074, 7.00574, 17.2114, 9.8027}, - { 31.0617, 0.6902, 13.0637, 2.3576, 18.442, - 8.618, 5.9696, 47.2579, 13.4118}, - { 21.7886, 1.3366, 19.5682, 0.488383, 19.1406, - 6.7727, 7.01107, 23.8132, 12.4734}, - { 32.1244, 1.00566, 18.8003, 6.10926, 12.0175, - 0.147041, 6.96886, 14.714, 8.08428}, - { 33.3689, 0.704, 12.951, 2.9238, 16.5877, - 8.7937, 6.4692, 48.0093, 13.5782}, - { 21.8053, 1.2356, 19.5026, 6.24149, 19.1053, - 0.469999, 7.10295, 20.3185, 12.4711}, - { 33.5364, 0.91654, 25.0946, 0.39042, 19.2497, - 5.71414, 6.91555, 12.8285, 6.7994}, - { 34.6726, 0.700999, 15.4733, 3.55078, 13.1138, - 9.55642, 7.02588, 47.0045, 13.677}, - { 35.3163, 0.68587, 19.0211, 3.97458, 9.49887, - 11.3824, 7.42518, 45.4715, 13.7108}, - { 35.5631, 0.6631, 21.2816, 4.0691, 8.0037, - 14.0422, 7.4433, 44.2473, 13.6905}, - { 35.9299, 0.646453, 23.0547, 4.17619, 12.1439, - 23.1052, 2.11253, 150.645, 13.7247}, - { 35.763, 0.616341, 22.9064, 3.87135, 12.4739, - 19.9887, 3.21097, 142.325, 13.6211}, - { 35.215, 0.604909, 21.67, 3.5767, 7.91342, - 12.601, 7.65078, 29.8436, 13.5431}, - { 35.6597, 0.589092, 23.1032, 3.65155, 12.5977, - 18.599, 4.08655, 117.02, 13.5266}, - { 35.1736, 0.579689, 22.1112, 3.41437, 8.19216, - 12.9187, 7.05545, 25.9443, 13.4637}, - { 35.5645, 0.563359, 23.4219, 3.46204, 12.7473, - 17.8309, 4.80703, 99.1722, 13.4314}, - { 35.1007, 0.555054, 22.4418, 3.24498, 9.78554, - 13.4661, 5.29444, 23.9533, 13.376}, - { 35.8847, 0.547751, 23.2948, 3.41519, 14.1891, - 16.9235, 4.17287, 105.251, 13.4287}, - { 36.0228, 0.5293, 23.4128, 3.3253, 14.9491, - 16.0927, 4.188, 100.613, 13.3966}, - { 35.5747, 0.52048, 22.5259, 3.12293, 12.2165, - 12.7148, 5.37073, 26.3394, 13.3092}, - { 35.3715, 0.516598, 22.5326, 3.05053, 12.0291, - 12.5723, 4.7984, 23.4582, 13.2671}, - { 34.8509, 0.507079, 22.7584, 2.8903, 14.0099, - 13.1767, 1.21457, 25.2017, 13.1665}, - { 36.1874, 0.511929, 23.5964, 3.25396, 15.6402, - 15.3622, 4.1855, 97.4908, 13.3573}, - { 35.7074, 0.502322, 22.613, 3.03807, 12.9898, - 12.1449, 5.43227, 25.4928, 13.2544}, - { 35.5103, 0.498626, 22.5787, 2.96627, 12.7766, - 11.9484, 4.92159, 22.7502, 13.2116}, - { 35.0136, 0.48981, 22.7286, 2.81099, 14.3884, - 12.33, 1.75669, 22.6581, 13.113}, - { 36.5254, 0.499384, 23.8083, 3.26371, 16.7707, - 14.9455, 3.47947, 105.98, 13.3812}, - { 35.84, 0.484938, 22.7169, 2.96118, 13.5807, - 11.5331, 5.66016, 24.3992, 13.1991}, - { 35.6493, 0.481422, 22.646, 2.8902, 13.3595, - 11.316, 5.18831, 21.8301, 13.1555}, - { 35.1736, 0.473204, 22.7181, 2.73848, 14.7635, - 11.553, 2.28678, 20.9303, 13.0582}, - { 36.6706, 0.483629, 24.0992, 3.20647, 17.3415, - 14.3136, 3.49331, 102.273, 13.3592}, - { 36.6488, 0.465154, 24.4096, 3.08997, 17.399, - 13.4346, 4.21665, 88.4834, 13.2887}, - { 36.7881, 0.451018, 24.7736, 3.04619, 17.8919, - 12.8946, 4.23284, 86.003, 13.2754}, - { 36.9185, 0.437533, 25.1995, 3.00775, 18.3317, - 12.4044, 4.24391, 83.7881, 13.2674}, - }; + {0.489918, 20.6593, 0.262003, 7.74039, 0.196767, 49.5519, 0.049879, 2.20159, 0.001305}, + {0.897661, 53.1368, 0.565616, 15.187, 0.415815, 186.576, 0.116973, 3.56709, 0.002389}, + {0.8734, 9.1037, 0.6309, 3.3568, 0.3112, 22.9276, 0.178, 0.9821, 0.0064}, + {1.1282, 3.9546, 0.7508, 1.0524, 0.6175, 85.3905, 0.4653, 68.261, 0.0377}, + {0.6968, 4.6237, 0.7888, 1.9557, 0.3414, 0.6316, 0.7029, 0.542, 0.0167}, + {1.5919, 43.6427, 1.1278, 1.8623, 0.5391, 103.483, 0.7029, 0.542, 0.0385}, + {6.2603, 0.0027, 0.8849, 0.8313, 0.7993, 2.2758, 0.1647, 5.1146, -6.1092}, + {2.0545, 23.2185, 1.3326, 1.021, 1.0979, 60.3498, 0.7068, 0.1403, -0.1932}, + {2.31, 20.8439, 1.02, 10.2075, 1.5886, 0.5687, 0.865, 51.6512, 0.2156}, + {2.26069, 22.6907, 1.56165, 0.656665, 1.05075, 9.75618, 0.839259, 55.5949, 0.286977}, + {12.2126, 0.0057, 3.1322, 9.8933, 2.0125, 28.9975, 1.1663, 0.5826, -11.529}, + {3.0485, 13.2771, 2.2868, 5.7011, 1.5463, 0.3239, 0.867, 32.9089, 0.2508}, + {4.1916, 12.8573, 1.63969, 4.17236, 1.52673, -47.0179, 20.307, -0.01404, 21.9412}, + {3.5392, 10.2825, 2.6412, 4.2944, 1.517, 0.2615, 1.0243, 26.1476, 0.2776}, + {3.6322, 5.27756, 3.51057, 14.7353, 1.26064, 0.442258, 0.940706, 47.3437, 0.653396}, + {3.9553, 8.4042, 3.1125, 3.4262, 1.4546, 0.2306, 1.1251, 21.7184, 0.3515}, + {4.7626, 3.285, 3.1736, 8.8422, 1.2674, 0.3136, 1.1128, 129.424, 0.676}, + {3.2565, 2.6671, 3.9362, 6.1153, 1.3998, 0.2001, 1.0032, 14.039, 0.404}, + {5.4204, 2.8275, 2.1735, 79.2611, 1.2269, 0.3808, 2.3073, 7.1937, 0.8584}, + {3.4988, 2.1676, 3.8378, 4.7542, 1.3284, 0.185, 0.8497, 10.1411, 0.4853}, + {6.4202, 3.0387, 1.9002, 0.7426, 1.5936, 31.5472, 1.9646, 85.0886, 1.1151}, + {4.17448, 1.93816, 3.3876, 4.14553, 1.20296, 0.228753, 0.528137, 8.28524, 0.706786}, + {6.2915, 2.4386, 3.0353, 32.3337, 1.9891, 0.6785, 1.541, 81.6937, 1.1407}, + {5.66269, 2.6652, 3.07164, 38.6634, 2.62446, 0.916946, 1.3932, 93.5458, 1.24707}, + {4.43918, 1.64167, 3.20345, 3.43757, 1.19453, 0.2149, 0.41653, 6.65365, 0.746297}, + {6.4345, 1.9067, 4.1791, 27.157, 1.78, 0.526, 1.4908, 68.1645, 1.1149}, + {6.9053, 1.4679, 5.2034, 22.2151, 1.4379, 0.2536, 1.5863, 56.172, 0.8669}, + {11.4604, 0.0104, 7.1964, 1.1662, 6.2556, 18.5194, 1.6455, 47.7784, -9.5574}, + {18.2915, 0.0066, 7.2084, 1.1717, 6.5337, 19.5424, 2.3386, 60.4486, -16.378}, + {7.4845, 0.9072, 6.7723, 14.8407, 0.6539, 43.8983, 1.6442, 33.3929, 1.4445}, + {8.2186, 12.7949, 7.4398, 0.7748, 1.0519, 213.187, 0.8659, 41.6841, 1.4228}, + {8.6266, 10.4421, 7.3873, 0.6599, 1.5899, 85.7484, 1.0211, 178.437, 1.3751}, + {15.6348, -0.0074, 7.9518, 0.6089, 8.4372, 10.3116, 0.8537, 25.9905, -14.875}, + {9.189, 9.0213, 7.3679, 0.5729, 1.6409, 136.108, 1.468, 51.3531, 1.3329}, + {13.4008, 0.29854, 8.0273, 7.9629, 1.65943, -0.28604, 1.57936, 16.0662, -6.6667}, + {9.7595, 7.8508, 7.3558, 0.5, 1.6991, 35.6338, 1.9021, 116.105, 1.2807}, + {9.11423, 7.5243, 7.62174, 0.457585, 2.2793, 19.5361, 0.087899, 61.6558, 0.897155}, + {17.7344, 0.22061, 8.73816, 7.04716, 5.25691, -0.15762, 1.92134, 15.9768, -14.652}, + {19.5114, 0.178847, 8.23473, 6.67018, 2.01341, -0.29263, 1.5208, 12.9464, -13.28}, + {10.2971, 6.8657, 7.3511, 0.4385, 2.0703, 26.8938, 2.0571, 102.478, 1.2199}, + {10.106, 6.8818, 7.3541, 0.4409, 2.2884, 20.3004, 0.0223, 115.122, 1.2298}, + {9.43141, 6.39535, 7.7419, 0.383349, 2.15343, 15.1908, 0.016865, 63.969, 0.656565}, + {15.6887, 0.679003, 8.14208, 5.40135, 2.03081, 9.97278, -9.576, 0.940464, 1.7143}, + {10.6406, 6.1038, 7.3537, 0.392, 3.324, 20.2626, 1.4922, 98.7399, 1.1832}, + {9.54034, 5.66078, 7.7509, 0.344261, 3.58274, 13.3075, 0.509107, 32.4224, 0.616898}, + {9.6809, 5.59463, 7.81136, 0.334393, 2.87603, 12.8288, 0.113575, 32.8761, 0.518275}, + {11.2819, 5.3409, 7.3573, 0.3432, 3.0193, 17.8674, 2.2441, 83.7543, 1.0896}, + {10.8061, 5.2796, 7.362, 0.3435, 3.5268, 14.343, 0.2184, 41.3235, 1.0874}, + {9.84521, 4.91797, 7.87194, 0.294393, 3.56531, 10.8171, 0.323613, 24.1281, 0.393974}, + {9.96253, 4.8485, 7.97057, 0.283303, 2.76067, 10.4852, 0.054447, 27.573, 0.251877}, + {11.7695, 4.7611, 7.3573, 0.3072, 3.5222, 15.3535, 2.3045, 76.8805, 1.0369}, + {11.0424, 4.6538, 7.374, 0.3053, 4.1346, 12.0546, 0.4399, 31.2809, 1.0097}, + {11.1764, 4.6147, 7.3863, 0.3005, 3.3948, 11.6729, 0.0724, 38.5566, 0.9707}, + {12.2841, 4.2791, 7.3409, 0.2784, 4.0034, 13.5359, 2.3488, 71.1692, 1.0118}, + {11.2296, 4.1231, 7.3883, 0.2726, 4.7393, 10.2443, 0.7108, 25.6466, 0.9324}, + {10.338, 3.90969, 7.88173, 0.238668, 4.76795, 8.35583, 0.725591, 18.3491, 0.286667}, + {12.8376, 3.8785, 7.292, 0.2565, 4.4438, 12.1763, 2.38, 66.3421, 1.0341}, + {11.4166, 3.6766, 7.4005, 0.2449, 5.3442, 8.873, 0.9773, 22.1626, 0.8614}, + {10.7806, 3.5477, 7.75868, 0.22314, 5.22746, 7.64468, 0.847114, 16.9673, 0.386044}, + {13.338, 3.5828, 7.1676, 0.247, 5.6158, 11.3966, 1.6735, 64.8126, 1.191}, + {11.9475, 3.3669, 7.3573, 0.2274, 6.2455, 8.6625, 1.5578, 25.8487, 0.89}, + {11.8168, 3.37484, 7.11181, 0.244078, 5.78135, 7.9876, 1.14523, 19.897, 1.14431}, + {14.0743, 3.2655, 7.0318, 0.2333, 5.1652, 10.3163, 2.41, 58.7097, 1.3041}, + {11.9719, 2.9946, 7.3862, 0.2031, 6.4668, 7.0826, 1.394, 18.0995, 0.7807}, + {15.2354, 3.0669, 6.7006, 0.2412, 4.3591, 10.7805, 2.9623, 61.4135, 1.7189}, + {12.692, 2.81262, 6.69883, 0.22789, 6.06692, 6.36441, 1.0066, 14.4122, 1.53545}, + {16.0816, 2.8509, 6.3747, 0.2516, 3.7068, 11.4468, 3.683, 54.7625, 2.1313}, + {12.9172, 2.53718, 6.70003, 0.205855, 6.06791, 5.47913, 0.859041, 11.603, 1.45572}, + {16.6723, 2.6345, 6.0701, 0.2647, 3.4313, 12.9479, 4.2779, 47.7972, 2.531}, + {17.0006, 2.4098, 5.8196, 0.2726, 3.9731, 15.2372, 4.3543, 43.8163, 2.8409}, + {17.1789, 2.1723, 5.2358, 16.5796, 5.6377, 0.2609, 3.9851, 41.4328, 2.9557}, + {17.1718, 2.2059, 6.3338, 19.3345, 5.5754, 0.2871, 3.7272, 58.1535, 3.1776}, + {17.3555, 1.9384, 6.7286, 16.5623, 5.5493, 0.2261, 3.5375, 39.3972, 2.825}, + {17.1784, 1.7888, 9.6435, 17.3151, 5.1399, 0.2748, 1.5292, 164.934, 3.4873}, + {17.5816, 1.7139, 7.6598, 14.7957, 5.8981, 0.1603, 2.7817, 31.2087, 2.0782}, + {17.5663, 1.5564, 9.8184, 14.0988, 5.422, 0.1664, 2.6694, 132.376, 2.5064}, + {18.0874, 1.4907, 8.1373, 12.6963, 2.5654, -24.5651, 34.193, -0.0138, 41.4025}, + {17.776, 1.4029, 10.2946, 12.8006, 5.72629, 0.125599, 3.26588, 104.354, 1.91213}, + {17.9268, 1.35417, 9.1531, 11.2145, 1.76795, -22.6599, 33.108, -0.01319, 40.2602}, + {17.8765, 1.27618, 10.948, 11.916, 5.41732, 0.117622, 3.65721, 87.6627, 2.06929}, + {18.1668, 1.2148, 10.0562, 10.1483, 1.01118, 21.6054, -2.6479, -0.10276, 9.41454}, + {17.6142, 1.18865, 12.0144, 11.766, 4.04183, 0.204785, 3.53346, 69.7957, 3.75591}, + {19.8812, 0.019175, 18.0653, 1.13305, 11.0177, 10.1621, 1.94715, 28.3389, -12.912}, + {17.9163, 1.12446, 13.3417, 0.028781, 10.799, 9.28206, 0.337905, 25.7228, -6.3934}, + {3.7025, 0.2772, 17.2356, 1.0958, 12.8876, 11.004, 3.7429, 61.6584, 4.3875}, + {21.1664, 0.014734, 18.2017, 1.03031, 11.7423, 9.53659, 2.30951, 26.6307, -14.421}, + {21.0149, 0.014345, 18.0992, 1.02238, 11.4632, 8.78809, 0.740625, 23.3452, -14.316}, + {17.8871, 1.03649, 11.175, 8.48061, 6.57891, 0.058881, 0, 0, 0.344941}, + {19.1301, 0.864132, 11.0948, 8.14487, 4.64901, 21.5707, 2.71263, 86.8472, 5.40428}, + {19.2674, 0.80852, 12.9182, 8.43467, 4.86337, 24.7997, 1.56756, 94.2928, 5.37814}, + {18.5638, 0.847329, 13.2885, 8.37164, 9.32602, 0.017662, 3.00964, 22.887, -3.1892}, + {18.5003, 0.844582, 13.1787, 8.12534, 4.71304, 0.36495, 2.18535, 20.8504, 1.42357}, + {19.2957, 0.751536, 14.3501, 8.21758, 4.73425, 25.8749, 1.28918, 98.6062, 5.328}, + {18.8785, 0.764252, 14.1259, 7.84438, 3.32515, 21.2487, -6.1989, -0.01036, 11.8678}, + {18.8545, 0.760825, 13.9806, 7.62436, 2.53464, 19.3317, -5.6526, -0.0102, 11.2835}, + {19.3319, 0.698655, 15.5017, 7.98929, 5.29537, 25.2052, 0.605844, 76.8986, 5.26593}, + {19.1701, 0.696219, 15.2096, 7.55573, 4.32234, 22.5057, 0, 0, 5.2916}, + {19.2493, 0.683839, 14.79, 7.14833, 2.89289, 17.9144, -7.9492, 0.005127, 13.0174}, + {19.2808, 0.6446, 16.6885, 7.4726, 4.8045, 24.6605, 1.0463, 99.8156, 5.179}, + {19.1812, 0.646179, 15.9719, 7.19123, 5.27475, 21.7326, 0.357534, 66.1147, 5.21572}, + {19.1643, 0.645643, 16.2456, 7.18544, 4.3709, 21.4072, 0, 0, 5.21404}, + {19.2214, 0.5946, 17.6444, 6.9089, 4.461, 24.7008, 1.6029, 87.4825, 5.0694}, + {19.1514, 0.597922, 17.2535, 6.80639, 4.47128, 20.2521, 0, 0, 5.11937}, + {19.1624, 0.5476, 18.5596, 6.3776, 4.2948, 25.8499, 2.0396, 92.8029, 4.9391}, + {19.1045, 0.551522, 18.1108, 6.3247, 3.78897, 17.3595, 0, 0, 4.99635}, + {19.1889, 5.8303, 19.1005, 0.5031, 4.4585, 26.8909, 2.4663, 83.9571, 4.7821}, + {19.1094, 0.5036, 19.0548, 5.8378, 4.5648, 23.3752, 0.487, 62.2061, 4.7861}, + {18.9333, 5.764, 19.7131, 0.4655, 3.4182, 14.0049, 0.0193, -0.7583, 3.9182}, + {19.6418, 5.3034, 19.0455, 0.4607, 5.0371, 27.9074, 2.6827, 75.2825, 4.5909}, + {18.9755, 0.467196, 18.933, 5.22126, 5.10789, 19.5902, 0.288753, 55.5113, 4.69626}, + {19.8685, 5.44853, 19.0302, 0.467973, 2.41253, 14.1259, 0, 0, 4.69263}, + {19.9644, 4.81742, 19.0138, 0.420885, 6.14487, 28.5284, 2.5239, 70.8403, 4.352}, + {20.1472, 4.347, 18.9949, 0.3814, 7.5138, 27.766, 2.2735, 66.8776, 4.0712}, + {20.2332, 4.3579, 18.997, 0.3815, 7.8069, 29.5259, 2.8868, 84.9304, 4.0714}, + {20.2933, 3.9282, 19.0298, 0.344, 8.9767, 26.4659, 1.99, 64.2658, 3.7118}, + {20.3892, 3.569, 19.1062, 0.3107, 10.662, 24.3879, 1.4953, 213.904, 3.3352}, + {20.3524, 3.552, 19.1278, 0.3086, 10.2821, 23.7128, 0.9615, 59.4565, 3.2791}, + {20.3361, 3.216, 19.297, 0.2756, 10.888, 20.2073, 2.6959, 167.202, 2.7731}, + {20.1807, 3.21367, 19.1136, 0.28331, 10.9054, 20.0558, 0.77634, 51.746, 3.02902}, + {20.578, 2.94817, 19.599, 0.244475, 11.3727, 18.7726, 3.28719, 133.124, 2.14678}, + {20.2489, 2.9207, 19.3763, 0.250698, 11.6323, 17.8211, 0.336048, 54.9453, 2.4086}, + {21.1671, 2.81219, 19.7695, 0.226836, 11.8513, 17.6083, 3.33049, 127.113, 1.86264}, + {20.8036, 2.77691, 19.559, 0.23154, 11.9369, 16.5408, 0.612376, 43.1692, 2.09013}, + {20.3235, 2.65941, 19.8186, 0.21885, 12.1233, 15.7992, 0.144583, 62.2355, 1.5918}, + {22.044, 2.77393, 19.6697, 0.222087, 12.3856, 16.7669, 2.82428, 143.644, 2.0583}, + {21.3727, 2.6452, 19.7491, 0.214299, 12.1329, 15.323, 0.97518, 36.4065, 1.77132}, + {20.9413, 2.54467, 20.0539, 0.202481, 12.4668, 14.8137, 0.296689, 45.4643, 1.24285}, + {22.6845, 2.66248, 19.6847, 0.210628, 12.774, 15.885, 2.85137, 137.903, 1.98486}, + {21.961, 2.52722, 19.9339, 0.199237, 12.12, 14.1783, 1.51031, 30.8717, 1.47588}, + {23.3405, 2.5627, 19.6095, 0.202088, 13.1235, 15.1009, 2.87516, 132.721, 2.02876}, + {22.5527, 2.4174, 20.1108, 0.185769, 12.0671, 13.1275, 2.07492, 27.4491, 1.19499}, + {24.0042, 2.47274, 19.4258, 0.196451, 13.4396, 14.3996, 2.89604, 128.007, 2.20963}, + {23.1504, 2.31641, 20.2599, 0.174081, 11.9202, 12.1571, 2.71488, 24.8242, 0.954586}, + {24.6274, 2.3879, 19.0886, 0.1942, 13.7603, 13.7546, 2.9227, 123.174, 2.5745}, + {24.0063, 2.27783, 19.9504, 0.17353, 11.8034, 11.6096, 3.87243, 26.5156, 1.36389}, + {23.7497, 2.22258, 20.3745, 0.16394, 11.8509, 11.311, 3.26503, 22.9966, 0.759344}, + {25.0709, 2.25341, 19.0798, 0.181951, 13.8518, 12.9331, 3.54545, 101.398, 2.4196}, + {24.3466, 2.13553, 20.4208, 0.155525, 11.8708, 10.5782, 3.7149, 21.7029, 0.645089}, + {25.8976, 2.24256, 18.2185, 0.196143, 14.3167, 12.6648, 2.95354, 115.362, 3.58324}, + {24.9559, 2.05601, 20.3271, 0.149525, 12.2471, 10.0499, 3.773, 21.2773, 0.691967}, + {26.507, 2.1802, 17.6383, 0.202172, 14.5596, 12.1899, 2.96577, 111.874, 4.29728}, + {25.5395, 1.9804, 20.2861, 0.143384, 11.9812, 9.34972, 4.50073, 19.581, 0.68969}, + {26.9049, 2.07051, 17.294, 0.19794, 14.5583, 11.4407, 3.63837, 92.6566, 4.56796}, + {26.1296, 1.91072, 20.0994, 0.139358, 11.9788, 8.80018, 4.93676, 18.5908, 0.852795}, + {27.6563, 2.07356, 16.4285, 0.223545, 14.9779, 11.3604, 2.98233, 105.703, 5.92046}, + {26.722, 1.84659, 19.7748, 0.13729, 12.1506, 8.36225, 5.17379, 17.8974, 1.17613}, + {28.1819, 2.02859, 15.8851, 0.238849, 15.1542, 10.9975, 2.98706, 102.961, 1.63929}, + {27.3083, 1.78711, 19.332, 0.136974, 12.3339, 7.96778, 5.38348, 17.2922, 1.63929}, + {28.6641, 1.9889, 15.4345, 0.257119, 15.3087, 10.6647, 2.98963, 100.417, 7.56672}, + {28.1209, 1.78503, 17.6817, 0.15997, 13.3335, 8.18304, 5.14657, 20.39, 3.70983}, + {27.8917, 1.73272, 18.7614, 0.13879, 12.6072, 7.64412, 5.47647, 16.8153, 2.26001}, + {28.9476, 1.90182, 15.2208, 9.98519, 15.1, 0.261033, 3.71601, 84.3298, 7.97628}, + {28.4628, 1.68216, 18.121, 0.142292, 12.8429, 7.33727, 5.59415, 16.3535, 2.97573}, + {29.144, 1.83262, 15.1726, 9.5999, 14.7586, 0.275116, 4.30013, 72.029, 8.58154}, + {28.8131, 1.59136, 18.4601, 0.128903, 12.7285, 6.76232, 5.59927, 14.0366, 2.39699}, + {29.2024, 1.77333, 15.2293, 9.37046, 14.5135, 0.295977, 4.76492, 63.3644, 9.24354}, + {29.1587, 1.50711, 18.8407, 0.116741, 12.8268, 6.31524, 5.38695, 12.4244, 1.78555}, + {29.0818, 1.72029, 15.43, 9.2259, 14.4327, 0.321703, 5.11982, 57.056, 9.8875}, + {29.4936, 1.42755, 19.3763, 0.104621, 13.0544, 5.93667, 5.06412, 11.1972, 1.01074}, + {28.7621, 1.67191, 15.7189, 9.09227, 14.5564, 0.3505, 5.44174, 52.0861, 10.472}, + {28.1894, 1.62903, 16.155, 8.97948, 14.9305, 0.382661, 5.67589, 48.1647, 11.0005}, + {30.419, 1.37113, 15.2637, 6.84706, 14.7458, 0.165191, 5.06795, 18.003, 6.49804}, + {27.3049, 1.59279, 16.7296, 8.86553, 15.6115, 0.417916, 5.83377, 45.0011, 11.4722}, + {30.4156, 1.34323, 15.862, 7.10909, 13.6145, 0.204633, 5.82008, 20.3254, 8.27903}, + {30.7058, 1.30923, 15.5512, 6.71983, 14.2326, 0.167252, 5.53672, 17.4911, 6.96824}, + {27.0059, 1.51293, 17.7639, 8.81174, 15.7131, 0.424593, 5.7837, 38.6103, 11.6883}, + {29.8429, 1.32927, 16.7224, 7.38979, 13.2153, 0.263297, 6.35234, 22.9426, 9.85329}, + {30.9612, 1.24813, 15.9829, 6.60834, 13.7348, 0.16864, 5.92034, 16.9392, 7.39534}, + {16.8819, 0.4611, 18.5913, 8.6216, 25.5582, 1.4826, 5.86, 36.3956, 12.0658}, + {28.0109, 1.35321, 17.8204, 7.7395, 14.3359, 0.356752, 6.58077, 26.4043, 11.2299}, + {30.6886, 1.2199, 16.9029, 6.82872, 12.7801, 0.212867, 6.52354, 18.659, 9.0968}, + {20.6809, 0.545, 19.0417, 8.4484, 21.6575, 1.5729, 5.9676, 38.3246, 12.6089}, + {25.0853, 1.39507, 18.4973, 7.65105, 16.8883, 0.443378, 6.48216, 28.2262, 12.0205}, + {29.5641, 1.21152, 18.06, 7.05639, 12.8374, 0.284738, 6.89912, 20.7482, 10.6268}, + {27.5446, 0.65515, 19.1584, 8.70751, 15.538, 1.96347, 5.52593, 45.8149, 13.1746}, + {21.3985, 1.4711, 20.4723, 0.517394, 18.7478, 7.43463, 6.82847, 28.8482, 12.5258}, + {30.8695, 1.1008, 18.3481, 6.53852, 11.9328, 0.219074, 7.00574, 17.2114, 9.8027}, + {31.0617, 0.6902, 13.0637, 2.3576, 18.442, 8.618, 5.9696, 47.2579, 13.4118}, + {21.7886, 1.3366, 19.5682, 0.488383, 19.1406, 6.7727, 7.01107, 23.8132, 12.4734}, + {32.1244, 1.00566, 18.8003, 6.10926, 12.0175, 0.147041, 6.96886, 14.714, 8.08428}, + {33.3689, 0.704, 12.951, 2.9238, 16.5877, 8.7937, 6.4692, 48.0093, 13.5782}, + {21.8053, 1.2356, 19.5026, 6.24149, 19.1053, 0.469999, 7.10295, 20.3185, 12.4711}, + {33.5364, 0.91654, 25.0946, 0.39042, 19.2497, 5.71414, 6.91555, 12.8285, 6.7994}, + {34.6726, 0.700999, 15.4733, 3.55078, 13.1138, 9.55642, 7.02588, 47.0045, 13.677}, + {35.3163, 0.68587, 19.0211, 3.97458, 9.49887, 11.3824, 7.42518, 45.4715, 13.7108}, + {35.5631, 0.6631, 21.2816, 4.0691, 8.0037, 14.0422, 7.4433, 44.2473, 13.6905}, + {35.9299, 0.646453, 23.0547, 4.17619, 12.1439, 23.1052, 2.11253, 150.645, 13.7247}, + {35.763, 0.616341, 22.9064, 3.87135, 12.4739, 19.9887, 3.21097, 142.325, 13.6211}, + {35.215, 0.604909, 21.67, 3.5767, 7.91342, 12.601, 7.65078, 29.8436, 13.5431}, + {35.6597, 0.589092, 23.1032, 3.65155, 12.5977, 18.599, 4.08655, 117.02, 13.5266}, + {35.1736, 0.579689, 22.1112, 3.41437, 8.19216, 12.9187, 7.05545, 25.9443, 13.4637}, + {35.5645, 0.563359, 23.4219, 3.46204, 12.7473, 17.8309, 4.80703, 99.1722, 13.4314}, + {35.1007, 0.555054, 22.4418, 3.24498, 9.78554, 13.4661, 5.29444, 23.9533, 13.376}, + {35.8847, 0.547751, 23.2948, 3.41519, 14.1891, 16.9235, 4.17287, 105.251, 13.4287}, + {36.0228, 0.5293, 23.4128, 3.3253, 14.9491, 16.0927, 4.188, 100.613, 13.3966}, + {35.5747, 0.52048, 22.5259, 3.12293, 12.2165, 12.7148, 5.37073, 26.3394, 13.3092}, + {35.3715, 0.516598, 22.5326, 3.05053, 12.0291, 12.5723, 4.7984, 23.4582, 13.2671}, + {34.8509, 0.507079, 22.7584, 2.8903, 14.0099, 13.1767, 1.21457, 25.2017, 13.1665}, + {36.1874, 0.511929, 23.5964, 3.25396, 15.6402, 15.3622, 4.1855, 97.4908, 13.3573}, + {35.7074, 0.502322, 22.613, 3.03807, 12.9898, 12.1449, 5.43227, 25.4928, 13.2544}, + {35.5103, 0.498626, 22.5787, 2.96627, 12.7766, 11.9484, 4.92159, 22.7502, 13.2116}, + {35.0136, 0.48981, 22.7286, 2.81099, 14.3884, 12.33, 1.75669, 22.6581, 13.113}, + {36.5254, 0.499384, 23.8083, 3.26371, 16.7707, 14.9455, 3.47947, 105.98, 13.3812}, + {35.84, 0.484938, 22.7169, 2.96118, 13.5807, 11.5331, 5.66016, 24.3992, 13.1991}, + {35.6493, 0.481422, 22.646, 2.8902, 13.3595, 11.316, 5.18831, 21.8301, 13.1555}, + {35.1736, 0.473204, 22.7181, 2.73848, 14.7635, 11.553, 2.28678, 20.9303, 13.0582}, + {36.6706, 0.483629, 24.0992, 3.20647, 17.3415, 14.3136, 3.49331, 102.273, 13.3592}, + {36.6488, 0.465154, 24.4096, 3.08997, 17.399, 13.4346, 4.21665, 88.4834, 13.2887}, + {36.7881, 0.451018, 24.7736, 3.04619, 17.8919, 12.8946, 4.23284, 86.003, 13.2754}, + {36.9185, 0.437533, 25.1995, 3.00775, 18.3317, 12.4044, 4.24391, 83.7881, 13.2674}, +}; #endif diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.h b/src/USER-DIFFRACTION/fix_saed_vtk.h index 8ff00bf547..8ae7abb392 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.h +++ b/src/USER-DIFFRACTION/fix_saed_vtk.h @@ -35,19 +35,18 @@ class FixSAEDVTK : public Fix { double compute_vector(int); void reset_timestep(bigint); - private: - int nrepeat,nfreq,irepeat; + int nrepeat, nfreq, irepeat; bigint nvalid; char *ids; FILE *fp; int nrows; - int ave,nwindow,nsum,startstep; + int ave, nwindow, nsum, startstep; int overwrite; long filepos; - int norm,iwindow,window_limit; + int norm, iwindow, window_limit; double *vector; double *vector_total; double **vector_list; @@ -60,27 +59,26 @@ class FixSAEDVTK : public Fix { class ComputeSAED *compute_saed; - double Zone[3]; // Zone axis to view SAED - double R_Ewald; // Radius of Ewald sphere (distance units) - double lambda; // Radiation wavelenght (distance units) - double dK[3]; // spacing of reciprocal points in each dimension - int Knmax[3]; // maximum integer value for K points in each dimension - int Knmin[3]; // minimum integer value for K points in each dimension + double Zone[3]; // Zone axis to view SAED + double R_Ewald; // Radius of Ewald sphere (distance units) + double lambda; // Radiation wavelenght (distance units) + double dK[3]; // spacing of reciprocal points in each dimension + int Knmax[3]; // maximum integer value for K points in each dimension + int Knmin[3]; // minimum integer value for K points in each dimension - int KnSlice[6]; // min 0-2 max 2-5 hkl index using zone - double Kmax; // Maximum reciprocal distance to explore - double c[3]; // Parameters controlling resolution of reciprocal space explored - double dR_Ewald; // Thickness of Ewald sphere slice - double prd_inv[3]; // Inverse spacing of unit cell - - char *filename; // user-specified file - int nOutput; - int Dim[3]; - bool manual; // Turn on manual recpiprocal map + int KnSlice[6]; // min 0-2 max 2-5 hkl index using zone + double Kmax; // Maximum reciprocal distance to explore + double c[3]; // Parameters controlling resolution of reciprocal space explored + double dR_Ewald; // Thickness of Ewald sphere slice + double prd_inv[3]; // Inverse spacing of unit cell + char *filename; // user-specified file + int nOutput; + int Dim[3]; + bool manual; // Turn on manual recpiprocal map }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/atom_vec_dpd.h b/src/USER-DPD/atom_vec_dpd.h index 4d4ab2693c..1fa08f6240 100644 --- a/src/USER-DPD/atom_vec_dpd.h +++ b/src/USER-DPD/atom_vec_dpd.h @@ -32,13 +32,13 @@ class AtomVecDPD : public AtomVec { void unpack_restart_init(int); void data_atom_post(int); -private: - double *rho,*dpdTheta; - double *uCond,*uMech,*uChem; - double *uCG,*uCGnew; + private: + double *rho, *dpdTheta; + double *uCond, *uMech, *uChem; + double *uCG, *uCGnew; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/compute_dpd.h b/src/USER-DPD/compute_dpd.h index 830b17cd66..39c28a3040 100644 --- a/src/USER-DPD/compute_dpd.h +++ b/src/USER-DPD/compute_dpd.h @@ -33,10 +33,9 @@ class ComputeDpd : public Compute { private: double *dpdU; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/compute_dpd_atom.h b/src/USER-DPD/compute_dpd_atom.h index b24333968c..6f974d0ddb 100644 --- a/src/USER-DPD/compute_dpd_atom.h +++ b/src/USER-DPD/compute_dpd_atom.h @@ -37,7 +37,7 @@ class ComputeDpdAtom : public Compute { double **dpdAtom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_dpd_energy.h b/src/USER-DPD/fix_dpd_energy.h index 7288a2f7e1..af0986f578 100644 --- a/src/USER-DPD/fix_dpd_energy.h +++ b/src/USER-DPD/fix_dpd_energy.h @@ -36,7 +36,7 @@ class FixDPDenergy : public Fix { class PairDPDfdtEnergy *pairDPDE; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_eos_cv.h b/src/USER-DPD/fix_eos_cv.h index 8d69dbda15..770b0f90a2 100644 --- a/src/USER-DPD/fix_eos_cv.h +++ b/src/USER-DPD/fix_eos_cv.h @@ -37,7 +37,7 @@ class FixEOScv : public Fix { double cvEOS; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_eos_table.h b/src/USER-DPD/fix_eos_table.h index d9a99d8770..1cbb32bc88 100644 --- a/src/USER-DPD/fix_eos_table.h +++ b/src/USER-DPD/fix_eos_table.h @@ -36,16 +36,16 @@ class FixEOStable : public Fix { void temperature_lookup(double, double &); protected: - enum{LINEAR}; + enum { LINEAR }; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { int ninput; - double lo,hi; - double *rfile,*efile; + double lo, hi; + double *rfile, *efile; double *e2file; - double delta,invdelta,deltasq6; - double *r,*e,*de,*e2; + double delta, invdelta, deltasq6; + double *r, *e, *de, *e2; }; int ntables; Table *tables; @@ -61,9 +61,8 @@ class FixEOStable : public Fix { void param_extract(Table *, Table *, char *); void spline(double *, double *, int, double, double, double *); double splint(double *, double *, double *, int, double); - - }; -} +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_eos_table_rx.h b/src/USER-DPD/fix_eos_table_rx.h index caa30fd6b8..57cd87954b 100644 --- a/src/USER-DPD/fix_eos_table_rx.h +++ b/src/USER-DPD/fix_eos_table_rx.h @@ -37,16 +37,16 @@ class FixEOStableRX : public Fix { void temperature_lookup(int, double, double &); protected: - enum{LINEAR}; + enum { LINEAR }; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { int ninput; - double lo,hi; - double *rfile,*efile; + double lo, hi; + double *rfile, *efile; double *e2file; - double delta,invdelta,deltasq6; - double *r,*e,*de,*e2; + double delta, invdelta, deltasq6; + double *r, *e, *de, *e2; }; int ntables; Table *tables, *tables2; @@ -67,18 +67,18 @@ class FixEOStableRX : public Fix { void read_file(char *); - double *dHf,*energyCorr,*tempCorrCoeff,*moleculeCorrCoeff; + double *dHf, *energyCorr, *tempCorrCoeff, *moleculeCorrCoeff; int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); int *eosSpecies; int ncolumn; bool rx_flag; - }; -} +}; +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/fix_rx.h b/src/USER-DPD/fix_rx.h index 4d04cbe030..5712e82208 100644 --- a/src/USER-DPD/fix_rx.h +++ b/src/USER-DPD/fix_rx.h @@ -41,22 +41,22 @@ class FixRX : public Fix { protected: int pack_reverse_comm(int, int, double *); void unpack_reverse_comm(int, int *, double *); - int pack_forward_comm(int , int *, double *, int, int *); - void unpack_forward_comm(int , int , double *); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); class NeighList *list; double tmpArg; - int *mol2param; // mapping from molecule to parameters - int nreactions; // # of stored parameter sets - int maxparam; // max # of parameter sets + int *mol2param; // mapping from molecule to parameters + int nreactions; // # of stored parameter sets + int maxparam; // max # of parameter sets struct Param { double cp; int ispecies; - char *name; // names of unique molecules and interaction type + char *name; // names of unique molecules and interaction type }; - Param *params; // parameter set for an I-J-K interaction + Param *params; // parameter set for an I-J-K interaction int nspecies; void read_file(char *); @@ -66,33 +66,30 @@ class FixRX : public Fix { double *kR; //!< Classic Runge-Kutta 4th-order stepper. - void rk4(int, double*, void*); + void rk4(int, double *, void *); //!< Runge-Kutta-Fehlberg ODE Solver. - void rkf45(int, double*, void*, int ode_counter[]); + void rkf45(int, double *, void *, int ode_counter[]); //!< Runge-Kutta-Fehlberg ODE stepper function. - void rkf45_step (const int neq, const double h, double y[], double y_out[], - double rwk[], void *); + void rkf45_step(const int neq, const double h, double y[], double y_out[], double rwk[], void *); //!< Initial step size estimation for the Runge-Kutta-Fehlberg ODE solver. - int rkf45_h0 (const int neq, const double t, const double t_stop, - const double hmin, const double hmax, - double& h0, double y[], double rwk[], void *v_params); + int rkf45_h0(const int neq, const double t, const double t_stop, const double hmin, + const double hmax, double &h0, double y[], double rwk[], void *v_params); class PairDPDfdtEnergy *pairDPDE; double *dpdThetaLocal; double *sumWeights; void computeLocalTemperature(); - int localTempFlag,wtFlag,odeIntegrationFlag; + int localTempFlag, wtFlag, odeIntegrationFlag; double sigFactor; int rhs(double, const double *, double *, void *); - int rhs_dense (double, const double *, double *, void *); + int rhs_dense(double, const double *, double *, void *); // User-defined data container needed in rhs. - struct UserRHSData - { + struct UserRHSData { double *kFor; double *rxnRateLaw; }; @@ -103,24 +100,25 @@ class FixRX : public Fix { void initSparse(void); int rhs_sparse(double, const double *, double *, void *) const; - int sparseKinetics_maxReactants; //dt); - - void ssa_update_dpd(int, int, int); // Constant Temperature - void ssa_update_dpde(int, int, int); // Constant Energy + double dtsqrt; // = sqrt(update->dt); + void ssa_update_dpd(int, int, int); // Constant Temperature + void ssa_update_dpde(int, int, int); // Constant Energy }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nbin_ssa.h b/src/USER-DPD/nbin_ssa.h index 7316545b54..9873880328 100644 --- a/src/USER-DPD/nbin_ssa.h +++ b/src/USER-DPD/nbin_ssa.h @@ -22,24 +22,23 @@ NBinStyle(ssa, #ifndef LMP_NBIN_SSA_H #define LMP_NBIN_SSA_H -#include -#include "nbin_standard.h" #include "error.h" +#include "nbin_standard.h" +#include namespace LAMMPS_NS { class NBinSSA : public NBinStandard { public: - - int gairhead_ssa[8]; // index of 1st ghost atom in each AIR + int gairhead_ssa[8]; // index of 1st ghost atom in each AIR // Bounds of the local atoms in the binhead array - int lbinxlo; // lowest local bin x-dim coordinate - int lbinylo; // lowest local bin y-dim coordinate - int lbinzlo; // lowest local bin z-dim coordinate - int lbinxhi; // highest local bin x-dim coordinate - int lbinyhi; // highest local bin y-dim coordinate - int lbinzhi; // highest local bin z-dim coordinate + int lbinxlo; // lowest local bin x-dim coordinate + int lbinylo; // lowest local bin y-dim coordinate + int lbinzlo; // lowest local bin z-dim coordinate + int lbinxhi; // highest local bin x-dim coordinate + int lbinyhi; // highest local bin y-dim coordinate + int lbinzhi; // highest local bin z-dim coordinate NBinSSA(class LAMMPS *); ~NBinSSA(); @@ -49,52 +48,51 @@ class NBinSSA : public NBinStandard { double memory_usage(); - inline - int coord2bin(const double & x,const double & y,const double & z, int &ixo, int &iyo, int &izo) const + inline int coord2bin(const double &x, const double &y, const double &z, int &ixo, int &iyo, + int &izo) const { - int ix,iy,iz; + int ix, iy, iz; if (!std::isfinite(x) || !std::isfinite(y) || !std::isfinite(z)) - error->one(FLERR,"Non-numeric positions - simulation unstable"); + error->one(FLERR, "Non-numeric positions - simulation unstable"); if (x >= bboxhi_[0]) - ix = static_cast ((x-bboxhi_[0])*bininvx) + nbinx; + ix = static_cast((x - bboxhi_[0]) * bininvx) + nbinx; else if (x >= bboxlo_[0]) { - ix = static_cast ((x-bboxlo_[0])*bininvx); - ix = MIN(ix,nbinx-1); + ix = static_cast((x - bboxlo_[0]) * bininvx); + ix = MIN(ix, nbinx - 1); } else - ix = static_cast ((x-bboxlo_[0])*bininvx) - 1; + ix = static_cast((x - bboxlo_[0]) * bininvx) - 1; if (y >= bboxhi_[1]) - iy = static_cast ((y-bboxhi_[1])*bininvy) + nbiny; + iy = static_cast((y - bboxhi_[1]) * bininvy) + nbiny; else if (y >= bboxlo_[1]) { - iy = static_cast ((y-bboxlo_[1])*bininvy); - iy = MIN(iy,nbiny-1); + iy = static_cast((y - bboxlo_[1]) * bininvy); + iy = MIN(iy, nbiny - 1); } else - iy = static_cast ((y-bboxlo_[1])*bininvy) - 1; + iy = static_cast((y - bboxlo_[1]) * bininvy) - 1; if (z >= bboxhi_[2]) - iz = static_cast ((z-bboxhi_[2])*bininvz) + nbinz; + iz = static_cast((z - bboxhi_[2]) * bininvz) + nbinz; else if (z >= bboxlo_[2]) { - iz = static_cast ((z-bboxlo_[2])*bininvz); - iz = MIN(iz,nbinz-1); + iz = static_cast((z - bboxlo_[2]) * bininvz); + iz = MIN(iz, nbinz - 1); } else - iz = static_cast ((z-bboxlo_[2])*bininvz) - 1; + iz = static_cast((z - bboxlo_[2]) * bininvz) - 1; ixo = ix - mbinxlo; iyo = iy - mbinylo; izo = iz - mbinzlo; - return (iz-mbinzlo)*mbiny*mbinx + (iy-mbinylo)*mbinx + (ix-mbinxlo); + return (iz - mbinzlo) * mbiny * mbinx + (iy - mbinylo) * mbinx + (ix - mbinxlo); } private: - int coord2ssaAIR(const double *); // map atom coord to an AIR number - double bboxlo_[3],bboxhi_[3]; - + int coord2ssaAIR(const double *); // map atom coord to an AIR number + double bboxlo_[3], bboxhi_[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/npair_half_bin_newton_ssa.h b/src/USER-DPD/npair_half_bin_newton_ssa.h index b6ae51f826..4706d6ea25 100644 --- a/src/USER-DPD/npair_half_bin_newton_ssa.h +++ b/src/USER-DPD/npair_half_bin_newton_ssa.h @@ -43,11 +43,12 @@ class NPairHalfBinNewtonSSA : public NPair { NPairHalfBinNewtonSSA(class LAMMPS *); ~NPairHalfBinNewtonSSA(); void build(class NeighList *); + private: int ssa_maxPhaseCt; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nstencil_half_bin_2d_ssa.h b/src/USER-DPD/nstencil_half_bin_2d_ssa.h index 001b0d2c1c..706675f01a 100644 --- a/src/USER-DPD/nstencil_half_bin_2d_ssa.h +++ b/src/USER-DPD/nstencil_half_bin_2d_ssa.h @@ -33,7 +33,7 @@ class NStencilHalfBin2dSSA : public NStencilSSA { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nstencil_half_bin_3d_ssa.h b/src/USER-DPD/nstencil_half_bin_3d_ssa.h index cd6bacdbfa..ee5d71c7b6 100644 --- a/src/USER-DPD/nstencil_half_bin_3d_ssa.h +++ b/src/USER-DPD/nstencil_half_bin_3d_ssa.h @@ -33,7 +33,7 @@ class NStencilHalfBin3dSSA : public NStencilSSA { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/nstencil_ssa.h b/src/USER-DPD/nstencil_ssa.h index 2e0de390f2..eaf581a6d8 100644 --- a/src/USER-DPD/nstencil_ssa.h +++ b/src/USER-DPD/nstencil_ssa.h @@ -28,7 +28,7 @@ class NStencilSSA : public NStencil { int nstencil_ssa[5]; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-DPD/pair_dpd_fdt.h b/src/USER-DPD/pair_dpd_fdt.h index a2e60806bf..aafdbae5d9 100644 --- a/src/USER-DPD/pair_dpd_fdt.h +++ b/src/USER-DPD/pair_dpd_fdt.h @@ -53,10 +53,9 @@ class PairDPDfdt : public Pair { bool a0_is_zero; void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_dpd_fdt_energy.h b/src/USER-DPD/pair_dpd_fdt_energy.h index 8b48dd5323..e87c9c204e 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.h +++ b/src/USER-DPD/pair_dpd_fdt_energy.h @@ -43,8 +43,8 @@ class PairDPDfdtEnergy : public Pair { double **cut; double **a0; - double **sigma,**kappa,**alpha; - double *duCond,*duMech; + double **sigma, **kappa, **alpha; + double *duCond, *duMech; int seed; class RanMars *random; @@ -55,10 +55,9 @@ class PairDPDfdtEnergy : public Pair { bool a0_is_zero; virtual void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_exp6_rx.h b/src/USER-DPD/pair_exp6_rx.h index e0b99716e0..5c1ec5c5c5 100644 --- a/src/USER-DPD/pair_exp6_rx.h +++ b/src/USER-DPD/pair_exp6_rx.h @@ -38,26 +38,26 @@ class PairExp6rx : public Pair { void read_restart_settings(FILE *); struct Param { - double epsilon,rm,alpha; + double epsilon, rm, alpha; int ispecies; - char *name, *potential; // names of unique molecules and interaction type - char *tablename; // name of interaction table - int potentialType; // enumerated interaction potential type. + char *name, *potential; // names of unique molecules and interaction type + char *tablename; // name of interaction table + int potentialType; // enumerated interaction potential type. }; protected: - enum{LINEAR}; - enum{NONE,EXPONENT,POLYNOMIAL}; + enum { LINEAR }; + enum { NONE, EXPONENT, POLYNOMIAL }; double cut_global; double **cut; - double **epsilon,**rm,**alpha; - double **rminv,**buck1,**buck2,**offset; + double **epsilon, **rm, **alpha; + double **rminv, **buck1, **buck2, **offset; virtual void allocate(); - int *mol2param; // mapping from molecule to parameters - int nparams; // # of stored parameter sets - int maxparam; // max # of parameter sets - Param *params; // parameter set for an I-J-K interaction + int *mol2param; // mapping from molecule to parameters + int nparams; // # of stored parameter sets + int maxparam; // max # of parameter sets + Param *params; // parameter set for an I-J-K interaction int nspecies; virtual void read_file(char *); @@ -66,7 +66,9 @@ class PairExp6rx : public Pair { int isite1, isite2; char *site1, *site2; - void getMixingWeights(int, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &, double &) const; + void getMixingWeights(int, double &, double &, double &, double &, double &, double &, double &, + double &, double &, double &, double &, double &, double &, double &, + double &, double &) const; double exponentR, exponentEpsilon; int scalingFlag; void exponentScaling(double, double &, double &) const; @@ -78,7 +80,7 @@ class PairExp6rx : public Pair { inline double expValue(const double) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_multi_lucy.h b/src/USER-DPD/pair_multi_lucy.h index 92fff5e50a..fe244a793c 100644 --- a/src/USER-DPD/pair_multi_lucy.h +++ b/src/USER-DPD/pair_multi_lucy.h @@ -44,20 +44,19 @@ class PairMultiLucy : public Pair { void computeLocalDensity(); double rho_0; - protected: - enum{LOOKUP,LINEAR}; + enum { LOOKUP, LINEAR }; int nmax; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { - int ninput,rflag,fpflag,match; - double rlo,rhi,fplo,fphi,cut; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double innersq,delta,invdelta,deltasq6; - double *rsq,*drsq,*e,*de,*f,*df,*e2,*f2; + int ninput, rflag, fpflag, match; + double rlo, rhi, fplo, fphi, cut; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double innersq, delta, invdelta, deltasq6; + double *rsq, *drsq, *e, *de, *f, *df, *e2, *f2; }; int ntables; Table *tables; @@ -76,7 +75,7 @@ class PairMultiLucy : public Pair { double splint(double *, double *, double *, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_multi_lucy_rx.h b/src/USER-DPD/pair_multi_lucy_rx.h index 8d2a01f100..3fe442ab91 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.h +++ b/src/USER-DPD/pair_multi_lucy_rx.h @@ -44,20 +44,19 @@ class PairMultiLucyRX : public Pair { void computeLocalDensity(); double rho_0; - protected: - enum{LOOKUP,LINEAR}; + enum { LOOKUP, LINEAR }; int nmax; - int tabstyle,tablength; + int tabstyle, tablength; struct Table { - int ninput,rflag,fpflag,match; - double rlo,rhi,fplo,fphi,cut; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double innersq,delta,invdelta,deltasq6; - double *rsq,*drsq,*e,*de,*f,*df,*e2,*f2; + int ninput, rflag, fpflag, match; + double rlo, rhi, fplo, fphi, cut; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double innersq, delta, invdelta, deltasq6; + double *rsq, *drsq, *e, *de, *f, *df, *e2, *f2; }; int ntables; Table *tables; @@ -80,10 +79,9 @@ class PairMultiLucyRX : public Pair { int isite1, isite2; void getMixingWeights(int, double &, double &, double &, double &); bool fractionalWeighting; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/pair_table_rx.h b/src/USER-DPD/pair_table_rx.h index ce9e8693e2..cde41bf9a2 100644 --- a/src/USER-DPD/pair_table_rx.h +++ b/src/USER-DPD/pair_table_rx.h @@ -35,16 +35,14 @@ class PairTableRX : public PairTable { virtual double single(int, int, int, int, double, double, double, double &); protected: - int nspecies; char *site1, *site2; int isite1, isite2; void getMixingWeights(int, double &, double &, double &, double &); bool fractionalWeighting; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DPD/random_external_state.h b/src/USER-DPD/random_external_state.h index 037a5ee8b0..037b616461 100644 --- a/src/USER-DPD/random_external_state.h +++ b/src/USER-DPD/random_external_state.h @@ -63,9 +63,8 @@ #ifndef LMP_RANDOM_EXTERNALSTATE_H #define LMP_RANDOM_EXTERNALSTATE_H -#include #include "accelerator_kokkos.h" - +#include /// \file random_external_state.h /// \brief Pseudorandom number generators @@ -77,90 +76,98 @@ // A replacement for the Kokkos Random_XorShift64 class that uses // an external state variable, instead of a class member variable. namespace random_external_state { - typedef uint64_t es_RNG_t; +typedef uint64_t es_RNG_t; - enum {MAX_URAND = 0xffffffffU}; - enum {MAX_URAND64 = 0xffffffffffffffffULL-1}; +enum { MAX_URAND = 0xffffffffU }; +enum { MAX_URAND64 = 0xffffffffffffffffULL - 1 }; - LAMMPS_INLINE - uint32_t es_urand(es_RNG_t &state_) { - state_ ^= state_ >> 12; - state_ ^= state_ << 25; - state_ ^= state_ >> 27; +LAMMPS_INLINE +uint32_t es_urand(es_RNG_t &state_) +{ + state_ ^= state_ >> 12; + state_ ^= state_ << 25; + state_ ^= state_ >> 27; - es_RNG_t tmp = state_ * 2685821657736338717ULL; - tmp = tmp>>16; - return static_cast(tmp&MAX_URAND); - } - - LAMMPS_INLINE - uint64_t es_urand64(es_RNG_t &state_) { - state_ ^= state_ >> 12; - state_ ^= state_ << 25; - state_ ^= state_ >> 27; - return (state_ * 2685821657736338717ULL) - 1; - } - - LAMMPS_INLINE - int es_rand(es_RNG_t &state_) { - return static_cast(es_urand(state_)/2); - } - - LAMMPS_INLINE - double es_drand(es_RNG_t &state_) { - return 1.0 * es_urand64(state_)/MAX_URAND64; - } - - //Marsaglia polar method for drawing a standard normal distributed random number - LAMMPS_INLINE - double es_normal(es_RNG_t &state_) { - double S, U; - do { - U = 2.0*es_drand(state_) - 1.0; - const double V = 2.0*es_drand(state_) - 1.0; - S = U*U+V*V; - } while ((S >= 1.0) || (S == 0.0)); - return U*sqrt(-2.0*log(S)/S); - } - - LAMMPS_INLINE - double es_normalPair(es_RNG_t &state_, double &second) { - double S, U, V; - do { - U = 2.0*es_drand(state_) - 1.0; - V = 2.0*es_drand(state_) - 1.0; - S = U*U+V*V; - } while ((S >= 1.0) || (S == 0.0)); - const double fac = sqrt(-2.0*log(S)/S); - second = V*fac; - return U*fac; - } - - // Use es_init() to init a serial RNG, that is then - // used to generate the initial state of your k parallel - // RNGs with k calls to genNextParallelState() - LAMMPS_INLINE - void es_init(es_RNG_t &serial_state, uint64_t seed) { - if (seed==0) seed = uint64_t(1318319); - serial_state = seed; - for (int i = 0; i < 17; i++) es_rand(serial_state); - } - - // Call genNextParallelState() once for each RNG to generate - // the initial state for that RNG. - LAMMPS_INLINE - void es_genNextParallelState(es_RNG_t &serial_state, es_RNG_t &new_state) { - int n1 = es_rand(serial_state); - int n2 = es_rand(serial_state); - int n3 = es_rand(serial_state); - int n4 = es_rand(serial_state); - new_state = ((((static_cast(n1)) & 0xffff)<<00) | - (((static_cast(n2)) & 0xffff)<<16) | - (((static_cast(n3)) & 0xffff)<<32) | - (((static_cast(n4)) & 0xffff)<<48)); - } + es_RNG_t tmp = state_ * 2685821657736338717ULL; + tmp = tmp >> 16; + return static_cast(tmp & MAX_URAND); } +LAMMPS_INLINE +uint64_t es_urand64(es_RNG_t &state_) +{ + state_ ^= state_ >> 12; + state_ ^= state_ << 25; + state_ ^= state_ >> 27; + return (state_ * 2685821657736338717ULL) - 1; +} + +LAMMPS_INLINE +int es_rand(es_RNG_t &state_) +{ + return static_cast(es_urand(state_) / 2); +} + +LAMMPS_INLINE +double es_drand(es_RNG_t &state_) +{ + return 1.0 * es_urand64(state_) / MAX_URAND64; +} + +//Marsaglia polar method for drawing a standard normal distributed random number +LAMMPS_INLINE +double es_normal(es_RNG_t &state_) +{ + double S, U; + do { + U = 2.0 * es_drand(state_) - 1.0; + const double V = 2.0 * es_drand(state_) - 1.0; + S = U * U + V * V; + } while ((S >= 1.0) || (S == 0.0)); + return U * sqrt(-2.0 * log(S) / S); +} + +LAMMPS_INLINE +double es_normalPair(es_RNG_t &state_, double &second) +{ + double S, U, V; + do { + U = 2.0 * es_drand(state_) - 1.0; + V = 2.0 * es_drand(state_) - 1.0; + S = U * U + V * V; + } while ((S >= 1.0) || (S == 0.0)); + const double fac = sqrt(-2.0 * log(S) / S); + second = V * fac; + return U * fac; +} + +// Use es_init() to init a serial RNG, that is then +// used to generate the initial state of your k parallel +// RNGs with k calls to genNextParallelState() +LAMMPS_INLINE +void es_init(es_RNG_t &serial_state, uint64_t seed) +{ + if (seed == 0) seed = uint64_t(1318319); + serial_state = seed; + for (int i = 0; i < 17; i++) es_rand(serial_state); +} + +// Call genNextParallelState() once for each RNG to generate +// the initial state for that RNG. +LAMMPS_INLINE +void es_genNextParallelState(es_RNG_t &serial_state, es_RNG_t &new_state) +{ + int n1 = es_rand(serial_state); + int n2 = es_rand(serial_state); + int n3 = es_rand(serial_state); + int n4 = es_rand(serial_state); + new_state = ((((static_cast(n1)) & 0xffff) << 00) | + (((static_cast(n2)) & 0xffff) << 16) | + (((static_cast(n3)) & 0xffff) << 32) | + (((static_cast(n4)) & 0xffff) << 48)); +} +} // namespace random_external_state + #endif /* ERROR/WARNING messages: diff --git a/src/USER-DRUDE/compute_temp_drude.h b/src/USER-DRUDE/compute_temp_drude.h index 2248733544..c88683f93d 100644 --- a/src/USER-DRUDE/compute_temp_drude.h +++ b/src/USER-DRUDE/compute_temp_drude.h @@ -36,7 +36,7 @@ class ComputeTempDrude : public Compute { private: int fix_dof; - class FixDrude * fix_drude; + class FixDrude *fix_drude; char *id_temp; class Compute *temperature; bigint dof_core, dof_drude; @@ -44,10 +44,9 @@ class ComputeTempDrude : public Compute { double temp_core, temp_drude; void dof_compute(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/fix_drude.h b/src/USER-DRUDE/fix_drude.h index d12d6a3c28..afc311baf2 100644 --- a/src/USER-DRUDE/fix_drude.h +++ b/src/USER-DRUDE/fix_drude.h @@ -24,15 +24,15 @@ FixStyle(drude,FixDrude); #include #define NOPOL_TYPE 0 -#define CORE_TYPE 1 +#define CORE_TYPE 1 #define DRUDE_TYPE 2 namespace LAMMPS_NS { class FixDrude : public Fix { public: - int * drudetype; - tagint * drudeid; + int *drudetype; + tagint *drudeid; bool is_reduced; FixDrude(class LAMMPS *, int, char **); @@ -48,9 +48,9 @@ class FixDrude : public Fix { int pack_border(int n, int *list, double *buf); int unpack_border(int n, int first, double *buf); -private: + private: int rebuildflag; - std::set * partner_set; + std::set *partner_set; void build_drudeid(); static void ring_search_drudeid(int size, char *cbuf, void *ptr); @@ -61,8 +61,7 @@ private: static void ring_copy_drude(int size, char *cbuf, void *ptr); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-DRUDE/fix_drude_transform.h b/src/USER-DRUDE/fix_drude_transform.h index 02c5138f38..fa7566ff2b 100644 --- a/src/USER-DRUDE/fix_drude_transform.h +++ b/src/USER-DRUDE/fix_drude_transform.h @@ -25,8 +25,7 @@ FixStyle(drude/transform/inverse,FixDrudeTransform); namespace LAMMPS_NS { -template -class FixDrudeTransform : public Fix { +template class FixDrudeTransform : public Fix { public: FixDrudeTransform(class LAMMPS *, int, char **); ~FixDrudeTransform(); @@ -39,13 +38,13 @@ class FixDrudeTransform : public Fix { void final_integrate(); int pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc); void unpack_forward_comm(int n, int first, double *buf); + protected: - double * mcoeff; - class FixDrude * fix_drude; + double *mcoeff; + class FixDrude *fix_drude; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-DRUDE/fix_langevin_drude.h b/src/USER-DRUDE/fix_langevin_drude.h index de1e92a269..7f30b3f35b 100644 --- a/src/USER-DRUDE/fix_langevin_drude.h +++ b/src/USER-DRUDE/fix_langevin_drude.h @@ -34,13 +34,13 @@ class FixLangevinDrude : public Fix { virtual void post_force(int vflag); void reset_target(double); virtual void *extract(const char *, int &); - int pack_reverse_comm(int, int, double*); - void unpack_reverse_comm(int, int*, double*); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); int modify_param(int, char **); protected: - double t_start_core,t_period_core,t_target_core; - double t_start_drude,t_period_drude,t_target_drude; + double t_start_core, t_period_core, t_target_core; + double t_start_drude, t_period_drude, t_target_drude; int tstyle_core, tstyle_drude; int tvar_core, tvar_drude; char *tstr_core, *tstr_drude; @@ -50,13 +50,12 @@ class FixLangevinDrude : public Fix { class RanMars *random_core, *random_drude; int zero; bigint ncore; - class FixDrude * fix_drude; + class FixDrude *fix_drude; class Compute *temperature; char *id_temp; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-DRUDE/fix_tgnh_drude.h b/src/USER-DRUDE/fix_tgnh_drude.h index 2063f0a97e..1f5579fd79 100644 --- a/src/USER-DRUDE/fix_tgnh_drude.h +++ b/src/USER-DRUDE/fix_tgnh_drude.h @@ -34,7 +34,7 @@ class FixTGNHDrude : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); @@ -42,92 +42,92 @@ class FixTGNHDrude : public Fix { double memory_usage(); protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes - class Irregular *irregular; // for migrating atoms after box flips + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes + class Irregular *irregular; // for migrating atoms after box flips int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally double *etamol; - double *etamol_dot; // chain thermostat for motion of whole molecules + double *etamol_dot; // chain thermostat for motion of whole molecules double *etamol_dotdot; double *etamol_mass; double *etaint; - double *etaint_dot; // chain thermostat for internal DOFs + double *etaint_dot; // chain thermostat for internal DOFs double *etaint_dotdot; double *etaint_mass; double *etadrude; - double *etadrude_dot; // chain thermostat for Drude relative motions + double *etadrude_dot; // chain thermostat for Drude relative motions double *etadrude_dotdot; double *etadrude_mass; - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mtchain; // length of chain - int mpchain; // length of chain + int mtchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + int nc_tchain, nc_pchain; + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); void nhc_temp_integrate(); void nhc_press_integrate(); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -140,24 +140,24 @@ class FixTGNHDrude : public Fix { void compute_press_target(); void nh_omega_dot(); - - class FixDrude * fix_drude; - int n_mol; // number of molecules in the system + class FixDrude *fix_drude; + int n_mol; // number of molecules in the system double *mass_mol; - double dof_mol, dof_int, dof_drude; // DOFs of different modes in the fix group + double dof_mol, dof_int, dof_drude; // DOFs of different modes in the fix group void setup_mol_mass_dof(); double **v_mol, **v_mol_tmp; - void compute_temp_mol_int_drude(bool); // calculate the temperatures of three sets of DOFs + void compute_temp_mol_int_drude(bool); // calculate the temperatures of three sets of DOFs bool temp_computed_end_of_step = false; double tdrude_target, tdrude_freq; double t_mol, t_int, t_drude; double ke2mol, ke2int, ke2drude; double ke2mol_target, ke2int_target, ke2drude_target; double factor_eta_mol, factor_eta_int, factor_eta_drude; - double propagate(double *, double *, double *, const double *, const double &, const double &, const double &) const; + double propagate(double *, double *, double *, const double *, const double &, const double &, + const double &) const; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-DRUDE/fix_tgnpt_drude.h b/src/USER-DRUDE/fix_tgnpt_drude.h index d5cf64cf79..fd200156b0 100644 --- a/src/USER-DRUDE/fix_tgnpt_drude.h +++ b/src/USER-DRUDE/fix_tgnpt_drude.h @@ -30,7 +30,7 @@ class FixTGNPTDrude : public FixTGNHDrude { ~FixTGNPTDrude() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/fix_tgnvt_drude.h b/src/USER-DRUDE/fix_tgnvt_drude.h index ab372570fa..f5958fadc4 100644 --- a/src/USER-DRUDE/fix_tgnvt_drude.h +++ b/src/USER-DRUDE/fix_tgnvt_drude.h @@ -24,13 +24,13 @@ FixStyle(tgnvt/drude,FixTGNVTDrude); namespace LAMMPS_NS { -class FixTGNVTDrude: public FixTGNHDrude { +class FixTGNVTDrude : public FixTGNHDrude { public: FixTGNVTDrude(class LAMMPS *, int, char **); ~FixTGNVTDrude() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/pair_coul_tt.h b/src/USER-DRUDE/pair_coul_tt.h index 4e235109f5..c4890ef542 100644 --- a/src/USER-DRUDE/pair_coul_tt.h +++ b/src/USER-DRUDE/pair_coul_tt.h @@ -24,7 +24,7 @@ PairStyle(coul/tt,PairCoulTT); namespace LAMMPS_NS { -class PairCoulTT: public Pair { +class PairCoulTT : public Pair { public: PairCoulTT(class LAMMPS *); virtual ~PairCoulTT(); @@ -43,15 +43,15 @@ class PairCoulTT: public Pair { protected: int n_global; double cut_global; - double **cut,**scale; - double **b,**c; + double **cut, **scale; + double **b, **c; int **ntt; - class FixDrude * fix_drude; + class FixDrude *fix_drude; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.h b/src/USER-DRUDE/pair_lj_cut_thole_long.h index 43c3a3378f..dcd4a77223 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.h +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.h @@ -44,23 +44,23 @@ class PairLJCutTholeLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; double thole_global; double cut_global; - double **cut,**scale; - double **polar,**thole,**ascreen; + double **cut, **scale; + double **polar, **thole, **ascreen; class FixDrude *fix_drude; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-DRUDE/pair_thole.h b/src/USER-DRUDE/pair_thole.h index 01699a0218..253c92e7aa 100644 --- a/src/USER-DRUDE/pair_thole.h +++ b/src/USER-DRUDE/pair_thole.h @@ -43,14 +43,14 @@ class PairThole : public Pair { protected: double thole_global; double cut_global; - double **cut,**scale; - double **polar,**thole,**ascreen; - class FixDrude * fix_drude; + double **cut, **scale; + double **polar, **thole, **ascreen; + class FixDrude *fix_drude; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/atom_vec_electron.h b/src/USER-EFF/atom_vec_electron.h index 6a445d8774..2d731e82e2 100644 --- a/src/USER-EFF/atom_vec_electron.h +++ b/src/USER-EFF/atom_vec_electron.h @@ -35,12 +35,12 @@ class AtomVecElectron : public AtomVec { int property_atom(char *); void pack_property_atom(int, double *, int, int); -private: + private: int *spin; - double *eradius,*ervel,*erforce; + double *eradius, *ervel, *erforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_ke_atom_eff.h b/src/USER-EFF/compute_ke_atom_eff.h index d2285e0c64..1425b8cade 100644 --- a/src/USER-EFF/compute_ke_atom_eff.h +++ b/src/USER-EFF/compute_ke_atom_eff.h @@ -11,7 +11,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef COMPUTE_CLASS // clang-format off ComputeStyle(ke/atom/eff,ComputeKEAtomEff); @@ -38,7 +37,7 @@ class ComputeKEAtomEff : public Compute { double *ke; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_ke_eff.h b/src/USER-EFF/compute_ke_eff.h index bd001a08d1..7d2c2b0c2a 100644 --- a/src/USER-EFF/compute_ke_eff.h +++ b/src/USER-EFF/compute_ke_eff.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class ComputeKEEff : public Compute { public: ComputeKEEff(class LAMMPS *, int, char **); - ~ComputeKEEff() {}; + ~ComputeKEEff(){}; void init(); double compute_scalar(); @@ -35,7 +35,7 @@ class ComputeKEEff : public Compute { double pfactor; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_temp_deform_eff.h b/src/USER-EFF/compute_temp_deform_eff.h index 1f8db39a6f..b591057352 100644 --- a/src/USER-EFF/compute_temp_deform_eff.h +++ b/src/USER-EFF/compute_temp_deform_eff.h @@ -41,14 +41,14 @@ class ComputeTempDeformEff : public Compute { protected: double tfactor; - double vbias[3]; // stored velocity bias for one atom - double **vbiasall; // stored velocity bias for all atoms - int maxbias; // size of vbiasall array + double vbias[3]; // stored velocity bias for one atom + double **vbiasall; // stored velocity bias for all atoms + int maxbias; // size of vbiasall array virtual void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_temp_eff.h b/src/USER-EFF/compute_temp_eff.h index 9b8d98b468..a5e72ab97d 100644 --- a/src/USER-EFF/compute_temp_eff.h +++ b/src/USER-EFF/compute_temp_eff.h @@ -39,7 +39,7 @@ class ComputeTempEff : public Compute { void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/compute_temp_region_eff.h b/src/USER-EFF/compute_temp_region_eff.h index e616462745..d5d39393a0 100644 --- a/src/USER-EFF/compute_temp_region_eff.h +++ b/src/USER-EFF/compute_temp_region_eff.h @@ -46,7 +46,7 @@ class ComputeTempRegionEff : public Compute { char *idregion; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_langevin_eff.h b/src/USER-EFF/fix_langevin_eff.h index 7779cb5837..c24d1cd81c 100644 --- a/src/USER-EFF/fix_langevin_eff.h +++ b/src/USER-EFF/fix_langevin_eff.h @@ -39,7 +39,7 @@ class FixLangevinEff : public FixLangevin { void post_force_tally(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nh_eff.h b/src/USER-EFF/fix_nh_eff.h index b98a4fa481..ba90ba0159 100644 --- a/src/USER-EFF/fix_nh_eff.h +++ b/src/USER-EFF/fix_nh_eff.h @@ -29,6 +29,6 @@ class FixNHEff : public FixNH { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-EFF/fix_nph_eff.h b/src/USER-EFF/fix_nph_eff.h index 7007289428..8b07a1f23d 100644 --- a/src/USER-EFF/fix_nph_eff.h +++ b/src/USER-EFF/fix_nph_eff.h @@ -30,7 +30,7 @@ class FixNPHEff : public FixNHEff { ~FixNPHEff() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_npt_eff.h b/src/USER-EFF/fix_npt_eff.h index 88af23a80a..b44521b0c4 100644 --- a/src/USER-EFF/fix_npt_eff.h +++ b/src/USER-EFF/fix_npt_eff.h @@ -30,7 +30,7 @@ class FixNPTEff : public FixNHEff { ~FixNPTEff() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nve_eff.h b/src/USER-EFF/fix_nve_eff.h index 367cceadf3..2a27ea4ac5 100644 --- a/src/USER-EFF/fix_nve_eff.h +++ b/src/USER-EFF/fix_nve_eff.h @@ -36,12 +36,12 @@ class FixNVEEff : public Fix { void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nvt_eff.h b/src/USER-EFF/fix_nvt_eff.h index 7b97b583a4..50999fb7a8 100644 --- a/src/USER-EFF/fix_nvt_eff.h +++ b/src/USER-EFF/fix_nvt_eff.h @@ -30,7 +30,7 @@ class FixNVTEff : public FixNHEff { ~FixNVTEff() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_nvt_sllod_eff.h b/src/USER-EFF/fix_nvt_sllod_eff.h index 6284ee9174..b7cb6d5c42 100644 --- a/src/USER-EFF/fix_nvt_sllod_eff.h +++ b/src/USER-EFF/fix_nvt_sllod_eff.h @@ -36,7 +36,7 @@ class FixNVTSllodEff : public FixNHEff { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/fix_temp_rescale_eff.h b/src/USER-EFF/fix_temp_rescale_eff.h index 7d37e51753..22282fbaee 100644 --- a/src/USER-EFF/fix_temp_rescale_eff.h +++ b/src/USER-EFF/fix_temp_rescale_eff.h @@ -37,15 +37,15 @@ class FixTempRescaleEff : public Fix { protected: int which; - double t_start,t_stop,t_window; - double fraction,energy,efactor; + double t_start, t_stop, t_window; + double fraction, energy, efactor; char *id_temp; class Compute *temperature; int tflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/pair_eff_cut.h b/src/USER-EFF/pair_eff_cut.h index f75c0ff4ed..c3cd07bab4 100644 --- a/src/USER-EFF/pair_eff_cut.h +++ b/src/USER-EFF/pair_eff_cut.h @@ -50,19 +50,19 @@ class PairEffCut : public Pair { double cut_global; double **cut; int ecp_type[100]; - double PAULI_CORE_A[100],PAULI_CORE_B[100],PAULI_CORE_C[100]; - double PAULI_CORE_D[100],PAULI_CORE_E[100]; + double PAULI_CORE_A[100], PAULI_CORE_B[100], PAULI_CORE_C[100]; + double PAULI_CORE_D[100], PAULI_CORE_E[100]; double hhmss2e, h2e; int nmax; - double *min_eradius,*min_erforce; + double *min_eradius, *min_erforce; void allocate(); void virial_eff_compute(); void ev_tally_eff(int, int, int, int, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-EFF/pair_eff_inline.h b/src/USER-EFF/pair_eff_inline.h index 4971b3d6ce..2b0198a56b 100644 --- a/src/USER-EFF/pair_eff_inline.h +++ b/src/USER-EFF/pair_eff_inline.h @@ -27,146 +27,134 @@ namespace LAMMPS_NS { // error arrays -double E1[] = -{ -1.483110564084803581889448079057, --3.01071073386594942470731046311E-1, -6.8994830689831566246603180718E-2, --1.3916271264722187682546525687E-2, -2.420799522433463662891678239E-3, --3.65863968584808644649382577E-4, -4.8620984432319048282887568E-5, --5.749256558035684835054215E-6, -6.11324357843476469706758E-7, --5.8991015312958434390846E-8, -5.207009092068648240455E-9, --4.23297587996554326810E-10, -3.1881135066491749748E-11, --2.236155018832684273E-12, -1.46732984799108492E-13, --9.044001985381747E-15, -5.25481371547092E-16, --2.8874261222849E-17, -1.504785187558E-18, --7.4572892821E-20, -3.522563810E-21, --1.58944644E-22, -6.864365E-24, --2.84257E-25, -1.1306E-26, --4.33E-28, -1.6E-29, --1.0E-30 -}; +double E1[] = {1.483110564084803581889448079057, + -3.01071073386594942470731046311E-1, + 6.8994830689831566246603180718E-2, + -1.3916271264722187682546525687E-2, + 2.420799522433463662891678239E-3, + -3.65863968584808644649382577E-4, + 4.8620984432319048282887568E-5, + -5.749256558035684835054215E-6, + 6.11324357843476469706758E-7, + -5.8991015312958434390846E-8, + 5.207009092068648240455E-9, + -4.23297587996554326810E-10, + 3.1881135066491749748E-11, + -2.236155018832684273E-12, + 1.46732984799108492E-13, + -9.044001985381747E-15, + 5.25481371547092E-16, + -2.8874261222849E-17, + 1.504785187558E-18, + -7.4572892821E-20, + 3.522563810E-21, + -1.58944644E-22, + 6.864365E-24, + -2.84257E-25, + 1.1306E-26, + -4.33E-28, + 1.6E-29, + -1.0E-30}; -double E2[] = -{ -1.077977852072383151168335910348, --2.6559890409148673372146500904E-2, --1.487073146698099509605046333E-3, --1.38040145414143859607708920E-4, --1.1280303332287491498507366E-5, --1.172869842743725224053739E-6, --1.03476150393304615537382E-7, --1.1899114085892438254447E-8, --1.016222544989498640476E-9, --1.37895716146965692169E-10, --9.369613033737303335E-12, --1.918809583959525349E-12, --3.7573017201993707E-14, --3.7053726026983357E-14, -2.627565423490371E-15, --1.121322876437933E-15, -1.84136028922538E-16, --4.9130256574886E-17, -1.0704455167373E-17, --2.671893662405E-18, -6.49326867976E-19, --1.65399353183E-19, -4.2605626604E-20, --1.1255840765E-20, -3.025617448E-21, --8.29042146E-22, -2.31049558E-22, --6.5469511E-23, -1.8842314E-23, --5.504341E-24, -1.630950E-24, --4.89860E-25, -1.49054E-25, --4.5922E-26, -1.4318E-26, --4.516E-27, -1.440E-27, --4.64E-28, -1.51E-28, --5.0E-29, -1.7E-29, --6.0E-30, -2.0E-30, --1.0E-30 -}; +double E2[] = {1.077977852072383151168335910348, + -2.6559890409148673372146500904E-2, + -1.487073146698099509605046333E-3, + -1.38040145414143859607708920E-4, + -1.1280303332287491498507366E-5, + -1.172869842743725224053739E-6, + -1.03476150393304615537382E-7, + -1.1899114085892438254447E-8, + -1.016222544989498640476E-9, + -1.37895716146965692169E-10, + -9.369613033737303335E-12, + -1.918809583959525349E-12, + -3.7573017201993707E-14, + -3.7053726026983357E-14, + 2.627565423490371E-15, + -1.121322876437933E-15, + 1.84136028922538E-16, + -4.9130256574886E-17, + 1.0704455167373E-17, + -2.671893662405E-18, + 6.49326867976E-19, + -1.65399353183E-19, + 4.2605626604E-20, + -1.1255840765E-20, + 3.025617448E-21, + -8.29042146E-22, + 2.31049558E-22, + -6.5469511E-23, + 1.8842314E-23, + -5.504341E-24, + 1.630950E-24, + -4.89860E-25, + 1.49054E-25, + -4.5922E-26, + 1.4318E-26, + -4.516E-27, + 1.440E-27, + -4.64E-28, + 1.51E-28, + -5.0E-29, + 1.7E-29, + -6.0E-30, + 2.0E-30, + -1.0E-30}; -double DE1[] = -{ --0.689379974848418501361491576718, -0.295939056851161774752959335568, --0.087237828075228616420029484096, -0.019959734091835509766546612696, --0.003740200486895490324750329974, -0.000593337912367800463413186784, --0.000081560801047403878256504204, -9.886099179971884018535968E-6, --1.071209234904290565745194E-6, -1.0490945447626050322784E-7, --9.370959271038746709966E-9, -7.6927263488753841874E-10, --5.8412335114551520146E-11, -4.125393291736424788E-12, --2.72304624901729048E-13, -1.6869717361387012E-14, --9.84565340276638E-16, -5.4313471880068E-17, --2.840458699772E-18, -1.4120512798E-19, --6.688772574E-21, -3.0257558E-22, --1.3097526E-23, -5.4352E-25, --2.1704E-26, -8.32E-28, --5.4E-29 -}; +double DE1[] = {-0.689379974848418501361491576718, + 0.295939056851161774752959335568, + -0.087237828075228616420029484096, + 0.019959734091835509766546612696, + -0.003740200486895490324750329974, + 0.000593337912367800463413186784, + -0.000081560801047403878256504204, + 9.886099179971884018535968E-6, + -1.071209234904290565745194E-6, + 1.0490945447626050322784E-7, + -9.370959271038746709966E-9, + 7.6927263488753841874E-10, + -5.8412335114551520146E-11, + 4.125393291736424788E-12, + -2.72304624901729048E-13, + 1.6869717361387012E-14, + -9.84565340276638E-16, + 5.4313471880068E-17, + -2.840458699772E-18, + 1.4120512798E-19, + -6.688772574E-21, + 3.0257558E-22, + -1.3097526E-23, + 5.4352E-25, + -2.1704E-26, + 8.32E-28, + -5.4E-29}; -double DE2[] = -{ -0.717710208167480928473053690384, --0.379868973985143305103199928808, -0.125832094465157378967135019248, --0.030917661684228839423081992424, -0.006073689914144320367855343072, --0.000996057789064916825079352632, -0.000140310790466315733723475232, --0.000017328176496070286001302184, -1.90540194670935746397168e-6, --1.8882873760163694937908e-7, -1.703176613666840587056e-8, --1.40955218086201517976e-9, -1.0776816914256065828e-10, --7.656138112778696256e-12, -5.07943557413613792e-13, --3.1608615530282912e-14, -1.852036572003432e-15, --1.02524641430496e-16, -5.37852808112e-18, --2.68128238704e-19, -1.273321788e-20, --5.77335744e-22, -2.504352e-23, --1.0446e-24, -4.16e-26, --2.808e-27 -}; +double DE2[] = {0.717710208167480928473053690384, + -0.379868973985143305103199928808, + 0.125832094465157378967135019248, + -0.030917661684228839423081992424, + 0.006073689914144320367855343072, + -0.000996057789064916825079352632, + 0.000140310790466315733723475232, + -0.000017328176496070286001302184, + 1.90540194670935746397168e-6, + -1.8882873760163694937908e-7, + 1.703176613666840587056e-8, + -1.40955218086201517976e-9, + 1.0776816914256065828e-10, + -7.656138112778696256e-12, + 5.07943557413613792e-13, + -3.1608615530282912e-14, + 1.852036572003432e-15, + -1.02524641430496e-16, + 5.37852808112e-18, + -2.68128238704e-19, + 1.273321788e-20, + -5.77335744e-22, + 2.504352e-23, + -1.0446e-24, + 4.16e-26, + -2.808e-27}; // inline functions for performance @@ -177,13 +165,14 @@ inline double ipoly02(double x) /* P(x) in the range x > 2 */ int i; double b0, b1, b2; - b1 = 0.0; b0 = 0.0; x *= 2; - for (i = ERF_TERMS2; i >= 0; i--) - { - b2 = b1; - b1 = b0; - b0 = x * b1 - b2 + E2[i]; - } + b1 = 0.0; + b0 = 0.0; + x *= 2; + for (i = ERF_TERMS2; i >= 0; i--) { + b2 = b1; + b1 = b0; + b0 = x * b1 - b2 + E2[i]; + } return 0.5 * (b0 - b2); } @@ -195,13 +184,14 @@ inline double ipoly1(double x) int i; double b0, b1, b2; - b1 = 0.0; b0 = 0.0; x *= 2; - for (i = DERF_TERMS; i >= 0; i--) - { - b2 = b1; - b1 = b0; - b0 = x * b1 - b2 + DE1[i]; - } + b1 = 0.0; + b0 = 0.0; + x *= 2; + for (i = DERF_TERMS; i >= 0; i--) { + b2 = b1; + b1 = b0; + b0 = x * b1 - b2 + DE1[i]; + } return 0.5 * (b0 - b2); } @@ -213,13 +203,14 @@ inline double ipoly01(double x) int i; double b0, b1, b2; - b1 = 0.0; b0 = 0.0; x *= 2; - for (i = ERF_TERMS1; i >= 0; i--) - { - b2 = b1; - b1 = b0; - b0 = x * b1 - b2 + E1[i]; - } + b1 = 0.0; + b0 = 0.0; + x *= 2; + for (i = ERF_TERMS1; i >= 0; i--) { + b2 = b1; + b1 = b0; + b0 = x * b1 - b2 + E1[i]; + } return 0.5 * (b0 - b2); } @@ -230,28 +221,25 @@ inline double ierfoverx1(double x, double *df) // Computes Erf(x)/x and its first derivative double t, f; - double x2; // x squared + double x2; // x squared double exp_term, recip_x; - if (x < 2.0) - { - /* erf(x) = x * y(t) */ - /* t = 2 * (x/2)^2 - 1. */ - t = 0.5 * x * x - 1; - f = ipoly01(t); - *df = ipoly1(t) * x; - } - else - { - /* erf(x) = 1 - exp(-x^2)/x * y(t) */ - /* t = (10.5 - x^2) / (2.5 + x^2) */ - x2 = x * x; - t = (10.5 - x2) / (2.5 + x2); - exp_term = exp(-x2); - recip_x = 1.0 / x; - f = 1.0 / x - (exp_term / x2) * ipoly02(t); - *df = (1.12837916709551257389615890312 * exp_term - f) * recip_x; - } + if (x < 2.0) { + /* erf(x) = x * y(t) */ + /* t = 2 * (x/2)^2 - 1. */ + t = 0.5 * x * x - 1; + f = ipoly01(t); + *df = ipoly1(t) * x; + } else { + /* erf(x) = 1 - exp(-x^2)/x * y(t) */ + /* t = (10.5 - x^2) / (2.5 + x^2) */ + x2 = x * x; + t = (10.5 - x2) / (2.5 + x2); + exp_term = exp(-x2); + recip_x = 1.0 / x; + f = 1.0 / x - (exp_term / x2) * ipoly02(t); + *df = (1.12837916709551257389615890312 * exp_term - f) * recip_x; + } return f; } @@ -273,8 +261,7 @@ inline void ElecNucNuc(double q, double rc, double *ecoul, double *frc) /* ---------------------------------------------------------------------- */ -inline void ElecNucElec(double q, double rc, double re1, - double *ecoul, double *frc, double *fre1) +inline void ElecNucElec(double q, double rc, double re1, double *ecoul, double *frc, double *fre1) { double a, arc; double coeff_a; @@ -302,9 +289,8 @@ inline void ElecNucElec(double q, double rc, double re1, /* ---------------------------------------------------------------------- */ -inline void ElecElecElec(double rc, double re1, double re2, - double *ecoul, double *frc, double *fre1, - double *fre2) +inline void ElecElecElec(double rc, double re1, double re2, double *ecoul, double *frc, + double *fre1, double *fre2) { double a, arc, re, fre; double coeff_a; @@ -347,7 +333,7 @@ inline void ElecCoreNuc(double q, double rc, double re1, double *ecoul, double * double coeff_a; double E, dEdr, df, f; - coeff_a = 1.4142135623730951; /* sqrt(2) */ + coeff_a = 1.4142135623730951; /* sqrt(2) */ a = coeff_a / re1; arc = a * rc; @@ -361,8 +347,7 @@ inline void ElecCoreNuc(double q, double rc, double re1, double *ecoul, double * /* ---------------------------------------------------------------------- */ -inline void ElecCoreCore(double q, double rc, double re1, double re2, - double *ecoul, double *frc) +inline void ElecCoreCore(double q, double rc, double re1, double re2, double *ecoul, double *frc) { double a, arc, re; double coeff_a; @@ -384,10 +369,10 @@ inline void ElecCoreCore(double q, double rc, double re1, double re2, /* ---------------------------------------------------------------------- */ -inline void ElecCoreElec(double q, double rc, double re1, double re2, - double *ecoul, double *frc, double *fre2) +inline void ElecCoreElec(double q, double rc, double re1, double re2, double *ecoul, double *frc, + double *fre2) { - double a,arc, re; + double a, arc, re; double coeff_a; double E, dEdr, dEdr2, f, df, fre; @@ -419,8 +404,7 @@ inline void ElecCoreElec(double q, double rc, double re1, double re2, /* ---------------------------------------------------------------------- */ -inline void PauliElecElec(int samespin, double rc, - double re1, double re2, double *epauli, +inline void PauliElecElec(int samespin, double rc, double re1, double re2, double *epauli, double *frc, double *fre1, double *fre2) { double ree, rem; @@ -429,30 +413,31 @@ inline void PauliElecElec(int samespin, double rc, double dTdr1, dTdr2, dTdr; double O, dOdS, ratio; - re1 *= PAULI_RE; re2 *= PAULI_RE; rc *= PAULI_RC; + re1 *= PAULI_RE; + re2 *= PAULI_RE; + rc *= PAULI_RC; ree = re1 * re1 + re2 * re2; rem = re1 * re1 - re2 * re2; - S = (2.82842712474619 / pow((re2 / re1 + re1 / re2), 1.5)) * - exp(-rc * rc / ree); + S = (2.82842712474619 / pow((re2 / re1 + re1 / re2), 1.5)) * exp(-rc * rc / ree); - t1 = 1.5 * (1 / (re1 * re1) + 1 / (re2 * re2)); - t2 = 2.0 * (3 * ree - 2 * rc * rc) / (ree * ree); + t1 = 1.5 * (1 / (re1 * re1) + 1 / (re2 * re2)); + t2 = 2.0 * (3 * ree - 2 * rc * rc) / (ree * ree); tt = t1 - t2; dSdr1 = (-1.5 / re1) * (rem / ree) + 2 * re1 * rc * rc / (ree * ree); dSdr2 = (1.5 / re2) * (rem / ree) + 2 * re2 * rc * rc / (ree * ree); - dSdr = -2 * rc / ree; - dTdr1 = -3 / (re1 * re1 * re1) - 12 * re1 / (ree * ree) + 8 * re1 * - (-2 * rc * rc + 3 * ree) / (ree * ree * ree); - dTdr2 = -3 / (re2 * re2 * re2) - 12 * re2 / (ree * ree) + 8 * re2 * - (-2 * rc * rc + 3 * ree) / (ree * ree * ree); - dTdr = 8 * rc / (ree * ree); + dSdr = -2 * rc / ree; + dTdr1 = -3 / (re1 * re1 * re1) - 12 * re1 / (ree * ree) + + 8 * re1 * (-2 * rc * rc + 3 * ree) / (ree * ree * ree); + dTdr2 = -3 / (re2 * re2 * re2) - 12 * re2 / (ree * ree) + + 8 * re2 * (-2 * rc * rc + 3 * ree) / (ree * ree * ree); + dTdr = 8 * rc / (ree * ree); if (samespin == 1) { O = S * S / (1.0 - S * S) + (1 - PAULI_RHO) * S * S / (1.0 + S * S); dOdS = 2 * S / ((1.0 - S * S) * (1.0 - S * S)) + - (1 - PAULI_RHO) * 2 * S / ((1.0 + S * S) * (1.0 + S * S)); + (1 - PAULI_RHO) * 2 * S / ((1.0 + S * S) * (1.0 + S * S)); } else { O = -PAULI_RHO * S * S / (1.0 + S * S); dOdS = -PAULI_RHO * 2 * S / ((1.0 + S * S) * (1.0 + S * S)); @@ -461,14 +446,14 @@ inline void PauliElecElec(int samespin, double rc, ratio = tt * dOdS * S; *fre1 -= PAULI_RE * (dTdr1 * O + ratio * dSdr1); *fre2 -= PAULI_RE * (dTdr2 * O + ratio * dSdr2); - *frc -= PAULI_RC * (dTdr * O + ratio * dSdr); - *epauli += tt*O; + *frc -= PAULI_RC * (dTdr * O + ratio * dSdr); + *epauli += tt * O; } /* ---------------------------------------------------------------------- */ -inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, - double *fre2, double PAULI_CORE_A, double PAULI_CORE_B, double PAULI_CORE_C) +inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, double *fre2, + double PAULI_CORE_A, double PAULI_CORE_B, double PAULI_CORE_C) { double E, dEdrc, dEdre2, rcsq, ssq; @@ -477,11 +462,12 @@ inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, E = PAULI_CORE_A * exp((-PAULI_CORE_B * rcsq) / (ssq + PAULI_CORE_C)); - dEdrc = -2 * PAULI_CORE_A * PAULI_CORE_B * rc * exp(-PAULI_CORE_B * rcsq / - (ssq + PAULI_CORE_C)) / (ssq + PAULI_CORE_C); + dEdrc = -2 * PAULI_CORE_A * PAULI_CORE_B * rc * exp(-PAULI_CORE_B * rcsq / (ssq + PAULI_CORE_C)) / + (ssq + PAULI_CORE_C); - dEdre2 = 2 * PAULI_CORE_A * PAULI_CORE_B * re2 * rcsq * exp(-PAULI_CORE_B * rcsq / - (ssq + PAULI_CORE_C)) / ((PAULI_CORE_C + ssq)*(PAULI_CORE_C + ssq)); + dEdre2 = 2 * PAULI_CORE_A * PAULI_CORE_B * re2 * rcsq * + exp(-PAULI_CORE_B * rcsq / (ssq + PAULI_CORE_C)) / + ((PAULI_CORE_C + ssq) * (PAULI_CORE_C + ssq)); *epauli += E; *frc -= dEdrc; @@ -490,34 +476,32 @@ inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, /* ---------------------------------------------------------------------- */ -inline void PauliCorePElec(double rc, double re2, double *epauli, double *frc, - double *fre2, double PAULI_CORE_P_A, - double PAULI_CORE_P_B, double PAULI_CORE_P_C, - double PAULI_CORE_P_D, double PAULI_CORE_P_E) +inline void PauliCorePElec(double rc, double re2, double *epauli, double *frc, double *fre2, + double PAULI_CORE_P_A, double PAULI_CORE_P_B, double PAULI_CORE_P_C, + double PAULI_CORE_P_D, double PAULI_CORE_P_E) { double E, dEdrc, dEdre2; - E = PAULI_CORE_P_A * - pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * - pow((rc - PAULI_CORE_P_C * re2), 2.0) * exp(-PAULI_CORE_P_D * - pow((rc - PAULI_CORE_P_C * re2), 2.0) / (PAULI_CORE_P_E + re2 * re2)); + E = PAULI_CORE_P_A * pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * + pow((rc - PAULI_CORE_P_C * re2), 2.0) * + exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / (PAULI_CORE_P_E + re2 * re2)); - dEdrc = PAULI_CORE_P_A * - pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * - 2.0 * (rc - PAULI_CORE_P_C * re2) * exp(-PAULI_CORE_P_D * - pow((rc - PAULI_CORE_P_C * re2), 2.0) / (PAULI_CORE_P_E + re2 * re2)) - + E * (-PAULI_CORE_P_D * 2.0 * (rc - PAULI_CORE_P_C * re2) / - (PAULI_CORE_P_E + re2 * re2)); + dEdrc = PAULI_CORE_P_A * pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * 2.0 * + (rc - PAULI_CORE_P_C * re2) * + exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / + (PAULI_CORE_P_E + re2 * re2)) + + E * (-PAULI_CORE_P_D * 2.0 * (rc - PAULI_CORE_P_C * re2) / (PAULI_CORE_P_E + re2 * re2)); - dEdre2 = E * (-5.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B) * - (-PAULI_CORE_P_B / (re2 * re2) + 1.0 / PAULI_CORE_P_B)) - + PAULI_CORE_P_A * - pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * - 2.0 * (rc - PAULI_CORE_P_C * re2) * (-PAULI_CORE_P_C) * - exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / - (PAULI_CORE_P_E + re2 * re2)) + E * (2.0 * PAULI_CORE_P_D * - (rc - PAULI_CORE_P_C * re2) * (PAULI_CORE_P_C * PAULI_CORE_P_E + - rc * re2) / pow((PAULI_CORE_P_E + re2 * re2), 2.0)); + dEdre2 = E * + (-5.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B) * + (-PAULI_CORE_P_B / (re2 * re2) + 1.0 / PAULI_CORE_P_B)) + + PAULI_CORE_P_A * pow((2.0 / (PAULI_CORE_P_B / re2 + re2 / PAULI_CORE_P_B)), 5.0) * 2.0 * + (rc - PAULI_CORE_P_C * re2) * (-PAULI_CORE_P_C) * + exp(-PAULI_CORE_P_D * pow((rc - PAULI_CORE_P_C * re2), 2.0) / + (PAULI_CORE_P_E + re2 * re2)) + + E * + (2.0 * PAULI_CORE_P_D * (rc - PAULI_CORE_P_C * re2) * + (PAULI_CORE_P_C * PAULI_CORE_P_E + rc * re2) / pow((PAULI_CORE_P_E + re2 * re2), 2.0)); *epauli += E; *frc -= dEdrc; @@ -526,8 +510,8 @@ inline void PauliCorePElec(double rc, double re2, double *epauli, double *frc, /* ---------------------------------------------------------------------- */ -inline void RForce(double dx, double dy, double dz, - double rc, double force, double *fx, double *fy, double *fz) +inline void RForce(double dx, double dy, double dz, double rc, double force, double *fx, double *fy, + double *fz) { force /= rc; *fx = force * dx; @@ -537,22 +521,29 @@ inline void RForce(double dx, double dy, double dz, /* ---------------------------------------------------------------------- */ -inline void SmallRForce(double dx, double dy, double dz, - double rc, double force, - double *fx, double *fy, double *fz) +inline void SmallRForce(double dx, double dy, double dz, double rc, double force, double *fx, + double *fy, double *fz) { /* Handles case where rc is small to avoid division by zero */ if (rc > 0.000001) { force /= rc; - *fx = force * dx; *fy = force * dy; *fz = force * dz; + *fx = force * dx; + *fy = force * dy; + *fz = force * dz; } else { - if (dx != 0) *fx = force / sqrt(1 + (dy * dy + dz * dz) / (dx * dx)); - else *fx = 0.0; - if (dy != 0) *fy = force / sqrt(1 + (dx * dx + dz * dz) / (dy * dy)); - else *fy = 0.0; - if (dz != 0) *fz = force / sqrt(1 + (dx * dx + dy * dy) / (dz * dz)); - else *fz = 0.0; + if (dx != 0) + *fx = force / sqrt(1 + (dy * dy + dz * dz) / (dx * dx)); + else + *fx = 0.0; + if (dy != 0) + *fy = force / sqrt(1 + (dx * dx + dz * dz) / (dy * dy)); + else + *fy = 0.0; + if (dz != 0) + *fz = force / sqrt(1 + (dx * dx + dy * dy) / (dz * dz)); + else + *fz = 0.0; // if (dx < 0) *fx = -*fx; // if (dy < 0) *fy = -*fy; // if (dz < 0) *fz = -*fz; @@ -583,4 +574,4 @@ inline double dcutoff(double x) return (((140 * x - 420) * x + 420) * x - 140) * x * x * x; } -} +} // namespace LAMMPS_NS diff --git a/src/USER-FEP/compute_fep.h b/src/USER-FEP/compute_fep.h index 302a3d19e2..ce38ea84bc 100644 --- a/src/USER-FEP/compute_fep.h +++ b/src/USER-FEP/compute_fep.h @@ -47,22 +47,22 @@ class ComputeFEP : public Compute { int nmax; double *q_orig; double **f_orig; - double eng_vdwl_orig,eng_coul_orig; + double eng_vdwl_orig, eng_coul_orig; double pvirial_orig[6]; - double *peatom_orig,**pvatom_orig; + double *peatom_orig, **pvatom_orig; double energy_orig; double kvirial_orig[6]; - double *keatom_orig,**kvatom_orig; + double *keatom_orig, **kvatom_orig; class Fix *fixgpu; struct Perturb { - int which,ivar; + int which, ivar; char *var; - char *pstyle,*pparam; - int ilo,ihi,jlo,jhi; + char *pstyle, *pparam; + int ilo, ihi, jlo, jhi; int pdim; - double **array,**array_orig; + double **array, **array_orig; int aparam; }; @@ -78,7 +78,7 @@ class ComputeFEP : public Compute { void restore_qfev(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/fix_adapt_fep.h b/src/USER-FEP/fix_adapt_fep.h index 8bc0b95a4a..0c20c83047 100644 --- a/src/USER-FEP/fix_adapt_fep.h +++ b/src/USER-FEP/fix_adapt_fep.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixAdaptFEP : public Fix { public: - int diamflag; // 1 if atom diameters will vary, for AtomVecGranular + int diamflag; // 1 if atom diameters will vary, for AtomVecGranular int chgflag; FixAdaptFEP(class LAMMPS *, int, char **); @@ -37,25 +37,25 @@ class FixAdaptFEP : public Fix { void setup_pre_force(int); void pre_force(int); void post_run(); - void setup_pre_force_respa(int,int); - void pre_force_respa(int,int,int); + void setup_pre_force_respa(int, int); + void pre_force_respa(int, int, int); void set_arrays(int); private: - int nadapt,resetflag,scaleflag,afterflag; + int nadapt, resetflag, scaleflag, afterflag; int anypair; int nlevels_respa; - char *id_fix_diam,*id_fix_chg; - class FixStore *fix_diam,*fix_chg; + char *id_fix_diam, *id_fix_chg; + class FixStore *fix_diam, *fix_chg; struct Adapt { - int which,ivar; + int which, ivar; char *var; - char *pstyle,*pparam; - int ilo,ihi,jlo,jhi; + char *pstyle, *pparam; + int ilo, ihi, jlo, jhi; int pdim; - double *scalar,scalar_orig; - double **array,**array_orig; + double *scalar, scalar_orig; + double **array, **array_orig; int aparam; }; @@ -66,7 +66,7 @@ class FixAdaptFEP : public Fix { void restore_settings(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_coul_cut_soft.h b/src/USER-FEP/pair_coul_cut_soft.h index 457dd8f99e..3e5388c604 100644 --- a/src/USER-FEP/pair_coul_cut_soft.h +++ b/src/USER-FEP/pair_coul_cut_soft.h @@ -52,7 +52,7 @@ class PairCoulCutSoft : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_coul_long_soft.h b/src/USER-FEP/pair_coul_long_soft.h index 2cc7c482ca..1992689f9d 100644 --- a/src/USER-FEP/pair_coul_long_soft.h +++ b/src/USER-FEP/pair_coul_long_soft.h @@ -41,18 +41,18 @@ class PairCoulLongSoft : public Pair { virtual void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq; + double cut_coul, cut_coulsq; double **scale; double **lambda; double nlambda, alphac; double **lam1, **lam2; - double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) + double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.h b/src/USER-FEP/pair_lj_charmm_coul_long_soft.h index 46df46ddd7..b14d652acf 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.h +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.h @@ -49,22 +49,22 @@ class PairLJCharmmCoulLongSoft : public Pair { protected: int implicit; - double cut_lj_inner,cut_lj; - double cut_lj_innersq,cut_ljsq; - double cut_coul,cut_coulsq; + double cut_lj_inner, cut_lj; + double cut_lj_innersq, cut_ljsq; + double cut_coul, cut_coulsq; double cut_bothsq; double denom_lj; - double **epsilon,**sigma,**eps14,**sigma14,**lambda; + double **epsilon, **sigma, **eps14, **sigma14, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; - double **lj14_1,**lj14_2,**lj14_3,**lj14_4; + double **lj1, **lj2, **lj3, **lj4, **offset; + double **lj14_1, **lj14_2, **lj14_3, **lj14_4; double *cut_respa; double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_class2_coul_cut_soft.h b/src/USER-FEP/pair_lj_class2_coul_cut_soft.h index 750a8ee1f5..74302292c9 100644 --- a/src/USER-FEP/pair_lj_class2_coul_cut_soft.h +++ b/src/USER-FEP/pair_lj_class2_coul_cut_soft.h @@ -43,17 +43,17 @@ class PairLJClass2CoulCutSoft : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma, **lambda; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_class2_coul_long_soft.h b/src/USER-FEP/pair_lj_class2_coul_long_soft.h index 3b11e38e9b..b7ae026c0e 100644 --- a/src/USER-FEP/pair_lj_class2_coul_long_soft.h +++ b/src/USER-FEP/pair_lj_class2_coul_long_soft.h @@ -44,17 +44,17 @@ class PairLJClass2CoulLongSoft : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma, **lambda; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_class2_soft.h b/src/USER-FEP/pair_lj_class2_soft.h index 778b120279..45cbea0a30 100644 --- a/src/USER-FEP/pair_lj_class2_soft.h +++ b/src/USER-FEP/pair_lj_class2_soft.h @@ -44,12 +44,12 @@ class PairLJClass2Soft : public Pair { double **cut; double **epsilon, **sigma, **lambda; double nlambda, alphalj; - double **lj1,**lj2,**lj3,**offset; + double **lj1, **lj2, **lj3, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.h b/src/USER-FEP/pair_lj_cut_coul_cut_soft.h index 303829e1a9..bc82a67f97 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.h +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.h @@ -43,17 +43,17 @@ class PairLJCutCoulCutSoft : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma, **lambda; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.h b/src/USER-FEP/pair_lj_cut_coul_long_soft.h index cef0f1e11b..5618d7d009 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.h +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.h @@ -48,19 +48,19 @@ class PairLJCutCoulLongSoft : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma, **lambda; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **lambda; double nlambda, alphalj, alphac; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) + double qdist; // TIP4P distance O to negative charge (compatibility of cutoffs) double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_soft.h b/src/USER-FEP/pair_lj_cut_soft.h index 976056f8aa..7350ef646f 100644 --- a/src/USER-FEP/pair_lj_cut_soft.h +++ b/src/USER-FEP/pair_lj_cut_soft.h @@ -49,15 +49,15 @@ class PairLJCutSoft : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma, **lambda; + double **epsilon, **sigma, **lambda; double nlambda, alphalj; - double **lj1,**lj2,**lj3,**offset; + double **lj1, **lj2, **lj3, **offset; double *cut_respa; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h index 803c49fbdb..b3f6dd26b6 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.h @@ -38,19 +38,19 @@ class PairLJCutTIP4PLongSoft : public PairLJCutCoulLongSoft { virtual double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_morse_soft.h b/src/USER-FEP/pair_morse_soft.h index 8a357d9059..1cc7cec4ec 100644 --- a/src/USER-FEP/pair_morse_soft.h +++ b/src/USER-FEP/pair_morse_soft.h @@ -29,7 +29,7 @@ namespace LAMMPS_NS { class PairMorseSoft : public PairMorse { public: - PairMorseSoft(class LAMMPS *lmp) : PairMorse(lmp), lambda(nullptr) {}; + PairMorseSoft(class LAMMPS *lmp) : PairMorse(lmp), lambda(nullptr){}; virtual ~PairMorseSoft(); virtual void compute(int, int); @@ -55,7 +55,7 @@ class PairMorseSoft : public PairMorse { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-FEP/pair_tip4p_long_soft.h b/src/USER-FEP/pair_tip4p_long_soft.h index 397b490185..1435e9b7a5 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.h +++ b/src/USER-FEP/pair_tip4p_long_soft.h @@ -38,19 +38,19 @@ class PairTIP4PLongSoft : public PairCoulLongSoft { virtual double memory_usage(); protected: - int typeH,typeO; // atom types of TIP4P water H and O atoms - int typeA,typeB; // angle and bond types of TIP4P water - double alpha; // geometric constraint parameter for TIP4P + int typeH, typeO; // atom types of TIP4P water H and O atoms + int typeA, typeB; // angle and bond types of TIP4P water + double alpha; // geometric constraint parameter for TIP4P - int nmax; // info on off-oxygen charge sites - int **hneigh; // 0,1 = indices of 2 H associated with O - // 2 = 0 if site loc not yet computed, 1 if yes - double **newsite; // locations of charge sites + int nmax; // info on off-oxygen charge sites + int **hneigh; // 0,1 = indices of 2 H associated with O + // 2 = 0 if site loc not yet computed, 1 if yes + double **newsite; // locations of charge sites void compute_newsite(double *, double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-H5MD/dump_h5md.h b/src/USER-H5MD/dump_h5md.h index be0964f8fa..c8c5d87100 100644 --- a/src/USER-H5MD/dump_h5md.h +++ b/src/USER-H5MD/dump_h5md.h @@ -21,19 +21,19 @@ DumpStyle(h5md,DumpH5MD); #ifndef LMP_DUMP_H5MD_H #define LMP_DUMP_H5MD_H -#include "dump.h" #include "ch5md.h" +#include "dump.h" namespace LAMMPS_NS { class DumpH5MD : public Dump { public: - DumpH5MD(class LAMMPS *, int, char**); + DumpH5MD(class LAMMPS *, int, char **); virtual ~DumpH5MD(); private: - int natoms,ntotal; - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no + int natoms, ntotal; + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no h5md_file datafile; int datafile_from_dump; h5md_particles_group particles_data; @@ -68,7 +68,7 @@ class DumpH5MD : public Dump { void write_fixed_frame(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-INTEL/angle_charmm_intel.h b/src/USER-INTEL/angle_charmm_intel.h index f37d224247..6cff72a636 100644 --- a/src/USER-INTEL/angle_charmm_intel.h +++ b/src/USER-INTEL/angle_charmm_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/angle_harmonic_intel.h b/src/USER-INTEL/angle_harmonic_intel.h index 809a939390..baa616e745 100644 --- a/src/USER-INTEL/angle_harmonic_intel.h +++ b/src/USER-INTEL/angle_harmonic_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/bond_fene_intel.h b/src/USER-INTEL/bond_fene_intel.h index 540c2413de..ac1c443190 100644 --- a/src/USER-INTEL/bond_fene_intel.h +++ b/src/USER-INTEL/bond_fene_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/bond_harmonic_intel.h b/src/USER-INTEL/bond_harmonic_intel.h index d1a567395b..2ade78154a 100644 --- a/src/USER-INTEL/bond_harmonic_intel.h +++ b/src/USER-INTEL/bond_harmonic_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/dihedral_charmm_intel.h b/src/USER-INTEL/dihedral_charmm_intel.h index 769b26d1f8..49fce62732 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.h +++ b/src/USER-INTEL/dihedral_charmm_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/dihedral_fourier_intel.h b/src/USER-INTEL/dihedral_fourier_intel.h index aef6ba110a..b9ffad78fc 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.h +++ b/src/USER-INTEL/dihedral_fourier_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/dihedral_harmonic_intel.h b/src/USER-INTEL/dihedral_harmonic_intel.h index 3577d0a22e..17923383bc 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.h +++ b/src/USER-INTEL/dihedral_harmonic_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/dihedral_opls_intel.h b/src/USER-INTEL/dihedral_opls_intel.h index 404241eec7..c7567b7843 100644 --- a/src/USER-INTEL/dihedral_opls_intel.h +++ b/src/USER-INTEL/dihedral_opls_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/fix_intel.h b/src/USER-INTEL/fix_intel.h index c53b812187..8ee4a28a50 100644 --- a/src/USER-INTEL/fix_intel.h +++ b/src/USER-INTEL/fix_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/fix_nh_intel.h b/src/USER-INTEL/fix_nh_intel.h index a2a53bb616..eb818d87a9 100644 --- a/src/USER-INTEL/fix_nh_intel.h +++ b/src/USER-INTEL/fix_nh_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/fix_npt_intel.h b/src/USER-INTEL/fix_npt_intel.h index 4928f31450..7b0b0233f9 100644 --- a/src/USER-INTEL/fix_npt_intel.h +++ b/src/USER-INTEL/fix_npt_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/fix_nve_asphere_intel.h b/src/USER-INTEL/fix_nve_asphere_intel.h index 3232906047..a9be989e43 100644 --- a/src/USER-INTEL/fix_nve_asphere_intel.h +++ b/src/USER-INTEL/fix_nve_asphere_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/fix_nve_intel.h b/src/USER-INTEL/fix_nve_intel.h index ea393249cd..fe2ffcc809 100644 --- a/src/USER-INTEL/fix_nve_intel.h +++ b/src/USER-INTEL/fix_nve_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/fix_nvt_intel.h b/src/USER-INTEL/fix_nvt_intel.h index 8e3d4c4a33..5f30999353 100644 --- a/src/USER-INTEL/fix_nvt_intel.h +++ b/src/USER-INTEL/fix_nvt_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/fix_nvt_sllod_intel.h b/src/USER-INTEL/fix_nvt_sllod_intel.h index 8f59a91571..3185d3beff 100644 --- a/src/USER-INTEL/fix_nvt_sllod_intel.h +++ b/src/USER-INTEL/fix_nvt_sllod_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/improper_cvff_intel.h b/src/USER-INTEL/improper_cvff_intel.h index 75c245ed40..c645f849a6 100644 --- a/src/USER-INTEL/improper_cvff_intel.h +++ b/src/USER-INTEL/improper_cvff_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/improper_harmonic_intel.h b/src/USER-INTEL/improper_harmonic_intel.h index c282f3fa6e..3a7ee546dc 100644 --- a/src/USER-INTEL/improper_harmonic_intel.h +++ b/src/USER-INTEL/improper_harmonic_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/intel_buffers.h b/src/USER-INTEL/intel_buffers.h index eafe3ad845..87da5cbab5 100644 --- a/src/USER-INTEL/intel_buffers.h +++ b/src/USER-INTEL/intel_buffers.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/intel_intrinsics.h b/src/USER-INTEL/intel_intrinsics.h index 34ba902a67..11e2bede72 100644 --- a/src/USER-INTEL/intel_intrinsics.h +++ b/src/USER-INTEL/intel_intrinsics.h @@ -1,3 +1,4 @@ +// clang-format off /* *- c++ -*- ----------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/intel_intrinsics_airebo.h b/src/USER-INTEL/intel_intrinsics_airebo.h index cadf80bbe8..f49abbaf3d 100644 --- a/src/USER-INTEL/intel_intrinsics_airebo.h +++ b/src/USER-INTEL/intel_intrinsics_airebo.h @@ -1,3 +1,4 @@ +// clang-format off #ifndef LMP_INTEL_AIREBO_SCALAR # ifdef __INTEL_COMPILER # if defined(__MIC__) || defined(__AVX512F__) diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h index 2e7101b42d..2efc50c8dc 100644 --- a/src/USER-INTEL/intel_preprocess.h +++ b/src/USER-INTEL/intel_preprocess.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/intel_simd.h b/src/USER-INTEL/intel_simd.h index 01fa1c0a45..8e3ea2bd43 100644 --- a/src/USER-INTEL/intel_simd.h +++ b/src/USER-INTEL/intel_simd.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/math_extra_intel.h b/src/USER-INTEL/math_extra_intel.h index 679ca635e1..097940a14f 100644 --- a/src/USER-INTEL/math_extra_intel.h +++ b/src/USER-INTEL/math_extra_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/nbin_intel.h b/src/USER-INTEL/nbin_intel.h index 29c4b92ab8..0562f0aaac 100644 --- a/src/USER-INTEL/nbin_intel.h +++ b/src/USER-INTEL/nbin_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.h b/src/USER-INTEL/npair_full_bin_ghost_intel.h index fd1a2c7005..b2b4d8d9b2 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.h +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_full_bin_intel.h b/src/USER-INTEL/npair_full_bin_intel.h index 75ca4add23..eac4f960a2 100644 --- a/src/USER-INTEL/npair_full_bin_intel.h +++ b/src/USER-INTEL/npair_full_bin_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_half_bin_newton_intel.h b/src/USER-INTEL/npair_half_bin_newton_intel.h index 20559c07b3..cf0255545e 100644 --- a/src/USER-INTEL/npair_half_bin_newton_intel.h +++ b/src/USER-INTEL/npair_half_bin_newton_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_half_bin_newton_tri_intel.h b/src/USER-INTEL/npair_half_bin_newton_tri_intel.h index e1e828480e..ce81882763 100644 --- a/src/USER-INTEL/npair_half_bin_newton_tri_intel.h +++ b/src/USER-INTEL/npair_half_bin_newton_tri_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_halffull_newtoff_intel.h b/src/USER-INTEL/npair_halffull_newtoff_intel.h index 8defd483de..112e1733ef 100644 --- a/src/USER-INTEL/npair_halffull_newtoff_intel.h +++ b/src/USER-INTEL/npair_halffull_newtoff_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_halffull_newton_intel.h b/src/USER-INTEL/npair_halffull_newton_intel.h index 671d2283ec..bd33001d38 100644 --- a/src/USER-INTEL/npair_halffull_newton_intel.h +++ b/src/USER-INTEL/npair_halffull_newton_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_intel.h b/src/USER-INTEL/npair_intel.h index 191c5385f5..294904e400 100644 --- a/src/USER-INTEL/npair_intel.h +++ b/src/USER-INTEL/npair_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/npair_skip_intel.h b/src/USER-INTEL/npair_skip_intel.h index 56b22a1dad..39f9e914bf 100644 --- a/src/USER-INTEL/npair_skip_intel.h +++ b/src/USER-INTEL/npair_skip_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_airebo_intel.h b/src/USER-INTEL/pair_airebo_intel.h index 3bc71cc944..f53f8715a6 100644 --- a/src/USER-INTEL/pair_airebo_intel.h +++ b/src/USER-INTEL/pair_airebo_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_airebo_morse_intel.h b/src/USER-INTEL/pair_airebo_morse_intel.h index 42fe889650..fa27c2be46 100644 --- a/src/USER-INTEL/pair_airebo_morse_intel.h +++ b/src/USER-INTEL/pair_airebo_morse_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.h b/src/USER-INTEL/pair_buck_coul_cut_intel.h index 5c754653bb..92260f3b0d 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.h +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.h b/src/USER-INTEL/pair_buck_coul_long_intel.h index d4e28a15b4..2d2381d1b5 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.h +++ b/src/USER-INTEL/pair_buck_coul_long_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_buck_intel.h b/src/USER-INTEL/pair_buck_intel.h index 7b5024a550..d0997080fc 100644 --- a/src/USER-INTEL/pair_buck_intel.h +++ b/src/USER-INTEL/pair_buck_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_dpd_intel.h b/src/USER-INTEL/pair_dpd_intel.h index c1d387bd27..9642e28b04 100644 --- a/src/USER-INTEL/pair_dpd_intel.h +++ b/src/USER-INTEL/pair_dpd_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_eam_alloy_intel.h b/src/USER-INTEL/pair_eam_alloy_intel.h index 2a78837961..70e5ffee4b 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.h +++ b/src/USER-INTEL/pair_eam_alloy_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_eam_fs_intel.h b/src/USER-INTEL/pair_eam_fs_intel.h index 59bb88d1b1..cb86d6a3fe 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.h +++ b/src/USER-INTEL/pair_eam_fs_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_eam_intel.h b/src/USER-INTEL/pair_eam_intel.h index 49bd0bbf5d..c9c775c788 100644 --- a/src/USER-INTEL/pair_eam_intel.h +++ b/src/USER-INTEL/pair_eam_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_gayberne_intel.h b/src/USER-INTEL/pair_gayberne_intel.h index d975eec1dd..5157567748 100644 --- a/src/USER-INTEL/pair_gayberne_intel.h +++ b/src/USER-INTEL/pair_gayberne_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h index 60d8cd952c..c3f9622961 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h index 44de69ea54..164e6a14a4 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h index 687eac15dc..41ee7d28fd 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_lj_cut_intel.h b/src/USER-INTEL/pair_lj_cut_intel.h index 85c0063301..0d50024a1b 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.h +++ b/src/USER-INTEL/pair_lj_cut_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_lj_long_coul_long_intel.h b/src/USER-INTEL/pair_lj_long_coul_long_intel.h index c5b19f2a45..644304b9c7 100644 --- a/src/USER-INTEL/pair_lj_long_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_long_coul_long_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* *- c++ -*- ----------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_rebo_intel.h b/src/USER-INTEL/pair_rebo_intel.h index 4f42d1206e..35c454e75b 100644 --- a/src/USER-INTEL/pair_rebo_intel.h +++ b/src/USER-INTEL/pair_rebo_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_sw_intel.h b/src/USER-INTEL/pair_sw_intel.h index 4f6704bf6f..4979b606c9 100644 --- a/src/USER-INTEL/pair_sw_intel.h +++ b/src/USER-INTEL/pair_sw_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pair_tersoff_intel.h b/src/USER-INTEL/pair_tersoff_intel.h index 6ea27458df..dc78da0ba8 100644 --- a/src/USER-INTEL/pair_tersoff_intel.h +++ b/src/USER-INTEL/pair_tersoff_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pppm_disp_intel.h b/src/USER-INTEL/pppm_disp_intel.h index 9596740f0b..a02c9a7200 100644 --- a/src/USER-INTEL/pppm_disp_intel.h +++ b/src/USER-INTEL/pppm_disp_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/pppm_intel.h b/src/USER-INTEL/pppm_intel.h index af42d9e4e2..64db482694 100644 --- a/src/USER-INTEL/pppm_intel.h +++ b/src/USER-INTEL/pppm_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* *- c++ -*- ----------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-INTEL/verlet_lrt_intel.h b/src/USER-INTEL/verlet_lrt_intel.h index e2e68c7a53..738f17d2b2 100644 --- a/src/USER-INTEL/verlet_lrt_intel.h +++ b/src/USER-INTEL/verlet_lrt_intel.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-LB/fix_lb_fluid.h b/src/USER-LB/fix_lb_fluid.h index e76e5f7f3f..3b0ce872ba 100644 --- a/src/USER-LB/fix_lb_fluid.h +++ b/src/USER-LB/fix_lb_fluid.h @@ -28,140 +28,138 @@ FixStyle(lb/fluid,FixLbFluid); namespace LAMMPS_NS { - class FixLbFluid : public Fix { - friend class FixLbMomentum; - friend class FixLbRigidPCSphere; - friend class FixLbPC; - friend class FixLbViscous; +class FixLbFluid : public Fix { + friend class FixLbMomentum; + friend class FixLbRigidPCSphere; + friend class FixLbPC; + friend class FixLbViscous; -public: - FixLbFluid(class LAMMPS *, int, char **); - ~FixLbFluid(); - int setmask(); - void init(); - void initial_integrate(int); - void setup(int); - void post_force(int); - void end_of_step(); + public: + FixLbFluid(class LAMMPS *, int, char **); + ~FixLbFluid(); + int setmask(); + void init(); + void initial_integrate(int); + void setup(int); + void post_force(int); + void end_of_step(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + void grow_arrays(int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); - private: - double viscosity,densityinit_real,a_0_real,T; - int setdx,seta0; - int numvel; + private: + double viscosity, densityinit_real, a_0_real, T; + int setdx, seta0; + int numvel; - double dm_lb,dx_lb,dt_lb; // Lattice units for mass, distance, time. + double dm_lb, dx_lb, dt_lb; // Lattice units for mass, distance, time. - int Nbx,Nby,Nbz; // Total # of x,y,z grid points. - int subNbx,subNby,subNbz; // # of x,y,z, grid points (including buffer) - // on local processor. - int me, nprocs; // MPI variables: processor ID, # of processors - MPI_Datatype oneslice; // MPI datatypes to pass arrays. - MPI_Datatype passxu,passyu,passzu; - MPI_Datatype passxf,passyf,passzf; - MPI_Datatype passxrho,passyrho,passzrho; - MPI_Datatype passxtemp,passytemp,passztemp; + int Nbx, Nby, Nbz; // Total # of x,y,z grid points. + int subNbx, subNby, subNbz; // # of x,y,z, grid points (including buffer) + // on local processor. + int me, nprocs; // MPI variables: processor ID, # of processors + MPI_Datatype oneslice; // MPI datatypes to pass arrays. + MPI_Datatype passxu, passyu, passzu; + MPI_Datatype passxf, passyf, passzf; + MPI_Datatype passxrho, passyrho, passzrho; + MPI_Datatype passxtemp, passytemp, passztemp; - double kB,densityinit,a_0; // Boltzmann constant, initial density, - // and a_0 all in lattice units. - double *Gamma; - double *NodeArea; - int setGamma,setArea; - double **hydroF; + double kB, densityinit, a_0; // Boltzmann constant, initial density, + // and a_0 all in lattice units. + double *Gamma; + double *NodeArea; + int setGamma, setArea; + double **hydroF; - int groupbit_viscouslb, groupbit_pc, groupbit_rigid_pc_sphere; + int groupbit_viscouslb, groupbit_pc, groupbit_rigid_pc_sphere; - double ***density_lb; // fluid density - double ****u_lb; // fluid velocity - double ****f_lb; // distributions - double ****fnew; // used in the calculation of the new - // distributions. - double ****feq; // equilibrium distributions - double ****feqold; // equilibrium distributions from previous - // timestep + double ***density_lb; // fluid density + double ****u_lb; // fluid velocity + double ****f_lb; // distributions + double ****fnew; // used in the calculation of the new + // distributions. + double ****feq; // equilibrium distributions + double ****feqold; // equilibrium distributions from previous + // timestep - double ****feqn; // equilibrium distributions without noise. - double ****feqoldn; // equilibrium distributions from previous - // timestep without noise. - double ****Ff; // Force from the MD particles on the fluid. - double ****Fftempx; - double ****Fftempy; - double ****Fftempz; + double ****feqn; // equilibrium distributions without noise. + double ****feqoldn; // equilibrium distributions from previous + // timestep without noise. + double ****Ff; // Force from the MD particles on the fluid. + double ****Fftempx; + double ****Fftempy; + double ****Fftempz; - double *Ng_lb; // Lattice Boltzmann variables. - double *w_lb; - double **mg_lb; - int **e; - double tau; - double expminusdtovertau; - double Dcoeff; - double K_0; - double dtoverdtcollision; + double *Ng_lb; // Lattice Boltzmann variables. + double *w_lb; + double **mg_lb; + int **e; + double tau; + double expminusdtovertau; + double Dcoeff; + double K_0; + double dtoverdtcollision; - int step; + int step; - double ****buf; // arrays used to output data. - double ****buf2; - double ****altogether; - double ****altogether2; + double ****buf; // arrays used to output data. + double ****buf2; + double ****altogether; + double ****altogether2; - double bodyforcex,bodyforcey,bodyforcez; // Body Forces acting on the fluid (default=0) - double vwtp,vwbt; // Velocities of the z walls in the y - // direction. (must have fixed boundary - // conditions in z) + double bodyforcex, bodyforcey, bodyforcez; // Body Forces acting on the fluid (default=0) + double vwtp, vwbt; // Velocities of the z walls in the y + // direction. (must have fixed boundary + // conditions in z) - int noisestress; // 1 to include noise in the system, - // 0 otherwise. - double namp,noisefactor; - int seed; - class RanMars *random; + int noisestress; // 1 to include noise in the system, + // 0 otherwise. + double namp, noisefactor; + int seed; + class RanMars *random; - int force_diagnostic; // 1 to print out the force action on a group - // of particles, 0 otherwise. - int igroupforce; // the group for which the force is to be - // printed. + int force_diagnostic; // 1 to print out the force action on a group + // of particles, 0 otherwise. + int igroupforce; // the group for which the force is to be + // printed. - int typeLB; + int typeLB; - int trilinear_stencil; // 1 to use the trilinear stencil, 0 to use the - // peskin stencil. + int trilinear_stencil; // 1 to use the trilinear stencil, 0 to use the + // peskin stencil. - int readrestart; // 1 to read in data from a restart file. - MPI_File pFileRead; + int readrestart; // 1 to read in data from a restart file. + MPI_File pFileRead; - int printrestart; // 1 to write data to a restart file. - MPI_File pFileWrite; + int printrestart; // 1 to write data to a restart file. + MPI_File pFileWrite; - int printfluid; - int fixviscouslb; + int printfluid; + int fixviscouslb; - void rescale(void); - void (FixLbFluid::*initializeLB)(void); - void initializeLB15(void); - void initializeLB19(void); - void initialize_feq(void); - void (FixLbFluid::*equilibriumdist)(int,int,int,int,int,int); - void equilibriumdist15(int,int,int,int,int,int); - void equilibriumdist19(int,int,int,int,int,int); - void parametercalc_part(int,int,int,int,int,int); - void parametercalc_full(void); - void update_periodic(int,int,int,int,int,int); - void (FixLbFluid::*update_full)(void); - void update_full15(void); - void update_full19(void); - void streamout(void); - void read_restartfile(void); - void write_restartfile(void); - void peskin_interpolation(int); - void trilinear_interpolation(int); - void calc_fluidforce(void); - - }; -} + void rescale(void); + void (FixLbFluid::*initializeLB)(void); + void initializeLB15(void); + void initializeLB19(void); + void initialize_feq(void); + void (FixLbFluid::*equilibriumdist)(int, int, int, int, int, int); + void equilibriumdist15(int, int, int, int, int, int); + void equilibriumdist19(int, int, int, int, int, int); + void parametercalc_part(int, int, int, int, int, int); + void parametercalc_full(void); + void update_periodic(int, int, int, int, int, int); + void (FixLbFluid::*update_full)(void); + void update_full15(void); + void update_full19(void); + void streamout(void); + void read_restartfile(void); + void write_restartfile(void); + void peskin_interpolation(int); + void trilinear_interpolation(int); + void calc_fluidforce(void); +}; +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-LB/fix_lb_momentum.h b/src/USER-LB/fix_lb_momentum.h index c6a1ca33c3..109a7d3d1c 100644 --- a/src/USER-LB/fix_lb_momentum.h +++ b/src/USER-LB/fix_lb_momentum.h @@ -33,13 +33,13 @@ class FixLbMomentum : public Fix { private: int linear; - int xflag,yflag,zflag; + int xflag, yflag, zflag; double masstotal; class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-LB/fix_lb_pc.h b/src/USER-LB/fix_lb_pc.h index 365797b5ee..26072fa7d3 100644 --- a/src/USER-LB/fix_lb_pc.h +++ b/src/USER-LB/fix_lb_pc.h @@ -24,7 +24,7 @@ FixStyle(lb/pc,FixLbPC); namespace LAMMPS_NS { - class FixLbPC : public Fix { +class FixLbPC : public Fix { public: FixLbPC(class LAMMPS *, int, char **); ~FixLbPC(); @@ -39,9 +39,8 @@ namespace LAMMPS_NS { int pack_exchange(int, double *); int unpack_exchange(int, double *); - private: - double dtv,dtf; + double dtv, dtf; int me; double *Gamma_MD; double expminusdttimesgamma; @@ -55,7 +54,7 @@ namespace LAMMPS_NS { class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.h b/src/USER-LB/fix_lb_rigid_pc_sphere.h index 971dcc3e99..2b81e45ed3 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.h +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.h @@ -47,54 +47,53 @@ class FixLbRigidPCSphere : public Fix { void reset_dt(); double compute_array(int, int); - private: double **up; double **up_old; double *Gamma_MD; - double expminusdttimesgamma,DMDcoeff; + double expminusdttimesgamma, DMDcoeff; double expminusdttimesgammadiv2; - double force_factor,torque_factor; + double force_factor, torque_factor; - double dtv,dtf; + double dtv, dtf; - int nbody; // # of rigid bodies - int *nrigid; // # of atoms in each rigid body + int nbody; // # of rigid bodies + int *nrigid; // # of atoms in each rigid body int *nrigid_shell; - double *masstotal; // total mass of each rigid body + double *masstotal; // total mass of each rigid body double *masstotal_shell; double *sphereradius; - double **xcm; // coords of center-of-mass of each rigid body + double **xcm; // coords of center-of-mass of each rigid body double **xcm_old; - double **vcm; // velocity of center-of-mass of each + double **vcm; // velocity of center-of-mass of each double **ucm; double **ucm_old; - double **fcm; // force on center-of-mass of each + double **fcm; // force on center-of-mass of each double **fcm_old; double **fcm_fluid; - double **omega; // angular momentum of each in space coords - double **torque; // torque on each rigid body in space coords + double **omega; // angular momentum of each in space coords + double **torque; // torque on each rigid body in space coords double **torque_old; double **torque_fluid; double **torque_fluid_old; double **rotate; - imageint *imagebody; // image flags of xcm of each rigid body - double **fflag; // flag for on/off of center-of-mass force - double **tflag; // flag for on/off of center-of-mass torque + imageint *imagebody; // image flags of xcm of each rigid body + double **fflag; // flag for on/off of center-of-mass force + double **tflag; // flag for on/off of center-of-mass torque - int *body; // which body each atom is part of (-1 if none) + int *body; // which body each atom is part of (-1 if none) - double **sum,**all; // work vectors for each rigid body - int **remapflag; // PBC remap flags for each rigid body + double **sum, **all; // work vectors for each rigid body + int **remapflag; // PBC remap flags for each rigid body - double tfactor; // scale factor on temperature of rigid bodies + double tfactor; // scale factor on temperature of rigid bodies - int inner_nodes; // ==1 if certain particle are inside the rigid - // body and should not interact with the fluid. - // ==0 otherwise. - int igroupinner; // specifies the particles which are inside the - // spherical rigid body, and do not interact with - // the fluid. + int inner_nodes; // ==1 if certain particle are inside the rigid + // body and should not interact with the fluid. + // ==0 otherwise. + int igroupinner; // specifies the particles which are inside the + // spherical rigid body, and do not interact with + // the fluid. void set_xv(); void set_v(); @@ -104,7 +103,7 @@ class FixLbRigidPCSphere : public Fix { class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-LB/fix_lb_viscous.h b/src/USER-LB/fix_lb_viscous.h index fcea842c93..9f144a2cfa 100644 --- a/src/USER-LB/fix_lb_viscous.h +++ b/src/USER-LB/fix_lb_viscous.h @@ -43,7 +43,7 @@ class FixLbViscous : public Fix { class FixLbFluid *fix_lb_fluid; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MANIFOLD/fix_manifoldforce.h b/src/USER-MANIFOLD/fix_manifoldforce.h index 47624d056c..57a110c49b 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.h +++ b/src/USER-MANIFOLD/fix_manifoldforce.h @@ -45,7 +45,9 @@ FixStyle(manifoldforce,FixManifoldForce); #include "fix.h" namespace LAMMPS_NS { -namespace user_manifold { class manifold; } +namespace user_manifold { + class manifold; +} class FixManifoldForce : public Fix { public: @@ -58,15 +60,14 @@ class FixManifoldForce : public Fix { void post_force_respa(int, int, int); void min_post_force(int); - private: user_manifold::manifold *ptr_m; // Stuff to store the parameters in. - int nvars; // # of args after manifold name. + int nvars; // # of args after manifold name. }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h index 3b8af42439..d3b11f65bf 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h @@ -31,7 +31,6 @@ ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS // clang-format off FixStyle(nve/manifold/rattle,FixNVEManifoldRattle); @@ -45,71 +44,72 @@ FixStyle(nve/manifold/rattle,FixNVEManifoldRattle); namespace LAMMPS_NS { -namespace user_manifold { class manifold; } - - class FixNVEManifoldRattle : public Fix { - public: - - struct statistics { - - statistics() : x_iters(0), v_iters(0), x_iters_per_atom(0), - v_iters_per_atom(0), natoms(0), dofs_removed(0), - last_out(0) {} - double x_iters, v_iters; - double x_iters_per_atom; - double v_iters_per_atom; - int natoms; - int dofs_removed; - bigint last_out; - }; - - FixNVEManifoldRattle(LAMMPS *, int &, char **, int = 1); - virtual ~FixNVEManifoldRattle(); - // All this stuff is interface, so you DO need to implement them. - // Just delegate them to the workhorse classes. - virtual int setmask(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void init(); - virtual void reset_dt(); - virtual void end_of_step(); - virtual int dof(int); - virtual void setup(int) {} // Not needed for fixNVE but is for fixNVT - virtual double memory_usage(); - - protected: - - int nevery, next_output; - - double dtv, dtf; - double tolerance; - int max_iter; - - char **tstrs; - int *tvars; - int *tstyle; - int *is_var; - - statistics stats; - int update_style; - int nvars; - - user_manifold::manifold *ptr_m; - - void print_stats( const char * ); - int was_var( const char * ); - - virtual void update_var_params(); - virtual void rattle_manifold_x( double *, double *, double *, double, double, tagint ); - virtual void rattle_manifold_v( double *, double *, double *, double, tagint ); - - virtual void nve_x_rattle(int, int); - virtual void nve_v_rattle(int, int); - }; +namespace user_manifold { + class manifold; } +class FixNVEManifoldRattle : public Fix { + public: + struct statistics { -#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H + statistics() : + x_iters(0), v_iters(0), x_iters_per_atom(0), v_iters_per_atom(0), natoms(0), + dofs_removed(0), last_out(0) + { + } + double x_iters, v_iters; + double x_iters_per_atom; + double v_iters_per_atom; + int natoms; + int dofs_removed; + bigint last_out; + }; + + FixNVEManifoldRattle(LAMMPS *, int &, char **, int = 1); + virtual ~FixNVEManifoldRattle(); + // All this stuff is interface, so you DO need to implement them. + // Just delegate them to the workhorse classes. + virtual int setmask(); + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void init(); + virtual void reset_dt(); + virtual void end_of_step(); + virtual int dof(int); + virtual void setup(int) {} // Not needed for fixNVE but is for fixNVT + virtual double memory_usage(); + + protected: + int nevery, next_output; + + double dtv, dtf; + double tolerance; + int max_iter; + + char **tstrs; + int *tvars; + int *tstyle; + int *is_var; + + statistics stats; + int update_style; + int nvars; + + user_manifold::manifold *ptr_m; + + void print_stats(const char *); + int was_var(const char *); + + virtual void update_var_params(); + virtual void rattle_manifold_x(double *, double *, double *, double, double, tagint); + virtual void rattle_manifold_v(double *, double *, double *, double, tagint); + + virtual void nve_x_rattle(int, int); + virtual void nve_v_rattle(int, int); +}; +} // namespace LAMMPS_NS + +#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H #endif /* ERROR/WARNING messages: diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h index ebfb8b3eac..ea86d659f4 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h @@ -31,7 +31,6 @@ ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS // clang-format off FixStyle(nvt/manifold/rattle,FixNVTManifoldRattle); @@ -43,8 +42,6 @@ FixStyle(nvt/manifold/rattle,FixNVTManifoldRattle); #include "fix_nve_manifold_rattle.h" - - /* FixNVTManifoldRattle works by wrapping some Nose-Hoover thermostat routines around the time integration functions of FixNVEManifoldRattle. @@ -53,50 +50,44 @@ namespace LAMMPS_NS { // namespace user_manifold { - class FixNVTManifoldRattle : public FixNVEManifoldRattle { - public: - FixNVTManifoldRattle(LAMMPS *, int, char **, int = 1); - virtual ~FixNVTManifoldRattle(); +class FixNVTManifoldRattle : public FixNVEManifoldRattle { + public: + FixNVTManifoldRattle(LAMMPS *, int, char **, int = 1); + virtual ~FixNVTManifoldRattle(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void init(); - virtual void reset_dt(); - virtual int setmask(); - virtual void setup(int); // Not needed for fixNVE but is for fixNVT - virtual double memory_usage(); + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void init(); + virtual void reset_dt(); + virtual int setmask(); + virtual void setup(int); // Not needed for fixNVE but is for fixNVT + virtual double memory_usage(); + protected: + void compute_temp_target(); + void nhc_temp_integrate(); + void nh_v_temp(); + double dthalf, dt4, dt8; - protected: + char *id_temp; + class Compute *temperature; + double t_start, t_stop, t_period; + double t_current, t_target, ke_target; + double t_freq, drag, tdrag_factor; + double boltz, nktv2p, tdof; + double *eta, *eta_dot; + double *eta_dotdot; + double *eta_mass; + int mtchain; + double factor_eta; + int which, got_temp; - void compute_temp_target(); - void nhc_temp_integrate(); - void nh_v_temp(); + const char *fix_id; +}; +} // namespace LAMMPS_NS - double dthalf, dt4, dt8; - - char *id_temp; - class Compute* temperature; - double t_start,t_stop, t_period; - double t_current,t_target,ke_target; - double t_freq, drag, tdrag_factor; - double boltz,nktv2p,tdof; - double *eta,*eta_dot; - double *eta_dotdot; - double *eta_mass; - int mtchain; - double factor_eta; - int which, got_temp; - - const char *fix_id; - }; -} - - - - -#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H +#endif // LMP_FIX_NVE_MANIFOLD_RATTLE_H #endif /* ERROR/WARNING messages: diff --git a/src/USER-MANIFOLD/manifold.h b/src/USER-MANIFOLD/manifold.h index c91647583f..3320c91d86 100644 --- a/src/USER-MANIFOLD/manifold.h +++ b/src/USER-MANIFOLD/manifold.h @@ -46,55 +46,47 @@ namespace user_manifold { // Abstract base class. class manifold : protected Pointers { public: - manifold(class LAMMPS* lmp) : Pointers(lmp), params(nullptr) { } + manifold(class LAMMPS *lmp) : Pointers(lmp), params(nullptr) {} virtual ~manifold() { delete[] params; } - virtual double g( const double * ) = 0; - virtual void n( const double *, double * ) = 0; - + virtual double g(const double *) = 0; + virtual void n(const double *, double *) = 0; // Variant of g that computes n at the same time. - virtual double g_and_n( const double *x, double *nn ) + virtual double g_and_n(const double *x, double *nn) { - this->n(x,nn); + this->n(x, nn); return g(x); } virtual const char *id() = 0; - virtual void set_atom_id( tagint /*a_id*/ ) {} + virtual void set_atom_id(tagint /*a_id*/) {} virtual int nparams() = 0; // double *get_params() { return params; }; // Overload if any initialization depends on params: virtual void post_param_init() {} - virtual void checkup() {} // Some diagnostics... + virtual void checkup() {} // Some diagnostics... double *params; }; - - // Some utility functions that are templated, so I implement them // here in the header. - template< unsigned int size > inline - double infnorm(double *vect) + template inline double infnorm(double *vect) { - double largest = fabs( vect[0] ); + double largest = fabs(vect[0]); for (unsigned int i = 1; i < size; ++i) { - double c = fabs( vect[i] ); - largest = ( c > largest ) ? c : largest; + double c = fabs(vect[i]); + largest = (c > largest) ? c : largest; } return largest; } - inline double dot(double *a, double *b) { - return a[0]*b[0] + a[1]*b[1] + a[2]*b[2]; - } + inline double dot(double *a, double *b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } +} // namespace user_manifold -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS -} - - -#endif // LMP_MANIFOLD_H +#endif // LMP_MANIFOLD_H diff --git a/src/USER-MANIFOLD/manifold_cylinder.h b/src/USER-MANIFOLD/manifold_cylinder.h index 10715b2683..1168834650 100644 --- a/src/USER-MANIFOLD/manifold_cylinder.h +++ b/src/USER-MANIFOLD/manifold_cylinder.h @@ -18,25 +18,24 @@ // A normal cylinder - namespace LAMMPS_NS { namespace user_manifold { class manifold_cylinder : public manifold { - public: - enum { NPARAMS = 1 }; // Number of parameters. - manifold_cylinder( LAMMPS *lmp, int, char ** ); + public: + enum { NPARAMS = 1 }; // Number of parameters. + manifold_cylinder(LAMMPS *lmp, int, char **); virtual ~manifold_cylinder() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "cylinder"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_CYLINDER_H +#endif // LMP_MANIFOLD_CYLINDER_H diff --git a/src/USER-MANIFOLD/manifold_cylinder_dent.h b/src/USER-MANIFOLD/manifold_cylinder_dent.h index 770fa23aef..2ab20750df 100644 --- a/src/USER-MANIFOLD/manifold_cylinder_dent.h +++ b/src/USER-MANIFOLD/manifold_cylinder_dent.h @@ -16,25 +16,24 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { class manifold_cylinder_dent : public manifold { public: - manifold_cylinder_dent( LAMMPS *lmp, int, char ** ); - enum { NPARAMS = 3 }; // Number of parameters. + manifold_cylinder_dent(LAMMPS *lmp, int, char **); + enum { NPARAMS = 3 }; // Number of parameters. virtual ~manifold_cylinder_dent() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "cylinder/dent"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_CYLINDER_DENT_H +#endif // LMP_MANIFOLD_CYLINDER_DENT_H diff --git a/src/USER-MANIFOLD/manifold_dumbbell.h b/src/USER-MANIFOLD/manifold_dumbbell.h index ef6aec6271..7416ea5da5 100644 --- a/src/USER-MANIFOLD/manifold_dumbbell.h +++ b/src/USER-MANIFOLD/manifold_dumbbell.h @@ -16,8 +16,6 @@ #include "manifold.h" - - namespace LAMMPS_NS { namespace user_manifold { @@ -25,20 +23,20 @@ namespace user_manifold { // A dendritic dumbbell approximation: class manifold_dumbbell : public manifold { public: - enum { NPARAMS = 4 }; // Number of parameters. - manifold_dumbbell( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 4 }; // Number of parameters. + manifold_dumbbell(LAMMPS *lmp, int, char **); virtual ~manifold_dumbbell() {} - virtual double g ( const double *x ); - virtual void n ( const double *x, double *nn ); + virtual double g(const double *x); + virtual void n(const double *x, double *nn); - static const char* type() { return "dumbbell"; } + static const char *type() { return "dumbbell"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_DUMBBELL_H +#endif // LMP_MANIFOLD_DUMBBELL_H diff --git a/src/USER-MANIFOLD/manifold_ellipsoid.h b/src/USER-MANIFOLD/manifold_ellipsoid.h index f728a95ff4..3a4e42a8bd 100644 --- a/src/USER-MANIFOLD/manifold_ellipsoid.h +++ b/src/USER-MANIFOLD/manifold_ellipsoid.h @@ -16,7 +16,6 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { @@ -24,18 +23,18 @@ namespace user_manifold { class manifold_ellipsoid : public manifold { public: enum { NPARAMS = 3 }; - manifold_ellipsoid( LAMMPS *lmp, int, char ** ); + manifold_ellipsoid(LAMMPS *lmp, int, char **); virtual ~manifold_ellipsoid() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); - static const char* type() { return "ellipsoid"; } + static const char *type() { return "ellipsoid"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_ELLIPSOID_H +#endif // LMP_MANIFOLD_ELLIPSOID_H diff --git a/src/USER-MANIFOLD/manifold_factory.h b/src/USER-MANIFOLD/manifold_factory.h index 61d143feb6..8ad5673719 100644 --- a/src/USER-MANIFOLD/manifold_factory.h +++ b/src/USER-MANIFOLD/manifold_factory.h @@ -31,79 +31,32 @@ ------------------------------------------------------------------------- */ - #ifndef LMP_MANIFOLD_FACTORY_H #define LMP_MANIFOLD_FACTORY_H #include #include -/* - * Defining USE_PHONY_LAMMPS makes sure that none of the LAMMPS classes are - * included/compiled. This is done in order to allow other programs to use - * the manifold_factory without compiling all of LAMMPS itself. The relevant - * classes/functions are replaced with dummy ones defined in this #ifdef-block: - */ -#ifdef USE_PHONY_LAMMPS -# ifdef __GNUG__ -# warning Not compiling actual LAMMPS classes! -# endif - - -struct Error { - void all(const char *fname, int line, const char* msg) - { - fprintf(stderr,"ERROR: %s (%s:%d)",msg,fname,line); - std::terminate(); - } - - void one(const char *fname, int line, const char* msg) - { - fprintf(stderr,"ERROR: %s (%s:%d)",msg,fname,line); - std::terminate(); - } -}; - -struct LAMMPS { }; - -struct Pointers -{ - Pointers(LAMMPS *) : error( &e ) {} - Error e; - Error *error; -}; - -static FILE *screen = fopen("/dev/stdout","w"); - -#define FLERR __FILE__,__LINE__ // Equivalent to definition in pointers.h -#endif // USE_PHONY_LAMMPS - -/* Here the actual implementation of LAMMPS-related functions begins. */ - namespace LAMMPS_NS { class LAMMPS; namespace user_manifold { -// forward declaration -class manifold; + // forward declaration + class manifold; // Templated, so needs to be in header. template - void make_manifold_if( manifold **man_ptr, const char *name, - LAMMPS *lmp, int narg, char **arg ) + void make_manifold_if(manifold **man_ptr, const char *name, LAMMPS *lmp, int narg, char **arg) { - if ( strcmp( m_type::type(), name ) == 0 ) { - if ( *man_ptr == nullptr ) { - *man_ptr = new m_type(lmp, narg, arg); - } + if (strcmp(m_type::type(), name) == 0) { + if (*man_ptr == nullptr) { *man_ptr = new m_type(lmp, narg, arg); } } } - manifold* create_manifold(const char *, LAMMPS *, - int , char ** ); + manifold *create_manifold(const char *, LAMMPS *, int, char **); -} // namespace user_manifold -} // namespace LAMMPS_NS +} // namespace user_manifold +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_FACTORY_H +#endif // LMP_MANIFOLD_FACTORY_H diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.h b/src/USER-MANIFOLD/manifold_gaussian_bump.h index 30926f9815..0896934f73 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.h +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.h @@ -50,20 +50,21 @@ namespace user_manifold { class manifold_gaussian_bump : public manifold { public: enum { NPARAMS = 4 }; - manifold_gaussian_bump(class LAMMPS*, int, char **); + manifold_gaussian_bump(class LAMMPS *, int, char **); virtual ~manifold_gaussian_bump(); - virtual double g( const double * ); - virtual void n( const double *, double * ); + virtual double g(const double *); + virtual void n(const double *, double *); // Variant of g that computes n at the same time. - virtual double g_and_n( const double *x, double *nn ); + virtual double g_and_n(const double *x, double *nn); - static const char* type() { return "gaussian_bump"; } + static const char *type() { return "gaussian_bump"; } virtual const char *id() { return type(); } virtual int nparams() { return NPARAMS; } virtual void post_param_init(); + private: // Some private constants: double AA, ll, ll2, f_at_rc, fp_at_rc; @@ -76,24 +77,22 @@ namespace user_manifold { double *lut_z; double *lut_zp; - double gaussian_bump ( double ) const; - double gaussian_bump_x2 ( double ) const; - double gaussian_bump_der( double ) const; + double gaussian_bump(double) const; + double gaussian_bump_x2(double) const; + double gaussian_bump_der(double) const; - void make_lut(); - double lut_get_z ( double rr ) const; - double lut_get_zp( double rr ) const; - void lut_get_z_and_zp( double rr, double &zz, double &zzp ) const; + void make_lut(); + double lut_get_z(double rr) const; + double lut_get_zp(double rr) const; + void lut_get_z_and_zp(double rr, double &zz, double &zzp) const; void test_lut(); - double taper( double ); - double taper_der( double ); - + double taper(double); + double taper_der(double); }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - -#endif // LMP_MANIFOLD_GAUSSIAN_BUMP_H +#endif // LMP_MANIFOLD_GAUSSIAN_BUMP_H diff --git a/src/USER-MANIFOLD/manifold_plane.h b/src/USER-MANIFOLD/manifold_plane.h index 9a45b58c94..d3ff859cb7 100644 --- a/src/USER-MANIFOLD/manifold_plane.h +++ b/src/USER-MANIFOLD/manifold_plane.h @@ -16,28 +16,25 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { - // A 2D plane class manifold_plane : public manifold { public: - enum { NPARAMS = 6 }; // Number of parameters. - manifold_plane( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 6 }; // Number of parameters. + manifold_plane(LAMMPS *lmp, int, char **); virtual ~manifold_plane() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "plane"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold +} // namespace LAMMPS_NS -} - -#endif // LMP_MANIFOLD_PLANE_H +#endif // LMP_MANIFOLD_PLANE_H diff --git a/src/USER-MANIFOLD/manifold_plane_wiggle.h b/src/USER-MANIFOLD/manifold_plane_wiggle.h index 06b55419ae..1c446cd78b 100644 --- a/src/USER-MANIFOLD/manifold_plane_wiggle.h +++ b/src/USER-MANIFOLD/manifold_plane_wiggle.h @@ -16,7 +16,6 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { @@ -24,18 +23,18 @@ namespace user_manifold { // A 2D wiggly/wave-y plane (Like z = A cos(kx)) class manifold_plane_wiggle : public manifold { public: - enum { NPARAMS = 2 }; // Number of parameters. - manifold_plane_wiggle( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 2 }; // Number of parameters. + manifold_plane_wiggle(LAMMPS *lmp, int, char **); virtual ~manifold_plane_wiggle() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "plane/wiggle"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS -#endif // LMP_MANIFOLD_PLANE_WIGGLE_H +#endif // LMP_MANIFOLD_PLANE_WIGGLE_H diff --git a/src/USER-MANIFOLD/manifold_sphere.h b/src/USER-MANIFOLD/manifold_sphere.h index e0a80ab88b..3d12a6ccb0 100644 --- a/src/USER-MANIFOLD/manifold_sphere.h +++ b/src/USER-MANIFOLD/manifold_sphere.h @@ -20,53 +20,51 @@ namespace LAMMPS_NS { namespace user_manifold { - // A sphere: class manifold_sphere : public manifold { public: enum { NPARAMS = 1 }; - manifold_sphere( LAMMPS *lmp, int, char ** ) : manifold(lmp) {} + manifold_sphere(LAMMPS *lmp, int, char **) : manifold(lmp) {} virtual ~manifold_sphere() {} - virtual double g( const double *x ) + virtual double g(const double *x) { double R = params[0]; - double r2 = x[0]*x[0] + x[1]*x[1] + x[2]*x[2]; - return r2 - R*R; + double r2 = x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; + return r2 - R * R; } - virtual double g_and_n( const double *x, double *nn ) + virtual double g_and_n(const double *x, double *nn) { double R = params[0]; - double r2 = x[0]*x[0] + x[1]*x[1] + x[2]*x[2]; - nn[0] = 2*x[0]; - nn[1] = 2*x[1]; - nn[2] = 2*x[2]; + double r2 = x[0] * x[0] + x[1] * x[1] + x[2] * x[2]; + nn[0] = 2 * x[0]; + nn[1] = 2 * x[1]; + nn[2] = 2 * x[2]; - return r2 - R*R; + return r2 - R * R; } - virtual void n( const double *x, double *nn ) + virtual void n(const double *x, double *nn) { - nn[0] = 2*x[0]; - nn[1] = 2*x[1]; - nn[2] = 2*x[2]; + nn[0] = 2 * x[0]; + nn[1] = 2 * x[1]; + nn[2] = 2 * x[2]; } - virtual void H( double * /*x*/, double h[3][3] ) + virtual void H(double * /*x*/, double h[3][3]) { h[0][1] = h[0][2] = h[1][0] = h[1][2] = h[2][0] = h[2][1] = 0.0; h[0][0] = h[1][1] = h[2][2] = 2.0; } - static const char* type() { return "sphere"; } + static const char *type() { return "sphere"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - -#endif // LMP_MANIFOLD_SPHERE_H +#endif // LMP_MANIFOLD_SPHERE_H diff --git a/src/USER-MANIFOLD/manifold_spine.h b/src/USER-MANIFOLD/manifold_spine.h index 1b54ceaa17..b2880dee53 100644 --- a/src/USER-MANIFOLD/manifold_spine.h +++ b/src/USER-MANIFOLD/manifold_spine.h @@ -16,7 +16,6 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { @@ -24,33 +23,32 @@ namespace user_manifold { // A dendritic spine approximation: class manifold_spine : public manifold { public: - enum { NPARAMS = 5 }; // Number of parameters. - manifold_spine( LAMMPS *lmp, int, char ** ); + enum { NPARAMS = 5 }; // Number of parameters. + manifold_spine(LAMMPS *lmp, int, char **); virtual ~manifold_spine() {} - virtual double g ( const double *x ); - virtual void n ( const double *x, double *nn ); - virtual double g_and_n( const double *x, double *nn ); + virtual double g(const double *x); + virtual void n(const double *x, double *nn); + virtual double g_and_n(const double *x, double *nn); - static const char* type() { return "spine"; } + static const char *type() { return "spine"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } + protected: int power; }; class manifold_spine_two : public manifold_spine { public: - manifold_spine_two( LAMMPS *lmp, int, char **); + manifold_spine_two(LAMMPS *lmp, int, char **); - static const char* type() { return "spine/two"; } + static const char *type() { return "spine/two"; } virtual const char *id() { return type(); } - }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - -#endif // LMP_MANIFOLD_SPINE_H +#endif // LMP_MANIFOLD_SPINE_H diff --git a/src/USER-MANIFOLD/manifold_supersphere.h b/src/USER-MANIFOLD/manifold_supersphere.h index 7b9ad2e12c..3f91fd6af3 100644 --- a/src/USER-MANIFOLD/manifold_supersphere.h +++ b/src/USER-MANIFOLD/manifold_supersphere.h @@ -18,23 +18,19 @@ namespace LAMMPS_NS { - namespace user_manifold { // A sphere: class manifold_supersphere : public manifold { public: enum { NPARAMS = 2 }; - manifold_supersphere( LAMMPS *lmp, int, char ** ) : manifold(lmp) {} + manifold_supersphere(LAMMPS *lmp, int, char **) : manifold(lmp) {} virtual ~manifold_supersphere() {} - double my_sign( double a ) - { - return (a > 0) - (a < 0); - } + double my_sign(double a) { return (a > 0) - (a < 0); } - virtual double g( const double *x ) + virtual double g(const double *x) { double R = params[0]; double q = params[1]; @@ -42,30 +38,30 @@ namespace user_manifold { double yy = fabs(x[1]); double zz = fabs(x[2]); - double rr = pow(xx,q) + pow(yy,q) + pow(zz,q); + double rr = pow(xx, q) + pow(yy, q) + pow(zz, q); - return rr - pow(R,q); + return rr - pow(R, q); } - virtual void n( const double *x, double *nn ) + virtual void n(const double *x, double *nn) { double q = params[1]; double xx = fabs(x[0]); double yy = fabs(x[1]); double zz = fabs(x[2]); - nn[0] = q * my_sign(x[0])*pow(xx,q-1); - nn[1] = q * my_sign(x[1])*pow(yy,q-1); - nn[2] = q * my_sign(x[2])*pow(zz,q-1); + nn[0] = q * my_sign(x[0]) * pow(xx, q - 1); + nn[1] = q * my_sign(x[1]) * pow(yy, q - 1); + nn[2] = q * my_sign(x[2]) * pow(zz, q - 1); } - static const char* type() { return "supersphere"; } + static const char *type() { return "supersphere"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index 69d5428e55..ceb45cf7e9 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -13,14 +13,13 @@ ----------------------------------------------------------------------- */ #include "manifold_thylakoid.h" -#include #include "manifold_thylakoid_shared.h" + #include "comm.h" #include "domain.h" // For some checks regarding the simulation box. #include "error.h" - -#define MANIFOLD_THYLAKOID_DEBUG +#include using namespace LAMMPS_NS; using namespace user_manifold; @@ -165,26 +164,12 @@ void manifold_thylakoid::init_domains() x0 = -( 0.5*LB + lB + lT + LT + lT + pad); y0 = -( 0.5*LT + lT + pad ); z0 = -15; -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"x0, y0, z0 = %f, %f, %f\n",x0,y0,z0); - } -#endif // MANIFOLD_THYLAKOID_DEBUG -#ifndef USE_PHONY_LAMMPS - if (x0 < domain->boxlo[0]) { - char msg[2048]; - sprintf(msg,"Thylakoid expects xlo of at most %f, but found %f", - x0, domain->boxlo[0]); - error->one(FLERR,msg); - } - if (y0 < domain->boxlo[1]) { - char msg[2048]; - sprintf(msg,"Thylakoid expects ylo of at most %f, but found %f", - y0, domain->boxlo[1]); - error->one(FLERR,msg); - } -#endif + if (x0 < domain->boxlo[0]) + error->one(FLERR,"Thylakoid expects xlo of at most {:.8f}, but found {:.8f}", x0, domain->boxlo[0]); + + if (y0 < domain->boxlo[1]) + error->one(FLERR,"Thylakoid expects ylo of at most {:.8f}, but found {:.8f}",y0, domain->boxlo[1]); // Add some padding to prevent improper lookups. z0 -= pad; @@ -197,24 +182,11 @@ void manifold_thylakoid::init_domains() Ly = y1 - y0; Lz = z1 - z0; -#ifndef USE_PHONY_LAMMPS - char msg[2048]; - if (x1 > domain->boxhi[0]) { - sprintf(msg,"Expected xhi larger than current box has: %f > %f", - x1, domain->boxhi[0]); - error->one(FLERR,msg); - } - if (y1 > domain->boxhi[1]) { - sprintf(msg,"Expected yhi larger than current box has: %f > %f", - y1, domain->boxhi[1]); - error->one(FLERR,msg); - } - // if (z1 > domain->boxhi[2]) { - // sprintf(msg,"Expected zhi larger than current box has: %f > %f", - // z1, domain->boxhi[2]); - // error->one(FLERR,msg); - // } -#endif + if (x1 > domain->boxhi[0]) + error->one(FLERR,"Expected xhi larger than current box has: {:.8f} > {:.8f}", x1, domain->boxhi[0]); + + if (y1 > domain->boxhi[1]) + error->one(FLERR,"Expected yhi larger than current box has: {:.8f} > {:.8f}", y1, domain->boxhi[1]); // Create and add the manifold parts to the array. thyla_part *p; @@ -256,11 +228,6 @@ void manifold_thylakoid::init_domains() bl.hi[2] = (1.0 + safety_fac) * Reff; // double X0, double R0, double R, double s, -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"x0, r0, R = %f, %f, %f\n", bl.pt[0], rB, lB); - } -#endif // MANIFOLD_THYLAKOID_DEBUG p = make_cyl_to_plane_part(bl.pt[0], rB, lB, -1, bl.pt); set_domain(p, bl.lo, bl.hi); parts.push_back(p); @@ -279,11 +246,6 @@ void manifold_thylakoid::init_domains() br.hi[2] = (1.0 + safety_fac) * Reff; // double X0, double R0, double R, double s, -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"x0, r0, R = %f, %f, %f\n", br.pt[0], rB, lB); - } -#endif // MANIFOLD_THYLAKOID_DEBUG p = make_cyl_to_plane_part(br.pt[0], rB, lB, 1, br.pt); set_domain(p, br.lo, br.hi); parts.push_back(p); @@ -306,12 +268,6 @@ void manifold_thylakoid::init_domains() p = make_cyl_part( 0, 1, 1, bc.pt, rB ); set_domain( p, bc.lo, bc.hi ); -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"Cylinder lives on [ %f x %f ] x [ %f x %f ] x [ %f x %f]\n", - bc.lo[0], bc.hi[0], bc.lo[1], bc.hi[1], bc.lo[2], bc.hi[2]); - } -#endif // MANIFOLD_THYLAKOID_DEBUG parts.push_back(p); @@ -478,41 +434,18 @@ void manifold_thylakoid::init_domains() prr.pt[0], br.pt[0] + lB); error->one(FLERR,msg); } - - // For debugging, print the domains and coms: -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - FILE *fp_doms = fopen("test_doms.dat","w"); - FILE *fp_coms = fopen("test_coms.dat","w"); - print_part_data(fp_doms, fp_coms); - fclose(fp_doms); - fclose(fp_coms); - } -#endif // MANIFOLD_THYLAKOID_DEBUG } void manifold_thylakoid::set_domain( thyla_part *p, const std::vector &lo, const std::vector &hi ) { -#ifdef MANIFOLD_THYLAKOID_DEBUG - if (comm->me == 0) { - fprintf(screen,"Adding part with domain [%f, %f] x [%f, %f] x [%f, %f]\n", - lo[0],hi[0],lo[1],hi[1],lo[2],hi[2] ); - } -#endif // MANIFOLD_THYLAKOID_DEBUG if (lo[0] >= hi[0]) { - char msg[2048]; - sprintf(msg,"xlo >= xhi (%f >= %f)",lo[0],hi[0]); - error->one(FLERR,msg); + error->one(FLERR,"xlo >= xhi ({:.8f} >= {:.8f})",lo[0],hi[0]); } else if (lo[1] >= hi[1]) { - char msg[2048]; - sprintf(msg,"ylo >= yhi (%f >= %f)",lo[1],hi[1]); - error->one(FLERR,msg); + error->one(FLERR,"ylo >= yhi ({:.8f} >= {:.8f})",lo[1],hi[1]); } else if (lo[2] >= hi[2]) { - char msg[2048]; - sprintf(msg,"zlo >= zhi (%f >= %f)",lo[2],hi[2]); - error->one(FLERR,msg); + error->one(FLERR,"zlo >= zhi ({:.8f} >= {:.8f})",lo[2],hi[2]); } p->xlo = lo[0]; p->ylo = lo[1]; @@ -612,21 +545,3 @@ thyla_part *manifold_thylakoid::make_cyl_to_plane_part(double X0, double R0, dou thyla_part *p = new thyla_part(thyla_part::THYLA_TYPE_CYL_TO_PLANE,args,0,0,0,0,0,0); return p; } - - - - -void manifold_thylakoid::print_part_data( FILE *fp_doms, FILE *fp_coms ) -{ - for (std::size_t i = 0; i < parts.size(); ++i) { - thyla_part *p = parts[i]; - fprintf(fp_doms, "%f %f\n", p->xlo, p->ylo); - fprintf(fp_doms, "%f %f\n", p->xlo, p->yhi); - fprintf(fp_doms, "%f %f\n", p->xhi, p->yhi); - fprintf(fp_doms, "%f %f\n", p->xhi, p->ylo); - fprintf(fp_doms, "%f %f\n\n",p->xlo, p->ylo); - fprintf(fp_coms, "%f %f\n", p->x0, p->y0 ); - } -} - - diff --git a/src/USER-MANIFOLD/manifold_thylakoid.h b/src/USER-MANIFOLD/manifold_thylakoid.h index cdd69d05cc..24a6ab33d9 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.h +++ b/src/USER-MANIFOLD/manifold_thylakoid.h @@ -25,45 +25,39 @@ namespace user_manifold { class manifold_thylakoid : public manifold { public: enum { NPARAMS = 3 }; - manifold_thylakoid( LAMMPS *lmp, int, char ** ); + manifold_thylakoid(LAMMPS *lmp, int, char **); virtual ~manifold_thylakoid(); - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); - static const char* type() { return "thylakoid"; } + static const char *type() { return "thylakoid"; } virtual const char *id() { return type(); } static int expected_argc() { return NPARAMS; } virtual int nparams() { return NPARAMS; } - virtual void post_param_init(); - virtual void checkup(); // Some diagnostics... + virtual void checkup(); // Some diagnostics... private: void init_domains(); - thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = nullptr ); - int is_in_domain( thyla_part *p, const double *x ); + thyla_part *get_thyla_part(const double *x, int *err_flag, std::size_t *idx = nullptr); + int is_in_domain(thyla_part *p, const double *x); void check_overlap(); - std::vector parts; + std::vector parts; - thyla_part *make_plane_part (double a, double b, double c, - const std::vector &pt); - thyla_part *make_cyl_part (double a, double b, double c, - const std::vector &pt, double R); + thyla_part *make_plane_part(double a, double b, double c, const std::vector &pt); + thyla_part *make_cyl_part(double a, double b, double c, const std::vector &pt, + double R); thyla_part *make_sphere_part(const std::vector &pt, double R); thyla_part *make_cyl_to_plane_part(double X0, double R0, double R, double s, - const std::vector &pt ); + const std::vector &pt); - - void set_domain( thyla_part *p, const std::vector &lo, - const std::vector &hi ); - - void print_part_data( FILE *fp_doms, FILE *fp_coms ); + void set_domain(thyla_part *p, const std::vector &lo, const std::vector &hi); // Coefficients for the thylakoid model. At the moment it is just // a cylinder, we slowly expand it. - double pad; // Padding to make sure periodic images are mapped back properly. + double pad; // Padding to make sure periodic images are mapped back properly. double LB, lT, lB, wB, LT; // Domain size: @@ -72,10 +66,8 @@ namespace user_manifold { double Lx, Ly, Lz; }; +} // namespace user_manifold +} // namespace LAMMPS_NS -} // namespace LAMMPS_NS - -} - -#endif // LMP_MANIFOLD_THYLAKOID_H +#endif // LMP_MANIFOLD_THYLAKOID_H diff --git a/src/USER-MANIFOLD/manifold_thylakoid_shared.h b/src/USER-MANIFOLD/manifold_thylakoid_shared.h index a83603785b..381e618647 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid_shared.h +++ b/src/USER-MANIFOLD/manifold_thylakoid_shared.h @@ -14,7 +14,6 @@ #ifndef MANIFOLD_THYLAKOID_SHARED_H #define MANIFOLD_THYLAKOID_SHARED_H - #include "lmptype.h" #include @@ -22,7 +21,6 @@ namespace LAMMPS_NS { namespace user_manifold { - // The thylakoid is composed of many parts struct thyla_part { enum thyla_types { @@ -32,13 +30,13 @@ namespace user_manifold { THYLA_TYPE_CYL_TO_PLANE }; - thyla_part( int type, double *args, double xlo, double ylo, double zlo, - double xhi, double yhi, double zhi ); + 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(); - double g( const double *x ); - void n( const double *x, double *n ); + double g(const double *x); + void n(const double *x, double *n); int type; double params[7]; @@ -51,9 +49,7 @@ namespace user_manifold { double xlo, xhi, ylo, yhi, zlo, zhi; double x0, y0, z0; - }; // struct thyla_part - - + }; // struct thyla_part struct thyla_part_geom { thyla_part_geom() : pt(3), lo(3), hi(3) {} @@ -61,16 +57,12 @@ namespace user_manifold { // Function for mirroring thyla_geoms: enum DIRS { DIR_X, DIR_Y, DIR_Z }; - static void mirror( unsigned int axis, thyla_part_geom *m, - const thyla_part_geom *o ); + static void mirror(unsigned int axis, thyla_part_geom *m, const thyla_part_geom *o); - }; // struct thyla_part_geom + }; // struct thyla_part_geom +} // namespace user_manifold -} // namespace user_manifold +} // namespace LAMMPS_NS - -} // namespace LAMMPS_NS - - -#endif // MANIFOLD_THYLAKOID_SHARED_H +#endif // MANIFOLD_THYLAKOID_SHARED_H diff --git a/src/USER-MANIFOLD/manifold_torus.h b/src/USER-MANIFOLD/manifold_torus.h index 15dd06c6bf..fe7d0e9e0e 100644 --- a/src/USER-MANIFOLD/manifold_torus.h +++ b/src/USER-MANIFOLD/manifold_torus.h @@ -16,19 +16,17 @@ #include "manifold.h" - namespace LAMMPS_NS { namespace user_manifold { - class manifold_torus : public manifold { public: - enum {NPARAMS=2}; - manifold_torus( LAMMPS *, int, char ** ); + enum { NPARAMS = 2 }; + manifold_torus(LAMMPS *, int, char **); ~manifold_torus() {} - virtual double g( const double *x ); - virtual void n( const double *x, double *n ); + virtual double g(const double *x); + virtual void n(const double *x, double *n); static const char *type() { return "torus"; } virtual const char *id() { return type(); } @@ -36,10 +34,8 @@ namespace user_manifold { virtual int nparams() { return NPARAMS; } }; -} +} // namespace user_manifold -} +} // namespace LAMMPS_NS - - -#endif // LMP_MANIFOLD_TORUS_H +#endif // LMP_MANIFOLD_TORUS_H diff --git a/src/USER-MEAMC/meam.h b/src/USER-MEAMC/meam.h index f9440d9cbf..1b2da7f0d5 100644 --- a/src/USER-MEAMC/meam.h +++ b/src/USER-MEAMC/meam.h @@ -14,7 +14,7 @@ #ifndef LMP_MEAM_H #define LMP_MEAM_H -#include "math_const.h" // IWYU pragma: export +#include "math_const.h" // IWYU pragma: export #include #include @@ -26,14 +26,13 @@ class Memory; typedef enum { FCC, BCC, HCP, DIM, DIA, DIA3, B1, C11, L12, B2, CH4, LIN, ZIG, TRI } lattice_t; -class MEAM -{ -public: - MEAM(Memory* mem); +class MEAM { + public: + MEAM(Memory *mem); ~MEAM(); -private: - Memory* memory; + private: + Memory *memory; // cutforce = force cutoff // cutforcesq = force cutoff squared @@ -97,7 +96,7 @@ private: int eltind[maxelt][maxelt]; int neltypes; - double** phir; + double **phir; double **phirar, **phirar1, **phirar2, **phirar3, **phirar4, **phirar5, **phirar6; @@ -110,13 +109,13 @@ private: int emb_lin_neg, bkgd_dyn; double gsmooth_factor; - int vind2D[3][3], vind3D[3][3][3]; // x-y-z to Voigt-like index - int v2D[6], v3D[10]; // multiplicity of Voigt index (i.e. [1] -> xy+yx = 2 + int vind2D[3][3], vind3D[3][3][3]; // x-y-z to Voigt-like index + int v2D[6], v3D[10]; // multiplicity of Voigt index (i.e. [1] -> xy+yx = 2 int nr, nrar; double dr, rdrar; -public: + public: int nmax; double *rho, *rho0, *rho1, *rho2, *rho3, *frhop; double *gamma, *dgamma1, *dgamma2, *dgamma3, *arho2b; @@ -129,13 +128,14 @@ public: double stheta_meam[maxelt][maxelt]; double ctheta_meam[maxelt][maxelt]; -protected: + protected: // meam_funcs.cpp //----------------------------------------------------------------------------- // Cutoff function // - static double fcut(const double xi) { + static double fcut(const double xi) + { double a; if (xi >= 1.0) return 1.0; @@ -144,7 +144,8 @@ protected: else { // ( 1.d0 - (1.d0 - xi)**4 )**2, but with better codegen a = 1.0 - xi; - a *= a; a *= a; + a *= a; + a *= a; a = 1.0 - a; return a * a; } @@ -153,7 +154,8 @@ protected: //----------------------------------------------------------------------------- // Cutoff function and derivative // - static double dfcut(const double xi, double& dfc) { + static double dfcut(const double xi, double &dfc) + { double a, a3, a4, a1m4; if (xi >= 1.0) { dfc = 0.0; @@ -165,10 +167,10 @@ protected: a = 1.0 - xi; a3 = a * a * a; a4 = a * a3; - a1m4 = 1.0-a4; + a1m4 = 1.0 - a4; dfc = 8 * a1m4 * a3; - return a1m4*a1m4; + return a1m4 * a1m4; } } @@ -176,13 +178,14 @@ protected: // Derivative of Cikj w.r.t. rij // Inputs: rij,rij2,rik2,rjk2 // - static double dCfunc(const double rij2, const double rik2, const double rjk2) { - double rij4, a, asq, b,denom; + static double dCfunc(const double rij2, const double rik2, const double rjk2) + { + double rij4, a, asq, b, denom; rij4 = rij2 * rij2; a = rik2 - rjk2; b = rik2 + rjk2; - asq = a*a; + asq = a * a; denom = rij4 - asq; denom = denom * denom; return -4 * (-2 * rij2 * asq + rij4 * b + asq * b) / denom; @@ -192,8 +195,9 @@ protected: // Derivative of Cikj w.r.t. rik and rjk // Inputs: rij,rij2,rik2,rjk2 // - static void dCfunc2(const double rij2, const double rik2, const double rjk2, - double& dCikj1, double& dCikj2) { + static void dCfunc2(const double rij2, const double rik2, const double rjk2, double &dCikj1, + double &dCikj2) + { double rij4, rik4, rjk4, a, denom; rij4 = rij2 * rij2; @@ -209,34 +213,40 @@ protected: double G_gam(const double gamma, const int ibar, int &errorflag) const; double dG_gam(const double gamma, const int ibar, double &dG) const; static double zbl(const double r, const int z1, const int z2); - double embedding(const double A, const double Ec, const double rhobar, double& dF) const; - static double erose(const double r, const double re, const double alpha, const double Ec, const double repuls, const double attrac, const int form); + double embedding(const double A, const double Ec, const double rhobar, double &dF) const; + static double erose(const double r, const double re, const double alpha, const double Ec, + const double repuls, const double attrac, const int form); - static void get_shpfcn(const lattice_t latt, const double sthe, const double cthe, double (&s)[3]); + static void get_shpfcn(const lattice_t latt, const double sthe, const double cthe, + double (&s)[3]); - static int get_Zij2(const lattice_t latt, const double cmin, const double cmax, - const double sthe, double &a, double &S); + static int get_Zij2(const lattice_t latt, const double cmin, const double cmax, const double sthe, + double &a, double &S); static int get_Zij2_b2nn(const lattice_t latt, const double cmin, const double cmax, double &S); -protected: - void meam_checkindex(int, int, int, int*, int*); - void getscreen(int i, double* scrfcn, double* dscrfcn, double* fcpair, double** x, int numneigh, - int* firstneigh, int numneigh_full, int* firstneigh_full, int ntype, int* type, int* fmap); - void calc_rho1(int i, int ntype, int* type, int* fmap, double** x, int numneigh, int* firstneigh, - double* scrfcn, double* fcpair); + protected: + void meam_checkindex(int, int, int, int *, int *); + void getscreen(int i, double *scrfcn, double *dscrfcn, double *fcpair, double **x, int numneigh, + int *firstneigh, int numneigh_full, int *firstneigh_full, int ntype, int *type, + int *fmap); + void calc_rho1(int i, int ntype, int *type, int *fmap, double **x, int numneigh, int *firstneigh, + double *scrfcn, double *fcpair); void alloyparams(); void compute_pair_meam(); double phi_meam(double, int, int); - double phi_meam_series(const double scrn, const int Z1, const int Z2, const int a, const int b, const double r, const double arat); + double phi_meam_series(const double scrn, const int Z1, const int Z2, const int a, const int b, + const double r, const double arat); void compute_reference_density(); - void get_tavref(double*, double*, double*, double*, double*, double*, double, double, double, double, - double, double, double, int, int, lattice_t); - void get_sijk(double, int, int, int, double*); - void get_densref(double, int, int, double*, double*, double*, double*, double*, double*, double*, double*); + void get_tavref(double *, double *, double *, double *, double *, double *, double, double, + double, double, double, double, double, int, int, lattice_t); + void get_sijk(double, int, int, int, double *); + void get_densref(double, int, int, double *, double *, double *, double *, double *, double *, + double *, double *); void interpolate_meam(int); -public: + public: + // clang-format off //----------------------------------------------------------------------------- // convert lattice spec to lattice_t // only use single-element lattices if single=true @@ -269,41 +279,46 @@ public: } return true; } - + // clang-format on static int get_Zij(const lattice_t latt); - void meam_setup_global(int nelt, lattice_t* lat, int* ielement, double* atwt, double* alpha, - double* b0, double* b1, double* b2, double* b3, double* alat, double* esub, - double* asub, double* t0, double* t1, double* t2, double* t3, double* rozero, - int* ibar); - void meam_setup_param(int which, double value, int nindex, int* index /*index(3)*/, int* errorflag); - void meam_setup_done(double* cutmax); + void meam_setup_global(int nelt, lattice_t *lat, int *ielement, double *atwt, double *alpha, + double *b0, double *b1, double *b2, double *b3, double *alat, double *esub, + double *asub, double *t0, double *t1, double *t2, double *t3, + double *rozero, int *ibar); + void meam_setup_param(int which, double value, int nindex, int *index /*index(3)*/, + int *errorflag); + void meam_setup_done(double *cutmax); void meam_dens_setup(int atom_nmax, int nall, int n_neigh); - void meam_dens_init(int i, int ntype, int* type, int* fmap, double** x, int numneigh, int* firstneigh, - int numneigh_full, int* firstneigh_full, int fnoffset); - void meam_dens_final(int nlocal, int eflag_either, int eflag_global, int eflag_atom, double* eng_vdwl, - double* eatom, int ntype, int* type, int* fmap, double** scale, int& errorflag); - void meam_force(int i, int eflag_either, int eflag_global, int eflag_atom, int vflag_atom, double* eng_vdwl, - double* eatom, int ntype, int* type, int* fmap, double** scale, double** x, int numneigh, int* firstneigh, - int numneigh_full, int* firstneigh_full, int fnoffset, double** f, double** vatom); + void meam_dens_init(int i, int ntype, int *type, int *fmap, double **x, int numneigh, + int *firstneigh, int numneigh_full, int *firstneigh_full, int fnoffset); + void meam_dens_final(int nlocal, int eflag_either, int eflag_global, int eflag_atom, + double *eng_vdwl, double *eatom, int ntype, int *type, int *fmap, + double **scale, int &errorflag); + void meam_force(int i, int eflag_either, int eflag_global, int eflag_atom, int vflag_atom, + double *eng_vdwl, double *eatom, int ntype, int *type, int *fmap, double **scale, + double **x, int numneigh, int *firstneigh, int numneigh_full, + int *firstneigh_full, int fnoffset, double **f, double **vatom); }; // Functions we need for compat -static inline bool iszero(const double f) { +static inline bool iszero(const double f) +{ return fabs(f) < 1e-20; } -static inline bool isone(const double f) { - return fabs(f-1.0) < 1e-20; +static inline bool isone(const double f) +{ + return fabs(f - 1.0) < 1e-20; } // Helper functions -static inline double fdiv_zero(const double n, const double d) { - if (iszero(d)) - return 0.0; +static inline double fdiv_zero(const double n, const double d) +{ + if (iszero(d)) return 0.0; return n / d; } -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-MEAMC/pair_meamc.h b/src/USER-MEAMC/pair_meamc.h index c7ed7e18fc..f8adf359b2 100644 --- a/src/USER-MEAMC/pair_meamc.h +++ b/src/USER-MEAMC/pair_meamc.h @@ -47,12 +47,12 @@ class PairMEAMC : public Pair { private: class MEAM *meam_inst; - double cutmax; // max cutoff for all elements - int nlibelements; // # of library elements - std::vector libelements; // names of library elements - std::vector mass; // mass of library element + double cutmax; // max cutoff for all elements + int nlibelements; // # of library elements + std::vector libelements; // names of library elements + std::vector mass; // mass of library element - double **scale; // scaling factor for adapt + double **scale; // scaling factor for adapt void allocate(); void read_files(const std::string &, const std::string &); @@ -61,7 +61,7 @@ class PairMEAMC : public Pair { void neigh_strip(int, int *, int *, int **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/atom_vec_edpd.h b/src/USER-MESODPD/atom_vec_edpd.h index 9f6c01897c..5a6defb88b 100644 --- a/src/USER-MESODPD/atom_vec_edpd.h +++ b/src/USER-MESODPD/atom_vec_edpd.h @@ -35,12 +35,12 @@ class AtomVecEDPD : public AtomVec { void data_atom_post(int); private: - double *edpd_cv,*edpd_temp,*edpd_flux; + double *edpd_cv, *edpd_temp, *edpd_flux; double **vest; double *vest_temp; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/atom_vec_mdpd.h b/src/USER-MESODPD/atom_vec_mdpd.h index 4b29038017..62321a2819 100644 --- a/src/USER-MESODPD/atom_vec_mdpd.h +++ b/src/USER-MESODPD/atom_vec_mdpd.h @@ -36,11 +36,11 @@ class AtomVecMDPD : public AtomVec { void pack_property_atom(int, double *, int, int); private: - double *rho,*drho; + double *rho, *drho; double **vest; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/atom_vec_tdpd.h b/src/USER-MESODPD/atom_vec_tdpd.h index b061b48c41..0e362705dc 100644 --- a/src/USER-MESODPD/atom_vec_tdpd.h +++ b/src/USER-MESODPD/atom_vec_tdpd.h @@ -41,7 +41,7 @@ class AtomVecTDPD : public AtomVec { int cc_species; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/compute_edpd_temp_atom.h b/src/USER-MESODPD/compute_edpd_temp_atom.h index b5c4d84e89..bc66d8fbf3 100644 --- a/src/USER-MESODPD/compute_edpd_temp_atom.h +++ b/src/USER-MESODPD/compute_edpd_temp_atom.h @@ -37,7 +37,7 @@ class ComputeEDPDTempAtom : public Compute { double *temp_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.h b/src/USER-MESODPD/compute_tdpd_cc_atom.h index db26e512dd..4736f7f393 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.h +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.h @@ -38,7 +38,7 @@ class ComputeTDPDCCAtom : public Compute { double *cc_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_edpd_source.h b/src/USER-MESODPD/fix_edpd_source.h index 81190becdc..3de1477406 100644 --- a/src/USER-MESODPD/fix_edpd_source.h +++ b/src/USER-MESODPD/fix_edpd_source.h @@ -38,7 +38,7 @@ class FixEDPDSource : public Fix { double value; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_mvv_dpd.h b/src/USER-MESODPD/fix_mvv_dpd.h index 496898cf2b..5a4221d536 100644 --- a/src/USER-MESODPD/fix_mvv_dpd.h +++ b/src/USER-MESODPD/fix_mvv_dpd.h @@ -39,7 +39,7 @@ class FixMvvDPD : public Fix { double verlet; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_mvv_edpd.h b/src/USER-MESODPD/fix_mvv_edpd.h index 194278e57d..30dca5041e 100644 --- a/src/USER-MESODPD/fix_mvv_edpd.h +++ b/src/USER-MESODPD/fix_mvv_edpd.h @@ -39,7 +39,7 @@ class FixMvvEDPD : public Fix { double verlet; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_mvv_tdpd.h b/src/USER-MESODPD/fix_mvv_tdpd.h index b64121b622..f35e9b31bb 100644 --- a/src/USER-MESODPD/fix_mvv_tdpd.h +++ b/src/USER-MESODPD/fix_mvv_tdpd.h @@ -40,7 +40,7 @@ class FixMvvTDPD : public Fix { int cc_species; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/fix_tdpd_source.h b/src/USER-MESODPD/fix_tdpd_source.h index 6a73de9d09..0b0b34536a 100644 --- a/src/USER-MESODPD/fix_tdpd_source.h +++ b/src/USER-MESODPD/fix_tdpd_source.h @@ -39,7 +39,7 @@ class FixTDPDSource : public Fix { double value; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_edpd.h b/src/USER-MESODPD/pair_edpd.h index f1a808c59e..6320404933 100644 --- a/src/USER-MESODPD/pair_edpd.h +++ b/src/USER-MESODPD/pair_edpd.h @@ -42,21 +42,21 @@ class PairEDPD : public Pair { protected: double cut_global; int seed; - double **cut,**cutT; - double **a0,**gamma; + double **cut, **cutT; + double **a0, **gamma; double **power; double **slope; double **kappa; double **powerT; int power_flag, kappa_flag; - double ***sc,***kc; + double ***sc, ***kc; class RanMars *random; class RanMars *randomT; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_mdpd.h b/src/USER-MESODPD/pair_mdpd.h index bb436f5137..49db0ee6af 100644 --- a/src/USER-MESODPD/pair_mdpd.h +++ b/src/USER-MESODPD/pair_mdpd.h @@ -41,17 +41,17 @@ class PairMDPD : public Pair { virtual void write_data_all(FILE *); protected: - double cut_global,temperature; + double cut_global, temperature; int seed; double **cut, **cut_r; - double **A_att,**B_rep; - double **gamma,**sigma; + double **A_att, **B_rep; + double **gamma, **sigma; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_mdpd_rhosum.h b/src/USER-MESODPD/pair_mdpd_rhosum.h index 7b44e04510..8c3435b2bf 100644 --- a/src/USER-MESODPD/pair_mdpd_rhosum.h +++ b/src/USER-MESODPD/pair_mdpd_rhosum.h @@ -44,7 +44,7 @@ class PairMDPDRhoSum : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESODPD/pair_tdpd.h b/src/USER-MESODPD/pair_tdpd.h index 92ac86ba73..71aa9618ff 100644 --- a/src/USER-MESODPD/pair_tdpd.h +++ b/src/USER-MESODPD/pair_tdpd.h @@ -40,19 +40,19 @@ class PairTDPD : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_global,temperature; - int seed,cc_species; - double **cut,**cutcc; - double **a0,**gamma,**sigma; + double cut_global, temperature; + int seed, cc_species; + double **cut, **cutcc; + double **a0, **gamma, **sigma; double **power; - double ***kappa,***epsilon; + double ***kappa, ***epsilon; double ***powercc; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/atom_vec_mesont.h b/src/USER-MESONT/atom_vec_mesont.h index fbfa607892..a919532682 100644 --- a/src/USER-MESONT/atom_vec_mesont.h +++ b/src/USER-MESONT/atom_vec_mesont.h @@ -31,7 +31,7 @@ class AtomVecMesoNT : public AtomVec { AtomVecMesoNT(class LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/compute_mesont.h b/src/USER-MESONT/compute_mesont.h index efa5f029a5..51e6f541a3 100644 --- a/src/USER-MESONT/compute_mesont.h +++ b/src/USER-MESONT/compute_mesont.h @@ -41,11 +41,11 @@ class ComputeMesoNT : public Compute { int nmax; double *energy; - enum ComputeType {ES, EB, ET}; + enum ComputeType { ES, EB, ET }; ComputeType compute_type; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/export_mesont.h b/src/USER-MESONT/export_mesont.h index 517b445d54..9c8baa1909 100644 --- a/src/USER-MESONT/export_mesont.h +++ b/src/USER-MESONT/export_mesont.h @@ -16,31 +16,32 @@ #ifdef __cplusplus extern "C" { #endif - // see ExportCNT.f90 in lib/mesont for function details - void mesont_lib_TPBInit(); - void mesont_lib_TPMInit(const int& M, const int& N); - void mesont_lib_SetTablePath(const char* TPMFile, const int& N); +// see ExportCNT.f90 in lib/mesont for function details +void mesont_lib_TPBInit(); +void mesont_lib_TPMInit(const int &M, const int &N); +void mesont_lib_SetTablePath(const char *TPMFile, const int &N); - void mesont_lib_InitCNTPotModule(const int& STRModel, const int& STRParams, - const int& YMType, const int& BNDModel, const double& Rref); +void mesont_lib_InitCNTPotModule(const int &STRModel, const int &STRParams, const int &YMType, + const int &BNDModel, const double &Rref); - double mesont_lib_get_R(); +double mesont_lib_get_R(); - void mesont_lib_TubeStretchingForceField(double& U1, double& U2, double* F1, - double* F2, double* S1, double* S2, const double* X1, const double* X2, - const double& R12, const double& L12); +void mesont_lib_TubeStretchingForceField(double &U1, double &U2, double *F1, double *F2, double *S1, + double *S2, const double *X1, const double *X2, + const double &R12, const double &L12); - void mesont_lib_TubeBendingForceField(double& U1, double& U2, double& U3, - double* F1, double* F2, double* F3, double* S1, double* S2, double* S3, - const double* X1, const double* X2, const double* X3, const double& R123, - const double& L123, int& BBF2 ); +void mesont_lib_TubeBendingForceField(double &U1, double &U2, double &U3, double *F1, double *F2, + double *F3, double *S1, double *S2, double *S3, + const double *X1, const double *X2, const double *X3, + const double &R123, const double &L123, int &BBF2); - void mesont_lib_SegmentTubeForceField(double& U1, double& U2, double *U, - double* F1, double* F2, double* F, double* Fe, double* S1, double* S2, - double* S, double* Se, const double* X1, const double* X2, - const double& R12, const int& N, const double* X, const double* Xe, - const int* BBF, const double& R, const int& E1, const int& E2, - const int& Ee, const int& TPMType); +void mesont_lib_SegmentTubeForceField(double &U1, double &U2, double *U, double *F1, double *F2, + double *F, double *Fe, double *S1, double *S2, double *S, + double *Se, const double *X1, const double *X2, + const double &R12, const int &N, const double *X, + const double *Xe, const int *BBF, const double &R, + const int &E1, const int &E2, const int &Ee, + const int &TPMType); #ifdef __cplusplus } diff --git a/src/USER-MESONT/pair_mesocnt.h b/src/USER-MESONT/pair_mesocnt.h index 7991996d7b..8cd8d0c923 100644 --- a/src/USER-MESONT/pair_mesocnt.h +++ b/src/USER-MESONT/pair_mesocnt.h @@ -35,28 +35,27 @@ class PairMesoCNT : public Pair { double init_one(int, int); protected: - int uinf_points,gamma_points,phi_points,usemi_points; - int nlocal_size,reduced_neigh_size; - int *reduced_nlist,*numchainlist; - int **reduced_neighlist,**nchainlist,**endlist; + int uinf_points, gamma_points, phi_points, usemi_points; + int nlocal_size, reduced_neigh_size; + int *reduced_nlist, *numchainlist; + int **reduced_neighlist, **nchainlist, **endlist; int ***chainlist; - double ang,ang_inv,eunit,funit; - double delta1,delta2; - double r,rsq,d,rc,rcsq,rc0,cutoff,cutoffsq; - double r_ang,rsq_ang,d_ang,rc_ang,rcsq_ang,cutoff_ang,cutoffsq_ang; - double sig,sig_ang,comega,ctheta; - double hstart_uinf,hstart_gamma, - hstart_phi,psistart_phi,hstart_usemi,xistart_usemi; - double delh_uinf,delh_gamma,delh_phi,delpsi_phi,delh_usemi,delxi_usemi; + double ang, ang_inv, eunit, funit; + double delta1, delta2; + double r, rsq, d, rc, rcsq, rc0, cutoff, cutoffsq; + double r_ang, rsq_ang, d_ang, rc_ang, rcsq_ang, cutoff_ang, cutoffsq_ang; + double sig, sig_ang, comega, ctheta; + double hstart_uinf, hstart_gamma, hstart_phi, psistart_phi, hstart_usemi, xistart_usemi; + double delh_uinf, delh_gamma, delh_phi, delpsi_phi, delh_usemi, delxi_usemi; - double p1[3],p2[3],p[3],m[3]; - double *param,*w,*wnode; + double p1[3], p2[3], p[3], m[3]; + double *param, *w, *wnode; double **dq_w; - double ***q1_dq_w,***q2_dq_w; - double *uinf_data,*gamma_data,**phi_data,**usemi_data; - double **uinf_coeff,**gamma_coeff,****phi_coeff,****usemi_coeff; - double **flocal,**fglobal,**basis; + double ***q1_dq_w, ***q2_dq_w; + double *uinf_data, *gamma_data, **phi_data, **usemi_data; + double **uinf_coeff, **gamma_coeff, ****phi_coeff, ****usemi_coeff; + double **flocal, **fglobal, **basis; char *file; @@ -67,59 +66,56 @@ class PairMesoCNT : public Pair { void sort(int *, int); void read_file(); void read_data(FILE *, double *, double &, double &, int); - void read_data(FILE *, double **, double &, double &, - double &, double &, int); + void read_data(FILE *, double **, double &, double &, double &, double &, int); void spline_coeff(double *, double **, double, int); void spline_coeff(double **, double ****, double, double, int); double spline(double, double, double, double **, int); double dspline(double, double, double, double **, int); - double spline(double, double, double, double, double, double, - double ****, int); - double dxspline(double, double, double, double, double, double, - double ****, int); - double dyspline(double, double, double, double, double, double, - double ****, int); + double spline(double, double, double, double, double, double, double ****, int); + double dxspline(double, double, double, double, double, double, double ****, int); + double dyspline(double, double, double, double, double, double, double ****, int); - void geometry(const double *, const double *, const double *, - const double *, const double *, + void geometry(const double *, const double *, const double *, const double *, const double *, double *, double *, double *, double **); - void weight(const double *, const double *, const double *, - const double *, double &, double *, double *, - double *, double *); + void weight(const double *, const double *, const double *, const double *, double &, double *, + double *, double *, double *); void finf(const double *, double &, double **); void fsemi(const double *, double &, double &, double **); // inlined functions for efficiency - inline double heaviside(double x) { - if (x > 0) return 1.0; - else return 0.0; + inline double heaviside(double x) + { + if (x > 0) + return 1.0; + else + return 0.0; } - inline double s(double x) { - return heaviside(-x) + heaviside(x)*heaviside(1-x)*(1 - x*x*(3 - 2*x)); + inline double s(double x) + { + return heaviside(-x) + heaviside(x) * heaviside(1 - x) * (1 - x * x * (3 - 2 * x)); } - inline double ds(double x) { - return 6 * heaviside(x) * heaviside(1-x) * x * (x-1); - } + inline double ds(double x) { return 6 * heaviside(x) * heaviside(1 - x) * x * (x - 1); } - inline double s5(double x) { + inline double s5(double x) + { double x2 = x * x; - return heaviside(-x) - + heaviside(x)*heaviside(1-x)*(1 - x2*x*(6*x2 - 15*x + 10)); + return heaviside(-x) + heaviside(x) * heaviside(1 - x) * (1 - x2 * x * (6 * x2 - 15 * x + 10)); } - inline double ds5(double x) { + inline double ds5(double x) + { double x2 = x * x; - return -30 * heaviside(x) * heaviside(1-x) * x2 * (x2 - 2*x + 1); + return -30 * heaviside(x) * heaviside(1 - x) * x2 * (x2 - 2 * x + 1); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MESONT/pair_mesont_tpm.h b/src/USER-MESONT/pair_mesont_tpm.h index 2a0db535e6..534fb25180 100644 --- a/src/USER-MESONT/pair_mesont_tpm.h +++ b/src/USER-MESONT/pair_mesont_tpm.h @@ -42,14 +42,14 @@ class PairMESONTTPM : public Pair { void write_data_all(FILE *); virtual void init_style(); - double energy_s; // accumulated energies for stretching - double energy_b; // accumulated energies for bending - double energy_t; // accumulated energies for tube-tube interaction - double *eatom_s, *eatom_b, *eatom_t; // accumulated per-atom values + double energy_s; // accumulated energies for stretching + double energy_b; // accumulated energies for bending + double energy_t; // accumulated energies for tube-tube interaction + double *eatom_s, *eatom_b, *eatom_t; // accumulated per-atom values protected: int BendingMode, TPMType; - char* tab_path; + char *tab_path; int tab_path_length; double cut_global; double **cut; @@ -60,7 +60,7 @@ class PairMESONTTPM : public Pair { virtual void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MGPT/mgpt_bgmul_7.c.h b/src/USER-MGPT/mgpt_bgmul_7.c.h index 5719697759..dfe42f8c77 100644 --- a/src/USER-MGPT/mgpt_bgmul_7.c.h +++ b/src/USER-MGPT/mgpt_bgmul_7.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_linalg.h b/src/USER-MGPT/mgpt_linalg.h index 20993af68c..ecb2db22af 100644 --- a/src/USER-MGPT/mgpt_linalg.h +++ b/src/USER-MGPT/mgpt_linalg.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul3_538.c.h b/src/USER-MGPT/mgpt_mmul3_538.c.h index d615902214..5810f709b1 100644 --- a/src/USER-MGPT/mgpt_mmul3_538.c.h +++ b/src/USER-MGPT/mgpt_mmul3_538.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul3_748.c.h b/src/USER-MGPT/mgpt_mmul3_748.c.h index f6104c52a7..c020c13d29 100644 --- a/src/USER-MGPT/mgpt_mmul3_748.c.h +++ b/src/USER-MGPT/mgpt_mmul3_748.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul3d_526.c.h b/src/USER-MGPT/mgpt_mmul3d_526.c.h index 0a7e763f63..9e1e507e06 100644 --- a/src/USER-MGPT/mgpt_mmul3d_526.c.h +++ b/src/USER-MGPT/mgpt_mmul3d_526.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul3d_744.c.h b/src/USER-MGPT/mgpt_mmul3d_744.c.h index cfbe1236c6..df958ee14e 100644 --- a/src/USER-MGPT/mgpt_mmul3d_744.c.h +++ b/src/USER-MGPT/mgpt_mmul3d_744.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul_bg_552.c.h b/src/USER-MGPT/mgpt_mmul_bg_552.c.h index 069f96907f..ff51c57e36 100644 --- a/src/USER-MGPT/mgpt_mmul_bg_552.c.h +++ b/src/USER-MGPT/mgpt_mmul_bg_552.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul_bg_722.c.h b/src/USER-MGPT/mgpt_mmul_bg_722.c.h index 732bb1319a..20114d14e7 100644 --- a/src/USER-MGPT/mgpt_mmul_bg_722.c.h +++ b/src/USER-MGPT/mgpt_mmul_bg_722.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h b/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h index ce2fb5e159..24d80528ad 100644 --- a/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h +++ b/src/USER-MGPT/mgpt_mmul_bgq_n5_lda8_2x8.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h b/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h index da7e850cac..dcc3c85688 100644 --- a/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h +++ b/src/USER-MGPT/mgpt_mmul_bgq_n7_lda8_4x8.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_readpot.h b/src/USER-MGPT/mgpt_readpot.h index 11c2a1b4b0..77fb0939cc 100644 --- a/src/USER-MGPT/mgpt_readpot.h +++ b/src/USER-MGPT/mgpt_readpot.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_splinetab.h b/src/USER-MGPT/mgpt_splinetab.h index 7458c1ecdd..86fa842a19 100644 --- a/src/USER-MGPT/mgpt_splinetab.h +++ b/src/USER-MGPT/mgpt_splinetab.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_5022.c.h b/src/USER-MGPT/mgpt_ttr_5022.c.h index c588d4925f..2d02c43159 100644 --- a/src/USER-MGPT/mgpt_ttr_5022.c.h +++ b/src/USER-MGPT/mgpt_ttr_5022.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_5042.c.h b/src/USER-MGPT/mgpt_ttr_5042.c.h index f60ecb5fb1..1ecd76898a 100644 --- a/src/USER-MGPT/mgpt_ttr_5042.c.h +++ b/src/USER-MGPT/mgpt_ttr_5042.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_5123.c.h b/src/USER-MGPT/mgpt_ttr_5123.c.h index ecab1d2c47..41d0ce9c2d 100644 --- a/src/USER-MGPT/mgpt_ttr_5123.c.h +++ b/src/USER-MGPT/mgpt_ttr_5123.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_5141.c.h b/src/USER-MGPT/mgpt_ttr_5141.c.h index 0e3f04cdf4..ed2f696e6b 100644 --- a/src/USER-MGPT/mgpt_ttr_5141.c.h +++ b/src/USER-MGPT/mgpt_ttr_5141.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_7022.c.h b/src/USER-MGPT/mgpt_ttr_7022.c.h index 1e5e1cd94b..0c26cc0a68 100644 --- a/src/USER-MGPT/mgpt_ttr_7022.c.h +++ b/src/USER-MGPT/mgpt_ttr_7022.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_7042.c.h b/src/USER-MGPT/mgpt_ttr_7042.c.h index fb8cdb3123..439e6f666e 100644 --- a/src/USER-MGPT/mgpt_ttr_7042.c.h +++ b/src/USER-MGPT/mgpt_ttr_7042.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_7123.c.h b/src/USER-MGPT/mgpt_ttr_7123.c.h index 60fa7eb5e3..01f09dae4b 100644 --- a/src/USER-MGPT/mgpt_ttr_7123.c.h +++ b/src/USER-MGPT/mgpt_ttr_7123.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/mgpt_ttr_7141.c.h b/src/USER-MGPT/mgpt_ttr_7141.c.h index 2e61b34fe2..b3c8cf904a 100644 --- a/src/USER-MGPT/mgpt_ttr_7141.c.h +++ b/src/USER-MGPT/mgpt_ttr_7141.c.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MGPT/pair_mgpt.h b/src/USER-MGPT/pair_mgpt.h index ef02be5a87..511aa9e4b4 100644 --- a/src/USER-MGPT/pair_mgpt.h +++ b/src/USER-MGPT/pair_mgpt.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-MISC/angle_cosine_shift.h b/src/USER-MISC/angle_cosine_shift.h index ed650c887b..c78767d8a5 100644 --- a/src/USER-MISC/angle_cosine_shift.h +++ b/src/USER-MISC/angle_cosine_shift.h @@ -46,7 +46,7 @@ class AngleCosineShift : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_cosine_shift_exp.h b/src/USER-MISC/angle_cosine_shift_exp.h index 7fbf9b7516..a1bb557c6a 100644 --- a/src/USER-MISC/angle_cosine_shift_exp.h +++ b/src/USER-MISC/angle_cosine_shift_exp.h @@ -38,7 +38,7 @@ class AngleCosineShiftExp : public Angle { protected: bool *doExpansion; - double *umin,*a,*opt1; + double *umin, *a, *opt1; double *theta0; double *sint; double *cost; @@ -46,7 +46,7 @@ class AngleCosineShiftExp : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_dipole.h b/src/USER-MISC/angle_dipole.h index 5a2681a722..728baabe62 100644 --- a/src/USER-MISC/angle_dipole.h +++ b/src/USER-MISC/angle_dipole.h @@ -37,12 +37,12 @@ class AngleDipole : public Angle { double single(int, int, int, int); protected: - double *k,*gamma0; + double *k, *gamma0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_fourier.h b/src/USER-MISC/angle_fourier.h index a229a876dd..f613caa37b 100644 --- a/src/USER-MISC/angle_fourier.h +++ b/src/USER-MISC/angle_fourier.h @@ -37,12 +37,12 @@ class AngleFourier : public Angle { virtual double single(int, int, int, int); protected: - double *k,*C0,*C1,*C2; + double *k, *C0, *C1, *C2; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_fourier_simple.h b/src/USER-MISC/angle_fourier_simple.h index 56404cd24f..50c1b18b98 100644 --- a/src/USER-MISC/angle_fourier_simple.h +++ b/src/USER-MISC/angle_fourier_simple.h @@ -37,12 +37,12 @@ class AngleFourierSimple : public Angle { virtual double single(int, int, int, int); protected: - double *k,*C,*N; + double *k, *C, *N; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_gaussian.h b/src/USER-MISC/angle_gaussian.h index ff281ac49a..3690169cdf 100644 --- a/src/USER-MISC/angle_gaussian.h +++ b/src/USER-MISC/angle_gaussian.h @@ -39,12 +39,12 @@ class AngleGaussian : public Angle { protected: int *nterms; double *angle_temperature; - double **alpha,**width,**theta0; + double **alpha, **width, **theta0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/angle_quartic.h b/src/USER-MISC/angle_quartic.h index c6340d3aac..81ce7adf20 100644 --- a/src/USER-MISC/angle_quartic.h +++ b/src/USER-MISC/angle_quartic.h @@ -42,7 +42,7 @@ class AngleQuartic : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_gaussian.h b/src/USER-MISC/bond_gaussian.h index 9958984020..63e6d1695a 100644 --- a/src/USER-MISC/bond_gaussian.h +++ b/src/USER-MISC/bond_gaussian.h @@ -39,12 +39,12 @@ class BondGaussian : public Bond { protected: int *nterms; double *bond_temperature; - double **alpha,**width,**r0; + double **alpha, **width, **r0; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_harmonic_shift.h b/src/USER-MISC/bond_harmonic_shift.h index a2818622cc..331e6b1c84 100644 --- a/src/USER-MISC/bond_harmonic_shift.h +++ b/src/USER-MISC/bond_harmonic_shift.h @@ -37,12 +37,12 @@ class BondHarmonicShift : public Bond { double single(int, double, int, int, double &); protected: - double *k,*r0,*r1; + double *k, *r0, *r1; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_harmonic_shift_cut.h b/src/USER-MISC/bond_harmonic_shift_cut.h index c382d0d6dc..29b0c9e0f6 100644 --- a/src/USER-MISC/bond_harmonic_shift_cut.h +++ b/src/USER-MISC/bond_harmonic_shift_cut.h @@ -37,12 +37,12 @@ class BondHarmonicShiftCut : public Bond { double single(int, double, int, int, double &); protected: - double *k,*r0,*r1; + double *k, *r0, *r1; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/bond_special.h b/src/USER-MISC/bond_special.h index 5da956d79e..333edd945b 100644 --- a/src/USER-MISC/bond_special.h +++ b/src/USER-MISC/bond_special.h @@ -26,7 +26,7 @@ BondStyle(special,BondSpecial); namespace LAMMPS_NS { -class BondSpecial: public Bond { +class BondSpecial : public Bond { public: BondSpecial(class LAMMPS *); virtual ~BondSpecial(); @@ -40,12 +40,12 @@ class BondSpecial: public Bond { double single(int, double, int, int, double &); protected: - double *factor_lj,*factor_coul; + double *factor_lj, *factor_coul; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_ackland_atom.h b/src/USER-MISC/compute_ackland_atom.h index 46d71af231..c803418453 100644 --- a/src/USER-MISC/compute_ackland_atom.h +++ b/src/USER-MISC/compute_ackland_atom.h @@ -34,7 +34,7 @@ class ComputeAcklandAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh,legacy; + int nmax, maxneigh, legacy; double *distsq; int *nearest, *nearest_n0, *nearest_n1; double *structure; @@ -44,7 +44,7 @@ class ComputeAcklandAtom : public Compute { void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_basal_atom.h b/src/USER-MISC/compute_basal_atom.h index 4c6621a714..08fa75a2ef 100644 --- a/src/USER-MISC/compute_basal_atom.h +++ b/src/USER-MISC/compute_basal_atom.h @@ -34,7 +34,7 @@ class ComputeBasalAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh; + int nmax, maxneigh; double *distsq; int *nearest, *nearest_n0, *nearest_n1; double **BPV; @@ -44,7 +44,7 @@ class ComputeBasalAtom : public Compute { void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_cnp_atom.h b/src/USER-MISC/compute_cnp_atom.h index 0890bc6655..3df091d8cd 100644 --- a/src/USER-MISC/compute_cnp_atom.h +++ b/src/USER-MISC/compute_cnp_atom.h @@ -34,22 +34,22 @@ class ComputeCNPAtom : public Compute { double memory_usage(); private: -//revise + //revise int nmax; double cutsq; class NeighList *list; int **nearest; int *nnearest; double *cnpv; -// int nmax; -// double cutsq; -// class NeighList *list; -// int **nearest; -// int *nnearest; -// double *pattern; + // int nmax; + // double cutsq; + // class NeighList *list; + // int **nearest; + // int *nnearest; + // double *pattern; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_entropy_atom.h b/src/USER-MISC/compute_entropy_atom.h index 062233c1a4..2b13523ce3 100644 --- a/src/USER-MISC/compute_entropy_atom.h +++ b/src/USER-MISC/compute_entropy_atom.h @@ -34,7 +34,7 @@ class ComputeEntropyAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh, nbin; + int nmax, maxneigh, nbin; class NeighList *list; double *pair_entropy, *pair_entropy_avg; double sigma, cutoff, cutoff2; @@ -45,7 +45,7 @@ class ComputeEntropyAtom : public Compute { int local_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_gyration_shape.h b/src/USER-MISC/compute_gyration_shape.h index efcbf0b207..fb33813f30 100644 --- a/src/USER-MISC/compute_gyration_shape.h +++ b/src/USER-MISC/compute_gyration_shape.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class ComputeGyrationShape : public Compute { public: - char *id_gyration; // fields accessed by other classes + char *id_gyration; // fields accessed by other classes ComputeGyrationShape(class LAMMPS *, int, char **); ~ComputeGyrationShape(); @@ -37,7 +37,7 @@ class ComputeGyrationShape : public Compute { class Compute *c_gyration; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_gyration_shape_chunk.h b/src/USER-MISC/compute_gyration_shape_chunk.h index f2175a1671..d4a2ad8cd8 100644 --- a/src/USER-MISC/compute_gyration_shape_chunk.h +++ b/src/USER-MISC/compute_gyration_shape_chunk.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class ComputeGyrationShapeChunk : public Compute { public: - char *id_gyration_chunk; // fields accessed by other classes + char *id_gyration_chunk; // fields accessed by other classes ComputeGyrationShapeChunk(class LAMMPS *, int, char **); ~ComputeGyrationShapeChunk(); @@ -45,10 +45,9 @@ class ComputeGyrationShapeChunk : public Compute { class Compute *c_gyration_chunk; void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/compute_hma.h b/src/USER-MISC/compute_hma.h index 92fd40dcd6..4249b11e9d 100644 --- a/src/USER-MISC/compute_hma.h +++ b/src/USER-MISC/compute_hma.h @@ -47,21 +47,20 @@ class ComputeHMA : public Compute { double boltz, nktv2p, inv_volume; double deltaPcap; double virial_compute(int); - static double sumVirial(int n, double* v) { + static double sumVirial(int n, double *v) + { double x = 0; - for (int i=0; ie and tb->f (evenly spaced) // ----------------------------------------------------------- - enum{LINEAR,SPLINE}; + enum { LINEAR, SPLINE }; inline void uf_lookup(int type, double x, double &u, double &f) { Table *tb = &tables[tabindex[type]]; - double x_over_delta = x*tb->invdelta; - int i = static_cast (x_over_delta); + double x_over_delta = x * tb->invdelta; + int i = static_cast(x_over_delta); double a; double b = x_over_delta - i; // Apply periodic boundary conditions to indices i and i+1 if (i >= tablength) i -= tablength; - int ip1 = i+1; if (ip1 >= tablength) ip1 -= tablength; + int ip1 = i + 1; + if (ip1 >= tablength) ip1 -= tablength; - switch(tabstyle) { + switch (tabstyle) { case LINEAR: u = tb->e[i] + b * tb->de[i]; - f = tb->f[i] + b * tb->df[i]; //<--works even if tb->f_unspecified==true + f = tb->f[i] + b * tb->df[i]; //<--works even if tb->f_unspecified==true break; case SPLINE: a = 1.0 - b; u = a * tb->e[i] + b * tb->e[ip1] + - ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) * - tb->deltasq6; + ((a * a * a - a) * tb->e2[i] + (b * b * b - b) * tb->e2[ip1]) * tb->deltasq6; if (tb->f_unspecified) //Formula below taken from equation3.3.5 of "numerical recipes in c" //"f"=-derivative of e with respect to x (or "phi" in this case) - f = (tb->e[i]-tb->e[ip1])*tb->invdelta + - ((3.0*a*a-1.0)*tb->e2[i]+(1.0-3.0*b*b)*tb->e2[ip1])*tb->delta/6.0; + f = (tb->e[i] - tb->e[ip1]) * tb->invdelta + + ((3.0 * a * a - 1.0) * tb->e2[i] + (1.0 - 3.0 * b * b) * tb->e2[ip1]) * tb->delta / + 6.0; else f = a * tb->f[i] + b * tb->f[ip1] + - ((a*a*a-a)*tb->f2[i] + (b*b*b-b)*tb->f2[ip1]) * - tb->deltasq6; + ((a * a * a - a) * tb->f2[i] + (b * b * b - b) * tb->f2[ip1]) * tb->deltasq6; break; - } // switch(tabstyle) - } // uf_lookup() - + } // switch(tabstyle) + } // uf_lookup() // ---------------------------------------------------------- // u_lookup() @@ -126,28 +125,27 @@ class DihedralTable : public Dihedral { int N = tablength; // i = static_cast ((x - tb->lo) * tb->invdelta); <-general version - double x_over_delta = x*tb->invdelta; - int i = static_cast (x_over_delta); + double x_over_delta = x * tb->invdelta; + int i = static_cast(x_over_delta); double b = x_over_delta - i; // Apply periodic boundary conditions to indices i and i+1 if (i >= N) i -= N; - int ip1 = i+1; if (ip1 >= N) ip1 -= N; + int ip1 = i + 1; + if (ip1 >= N) ip1 -= N; if (tabstyle == LINEAR) { u = tb->e[i] + b * tb->de[i]; - } - else if (tabstyle == SPLINE) { + } else if (tabstyle == SPLINE) { double a = 1.0 - b; u = a * tb->e[i] + b * tb->e[ip1] + - ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) * - tb->deltasq6; + ((a * a * a - a) * tb->e2[i] + (b * b * b - b) * tb->e2[ip1]) * tb->deltasq6; } - } // u_lookup() + } // u_lookup() -}; //class DihedralTable +}; //class DihedralTable -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS -#endif //#ifndef LMP_DIHEDRAL_TABLE_H -#endif //#ifdef DIHEDRAL_CLASS ... #else +#endif //#ifndef LMP_DIHEDRAL_TABLE_H +#endif //#ifdef DIHEDRAL_CLASS ... #else diff --git a/src/USER-MISC/dihedral_table_cut.h b/src/USER-MISC/dihedral_table_cut.h index 54cd58f0d2..443c2e2e39 100644 --- a/src/USER-MISC/dihedral_table_cut.h +++ b/src/USER-MISC/dihedral_table_cut.h @@ -32,12 +32,12 @@ class DihedralTableCut : public DihedralTable { virtual void coeff(int, char **); protected: - double *aat_k,*aat_theta0_1,*aat_theta0_2; + double *aat_k, *aat_theta0_1, *aat_theta0_2; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_accelerate_cos.h b/src/USER-MISC/fix_accelerate_cos.h index 8e0e725469..403b53e009 100644 --- a/src/USER-MISC/fix_accelerate_cos.h +++ b/src/USER-MISC/fix_accelerate_cos.h @@ -28,12 +28,12 @@ FixStyle(accelerate/cos,FixAccelerateCos); namespace LAMMPS_NS { -class FixAccelerateCos: public Fix { +class FixAccelerateCos : public Fix { public: FixAccelerateCos(class LAMMPS *, int, char **); - virtual ~FixAccelerateCos() {}; + virtual ~FixAccelerateCos(){}; int setmask(); - virtual void init() {}; + virtual void init(){}; void setup(int); virtual void post_force(int); @@ -41,7 +41,7 @@ class FixAccelerateCos: public Fix { double acceleration; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_addtorque.h b/src/USER-MISC/fix_addtorque.h index d37c14ae25..74c2ed6779 100644 --- a/src/USER-MISC/fix_addtorque.h +++ b/src/USER-MISC/fix_addtorque.h @@ -39,16 +39,16 @@ class FixAddTorque : public Fix { double compute_vector(int); private: - double xvalue,yvalue,zvalue; + double xvalue, yvalue, zvalue; int varflag; - char *xstr,*ystr,*zstr; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; - double foriginal[4],foriginal_all[4]; + char *xstr, *ystr, *zstr; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; + double foriginal[4], foriginal_all[4]; int force_flag; int ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ave_correlate_long.h b/src/USER-MISC/fix_ave_correlate_long.h index d5137d0ae4..946fe3b8aa 100644 --- a/src/USER-MISC/fix_ave_correlate_long.h +++ b/src/USER-MISC/fix_ave_correlate_long.h @@ -37,38 +37,38 @@ class FixAveCorrelateLong : public Fix { void restart(char *); double memory_usage(); - double *t; // Time steps for result arrays - double **f; // Result arrays + double *t; // Time steps for result arrays + double **f; // Result arrays unsigned int npcorr; private: // NOT OPTIMAL: shift2 and accumulator2 only needed in cross-correlations - double ***shift, *** shift2; + double ***shift, ***shift2; double ***correlation; double **accumulator, **accumulator2; unsigned long int **ncorrelation; unsigned int *naccumulator; unsigned int *insertindex; - int numcorrelators; // Recommended 20 - unsigned int p; // Points per correlator (recommended 16) - unsigned int m; // Num points for average (recommended 2; p mod m = 0) - unsigned int dmin; // Min distance between ponts for correlators k>0; dmin=p/m + int numcorrelators; // Recommended 20 + unsigned int p; // Points per correlator (recommended 16) + unsigned int m; // Num points for average (recommended 2; p mod m = 0) + unsigned int dmin; // Min distance between ponts for correlators k>0; dmin=p/m - int length; // Length of result arrays - int kmax; // Maximum correlator attained during simulation + int length; // Length of result arrays + int kmax; // Maximum correlator attained during simulation - int me,nvalues; + int me, nvalues; int nfreq; - bigint nvalid,nvalid_last,last_accumulated_step; - int *which,*argindex,*value2index; + bigint nvalid, nvalid_last, last_accumulated_step; + int *which, *argindex, *value2index; char **ids; FILE *fp; - int type,startstep,overwrite; + int type, startstep, overwrite; long filepos; - int npair; // number of correlation pairs to calculate + int npair; // number of correlation pairs to calculate double *values; void accumulate(); @@ -77,10 +77,9 @@ class FixAveCorrelateLong : public Fix { void add(const int i, const double w, const int k = 0); void add(const int i, const double wA, const double wB, const int k = 0); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_electron_stopping.h b/src/USER-MISC/fix_electron_stopping.h index 5fd85a7a07..8eeaf31476 100644 --- a/src/USER-MISC/fix_electron_stopping.h +++ b/src/USER-MISC/fix_electron_stopping.h @@ -27,7 +27,6 @@ FixStyle(electron/stopping,FixElectronStopping); #include "fix.h" - namespace LAMMPS_NS { class FixElectronStopping : public Fix { @@ -44,22 +43,22 @@ class FixElectronStopping : public Fix { void read_table(const char *); void grow_table(); - double Ecut; // cutoff energy - double SeLoss, SeLoss_all; // electronic energy loss - int SeLoss_sync_flag; // sync done since last change? + double Ecut; // cutoff energy + double SeLoss, SeLoss_all; // electronic energy loss + int SeLoss_sync_flag; // sync done since last change? - int maxlines; // max number of lines in table - int table_entries; // number of table entries actually read - double **elstop_ranges; // [ 0][i]: energies - // [>0][i]: stopping powers per type + int maxlines; // max number of lines in table + int table_entries; // number of table entries actually read + double **elstop_ranges; // [ 0][i]: energies + // [>0][i]: stopping powers per type - int iregion; // region index if used, else -1 - int minneigh; // minimum number of neighbors + int iregion; // region index if used, else -1 + int minneigh; // minimum number of neighbors class NeighList *list; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_electron_stopping_fit.h b/src/USER-MISC/fix_electron_stopping_fit.h index 7c0b5b0c10..b58e679676 100644 --- a/src/USER-MISC/fix_electron_stopping_fit.h +++ b/src/USER-MISC/fix_electron_stopping_fit.h @@ -41,14 +41,15 @@ class FixElectronStoppingFit : public Fix { double compute_scalar(); private: - double *energy_coh_in,*v_min_sq,*v_max_sq,*drag_fac_in_1,*drag_fac_in_2,*drag_fac_1,*drag_fac_2; - double electronic_loss,electronic_loss_this_node; - double f_dot_v_prior,f_dot_v_current; - int last_step,this_step; + double *energy_coh_in, *v_min_sq, *v_max_sq, *drag_fac_in_1, *drag_fac_in_2, *drag_fac_1, + *drag_fac_2; + double electronic_loss, electronic_loss_this_node; + double f_dot_v_prior, f_dot_v_current; + int last_step, this_step; int nlevels_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ffl.h b/src/USER-MISC/fix_ffl.h index 325a85c8da..5739ae3a30 100644 --- a/src/USER-MISC/fix_ffl.h +++ b/src/USER-MISC/fix_ffl.h @@ -45,6 +45,7 @@ class FixFFL : public Fix { virtual void *extract(const char *, int &); void init_ffl(); + protected: double *ffl_tmp1, *ffl_tmp2; double t_start, t_stop, t_target; @@ -61,7 +62,7 @@ class FixFFL : public Fix { double **vaux; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_filter_corotate.h b/src/USER-MISC/fix_filter_corotate.h index 8b1b0a6830..dcf547c159 100644 --- a/src/USER-MISC/fix_filter_corotate.h +++ b/src/USER-MISC/fix_filter_corotate.h @@ -27,111 +27,105 @@ FixStyle(filter/corotate,FixFilterCorotate); #include "fix.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { - class FixFilterCorotate : public Fix - { - public: +class FixFilterCorotate : public Fix { + public: + FixFilterCorotate(class LAMMPS *, int, char **); + ~FixFilterCorotate(); + void setup(int); + void setup_pre_neighbor(); + void pre_neighbor(); + void setup_pre_force_respa(int, int); + // void setup_post_force_respa(int,int); + void pre_force_respa(int, int, int); + void post_force_respa(int, int, int); - FixFilterCorotate(class LAMMPS *, int, char **); - ~FixFilterCorotate(); - void setup(int); - void setup_pre_neighbor(); - void pre_neighbor(); - void setup_pre_force_respa(int,int); -// void setup_post_force_respa(int,int); - void pre_force_respa(int, int, int); - void post_force_respa(int, int, int); + void init(); + int setmask(); - void init(); - int setmask(); + double compute_array(int, int); - double compute_array(int,int); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + void grow_arrays(int); + double memory_usage(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - void grow_arrays(int ); - double memory_usage(); + void copy_arrays(int, int, int); + void set_arrays(int); + void update_arrays(int, int); - void copy_arrays(int, int, int); - void set_arrays(int); - void update_arrays(int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); + protected: + int me, nprocs; - protected: + int flevel; //filtered respa level - int me,nprocs; + double **help2; //temp derivative + double **x_store; //temp for atom->x + double *g; //temp for derivative - int flevel; //filtered respa level + double *n1, *n2, *n3, *del1, *del2, *del3; - double **help2; //temp derivative - double **x_store; //temp for atom->x - double *g; //temp for derivative + double **dn1dx, **dn2dx, **dn3dx; - double*n1,*n2,*n3, *del1, *del2,*del3; + int *bond_flag, *angle_flag; // bond/angle types to constrain + int *type_flag; // constrain bonds to these types + double *mass_list; // constrain bonds to these masses + int nmass; // # of masses in mass_list - double**dn1dx,**dn2dx,**dn3dx; + int molecular; // copy of atom->molecular + double *bond_distance, *angle_distance; // constraint distances - int *bond_flag,*angle_flag; // bond/angle types to constrain - int *type_flag; // constrain bonds to these types - double *mass_list; // constrain bonds to these masses - int nmass; // # of masses in mass_list + int nlevels_respa; // copies of needed rRESPA variables - int molecular; // copy of atom->molecular - double *bond_distance,*angle_distance; // constraint distances + double **x, **v, **f; // local ptrs to atom class quantities + double *mass, *rmass; + int *type; + int nlocal; + // atom-based arrays + int *shake_flag; // 0 if atom not in SHAKE cluster + // 1 = size 3 angle cluster + // 2,3,4 = size of bond-only cluster + tagint **shake_atom; // global IDs of atoms in cluster + // central atom is 1st + // lowest global ID is 1st for size 2 + int **shake_type; // bondtype of each bond in cluster + // for angle cluster, 3rd value + // is angletype + int *nshake; // count - int nlevels_respa; // copies of needed rRESPA variables + int *list; // list of clusters to SHAKE + int nlist, maxlist; // size and max-size of list + double ***clist_derv; //stores derivative + double **clist_q0; //stores reference config + int *clist_nselect1, *clist_nselect2; //stores length of each selec. list + int **clist_select1, **clist_select2; //stores selection lists - double **x,**v,**f; // local ptrs to atom class quantities - double *mass,*rmass; - int *type; - int nlocal; - // atom-based arrays - int *shake_flag; // 0 if atom not in SHAKE cluster - // 1 = size 3 angle cluster - // 2,3,4 = size of bond-only cluster - tagint **shake_atom; // global IDs of atoms in cluster - // central atom is 1st - // lowest global ID is 1st for size 2 - int **shake_type; // bondtype of each bond in cluster - // for angle cluster, 3rd value - // is angletype - int *nshake; // count + void find_clusters(); + int masscheck(double); - int *list; // list of clusters to SHAKE - int nlist,maxlist; // size and max-size of list - double ***clist_derv; //stores derivative - double **clist_q0; //stores reference config - int *clist_nselect1, *clist_nselect2; //stores length of each selec. list - int **clist_select1, **clist_select2; //stores selection lists + void filter_inner(); + void filter_outer(); - void find_clusters(); - int masscheck(double); + void general_cluster(int, int); - void filter_inner(); - void filter_outer(); + void stats(); + int bondtype_findset(int, tagint, tagint, int); + int angletype_findset(int, tagint, tagint, int); - void general_cluster(int,int); + // callback functions for ring communication - void stats(); - int bondtype_findset(int, tagint, tagint, int); - int angletype_findset(int, tagint, tagint, int); + static void ring_bonds(int, char *, void *); + static void ring_nshake(int, char *, void *); + static void ring_shake(int, char *, void *); - // callback functions for ring communication + int sgn(double val) { return (0 < val) - (val < 0); }; +}; - static void ring_bonds(int, char *, void *); - static void ring_nshake(int, char *, void *); - static void ring_shake(int, char *, void *); - - int sgn(double val) { - return (0 < val) - (val < 0); - }; - }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_flow_gauss.h b/src/USER-MISC/fix_flow_gauss.h index 6c772a0ae5..7f1def4b57 100644 --- a/src/USER-MISC/fix_flow_gauss.h +++ b/src/USER-MISC/fix_flow_gauss.h @@ -24,33 +24,32 @@ FixStyle(flow/gauss,FixFlowGauss); #include "fix.h" - namespace LAMMPS_NS { +namespace LAMMPS_NS { - class FixFlowGauss : public Fix { - public: - FixFlowGauss(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - double compute_vector(int n); +class FixFlowGauss : public Fix { + public: + FixFlowGauss(class LAMMPS *, int, char **); + int setmask(); + void init(); + void setup(int); + void post_force(int); + void post_force_respa(int, int, int); + double compute_scalar(); + double compute_vector(int n); - protected: - int dimension; - bool flow[3]; //flag if each direction is conserved - double a_app[3]; //applied acceleration - double mTot; //total mass of constrained group - double f_tot[3]; //total applied force - double pe_tot; //total added energy - double dt; //timestep - bool workflag; //if calculate work done by fix - int ilevel_respa; + protected: + int dimension; + bool flow[3]; //flag if each direction is conserved + double a_app[3]; //applied acceleration + double mTot; //total mass of constrained group + double f_tot[3]; //total applied force + double pe_tot; //total added energy + double dt; //timestep + bool workflag; //if calculate work done by fix + int ilevel_respa; +}; - }; - - } +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_gle.h b/src/USER-MISC/fix_gle.h index 34a3932d2a..509dada6ef 100644 --- a/src/USER-MISC/fix_gle.h +++ b/src/USER-MISC/fix_gle.h @@ -52,7 +52,9 @@ class FixGLE : public Fix { virtual void *extract(const char *, int &); - void init_gle(); void init_gles(); + void init_gle(); + void init_gles(); + protected: int ns, ns1sq; double *A, *C, *S, *T, *ST, *TT; @@ -71,7 +73,7 @@ class FixGLE : public Fix { double **vaux; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_grem.h b/src/USER-MISC/fix_grem.h index 287da4aec2..77fd67e1b7 100644 --- a/src/USER-MISC/fix_grem.h +++ b/src/USER-MISC/fix_grem.h @@ -35,18 +35,18 @@ class FixGrem : public Fix { void post_force(int); void *extract(const char *, int &); double compute_scalar(); - double scale_grem,lambda,eta,h0; + double scale_grem, lambda, eta, h0; int pressflag; private: - double tbath,pressref; + double tbath, pressref; protected: - char *id_temp,*id_press,*id_ke,*id_pe,*id_nh; - class Compute *temperature,*pressure,*ke,*pe; + char *id_temp, *id_press, *id_ke, *id_pe, *id_nh; + class Compute *temperature, *pressure, *ke, *pe; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_imd.h b/src/USER-MISC/fix_imd.h index 14cabf81fc..9a56b778f8 100644 --- a/src/USER-MISC/fix_imd.h +++ b/src/USER-MISC/fix_imd.h @@ -73,51 +73,51 @@ class FixIMD : public Fix { double memory_usage(); protected: - int imd_port; - void *localsock; - void *clientsock; + int imd_port; + void *localsock; + void *clientsock; - int num_coords; // total number of atoms controlled by this fix - int size_one; // bytes per atom in communication buffer. - int maxbuf; // size of atom communication buffer. - void *comm_buf; // communication buffer - void *idmap; // hash for mapping atom indices to consistent order. - tagint *rev_idmap; // list of the hash keys for reverse mapping. + int num_coords; // total number of atoms controlled by this fix + int size_one; // bytes per atom in communication buffer. + int maxbuf; // size of atom communication buffer. + void *comm_buf; // communication buffer + void *idmap; // hash for mapping atom indices to consistent order. + tagint *rev_idmap; // list of the hash keys for reverse mapping. - int imd_forces; // number of forces communicated via IMD. - void *force_buf; // force data buffer - double imd_fscale; // scale factor for forces. in case VMD's units are off. + int imd_forces; // number of forces communicated via IMD. + void *force_buf; // force data buffer + double imd_fscale; // scale factor for forces. in case VMD's units are off. - int imd_inactive; // true if IMD connection stopped. - int imd_terminate; // true if IMD requests termination of run. - int imd_trate; // IMD transmission rate. + int imd_inactive; // true if IMD connection stopped. + int imd_terminate; // true if IMD requests termination of run. + int imd_trate; // IMD transmission rate. - int unwrap_flag; // true if coordinates need to be unwrapped before sending - int nowait_flag; // true if LAMMPS should not wait with the execution for VMD. - int connect_msg; // flag to indicate whether a "listen for connection message" is needed. + int unwrap_flag; // true if coordinates need to be unwrapped before sending + int nowait_flag; // true if LAMMPS should not wait with the execution for VMD. + int connect_msg; // flag to indicate whether a "listen for connection message" is needed. - int me; // my MPI rank in this "world". - int nlevels_respa; // flag to determine respa levels. + int me; // my MPI rank in this "world". + int nlevels_respa; // flag to determine respa levels. - int msglen; - char *msgdata; + int msglen; + char *msgdata; #if defined(LAMMPS_ASYNC_IMD) - int buf_has_data; // flag to indicate to the i/o thread what to do. - pthread_mutex_t write_mutex; // mutex for sending coordinates to i/o thread - pthread_cond_t write_cond; // conditional variable for coordinate i/o - pthread_mutex_t read_mutex; // mutex for accessing data receieved by i/o thread - pthread_t iothread; // thread id for i/o thread. - pthread_attr_t iot_attr; // i/o thread attributes. -public: - void ioworker(void); + int buf_has_data; // flag to indicate to the i/o thread what to do. + pthread_mutex_t write_mutex; // mutex for sending coordinates to i/o thread + pthread_cond_t write_cond; // conditional variable for coordinate i/o + pthread_mutex_t read_mutex; // mutex for accessing data receieved by i/o thread + pthread_t iothread; // thread id for i/o thread. + pthread_attr_t iot_attr; // i/o thread attributes. + public: + void ioworker(void); #endif -protected: + protected: int reconnect(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ipi.h b/src/USER-MISC/fix_ipi.h index c87d2b92d5..8474f9f397 100644 --- a/src/USER-MISC/fix_ipi.h +++ b/src/USER-MISC/fix_ipi.h @@ -34,8 +34,12 @@ class FixIPI : public Fix { virtual void final_integrate(); protected: - char *host; int port; int inet, master, hasdata; - int ipisock, me, socketflag; double *buffer; long bsize; + char *host; + int port; + int inet, master, hasdata; + int ipisock, me, socketflag; + double *buffer; + long bsize; int kspace_flag; int reset_flag; @@ -43,7 +47,7 @@ class FixIPI : public Fix { class Irregular *irregular; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_momentum_chunk.h b/src/USER-MISC/fix_momentum_chunk.h index 36e5f51bec..5d3b93e22b 100644 --- a/src/USER-MISC/fix_momentum_chunk.h +++ b/src/USER-MISC/fix_momentum_chunk.h @@ -22,7 +22,6 @@ FixStyle(momentum/chunk,FixMomentumChunk); #include "fix.h" - namespace LAMMPS_NS { class FixMomentumChunk : public Fix { @@ -35,15 +34,15 @@ class FixMomentumChunk : public Fix { void post_run(); protected: - std::string id_chunk,id_com,id_vcm,id_omega; - int nchunk,linear,angular,rescale; - int xflag,yflag,zflag; + std::string id_chunk, id_com, id_vcm, id_omega; + int nchunk, linear, angular, rescale; + int xflag, yflag, zflag; class ComputeChunkAtom *cchunk; - class Compute *ccom,*cvcm,*comega; + class Compute *ccom, *cvcm, *comega; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_npt_cauchy.h b/src/USER-MISC/fix_npt_cauchy.h index 81381fdc4e..91b0456782 100644 --- a/src/USER-MISC/fix_npt_cauchy.h +++ b/src/USER-MISC/fix_npt_cauchy.h @@ -40,101 +40,101 @@ class FixNPTCauchy : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); void reset_dt(); - virtual void *extract(const char*,int &); + virtual void *extract(const char *, int &); double memory_usage(); protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target,ke_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target, ke_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple,allremap; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple, allremap; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - double drag,tdrag_factor; // drag factor on particle thermostat - double pdrag_factor; // drag factor on barostat - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int dilate_group_bit; // mask for dilation group - int *rfix; // indices of rigid fixes - char *id_dilate; // group name to dilate - class Irregular *irregular; // for migrating atoms after box flips + double drag, tdrag_factor; // drag factor on particle thermostat + double pdrag_factor; // drag factor on barostat + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int dilate_group_bit; // mask for dilation group + int *rfix; // indices of rigid fixes + char *id_dilate; // group name to dilate + class Irregular *irregular; // for migrating atoms after box flips int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally - double *eta,*eta_dot; // chain thermostat for particles + double *eta, *eta_dot; // chain thermostat for particles double *eta_dotdot; double *eta_mass; - int mtchain; // length of chain - int mtchain_default_flag; // 1 = mtchain is default + int mtchain; // length of chain + int mtchain_default_flag; // 1 = mtchain is default - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mpchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; + int nc_tchain, nc_pchain; double factor_eta; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int eta_mass_flag; // 1 if eta_mass updated, 0 if not. - int omega_mass_flag; // 1 if omega_mass updated, 0 if not. - int etap_mass_flag; // 1 if etap_mass updated, 0 if not. - int dipole_flag; // 1 if dipole is updated, 0 if not. - int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not + int eta_mass_flag; // 1 if eta_mass updated, 0 if not. + int omega_mass_flag; // 1 if omega_mass updated, 0 if not. + int etap_mass_flag; // 1 if etap_mass updated, 0 if not. + int dipole_flag; // 1 if dipole is updated, 0 if not. + int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); void nhc_temp_integrate(); void nhc_press_integrate(); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -148,36 +148,34 @@ class FixNPTCauchy : public Fix { void nh_omega_dot(); // Implementation of CauchyStat - char *id_store; // fix id of the STORE fix for retaining data - class FixStore *init_store; // fix pointer to STORE fix - double H0[3][3]; // shape matrix for the undeformed cell - double h_old[6]; // previous time step shape matrix for - // the undeformed cell - double invH0[3][3]; // inverse of H0; - double CSvol0; // volume of undeformed cell - double setPK[3][3]; // current set values of the PK stress - // (this is modified until the cauchy - // stress converges) - double alpha; // integration parameter for the cauchystat - int initPK; // 1 if setPK needs to be initialized either - // from cauchy or restart, else 0 - int restartPK; // Read PK stress from the previous run - int restart_stored; // values of PK stress from the previous step stored - int initRUN; // 0 if run not initialized - // (pressure->vector not computed yet), - // else 1 (pressure->vector available) + char *id_store; // fix id of the STORE fix for retaining data + class FixStore *init_store; // fix pointer to STORE fix + double H0[3][3]; // shape matrix for the undeformed cell + double h_old[6]; // previous time step shape matrix for + // the undeformed cell + double invH0[3][3]; // inverse of H0; + double CSvol0; // volume of undeformed cell + double setPK[3][3]; // current set values of the PK stress + // (this is modified until the cauchy + // stress converges) + double alpha; // integration parameter for the cauchystat + int initPK; // 1 if setPK needs to be initialized either + // from cauchy or restart, else 0 + int restartPK; // Read PK stress from the previous run + int restart_stored; // values of PK stress from the previous step stored + int initRUN; // 0 if run not initialized + // (pressure->vector not computed yet), + // else 1 (pressure->vector available) void CauchyStat_init(); void CauchyStat_cleanup(); void CauchyStat(); - void CauchyStat_Step(double (&Fi)[3][3], double (&Fdot)[3][3], - double (&cauchy)[3][3], double (&setcauchy)[3][3], - double (&setPK)[3][3], double volume, double volume0, - double deltat, double alpha); - + void CauchyStat_Step(double (&Fi)[3][3], double (&Fdot)[3][3], double (&cauchy)[3][3], + double (&setcauchy)[3][3], double (&setPK)[3][3], double volume, + double volume0, double deltat, double alpha); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_nvk.h b/src/USER-MISC/fix_nvk.h index e4817c3552..b89fc9778d 100644 --- a/src/USER-MISC/fix_nvk.h +++ b/src/USER-MISC/fix_nvk.h @@ -37,13 +37,13 @@ class FixNVK : public Fix { virtual void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; double K_target; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_orient_eco.h b/src/USER-MISC/fix_orient_eco.h index f145b0277d..9a1a5df67c 100644 --- a/src/USER-MISC/fix_orient_eco.h +++ b/src/USER-MISC/fix_orient_eco.h @@ -25,56 +25,55 @@ FixStyle(orient/eco,FixOrientECO); namespace LAMMPS_NS { class FixOrientECO : public Fix { - public: - FixOrientECO(class LAMMPS *, int, char **); - ~FixOrientECO(); - int setmask(); - void init(); - void init_list(int, class NeighList *); - void setup(int); - void post_force(int); - void post_force_respa(int, int, int); - double compute_scalar(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - double memory_usage(); + public: + FixOrientECO(class LAMMPS *, int, char **); + ~FixOrientECO(); + int setmask(); + void init(); + void init_list(int, class NeighList *); + void setup(int); + void post_force(int); + void post_force_respa(int, int, int); + double compute_scalar(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + double memory_usage(); - private: - struct Nbr; // forward declaration. private struct for managing precomputed terms + private: + struct Nbr; // forward declaration. private struct for managing precomputed terms - int me; // this processors rank - int nmax; // maximal # of owned + ghost atoms on this processor - int ilevel_respa; // used for RESPA integrator only + int me; // this processors rank + int nmax; // maximal # of owned + ghost atoms on this processor + int ilevel_respa; // used for RESPA integrator only - int sign; // from sign of u - double u_0; // synthetic potential energy - double half_u; // half synthetic potential energy - double eta; // threshold for thermal effects - double inv_eta; // inverse threshold for thermal effects - double r_cut; // cutoff radius - double squared_cutoff; // squared cutoff radius - double inv_squared_cutoff; // inverse squared cutoff radius - char *dir_filename; // filename of reference grain input - double dir_vec[6][3]; // direct lattice vectors - double reciprocal_vectors[2][3][3]; // reciprocal lattice vectors + int sign; // from sign of u + double u_0; // synthetic potential energy + double half_u; // half synthetic potential energy + double eta; // threshold for thermal effects + double inv_eta; // inverse threshold for thermal effects + double r_cut; // cutoff radius + double squared_cutoff; // squared cutoff radius + double inv_squared_cutoff; // inverse squared cutoff radius + char *dir_filename; // filename of reference grain input + double dir_vec[6][3]; // direct lattice vectors + double reciprocal_vectors[2][3][3]; // reciprocal lattice vectors - double added_energy; // energy added by fix + double added_energy; // energy added by fix - double **order; // order parameter and normalized order - // parameter per atom + double **order; // order parameter and normalized order + // parameter per atom - double norm_fac; // normalization constant - double inv_norm_fac; // inverse normalization constant + double norm_fac; // normalization constant + double inv_norm_fac; // inverse normalization constant - Nbr *nbr; // pointer on array of precomputed terms - class NeighList *list; // LAMMPS' neighbor list + Nbr *nbr; // pointer on array of precomputed terms + class NeighList *list; // LAMMPS' neighbor list - void get_reciprocal(); // calculate reciprocal lattice vectors - int get_norm(); // compute normalization factor + void get_reciprocal(); // calculate reciprocal lattice vectors + int get_norm(); // compute normalization factor }; -} - -#endif // LMP_FIX_ORIENT_ECO_H -#endif // FIX_CLASS +} // namespace LAMMPS_NS +#endif // LMP_FIX_ORIENT_ECO_H +#endif // FIX_CLASS diff --git a/src/USER-MISC/fix_pafi.h b/src/USER-MISC/fix_pafi.h index 613aeb944f..b6f95a0374 100644 --- a/src/USER-MISC/fix_pafi.h +++ b/src/USER-MISC/fix_pafi.h @@ -48,26 +48,26 @@ class FixPAFI : public Fix { double memory_usage(); protected: - int varflag,icompute; + int varflag, icompute; char *computename; class Compute *PathCompute; - double proj[6], proj_all[6]; // f,v,h, psi - double results[5], results_all[5]; // f.n, (f.n)**2, psi, dx.n - double c_v[10],c_v_all[10]; - double temperature,gamma,sqrtD,t_period,local_norm,mass_f; - int force_flag,od_flag,com_flag; - int nlevels_respa,ilevel_respa; + double proj[6], proj_all[6]; // f,v,h, psi + double results[5], results_all[5]; // f.n, (f.n)**2, psi, dx.n + double c_v[10], c_v_all[10]; + double temperature, gamma, sqrtD, t_period, local_norm, mass_f; + int force_flag, od_flag, com_flag; + int nlevels_respa, ilevel_respa; int maxatom; class RanMars *random; int seed; double **h; // nve - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_pimd.h b/src/USER-MISC/fix_pimd.h index 60ff0912ec..d2c1d91749 100644 --- a/src/USER-MISC/fix_pimd.h +++ b/src/USER-MISC/fix_pimd.h @@ -38,16 +38,16 @@ class FixPIMD : public Fix { double memory_usage(); void grow_arrays(int); - void copy_arrays(int,int,int); - int pack_exchange(int,double*); - int unpack_exchange(int,double*); - int pack_restart(int,double*); - void unpack_restart(int,int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); int maxsize_restart(); int size_restart(int); double compute_vector(int); - int pack_forward_comm(int, int*, double *, int, int*); + int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); int method; @@ -68,7 +68,7 @@ class FixPIMD : public Fix { /* inter-partition communication */ int max_nsend; - tagint* tag_send; + tagint *tag_send; double *buf_send; int max_nlocal; @@ -87,8 +87,8 @@ class FixPIMD : public Fix { int *mode_index; void nmpimd_init(); - void nmpimd_fill(double**); - void nmpimd_transform(double**, double**, double*); + void nmpimd_fill(double **); + void nmpimd_transform(double **, double **, double *); /* Nose-hoover chain integration */ @@ -108,8 +108,7 @@ class FixPIMD : public Fix { void nhc_update_x(); }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_rhok.h b/src/USER-MISC/fix_rhok.h index b43df04308..6398951651 100644 --- a/src/USER-MISC/fix_rhok.h +++ b/src/USER-MISC/fix_rhok.h @@ -22,13 +22,12 @@ FixStyle(rhok,FixRhok); namespace LAMMPS_NS { -class FixRhok : public Fix -{ -public: +class FixRhok : public Fix { + public: // Constructor: all the parameters to this fix specified in // the LAMMPS input get passed in - FixRhok( LAMMPS* inLMP, int inArgc, char** inArgv ); - virtual ~FixRhok() {}; + FixRhok(LAMMPS *inLMP, int inArgc, char **inArgv); + virtual ~FixRhok(){}; // Methods that this fix implements // -------------------------------- @@ -40,38 +39,37 @@ public: void init(); // Initial application of the fix to a system (when doing MD / minimization) - void setup( int inVFlag ); - void min_setup( int inVFlag ); + void setup(int inVFlag); + void min_setup(int inVFlag); // Modify the forces calculated in the main force loop, either when // doing usual MD, RESPA MD or minimization - void post_force( int inVFlag ); - void post_force_respa( int inVFlag, int inILevel, int inILoop ); - void min_post_force( int inVFlag ); + void post_force(int inVFlag); + void post_force_respa(int inVFlag, int inILevel, int inILoop); + void min_post_force(int inVFlag); // Compute the change in the potential energy induced by this fix double compute_scalar(); - // Compute the ith component of the vector associated with this fix - double compute_vector( int inI ); + // Compute the ith component of the vector associated with this fix + double compute_vector(int inI); -private: + private: // RESPA boilerplate int mNLevelsRESPA; // Defining parameters for this umbrella - double mK[3], mKappa, mRhoK0; + double mK[3], mKappa, mRhoK0; - // Number of particles affected by the fix - int mNThis; - double mSqrtNThis; + // Number of particles affected by the fix + int mNThis; + double mSqrtNThis; - // Real and imaginary parts of rho_k := sum_i exp( - i k . r_i ) - double mRhoKLocal[2], mRhoKGlobal[2]; + // Real and imaginary parts of rho_k := sum_i exp( - i k . r_i ) + double mRhoKLocal[2], mRhoKGlobal[2]; }; -} // namespace LAMMPS_NS - -#endif // __FIX_RHOK__ -#endif // FIX_CLASS +} // namespace LAMMPS_NS +#endif // __FIX_RHOK__ +#endif // FIX_CLASS diff --git a/src/USER-MISC/fix_smd.h b/src/USER-MISC/fix_smd.h index 46b2c31cfc..54ad5bc11e 100644 --- a/src/USER-MISC/fix_smd.h +++ b/src/USER-MISC/fix_smd.h @@ -38,23 +38,23 @@ class FixSMD : public Fix { void restart(char *); private: - double xc,yc,zc,xn,yn,zn,r0; - double k_smd,f_smd,v_smd; - int xflag,yflag,zflag; + double xc, yc, zc, xn, yn, zn, r0; + double k_smd, f_smd, v_smd; + int xflag, yflag, zflag; int styleflag; - double r_old,r_now,pmf; + double r_old, r_now, pmf; - int igroup2,group2bit; - double masstotal,masstotal2; + int igroup2, group2bit; + double masstotal, masstotal2; int ilevel_respa; - double ftotal[3],ftotal_all[7]; + double ftotal[3], ftotal_all[7]; int force_flag; void smd_tether(); void smd_couple(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_srp.h b/src/USER-MISC/fix_srp.h index 407f8f7103..8b1a615128 100644 --- a/src/USER-MISC/fix_srp.h +++ b/src/USER-MISC/fix_srp.h @@ -44,7 +44,7 @@ class FixSRP : public Fix { int unpack_border(int, int, double *); void post_run(); - int pack_restart(int, double*); + int pack_restart(int, double *); void unpack_restart(int, int); int maxsize_restart(); int size_restart(int); @@ -59,7 +59,7 @@ class FixSRP : public Fix { int bptype; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ti_spring.h b/src/USER-MISC/fix_ti_spring.h index f474ae8873..e6441d643a 100644 --- a/src/USER-MISC/fix_ti_spring.h +++ b/src/USER-MISC/fix_ti_spring.h @@ -35,45 +35,45 @@ class FixTISpring : public Fix { public: FixTISpring(class LAMMPS *, int, char **); ~FixTISpring(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - void initial_integrate(int); + int setmask(); + void init(); + void setup(int); + void min_setup(int); + void post_force(int); + void post_force_respa(int, int, int); + void min_post_force(int); + void initial_integrate(int); double compute_scalar(); double compute_vector(int); double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + void grow_arrays(int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); + int size_restart(int); + int maxsize_restart(); private: - double switch_func(double); // Switching function. - double dswitch_func(double); // Switching function derivative. + double switch_func(double); // Switching function. + double dswitch_func(double); // Switching function derivative. - double k; // Spring constant. - double espring; // Springs energies. - double **xoriginal; // Original coords of atoms. - double lambda; // Coupling parameter. - double dlambda; // Lambda variation with t. - double linfo[2]; // Current lambda status. - bigint t_switch; // Total switching steps. - bigint t_equil; // Equilibration time. - bigint t0; // Initial time. - int sf; // Switching function option. - int nlevels_respa; + double k; // Spring constant. + double espring; // Springs energies. + double **xoriginal; // Original coords of atoms. + double lambda; // Coupling parameter. + double dlambda; // Lambda variation with t. + double linfo[2]; // Current lambda status. + bigint t_switch; // Total switching steps. + bigint t_equil; // Equilibration time. + bigint t0; // Initial time. + int sf; // Switching function option. + int nlevels_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_ttm_mod.h b/src/USER-MISC/fix_ttm_mod.h index 55019652fa..8c12eadb7b 100644 --- a/src/USER-MISC/fix_ttm_mod.h +++ b/src/USER-MISC/fix_ttm_mod.h @@ -25,8 +25,8 @@ FixStyle(ttm/mod,FixTTMMod); namespace LAMMPS_NS { struct el_heat_capacity_thermal_conductivity { -double el_heat_capacity; -double el_thermal_conductivity; + double el_heat_capacity; + double el_thermal_conductivity; }; class FixTTMMod : public Fix { @@ -58,22 +58,22 @@ class FixTTMMod : public Fix { int seed; class RanMars *random; FILE *fp; - int nxnodes,nynodes,nznodes; + int nxnodes, nynodes, nznodes; bigint total_nnodes; int ***nsum, ***nsum_all; - double *gfactor1,*gfactor2,*ratio,**flangevin; - double ***T_electron,***T_electron_old,***T_electron_first; - double ***sum_vsq,***sum_mass_vsq; - double ***sum_vsq_all,***sum_mass_vsq_all; - double ***net_energy_transfer,***net_energy_transfer_all; - double gamma_p,gamma_s,v_0,v_0_sq; - int skin_layer,surface_l,surface_r,t_surface_l,t_surface_r; + double *gfactor1, *gfactor2, *ratio, **flangevin; + double ***T_electron, ***T_electron_old, ***T_electron_first; + double ***sum_vsq, ***sum_mass_vsq; + double ***sum_vsq_all, ***sum_mass_vsq_all; + double ***net_energy_transfer, ***net_energy_transfer_all; + double gamma_p, gamma_s, v_0, v_0_sq; + int skin_layer, surface_l, surface_r, t_surface_l, t_surface_r; int movsur; - double esheat_0,esheat_1,esheat_2,esheat_3,esheat_4,C_limit,electronic_density; - double el_th_diff,T_damp; - double intensity,width,duration,surface_double; - double mult_factor,ttm_dt; - double pres_factor,free_path,ionic_density; + double esheat_0, esheat_1, esheat_2, esheat_3, esheat_4, C_limit, electronic_density; + double el_th_diff, T_damp; + double intensity, width, duration, surface_double; + double mult_factor, ttm_dt; + double pres_factor, free_path, ionic_density; double electron_temperature_min; el_heat_capacity_thermal_conductivity el_properties(double); double el_sp_heat_integral(double); @@ -81,7 +81,7 @@ class FixTTMMod : public Fix { void read_initial_electron_temperatures(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_wall_ees.h b/src/USER-MISC/fix_wall_ees.h index 4925440d41..e37b6d7261 100644 --- a/src/USER-MISC/fix_wall_ees.h +++ b/src/USER-MISC/fix_wall_ees.h @@ -32,11 +32,11 @@ class FixWallEES : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],coeff5[6],coeff6[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], coeff5[6], coeff6[6]; class AtomVecEllipsoid *avec; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.h b/src/USER-MISC/fix_wall_reflect_stochastic.h index 19a09ba084..87ff234c19 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.h +++ b/src/USER-MISC/fix_wall_reflect_stochastic.h @@ -31,15 +31,15 @@ class FixWallReflectStochastic : public FixWallReflect { private: int seedfix; - double walltemp[6],wallvel[6][3],wallaccom[6][3]; + double walltemp[6], wallvel[6][3], wallaccom[6][3]; int rstyle; class RanMars *random; - void wall_particle(int m,int which, double coord); + void wall_particle(int m, int which, double coord); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/fix_wall_region_ees.h b/src/USER-MISC/fix_wall_region_ees.h index 85104e040a..c728a6808c 100644 --- a/src/USER-MISC/fix_wall_region_ees.h +++ b/src/USER-MISC/fix_wall_region_ees.h @@ -22,7 +22,6 @@ FixStyle(wall/region/ees,FixWallRegionEES); #include "fix.h" - namespace LAMMPS_NS { class FixWallRegionEES : public Fix { @@ -43,21 +42,21 @@ class FixWallRegionEES : public Fix { class AtomVecEllipsoid *avec; int iregion; - double epsilon,sigma,cutoff; + double epsilon, sigma, cutoff; int eflag; - double ewall[4],ewall_all[4]; + double ewall[4], ewall_all[4]; int nlevels_respa; char *idregion; - double coeff1,coeff2,coeff3,coeff4,offset; + double coeff1, coeff2, coeff3, coeff4, offset; double coeff5, coeff6; - double eng,fwall; + double eng, fwall; double torque[3]; void ees(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/improper_cossq.h b/src/USER-MISC/improper_cossq.h index 207fbdf4bf..081945b04f 100644 --- a/src/USER-MISC/improper_cossq.h +++ b/src/USER-MISC/improper_cossq.h @@ -39,7 +39,7 @@ class ImproperCossq : public Improper { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/improper_distance.h b/src/USER-MISC/improper_distance.h index 86438ca2bf..c8ee2a7c8d 100644 --- a/src/USER-MISC/improper_distance.h +++ b/src/USER-MISC/improper_distance.h @@ -35,13 +35,12 @@ class ImproperDistance : public Improper { void write_data(FILE *); private: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-MISC/improper_fourier.h b/src/USER-MISC/improper_fourier.h index 3ff9baac9e..ca0417b694 100644 --- a/src/USER-MISC/improper_fourier.h +++ b/src/USER-MISC/improper_fourier.h @@ -37,15 +37,14 @@ class ImproperFourier : public Improper { protected: double *k, *C0, *C1, *C2; int *all; - void addone(const int &i1,const int &i2,const int &i3,const int &i4, - const int &type,const int &evflag,const int &eflag, - const double &vb1x, const double &vb1y, const double &vb1z, - const double &vb2x, const double &vb2y, const double &vb2z, + void addone(const int &i1, const int &i2, const int &i3, const int &i4, const int &type, + const int &evflag, const int &eflag, const double &vb1x, const double &vb1y, + const double &vb1z, const double &vb2x, const double &vb2y, const double &vb2z, const double &vb3x, const double &vb3y, const double &vb3z); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/improper_ring.h b/src/USER-MISC/improper_ring.h index 2668c44a59..45b8d6086d 100644 --- a/src/USER-MISC/improper_ring.h +++ b/src/USER-MISC/improper_ring.h @@ -35,12 +35,12 @@ class ImproperRing : public Improper { void write_data(FILE *); protected: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_agni.h b/src/USER-MISC/pair_agni.h index 21cea32005..32594c9110 100644 --- a/src/USER-MISC/pair_agni.h +++ b/src/USER-MISC/pair_agni.h @@ -36,23 +36,22 @@ class PairAGNI : public Pair { virtual void init_style(); struct Param { - double cut,cutsq; - double *eta,**xU,*alpha; - double sigma,lambda,b,gwidth; - int numeta,numtrain,ielement; - + double cut, cutsq; + double *eta, **xU, *alpha; + double sigma, lambda, b, gwidth; + int numeta, numtrain, ielement; }; protected: - double cutmax; // max cutoff for all elements - int atomic_feature_version; // version of fingerprint - Param *params; // parameter set for an I-J interaction + double cutmax; // max cutoff for all elements + int atomic_feature_version; // version of fingerprint + Param *params; // parameter set for an I-J interaction virtual void allocate(); void read_file(char *); virtual void setup_params(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_buck_mdf.h b/src/USER-MISC/pair_buck_mdf.h index 7226f2090e..ae92f89e20 100644 --- a/src/USER-MISC/pair_buck_mdf.h +++ b/src/USER-MISC/pair_buck_mdf.h @@ -40,15 +40,15 @@ class PairBuckMDF : public Pair { void *extract(const char *, int &); protected: - double cut_global,cut_inner_global; - double **cut,**cut_inner,**cut_inner_sq; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double cut_global, cut_inner_global; + double **cut, **cut_inner, **cut_inner_sq; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_cosine_squared.h b/src/USER-MISC/pair_cosine_squared.h index fc657d30bd..ef36f38494 100644 --- a/src/USER-MISC/pair_cosine_squared.h +++ b/src/USER-MISC/pair_cosine_squared.h @@ -46,7 +46,7 @@ class PairCosineSquared : public Pair { double single(int, int, int, int, double, double, double, double &); // void *extract(const char *, int &); -/* RESPA stuff not implemented... + /* RESPA stuff not implemented... void compute_inner(); void compute_middle(); void compute_outer(int, int); @@ -61,7 +61,7 @@ class PairCosineSquared : public Pair { virtual void allocate(); }; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif #endif @@ -97,4 +97,3 @@ If cutoff is equal to sigma (minimum) then this pair style basically degenerates/reverts to only WCA. This is for convenience. */ - diff --git a/src/USER-MISC/pair_coul_diel.h b/src/USER-MISC/pair_coul_diel.h index 48ee3ab8da..78f3003912 100644 --- a/src/USER-MISC/pair_coul_diel.h +++ b/src/USER-MISC/pair_coul_diel.h @@ -51,7 +51,7 @@ class PairCoulDiel : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_coul_shield.h b/src/USER-MISC/pair_coul_shield.h index 3282b504c6..54747c8e00 100644 --- a/src/USER-MISC/pair_coul_shield.h +++ b/src/USER-MISC/pair_coul_shield.h @@ -51,47 +51,49 @@ class PairCoulShield : public Pair { void allocate(); -/* ----Calculate the long-range cutoff term */ - inline double calc_Tap(double r_ij, double Rcut) { - double Tap,r; + /* ----Calculate the long-range cutoff term */ + inline double calc_Tap(double r_ij, double Rcut) + { + double Tap, r; //int Tap_coeff[8] = {1,0,0,0,-35,84,-70,20}; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; + r = r_ij / Rcut; Tap = 0.0; Tap = Tap_coeff[7] * r + Tap_coeff[6]; - Tap = Tap * r + Tap_coeff[5]; - Tap = Tap * r + Tap_coeff[4]; - Tap = Tap * r + Tap_coeff[3]; - Tap = Tap * r + Tap_coeff[2]; - Tap = Tap * r + Tap_coeff[1]; - Tap = Tap * r + Tap_coeff[0]; + Tap = Tap * r + Tap_coeff[5]; + Tap = Tap * r + Tap_coeff[4]; + Tap = Tap * r + Tap_coeff[3]; + Tap = Tap * r + Tap_coeff[2]; + Tap = Tap * r + Tap_coeff[1]; + Tap = Tap * r + Tap_coeff[0]; - return(Tap); + return (Tap); } - /* ----Calculate the derivatives of long-range cutoff term */ - inline double calc_dTap(double r_ij, double Rcut) { - double dTap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + /* ----Calculate the derivatives of long-range cutoff term */ + inline double calc_dTap(double r_ij, double Rcut) + { + double dTap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; + r = r_ij / Rcut; dTap = 0.0; - dTap = 7.0*Tap_coeff[7] * r + 6.0*Tap_coeff[6]; - dTap = dTap * r + 5.0*Tap_coeff[5]; - dTap = dTap * r + 4.0*Tap_coeff[4]; - dTap = dTap * r + 3.0*Tap_coeff[3]; - dTap = dTap * r + 2.0*Tap_coeff[2]; - dTap = dTap * r + Tap_coeff[1]; - dTap = dTap/Rcut; + dTap = 7.0 * Tap_coeff[7] * r + 6.0 * Tap_coeff[6]; + dTap = dTap * r + 5.0 * Tap_coeff[5]; + dTap = dTap * r + 4.0 * Tap_coeff[4]; + dTap = dTap * r + 3.0 * Tap_coeff[3]; + dTap = dTap * r + 2.0 * Tap_coeff[2]; + dTap = dTap * r + Tap_coeff[1]; + dTap = dTap / Rcut; - return(dTap); + return (dTap); } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_coul_slater_cut.h b/src/USER-MISC/pair_coul_slater_cut.h index 448090b485..0f59e50730 100644 --- a/src/USER-MISC/pair_coul_slater_cut.h +++ b/src/USER-MISC/pair_coul_slater_cut.h @@ -37,7 +37,7 @@ class PairCoulSlaterCut : public PairCoulCut { double lamda; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_coul_slater_long.h b/src/USER-MISC/pair_coul_slater_long.h index 1619c95838..e37e3eb18d 100644 --- a/src/USER-MISC/pair_coul_slater_long.h +++ b/src/USER-MISC/pair_coul_slater_long.h @@ -41,7 +41,7 @@ class PairCoulSlaterLong : public Pair { virtual void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq,qdist; + double cut_coul, cut_coulsq, qdist; double lamda; //double *cut_respa; double g_ewald; @@ -50,7 +50,7 @@ class PairCoulSlaterLong : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_dpd_ext.h b/src/USER-MISC/pair_dpd_ext.h index abaef8d970..3b43a0d217 100644 --- a/src/USER-MISC/pair_dpd_ext.h +++ b/src/USER-MISC/pair_dpd_ext.h @@ -42,18 +42,18 @@ class PairDPDExt : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_global,temperature; + double cut_global, temperature; int seed; double **cut; - double **a0,**gamma,**gammaII,**gammaT; - double **sigma,**sigmaT; - double **ws,**wsT; + double **a0, **gamma, **gammaII, **gammaT; + double **sigma, **sigmaT; + double **ws, **wsT; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_dpd_ext_tstat.h b/src/USER-MISC/pair_dpd_ext_tstat.h index a7959480cc..51d7b6a044 100644 --- a/src/USER-MISC/pair_dpd_ext_tstat.h +++ b/src/USER-MISC/pair_dpd_ext_tstat.h @@ -39,10 +39,10 @@ class PairDPDExtTstat : public PairDPDExt { void write_data_all(FILE *); protected: - double t_start,t_stop; + double t_start, t_stop; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_drip.h b/src/USER-MISC/pair_drip.h index 3773cdb16c..bb1864ee8f 100644 --- a/src/USER-MISC/pair_drip.h +++ b/src/USER-MISC/pair_drip.h @@ -20,7 +20,6 @@ Phys. Rev. B, 98, 235404 (2018). ------------------------------------------------------------------------- */ - #ifdef PAIR_CLASS // clang-format off PairStyle(drip, PairDRIP); @@ -35,11 +34,10 @@ PairStyle(drip, PairDRIP); namespace LAMMPS_NS { #define DIM 3 -typedef double V3[3]; - +typedef double V3[3]; class PairDRIP : public Pair { -public: + public: PairDRIP(class LAMMPS *); virtual ~PairDRIP(); @@ -49,70 +47,62 @@ public: double init_one(int, int); void init_style(); -protected: - struct Param - { - int ielement, jelement; + protected: + struct Param { + int ielement, jelement; double C0, C2, C4, C, delta, lambda, A, z0, B, eta, rhocut, rcut, ncut; double rhocutsq, rcutsq, ncutsq; }; - Param *params; // parameter set for I-J interactions - int **nearest3neigh; // nearest 3 neighbors of atoms - double cutmax; // max cutoff for all species + Param *params; // parameter set for I-J interactions + int **nearest3neigh; // nearest 3 neighbors of atoms + double cutmax; // max cutoff for all species void read_file(char *); void allocate(); // DRIP specific functions - double calc_attractive(Param&, double const, double const *, - double *const, double *const); + double calc_attractive(Param &, double const, double const *, double *const, double *const); - double calc_repulsive(int const, int const, Param&, double const, - double const *, double const *, V3 const *, V3 const *, V3 const *, - V3 const *, double *const, double *const); + double calc_repulsive(int const, int const, Param &, double const, double const *, double const *, + V3 const *, V3 const *, V3 const *, V3 const *, double *const, + double *const); void find_nearest3neigh(); - void calc_normal(int const, double *const, V3 *const, V3 *const, V3 *const, - V3 *const); + void calc_normal(int const, double *const, V3 *const, V3 *const, V3 *const, V3 *const); - void get_drhosqij(double const *, double const *, V3 const *, V3 const *, - V3 const *, V3 const *, double *const, double *const, double *const, - double *const, double *const); + void get_drhosqij(double const *, double const *, V3 const *, V3 const *, V3 const *, V3 const *, + double *const, double *const, double *const, double *const, double *const); - double td(double, double, double, double, double const *const, double, - const double *const, double&, double&); + double td(double, double, double, double, double const *const, double, const double *const, + double &, double &); - double dihedral(const int, const int, Param&, double const, double&, - double *const, double *const, double *const, double *const, double *const, - double *const, double *const, double *const); + double dihedral(const int, const int, Param &, double const, double &, double *const, + double *const, double *const, double *const, double *const, double *const, + double *const, double *const); - double deriv_cos_omega(double const *, double const *, double const *, - double const *, double *const, double *const, double *const, - double *const); + double deriv_cos_omega(double const *, double const *, double const *, double const *, + double *const, double *const, double *const, double *const); - double tap(double, double, double&); + double tap(double, double, double &); - double tap_rho(double, double, double&); + double tap_rho(double, double, double &); - void deriv_cross(double const *, double const *, double const *, - double *const, V3 *const, V3 *const, V3 *const); + void deriv_cross(double const *, double const *, double const *, double *const, V3 *const, + V3 *const, V3 *const); // inline functions inline double dot(double const *x, double const *y) const { - return x[0]*y[0]+x[1]*y[1]+x[2]*y[2]; + return x[0] * y[0] + x[1] * y[1] + x[2] * y[2]; } inline void mat_dot_vec(V3 const *X, double const *y, double *const z) const { - for (int k = 0; k < 3; k++) { - z[k] = X[k][0]*y[0]+X[k][1]*y[1]+X[k][2]*y[2]; - } + for (int k = 0; k < 3; k++) { z[k] = X[k][0] * y[0] + X[k][1] * y[1] + X[k][2] * y[2]; } } - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_e3b.h b/src/USER-MISC/pair_e3b.h index e901a9763a..e436276fdb 100644 --- a/src/USER-MISC/pair_e3b.h +++ b/src/USER-MISC/pair_e3b.h @@ -34,35 +34,35 @@ class PairE3B : public Pair { virtual double init_one(int, int); virtual void init_style(); -protected: + protected: //potential parameters int typeO; - double ea,eb,ec; //three body energies - double k3; //three body exponential decay (units inverse length) - double rs,rc3,rc2; //rs: switching cutuff, rc3: cutoff for 3-body - double e2,k2; //2-body energy and exp decay - double cutmax; //max cutoff of all interactions - double rc2sq,rc3sq,rc3deltaSq; - double sc_denom,sc_num; + double ea, eb, ec; //three body energies + double k3; //three body exponential decay (units inverse length) + double rs, rc3, rc2; //rs: switching cutuff, rc3: cutoff for 3-body + double e2, k2; //2-body energy and exp decay + double cutmax; //max cutoff of all interactions + double rc2sq, rc3sq, rc3deltaSq; + double sc_denom, sc_num; //list of indexes of Os and Hs in each pair - int pairmax,pairPerAtom; // size of pair list - int **pairO,***pairH; // pair lists - double ***exps,****del3,***fpair3,*sumExp; - int maxID; //size of global sumExp array - size_t nbytes; //size of sumExp array in bytes - int natoms; //to make sure number of atoms is constant + int pairmax, pairPerAtom; // size of pair list + int **pairO, ***pairH; // pair lists + double ***exps, ****del3, ***fpair3, *sumExp; + int maxID; //size of global sumExp array + size_t nbytes; //size of sumExp array in bytes + int natoms; //to make sure number of atoms is constant virtual void allocate(); void allocateE3B(); bool allocatedE3B; //for reading settings from pair_style input - bool checkKeyword(const char *,const char *,const int, const int); + bool checkKeyword(const char *, const char *, const int, const int); void checkInputs(const double &bondL); - void presetParam(const int flag,bool &repeatFlag,double &bondL); + void presetParam(const int flag, bool &repeatFlag, double &bondL); tagint find_maxID(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_edip.h b/src/USER-MISC/pair_edip.h index 9111003f18..1f79983792 100644 --- a/src/USER-MISC/pair_edip.h +++ b/src/USER-MISC/pair_edip.h @@ -41,7 +41,7 @@ class PairEDIP : public Pair { double alpha, beta; double eta, gamm, lambda, mu, rho, sigma, Q0; double u1, u2, u3, u4; - int ielement,jelement,kelement; + int ielement, jelement, kelement; }; double *preInvR_ij; @@ -86,8 +86,8 @@ class PairEDIP : public Pair { double u3; double u4; - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); void allocatePreLoops(void); @@ -100,7 +100,7 @@ class PairEDIP : public Pair { void setup_params(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_edip_multi.h b/src/USER-MISC/pair_edip_multi.h index 7c0077c362..789a5fb3c3 100644 --- a/src/USER-MISC/pair_edip_multi.h +++ b/src/USER-MISC/pair_edip_multi.h @@ -36,25 +36,25 @@ class PairEDIPMulti : public Pair { protected: struct Param { - double A, B; // coefficients for pair interaction I-J - double cutoffA; // cut-off distance for pair interaction I-J - double cutoffC; // lower cut-off distance for calculating Z_I - double alpha; // coefficient for calculating Z_I - double beta; // attractive term for pair I-J - double sigma; // cut-off coefficient for pair I-J - double rho; // pair I-J - double gamma; // coefficient for three-body interaction I-J-K - double eta, lambda; // coefficients for function h(l,Z) - double mu, Q0; // coefficients for function Q(Z) - double u1, u2, u3, u4; // coefficients for function tau(Z) + double A, B; // coefficients for pair interaction I-J + double cutoffA; // cut-off distance for pair interaction I-J + double cutoffC; // lower cut-off distance for calculating Z_I + double alpha; // coefficient for calculating Z_I + double beta; // attractive term for pair I-J + double sigma; // cut-off coefficient for pair I-J + double rho; // pair I-J + double gamma; // coefficient for three-body interaction I-J-K + double eta, lambda; // coefficients for function h(l,Z) + double mu, Q0; // coefficients for function Q(Z) + double u1, u2, u3, u4; // coefficients for function tau(Z) double cutsq; - int ielement,jelement,kelement; + int ielement, jelement, kelement; }; double *preForceCoord; - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); void allocatePreLoops(void); @@ -71,7 +71,7 @@ class PairEDIPMulti : public Pair { void edip_fcut3(double, Param *, double &, double &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_extep.h b/src/USER-MISC/pair_extep.h index da0ca88900..b2f49a7b2b 100644 --- a/src/USER-MISC/pair_extep.h +++ b/src/USER-MISC/pair_extep.h @@ -39,33 +39,33 @@ class PairExTeP : public Pair { protected: struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,bigd,bigr; - double cut,cutsq; - double c1,c2,c3,c4; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, bigd, bigr; + double cut, cutsq; + double c1, c2, c3, c4; + int ielement, jelement, kelement; int powermint; - double Z_i,Z_j; // added for ExTePZBL - double ZBLcut,ZBLexpscale; - double c5,ca1,ca4; // added for ExTePMOD + double Z_i, Z_j; // added for ExTePZBL + double ZBLcut, ZBLexpscale; + double c5, ca1, ca4; // added for ExTePMOD double powern_del; }; - Param *params; // parameter set for an I-J-K interaction - double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements - int maxlocal; // size of numneigh, firstneigh arrays - int maxpage; // # of pages currently allocated - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *SR_numneigh; // # of pair neighbors for each atom - int **SR_firstneigh; // ptr to 1st neighbor of each atom + int maxlocal; // size of numneigh, firstneigh arrays + int maxpage; // # of pages currently allocated + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *SR_numneigh; // # of pair neighbors for each atom + int **SR_firstneigh; // ptr to 1st neighbor of each atom - double *Nt, *Nd; // sum of cutoff fns ( f_C ) with SR neighs + double *Nt, *Nd; // sum of cutoff fns ( f_C ) with SR neighs void allocate(); void spline_init(); @@ -73,10 +73,9 @@ class PairExTeP : public Pair { virtual void setup(); virtual void repulsive(Param *, double, double &, int, double &); virtual double zeta(Param *, double, double, double *, double *); - virtual void force_zeta(Param *, double, double, double &, - double &, int, double &); - void attractive(Param *, double, double, double, double *, double *, - double *, double *, double *); + virtual void force_zeta(Param *, double, double, double &, double &, int, double &); + void attractive(Param *, double, double, double, double *, double *, double *, double *, + double *); virtual double ters_fc(double, Param *); virtual double ters_fc_d(double, Param *); @@ -85,61 +84,47 @@ class PairExTeP : public Pair { virtual double ters_bij(double, Param *); virtual double ters_bij_d(double, Param *); - virtual void ters_zetaterm_d(double, double *, double, double *, double, - double *, double *, double *, Param *); - void costheta_d(double *, double, double *, double, - double *, double *, double *); + virtual void ters_zetaterm_d(double, double *, double, double *, double, double *, double *, + double *, Param *); + void costheta_d(double *, double, double *, double, double *, double *, double *); // inlined functions for efficiency - inline double ters_gijk(const double costheta, - const Param * const param) const { + inline double ters_gijk(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; - return param->gamma*(1.0 + ters_c/ters_d - ters_c / (ters_d + hcth*hcth)); + return param->gamma * (1.0 + ters_c / ters_d - ters_c / (ters_d + hcth * hcth)); } - inline double ters_gijk_d(const double costheta, - const Param * const param) const { + inline double ters_gijk_d(const double costheta, const Param *const param) const + { const double ters_c = param->c * param->c; const double ters_d = param->d * param->d; const double hcth = param->h - costheta; const double numerator = -2.0 * ters_c * hcth; - const double denominator = 1.0/(ters_d + hcth*hcth); - return param->gamma*numerator*denominator*denominator; + const double denominator = 1.0 / (ters_d + hcth * hcth); + return param->gamma * numerator * denominator * denominator; } // splines parameters // F[Ni=0-1, 1-2, 2-3, // Nj=..., struct TF_corr_param { - double - f_00, - f_01, - f_10, - f_11, - f_x_00, - f_x_01, - f_x_10, - f_x_11, - f_y_00, - f_y_01, - f_y_10, - f_y_11; + double f_00, f_01, f_10, f_11, f_x_00, f_x_01, f_x_10, f_x_11, f_y_00, f_y_01, f_y_10, f_y_11; } F_corr_param[MAXTYPES][MAXTYPES][NSPLINE][NSPLINE]; double F_corr_data[MAXTYPES][MAXTYPES][NSPLINE][NSPLINE][3]; - double F_corr( int, int, double, double, double*, double* ); + double F_corr(int, int, double, double, double *, double *); void SR_neigh(); - double envelop_function(double, double, double*); - + double envelop_function(double, double, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_gauss_cut.h b/src/USER-MISC/pair_gauss_cut.h index ace3eaf4ca..04eaed9a5a 100644 --- a/src/USER-MISC/pair_gauss_cut.h +++ b/src/USER-MISC/pair_gauss_cut.h @@ -50,13 +50,13 @@ class PairGaussCut : public Pair { protected: double cut_global; double **cut; - double **hgauss,**sigmah,**rmh; - double **pgauss,**offset; + double **hgauss, **sigmah, **rmh; + double **pgauss, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.h b/src/USER-MISC/pair_ilp_graphene_hbn.h index 64c72b158d..c86260eb64 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.h +++ b/src/USER-MISC/pair_ilp_graphene_hbn.h @@ -42,21 +42,21 @@ class PairILPGrapheneHBN : public Pair { protected: int me; - int maxlocal; // size of numneigh, firstneigh arrays - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *ILP_numneigh; // # of pair neighbors for each atom - int **ILP_firstneigh; // ptr to 1st neighbor of each atom - int tap_flag; // flag to turn on/off taper function + int maxlocal; // size of numneigh, firstneigh arrays + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *ILP_numneigh; // # of pair neighbors for each atom + int **ILP_firstneigh; // ptr to 1st neighbor of each atom + int tap_flag; // flag to turn on/off taper function struct Param { - double z0,alpha,epsilon,C,delta,d,sR,reff,C6,S; - double delta2inv,seff,lambda,rcut; - int ielement,jelement; + double z0, alpha, epsilon, C, delta, d, sR, reff, C6, S; + double delta2inv, seff, lambda, rcut; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions - int nmax; // max # of atoms + Param *params; // parameter set for I-J interactions + int nmax; // max # of atoms double cut_global; double cut_normal; @@ -67,49 +67,53 @@ class PairILPGrapheneHBN : public Pair { double ***dnormdri; double ****dnormal; - void read_file( char * ); + void read_file(char *); void allocate(); /* ----Calculate the long-range cutoff term */ - inline double calc_Tap(double r_ij, double Rcut) { - double Tap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_Tap(double r_ij, double Rcut) + { + double Tap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {Tap = 0.0;} - else { + r = r_ij / Rcut; + if (r >= 1.0) { + Tap = 0.0; + } else { Tap = Tap_coeff[7] * r + Tap_coeff[6]; - Tap = Tap * r + Tap_coeff[5]; - Tap = Tap * r + Tap_coeff[4]; - Tap = Tap * r + Tap_coeff[3]; - Tap = Tap * r + Tap_coeff[2]; - Tap = Tap * r + Tap_coeff[1]; - Tap = Tap * r + Tap_coeff[0]; + Tap = Tap * r + Tap_coeff[5]; + Tap = Tap * r + Tap_coeff[4]; + Tap = Tap * r + Tap_coeff[3]; + Tap = Tap * r + Tap_coeff[2]; + Tap = Tap * r + Tap_coeff[1]; + Tap = Tap * r + Tap_coeff[0]; } - return(Tap); -} + return (Tap); + } /* ----Calculate the derivatives of long-range cutoff term */ - inline double calc_dTap(double r_ij, double Rcut) { - double dTap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_dTap(double r_ij, double Rcut) + { + double dTap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {dTap = 0.0;} - else { - dTap = 7.0*Tap_coeff[7] * r + 6.0*Tap_coeff[6]; - dTap = dTap * r + 5.0*Tap_coeff[5]; - dTap = dTap * r + 4.0*Tap_coeff[4]; - dTap = dTap * r + 3.0*Tap_coeff[3]; - dTap = dTap * r + 2.0*Tap_coeff[2]; - dTap = dTap * r + Tap_coeff[1]; - dTap = dTap/Rcut; + r = r_ij / Rcut; + if (r >= 1.0) { + dTap = 0.0; + } else { + dTap = 7.0 * Tap_coeff[7] * r + 6.0 * Tap_coeff[6]; + dTap = dTap * r + 5.0 * Tap_coeff[5]; + dTap = dTap * r + 4.0 * Tap_coeff[4]; + dTap = dTap * r + 3.0 * Tap_coeff[3]; + dTap = dTap * r + 2.0 * Tap_coeff[2]; + dTap = dTap * r + Tap_coeff[1]; + dTap = dTap / Rcut; } - return(dTap); + return (dTap); } }; -} +} // namespace LAMMPS_NS #endif #endif @@ -132,4 +136,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.h b/src/USER-MISC/pair_kolmogorov_crespi_full.h index 95efe5ffd2..64a5c06843 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.h +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.h @@ -42,22 +42,21 @@ class PairKolmogorovCrespiFull : public Pair { protected: int me; - int maxlocal; // size of numneigh, firstneigh arrays - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - MyPage *ipage; // neighbor list pages - int *KC_numneigh; // # of pair neighbors for each atom - int **KC_firstneigh; // ptr to 1st neighbor of each atom - int tap_flag; // flag to turn on/off taper function - + int maxlocal; // size of numneigh, firstneigh arrays + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + MyPage *ipage; // neighbor list pages + int *KC_numneigh; // # of pair neighbors for each atom + int **KC_firstneigh; // ptr to 1st neighbor of each atom + int tap_flag; // flag to turn on/off taper function struct Param { - double z0,C0,C2,C4,C,delta,lambda,A,S; - double delta2inv,z06,rcut; - int ielement,jelement; + double z0, C0, C2, C4, C, delta, lambda, A, S; + double delta2inv, z06, rcut; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions - int nmax; // max # of atoms + Param *params; // parameter set for I-J interactions + int nmax; // max # of atoms double cut_global; double cut_normal; @@ -68,52 +67,55 @@ class PairKolmogorovCrespiFull : public Pair { double ***dnormdri; double ****dnormal; - void read_file( char * ); + void read_file(char *); void allocate(); - /* ----Calculate the long-range cutoff term */ - inline double calc_Tap(double r_ij, double Rcut) { - double Tap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_Tap(double r_ij, double Rcut) + { + double Tap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {Tap = 0.0;} - else{ + r = r_ij / Rcut; + if (r >= 1.0) { + Tap = 0.0; + } else { Tap = Tap_coeff[7] * r + Tap_coeff[6]; - Tap = Tap * r + Tap_coeff[5]; - Tap = Tap * r + Tap_coeff[4]; - Tap = Tap * r + Tap_coeff[3]; - Tap = Tap * r + Tap_coeff[2]; - Tap = Tap * r + Tap_coeff[1]; - Tap = Tap * r + Tap_coeff[0]; + Tap = Tap * r + Tap_coeff[5]; + Tap = Tap * r + Tap_coeff[4]; + Tap = Tap * r + Tap_coeff[3]; + Tap = Tap * r + Tap_coeff[2]; + Tap = Tap * r + Tap_coeff[1]; + Tap = Tap * r + Tap_coeff[0]; } - return(Tap); + return (Tap); } /* ----Calculate the derivatives of long-range cutoff term */ - inline double calc_dTap(double r_ij, double Rcut) { - double dTap,r; - double Tap_coeff[8] = {1.0,0.0,0.0,0.0,-35.0,84.0,-70.0,20.0}; + inline double calc_dTap(double r_ij, double Rcut) + { + double dTap, r; + double Tap_coeff[8] = {1.0, 0.0, 0.0, 0.0, -35.0, 84.0, -70.0, 20.0}; - r = r_ij/Rcut; - if (r >= 1.0) {dTap = 0.0;} - else { - dTap = 7.0*Tap_coeff[7] * r + 6.0*Tap_coeff[6]; - dTap = dTap * r + 5.0*Tap_coeff[5]; - dTap = dTap * r + 4.0*Tap_coeff[4]; - dTap = dTap * r + 3.0*Tap_coeff[3]; - dTap = dTap * r + 2.0*Tap_coeff[2]; - dTap = dTap * r + Tap_coeff[1]; - dTap = dTap/Rcut; + r = r_ij / Rcut; + if (r >= 1.0) { + dTap = 0.0; + } else { + dTap = 7.0 * Tap_coeff[7] * r + 6.0 * Tap_coeff[6]; + dTap = dTap * r + 5.0 * Tap_coeff[5]; + dTap = dTap * r + 4.0 * Tap_coeff[4]; + dTap = dTap * r + 3.0 * Tap_coeff[3]; + dTap = dTap * r + 2.0 * Tap_coeff[2]; + dTap = dTap * r + Tap_coeff[1]; + dTap = dTap / Rcut; } - return(dTap); + return (dTap); } }; -} +} // namespace LAMMPS_NS #endif #endif @@ -136,4 +138,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.h b/src/USER-MISC/pair_kolmogorov_crespi_z.h index b3da85456b..0915b56c42 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.h +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.h @@ -38,20 +38,20 @@ class PairKolmogorovCrespiZ : public Pair { int me; struct Param { - double z0,C0,C2,C4,C,delta,lambda,A,S; - double delta2inv,z06; - int ielement,jelement; + double z0, C0, C2, C4, C, delta, lambda, A, S; + double delta2inv, z06; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions + Param *params; // parameter set for I-J interactions double cut_global; double **cut; double **offset; - void read_file( char * ); + void read_file(char *); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif @@ -74,4 +74,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_lebedeva_z.h b/src/USER-MISC/pair_lebedeva_z.h index fb15e39514..1ac0ce62ad 100644 --- a/src/USER-MISC/pair_lebedeva_z.h +++ b/src/USER-MISC/pair_lebedeva_z.h @@ -38,20 +38,20 @@ class PairLebedevaZ : public Pair { int me; struct Param { - double z0,A,B,C,alpha,D1,D2,lambda1,lambda2,S; - double z02,z06; - int ielement,jelement; + double z0, A, B, C, alpha, D1, D2, lambda1, lambda2, S; + double z02, z06; + int ielement, jelement; }; - Param *params; // parameter set for I-J interactions + Param *params; // parameter set for I-J interactions double cut_global; double **cut; double **offset; - void read_file( char * ); + void read_file(char *); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif @@ -74,4 +74,3 @@ All pair coefficients must be set in the data file or by the pair_coeff command before running a simulation. */ - diff --git a/src/USER-MISC/pair_lennard_mdf.h b/src/USER-MISC/pair_lennard_mdf.h index c050258d95..4c9e23acf1 100644 --- a/src/USER-MISC/pair_lennard_mdf.h +++ b/src/USER-MISC/pair_lennard_mdf.h @@ -43,15 +43,15 @@ class PairLennardMDF : public Pair { void *extract(const char *, int &); protected: - double cut_global,cut_inner_global; - double **cut,**cut_inner,**cut_inner_sq; - double **aparm,**bparm; - double **lj1,**lj2,**lj3,**lj4; + double cut_global, cut_inner_global; + double **cut, **cut_inner, **cut_inner_sq; + double **aparm, **bparm; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_list.h b/src/USER-MISC/pair_list.h index b23da7f2f5..e3bf59cce7 100644 --- a/src/USER-MISC/pair_list.h +++ b/src/USER-MISC/pair_list.h @@ -39,12 +39,18 @@ class PairList : public Pair { protected: void allocate(); - enum { NONE=0, HARM, MORSE, LJ126 }; + enum { NONE = 0, HARM, MORSE, LJ126 }; // potential specific parameters - struct harm_p { double k, r0; }; - struct morse_p { double d0, alpha, r0; }; - struct lj126_p { double epsilon, sigma; }; + struct harm_p { + double k, r0; + }; + struct morse_p { + double d0, alpha, r0; + }; + struct lj126_p { + double epsilon, sigma; + }; union parm_u { struct harm_p harm; @@ -53,21 +59,21 @@ class PairList : public Pair { }; typedef struct { - tagint id1,id2; // global atom ids - double cutsq; // cutoff**2 for this pair - double offset; // energy offset - union parm_u parm; // parameters for style + tagint id1, id2; // global atom ids + double cutsq; // cutoff**2 for this pair + double offset; // energy offset + union parm_u parm; // parameters for style } list_parm_t; protected: - double cut_global; // global cutoff distance - int *style; // list of styles for pair interactions - list_parm_t *params; // lisf of pair interaction parameters - int npairs; // # of atom pairs in global list - int check_flag; // 1 if checking for missing pairs + double cut_global; // global cutoff distance + int *style; // list of styles for pair interactions + list_parm_t *params; // lisf of pair interaction parameters + int npairs; // # of atom pairs in global list + int check_flag; // 1 if checking for missing pairs }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_lj_expand_coul_long.h b/src/USER-MISC/pair_lj_expand_coul_long.h index 6d7b6c65e6..52d4c1adfd 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.h +++ b/src/USER-MISC/pair_lj_expand_coul_long.h @@ -49,18 +49,18 @@ class PairLJExpandCoulLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset,**shift; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset, **shift; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_lj_mdf.h b/src/USER-MISC/pair_lj_mdf.h index 1d63e8bf85..e04c44672e 100644 --- a/src/USER-MISC/pair_lj_mdf.h +++ b/src/USER-MISC/pair_lj_mdf.h @@ -43,15 +43,15 @@ class PairLJMDF : public Pair { void *extract(const char *, int &); protected: - double cut_global,cut_inner_global; - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double cut_global, cut_inner_global; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.h b/src/USER-MISC/pair_lj_sf_dipole_sf.h index 6a64fda6f3..2ce4eca4f7 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.h +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.h @@ -41,17 +41,17 @@ class PairLJSFDipoleSF : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; double **scale; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_local_density.h b/src/USER-MISC/pair_local_density.h index 8689f3c724..2998949ce9 100644 --- a/src/USER-MISC/pair_local_density.h +++ b/src/USER-MISC/pair_local_density.h @@ -15,7 +15,6 @@ David Rosenberger: TU Darmstadt -------------------------------------------------------------------------*/ - #ifdef PAIR_CLASS // clang-format off PairStyle(local/density,PairLocalDensity); @@ -27,62 +26,60 @@ PairStyle(local/density,PairLocalDensity); #include "pair.h" - namespace LAMMPS_NS { class PairLocalDensity : public Pair { - public: - PairLocalDensity(class LAMMPS *); - virtual ~PairLocalDensity(); - virtual void compute(int, int); - void settings(int, char **); - virtual void coeff(int, char **); - void init_style(); - double init_one(int, int); - double single(int, int, int, int, double, double, double, double &); + public: + PairLocalDensity(class LAMMPS *); + virtual ~PairLocalDensity(); + virtual void compute(int, int); + void settings(int, char **); + virtual void coeff(int, char **); + void init_style(); + double init_one(int, int); + double single(int, int, int, int, double, double, double, double &); - virtual int pack_comm(int, int *, double *, int, int *); - virtual void unpack_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + virtual int pack_comm(int, int *, double *, int, int *); + virtual void unpack_comm(int, int, double *); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); + double memory_usage(); + protected: + //------------------------------------------------------------------------ + //This information is read from the tabulated input file - protected: - //------------------------------------------------------------------------ - //This information is read from the tabulated input file + int nLD, nrho; // number of LD types + int **a, **b; // central and neigh atom filters + double *uppercut, *lowercut; // upper and lower cutoffs + double *uppercutsq, *lowercutsq; // square of above cutoffs + double *c0, *c2, *c4, *c6; // coeffs for indicator function + double *rho_min, *rho_max, *delta_rho; // min, max & grid-size for LDs + double **rho, **frho; // LD and LD function tables - int nLD, nrho; // number of LD types - int **a, **b; // central and neigh atom filters - double *uppercut, *lowercut; // upper and lower cutoffs - double *uppercutsq, *lowercutsq; // square of above cutoffs - double *c0, *c2, *c4, *c6; // coeffs for indicator function - double *rho_min, *rho_max, *delta_rho; // min, max & grid-size for LDs - double **rho, **frho; // LD and LD function tables + //------------------------------------------------------------------------ - //------------------------------------------------------------------------ + double ***frho_spline; // splined LD potentials + double cutmax; // max cutoff for all elements + double cutforcesq; // square of global upper cutoff - double ***frho_spline; // splined LD potentials - double cutmax; // max cutoff for all elements - double cutforcesq; // square of global upper cutoff + int nmax; // max size of per-atom arrays + double **localrho; // per-atom LD + double **fp; // per-atom LD potential function derivative - int nmax; // max size of per-atom arrays - double **localrho; // per-atom LD - double **fp; // per-atom LD potential function derivative + void allocate(); - void allocate(); + // read tabulated input file + void parse_file(char *); - // read tabulated input file - void parse_file(char *); + // convert array to spline + void array2spline(); - // convert array to spline - void array2spline(); - - // cubic spline interpolation - void interpolate_cbspl(int, double, double *, double **); + // cubic spline interpolation + void interpolate_cbspl(int, double, double *, double **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_meam_spline.h b/src/USER-MISC/pair_meam_spline.h index e8d43711a3..3f9fdd990e 100644 --- a/src/USER-MISC/pair_meam_spline.h +++ b/src/USER-MISC/pair_meam_spline.h @@ -37,28 +37,27 @@ namespace LAMMPS_NS { #define SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES 0 -class PairMEAMSpline : public Pair -{ -public: +class PairMEAMSpline : public Pair { + public: PairMEAMSpline(class LAMMPS *); virtual ~PairMEAMSpline(); virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); void get_coeff(double *, double *); - double pair_density(int ); - double three_body_density(int ); + double pair_density(int); + double three_body_density(int); void init_style(); void init_list(int, class NeighList *); double init_one(int, int); // helper functions for compute() - int ij_to_potl(const int itype, const int jtype, const int ntypes) const { - return jtype - 1 + (itype-1)*ntypes - (itype-1)*itype/2; + int ij_to_potl(const int itype, const int jtype, const int ntypes) const + { + return jtype - 1 + (itype - 1) * ntypes - (itype - 1) * itype / 2; } - int i_to_potl(const int itype) const { return itype-1; } - + int i_to_potl(const int itype) const { return itype - 1; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); @@ -66,14 +65,15 @@ public: void unpack_reverse_comm(int, int *, double *); double memory_usage(); -protected: + protected: class SplineFunction { - public: + public: /// Default constructor. SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. - ~SplineFunction() { + ~SplineFunction() + { delete[] X; delete[] Xs; delete[] Y; @@ -82,7 +82,8 @@ protected: } /// Initialization of spline function. - void init(int _N, double _deriv0, double _derivN) { + void init(int _N, double _deriv0, double _derivN) + { N = _N; deriv0 = _deriv0; derivN = _derivN; @@ -99,97 +100,98 @@ protected: } /// Adds a knot to the spline. - void setKnot(int n, double x, double y) { X[n] = x; Y[n] = y; } + void setKnot(int n, double x, double y) + { + X[n] = x; + Y[n] = y; + } /// Returns the number of knots. int numKnots() const { return N; } /// Parses the spline knots from a text file. - void parse(FILE* fp, Error* error, bool isNewFormat); + void parse(FILE *fp, Error *error, bool isNewFormat); /// Calculates the second derivatives of the cubic spline. - void prepareSpline(Error* error); + void prepareSpline(Error *error); /// Evaluates the spline function at position x. inline double eval(double x) const { x -= xmin; - if (x <= 0.0) { // Left extrapolation. + if (x <= 0.0) { // Left extrapolation. return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + } else if (x >= xmax_shifted) { // Right extrapolation. + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES // Do interval search. int klo = 0; - int khi = N-1; - while(khi - klo > 1) { + int khi = N - 1; + while (khi - klo > 1) { int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; + if (Xs[k] > x) + khi = k; + else + klo = k; } double h = Xs[khi] - Xs[klo]; // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h return a * Y[klo] + b * Y[khi] + - ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi])*(h*h)/6.0; + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else // For a spline with regular grid, we directly calculate the interval X is in. - int klo = (int)(x*inv_h); + int klo = (int) (x * inv_h); int khi = klo + 1; double a = Xs[khi] - x; double b = h - a; return Y[khi] - a * Ydelta[klo] + - ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif } } /// Evaluates the spline function and its first derivative at position x. - inline double eval(double x, double& deriv) const + inline double eval(double x, double &deriv) const { x -= xmin; - if (x <= 0.0) { // Left extrapolation. + if (x <= 0.0) { // Left extrapolation. deriv = deriv0; return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. + } else if (x >= xmax_shifted) { // Right extrapolation. deriv = derivN; - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES // Do interval search. int klo = 0; - int khi = N-1; - while(khi - klo > 1) { + int khi = N - 1; + while (khi - klo > 1) { int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; + if (Xs[k] > x) + khi = k; + else + klo = k; } double h = Xs[khi] - Xs[klo]; // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h deriv = (Y[khi] - Y[klo]) / h + - ((3.0*b*b - 1.0) * Y2[khi] - - (3.0*a*a - 1.0) * Y2[klo]) * h / 6.0; + ((3.0 * b * b - 1.0) * Y2[khi] - (3.0 * a * a - 1.0) * Y2[klo]) * h / 6.0; return a * Y[klo] + b * Y[khi] + - ((a*a*a - a) * Y2[klo] + - (b*b*b - b) * Y2[khi]) * (h*h) / 6.0; + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else // For a spline with regular grid, we directly calculate the interval X is in. - int klo = (int)(x*inv_h); + int klo = (int) (x * inv_h); int khi = klo + 1; double a = Xs[khi] - x; double b = h - a; - deriv = Ydelta[klo] + ((3.0*b*b - hsq) * Y2[khi] - - (3.0*a*a - hsq) * Y2[klo]); + deriv = Ydelta[klo] + ((3.0 * b * b - hsq) * Y2[khi] - (3.0 * a * a - hsq) * Y2[klo]); return Y[khi] - a * Ydelta[klo] + - ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif } } @@ -198,60 +200,63 @@ protected: double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } /// Returns the cutoff radius of this function. - double cutoff() const { return X[N-1]; } + double cutoff() const { return X[N - 1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = nullptr) const; + void writeGnuplot(const char *filename, const char *title = nullptr) const; /// Broadcasts the spline function parameters to all processors. - void communicate(MPI_Comm& world, int me); + void communicate(MPI_Comm &world, int me); - private: - double* X; // Positions of spline knots - double* Xs; // Shifted positions of spline knots - double* Y; // Function values at spline knots - double* Y2; // Second derivatives at spline knots - double* Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h - int N; // Number of spline knots - double deriv0; // First derivative at knot 0 - double derivN; // First derivative at knot (N-1) - double xmin; // The beginning of the interval on which the spline function is defined. - double xmax; // The end of the interval on which the spline function is defined. - int isGridSpline;// Indicates that all spline knots are on a regular grid. - double h; // The distance between knots if this is a grid spline with equidistant knots. - double hsq; // The squared distance between knots if this is a grid spline with equidistant knots. - double inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. - double xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. + private: + double *X; // Positions of spline knots + double *Xs; // Shifted positions of spline knots + double *Y; // Function values at spline knots + double *Y2; // Second derivatives at spline knots + double *Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h + int N; // Number of spline knots + double deriv0; // First derivative at knot 0 + double derivN; // First derivative at knot (N-1) + double xmin; // The beginning of the interval on which the spline function is defined. + double xmax; // The end of the interval on which the spline function is defined. + int isGridSpline; // Indicates that all spline knots are on a regular grid. + double h; // The distance between knots if this is a grid spline with equidistant knots. + double + hsq; // The squared distance between knots if this is a grid spline with equidistant knots. + double + inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. + double + xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. }; /// Helper data structure for potential routine. struct MEAM2Body { - int tag; // holds the index of the second atom (j) + int tag; // holds the index of the second atom (j) double r; double f, fprime; double del[3]; }; - SplineFunction* phis; // Phi_i(r_ij) - SplineFunction* rhos; // Rho_ij(r_ij) - SplineFunction* fs; // f_i(r_ij) - SplineFunction* Us; // U_i(rho) - SplineFunction* gs; // g_ij(cos_theta) - double* zero_atom_energies; // Shift embedding energy by this value to make it zero for a single atom in vacuum. + SplineFunction *phis; // Phi_i(r_ij) + SplineFunction *rhos; // Rho_ij(r_ij) + SplineFunction *fs; // f_i(r_ij) + SplineFunction *Us; // U_i(rho) + SplineFunction *gs; // g_ij(cos_theta) + double * + zero_atom_energies; // Shift embedding energy by this value to make it zero for a single atom in vacuum. - double cutoff; // The cutoff radius + double cutoff; // The cutoff radius - double* Uprime_values; // Used for temporary storage of U'(rho) values - int nmax; // Size of temporary array. - int maxNeighbors; // The last maximum number of neighbors a single atoms has. - MEAM2Body* twoBodyInfo; // Temporary array. + double *Uprime_values; // Used for temporary storage of U'(rho) values + int nmax; // Size of temporary array. + int maxNeighbors; // The last maximum number of neighbors a single atoms has. + MEAM2Body *twoBodyInfo; // Temporary array. - void read_file(const char* filename); + void read_file(const char *filename); void allocate(); - }; -} +} // namespace LAMMPS_NS #endif #endif @@ -297,5 +302,3 @@ protected: * * See file 'pair_spline_meam.cpp' for history of changes. ------------------------------------------------------------------------- */ - - diff --git a/src/USER-MISC/pair_meam_sw_spline.h b/src/USER-MISC/pair_meam_sw_spline.h index 07736f74e1..08ac4372b8 100644 --- a/src/USER-MISC/pair_meam_sw_spline.h +++ b/src/USER-MISC/pair_meam_sw_spline.h @@ -35,209 +35,221 @@ namespace LAMMPS_NS { #define SPLINE_MEAMSW_SUPPORT_NON_GRID_SPLINES 0 -class PairMEAMSWSpline : public Pair -{ -public: - PairMEAMSWSpline(class LAMMPS *); - virtual ~PairMEAMSWSpline(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - void init_style(); - void init_list(int, class NeighList *); - double init_one(int, int); +class PairMEAMSWSpline : public Pair { + public: + PairMEAMSWSpline(class LAMMPS *); + virtual ~PairMEAMSWSpline(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + void init_style(); + void init_list(int, class NeighList *); + double init_one(int, int); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - int pack_reverse_comm(int, int, double *); - void unpack_reverse_comm(int, int *, double *); - double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); + double memory_usage(); -protected: + protected: + class SplineFunction { + public: + /// Default constructor. + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} - class SplineFunction { - public: + /// Destructor. + ~SplineFunction() + { + delete[] X; + delete[] Xs; + delete[] Y; + delete[] Y2; + delete[] Ydelta; + } - /// Default constructor. - SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} + /// Initialization of spline function. + void init(int _n, double _deriv0, double _derivN) + { + N = _n; + deriv0 = _deriv0; + derivN = _derivN; + delete[] X; + delete[] Xs; + delete[] Y; + delete[] Y2; + delete[] Ydelta; + X = new double[N]; + Xs = new double[N]; + Y = new double[N]; + Y2 = new double[N]; + Ydelta = new double[N]; + } - /// Destructor. - ~SplineFunction() { - delete[] X; - delete[] Xs; - delete[] Y; - delete[] Y2; - delete[] Ydelta; - } + /// Adds a knot to the spline. + void setKnot(int n, double x, double y) + { + X[n] = x; + Y[n] = y; + } - /// Initialization of spline function. - void init(int _n, double _deriv0, double _derivN) { - N = _n; - deriv0 = _deriv0; - derivN = _derivN; - delete[] X; - delete[] Xs; - delete[] Y; - delete[] Y2; - delete[] Ydelta; - X = new double[N]; - Xs = new double[N]; - Y = new double[N]; - Y2 = new double[N]; - Ydelta = new double[N]; - } + /// Returns the number of knots. + int numKnots() const { return N; } - /// Adds a knot to the spline. - void setKnot(int n, double x, double y) { X[n] = x; Y[n] = y; } + /// Parses the spline knots from a text file. + void parse(FILE *fp, Error *error); - /// Returns the number of knots. - int numKnots() const { return N; } + /// Calculates the second derivatives of the cubic spline. + void prepareSpline(Error *error); - /// Parses the spline knots from a text file. - void parse(FILE* fp, Error* error); - - /// Calculates the second derivatives of the cubic spline. - void prepareSpline(Error* error); - - /// Evaluates the spline function at position x. - inline double eval(double x) const - { - x -= xmin; - if (x <= 0.0) { // Left extrapolation. - return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + /// Evaluates the spline function at position x. + inline double eval(double x) const + { + x -= xmin; + if (x <= 0.0) { // Left extrapolation. + return Y[0] + deriv0 * x; + } else if (x >= xmax_shifted) { // Right extrapolation. + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAMSW_SUPPORT_NON_GRID_SPLINES - // Do interval search. - int klo = 0; - int khi = N-1; - while(khi - klo > 1) { - int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; - } - double h = Xs[khi] - Xs[klo]; - // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h - return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi])*(h*h)/6.0; + // Do interval search. + int klo = 0; + int khi = N - 1; + while (khi - klo > 1) { + int k = (khi + klo) / 2; + if (Xs[k] > x) + khi = k; + else + klo = k; + } + double h = Xs[khi] - Xs[klo]; + // Do spline interpolation. + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h + return a * Y[klo] + b * Y[khi] + + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else - // For a spline with grid points, we can directly calculate the interval X is in. - // - int klo = (int)(x*inv_h); - if ( klo > N - 2 ) klo = N - 2; - int khi = klo + 1; - double a = Xs[khi] - x; - double b = h - a; - return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + // For a spline with grid points, we can directly calculate the interval X is in. + // + int klo = (int) (x * inv_h); + if (klo > N - 2) klo = N - 2; + int khi = klo + 1; + double a = Xs[khi] - x; + double b = h - a; + return Y[khi] - a * Ydelta[klo] + + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif - } - } + } + } - /// Evaluates the spline function and its first derivative at position x. - inline double eval(double x, double& deriv) const - { - x -= xmin; - if (x <= 0.0) { // Left extrapolation. - deriv = deriv0; - return Y[0] + deriv0 * x; - } - else if (x >= xmax_shifted) { // Right extrapolation. - deriv = derivN; - return Y[N-1] + derivN * (x - xmax_shifted); - } - else { + /// Evaluates the spline function and its first derivative at position x. + inline double eval(double x, double &deriv) const + { + x -= xmin; + if (x <= 0.0) { // Left extrapolation. + deriv = deriv0; + return Y[0] + deriv0 * x; + } else if (x >= xmax_shifted) { // Right extrapolation. + deriv = derivN; + return Y[N - 1] + derivN * (x - xmax_shifted); + } else { #if SPLINE_MEAMSW_SUPPORT_NON_GRID_SPLINES - // Do interval search. - int klo = 0; - int khi = N-1; - while(khi - klo > 1) { - int k = (khi + klo) / 2; - if (Xs[k] > x) khi = k; - else klo = k; - } - double h = Xs[khi] - Xs[klo]; - // Do spline interpolation. - double a = (Xs[khi] - x)/h; - double b = 1.0 - a; // = (x - X[klo])/h - deriv = (Y[khi] - Y[klo]) / h + ((3.0*b*b - 1.0) * Y2[khi] - (3.0*a*a - 1.0) * Y2[klo]) * h / 6.0; - return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi]) * (h*h) / 6.0; + // Do interval search. + int klo = 0; + int khi = N - 1; + while (khi - klo > 1) { + int k = (khi + klo) / 2; + if (Xs[k] > x) + khi = k; + else + klo = k; + } + double h = Xs[khi] - Xs[klo]; + // Do spline interpolation. + double a = (Xs[khi] - x) / h; + double b = 1.0 - a; // = (x - X[klo])/h + deriv = (Y[khi] - Y[klo]) / h + + ((3.0 * b * b - 1.0) * Y2[khi] - (3.0 * a * a - 1.0) * Y2[klo]) * h / 6.0; + return a * Y[klo] + b * Y[khi] + + ((a * a * a - a) * Y2[klo] + (b * b * b - b) * Y2[khi]) * (h * h) / 6.0; #else - // For a spline with grid points, we can directly calculate the interval X is in. - int klo = (int)(x*inv_h); - if ( klo > N - 2 ) klo = N - 2; - int khi = klo + 1; - double a = Xs[khi] - x; - double b = h - a; - deriv = Ydelta[klo] + ((3.0*b*b - hsq) * Y2[khi] - (3.0*a*a - hsq) * Y2[klo]); - return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]); + // For a spline with grid points, we can directly calculate the interval X is in. + int klo = (int) (x * inv_h); + if (klo > N - 2) klo = N - 2; + int khi = klo + 1; + double a = Xs[khi] - x; + double b = h - a; + deriv = Ydelta[klo] + ((3.0 * b * b - hsq) * Y2[khi] - (3.0 * a * a - hsq) * Y2[klo]); + return Y[khi] - a * Ydelta[klo] + + ((a * a - hsq) * a * Y2[klo] + (b * b - hsq) * b * Y2[khi]); #endif - } - } + } + } - /// Returns the number of bytes used by this function object. - double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } + /// Returns the number of bytes used by this function object. + double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; } - /// Returns the cutoff radius of this function. - double cutoff() const { return X[N-1]; } + /// Returns the cutoff radius of this function. + double cutoff() const { return X[N - 1]; } - /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = nullptr) const; + /// Writes a Gnuplot script that plots the spline function. + void writeGnuplot(const char *filename, const char *title = nullptr) const; - /// Broadcasts the spline function parameters to all processors. - void communicate(MPI_Comm& world, int me); + /// Broadcasts the spline function parameters to all processors. + void communicate(MPI_Comm &world, int me); - private: - double* X; // Positions of spline knots - double* Xs; // Shifted positions of spline knots - double* Y; // Function values at spline knots - double* Y2; // Second derivatives at spline knots - double* Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h - int N; // Number of spline knots - double deriv0; // First derivative at knot 0 - double derivN; // First derivative at knot (N-1) - double xmin; // The beginning of the interval on which the spline function is defined. - double xmax; // The end of the interval on which the spline function is defined. - int isGridSpline; // Indicates that all spline knots are on a regular grid. - double h; // The distance between knots if this is a grid spline with equidistant knots. - double hsq; // The squared distance between knots if this is a grid spline with equidistant knots. - double inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. - double xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. - }; + private: + double *X; // Positions of spline knots + double *Xs; // Shifted positions of spline knots + double *Y; // Function values at spline knots + double *Y2; // Second derivatives at spline knots + double *Ydelta; // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h + int N; // Number of spline knots + double deriv0; // First derivative at knot 0 + double derivN; // First derivative at knot (N-1) + double xmin; // The beginning of the interval on which the spline function is defined. + double xmax; // The end of the interval on which the spline function is defined. + int isGridSpline; // Indicates that all spline knots are on a regular grid. + double h; // The distance between knots if this is a grid spline with equidistant knots. + double + hsq; // The squared distance between knots if this is a grid spline with equidistant knots. + double + inv_h; // (1/h), used to avoid numerical errors in binnning for grid spline with equidistant knots. + double + xmax_shifted; // The end of the spline interval after it has been shifted to begin at X=0. + }; - /// Helper data structure for potential routine. - struct MEAM2Body { - int tag; - double r; - double f, fprime; - double F, Fprime; - double del[3]; - }; + /// Helper data structure for potential routine. + struct MEAM2Body { + int tag; + double r; + double f, fprime; + double F, Fprime; + double del[3]; + }; - SplineFunction phi; // Phi(r_ij) - SplineFunction rho; // Rho(r_ij) - SplineFunction f; // f(r_ij) - SplineFunction U; // U(rho) - SplineFunction g; // g(cos_theta) - SplineFunction F; // F(r_ij) - SplineFunction G; // G(cos_theta) - double zero_atom_energy; // Shift embedding energy by this value to make it zero for a single atom in vacuum. + SplineFunction phi; // Phi(r_ij) + SplineFunction rho; // Rho(r_ij) + SplineFunction f; // f(r_ij) + SplineFunction U; // U(rho) + SplineFunction g; // g(cos_theta) + SplineFunction F; // F(r_ij) + SplineFunction G; // G(cos_theta) + double + zero_atom_energy; // Shift embedding energy by this value to make it zero for a single atom in vacuum. - double cutoff; // The cutoff radius + double cutoff; // The cutoff radius - double* Uprime_values; // Used for temporary storage of U'(rho) values - int nmax; // Size of temporary array. - int maxNeighbors; // The last maximum number of neighbors a single atoms has. - MEAM2Body* twoBodyInfo; // Temporary array. + double *Uprime_values; // Used for temporary storage of U'(rho) values + int nmax; // Size of temporary array. + int maxNeighbors; // The last maximum number of neighbors a single atoms has. + MEAM2Body *twoBodyInfo; // Temporary array. - void read_file(const char* filename); - void allocate(); + void read_file(const char *filename); + void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_momb.h b/src/USER-MISC/pair_momb.h index 7e94a0ceef..7dd1e02276 100644 --- a/src/USER-MISC/pair_momb.h +++ b/src/USER-MISC/pair_momb.h @@ -44,15 +44,15 @@ class PairMomb : public Pair { protected: double cut_global; double **cut; - double sscale,dscale; - double **d0,**alpha,**r0,**c,**rr; + double sscale, dscale; + double **d0, **alpha, **r0, **c, **rr; double **morse1; double **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_morse_smooth_linear.h b/src/USER-MISC/pair_morse_smooth_linear.h index ab371ed077..ea33a520cf 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.h +++ b/src/USER-MISC/pair_morse_smooth_linear.h @@ -47,7 +47,7 @@ class PairMorseSmoothLinear : public Pair { protected: double cut_global; double **cut; - double **d0,**alpha,**r0; + double **d0, **alpha, **r0; double **morse1; double **der_at_cutoff; double **offset; @@ -55,7 +55,7 @@ class PairMorseSmoothLinear : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_srp.h b/src/USER-MISC/pair_srp.h index 77de81adcb..7dccebdcf0 100644 --- a/src/USER-MISC/pair_srp.h +++ b/src/USER-MISC/pair_srp.h @@ -41,11 +41,11 @@ class PairSRP : public Pair { virtual void read_restart_settings(FILE *); private: - inline void onetwoexclude(int* &, int &, int* &, int* &, int** &); + inline void onetwoexclude(int *&, int &, int *&, int *&, int **&); inline void remapBonds(int &); void allocate(); - void getMinDist(double** &, double &, double &, double &, double &, - double &, int &, int &, int &, int &); + void getMinDist(double **&, double &, double &, double &, double &, double &, int &, int &, int &, + int &); bool min, midpoint; double **cut; double **a0; @@ -55,11 +55,11 @@ class PairSRP : public Pair { int btype; class Fix *f_srp; char *fix_id; - int exclude,maxcount; + int exclude, maxcount; int **segment; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_tersoff_table.h b/src/USER-MISC/pair_tersoff_table.h index e130c6fe0b..9fb0ec713a 100644 --- a/src/USER-MISC/pair_tersoff_table.h +++ b/src/USER-MISC/pair_tersoff_table.h @@ -47,19 +47,18 @@ class PairTersoffTable : public Pair { protected: struct Param { - double lam1,lam2,lam3; - double c,d,h; - double gamma,powerm; - double powern,beta; - double biga,bigb,cutoffR, cutoffS; - double cut,cutsq; - int ielement,jelement,kelement; + double lam1, lam2, lam3; + double c, d, h; + double gamma, powerm; + double powern, beta; + double biga, bigb, cutoffR, cutoffS; + double cut, cutsq; + int ielement, jelement, kelement; int powermint; }; - - double cutmax; // max cutoff for all elements - Param *params; // parameter set for an I-J-K interaction + double cutmax; // max cutoff for all elements + Param *params; // parameter set for an I-J-K interaction void allocate(); @@ -84,7 +83,7 @@ class PairTersoffTable : public Pair { void deallocateGrids(void); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/pair_wf_cut.h b/src/USER-MISC/pair_wf_cut.h index 7bff492b6b..c480e1b9bc 100644 --- a/src/USER-MISC/pair_wf_cut.h +++ b/src/USER-MISC/pair_wf_cut.h @@ -43,16 +43,16 @@ class PairWFCut : public Pair { void *extract(const char *, int &); protected: - int **nu,**mu; + int **nu, **mu; double cut_global; double **cut; - double **epsilon,**sigma; - double **nm,**e0nm,**rcmu,**sigma_mu,**offset; + double **epsilon, **sigma; + double **nm, **e0nm, **rcmu, **sigma_mu, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/temper_grem.h b/src/USER-MISC/temper_grem.h index 77a8ea6eda..6e49480e03 100644 --- a/src/USER-MISC/temper_grem.h +++ b/src/USER-MISC/temper_grem.h @@ -31,34 +31,34 @@ class TemperGrem : public Command { void command(int, char **); private: - int me,me_universe; // my proc ID in world and universe - int iworld,nworlds; // world info - double boltz; // copy from output->boltz - MPI_Comm roots; // MPI comm with 1 root proc from each world - class RanPark *ranswap,*ranboltz; // RNGs for swapping and Boltz factor - int nevery; // # of timesteps between swaps - int nswaps; // # of tempering swaps to perform - int seed_swap; // 0 = toggle swaps, n = RNG for swap direction - int seed_boltz; // seed for Boltz factor comparison - int whichfix; // index of temperature fix to use - int fixstyle; // what kind of temperature fix is used + int me, me_universe; // my proc ID in world and universe + int iworld, nworlds; // world info + double boltz; // copy from output->boltz + MPI_Comm roots; // MPI comm with 1 root proc from each world + class RanPark *ranswap, *ranboltz; // RNGs for swapping and Boltz factor + int nevery; // # of timesteps between swaps + int nswaps; // # of tempering swaps to perform + int seed_swap; // 0 = toggle swaps, n = RNG for swap direction + int seed_boltz; // seed for Boltz factor comparison + int whichfix; // index of temperature fix to use + int fixstyle; // what kind of temperature fix is used - int my_set_lambda; // which set lambda I am simulating - double *set_lambda; // static list of replica set lambdas - int *lambda2world; // lambda2world[i] = world simulating set lambda i - int *world2lambda; // world2lambda[i] = lambda simulated by world i - int *world2root; // world2root[i] = root proc of world i + int my_set_lambda; // which set lambda I am simulating + double *set_lambda; // static list of replica set lambdas + int *lambda2world; // lambda2world[i] = world simulating set lambda i + int *world2lambda; // world2lambda[i] = lambda simulated by world i + int *world2root; // world2root[i] = root proc of world i void print_status(); - class FixGrem * fix_grem; + class FixGrem *fix_grem; protected: char *id_nh; int pressflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MISC/temper_npt.h b/src/USER-MISC/temper_npt.h index a138439b0c..e00d9de7d1 100644 --- a/src/USER-MISC/temper_npt.h +++ b/src/USER-MISC/temper_npt.h @@ -32,30 +32,30 @@ class TemperNPT : public Command { void command(int, char **); private: - int me,me_universe; // my proc ID in world and universe - int iworld,nworlds; // world info - double boltz; // copy from output->boltz + int me, me_universe; // my proc ID in world and universe + int iworld, nworlds; // world info + double boltz; // copy from output->boltz double nktv2p; - MPI_Comm roots; // MPI comm with 1 root proc from each world - class RanPark *ranswap,*ranboltz; // RNGs for swapping and Boltz factor - int nevery; // # of timesteps between swaps - int nswaps; // # of tempering swaps to perform - int seed_swap; // 0 = toggle swaps, n = RNG for swap direction - int seed_boltz; // seed for Boltz factor comparison - int whichfix; // index of temperature fix to use - int fixstyle; // what kind of temperature fix is used + MPI_Comm roots; // MPI comm with 1 root proc from each world + class RanPark *ranswap, *ranboltz; // RNGs for swapping and Boltz factor + int nevery; // # of timesteps between swaps + int nswaps; // # of tempering swaps to perform + int seed_swap; // 0 = toggle swaps, n = RNG for swap direction + int seed_boltz; // seed for Boltz factor comparison + int whichfix; // index of temperature fix to use + int fixstyle; // what kind of temperature fix is used - int my_set_temp; // which set temp I am simulating - double *set_temp; // static list of replica set temperatures - int *temp2world; // temp2world[i] = world simulating set temp i - int *world2temp; // world2temp[i] = temp simulated by world i - int *world2root; // world2root[i] = root proc of world i + int my_set_temp; // which set temp I am simulating + double *set_temp; // static list of replica set temperatures + int *temp2world; // temp2world[i] = world simulating set temp i + int *world2temp; // world2temp[i] = temp simulated by world i + int *world2root; // world2root[i] = root proc of world i void scale_velocities(int, int); void print_status(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/angle_class2_p6.h b/src/USER-MOFFF/angle_class2_p6.h index d413305942..6e51905f87 100644 --- a/src/USER-MOFFF/angle_class2_p6.h +++ b/src/USER-MOFFF/angle_class2_p6.h @@ -37,15 +37,15 @@ class AngleClass2P6 : public Angle { double single(int, int, int, int); protected: - double *theta0,*k2,*k3,*k4,*k5,*k6; - double *bb_k,*bb_r1,*bb_r2; - double *ba_k1,*ba_k2,*ba_r1,*ba_r2; - int *setflag_a,*setflag_bb,*setflag_ba; + double *theta0, *k2, *k3, *k4, *k5, *k6; + double *bb_k, *bb_r1, *bb_r2; + double *ba_k1, *ba_k2, *ba_r1, *ba_r2; + int *setflag_a, *setflag_bb, *setflag_ba; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/angle_cosine_buck6d.h b/src/USER-MOFFF/angle_cosine_buck6d.h index 4685240709..7b09cfaf5a 100644 --- a/src/USER-MOFFF/angle_cosine_buck6d.h +++ b/src/USER-MOFFF/angle_cosine_buck6d.h @@ -38,16 +38,16 @@ class AngleCosineBuck6d : public Angle { double single(int, int, int, int); protected: - double *k,*th0; - double *eps,*d0; - double **buck6d1,**buck6d2,**buck6d3,**buck6d4,**cut_ljsq; - double **c0,**c1,**c2,**c3,**c4,**c5,**rsmooth_sq,**offset; + double *k, *th0; + double *eps, *d0; + double **buck6d1, **buck6d2, **buck6d3, **buck6d4, **cut_ljsq; + double **c0, **c1, **c2, **c3, **c4, **c5, **rsmooth_sq, **offset; int *multiplicity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/improper_inversion_harmonic.h b/src/USER-MOFFF/improper_inversion_harmonic.h index f0544ccaca..86b5b9a59c 100644 --- a/src/USER-MOFFF/improper_inversion_harmonic.h +++ b/src/USER-MOFFF/improper_inversion_harmonic.h @@ -36,18 +36,16 @@ class ImproperInversionHarmonic : public Improper { protected: double *kw, *w0; - void invang(const int &i1,const int &i2,const int &i3,const int &i4, - const int &type,const int &evflag,const int &eflag, - const double &vb1x, const double &vb1y, const double &vb1z, - const double &rrvb1, const double &rr2vb1, - const double &vb2x, const double &vb2y, const double &vb2z, - const double &rrvb2, const double &rr2vb2, - const double &vb3x, const double &vb3y, const double &vb3z, - const double &rrvb3, const double &rr2vb3); + void invang(const int &i1, const int &i2, const int &i3, const int &i4, const int &type, + const int &evflag, const int &eflag, const double &vb1x, const double &vb1y, + const double &vb1z, const double &rrvb1, const double &rr2vb1, const double &vb2x, + const double &vb2y, const double &vb2z, const double &rrvb2, const double &rr2vb2, + const double &vb3x, const double &vb3y, const double &vb3z, const double &rrvb3, + const double &rr2vb3); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h index 4222882a4e..251158a480 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.h @@ -44,18 +44,18 @@ class PairBuck6dCoulGaussDSF : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; + double **cut_lj, **cut_ljsq; double **alpha_ij; - double **buck6d1,**buck6d2,**buck6d3,**buck6d4,**offset; - double **f_shift_ij,**e_shift_ij; - double cut_coul,cut_coulsq; + double **buck6d1, **buck6d2, **buck6d3, **buck6d4, **offset; + double **f_shift_ij, **e_shift_ij; + double cut_coul, cut_coulsq; double vdwl_smooth; - double **c0,**c1,**c2,**c3,**c4,**c5,**rsmooth_sq; + double **c0, **c1, **c2, **c3, **c4, **c5, **rsmooth_sq; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h index 87f0241108..93fb232af0 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.h @@ -44,19 +44,19 @@ class PairBuck6dCoulGaussLong : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; + double **cut_lj, **cut_ljsq; double **alpha_ij; - double **buck6d1,**buck6d2,**buck6d3,**buck6d4,**offset; + double **buck6d1, **buck6d2, **buck6d3, **buck6d4, **offset; double cut_coul, cut_coulsq; double vdwl_smooth, coul_smooth; - double c0_c,c1_c,c2_c,c3_c,c4_c,c5_c,rsmooth_sq_c; - double **c0,**c1,**c2,**c3,**c4,**c5,**rsmooth_sq; + double c0_c, c1_c, c2_c, c3_c, c4_c, c5_c, rsmooth_sq_c; + double **c0, **c1, **c2, **c3, **c4, **c5, **rsmooth_sq; double g_ewald; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOLFILE/dump_molfile.h b/src/USER-MOLFILE/dump_molfile.h index 220b334f25..ad09e96286 100644 --- a/src/USER-MOLFILE/dump_molfile.h +++ b/src/USER-MOLFILE/dump_molfile.h @@ -28,34 +28,34 @@ namespace LAMMPS_NS { class DumpMolfile : public Dump { public: - DumpMolfile(LAMMPS *, int, char**); + DumpMolfile(LAMMPS *, int, char **); virtual ~DumpMolfile(); virtual void write(); protected: - class MolfileInterface *mf; //< handles low-level I/O + class MolfileInterface *mf; //< handles low-level I/O // per-atom data float *coords, *vels, *masses, *charges, *radiuses; - int *types, *molids; + int *types, *molids; char **typenames; - int natoms,me,ntotal,ntypes; + int natoms, me, ntotal, ntypes; int need_structure; - int unwrap_flag; // 1 if writing unwrapped atom coords, 0 if not - int velocity_flag; // 1 if writing velocities, 0 if not - int topology_flag; // 1 if writing topology data, 0 if not - float cell[6]; // cell parameters: A, B, C, alpha, beta, gamma + int unwrap_flag; // 1 if writing unwrapped atom coords, 0 if not + int velocity_flag; // 1 if writing velocities, 0 if not + int topology_flag; // 1 if writing topology data, 0 if not + float cell[6]; // cell parameters: A, B, C, alpha, beta, gamma virtual void init_style(); virtual int modify_param(int, char **); - virtual void write_header(bigint) {}; + virtual void write_header(bigint){}; virtual void pack(tagint *); virtual void write_data(int, double *); virtual double memory_usage(); virtual void openfile(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-MOLFILE/molfile_interface.h b/src/USER-MOLFILE/molfile_interface.h index 8ac0f35bbf..18a43ebcdd 100644 --- a/src/USER-MOLFILE/molfile_interface.h +++ b/src/USER-MOLFILE/molfile_interface.h @@ -23,47 +23,56 @@ namespace LAMMPS_NS { // This class provides an abstract interface // to the VMD plugin library. -class MolfileInterface -{ +class MolfileInterface { public: // plugin modes. - enum {M_NONE=0, - M_READ = 1<<0, M_WRITE = 1<<1, - M_RSTRUCT = 1<<2, M_WSTRUCT = 1<<3, - M_RBONDS = 1<<4, M_WBONDS = 1<<5, - M_RANGLES = 1<<6, M_WANGLES = 1<<7, - M_RVOL = 1<<8, M_WVOL = 1<<9, - M_RVELS = 1<<10, M_WVELS = 1<<11, - M_LAST = 1<<12 }; + enum { + M_NONE = 0, + M_READ = 1 << 0, + M_WRITE = 1 << 1, + M_RSTRUCT = 1 << 2, + M_WSTRUCT = 1 << 3, + M_RBONDS = 1 << 4, + M_WBONDS = 1 << 5, + M_RANGLES = 1 << 6, + M_WANGLES = 1 << 7, + M_RVOL = 1 << 8, + M_WVOL = 1 << 9, + M_RVELS = 1 << 10, + M_WVELS = 1 << 11, + M_LAST = 1 << 12 + }; // plugin finder return values. - enum {E_NONE=0, //< nothing happened - E_DIR, //< path is not a directory or not readable - E_FILE, //< file not a DSO or not readable - E_SYMBOL, //< DSO is not a VMD plugin - E_TYPE, //< plugin is not of the correct type - E_ABI, //< plugin ABI does not match - E_MODE, //< plugin does not support desired mode - E_VERSION, //< plugin is not newer as the current one - E_MATCH, //< plugin matches - E_LAST //< last entry + enum { + E_NONE = 0, //< nothing happened + E_DIR, //< path is not a directory or not readable + E_FILE, //< file not a DSO or not readable + E_SYMBOL, //< DSO is not a VMD plugin + E_TYPE, //< plugin is not of the correct type + E_ABI, //< plugin ABI does not match + E_MODE, //< plugin does not support desired mode + E_VERSION, //< plugin is not newer as the current one + E_MATCH, //< plugin matches + E_LAST //< last entry }; // atom structure properties. deliberately not complete. - enum {P_NONE=0, //< no structure information available - P_NAME=1<<0, //< atom name, char[16] - P_TYPE=1<<1, //< atom type, char[16] - P_RESN=1<<2, //< residue name, char[ 8] - P_RESI=1<<3, //< residue index, int - P_SEGN=1<<4, //< segment name, char[ 8] - P_CHAI=1<<5, //< chain id, char[ 2] - P_OCCP=1<<6, //< occupancy, float - P_BFAC=1<<7, //< B factor, float - P_MASS=1<<8, //< atom mass, float - P_CHRG=1<<9, //< atom charge, float - P_RADS=1<<10, //< atom radius, float - P_ATMN=1<<11, //< atomic number, int - P_LAST=1<<12 //< last entry + enum { + P_NONE = 0, //< no structure information available + P_NAME = 1 << 0, //< atom name, char[16] + P_TYPE = 1 << 1, //< atom type, char[16] + P_RESN = 1 << 2, //< residue name, char[ 8] + P_RESI = 1 << 3, //< residue index, int + P_SEGN = 1 << 4, //< segment name, char[ 8] + P_CHAI = 1 << 5, //< chain id, char[ 2] + P_OCCP = 1 << 6, //< occupancy, float + P_BFAC = 1 << 7, //< B factor, float + P_MASS = 1 << 8, //< atom mass, float + P_CHRG = 1 << 9, //< atom charge, float + P_RADS = 1 << 10, //< atom radius, float + P_ATMN = 1 << 11, //< atomic number, int + P_LAST = 1 << 12 //< last entry }; MolfileInterface(const char *type, const int mode); @@ -71,9 +80,9 @@ class MolfileInterface // disallowed default methods private: - MolfileInterface() {}; - MolfileInterface(const MolfileInterface &) {}; - MolfileInterface &operator =(const MolfileInterface &) {return *this;}; + MolfileInterface(){}; + MolfileInterface(const MolfileInterface &){}; + MolfileInterface &operator=(const MolfileInterface &) { return *this; }; public: // search in the given directory path for a molfile plugin that @@ -106,9 +115,9 @@ class MolfileInterface // true if file stream is active. bool is_open() const { return (_ptr != 0); }; // true if file format requires or provides atom properties - bool has_props() const { return (_mode & (M_RSTRUCT|M_WSTRUCT)) != 0; }; + bool has_props() const { return (_mode & (M_RSTRUCT | M_WSTRUCT)) != 0; }; // true if file format can read or write velocities - bool has_vels() const { return (_mode & (M_RVELS|M_WVELS)) != 0; }; + bool has_vels() const { return (_mode & (M_RVELS | M_WVELS)) != 0; }; // return number of atoms in current file. -1 if closed/invalid; bool get_natoms() const { return _natoms; }; @@ -144,18 +153,18 @@ class MolfileInterface // internal data protected: - void *_plugin; // pointer to plugin struct - void *_dso; // handle to DSO - void *_ptr; // pointer to plugin data handle - void *_info; // pointer to atomic info data - char *_type; // canonical plugin name - char *_name; // plugin formatted name - int _natoms; // number of atoms - int _mode; // plugin mode of operation - int _caps; // plugin capabilities - int _props; // accumulated/available properties + void *_plugin; // pointer to plugin struct + void *_dso; // handle to DSO + void *_ptr; // pointer to plugin data handle + void *_info; // pointer to atomic info data + char *_type; // canonical plugin name + char *_name; // plugin formatted name + int _natoms; // number of atoms + int _mode; // plugin mode of operation + int _caps; // plugin capabilities + int _props; // accumulated/available properties }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-MOLFILE/reader_molfile.h b/src/USER-MOLFILE/reader_molfile.h index 76c5d402db..7d04955bc8 100644 --- a/src/USER-MOLFILE/reader_molfile.h +++ b/src/USER-MOLFILE/reader_molfile.h @@ -35,31 +35,31 @@ class ReaderMolfile : public Reader { virtual int read_time(bigint &); virtual void skip(); - virtual bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &); + virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &); virtual void read_atoms(int, int, double **); virtual void open_file(const char *); virtual void close_file(); -private: - int *fieldindex; // mapping of input fields to dump + private: + int *fieldindex; // mapping of input fields to dump class MolfileInterface *mf; - float *coords; // pointer to temporary coordinate storage - float *vels; // pointer to temporary velocity storage - int *types; // pointer to temporary type info storage - float cell[6]; // box info (stored as, a, b, c, alpha, beta, gamma) - int natoms; // current number of atoms - int needvels; // 1 if velocities are required, otherwise 0 + float *coords; // pointer to temporary coordinate storage + float *vels; // pointer to temporary velocity storage + int *types; // pointer to temporary type info storage + float cell[6]; // box info (stored as, a, b, c, alpha, beta, gamma) + int natoms; // current number of atoms + int needvels; // 1 if velocities are required, otherwise 0 - bigint nstep; // current (time) step number - bigint nid; // current atom id. + bigint nstep; // current (time) step number + bigint nid; // current atom id. int me; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-NETCDF/dump_netcdf.h b/src/USER-NETCDF/dump_netcdf.h index 1e8bf697d6..310c88d5fa 100644 --- a/src/USER-NETCDF/dump_netcdf.h +++ b/src/USER-NETCDF/dump_netcdf.h @@ -31,7 +31,7 @@ DumpStyle(netcdf,DumpNetCDF); namespace LAMMPS_NS { const int NC_FIELD_NAME_MAX = 100; -const int DUMP_NC_MAX_DIMS = 100; +const int DUMP_NC_MAX_DIMS = 100; class DumpNetCDF : public DumpCustom { public: @@ -42,32 +42,32 @@ class DumpNetCDF : public DumpCustom { private: // per-atoms quantities (positions, velocities, etc.) struct nc_perat_t { - int dims; // number of dimensions - int field[DUMP_NC_MAX_DIMS]; // field indices corresponding to the dim. - char name[NC_FIELD_NAME_MAX]; // field name - int var; // NetCDF variable + int dims; // number of dimensions + int field[DUMP_NC_MAX_DIMS]; // field indices corresponding to the dim. + char name[NC_FIELD_NAME_MAX]; // field name + int var; // NetCDF variable - bool constant; // is this property per file (not per frame) - int ndumped; // number of enties written for this prop. + bool constant; // is this property per file (not per frame) + int ndumped; // number of enties written for this prop. }; - int framei; // current frame index - int blocki; // current block index - int ndata; // number of data blocks to expect + int framei; // current frame index + int blocki; // current block index + int ndata; // number of data blocks to expect - bigint ntotalgr; // # of atoms + bigint ntotalgr; // # of atoms - int n_perat; // # of netcdf per-atom properties - nc_perat_t *perat; // per-atom properties + int n_perat; // # of netcdf per-atom properties + nc_perat_t *perat; // per-atom properties - int *thermovar; // NetCDF variables for thermo output + int *thermovar; // NetCDF variables for thermo output - bool double_precision; // write everything as double precision - bool thermo; // write thermo output to netcdf file + bool double_precision; // write everything as double precision + bool thermo; // write thermo output to netcdf file - bigint n_buffer; // size of buffer - bigint *int_buffer; // buffer for passing data to netcdf - double *double_buffer; // buffer for passing data to netcdf + bigint n_buffer; // size of buffer + bigint *int_buffer; // buffer for passing data to netcdf + double *double_buffer; // buffer for passing data to netcdf int ncid; @@ -97,7 +97,7 @@ class DumpNetCDF : public DumpCustom { void ncerr(int, const char *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.h b/src/USER-NETCDF/dump_netcdf_mpiio.h index 9e433b5133..eb1e12648f 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.h +++ b/src/USER-NETCDF/dump_netcdf_mpiio.h @@ -31,7 +31,7 @@ DumpStyle(netcdf/mpiio,DumpNetCDFMPIIO); namespace LAMMPS_NS { const int NC_MPIIO_FIELD_NAME_MAX = 100; -const int DUMP_NC_MPIIO_MAX_DIMS = 100; +const int DUMP_NC_MPIIO_MAX_DIMS = 100; class DumpNetCDFMPIIO : public DumpCustom { public: @@ -42,31 +42,31 @@ class DumpNetCDFMPIIO : public DumpCustom { private: // per-atoms quantities (positions, velocities, etc.) struct nc_perat_t { - int dims; // number of dimensions - int field[DUMP_NC_MPIIO_MAX_DIMS]; // field indices corresponding to the dim. - char name[NC_MPIIO_FIELD_NAME_MAX]; // field name - int var; // NetCDF variable + int dims; // number of dimensions + int field[DUMP_NC_MPIIO_MAX_DIMS]; // field indices corresponding to the dim. + char name[NC_MPIIO_FIELD_NAME_MAX]; // field name + int var; // NetCDF variable }; typedef void (DumpNetCDFMPIIO::*funcptr_t)(void *); - int framei; // current frame index - int blocki; // current block index - int ndata; // number of data blocks to expect + int framei; // current frame index + int blocki; // current block index + int ndata; // number of data blocks to expect - bigint ntotalgr; // # of atoms + bigint ntotalgr; // # of atoms - int n_perat; // # of netcdf per-atom properties - nc_perat_t *perat; // per-atom properties + int n_perat; // # of netcdf per-atom properties + nc_perat_t *perat; // per-atom properties - int *thermovar; // NetCDF variables for thermo output + int *thermovar; // NetCDF variables for thermo output - bool double_precision; // write everything as double precision - bool thermo; // write thermo output to netcdf file + bool double_precision; // write everything as double precision + bool thermo; // write thermo output to netcdf file - bigint n_buffer; // size of buffer - bigint *int_buffer; // buffer for passing data to netcdf - double *double_buffer; // buffer for passing data to netcdf + bigint n_buffer; // size of buffer + bigint *int_buffer; // buffer for passing data to netcdf + double *double_buffer; // buffer for passing data to netcdf int ncid; @@ -97,7 +97,7 @@ class DumpNetCDFMPIIO : public DumpCustom { void ncerr(int, const char *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_charmm_omp.h b/src/USER-OMP/angle_charmm_omp.h index 13bd91fb76..e92e49fd2e 100644 --- a/src/USER-OMP/angle_charmm_omp.h +++ b/src/USER-OMP/angle_charmm_omp.h @@ -37,10 +37,10 @@ class AngleCharmmOMP : public AngleCharmm, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_class2_omp.h b/src/USER-OMP/angle_class2_omp.h index 90f99a8347..aa93a646ae 100644 --- a/src/USER-OMP/angle_class2_omp.h +++ b/src/USER-OMP/angle_class2_omp.h @@ -37,10 +37,10 @@ class AngleClass2OMP : public AngleClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_delta_omp.h b/src/USER-OMP/angle_cosine_delta_omp.h index 88b9b38412..86bca4596e 100644 --- a/src/USER-OMP/angle_cosine_delta_omp.h +++ b/src/USER-OMP/angle_cosine_delta_omp.h @@ -37,10 +37,10 @@ class AngleCosineDeltaOMP : public AngleCosineDelta, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_omp.h b/src/USER-OMP/angle_cosine_omp.h index ce1534812c..9550b6f362 100644 --- a/src/USER-OMP/angle_cosine_omp.h +++ b/src/USER-OMP/angle_cosine_omp.h @@ -37,10 +37,10 @@ class AngleCosineOMP : public AngleCosine, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_periodic_omp.h b/src/USER-OMP/angle_cosine_periodic_omp.h index 281440e840..6bd6cb2f58 100644 --- a/src/USER-OMP/angle_cosine_periodic_omp.h +++ b/src/USER-OMP/angle_cosine_periodic_omp.h @@ -37,10 +37,10 @@ class AngleCosinePeriodicOMP : public AngleCosinePeriodic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_shift_exp_omp.h b/src/USER-OMP/angle_cosine_shift_exp_omp.h index 2aff66ae80..1c8ed89461 100644 --- a/src/USER-OMP/angle_cosine_shift_exp_omp.h +++ b/src/USER-OMP/angle_cosine_shift_exp_omp.h @@ -37,10 +37,10 @@ class AngleCosineShiftExpOMP : public AngleCosineShiftExp, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_shift_omp.h b/src/USER-OMP/angle_cosine_shift_omp.h index 451ab35258..1a26a3bb45 100644 --- a/src/USER-OMP/angle_cosine_shift_omp.h +++ b/src/USER-OMP/angle_cosine_shift_omp.h @@ -37,10 +37,10 @@ class AngleCosineShiftOMP : public AngleCosineShift, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_cosine_squared_omp.h b/src/USER-OMP/angle_cosine_squared_omp.h index f0463cabc4..7ed30831f5 100644 --- a/src/USER-OMP/angle_cosine_squared_omp.h +++ b/src/USER-OMP/angle_cosine_squared_omp.h @@ -37,10 +37,10 @@ class AngleCosineSquaredOMP : public AngleCosineSquared, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_dipole_omp.h b/src/USER-OMP/angle_dipole_omp.h index ddb274c6fb..93b89064ca 100644 --- a/src/USER-OMP/angle_dipole_omp.h +++ b/src/USER-OMP/angle_dipole_omp.h @@ -36,11 +36,10 @@ class AngleDipoleOMP : public AngleDipole, public ThrOMP { virtual void compute(int, int); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_fourier_omp.h b/src/USER-OMP/angle_fourier_omp.h index 1a94f39a41..2a8bca91f1 100644 --- a/src/USER-OMP/angle_fourier_omp.h +++ b/src/USER-OMP/angle_fourier_omp.h @@ -37,10 +37,10 @@ class AngleFourierOMP : public AngleFourier, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_fourier_simple_omp.h b/src/USER-OMP/angle_fourier_simple_omp.h index 5c86d71bde..5f39178604 100644 --- a/src/USER-OMP/angle_fourier_simple_omp.h +++ b/src/USER-OMP/angle_fourier_simple_omp.h @@ -37,10 +37,10 @@ class AngleFourierSimpleOMP : public AngleFourierSimple, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_harmonic_omp.h b/src/USER-OMP/angle_harmonic_omp.h index be9acd56b4..cc3811e0df 100644 --- a/src/USER-OMP/angle_harmonic_omp.h +++ b/src/USER-OMP/angle_harmonic_omp.h @@ -37,10 +37,10 @@ class AngleHarmonicOMP : public AngleHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_quartic_omp.h b/src/USER-OMP/angle_quartic_omp.h index cc69bd2364..9ca2a2bfa3 100644 --- a/src/USER-OMP/angle_quartic_omp.h +++ b/src/USER-OMP/angle_quartic_omp.h @@ -37,10 +37,10 @@ class AngleQuarticOMP : public AngleQuartic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_sdk_omp.h b/src/USER-OMP/angle_sdk_omp.h index c9e10cec4a..99e30a8108 100644 --- a/src/USER-OMP/angle_sdk_omp.h +++ b/src/USER-OMP/angle_sdk_omp.h @@ -37,10 +37,10 @@ class AngleSDKOMP : public AngleSDK, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/angle_table_omp.h b/src/USER-OMP/angle_table_omp.h index 372e07c17e..2c5b9df1cd 100644 --- a/src/USER-OMP/angle_table_omp.h +++ b/src/USER-OMP/angle_table_omp.h @@ -37,10 +37,10 @@ class AngleTableOMP : public AngleTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_class2_omp.h b/src/USER-OMP/bond_class2_omp.h index 9d77525a03..cf39d113bb 100644 --- a/src/USER-OMP/bond_class2_omp.h +++ b/src/USER-OMP/bond_class2_omp.h @@ -37,10 +37,10 @@ class BondClass2OMP : public BondClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_fene_expand_omp.h b/src/USER-OMP/bond_fene_expand_omp.h index 5588cdc9c1..fe7a5edf2a 100644 --- a/src/USER-OMP/bond_fene_expand_omp.h +++ b/src/USER-OMP/bond_fene_expand_omp.h @@ -37,10 +37,10 @@ class BondFENEExpandOMP : public BondFENEExpand, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_fene_omp.h b/src/USER-OMP/bond_fene_omp.h index 496b285a41..9714831ccc 100644 --- a/src/USER-OMP/bond_fene_omp.h +++ b/src/USER-OMP/bond_fene_omp.h @@ -37,10 +37,10 @@ class BondFENEOMP : public BondFENE, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_gromos_omp.h b/src/USER-OMP/bond_gromos_omp.h index acd9260bf2..99d26fde3f 100644 --- a/src/USER-OMP/bond_gromos_omp.h +++ b/src/USER-OMP/bond_gromos_omp.h @@ -37,10 +37,10 @@ class BondGromosOMP : public BondGromos, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_harmonic_omp.h b/src/USER-OMP/bond_harmonic_omp.h index 9015480f2e..9b18c18c5a 100644 --- a/src/USER-OMP/bond_harmonic_omp.h +++ b/src/USER-OMP/bond_harmonic_omp.h @@ -37,10 +37,10 @@ class BondHarmonicOMP : public BondHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.h b/src/USER-OMP/bond_harmonic_shift_cut_omp.h index 3905c4280b..4a461167ba 100644 --- a/src/USER-OMP/bond_harmonic_shift_cut_omp.h +++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.h @@ -37,10 +37,10 @@ class BondHarmonicShiftCutOMP : public BondHarmonicShiftCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_harmonic_shift_omp.h b/src/USER-OMP/bond_harmonic_shift_omp.h index 341c8390e8..f3272cb73d 100644 --- a/src/USER-OMP/bond_harmonic_shift_omp.h +++ b/src/USER-OMP/bond_harmonic_shift_omp.h @@ -37,10 +37,10 @@ class BondHarmonicShiftOMP : public BondHarmonicShift, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_morse_omp.h b/src/USER-OMP/bond_morse_omp.h index e733a15280..a4eeeba78b 100644 --- a/src/USER-OMP/bond_morse_omp.h +++ b/src/USER-OMP/bond_morse_omp.h @@ -37,10 +37,10 @@ class BondMorseOMP : public BondMorse, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_nonlinear_omp.h b/src/USER-OMP/bond_nonlinear_omp.h index d41e7abf5c..e44abaf40f 100644 --- a/src/USER-OMP/bond_nonlinear_omp.h +++ b/src/USER-OMP/bond_nonlinear_omp.h @@ -37,10 +37,10 @@ class BondNonlinearOMP : public BondNonlinear, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_quartic_omp.h b/src/USER-OMP/bond_quartic_omp.h index 9840a0d8ac..6b97639c3d 100644 --- a/src/USER-OMP/bond_quartic_omp.h +++ b/src/USER-OMP/bond_quartic_omp.h @@ -37,10 +37,10 @@ class BondQuarticOMP : public BondQuartic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/bond_table_omp.h b/src/USER-OMP/bond_table_omp.h index f3716aa006..a0972d08cb 100644 --- a/src/USER-OMP/bond_table_omp.h +++ b/src/USER-OMP/bond_table_omp.h @@ -37,10 +37,10 @@ class BondTableOMP : public BondTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_charmm_omp.h b/src/USER-OMP/dihedral_charmm_omp.h index c9b2c47bc3..f2779d3d6b 100644 --- a/src/USER-OMP/dihedral_charmm_omp.h +++ b/src/USER-OMP/dihedral_charmm_omp.h @@ -37,10 +37,10 @@ class DihedralCharmmOMP : public DihedralCharmm, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_class2_omp.h b/src/USER-OMP/dihedral_class2_omp.h index 6252e531e3..78a5183a90 100644 --- a/src/USER-OMP/dihedral_class2_omp.h +++ b/src/USER-OMP/dihedral_class2_omp.h @@ -37,10 +37,10 @@ class DihedralClass2OMP : public DihedralClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_cosine_shift_exp_omp.h b/src/USER-OMP/dihedral_cosine_shift_exp_omp.h index eba0dd1462..690f83e577 100644 --- a/src/USER-OMP/dihedral_cosine_shift_exp_omp.h +++ b/src/USER-OMP/dihedral_cosine_shift_exp_omp.h @@ -37,10 +37,10 @@ class DihedralCosineShiftExpOMP : public DihedralCosineShiftExp, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_fourier_omp.h b/src/USER-OMP/dihedral_fourier_omp.h index 75211b9567..68e1f95eed 100644 --- a/src/USER-OMP/dihedral_fourier_omp.h +++ b/src/USER-OMP/dihedral_fourier_omp.h @@ -37,10 +37,10 @@ class DihedralFourierOMP : public DihedralFourier, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_harmonic_omp.h b/src/USER-OMP/dihedral_harmonic_omp.h index 5025effcf0..166b23a023 100644 --- a/src/USER-OMP/dihedral_harmonic_omp.h +++ b/src/USER-OMP/dihedral_harmonic_omp.h @@ -37,10 +37,10 @@ class DihedralHarmonicOMP : public DihedralHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_helix_omp.h b/src/USER-OMP/dihedral_helix_omp.h index b356eba837..794388a989 100644 --- a/src/USER-OMP/dihedral_helix_omp.h +++ b/src/USER-OMP/dihedral_helix_omp.h @@ -37,10 +37,10 @@ class DihedralHelixOMP : public DihedralHelix, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_multi_harmonic_omp.h b/src/USER-OMP/dihedral_multi_harmonic_omp.h index a172650e46..586c444930 100644 --- a/src/USER-OMP/dihedral_multi_harmonic_omp.h +++ b/src/USER-OMP/dihedral_multi_harmonic_omp.h @@ -37,10 +37,10 @@ class DihedralMultiHarmonicOMP : public DihedralMultiHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_nharmonic_omp.h b/src/USER-OMP/dihedral_nharmonic_omp.h index 6b9c90e308..74f3d1d436 100644 --- a/src/USER-OMP/dihedral_nharmonic_omp.h +++ b/src/USER-OMP/dihedral_nharmonic_omp.h @@ -37,10 +37,10 @@ class DihedralNHarmonicOMP : public DihedralNHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_opls_omp.h b/src/USER-OMP/dihedral_opls_omp.h index 70ae7c989e..87f57cb573 100644 --- a/src/USER-OMP/dihedral_opls_omp.h +++ b/src/USER-OMP/dihedral_opls_omp.h @@ -37,10 +37,10 @@ class DihedralOPLSOMP : public DihedralOPLS, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_quadratic_omp.h b/src/USER-OMP/dihedral_quadratic_omp.h index a62f009c1a..0bdcfc14e5 100644 --- a/src/USER-OMP/dihedral_quadratic_omp.h +++ b/src/USER-OMP/dihedral_quadratic_omp.h @@ -37,10 +37,10 @@ class DihedralQuadraticOMP : public DihedralQuadratic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/dihedral_table_omp.h b/src/USER-OMP/dihedral_table_omp.h index fa60de1614..80a82226f9 100644 --- a/src/USER-OMP/dihedral_table_omp.h +++ b/src/USER-OMP/dihedral_table_omp.h @@ -37,10 +37,10 @@ class DihedralTableOMP : public DihedralTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/ewald_omp.h b/src/USER-OMP/ewald_omp.h index 40ae69435d..e5f97fdbff 100644 --- a/src/USER-OMP/ewald_omp.h +++ b/src/USER-OMP/ewald_omp.h @@ -25,10 +25,10 @@ KSpaceStyle(ewald/omp,EwaldOMP); namespace LAMMPS_NS { - class EwaldOMP : public Ewald, public ThrOMP { +class EwaldOMP : public Ewald, public ThrOMP { public: EwaldOMP(class LAMMPS *); - virtual ~EwaldOMP() { }; + virtual ~EwaldOMP(){}; virtual void allocate(); virtual void compute(int, int); @@ -37,7 +37,7 @@ namespace LAMMPS_NS { virtual void eik_dot_r_triclinic(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_gravity_omp.h b/src/USER-OMP/fix_gravity_omp.h index 08361588db..b9417ac24a 100644 --- a/src/USER-OMP/fix_gravity_omp.h +++ b/src/USER-OMP/fix_gravity_omp.h @@ -32,7 +32,7 @@ class FixGravityOMP : public FixGravity { virtual void post_force_respa(int, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_neigh_history_omp.h b/src/USER-OMP/fix_neigh_history_omp.h index d50d85f524..6f6cf911c1 100644 --- a/src/USER-OMP/fix_neigh_history_omp.h +++ b/src/USER-OMP/fix_neigh_history_omp.h @@ -34,7 +34,7 @@ class FixNeighHistoryOMP : public FixNeighHistory { void post_neighbor(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nh_asphere_omp.h b/src/USER-OMP/fix_nh_asphere_omp.h index 3a6b40f334..b0a8ffeaec 100644 --- a/src/USER-OMP/fix_nh_asphere_omp.h +++ b/src/USER-OMP/fix_nh_asphere_omp.h @@ -33,7 +33,7 @@ class FixNHAsphereOMP : public FixNHOMP { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_nh_omp.h b/src/USER-OMP/fix_nh_omp.h index bc5c748111..867cdf37e1 100644 --- a/src/USER-OMP/fix_nh_omp.h +++ b/src/USER-OMP/fix_nh_omp.h @@ -20,8 +20,8 @@ namespace LAMMPS_NS { class FixNHOMP : public FixNH { public: - FixNHOMP(class LAMMPS *lmp, int narg, char **args) : FixNH(lmp,narg,args) {}; - virtual ~FixNHOMP() {}; + FixNHOMP(class LAMMPS *lmp, int narg, char **args) : FixNH(lmp, narg, args){}; + virtual ~FixNHOMP(){}; protected: virtual void remap(); @@ -31,7 +31,7 @@ class FixNHOMP : public FixNH { virtual void nve_x(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_nh_sphere_omp.h b/src/USER-OMP/fix_nh_sphere_omp.h index f3f961e295..685ba6e201 100644 --- a/src/USER-OMP/fix_nh_sphere_omp.h +++ b/src/USER-OMP/fix_nh_sphere_omp.h @@ -29,7 +29,7 @@ class FixNHSphereOMP : public FixNHOMP { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_nph_asphere_omp.h b/src/USER-OMP/fix_nph_asphere_omp.h index 8d7f3288fd..2203687a81 100644 --- a/src/USER-OMP/fix_nph_asphere_omp.h +++ b/src/USER-OMP/fix_nph_asphere_omp.h @@ -30,7 +30,7 @@ class FixNPHAsphereOMP : public FixNHAsphereOMP { virtual ~FixNPHAsphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nph_omp.h b/src/USER-OMP/fix_nph_omp.h index a6542b9087..17fd772305 100644 --- a/src/USER-OMP/fix_nph_omp.h +++ b/src/USER-OMP/fix_nph_omp.h @@ -30,7 +30,7 @@ class FixNPHOMP : public FixNHOMP { ~FixNPHOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nph_sphere_omp.h b/src/USER-OMP/fix_nph_sphere_omp.h index dc2018bc81..0877518d36 100644 --- a/src/USER-OMP/fix_nph_sphere_omp.h +++ b/src/USER-OMP/fix_nph_sphere_omp.h @@ -30,7 +30,7 @@ class FixNPHSphereOMP : public FixNHSphereOMP { virtual ~FixNPHSphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_npt_asphere_omp.h b/src/USER-OMP/fix_npt_asphere_omp.h index a6f922fe34..117604de8b 100644 --- a/src/USER-OMP/fix_npt_asphere_omp.h +++ b/src/USER-OMP/fix_npt_asphere_omp.h @@ -30,7 +30,7 @@ class FixNPTAsphereOMP : public FixNHAsphereOMP { virtual ~FixNPTAsphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_npt_omp.h b/src/USER-OMP/fix_npt_omp.h index eb2bb3feb7..ca8f63c727 100644 --- a/src/USER-OMP/fix_npt_omp.h +++ b/src/USER-OMP/fix_npt_omp.h @@ -30,7 +30,7 @@ class FixNPTOMP : public FixNHOMP { ~FixNPTOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_npt_sphere_omp.h b/src/USER-OMP/fix_npt_sphere_omp.h index 73e2a599db..e012b2d292 100644 --- a/src/USER-OMP/fix_npt_sphere_omp.h +++ b/src/USER-OMP/fix_npt_sphere_omp.h @@ -30,7 +30,7 @@ class FixNPTSphereOMP : public FixNHSphereOMP { virtual ~FixNPTSphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nve_omp.h b/src/USER-OMP/fix_nve_omp.h index 9cf07ea0b1..d71afcedc0 100644 --- a/src/USER-OMP/fix_nve_omp.h +++ b/src/USER-OMP/fix_nve_omp.h @@ -32,7 +32,7 @@ class FixNVEOMP : public FixNVE { virtual void final_integrate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nve_sphere_omp.h b/src/USER-OMP/fix_nve_sphere_omp.h index 590cd16466..2c7886cee8 100644 --- a/src/USER-OMP/fix_nve_sphere_omp.h +++ b/src/USER-OMP/fix_nve_sphere_omp.h @@ -26,14 +26,13 @@ namespace LAMMPS_NS { class FixNVESphereOMP : public FixNVESphere { public: - FixNVESphereOMP(class LAMMPS *lmp, int narg, char **arg) : - FixNVESphere(lmp, narg, arg) {}; + FixNVESphereOMP(class LAMMPS *lmp, int narg, char **arg) : FixNVESphere(lmp, narg, arg){}; virtual void initial_integrate(int); virtual void final_integrate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_asphere_omp.h b/src/USER-OMP/fix_nvt_asphere_omp.h index d39b84583e..867ed7ae81 100644 --- a/src/USER-OMP/fix_nvt_asphere_omp.h +++ b/src/USER-OMP/fix_nvt_asphere_omp.h @@ -30,7 +30,7 @@ class FixNVTAsphereOMP : public FixNHAsphereOMP { virtual ~FixNVTAsphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_omp.h b/src/USER-OMP/fix_nvt_omp.h index 915a89adf8..50e34d58f6 100644 --- a/src/USER-OMP/fix_nvt_omp.h +++ b/src/USER-OMP/fix_nvt_omp.h @@ -30,7 +30,7 @@ class FixNVTOMP : public FixNHOMP { ~FixNVTOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_sllod_omp.h b/src/USER-OMP/fix_nvt_sllod_omp.h index 7828b64e71..b24c698c7a 100644 --- a/src/USER-OMP/fix_nvt_sllod_omp.h +++ b/src/USER-OMP/fix_nvt_sllod_omp.h @@ -36,7 +36,7 @@ class FixNVTSllodOMP : public FixNHOMP { virtual void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_nvt_sphere_omp.h b/src/USER-OMP/fix_nvt_sphere_omp.h index 0ef78bc942..f72084d934 100644 --- a/src/USER-OMP/fix_nvt_sphere_omp.h +++ b/src/USER-OMP/fix_nvt_sphere_omp.h @@ -30,7 +30,7 @@ class FixNVTSphereOMP : public FixNHSphereOMP { virtual ~FixNVTSphereOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_omp.h b/src/USER-OMP/fix_omp.h index 0db3497d41..1261415c15 100644 --- a/src/USER-OMP/fix_omp.h +++ b/src/USER-OMP/fix_omp.h @@ -22,7 +22,6 @@ FixStyle(OMP,FixOMP); #include "fix.h" - namespace LAMMPS_NS { class ThrData; @@ -40,43 +39,43 @@ class FixOMP : public Fix { virtual void min_setup(int flag) { setup(flag); } virtual void pre_force(int); - virtual void setup_pre_force(int vflag) { pre_force(vflag); } - virtual void min_setup_pre_force(int vflag) { pre_force(vflag); } - virtual void min_pre_force(int vflag) { pre_force(vflag); } - virtual void setup_pre_force_respa(int vflag,int) { pre_force(vflag); } - virtual void pre_force_respa(int vflag,int,int) { pre_force(vflag); } + virtual void setup_pre_force(int vflag) { pre_force(vflag); } + virtual void min_setup_pre_force(int vflag) { pre_force(vflag); } + virtual void min_pre_force(int vflag) { pre_force(vflag); } + virtual void setup_pre_force_respa(int vflag, int) { pre_force(vflag); } + virtual void pre_force_respa(int vflag, int, int) { pre_force(vflag); } virtual double memory_usage(); protected: ThrData **thr; - void *last_omp_style; // pointer to the style that needs - // to do the general force reduction - void *last_pair_hybrid; // pointer to the pair style that needs - // to call virial_fdot_compute() + void *last_omp_style; // pointer to the style that needs + // to do the general force reduction + void *last_pair_hybrid; // pointer to the pair style that needs + // to call virial_fdot_compute() // signal that an /omp style did the force reduction. needed by respa/omp - void did_reduce() { _reduced = true; } + void did_reduce() { _reduced = true; } public: - ThrData *get_thr(int tid) { return thr[tid]; } - int get_nthr() const { return _nthr; } + ThrData *get_thr(int tid) { return thr[tid]; } + int get_nthr() const { return _nthr; } bool get_neighbor() const { return _neighbor; } - bool get_mixed() const { return _mixed; } - bool get_reduced() const { return _reduced; } + bool get_mixed() const { return _mixed; } + bool get_reduced() const { return _reduced; } private: - int _nthr; // number of currently active ThrData objects - bool _neighbor; // en/disable threads for neighbor list construction - bool _mixed; // whether to prefer mixed precision compute kernels - bool _reduced; // whether forces have been reduced for this step - bool _pair_compute_flag; // whether pair_compute is called - bool _kspace_compute_flag; // whether kspace_compute is called + int _nthr; // number of currently active ThrData objects + bool _neighbor; // en/disable threads for neighbor list construction + bool _mixed; // whether to prefer mixed precision compute kernels + bool _reduced; // whether forces have been reduced for this step + bool _pair_compute_flag; // whether pair_compute is called + bool _kspace_compute_flag; // whether kspace_compute is called void set_neighbor_omp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_peri_neigh_omp.h b/src/USER-OMP/fix_peri_neigh_omp.h index 179ce7280b..badb546e19 100644 --- a/src/USER-OMP/fix_peri_neigh_omp.h +++ b/src/USER-OMP/fix_peri_neigh_omp.h @@ -27,12 +27,11 @@ namespace LAMMPS_NS { class FixPeriNeighOMP : public FixPeriNeigh { public: - FixPeriNeighOMP(class LAMMPS *lmp, int narg, char **argv) : - FixPeriNeigh(lmp,narg,argv) {}; + FixPeriNeighOMP(class LAMMPS *lmp, int narg, char **argv) : FixPeriNeigh(lmp, narg, argv){}; virtual void init(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_qeq_comb_omp.h b/src/USER-OMP/fix_qeq_comb_omp.h index f9dd6297a0..d27f0ea506 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.h +++ b/src/USER-OMP/fix_qeq_comb_omp.h @@ -26,7 +26,7 @@ class FixQEQCombOMP : public FixQEQComb { virtual void post_force(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_qeq_reax_omp.h b/src/USER-OMP/fix_qeq_reax_omp.h index e4084fc9a9..1cc8dc9811 100644 --- a/src/USER-OMP/fix_qeq_reax_omp.h +++ b/src/USER-OMP/fix_qeq_reax_omp.h @@ -40,27 +40,27 @@ class FixQEqReaxOMP : public FixQEqReax { int do_aspc; int aspc_order, aspc_order_max; double aspc_omega; - double * aspc_b; + double *aspc_b; virtual void allocate_storage(); virtual void deallocate_storage(); virtual void init_matvec(); virtual void compute_H(); - virtual int CG(double*,double*); - virtual void sparse_matvec(sparse_matrix*,double*,double*); + virtual int CG(double *, double *); + virtual void sparse_matvec(sparse_matrix *, double *, double *); virtual void calculate_Q(); - virtual void vector_sum(double*,double,double*,double,double*,int); - virtual void vector_add(double*, double, double*,int); + virtual void vector_sum(double *, double, double *, double, double *, int); + virtual void vector_add(double *, double, double *, int); // dual CG support - virtual int dual_CG(double*,double*,double*,double*); - virtual void dual_sparse_matvec(sparse_matrix*,double*,double*,double*); - virtual void dual_sparse_matvec(sparse_matrix*,double*,double*); + virtual int dual_CG(double *, double *, double *, double *); + virtual void dual_sparse_matvec(sparse_matrix *, double *, double *, double *); + virtual void dual_sparse_matvec(sparse_matrix *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_nh_omp.h b/src/USER-OMP/fix_rigid_nh_omp.h index ceebccf620..54e3c47d09 100644 --- a/src/USER-OMP/fix_rigid_nh_omp.h +++ b/src/USER-OMP/fix_rigid_nh_omp.h @@ -20,8 +20,7 @@ namespace LAMMPS_NS { class FixRigidNHOMP : public FixRigidNH { public: - FixRigidNHOMP(class LAMMPS *lmp, int narg, char **args) - : FixRigidNH(lmp,narg,args) {} + FixRigidNHOMP(class LAMMPS *lmp, int narg, char **args) : FixRigidNH(lmp, narg, args) {} virtual ~FixRigidNHOMP() {} virtual void initial_integrate(int); @@ -31,11 +30,11 @@ class FixRigidNHOMP : public FixRigidNH { protected: virtual void compute_forces_and_torques(); - private: // copied from FixRigidOMP + private: // copied from FixRigidOMP template void set_xv_thr(); template void set_v_thr(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/fix_rigid_nph_omp.h b/src/USER-OMP/fix_rigid_nph_omp.h index 345c5697e1..3311a4fe3a 100644 --- a/src/USER-OMP/fix_rigid_nph_omp.h +++ b/src/USER-OMP/fix_rigid_nph_omp.h @@ -30,8 +30,7 @@ class FixRigidNPHOMP : public FixRigidNHOMP { ~FixRigidNPHOMP() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_npt_omp.h b/src/USER-OMP/fix_rigid_npt_omp.h index 7f10ea1ab4..cc49583b77 100644 --- a/src/USER-OMP/fix_rigid_npt_omp.h +++ b/src/USER-OMP/fix_rigid_npt_omp.h @@ -30,8 +30,7 @@ class FixRigidNPTOMP : public FixRigidNHOMP { ~FixRigidNPTOMP() {} }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_nve_omp.h b/src/USER-OMP/fix_rigid_nve_omp.h index 4cc85f589e..a781fbe0e0 100644 --- a/src/USER-OMP/fix_rigid_nve_omp.h +++ b/src/USER-OMP/fix_rigid_nve_omp.h @@ -30,7 +30,7 @@ class FixRigidNVEOMP : public FixRigidNHOMP { ~FixRigidNVEOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_nvt_omp.h b/src/USER-OMP/fix_rigid_nvt_omp.h index 69408fa2ff..67a79eb7e0 100644 --- a/src/USER-OMP/fix_rigid_nvt_omp.h +++ b/src/USER-OMP/fix_rigid_nvt_omp.h @@ -30,7 +30,7 @@ class FixRigidNVTOMP : public FixRigidNHOMP { ~FixRigidNVTOMP() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_omp.h b/src/USER-OMP/fix_rigid_omp.h index 82686e89b8..664b25d8f5 100644 --- a/src/USER-OMP/fix_rigid_omp.h +++ b/src/USER-OMP/fix_rigid_omp.h @@ -26,8 +26,7 @@ namespace LAMMPS_NS { class FixRigidOMP : public FixRigid { public: - FixRigidOMP(class LAMMPS *lmp, int narg, char **args) - : FixRigid(lmp,narg,args) {} + FixRigidOMP(class LAMMPS *lmp, int narg, char **args) : FixRigid(lmp, narg, args) {} ~FixRigidOMP() {} virtual void initial_integrate(int); @@ -41,7 +40,7 @@ class FixRigidOMP : public FixRigid { template void set_v_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/fix_rigid_small_omp.h b/src/USER-OMP/fix_rigid_small_omp.h index 5cf3ff08af..44bad2cf35 100644 --- a/src/USER-OMP/fix_rigid_small_omp.h +++ b/src/USER-OMP/fix_rigid_small_omp.h @@ -26,9 +26,8 @@ namespace LAMMPS_NS { class FixRigidSmallOMP : public FixRigidSmall { public: - FixRigidSmallOMP(class LAMMPS *lmp, int narg, char **args) - : FixRigidSmall(lmp,narg,args) {}; - virtual ~FixRigidSmallOMP() {}; + FixRigidSmallOMP(class LAMMPS *lmp, int narg, char **args) : FixRigidSmall(lmp, narg, args){}; + virtual ~FixRigidSmallOMP(){}; virtual void initial_integrate(int); virtual void final_integrate(); @@ -41,7 +40,7 @@ class FixRigidSmallOMP : public FixRigidSmall { template void set_v_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_class2_omp.h b/src/USER-OMP/improper_class2_omp.h index 93be028b36..b00bf943bd 100644 --- a/src/USER-OMP/improper_class2_omp.h +++ b/src/USER-OMP/improper_class2_omp.h @@ -37,14 +37,13 @@ class ImproperClass2OMP : public ImproperClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); template - void angleangle_thr(int, int, ThrData * const thr); - + void angleangle_thr(int, int, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_cossq_omp.h b/src/USER-OMP/improper_cossq_omp.h index e537dfdff9..5c7a3605ae 100644 --- a/src/USER-OMP/improper_cossq_omp.h +++ b/src/USER-OMP/improper_cossq_omp.h @@ -37,10 +37,10 @@ class ImproperCossqOMP : public ImproperCossq, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_cvff_omp.h b/src/USER-OMP/improper_cvff_omp.h index 1a405ebdb9..bce6802959 100644 --- a/src/USER-OMP/improper_cvff_omp.h +++ b/src/USER-OMP/improper_cvff_omp.h @@ -37,10 +37,10 @@ class ImproperCvffOMP : public ImproperCvff, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_fourier_omp.h b/src/USER-OMP/improper_fourier_omp.h index fb8ace888b..284b0d44b1 100644 --- a/src/USER-OMP/improper_fourier_omp.h +++ b/src/USER-OMP/improper_fourier_omp.h @@ -37,17 +37,15 @@ class ImproperFourierOMP : public ImproperFourier, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); template - void add1_thr(const int,const int,const int,const int,const int, - const double &, const double &, const double &, - const double &, const double &, const double &, - const double &, const double &, const double &, - ThrData * const thr); + void add1_thr(const int, const int, const int, const int, const int, const double &, + const double &, const double &, const double &, const double &, const double &, + const double &, const double &, const double &, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_harmonic_omp.h b/src/USER-OMP/improper_harmonic_omp.h index 96497fced8..f5f7345376 100644 --- a/src/USER-OMP/improper_harmonic_omp.h +++ b/src/USER-OMP/improper_harmonic_omp.h @@ -37,10 +37,10 @@ class ImproperHarmonicOMP : public ImproperHarmonic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_ring_omp.h b/src/USER-OMP/improper_ring_omp.h index 9e15c7bd04..aa6fd78cda 100644 --- a/src/USER-OMP/improper_ring_omp.h +++ b/src/USER-OMP/improper_ring_omp.h @@ -37,10 +37,10 @@ class ImproperRingOMP : public ImproperRing, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/improper_umbrella_omp.h b/src/USER-OMP/improper_umbrella_omp.h index 0cf6a570c4..abece64e7d 100644 --- a/src/USER-OMP/improper_umbrella_omp.h +++ b/src/USER-OMP/improper_umbrella_omp.h @@ -37,10 +37,10 @@ class ImproperUmbrellaOMP : public ImproperUmbrella, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/msm_cg_omp.h b/src/USER-OMP/msm_cg_omp.h index 884dbea7fb..17682e3806 100644 --- a/src/USER-OMP/msm_cg_omp.h +++ b/src/USER-OMP/msm_cg_omp.h @@ -44,7 +44,7 @@ class MSMCGOMP : public MSMOMP { virtual void fieldforce_peratom(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/msm_omp.h b/src/USER-OMP/msm_omp.h index 200eba3144..983258625b 100644 --- a/src/USER-OMP/msm_omp.h +++ b/src/USER-OMP/msm_omp.h @@ -25,22 +25,21 @@ KSpaceStyle(msm/omp,MSMOMP); namespace LAMMPS_NS { - class MSMOMP : public MSM, public ThrOMP { +class MSMOMP : public MSM, public ThrOMP { public: MSMOMP(class LAMMPS *); - virtual ~MSMOMP () {}; + virtual ~MSMOMP(){}; protected: virtual void direct(int); - virtual void compute(int,int); + virtual void compute(int, int); private: template void direct_eval(int); template void direct_peratom(int); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_bin_atomonly_omp.h b/src/USER-OMP/npair_full_bin_atomonly_omp.h index 981e922821..a5b51f5e9c 100644 --- a/src/USER-OMP/npair_full_bin_atomonly_omp.h +++ b/src/USER-OMP/npair_full_bin_atomonly_omp.h @@ -34,7 +34,7 @@ class NPairFullBinAtomonlyOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_bin_ghost_omp.h b/src/USER-OMP/npair_full_bin_ghost_omp.h index 925ce2a080..fa0a56f0c4 100644 --- a/src/USER-OMP/npair_full_bin_ghost_omp.h +++ b/src/USER-OMP/npair_full_bin_ghost_omp.h @@ -34,7 +34,7 @@ class NPairFullBinGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_bin_omp.h b/src/USER-OMP/npair_full_bin_omp.h index a9d98233d2..631449a6f5 100644 --- a/src/USER-OMP/npair_full_bin_omp.h +++ b/src/USER-OMP/npair_full_bin_omp.h @@ -34,7 +34,7 @@ class NPairFullBinOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_multi_old_omp.cpp b/src/USER-OMP/npair_full_multi_old_omp.cpp index 46890f6438..459d1f38a8 100644 --- a/src/USER-OMP/npair_full_multi_old_omp.cpp +++ b/src/USER-OMP/npair_full_multi_old_omp.cpp @@ -11,16 +11,16 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "npair_full_multi_old_omp.h" -#include "npair_omp.h" -#include "neigh_list.h" #include "atom.h" #include "atom_vec.h" -#include "molecule.h" #include "domain.h" -#include "my_page.h" #include "error.h" +#include "molecule.h" +#include "my_page.h" +#include "neigh_list.h" +#include "npair_omp.h" +#include "omp_compat.h" using namespace LAMMPS_NS; @@ -46,11 +46,11 @@ void NPairFullMultiOldOmp::build(NeighList *list) #endif NPAIR_OMP_SETUP(nlocal); - int i,j,k,n,itype,jtype,ibin,which,ns,imol,iatom; + int i, j, k, n, itype, jtype, ibin, which, ns, imol, iatom; tagint tagprev; - double xtmp,ytmp,ztmp,delx,dely,delz,rsq; - int *neighptr,*s; - double *cutsq,*distsq; + double xtmp, ytmp, ztmp, delx, dely, delz, rsq; + int *neighptr, *s; + double *cutsq, *distsq; // loop over each atom, storing neighbors @@ -99,32 +99,35 @@ void NPairFullMultiOldOmp::build(NeighList *list) cutsq = cutneighsq[itype]; ns = nstencil_multi_old[itype]; for (k = 0; k < ns; k++) { - for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) { + for (j = binhead[ibin + s[k]]; j >= 0; j = bins[j]) { jtype = type[j]; if (cutsq[jtype] < distsq[k]) continue; if (i == j) continue; - if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; + if (exclude && exclusion(i, j, itype, jtype, mask, molecule)) continue; delx = xtmp - x[j][0]; dely = ytmp - x[j][1]; delz = ztmp - x[j][2]; - rsq = delx*delx + dely*dely + delz*delz; + rsq = delx * delx + dely * dely + delz * delz; if (rsq <= cutneighsq[itype][jtype]) { if (molecular != Atom::ATOMIC) { if (!moltemplate) - which = find_special(special[i],nspecial[i],tag[j]); - else if (imol >=0) - which = find_special(onemols[imol]->special[iatom], - onemols[imol]->nspecial[iatom], - tag[j]-tagprev); - else which = 0; - if (which == 0) neighptr[n++] = j; - else if (domain->minimum_image_check(delx,dely,delz)) + which = find_special(special[i], nspecial[i], tag[j]); + else if (imol >= 0) + which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom], + tag[j] - tagprev); + else + which = 0; + if (which == 0) neighptr[n++] = j; - else if (which > 0) neighptr[n++] = j ^ (which << SBBITS); - } else neighptr[n++] = j; + else if (domain->minimum_image_check(delx, dely, delz)) + neighptr[n++] = j; + else if (which > 0) + neighptr[n++] = j ^ (which << SBBITS); + } else + neighptr[n++] = j; } } } @@ -133,8 +136,7 @@ void NPairFullMultiOldOmp::build(NeighList *list) firstneigh[i] = neighptr; numneigh[i] = n; ipage.vgot(n); - if (ipage.status()) - error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); + if (ipage.status()) error->one(FLERR, "Neighbor list overflow, boost neigh_modify one"); } NPAIR_OMP_CLOSE; list->inum = nlocal; diff --git a/src/USER-OMP/npair_full_multi_old_omp.h b/src/USER-OMP/npair_full_multi_old_omp.h index f9adb7c793..964e2d98bb 100644 --- a/src/USER-OMP/npair_full_multi_old_omp.h +++ b/src/USER-OMP/npair_full_multi_old_omp.h @@ -34,7 +34,7 @@ class NPairFullMultiOldOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_multi_omp.h b/src/USER-OMP/npair_full_multi_omp.h index cd50d0bb66..954742fb03 100644 --- a/src/USER-OMP/npair_full_multi_omp.h +++ b/src/USER-OMP/npair_full_multi_omp.h @@ -34,7 +34,7 @@ class NPairFullMultiOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_nsq_ghost_omp.h b/src/USER-OMP/npair_full_nsq_ghost_omp.h index 39967e8b53..991bd64d13 100644 --- a/src/USER-OMP/npair_full_nsq_ghost_omp.h +++ b/src/USER-OMP/npair_full_nsq_ghost_omp.h @@ -34,7 +34,7 @@ class NPairFullNsqGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_full_nsq_omp.h b/src/USER-OMP/npair_full_nsq_omp.h index ba9a010cac..70794f8cf1 100644 --- a/src/USER-OMP/npair_full_nsq_omp.h +++ b/src/USER-OMP/npair_full_nsq_omp.h @@ -34,7 +34,7 @@ class NPairFullNsqOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h index 443ea50631..b55a8a7d69 100644 --- a/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h +++ b/src/USER-OMP/npair_half_bin_atomonly_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfBinAtomonlyNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h index a16e9eb66b..33b88d6363 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h +++ b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.h @@ -34,7 +34,7 @@ class NPairHalfBinNewtoffGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newtoff_omp.h b/src/USER-OMP/npair_half_bin_newtoff_omp.h index af13a6f707..1b2574d44e 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_omp.h +++ b/src/USER-OMP/npair_half_bin_newtoff_omp.h @@ -33,7 +33,7 @@ class NPairHalfBinNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newton_omp.h b/src/USER-OMP/npair_half_bin_newton_omp.h index 3bff54b8b1..ae0e64ccc7 100644 --- a/src/USER-OMP/npair_half_bin_newton_omp.h +++ b/src/USER-OMP/npair_half_bin_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfBinNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_bin_newton_tri_omp.h b/src/USER-OMP/npair_half_bin_newton_tri_omp.h index ab38f4dbdd..fb4b8f9d5f 100644 --- a/src/USER-OMP/npair_half_bin_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_bin_newton_tri_omp.h @@ -33,7 +33,7 @@ class NPairHalfBinNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_newtoff_omp.h b/src/USER-OMP/npair_half_multi_newtoff_omp.h index c204021591..45dca6d346 100644 --- a/src/USER-OMP/npair_half_multi_newtoff_omp.h +++ b/src/USER-OMP/npair_half_multi_newtoff_omp.h @@ -33,7 +33,7 @@ class NPairHalfMultiNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_newton_omp.h b/src/USER-OMP/npair_half_multi_newton_omp.h index f025c62cfe..023d18bc35 100644 --- a/src/USER-OMP/npair_half_multi_newton_omp.h +++ b/src/USER-OMP/npair_half_multi_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfMultiNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_newton_tri_omp.h b/src/USER-OMP/npair_half_multi_newton_tri_omp.h index ba55b89dad..78f19727b5 100644 --- a/src/USER-OMP/npair_half_multi_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_multi_newton_tri_omp.h @@ -33,7 +33,7 @@ class NPairHalfMultiNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_old_newtoff_omp.h b/src/USER-OMP/npair_half_multi_old_newtoff_omp.h index e25abb8941..865f409c41 100644 --- a/src/USER-OMP/npair_half_multi_old_newtoff_omp.h +++ b/src/USER-OMP/npair_half_multi_old_newtoff_omp.h @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_old_newton_omp.h b/src/USER-OMP/npair_half_multi_old_newton_omp.h index 54a5f14837..0848b945ac 100644 --- a/src/USER-OMP/npair_half_multi_old_newton_omp.h +++ b/src/USER-OMP/npair_half_multi_old_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h b/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h index b1f791e32b..17eaedd8a3 100644 --- a/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_multi_old_newton_tri_omp.h @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h index d1cb273fd1..d6053fedd7 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h +++ b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.h @@ -34,7 +34,7 @@ class NPairHalfNsqNewtoffGhostOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_nsq_newtoff_omp.h b/src/USER-OMP/npair_half_nsq_newtoff_omp.h index bcdc5c1898..a82a4603d8 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_omp.h +++ b/src/USER-OMP/npair_half_nsq_newtoff_omp.h @@ -33,7 +33,7 @@ class NPairHalfNsqNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_nsq_newton_omp.h b/src/USER-OMP/npair_half_nsq_newton_omp.h index 683213fd76..fd1dbc2c3c 100644 --- a/src/USER-OMP/npair_half_nsq_newton_omp.h +++ b/src/USER-OMP/npair_half_nsq_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfNsqNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h index 71032e911d..2169523c94 100644 --- a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h +++ b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.h @@ -34,7 +34,7 @@ class NPairHalfRespaBinNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_bin_newton_omp.h b/src/USER-OMP/npair_half_respa_bin_newton_omp.h index 4d87f83f07..683fb01cf7 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_omp.h +++ b/src/USER-OMP/npair_half_respa_bin_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h index 98ca0dc862..50fa507dea 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.h @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h index 77490ea79e..d3d77dc8a3 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h +++ b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.h @@ -34,7 +34,7 @@ class NPairHalfRespaNsqNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_respa_nsq_newton_omp.h b/src/USER-OMP/npair_half_respa_nsq_newton_omp.h index e70bde361b..8973e54324 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newton_omp.h +++ b/src/USER-OMP/npair_half_respa_nsq_newton_omp.h @@ -34,7 +34,7 @@ class NPairHalfRespaNsqNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_bin_newtoff_omp.h b/src/USER-OMP/npair_half_size_bin_newtoff_omp.h index 9a72f813f9..be286d94b3 100644 --- a/src/USER-OMP/npair_half_size_bin_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_bin_newtoff_omp.h @@ -34,7 +34,7 @@ class NPairHalfSizeBinNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_bin_newton_omp.h b/src/USER-OMP/npair_half_size_bin_newton_omp.h index 154b4e9482..8ce2051bd2 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_omp.h +++ b/src/USER-OMP/npair_half_size_bin_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h index 020352b3f9..e0e49274a3 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_size_bin_newton_tri_omp.h @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_newtoff_omp.h b/src/USER-OMP/npair_half_size_multi_newtoff_omp.h index 56da12805f..224b4ade07 100644 --- a/src/USER-OMP/npair_half_size_multi_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_multi_newtoff_omp.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_newton_omp.h b/src/USER-OMP/npair_half_size_multi_newton_omp.h index 957d7c55ae..52561019d2 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_omp.h +++ b/src/USER-OMP/npair_half_size_multi_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h index f6d8814b57..ab48831cbf 100644 --- a/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_size_multi_newton_tri_omp.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h b/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h index 5f84c6b378..7e122f27a7 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_multi_old_newtoff_omp.h @@ -34,7 +34,7 @@ class NPairHalfSizeMultiOldNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_old_newton_omp.h b/src/USER-OMP/npair_half_size_multi_old_newton_omp.h index 75f9533c7e..de0ff6d71d 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newton_omp.h +++ b/src/USER-OMP/npair_half_size_multi_old_newton_omp.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h b/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h index b133dcdbdc..e8d29b23f0 100644 --- a/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h +++ b/src/USER-OMP/npair_half_size_multi_old_newton_tri_omp.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtonTriOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h index 39354224e9..8ddaf740d0 100644 --- a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h +++ b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.h @@ -34,7 +34,7 @@ class NPairHalfSizeNsqNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_half_size_nsq_newton_omp.h b/src/USER-OMP/npair_half_size_nsq_newton_omp.h index 86ed07edcc..9949db34a4 100644 --- a/src/USER-OMP/npair_half_size_nsq_newton_omp.h +++ b/src/USER-OMP/npair_half_size_nsq_newton_omp.h @@ -34,7 +34,7 @@ class NPairHalfSizeNsqNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_halffull_newtoff_omp.h b/src/USER-OMP/npair_halffull_newtoff_omp.h index 0a1f2bb93a..7c7b745734 100644 --- a/src/USER-OMP/npair_halffull_newtoff_omp.h +++ b/src/USER-OMP/npair_halffull_newtoff_omp.h @@ -39,7 +39,7 @@ class NPairHalffullNewtoffOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_halffull_newton_omp.h b/src/USER-OMP/npair_halffull_newton_omp.h index 271f9ae38a..12b80f3f83 100644 --- a/src/USER-OMP/npair_halffull_newton_omp.h +++ b/src/USER-OMP/npair_halffull_newton_omp.h @@ -39,7 +39,7 @@ class NPairHalffullNewtonOmp : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/npair_omp.h b/src/USER-OMP/npair_omp.h index bfcda382ed..f045c2bbc3 100644 --- a/src/USER-OMP/npair_omp.h +++ b/src/USER-OMP/npair_omp.h @@ -19,10 +19,10 @@ #endif #include "comm.h" -#include "modify.h" -#include "timer.h" #include "fix_omp.h" +#include "modify.h" #include "thr_data.h" +#include "timer.h" namespace LAMMPS_NS { @@ -30,39 +30,38 @@ namespace LAMMPS_NS { #if defined(_OPENMP) // get access to number of threads and per-thread data structures via FixOMP -#define NPAIR_OMP_INIT \ - const int nthreads = comm->nthreads; \ +#define NPAIR_OMP_INIT \ + const int nthreads = comm->nthreads; \ const int ifix = modify->find_fix("package_omp") // get thread id and then assign each thread a fixed chunk of atoms -#define NPAIR_OMP_SETUP(num) \ - { \ - const int tid = omp_get_thread_num(); \ - const int idelta = 1 + num/nthreads; \ - const int ifrom = tid*idelta; \ - const int ito = ((ifrom + idelta) > num) \ - ? num : (ifrom+idelta); \ - FixOMP *fix = static_cast(modify->fix[ifix]); \ - ThrData *thr = fix->get_thr(tid); \ +#define NPAIR_OMP_SETUP(num) \ + { \ + const int tid = omp_get_thread_num(); \ + const int idelta = 1 + num / nthreads; \ + const int ifrom = tid * idelta; \ + const int ito = ((ifrom + idelta) > num) ? num : (ifrom + idelta); \ + FixOMP *fix = static_cast(modify->fix[ifix]); \ + ThrData *thr = fix->get_thr(tid); \ thr->timer(Timer::START); -#define NPAIR_OMP_CLOSE \ - thr->timer(Timer::NEIGH); \ - } +#define NPAIR_OMP_CLOSE \ + thr->timer(Timer::NEIGH); \ + } #else /* !defined(_OPENMP) */ #define NPAIR_OMP_INIT -#define NPAIR_OMP_SETUP(num) \ - const int tid = 0; \ - const int ifrom = 0; \ +#define NPAIR_OMP_SETUP(num) \ + const int tid = 0; \ + const int ifrom = 0; \ const int ito = num #define NPAIR_OMP_CLOSE #endif -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/pair_adp_omp.h b/src/USER-OMP/pair_adp_omp.h index c598579736..4efcbb1140 100644 --- a/src/USER-OMP/pair_adp_omp.h +++ b/src/USER-OMP/pair_adp_omp.h @@ -39,10 +39,10 @@ class PairADPOMP : public PairADP, public ThrOMP { private: template - void eval(int iifrom, int iito, ThrData * const thr); + void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_agni_omp.h b/src/USER-OMP/pair_agni_omp.h index cfcb8a4a30..58d3b35a7e 100644 --- a/src/USER-OMP/pair_agni_omp.h +++ b/src/USER-OMP/pair_agni_omp.h @@ -39,10 +39,10 @@ class PairAGNIOMP : public PairAGNI, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_airebo_morse_omp.h b/src/USER-OMP/pair_airebo_morse_omp.h index 261bbb7721..9cd51fc13f 100644 --- a/src/USER-OMP/pair_airebo_morse_omp.h +++ b/src/USER-OMP/pair_airebo_morse_omp.h @@ -30,7 +30,7 @@ class PairAIREBOMorseOMP : public PairAIREBOOMP { virtual void settings(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_airebo_omp.h b/src/USER-OMP/pair_airebo_omp.h index 2589ff4e23..fa9ca2045d 100644 --- a/src/USER-OMP/pair_airebo_omp.h +++ b/src/USER-OMP/pair_airebo_omp.h @@ -33,22 +33,20 @@ class PairAIREBOOMP : public PairAIREBO, public ThrOMP { virtual double memory_usage(); protected: - double bondorder_thr(int i, int j, double rij[3], double rijmag, - double VA, int vflag_atom, ThrData * const thr); - double bondorderLJ_thr(int i, int j, double rij[3], double rijmag, - double VA, double rij0[3], double rijmag0, - int vflag_atom, ThrData * const thr); + double bondorder_thr(int i, int j, double rij[3], double rijmag, double VA, int vflag_atom, + ThrData *const thr); + double bondorderLJ_thr(int i, int j, double rij[3], double rijmag, double VA, double rij0[3], + double rijmag0, int vflag_atom, ThrData *const thr); - void FREBO_thr(int ifrom, int ito, int evflag, int eflag, - int vflag_atom, double *pv0, ThrData * const thr); - void FLJ_thr(int ifrom, int ito, int evflag, int eflag, - int vflag_atom, double *pv1, ThrData * const thr); - void TORSION_thr(int ifrom, int ito, int evflag, int eflag, - double *pv2, ThrData * const thr); + void FREBO_thr(int ifrom, int ito, int evflag, int eflag, int vflag_atom, double *pv0, + ThrData *const thr); + void FLJ_thr(int ifrom, int ito, int evflag, int eflag, int vflag_atom, double *pv1, + ThrData *const thr); + void TORSION_thr(int ifrom, int ito, int evflag, int eflag, double *pv2, ThrData *const thr); void REBO_neigh_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_beck_omp.h b/src/USER-OMP/pair_beck_omp.h index 707435808e..5c8ba7c0ed 100644 --- a/src/USER-OMP/pair_beck_omp.h +++ b/src/USER-OMP/pair_beck_omp.h @@ -39,10 +39,10 @@ class PairBeckOMP : public PairBeck, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_coul_long_omp.h b/src/USER-OMP/pair_born_coul_long_omp.h index cc0f5a97d1..ea21f67d27 100644 --- a/src/USER-OMP/pair_born_coul_long_omp.h +++ b/src/USER-OMP/pair_born_coul_long_omp.h @@ -39,10 +39,10 @@ class PairBornCoulLongOMP : public PairBornCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_coul_msm_omp.h b/src/USER-OMP/pair_born_coul_msm_omp.h index 1525ee40a1..856e2ee6d9 100644 --- a/src/USER-OMP/pair_born_coul_msm_omp.h +++ b/src/USER-OMP/pair_born_coul_msm_omp.h @@ -39,10 +39,10 @@ class PairBornCoulMSMOMP : public PairBornCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.h b/src/USER-OMP/pair_born_coul_wolf_omp.h index 2bdda5e12d..3996a88d2e 100644 --- a/src/USER-OMP/pair_born_coul_wolf_omp.h +++ b/src/USER-OMP/pair_born_coul_wolf_omp.h @@ -39,10 +39,10 @@ class PairBornCoulWolfOMP : public PairBornCoulWolf, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_born_omp.h b/src/USER-OMP/pair_born_omp.h index 4e625ebd34..dd5f1eda20 100644 --- a/src/USER-OMP/pair_born_omp.h +++ b/src/USER-OMP/pair_born_omp.h @@ -39,10 +39,10 @@ class PairBornOMP : public PairBorn, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_brownian_omp.h b/src/USER-OMP/pair_brownian_omp.h index 20de5bb1cd..62d85207b2 100644 --- a/src/USER-OMP/pair_brownian_omp.h +++ b/src/USER-OMP/pair_brownian_omp.h @@ -44,10 +44,10 @@ class PairBrownianOMP : public PairBrownian, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_brownian_poly_omp.h b/src/USER-OMP/pair_brownian_poly_omp.h index a6997b08f3..af2900da63 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.h +++ b/src/USER-OMP/pair_brownian_poly_omp.h @@ -43,11 +43,10 @@ class PairBrownianPolyOMP : public PairBrownianPoly, public ThrOMP { int nthreads; private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.h b/src/USER-OMP/pair_buck_coul_cut_omp.h index e9eb7cc12b..8f4bb18874 100644 --- a/src/USER-OMP/pair_buck_coul_cut_omp.h +++ b/src/USER-OMP/pair_buck_coul_cut_omp.h @@ -39,10 +39,10 @@ class PairBuckCoulCutOMP : public PairBuckCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_coul_long_omp.h b/src/USER-OMP/pair_buck_coul_long_omp.h index 6edee897d0..f345e62351 100644 --- a/src/USER-OMP/pair_buck_coul_long_omp.h +++ b/src/USER-OMP/pair_buck_coul_long_omp.h @@ -39,10 +39,10 @@ class PairBuckCoulLongOMP : public PairBuckCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_coul_msm_omp.h b/src/USER-OMP/pair_buck_coul_msm_omp.h index bfa63c889e..52b2c429d9 100644 --- a/src/USER-OMP/pair_buck_coul_msm_omp.h +++ b/src/USER-OMP/pair_buck_coul_msm_omp.h @@ -39,10 +39,10 @@ class PairBuckCoulMSMOMP : public PairBuckCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_long_coul_long_omp.h b/src/USER-OMP/pair_buck_long_coul_long_omp.h index 28735acf77..9d97d8a67f 100644 --- a/src/USER-OMP/pair_buck_long_coul_long_omp.h +++ b/src/USER-OMP/pair_buck_long_coul_long_omp.h @@ -36,22 +36,19 @@ class PairBuckLongCoulLongOMP : public PairBuckLongCoulLong, public ThrOMP { virtual void compute_outer(int, int); private: - template - void eval(int, int, ThrData * const); - - template - void eval_outer(int, int, ThrData * const); + template + void eval(int, int, ThrData *const); + template + void eval_outer(int, int, ThrData *const); void eval_inner(int, int, ThrData *const); void eval_middle(int, int, ThrData *const); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_buck_omp.h b/src/USER-OMP/pair_buck_omp.h index 16af721772..984a8424aa 100644 --- a/src/USER-OMP/pair_buck_omp.h +++ b/src/USER-OMP/pair_buck_omp.h @@ -39,10 +39,10 @@ class PairBuckOMP : public PairBuck, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_colloid_omp.h b/src/USER-OMP/pair_colloid_omp.h index 17f21692e8..68ab98b595 100644 --- a/src/USER-OMP/pair_colloid_omp.h +++ b/src/USER-OMP/pair_colloid_omp.h @@ -39,10 +39,10 @@ class PairColloidOMP : public PairColloid, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_comb_omp.h b/src/USER-OMP/pair_comb_omp.h index 36a89bc9c7..e161c672c9 100644 --- a/src/USER-OMP/pair_comb_omp.h +++ b/src/USER-OMP/pair_comb_omp.h @@ -36,12 +36,12 @@ class PairCombOMP : public PairComb, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); void Short_neigh_thr(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_cut_global_omp.h b/src/USER-OMP/pair_coul_cut_global_omp.h index 53183d814c..70f4835725 100644 --- a/src/USER-OMP/pair_coul_cut_global_omp.h +++ b/src/USER-OMP/pair_coul_cut_global_omp.h @@ -31,7 +31,7 @@ class PairCoulCutGlobalOMP : public PairCoulCutOMP { void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_cut_omp.h b/src/USER-OMP/pair_coul_cut_omp.h index 821c961358..533227a469 100644 --- a/src/USER-OMP/pair_coul_cut_omp.h +++ b/src/USER-OMP/pair_coul_cut_omp.h @@ -39,10 +39,10 @@ class PairCoulCutOMP : public PairCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_cut_soft_omp.h b/src/USER-OMP/pair_coul_cut_soft_omp.h index d8710c7992..5149ef7787 100644 --- a/src/USER-OMP/pair_coul_cut_soft_omp.h +++ b/src/USER-OMP/pair_coul_cut_soft_omp.h @@ -39,10 +39,10 @@ class PairCoulCutSoftOMP : public PairCoulCutSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_debye_omp.h b/src/USER-OMP/pair_coul_debye_omp.h index ce09e80a31..fffc64fb02 100644 --- a/src/USER-OMP/pair_coul_debye_omp.h +++ b/src/USER-OMP/pair_coul_debye_omp.h @@ -39,10 +39,10 @@ class PairCoulDebyeOMP : public PairCoulDebye, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_diel_omp.h b/src/USER-OMP/pair_coul_diel_omp.h index cc09db2540..8204e5646d 100644 --- a/src/USER-OMP/pair_coul_diel_omp.h +++ b/src/USER-OMP/pair_coul_diel_omp.h @@ -39,10 +39,10 @@ class PairCoulDielOMP : public PairCoulDiel, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_dsf_omp.h b/src/USER-OMP/pair_coul_dsf_omp.h index 90b6651e96..776a86a743 100644 --- a/src/USER-OMP/pair_coul_dsf_omp.h +++ b/src/USER-OMP/pair_coul_dsf_omp.h @@ -39,10 +39,10 @@ class PairCoulDSFOMP : public PairCoulDSF, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_long_omp.h b/src/USER-OMP/pair_coul_long_omp.h index fec18d9976..719aef6548 100644 --- a/src/USER-OMP/pair_coul_long_omp.h +++ b/src/USER-OMP/pair_coul_long_omp.h @@ -39,10 +39,10 @@ class PairCoulLongOMP : public PairCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_long_soft_omp.h b/src/USER-OMP/pair_coul_long_soft_omp.h index b4e9e49f94..c37c277416 100644 --- a/src/USER-OMP/pair_coul_long_soft_omp.h +++ b/src/USER-OMP/pair_coul_long_soft_omp.h @@ -39,10 +39,10 @@ class PairCoulLongSoftOMP : public PairCoulLongSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_msm_omp.h b/src/USER-OMP/pair_coul_msm_omp.h index 9a665e30db..a540651015 100644 --- a/src/USER-OMP/pair_coul_msm_omp.h +++ b/src/USER-OMP/pair_coul_msm_omp.h @@ -39,10 +39,10 @@ class PairCoulMSMOMP : public PairCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_coul_wolf_omp.h b/src/USER-OMP/pair_coul_wolf_omp.h index 90a7aaf808..99659707af 100644 --- a/src/USER-OMP/pair_coul_wolf_omp.h +++ b/src/USER-OMP/pair_coul_wolf_omp.h @@ -39,10 +39,10 @@ class PairCoulWolfOMP : public PairCoulWolf, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_dpd_omp.h b/src/USER-OMP/pair_dpd_omp.h index b630de2e20..fa4747875b 100644 --- a/src/USER-OMP/pair_dpd_omp.h +++ b/src/USER-OMP/pair_dpd_omp.h @@ -44,10 +44,10 @@ class PairDPDOMP : public PairDPD, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_dpd_tstat_omp.h b/src/USER-OMP/pair_dpd_tstat_omp.h index ef1082cdfc..f4a9aa67cc 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.h +++ b/src/USER-OMP/pair_dpd_tstat_omp.h @@ -44,10 +44,10 @@ class PairDPDTstatOMP : public PairDPDTstat, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eam_alloy_omp.h b/src/USER-OMP/pair_eam_alloy_omp.h index a3e94f88aa..cede16d0a2 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.h +++ b/src/USER-OMP/pair_eam_alloy_omp.h @@ -37,7 +37,7 @@ class PairEAMAlloyOMP : virtual public PairEAMOMP { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eam_fs_omp.h b/src/USER-OMP/pair_eam_fs_omp.h index c170b95782..515a097f4a 100644 --- a/src/USER-OMP/pair_eam_fs_omp.h +++ b/src/USER-OMP/pair_eam_fs_omp.h @@ -37,7 +37,7 @@ class PairEAMFSOMP : virtual public PairEAMOMP { void file2array(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eam_omp.h b/src/USER-OMP/pair_eam_omp.h index 188a82bd37..470f44bfd6 100644 --- a/src/USER-OMP/pair_eam_omp.h +++ b/src/USER-OMP/pair_eam_omp.h @@ -39,10 +39,10 @@ class PairEAMOMP : public PairEAM, public ThrOMP { private: template - void eval(int iifrom, int iito, ThrData * const thr); + void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_edip_omp.h b/src/USER-OMP/pair_edip_omp.h index 32276d9932..c4ff9a7407 100644 --- a/src/USER-OMP/pair_edip_omp.h +++ b/src/USER-OMP/pair_edip_omp.h @@ -34,10 +34,10 @@ class PairEDIPOMP : public PairEDIP, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_eim_omp.h b/src/USER-OMP/pair_eim_omp.h index 5d52229dfc..2d65259300 100644 --- a/src/USER-OMP/pair_eim_omp.h +++ b/src/USER-OMP/pair_eim_omp.h @@ -39,10 +39,10 @@ class PairEIMOMP : public PairEIM, public ThrOMP { private: template - void eval(int iifrom, int iito, ThrData * const thr); + void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gauss_cut_omp.h b/src/USER-OMP/pair_gauss_cut_omp.h index 789856965d..ae42821614 100644 --- a/src/USER-OMP/pair_gauss_cut_omp.h +++ b/src/USER-OMP/pair_gauss_cut_omp.h @@ -39,10 +39,10 @@ class PairGaussCutOMP : public PairGaussCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gauss_omp.h b/src/USER-OMP/pair_gauss_omp.h index eb29666e21..51fc7c760a 100644 --- a/src/USER-OMP/pair_gauss_omp.h +++ b/src/USER-OMP/pair_gauss_omp.h @@ -39,10 +39,10 @@ class PairGaussOMP : public PairGauss, public ThrOMP { private: template - double eval(int ifrom, int ito, ThrData * const thr); + double eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gayberne_omp.h b/src/USER-OMP/pair_gayberne_omp.h index ed21ca6a3f..eb4ecd95cb 100644 --- a/src/USER-OMP/pair_gayberne_omp.h +++ b/src/USER-OMP/pair_gayberne_omp.h @@ -39,10 +39,10 @@ class PairGayBerneOMP : public PairGayBerne, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.h b/src/USER-OMP/pair_gran_hertz_history_omp.h index d73346a527..c5f2a79b3e 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.h +++ b/src/USER-OMP/pair_gran_hertz_history_omp.h @@ -39,10 +39,10 @@ class PairGranHertzHistoryOMP : public PairGranHertzHistory, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.h b/src/USER-OMP/pair_gran_hooke_history_omp.h index 075e0f95ff..e98c898db7 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.h +++ b/src/USER-OMP/pair_gran_hooke_history_omp.h @@ -39,10 +39,10 @@ class PairGranHookeHistoryOMP : public PairGranHookeHistory, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_gran_hooke_omp.h b/src/USER-OMP/pair_gran_hooke_omp.h index 689d31d6df..8fb8e98fa5 100644 --- a/src/USER-OMP/pair_gran_hooke_omp.h +++ b/src/USER-OMP/pair_gran_hooke_omp.h @@ -38,11 +38,10 @@ class PairGranHookeOMP : public PairGranHooke, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.h b/src/USER-OMP/pair_hbond_dreiding_lj_omp.h index 2bb54bb90b..c3ac0393ea 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.h +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.h @@ -43,10 +43,10 @@ class PairHbondDreidingLJOMP : public PairHbondDreidingLJ, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.h b/src/USER-OMP/pair_hbond_dreiding_morse_omp.h index aa6dbebcb9..b604da7d65 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.h +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.h @@ -43,10 +43,10 @@ class PairHbondDreidingMorseOMP : public PairHbondDreidingMorse, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj96_cut_omp.h b/src/USER-OMP/pair_lj96_cut_omp.h index 8860637dee..719f4b78e5 100644 --- a/src/USER-OMP/pair_lj96_cut_omp.h +++ b/src/USER-OMP/pair_lj96_cut_omp.h @@ -39,10 +39,10 @@ class PairLJ96CutOMP : public PairLJ96Cut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h index 99bf3c895d..ea2e179914 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h @@ -39,10 +39,10 @@ class PairLJCharmmCoulCharmmImplicitOMP : public PairLJCharmmCoulCharmmImplicit, private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h index b18668ee3c..7665242a53 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h @@ -39,10 +39,10 @@ class PairLJCharmmCoulCharmmOMP : public PairLJCharmmCoulCharmm, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.h b/src/USER-OMP/pair_lj_charmm_coul_long_omp.h index 55c4de1540..cd84ba6c90 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.h @@ -39,10 +39,10 @@ class PairLJCharmmCoulLongOMP : public PairLJCharmmCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h index e800633847..49972cd5dd 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.h @@ -39,10 +39,10 @@ class PairLJCharmmCoulLongSoftOMP : public PairLJCharmmCoulLongSoft, public ThrO private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h index 49a441dd48..c637d55049 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h +++ b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.h @@ -39,10 +39,10 @@ class PairLJCharmmCoulMSMOMP : public PairLJCharmmCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.h b/src/USER-OMP/pair_lj_class2_coul_cut_omp.h index 105a1a9159..d8e5c0216e 100644 --- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.h +++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.h @@ -39,10 +39,10 @@ class PairLJClass2CoulCutOMP : public PairLJClass2CoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.h b/src/USER-OMP/pair_lj_class2_coul_long_omp.h index 69680d82b3..1147e2a774 100644 --- a/src/USER-OMP/pair_lj_class2_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.h @@ -39,10 +39,10 @@ class PairLJClass2CoulLongOMP : public PairLJClass2CoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_class2_omp.h b/src/USER-OMP/pair_lj_class2_omp.h index ba48721824..93c0b241cb 100644 --- a/src/USER-OMP/pair_lj_class2_omp.h +++ b/src/USER-OMP/pair_lj_class2_omp.h @@ -39,10 +39,10 @@ class PairLJClass2OMP : public PairLJClass2, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cubic_omp.h b/src/USER-OMP/pair_lj_cubic_omp.h index 1344fd9ce9..7962310c9e 100644 --- a/src/USER-OMP/pair_lj_cubic_omp.h +++ b/src/USER-OMP/pair_lj_cubic_omp.h @@ -39,10 +39,10 @@ class PairLJCubicOMP : public PairLJCubic, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.h b/src/USER-OMP/pair_lj_cut_coul_cut_omp.h index 3935e5b1ce..dcf2131b14 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulCutOMP : public PairLJCutCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h index 24a3951a50..b5f348340e 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulCutSoftOMP : public PairLJCutCoulCutSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.h b/src/USER-OMP/pair_lj_cut_coul_debye_omp.h index e4c9fd3ee5..ee88242a38 100644 --- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulDebyeOMP : public PairLJCutCoulDebye, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h index e67ab7d844..609b93a8f3 100644 --- a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulDSFOMP : public PairLJCutCoulDSF, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.h b/src/USER-OMP/pair_lj_cut_coul_long_omp.h index e79835c5f4..d9fb58fc33 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulLongOMP : public PairLJCutCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h index f18b29d161..a906b51025 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulLongSoftOMP : public PairLJCutCoulLongSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_msm_omp.h b/src/USER-OMP/pair_lj_cut_coul_msm_omp.h index 2fd86e2085..ac955159d5 100644 --- a/src/USER-OMP/pair_lj_cut_coul_msm_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_msm_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulMSMOMP : public PairLJCutCoulMSM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h index e01e0569af..d299e88086 100644 --- a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h +++ b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.h @@ -39,10 +39,10 @@ class PairLJCutCoulWolfOMP : public PairLJCutCoulWolf, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h index 8b5cb4f4e2..03aeaf2133 100644 --- a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.h @@ -39,10 +39,10 @@ class PairLJCutDipoleCutOMP : public PairLJCutDipoleCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_omp.h b/src/USER-OMP/pair_lj_cut_omp.h index dc0dcd51f5..be4a2a01bf 100644 --- a/src/USER-OMP/pair_lj_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_omp.h @@ -39,10 +39,10 @@ class PairLJCutOMP : public PairLJCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_soft_omp.h b/src/USER-OMP/pair_lj_cut_soft_omp.h index 9a37f988cd..58ebb8d391 100644 --- a/src/USER-OMP/pair_lj_cut_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_soft_omp.h @@ -39,10 +39,10 @@ class PairLJCutSoftOMP : public PairLJCutSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.h b/src/USER-OMP/pair_lj_cut_thole_long_omp.h index 73a8e87db0..ac33c4b230 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.h +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.h @@ -33,10 +33,10 @@ class PairLJCutTholeLongOMP : public PairLJCutTholeLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h index b2f262662a..3eed7aba9a 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h +++ b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.h @@ -42,12 +42,11 @@ class PairLJCutTIP4PCutOMP : public PairLJCutTIP4PCut, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h index bbaf131423..0bd925f185 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.h @@ -42,12 +42,11 @@ class PairLJCutTIP4PLongOMP : public PairLJCutTIP4PLong, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h index 4170c58a4d..2b65d522f0 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.h @@ -42,12 +42,11 @@ class PairLJCutTIP4PLongSoftOMP : public PairLJCutTIP4PLongSoft, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_expand_omp.h b/src/USER-OMP/pair_lj_expand_omp.h index 351b019eec..e7a3428145 100644 --- a/src/USER-OMP/pair_lj_expand_omp.h +++ b/src/USER-OMP/pair_lj_expand_omp.h @@ -39,10 +39,10 @@ class PairLJExpandOMP : public PairLJExpand, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h index 8167d62e0b..2d336c59fe 100644 --- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h +++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h @@ -39,10 +39,10 @@ class PairLJGromacsCoulGromacsOMP : public PairLJGromacsCoulGromacs, public ThrO private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_gromacs_omp.h b/src/USER-OMP/pair_lj_gromacs_omp.h index 63adddaaf7..4db931b93e 100644 --- a/src/USER-OMP/pair_lj_gromacs_omp.h +++ b/src/USER-OMP/pair_lj_gromacs_omp.h @@ -39,10 +39,10 @@ class PairLJGromacsOMP : public PairLJGromacs, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_long_coul_long_omp.h b/src/USER-OMP/pair_lj_long_coul_long_omp.h index 93500b8d44..e2499b2774 100644 --- a/src/USER-OMP/pair_lj_long_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_long_coul_long_omp.h @@ -41,25 +41,19 @@ class PairLJLongCoulLongOMP : public PairLJLongCoulLong, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int, int, ThrData * const); - - template - void eval_outer(int, int, ThrData * const); + template + void eval(int, int, ThrData *const); + template + void eval_outer(int, int, ThrData *const); void eval_inner(int, int, ThrData *const); void eval_middle(int, int, ThrData *const); - - - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.h b/src/USER-OMP/pair_lj_long_tip4p_long_omp.h index d7dc05faef..513d96deac 100644 --- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.h +++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.h @@ -45,28 +45,21 @@ class PairLJLongTIP4PLongOMP : public PairLJLongTIP4PLong, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template - void eval(int, int, ThrData * const); - - template - void eval_outer(int, int, ThrData * const); + template + void eval(int, int, ThrData *const); + template + void eval_outer(int, int, ThrData *const); void eval_inner(int, int, ThrData *const); void eval_middle(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; - - - + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_relres_omp.h b/src/USER-OMP/pair_lj_relres_omp.h index 29ed84207f..9727fe518a 100644 --- a/src/USER-OMP/pair_lj_relres_omp.h +++ b/src/USER-OMP/pair_lj_relres_omp.h @@ -39,10 +39,10 @@ class PairLJRelResOMP : public PairLJRelRes, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.h b/src/USER-OMP/pair_lj_sdk_coul_long_omp.h index 3e58d0ecd5..0ada1d3903 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.h +++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.h @@ -39,10 +39,10 @@ class PairLJSDKCoulLongOMP : public PairLJSDKCoulLong, public ThrOMP { private: template - void eval_thr(int ifrom, int ito, ThrData * const thr); + void eval_thr(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h index 710b72a172..ac8d6950d7 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h +++ b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.h @@ -39,10 +39,10 @@ class PairLJSDKCoulMSMOMP : public PairLJSDKCoulMSM, public ThrOMP { private: template - void eval_msm_thr(int ifrom, int ito, ThrData * const thr); + void eval_msm_thr(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sdk_omp.h b/src/USER-OMP/pair_lj_sdk_omp.h index 81d6406d5f..e756f6088e 100644 --- a/src/USER-OMP/pair_lj_sdk_omp.h +++ b/src/USER-OMP/pair_lj_sdk_omp.h @@ -39,10 +39,10 @@ class PairLJSDKOMP : public PairLJSDK, public ThrOMP { private: template - void eval_thr(int ifrom, int ito, ThrData * const thr); + void eval_thr(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h index 6bd48f014c..5e7435870c 100644 --- a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h +++ b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.h @@ -39,10 +39,10 @@ class PairLJSFDipoleSFOMP : public PairLJSFDipoleSF, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.h b/src/USER-OMP/pair_lj_smooth_linear_omp.h index fab5c8ea0b..b6eba3d3ce 100644 --- a/src/USER-OMP/pair_lj_smooth_linear_omp.h +++ b/src/USER-OMP/pair_lj_smooth_linear_omp.h @@ -40,10 +40,10 @@ class PairLJSmoothLinearOMP : public PairLJSmoothLinear, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lj_smooth_omp.h b/src/USER-OMP/pair_lj_smooth_omp.h index 1263d2a00d..2d065b3808 100644 --- a/src/USER-OMP/pair_lj_smooth_omp.h +++ b/src/USER-OMP/pair_lj_smooth_omp.h @@ -39,10 +39,10 @@ class PairLJSmoothOMP : public PairLJSmooth, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lubricate_omp.h b/src/USER-OMP/pair_lubricate_omp.h index 958e8bcce4..36242f2d47 100644 --- a/src/USER-OMP/pair_lubricate_omp.h +++ b/src/USER-OMP/pair_lubricate_omp.h @@ -40,10 +40,10 @@ class PairLubricateOMP : public PairLubricate, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_lubricate_poly_omp.h b/src/USER-OMP/pair_lubricate_poly_omp.h index b364b4b71a..2adcea4e8a 100644 --- a/src/USER-OMP/pair_lubricate_poly_omp.h +++ b/src/USER-OMP/pair_lubricate_poly_omp.h @@ -40,10 +40,10 @@ class PairLubricatePolyOMP : public PairLubricatePoly, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_meam_spline_omp.h b/src/USER-OMP/pair_meam_spline_omp.h index cb81e99966..be5a80a594 100644 --- a/src/USER-OMP/pair_meam_spline_omp.h +++ b/src/USER-OMP/pair_meam_spline_omp.h @@ -38,11 +38,10 @@ class PairMEAMSplineOMP : public PairMEAMSpline, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int iifrom, int iito, ThrData * const thr); + template void eval(int iifrom, int iito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_morse_omp.h b/src/USER-OMP/pair_morse_omp.h index e62e8a9fd7..46bd231a51 100644 --- a/src/USER-OMP/pair_morse_omp.h +++ b/src/USER-OMP/pair_morse_omp.h @@ -39,10 +39,10 @@ class PairMorseOMP : public PairMorse, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_morse_smooth_linear_omp.h b/src/USER-OMP/pair_morse_smooth_linear_omp.h index 4f036f91e1..9a9b49c022 100644 --- a/src/USER-OMP/pair_morse_smooth_linear_omp.h +++ b/src/USER-OMP/pair_morse_smooth_linear_omp.h @@ -34,10 +34,10 @@ class PairMorseSmoothLinearOMP : public PairMorseSmoothLinear, public ThrOMP { private: template - void eval( int ifrom, int ito, ThrData * const thr ); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_nm_cut_coul_cut_omp.h b/src/USER-OMP/pair_nm_cut_coul_cut_omp.h index de13527d86..5fc1852dcd 100644 --- a/src/USER-OMP/pair_nm_cut_coul_cut_omp.h +++ b/src/USER-OMP/pair_nm_cut_coul_cut_omp.h @@ -39,10 +39,10 @@ class PairNMCutCoulCutOMP : public PairNMCutCoulCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_nm_cut_coul_long_omp.h b/src/USER-OMP/pair_nm_cut_coul_long_omp.h index 8af07145b8..7627000787 100644 --- a/src/USER-OMP/pair_nm_cut_coul_long_omp.h +++ b/src/USER-OMP/pair_nm_cut_coul_long_omp.h @@ -39,10 +39,10 @@ class PairNMCutCoulLongOMP : public PairNMCutCoulLong, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_nm_cut_omp.h b/src/USER-OMP/pair_nm_cut_omp.h index d2bc25470d..04facb8bfe 100644 --- a/src/USER-OMP/pair_nm_cut_omp.h +++ b/src/USER-OMP/pair_nm_cut_omp.h @@ -39,10 +39,10 @@ class PairNMCutOMP : public PairNMCut, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_peri_lps_omp.h b/src/USER-OMP/pair_peri_lps_omp.h index 412c743140..72dee63a6e 100644 --- a/src/USER-OMP/pair_peri_lps_omp.h +++ b/src/USER-OMP/pair_peri_lps_omp.h @@ -40,13 +40,12 @@ class PairPeriLPSOMP : public PairPeriLPS, public ThrOMP { protected: void compute_dilatation_thr(int ifrom, int ito); - private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_peri_pmb_omp.h b/src/USER-OMP/pair_peri_pmb_omp.h index ac79224fc1..7e1d8fa7cf 100644 --- a/src/USER-OMP/pair_peri_pmb_omp.h +++ b/src/USER-OMP/pair_peri_pmb_omp.h @@ -39,10 +39,10 @@ class PairPeriPMBOMP : public PairPeriPMB, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_reaxc_omp.h b/src/USER-OMP/pair_reaxc_omp.h index b23d2c7d7b..eacfd0e33e 100644 --- a/src/USER-OMP/pair_reaxc_omp.h +++ b/src/USER-OMP/pair_reaxc_omp.h @@ -32,47 +32,47 @@ class PairReaxCOMP : public PairReaxC, public ThrOMP { virtual void compute(int, int); virtual void init_style(); - inline FixOMP *getFixOMP() { - return fix; - }; + inline FixOMP *getFixOMP() { return fix; }; - inline void ev_setup_thr_proxy(int eflagparm, int vflagparm, int nallparm, - double *eatomparm, double **vatomparm, - double **cvatomparm, ThrData *thrparm) { - ev_setup_thr(eflagparm, vflagparm, nallparm, eatomparm, vatomparm, - cvatomparm, thrparm); + inline void ev_setup_thr_proxy(int eflagparm, int vflagparm, int nallparm, double *eatomparm, + double **vatomparm, double **cvatomparm, ThrData *thrparm) + { + ev_setup_thr(eflagparm, vflagparm, nallparm, eatomparm, vatomparm, cvatomparm, thrparm); }; // reduce per thread data as needed - inline void reduce_thr_proxy(void * const styleparm, const int eflagparm, - const int vflagparm, ThrData * const thrparm) { + inline void reduce_thr_proxy(void *const styleparm, const int eflagparm, const int vflagparm, + ThrData *const thrparm) + { reduce_thr(styleparm, eflagparm, vflagparm, thrparm); } - inline void ev_tally_thr_proxy(Pair * const pairparm, const int iparm, const int jparm, + inline void ev_tally_thr_proxy(Pair *const pairparm, const int iparm, const int jparm, const int nlocalparm, const int newton_pairparm, const double evdwlparm, const double ecoulparm, const double fpairparm, const double delxparm, const double delyparm, const double delzparm, - ThrData * const thrparm) { - ev_tally_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, - evdwlparm, ecoulparm, fpairparm, delxparm, delyparm, delzparm, thrparm); + ThrData *const thrparm) + { + ev_tally_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, evdwlparm, ecoulparm, + fpairparm, delxparm, delyparm, delzparm, thrparm); } - inline void ev_tally_xyz_thr_proxy(Pair * const pairparm, const int iparm, const int jparm, + inline void ev_tally_xyz_thr_proxy(Pair *const pairparm, const int iparm, const int jparm, const int nlocalparm, const int newton_pairparm, const double evdwlparm, const double ecoulparm, const double fxparm, const double fyparm, const double fzparm, const double delxparm, const double delyparm, - const double delzparm, ThrData * const thrparm) { - ev_tally_xyz_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, - evdwlparm, ecoulparm, fxparm, fyparm, fzparm, - delxparm, delyparm, delzparm, thrparm); + const double delzparm, ThrData *const thrparm) + { + ev_tally_xyz_thr(pairparm, iparm, jparm, nlocalparm, newton_pairparm, evdwlparm, ecoulparm, + fxparm, fyparm, fzparm, delxparm, delyparm, delzparm, thrparm); } - inline void ev_tally3_thr_proxy(Pair * const pairparm,int i, int j, int k, - double evdwl, double ecoul, double *fj, double *fk, - double *drji, double *drki, ThrData * const thrparm) { + inline void ev_tally3_thr_proxy(Pair *const pairparm, int i, int j, int k, double evdwl, + double ecoul, double *fj, double *fk, double *drji, double *drki, + ThrData *const thrparm) + { ev_tally3_thr(pairparm, i, j, k, evdwl, ecoul, fj, fk, drji, drki, thrparm); } @@ -85,10 +85,10 @@ class PairReaxCOMP : public PairReaxC, public ThrOMP { virtual void FindBond(); // work array used in write_reax_lists() - int * num_nbrs_offset; + int *num_nbrs_offset; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_rebo_omp.h b/src/USER-OMP/pair_rebo_omp.h index 8d6a6716ff..869675cde4 100644 --- a/src/USER-OMP/pair_rebo_omp.h +++ b/src/USER-OMP/pair_rebo_omp.h @@ -28,11 +28,12 @@ class PairREBOOMP : public PairAIREBOOMP { public: PairREBOOMP(class LAMMPS *); virtual void settings(int, char **); + protected: void spline_init(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_resquared_omp.h b/src/USER-OMP/pair_resquared_omp.h index 0da44ab779..b025364d4b 100644 --- a/src/USER-OMP/pair_resquared_omp.h +++ b/src/USER-OMP/pair_resquared_omp.h @@ -39,10 +39,10 @@ class PairRESquaredOMP : public PairRESquared, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_soft_omp.h b/src/USER-OMP/pair_soft_omp.h index 599bb29954..9275bff73e 100644 --- a/src/USER-OMP/pair_soft_omp.h +++ b/src/USER-OMP/pair_soft_omp.h @@ -39,10 +39,10 @@ class PairSoftOMP : public PairSoft, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_sw_omp.h b/src/USER-OMP/pair_sw_omp.h index ba43436fde..dfb3918e9e 100644 --- a/src/USER-OMP/pair_sw_omp.h +++ b/src/USER-OMP/pair_sw_omp.h @@ -38,11 +38,10 @@ class PairSWOMP : public PairSW, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_table_omp.h b/src/USER-OMP/pair_table_omp.h index 853c9bd481..cafa763e13 100644 --- a/src/USER-OMP/pair_table_omp.h +++ b/src/USER-OMP/pair_table_omp.h @@ -39,10 +39,10 @@ class PairTableOMP : public PairTable, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_mod_c_omp.h b/src/USER-OMP/pair_tersoff_mod_c_omp.h index 0ca644c481..aacab1fc74 100644 --- a/src/USER-OMP/pair_tersoff_mod_c_omp.h +++ b/src/USER-OMP/pair_tersoff_mod_c_omp.h @@ -34,10 +34,10 @@ class PairTersoffMODCOMP : public PairTersoffMODC, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_mod_omp.h b/src/USER-OMP/pair_tersoff_mod_omp.h index 39a43826c2..268d9e2bfa 100644 --- a/src/USER-OMP/pair_tersoff_mod_omp.h +++ b/src/USER-OMP/pair_tersoff_mod_omp.h @@ -34,10 +34,10 @@ class PairTersoffMODOMP : public PairTersoffMOD, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_omp.h b/src/USER-OMP/pair_tersoff_omp.h index cb52ec09d1..d06664d92e 100644 --- a/src/USER-OMP/pair_tersoff_omp.h +++ b/src/USER-OMP/pair_tersoff_omp.h @@ -34,10 +34,10 @@ class PairTersoffOMP : public PairTersoff, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_table_omp.h b/src/USER-OMP/pair_tersoff_table_omp.h index 0123037a82..9dd6ea930d 100644 --- a/src/USER-OMP/pair_tersoff_table_omp.h +++ b/src/USER-OMP/pair_tersoff_table_omp.h @@ -34,7 +34,6 @@ class PairTersoffTableOMP : public PairTersoffTable, public ThrOMP { virtual double memory_usage(); protected: - double ***thrGtetaFunction, ***thrGtetaFunctionDerived; double **thrCutoffFunction, **thrCutoffFunctionDerived; @@ -42,11 +41,10 @@ class PairTersoffTableOMP : public PairTersoffTable, public ThrOMP { void deallocatePreLoops(void); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.h b/src/USER-OMP/pair_tersoff_zbl_omp.h index c44f28534a..99e5aa75b4 100644 --- a/src/USER-OMP/pair_tersoff_zbl_omp.h +++ b/src/USER-OMP/pair_tersoff_zbl_omp.h @@ -29,17 +29,16 @@ class PairTersoffZBLOMP : public PairTersoffOMP { virtual ~PairTersoffZBLOMP() {} protected: - double global_a_0; // Bohr radius for Coulomb repulsion - double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion - double global_e; // proton charge (negative of electron charge) + double global_a_0; // Bohr radius for Coulomb repulsion + double global_epsilon_0; // permittivity of vacuum for Coulomb repulsion + double global_e; // proton charge (negative of electron charge) virtual void read_file(char *); virtual void repulsive(Param *, double, double &, int, double &); virtual void force_zeta(Param *, double, double, double &, double &, int, double &); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tip4p_cut_omp.h b/src/USER-OMP/pair_tip4p_cut_omp.h index 56df1ab923..bba48c4918 100644 --- a/src/USER-OMP/pair_tip4p_cut_omp.h +++ b/src/USER-OMP/pair_tip4p_cut_omp.h @@ -42,12 +42,11 @@ class PairTIP4PCutOMP : public PairTIP4PCut, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tip4p_long_omp.h b/src/USER-OMP/pair_tip4p_long_omp.h index 1c70a018c4..8a85204657 100644 --- a/src/USER-OMP/pair_tip4p_long_omp.h +++ b/src/USER-OMP/pair_tip4p_long_omp.h @@ -42,12 +42,11 @@ class PairTIP4PLongOMP : public PairTIP4PLong, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_tip4p_long_soft_omp.h b/src/USER-OMP/pair_tip4p_long_soft_omp.h index 45aa872474..349fdf5382 100644 --- a/src/USER-OMP/pair_tip4p_long_soft_omp.h +++ b/src/USER-OMP/pair_tip4p_long_soft_omp.h @@ -42,12 +42,11 @@ class PairTIP4PLongSoftOMP : public PairTIP4PLongSoft, public ThrOMP { dbl3_t *newsite_thr; int3_t *hneigh_thr; - template < int, int, int > void eval(int, int, ThrData *const); - void compute_newsite_thr(const dbl3_t &, const dbl3_t &, - const dbl3_t &, dbl3_t &) const; + template void eval(int, int, ThrData *const); + void compute_newsite_thr(const dbl3_t &, const dbl3_t &, const dbl3_t &, dbl3_t &) const; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_ufm_omp.h b/src/USER-OMP/pair_ufm_omp.h index eaa5980287..3a12f02861 100644 --- a/src/USER-OMP/pair_ufm_omp.h +++ b/src/USER-OMP/pair_ufm_omp.h @@ -41,10 +41,10 @@ class PairUFMOMP : public PairUFM, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_vashishta_omp.h b/src/USER-OMP/pair_vashishta_omp.h index ef7e88113f..c89a01ebf1 100644 --- a/src/USER-OMP/pair_vashishta_omp.h +++ b/src/USER-OMP/pair_vashishta_omp.h @@ -38,11 +38,10 @@ class PairVashishtaOMP : public PairVashishta, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_vashishta_table_omp.h b/src/USER-OMP/pair_vashishta_table_omp.h index 12d7361d7a..9c05307b45 100644 --- a/src/USER-OMP/pair_vashishta_table_omp.h +++ b/src/USER-OMP/pair_vashishta_table_omp.h @@ -38,11 +38,10 @@ class PairVashishtaTableOMP : public PairVashishtaTable, public ThrOMP { virtual double memory_usage(); private: - template - void eval(int ifrom, int ito, ThrData * const thr); + template void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.h b/src/USER-OMP/pair_yukawa_colloid_omp.h index 9b6884638a..7dcdf929b0 100644 --- a/src/USER-OMP/pair_yukawa_colloid_omp.h +++ b/src/USER-OMP/pair_yukawa_colloid_omp.h @@ -39,10 +39,10 @@ class PairYukawaColloidOMP : public PairYukawaColloid, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_yukawa_omp.h b/src/USER-OMP/pair_yukawa_omp.h index 955314e7a8..19ba10fe28 100644 --- a/src/USER-OMP/pair_yukawa_omp.h +++ b/src/USER-OMP/pair_yukawa_omp.h @@ -39,10 +39,10 @@ class PairYukawaOMP : public PairYukawa, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pair_zbl_omp.h b/src/USER-OMP/pair_zbl_omp.h index 63e59ba256..b304060ed2 100644 --- a/src/USER-OMP/pair_zbl_omp.h +++ b/src/USER-OMP/pair_zbl_omp.h @@ -39,10 +39,10 @@ class PairZBLOMP : public PairZBL, public ThrOMP { private: template - void eval(int ifrom, int ito, ThrData * const thr); + void eval(int ifrom, int ito, ThrData *const thr); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_cg_omp.h b/src/USER-OMP/pppm_cg_omp.h index 4e61cb4520..36f9e93035 100644 --- a/src/USER-OMP/pppm_cg_omp.h +++ b/src/USER-OMP/pppm_cg_omp.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PPPMCGOMP : public PPPMCG, public ThrOMP { public: PPPMCGOMP(class LAMMPS *); - virtual ~PPPMCGOMP (); + virtual ~PPPMCGOMP(); virtual void compute(int, int); protected: @@ -43,13 +43,13 @@ class PPPMCGOMP : public PPPMCG, public ThrOMP { virtual void fieldforce_peratom(); private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_disp_omp.h b/src/USER-OMP/pppm_disp_omp.h index a243f369a6..5679af1cef 100644 --- a/src/USER-OMP/pppm_disp_omp.h +++ b/src/USER-OMP/pppm_disp_omp.h @@ -25,10 +25,10 @@ KSpaceStyle(pppm/disp/omp,PPPMDispOMP); namespace LAMMPS_NS { - class PPPMDispOMP : public PPPMDisp, public ThrOMP { +class PPPMDispOMP : public PPPMDisp, public ThrOMP { public: PPPMDispOMP(class LAMMPS *); - virtual ~PPPMDispOMP (); + virtual ~PPPMDispOMP(); virtual void compute(int, int); protected: @@ -37,10 +37,8 @@ namespace LAMMPS_NS { virtual void compute_gf(); virtual void compute_gf_6(); - virtual void particle_map(double,double,double, - double,int**,int,int, - int,int,int,int,int,int); - + virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int); virtual void fieldforce_c_ik(); virtual void fieldforce_c_ad(); @@ -56,18 +54,15 @@ namespace LAMMPS_NS { virtual void make_rho_g(); virtual void make_rho_a(); - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); -// void compute_rho_coeff(); -// void slabcorr(int); - + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); + // void compute_rho_coeff(); + // void slabcorr(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_disp_tip4p_omp.h b/src/USER-OMP/pppm_disp_tip4p_omp.h index c64535edf5..20a7ceadf7 100644 --- a/src/USER-OMP/pppm_disp_tip4p_omp.h +++ b/src/USER-OMP/pppm_disp_tip4p_omp.h @@ -25,10 +25,10 @@ KSpaceStyle(pppm/disp/tip4p/omp,PPPMDispTIP4POMP); namespace LAMMPS_NS { - class PPPMDispTIP4POMP : public PPPMDispTIP4P, public ThrOMP { +class PPPMDispTIP4POMP : public PPPMDispTIP4P, public ThrOMP { public: PPPMDispTIP4POMP(class LAMMPS *); - virtual ~PPPMDispTIP4POMP (); + virtual ~PPPMDispTIP4POMP(); protected: virtual void allocate(); @@ -36,15 +36,13 @@ namespace LAMMPS_NS { virtual void compute_gf(); virtual void compute_gf_6(); - virtual void compute(int,int); + virtual void compute(int, int); - virtual void particle_map(double, double, double, - double, int **, int, int, - int, int, int, int, int, int); - virtual void particle_map_c(double, double, double, - double, int **, int, int, - int, int, int, int, int, int); - virtual void make_rho_c(); // XXX: not (yet) multi-threaded + virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, int, + int, int); + virtual void particle_map_c(double, double, double, double, int **, int, int, int, int, int, int, + int, int); + virtual void make_rho_c(); // XXX: not (yet) multi-threaded virtual void make_rho_g(); virtual void make_rho_a(); @@ -58,18 +56,15 @@ namespace LAMMPS_NS { virtual void fieldforce_a_ad(); virtual void fieldforce_a_peratom(); - private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &, - const int, FFT_SCALAR * const * const); + private: + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &, const int, FFT_SCALAR *const *const); virtual void find_M_thr(int, int &, int &, dbl3_t &); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_omp.h b/src/USER-OMP/pppm_omp.h index 6b43f4a5ba..8336101963 100644 --- a/src/USER-OMP/pppm_omp.h +++ b/src/USER-OMP/pppm_omp.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PPPMOMP : public PPPM, public ThrOMP { public: PPPMOMP(class LAMMPS *); - virtual ~PPPMOMP (); + virtual ~PPPMOMP(); virtual void compute(int, int); protected: @@ -43,15 +43,14 @@ class PPPMOMP : public PPPM, public ThrOMP { virtual void fieldforce_peratom(); private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); -// void slabcorr(int); - + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + // void slabcorr(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/pppm_tip4p_omp.h b/src/USER-OMP/pppm_tip4p_omp.h index 815fe8940a..8265c380a7 100644 --- a/src/USER-OMP/pppm_tip4p_omp.h +++ b/src/USER-OMP/pppm_tip4p_omp.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class PPPMTIP4POMP : public PPPMTIP4P, public ThrOMP { public: PPPMTIP4POMP(class LAMMPS *); - virtual ~PPPMTIP4POMP (); + virtual ~PPPMTIP4POMP(); virtual void compute(int, int); protected: @@ -38,25 +38,24 @@ class PPPMTIP4POMP : public PPPMTIP4P, public ThrOMP { virtual void compute_gf_ad(); virtual void particle_map(); - virtual void make_rho(); // XXX: not (yet) multi-threaded + virtual void make_rho(); // XXX: not (yet) multi-threaded virtual void fieldforce_ik(); virtual void fieldforce_ad(); // virtual void fieldforce_peratom(); XXX: need to benchmark first. private: - void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); - void compute_drho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &, - const FFT_SCALAR &, const FFT_SCALAR &); + void compute_rho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); + void compute_drho1d_thr(FFT_SCALAR *const *const, const FFT_SCALAR &, const FFT_SCALAR &, + const FFT_SCALAR &); void find_M_thr(const int, int &, int &, dbl3_t &); -// void slabcorr(int); // XXX: not (yet) multi-threaded - + // void slabcorr(int); // XXX: not (yet) multi-threaded }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/reaxc_bond_orders_omp.h b/src/USER-OMP/reaxc_bond_orders_omp.h index 2027a8628e..46dc25148d 100644 --- a/src/USER-OMP/reaxc_bond_orders_omp.h +++ b/src/USER-OMP/reaxc_bond_orders_omp.h @@ -31,14 +31,14 @@ #include "reaxc_types.h" -void Add_dBond_to_ForcesOMP( reax_system*, int, int, storage*, reax_list** ); -void Add_dBond_to_Forces_NPTOMP( reax_system *system, int, int, - simulation_data*, storage*, reax_list** ); +void Add_dBond_to_ForcesOMP(reax_system *, int, int, storage *, reax_list **); +void Add_dBond_to_Forces_NPTOMP(reax_system *system, int, int, simulation_data *, storage *, + reax_list **); -int BOp_OMP(storage*, reax_list*, double, int, int, far_neighbor_data*, - single_body_parameters*, single_body_parameters*, two_body_parameters*, - int, double, double, double, double, double, double, double); +int BOp_OMP(storage *, reax_list *, double, int, int, far_neighbor_data *, single_body_parameters *, + single_body_parameters *, two_body_parameters *, int, double, double, double, double, + double, double, double); -void BOOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void BOOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_bonds_omp.h b/src/USER-OMP/reaxc_bonds_omp.h index e5fb0f99e1..19403c35da 100644 --- a/src/USER-OMP/reaxc_bonds_omp.h +++ b/src/USER-OMP/reaxc_bonds_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void BondsOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void BondsOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_forces_omp.h b/src/USER-OMP/reaxc_forces_omp.h index 6df0288656..c42aed1282 100644 --- a/src/USER-OMP/reaxc_forces_omp.h +++ b/src/USER-OMP/reaxc_forces_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void Init_Force_FunctionsOMP( control_params* ); -void Compute_ForcesOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls*, mpi_datatypes* ); +void Init_Force_FunctionsOMP(control_params *); +void Compute_ForcesOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *, mpi_datatypes *); #endif diff --git a/src/USER-OMP/reaxc_hydrogen_bonds_omp.h b/src/USER-OMP/reaxc_hydrogen_bonds_omp.h index 8c3d04448a..3703b09058 100644 --- a/src/USER-OMP/reaxc_hydrogen_bonds_omp.h +++ b/src/USER-OMP/reaxc_hydrogen_bonds_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void Hydrogen_BondsOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Hydrogen_BondsOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_init_md_omp.h b/src/USER-OMP/reaxc_init_md_omp.h index 45478ec632..c4292ae4c0 100644 --- a/src/USER-OMP/reaxc_init_md_omp.h +++ b/src/USER-OMP/reaxc_init_md_omp.h @@ -33,6 +33,6 @@ #include -void InitializeOMP( reax_system*, control_params*, simulation_data*, storage*, - reax_list**, output_controls*, mpi_datatypes*, MPI_Comm ); +void InitializeOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *, mpi_datatypes *, MPI_Comm); #endif diff --git a/src/USER-OMP/reaxc_multi_body_omp.h b/src/USER-OMP/reaxc_multi_body_omp.h index 772aafbb31..c5e7de6b57 100644 --- a/src/USER-OMP/reaxc_multi_body_omp.h +++ b/src/USER-OMP/reaxc_multi_body_omp.h @@ -31,7 +31,7 @@ #include "reaxc_types.h" -void Atom_EnergyOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Atom_EnergyOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_nonbonded_omp.h b/src/USER-OMP/reaxc_nonbonded_omp.h index a5d895533a..779642b83d 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.h +++ b/src/USER-OMP/reaxc_nonbonded_omp.h @@ -31,10 +31,9 @@ #include "reaxc_types.h" -void vdW_Coulomb_Energy_OMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void vdW_Coulomb_Energy_OMP(reax_system *, control_params *, simulation_data *, storage *, + reax_list **, output_controls *); -void Tabulated_vdW_Coulomb_Energy_OMP( reax_system*, control_params*, - simulation_data*, storage*, - reax_list**, output_controls* ); +void Tabulated_vdW_Coulomb_Energy_OMP(reax_system *, control_params *, simulation_data *, storage *, + reax_list **, output_controls *); #endif diff --git a/src/USER-OMP/reaxc_torsion_angles_omp.h b/src/USER-OMP/reaxc_torsion_angles_omp.h index 62cb760f41..4b62f90241 100644 --- a/src/USER-OMP/reaxc_torsion_angles_omp.h +++ b/src/USER-OMP/reaxc_torsion_angles_omp.h @@ -29,10 +29,10 @@ #ifndef __TORSION_ANGLES_OMP_H_ #define __TORSION_ANGLES_OMP_H_ -#include "reaxc_types.h" #include "reaxc_torsion_angles.h" +#include "reaxc_types.h" -void Torsion_AnglesOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Torsion_AnglesOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); #endif diff --git a/src/USER-OMP/reaxc_valence_angles_omp.h b/src/USER-OMP/reaxc_valence_angles_omp.h index 5a8d992b0d..f1a4fef505 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.h +++ b/src/USER-OMP/reaxc_valence_angles_omp.h @@ -31,9 +31,9 @@ #include "reaxc_types.h" -void Valence_AnglesOMP( reax_system*, control_params*, simulation_data*, - storage*, reax_list**, output_controls* ); +void Valence_AnglesOMP(reax_system *, control_params *, simulation_data *, storage *, reax_list **, + output_controls *); -void Calculate_dCos_ThetaOMP( rvec, double, rvec, double, rvec*, rvec*, rvec* ); +void Calculate_dCos_ThetaOMP(rvec, double, rvec, double, rvec *, rvec *, rvec *); #endif diff --git a/src/USER-OMP/respa_omp.h b/src/USER-OMP/respa_omp.h index c33fce1d37..e7d6cd2e5a 100644 --- a/src/USER-OMP/respa_omp.h +++ b/src/USER-OMP/respa_omp.h @@ -37,7 +37,7 @@ class RespaOMP : public Respa, public ThrOMP { virtual void recurse(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-OMP/thr_data.h b/src/USER-OMP/thr_data.h index 1ec198c726..7f48da63ab 100644 --- a/src/USER-OMP/thr_data.h +++ b/src/USER-OMP/thr_data.h @@ -31,14 +31,21 @@ class ThrData { public: ThrData(int tid, class Timer *t); - ~ThrData() { delete _timer; _timer = nullptr; }; + ~ThrData() + { + delete _timer; + _timer = nullptr; + }; - void check_tid(int); // thread id consistency check - int get_tid() const { return _tid; }; // our thread id. + void check_tid(int); // thread id consistency check + int get_tid() const { return _tid; }; // our thread id. // inline wrapper, to make this more efficient // when per-thread timers are off - void timer(enum Timer::ttype flag) { if (_timer) _stamp(flag); }; + void timer(enum Timer::ttype flag) + { + if (_timer) _stamp(flag); + }; double get_time(enum Timer::ttype flag); // erase accumulator contents and hook up force arrays @@ -51,9 +58,9 @@ class ThrData { double *get_drho() const { return _drho; }; // setup and erase per atom arrays - void init_adp(int, double *, double **, double **); // ADP (+ EAM) - void init_eam(int, double *); // EAM - void init_eim(int, double *, double *); // EIM (+ EAM) + void init_adp(int, double *, double **, double **); // ADP (+ EAM) + void init_eam(int, double *); // EAM + void init_eim(int, double *, double *); // EIM (+ EAM) void init_pppm(int, class Memory *); void init_pppm_disp(int, class Memory *); @@ -71,19 +78,19 @@ class ThrData { void *get_drho1d_6() const { return _drho1d_6; }; private: - double eng_vdwl; // non-bonded non-coulomb energy - double eng_coul; // non-bonded coulomb energy - double eng_bond; // bond energy - double eng_angle; // angle energy - double eng_dihed; // dihedral energy - double eng_imprp; // improper energy - double eng_kspce; // kspace energy - double virial_pair[6]; // virial contribution from non-bonded - double virial_bond[6]; // virial contribution from bonds - double virial_angle[6]; // virial contribution from angles - double virial_dihed[6]; // virial contribution from dihedrals - double virial_imprp[6]; // virial contribution from impropers - double virial_kspce[6]; // virial contribution from kspace + double eng_vdwl; // non-bonded non-coulomb energy + double eng_coul; // non-bonded coulomb energy + double eng_bond; // bond energy + double eng_angle; // angle energy + double eng_dihed; // dihedral energy + double eng_imprp; // improper energy + double eng_kspce; // kspace energy + double virial_pair[6]; // virial contribution from non-bonded + double virial_bond[6]; // virial contribution from bonds + double virial_angle[6]; // virial contribution from angles + double virial_dihed[6]; // virial contribution from dihedrals + double virial_imprp[6]; // virial contribution from impropers + double virial_kspce[6]; // virial contribution from kspace double *eatom_pair; double *eatom_bond; double *eatom_angle; @@ -111,10 +118,10 @@ class ThrData { double *_drho; // these are maintained by individual pair styles - double **_mu, **_lambda; // ADP (+ EAM) - double *_rhoB, *_D_values; // CDEAM (+ EAM) - double *_rho; // EAM - double *_fp; // EIM (+ EAM) + double **_mu, **_lambda; // ADP (+ EAM) + double *_rhoB, *_D_values; // CDEAM (+ EAM) + double *_rho; // EAM + double *_fp; // EIM (+ EAM) // this is for pppm/omp void *_rho1d; @@ -137,9 +144,9 @@ class ThrData { double memory_usage(); - // disabled default methods + // disabled default methods private: - ThrData() : _tid(-1), _timer(nullptr) {}; + ThrData() : _tid(-1), _timer(nullptr){}; }; //////////////////////////////////////////////////////////////////////// @@ -147,5 +154,5 @@ class ThrData { //////////////////////////////////////////////////////////////////////// // generic per thread data reduction for continuous arrays of nthreads*nmax size void data_reduce_thr(double *, int, int, int, int); -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-OMP/thr_omp.h b/src/USER-OMP/thr_omp.h index 966970eb4d..cd6c71e5d0 100644 --- a/src/USER-OMP/thr_omp.h +++ b/src/USER-OMP/thr_omp.h @@ -21,10 +21,10 @@ #if defined(_OPENMP) #include #endif -#include "pointers.h" #include "error.h" -#include "fix_omp.h" // IWYU pragma: export -#include "thr_data.h" // IWYU pragma: export +#include "fix_omp.h" // IWYU pragma: export +#include "pointers.h" +#include "thr_data.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -38,8 +38,8 @@ class Improper; class ThrOMP { protected: - LAMMPS *lmp; // reference to base lammps object. - FixOMP *fix; // pointer to fix_omp; + LAMMPS *lmp; // reference to base lammps object. + FixOMP *fix; // pointer to fix_omp; const int thr_style; int thr_error; @@ -50,30 +50,39 @@ class ThrOMP { double memory_usage_thr(); - inline void sync_threads() { + inline void sync_threads() + { #if defined(_OPENMP) #pragma omp barrier #endif - { ; } - }; + { + ; + } + }; - enum {THR_NONE=0,THR_PAIR=1,THR_BOND=1<<1,THR_ANGLE=1<<2, - THR_DIHEDRAL=1<<3,THR_IMPROPER=1<<4,THR_KSPACE=1<<5, - THR_CHARMM=1<<6, /*THR_PROXY=1<<7,THR_HYBRID=1<<8, */ - THR_FIX=1<<9,THR_INTGR=1<<10}; + enum { + THR_NONE = 0, + THR_PAIR = 1, + THR_BOND = 1 << 1, + THR_ANGLE = 1 << 2, + THR_DIHEDRAL = 1 << 3, + THR_IMPROPER = 1 << 4, + THR_KSPACE = 1 << 5, + THR_CHARMM = 1 << 6, /*THR_PROXY=1<<7,THR_HYBRID=1<<8, */ + THR_FIX = 1 << 9, + THR_INTGR = 1 << 10 + }; protected: // extra ev_tally setup work for threaded styles void ev_setup_thr(int, int, int, double *, double **, double **, ThrData *); // compute global per thread virial contribution from per-thread force - void virial_fdotr_compute_thr(double * const, const double * const * const, - const double * const * const, - const int, const int, const int); + void virial_fdotr_compute_thr(double *const, const double *const *const, + const double *const *const, const int, const int, const int); // reduce per thread data as needed - void reduce_thr(void * const style, const int eflag, const int vflag, - ThrData * const thr); + void reduce_thr(void *const style, const int eflag, const int vflag, ThrData *const thr); // thread safe variant error abort support. // signals an error condition in any thread by making @@ -83,105 +92,103 @@ class ThrOMP { // returns false if no error found on any thread. // use return value to jump/return to end of threaded region. - bool check_error_thr(const bool cond, const int tid, const char *fname, - const int line, const char *errmsg) { + bool check_error_thr(const bool cond, const int tid, const char *fname, const int line, + const char *errmsg) + { if (cond) { #if defined(_OPENMP) #pragma omp atomic ++thr_error; #endif - if (tid > 0) return true; - else lmp->error->one(fname,line,errmsg); + if (tid > 0) + return true; + else + lmp->error->one(fname, line, errmsg); } else { if (thr_error > 0) { - if (tid == 0) lmp->error->one(fname,line,errmsg); - else return true; - } else return false; + if (tid == 0) + lmp->error->one(fname, line, errmsg); + else + return true; + } else + return false; } return false; }; protected: - // threading adapted versions of the ev_tally infrastructure // style specific versions (need access to style class flags) // Pair - void e_tally_thr(Pair * const, const int, const int, const int, - const int, const double, const double, ThrData * const); - void v_tally_thr(Pair * const, const int, const int, const int, - const int, const double * const, ThrData * const); + void e_tally_thr(Pair *const, const int, const int, const int, const int, const double, + const double, ThrData *const); + void v_tally_thr(Pair *const, const int, const int, const int, const int, const double *const, + ThrData *const); - void ev_tally_thr(Pair * const, const int, const int, const int, const int, - const double, const double, const double, const double, - const double, const double, ThrData * const); - void ev_tally_xyz_thr(Pair * const, const int, const int, const int, - const int, const double, const double, const double, - const double, const double, const double, - const double, const double, ThrData * const); - void ev_tally_xyz_full_thr(Pair * const, const int, const double, const double, - const double, const double, const double, - const double, const double, const double, ThrData * const); - void ev_tally3_thr(Pair * const, const int, const int, const int, const double, - const double, const double * const, const double * const, - const double * const, const double * const, ThrData * const); - void ev_tally4_thr(Pair * const, const int, const int, const int, const int, - const double, const double * const, const double * const, - const double * const, const double * const, const double * const, - const double * const, ThrData * const); + void ev_tally_thr(Pair *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, const double, + ThrData *const); + void ev_tally_xyz_thr(Pair *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, const double, + const double, const double, ThrData *const); + void ev_tally_xyz_full_thr(Pair *const, const int, const double, const double, const double, + const double, const double, const double, const double, const double, + ThrData *const); + void ev_tally3_thr(Pair *const, const int, const int, const int, const double, const double, + const double *const, const double *const, const double *const, + const double *const, ThrData *const); + void ev_tally4_thr(Pair *const, const int, const int, const int, const int, const double, + const double *const, const double *const, const double *const, + const double *const, const double *const, const double *const, ThrData *const); // Bond - void ev_tally_thr(Bond * const, const int, const int, const int, const int, - const double, const double, const double, const double, - const double, ThrData * const); + void ev_tally_thr(Bond *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, ThrData *const); // Angle - void ev_tally_thr(Angle * const, const int, const int, const int, const int, const int, - const double, const double * const, const double * const, + void ev_tally_thr(Angle *const, const int, const int, const int, const int, const int, + const double, const double *const, const double *const, const double, const double, const double, const double, const double, const double, - const double, ThrData * const thr); - void ev_tally13_thr(Angle * const, const int, const int, const int, const int, - const double, const double, const double, const double, - const double, ThrData * const thr); + ThrData *const thr); + void ev_tally13_thr(Angle *const, const int, const int, const int, const int, const double, + const double, const double, const double, const double, ThrData *const thr); // Dihedral - void ev_tally_thr(Dihedral * const, const int, const int, const int, const int, const int, - const int, const double, const double * const, const double * const, - const double * const, const double, const double, const double, + void ev_tally_thr(Dihedral *const, const int, const int, const int, const int, const int, + const int, const double, const double *const, const double *const, + const double *const, const double, const double, const double, const double, const double, const double, const double, const double, const double, - const double, ThrData * const); + ThrData *const); // Improper - void ev_tally_thr(Improper * const, const int, const int, const int, const int, const int, - const int, const double, const double * const, const double * const, - const double * const, const double, const double, const double, + void ev_tally_thr(Improper *const, const int, const int, const int, const int, const int, + const int, const double, const double *const, const double *const, + const double *const, const double, const double, const double, const double, const double, const double, const double, const double, const double, - const double, ThrData * const); + ThrData *const); // style independent versions - void v_tally2_thr(const int, const int, const double, const double * const, ThrData * const); - void v_tally3_thr(const int, const int, const int, const double * const, const double * const, - const double * const, const double * const, ThrData * const); - void v_tally4_thr(const int, const int, const int, const int, const double * const, - const double * const, const double * const, const double * const, - const double * const, const double * const, ThrData * const); - void ev_tally_list_thr(Pair * const, const int, const int * const, - const double * const, const double, const double, - ThrData * const); - + void v_tally2_thr(const int, const int, const double, const double *const, ThrData *const); + void v_tally3_thr(const int, const int, const int, const double *const, const double *const, + const double *const, const double *const, ThrData *const); + void v_tally4_thr(const int, const int, const int, const int, const double *const, + const double *const, const double *const, const double *const, + const double *const, const double *const, ThrData *const); + void ev_tally_list_thr(Pair *const, const int, const int *const, const double *const, + const double, const double, ThrData *const); }; // set loop range thread id, and force array offset for threaded runs. -static inline void loop_setup_thr(int &ifrom, int &ito, int &tid, - int inum, int nthreads) +static inline void loop_setup_thr(int &ifrom, int &ito, int &tid, int inum, int nthreads) { #if defined(_OPENMP) tid = omp_get_thread_num(); // each thread works on a fixed chunk of atoms. - const int idelta = 1 + inum/nthreads; - ifrom = tid*idelta; - ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; + const int idelta = 1 + inum / nthreads; + ifrom = tid * idelta; + ito = ((ifrom + idelta) > inum) ? inum : ifrom + idelta; #else tid = 0; ifrom = 0; @@ -192,12 +199,22 @@ static inline void loop_setup_thr(int &ifrom, int &ito, int &tid, // helpful definitions to help compilers optimizing code better -typedef struct { double x,y,z; } dbl3_t; -typedef struct { double x,y,z,w; } dbl4_t; -typedef struct { int a,b,t; } int3_t; -typedef struct { int a,b,c,t; } int4_t; -typedef struct { int a,b,c,d,t; } int5_t; +typedef struct { + double x, y, z; +} dbl3_t; +typedef struct { + double x, y, z, w; +} dbl4_t; +typedef struct { + int a, b, t; +} int3_t; +typedef struct { + int a, b, c, t; +} int4_t; +typedef struct { + int a, b, c, d, t; +} int5_t; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-PACE/pair_pace.h b/src/USER-PACE/pair_pace.h index dcb639adff..43c681911e 100644 --- a/src/USER-PACE/pair_pace.h +++ b/src/USER-PACE/pair_pace.h @@ -19,12 +19,10 @@ Copyright 2021 Yury Lysogorskiy^1, Cas van der Oord^2, Anton Bochkarev^1, ^4: University of British Columbia, Vancouver, BC, Canada */ - // // Created by Lysogorskiy Yury on 27.02.20. // - #ifdef PAIR_CLASS // clang-format off PairStyle(pace,PairPACE); @@ -57,9 +55,9 @@ class PairPACE : public Pair { virtual void allocate(); double **scale; - bool recursive; // "recursive" option for ACERecursiveEvaluator + bool recursive; // "recursive" option for ACERecursiveEvaluator }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-PHONON/dynamical_matrix.h b/src/USER-PHONON/dynamical_matrix.h index 59b0d4f160..cc70cd026e 100644 --- a/src/USER-PHONON/dynamical_matrix.h +++ b/src/USER-PHONON/dynamical_matrix.h @@ -23,21 +23,20 @@ class DynamicalMatrix : public Command { void setup(); protected: - int eflag,vflag; // flags for energy/virial computation - int external_force_clear; // clear forces locally or externally + int eflag, vflag; // flags for energy/virial computation + int external_force_clear; // clear forces locally or externally - - int triclinic; // 0 if domain is orthog, 1 if triclinic + int triclinic; // 0 if domain is orthog, 1 if triclinic int pairflag; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int nvec; // local atomic dof = length of xvec + int nvec; // local atomic dof = length of xvec void update_force(); void force_clear(); - virtual void openfile(const char* filename); + virtual void openfile(const char *filename); private: void options(int, char **); @@ -53,22 +52,21 @@ class DynamicalMatrix : public Command { double conv_distance; double conv_mass; double del; - int igroup,groupbit; - bigint gcount; // number of atoms in group - bigint dynlen; // rank of dynamical matrix + int igroup, groupbit; + bigint gcount; // number of atoms in group + bigint dynlen; // rank of dynamical matrix int scaleflag; int me; bigint *groupmap; - int compressed; // 1 if dump file is written compressed, 0 no - int binaryflag; // 1 if dump file is written binary, 0 no - int file_opened; // 1 if openfile method has been called, 0 no - int file_flag; // 1 custom file name, 0 dynmat.dat + int compressed; // 1 if dump file is written compressed, 0 no + int binaryflag; // 1 if dump file is written binary, 0 no + int file_opened; // 1 if openfile method has been called, 0 no + int file_flag; // 1 custom file name, 0 dynmat.dat FILE *fp; }; -} +} // namespace LAMMPS_NS - -#endif //LMP_DYNAMICAL_MATRIX_H +#endif //LMP_DYNAMICAL_MATRIX_H #endif diff --git a/src/USER-PHONON/fix_phonon.h b/src/USER-PHONON/fix_phonon.h index d9b67293e6..0e3c251528 100644 --- a/src/USER-PHONON/fix_phonon.h +++ b/src/USER-PHONON/fix_phonon.h @@ -40,8 +40,8 @@ typedef double FFT_SCALAR; #define MPI_FFT_SCALAR MPI_DOUBLE #endif -#include #include "fix.h" +#include #include namespace LAMMPS_NS { @@ -51,7 +51,7 @@ class FixPhonon : public Fix { FixPhonon(class LAMMPS *, int, char **); ~FixPhonon(); - int setmask(); + int setmask(); void init(); void setup(int); void end_of_step(); @@ -60,66 +60,66 @@ class FixPhonon : public Fix { int modify_param(int, char **); private: - int me,nprocs; - bigint waitsteps; // wait these number of timesteps before recording atom positions - bigint prev_nstep; // number of steps from previous run(s); to judge if waitsteps is reached. - int nfreq, ifreq; // after this number of measurement (nfreq), the result will be output once - int nx,ny,nz,nucell,ntotal; // surface dimensions in x- and y-direction, number of atom per unit surface cell - int neval; // # of evaluations - int sysdim; // system dimension - int ngroup, nfind; // total number of atoms in group; total number of atoms on this proc - char *prefix, *logfile; // prefix of output file names + int me, nprocs; + bigint waitsteps; // wait these number of timesteps before recording atom positions + bigint prev_nstep; // number of steps from previous run(s); to judge if waitsteps is reached. + int nfreq, ifreq; // after this number of measurement (nfreq), the result will be output once + int nx, ny, nz, nucell, + ntotal; // surface dimensions in x- and y-direction, number of atom per unit surface cell + int neval; // # of evaluations + int sysdim; // system dimension + int ngroup, nfind; // total number of atoms in group; total number of atoms on this proc + char *prefix, *logfile; // prefix of output file names FILE *flog; double *M_inv_sqrt; - class FFT3d *fft; // to do fft via the fft3d wrapper - int nxlo,nxhi,mysize; // size info for local MPI_FFTW - int mynpt,mynq,fft_nsend; + class FFT3d *fft; // to do fft via the fft3d wrapper + int nxlo, nxhi, mysize; // size info for local MPI_FFTW + int mynpt, mynq, fft_nsend; int *fft_cnts, *fft_disp; int fft_dim, fft_dim2; FFT_SCALAR *fft_data; - tagint itag; // index variables - int idx, idq; // more index variables - std::map tag2surf; // Mapping info - std::map surf2tag; // more Mapping info + tagint itag; // index variables + int idx, idq; // more index variables + std::map tag2surf; // Mapping info + std::map surf2tag; // more Mapping info - double **RIloc; // R(r) and index on local proc - double **RIall; // gathered R(r) and index - double **Rsort; // sorted R(r) - double **Rnow; // Current R(r) on local proc - double **Rsum; // Accumulated R(r) on local proc + double **RIloc; // R(r) and index on local proc + double **RIall; // gathered R(r) and index + double **Rsort; // sorted R(r) + double **Rnow; // Current R(r) on local proc + double **Rsum; // Accumulated R(r) on local proc - int *recvcnts, *displs; // MPI related variables + int *recvcnts, *displs; // MPI related variables - std::complex **Rqnow; // Current R(q) on local proc - std::complex **Rqsum; // Accumulator for conj(R(q)_alpha)*R(q)_beta - std::complex **Phi_q; // Phi's on local proc - std::complex **Phi_all; // Phi for all + std::complex **Rqnow; // Current R(q) on local proc + std::complex **Rqsum; // Accumulator for conj(R(q)_alpha)*R(q)_beta + std::complex **Phi_q; // Phi's on local proc + std::complex **Phi_all; // Phi for all - void readmap(); // to read the mapping of gf atoms - char *mapfile; // file name of the map file + void readmap(); // to read the mapping of gf atoms + char *mapfile; // file name of the map file - void getmass(); // to get the mass of each atom in a unit cell + void getmass(); // to get the mass of each atom in a unit cell int nasr; - void postprocess(); // to post process the data - void EnforceASR(); // to apply acoustic sum rule to gamma point force constant matrix + void postprocess(); // to post process the data + void EnforceASR(); // to apply acoustic sum rule to gamma point force constant matrix - char *id_temp; // compute id for temperature - double *TempSum; // to get the average temperature vector - double inv_nTemp; // inverse of number of atoms in temperature group - class Compute *temperature; // compute that computes the temperature + char *id_temp; // compute id for temperature + double *TempSum; // to get the average temperature vector + double inv_nTemp; // inverse of number of atoms in temperature group + class Compute *temperature; // compute that computes the temperature double hsum[6], **basis; int *basetype; // private methods to do matrix inversion - void GaussJordan(int, std::complex*); - + void GaussJordan(int, std::complex *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-PHONON/third_order.h b/src/USER-PHONON/third_order.h index e5bd07e7ad..fa8741cfc6 100644 --- a/src/USER-PHONON/third_order.h +++ b/src/USER-PHONON/third_order.h @@ -2,7 +2,6 @@ // Created by charlie sievers on 7/5/18. // - #ifdef COMMAND_CLASS // clang-format off CommandStyle(third_order,ThirdOrder); @@ -16,61 +15,57 @@ CommandStyle(third_order,ThirdOrder); namespace LAMMPS_NS { - class ThirdOrder : public Command { - public: - ThirdOrder(class LAMMPS *); - virtual ~ThirdOrder(); - void command(int, char **); - void setup(); +class ThirdOrder : public Command { + public: + ThirdOrder(class LAMMPS *); + virtual ~ThirdOrder(); + void command(int, char **); + void setup(); - protected: - int eflag,vflag; // flags for energy/virial computation - int external_force_clear; // clear forces locally or externally + protected: + int eflag, vflag; // flags for energy/virial computation + int external_force_clear; // clear forces locally or externally + int triclinic; // 0 if domain is orthog, 1 if triclinic + int pairflag; - int triclinic; // 0 if domain is orthog, 1 if triclinic - int pairflag; + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int nvec; // local atomic dof = length of xvec - int nvec; // local atomic dof = length of xvec + void update_force(); + void force_clear(); + virtual void openfile(const char *filename); - void update_force(); - void force_clear(); - virtual void openfile(const char* filename); + private: + void options(int, char **); + void create_groupmap(); + void calculateMatrix(); + void convert_units(const char *style); + void displace_atom(int local_idx, int direction, int magnitude); + void writeMatrix(double *, bigint, int, bigint, int); + double conversion; + double conv_energy; + double conv_distance; + double conv_mass; + double del; + int igroup, groupbit; + bigint dynlen; + int scaleflag; + int me; + bigint gcount; // number of atoms in group + bigint *groupmap; - private: - void options(int, char **); - void create_groupmap(); - void calculateMatrix(); - void convert_units(const char *style); - void displace_atom(int local_idx, int direction, int magnitude); - void writeMatrix(double *, bigint, int, bigint, int); + int compressed; // 1 if dump file is written compressed, 0 no + int binaryflag; // 1 if dump file is written binary, 0 no + int file_opened; // 1 if openfile method has been called, 0 no + int file_flag; // 1 custom file name, 0 dynmat.dat - double conversion; - double conv_energy; - double conv_distance; - double conv_mass; - double del; - int igroup,groupbit; - bigint dynlen; - int scaleflag; - int me; - bigint gcount; // number of atoms in group - bigint *groupmap; + FILE *fp; +}; +} // namespace LAMMPS_NS - int compressed; // 1 if dump file is written compressed, 0 no - int binaryflag; // 1 if dump file is written binary, 0 no - int file_opened; // 1 if openfile method has been called, 0 no - int file_flag; // 1 custom file name, 0 dynmat.dat - - FILE *fp; - }; -} - - -#endif //LMP_THIRD_ORDER_H +#endif //LMP_THIRD_ORDER_H #endif - diff --git a/src/USER-PLUMED/fix_plumed.h b/src/USER-PLUMED/fix_plumed.h index 919fc4568f..e88d619c68 100644 --- a/src/USER-PLUMED/fix_plumed.h +++ b/src/USER-PLUMED/fix_plumed.h @@ -24,7 +24,7 @@ FixStyle(plumed,FixPlumed); // forward declaration namespace PLMD { - class Plumed; +class Plumed; } namespace LAMMPS_NS { @@ -46,23 +46,22 @@ class FixPlumed : public Fix { double memory_usage(); private: - - PLMD::Plumed *p; // pointer to plumed object - int nlocal; // number of atoms local to this process - int natoms; // total number of atoms - int *gatindex; // array of atom indexes local to this process - double *masses; // array of masses for local atoms - double *charges; // array of charges for local atoms - int nlevels_respa; // this is something to enable respa - double bias; // output bias potential - class Compute *c_pe; // Compute for the energy - class Compute *c_press; // Compute for the pressure - int plumedNeedsEnergy; // Flag to trigger calculation of the - // energy and virial - char *id_pe, *id_press; // ID for potential energy and pressure compute + PLMD::Plumed *p; // pointer to plumed object + int nlocal; // number of atoms local to this process + int natoms; // total number of atoms + int *gatindex; // array of atom indexes local to this process + double *masses; // array of masses for local atoms + double *charges; // array of charges for local atoms + int nlevels_respa; // this is something to enable respa + double bias; // output bias potential + class Compute *c_pe; // Compute for the energy + class Compute *c_press; // Compute for the pressure + int plumedNeedsEnergy; // Flag to trigger calculation of the + // energy and virial + char *id_pe, *id_press; // ID for potential energy and pressure compute }; -}; +}; // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-QMMM/fix_qmmm.h b/src/USER-QMMM/fix_qmmm.h index ebf2756aca..b0e8e15a7f 100644 --- a/src/USER-QMMM/fix_qmmm.h +++ b/src/USER-QMMM/fix_qmmm.h @@ -11,7 +11,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS // clang-format off FixStyle(qmmm,FixQMMM); @@ -47,35 +46,35 @@ class FixQMMM : public Fix { int ec_fill_radii(double *, int); protected: - MPI_Comm qm_comm; // intra communicator with QM subsystem - MPI_Comm mm_comm; // intra communicator with MM subsystem - void *comm_buf; // message buffer for internal communication - void *qm_idmap; // hash for mapping QM atom indices to consistent order. - tagint *qm_remap; // list of the hash keys for reverse mapping. - void *mm_idmap; // hash for mapping MM atom indices to consistent order. - tagint *mm_remap; // list of the hash keys for reverse mapping. - double *qm_coord; // QM system coordinates - double *qm_charge; // QM system charges - double *mm_coord; // MM system coordinates used for electrostatic coupling - int *mm_type; // system atom types used for electrostatic coupling - double *qm_force; // QM force data buffer - double *mm_force; // MM slave force data buffer - double qmmm_fscale; // scale factor for forces. in case VMD's units are off. + MPI_Comm qm_comm; // intra communicator with QM subsystem + MPI_Comm mm_comm; // intra communicator with MM subsystem + void *comm_buf; // message buffer for internal communication + void *qm_idmap; // hash for mapping QM atom indices to consistent order. + tagint *qm_remap; // list of the hash keys for reverse mapping. + void *mm_idmap; // hash for mapping MM atom indices to consistent order. + tagint *mm_remap; // list of the hash keys for reverse mapping. + double *qm_coord; // QM system coordinates + double *qm_charge; // QM system charges + double *mm_coord; // MM system coordinates used for electrostatic coupling + int *mm_type; // system atom types used for electrostatic coupling + double *qm_force; // QM force data buffer + double *mm_force; // MM slave force data buffer + double qmmm_fscale; // scale factor for forces. in case VMD's units are off. - int num_qm; // total number of QM atoms controlled by this fix - int num_mm; // total number of MM atoms for electrostatic coupling - int mm_group; // group of MM atoms for electrostatic coupling - int mm_grbit; // group of MM atoms for electrostatic coupling - int comm_mode; // QM/MM communication method (MPI or shmemq) - int qmmm_mode; // QM/MM coupling mode (mechanical or electrostatic) - int qmmm_role; // role in QM/MM coupling (MM master or MM slave) - int size_one; // size of one element in communication buffer - int maxbuf; // size of communication buffer - int do_init; // flag for one time initialization - int verbose; // print level (<= 0 means no output) + int num_qm; // total number of QM atoms controlled by this fix + int num_mm; // total number of MM atoms for electrostatic coupling + int mm_group; // group of MM atoms for electrostatic coupling + int mm_grbit; // group of MM atoms for electrostatic coupling + int comm_mode; // QM/MM communication method (MPI or shmemq) + int qmmm_mode; // QM/MM coupling mode (mechanical or electrostatic) + int qmmm_role; // role in QM/MM coupling (MM master or MM slave) + int size_one; // size of one element in communication buffer + int maxbuf; // size of communication buffer + int do_init; // flag for one time initialization + int verbose; // print level (<= 0 means no output) }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-QTB/fix_qbmsst.h b/src/USER-QTB/fix_qbmsst.h index ceda70bb0c..e0f6b3be40 100644 --- a/src/USER-QTB/fix_qbmsst.h +++ b/src/USER-QTB/fix_qbmsst.h @@ -51,58 +51,59 @@ class FixQBMSST : public Fix { private: // msst parameters - int direction; // Direction of shock - double velocity; // Velocity of the shock - double qmass; // Effective cell mass - double mu; // Effective cell viscosity - double e0; // Initial energy - double v0; // Initial volume - double p0; // Initial pressure - int p0_set; // Is pressure set - int v0_set; // Is volume set - int e0_set; // Is energy set - double tscale; // Converts thermal energy to compressive strain ke at simulation start - char *id_temp,*id_press, *id_pe; // Strings with identifiers of created computes. - int tflag,pflag,vsflag,peflag; // Flags to keep track of computes that were created. - double dtv; // update->dt - double dtf; // Full step size - double dthalf; // half step size - bigint ntotal; // atom->natoms - double boltz,nktv2p, mvv2e; // Boltzmann factor and unit conversions - class Compute *temperature; // Computes created to evaluate - class Compute *pressure; // thermodynamic quantities. + int direction; // Direction of shock + double velocity; // Velocity of the shock + double qmass; // Effective cell mass + double mu; // Effective cell viscosity + double e0; // Initial energy + double v0; // Initial volume + double p0; // Initial pressure + int p0_set; // Is pressure set + int v0_set; // Is volume set + int e0_set; // Is energy set + double tscale; // Converts thermal energy to compressive strain ke at simulation start + char *id_temp, *id_press, *id_pe; // Strings with identifiers of created computes. + int tflag, pflag, vsflag, peflag; // Flags to keep track of computes that were created. + double dtv; // update->dt + double dtf; // Full step size + double dthalf; // half step size + bigint ntotal; // atom->natoms + double boltz, nktv2p, mvv2e; // Boltzmann factor and unit conversions + class Compute *temperature; // Computes created to evaluate + class Compute *pressure; // thermodynamic quantities. class Compute *pe; - double **old_velocity; // Saved velocities. - int atoms_allocated; // size of old_velocity + double **old_velocity; // Saved velocities. + int atoms_allocated; // size of old_velocity double dilation[3]; - double omega[3]; // Time derivative of the volume. - double total_mass; // Mass of the computational cell - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes - double p_current[3]; // pressure - double velocity_sum; // Sum of the velocities squared. - double lagrangian_position; // Lagrangian location of computational cell + double omega[3]; // Time derivative of the volume. + double total_mass; // Mass of the computational cell + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes + double p_current[3]; // pressure + double velocity_sum; // Sum of the velocities squared. + double lagrangian_position; // Lagrangian location of computational cell // qbmsst parameters - double t_period, fric_coef; // friction coefficient - int seed; // seed for the random number generator - double f_max; // frequency cutoff - int N_f; // number of frequency grid - double eta; // coupling coefficient between shock and the qtb - int beta; // average beta steps before updating the qtb temperature - double t_init; // initial qtb temperature - int qtb_set; // 1 if its a restarting qbmsst, 0 if not - int counter_l, counter_mu; // counter l and mu - double t_current; // qtb temperature - double h_timestep; // time step to update the random forces - int alpha; // number of time steps to update the random forces - class RanMars *random; // random number generator - double *gfactor; // factors of random forces - double *omega_H,*time_H; // H gives the desired power spectrum - double **random_array_0, **random_array_1, **random_array_2; // random number arrays give independence between atoms and directions - double **fran; // random forces - double old_eavg; // average previous energies + double t_period, fric_coef; // friction coefficient + int seed; // seed for the random number generator + double f_max; // frequency cutoff + int N_f; // number of frequency grid + double eta; // coupling coefficient between shock and the qtb + int beta; // average beta steps before updating the qtb temperature + double t_init; // initial qtb temperature + int qtb_set; // 1 if its a restarting qbmsst, 0 if not + int counter_l, counter_mu; // counter l and mu + double t_current; // qtb temperature + double h_timestep; // time step to update the random forces + int alpha; // number of time steps to update the random forces + class RanMars *random; // random number generator + double *gfactor; // factors of random forces + double *omega_H, *time_H; // H gives the desired power spectrum + double **random_array_0, **random_array_1, + **random_array_2; // random number arrays give independence between atoms and directions + double **fran; // random forces + double old_eavg; // average previous energies // functions void couple(); @@ -118,7 +119,7 @@ class FixQBMSST : public Fix { double compute_lagrangian_position(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-QTB/fix_qtb.h b/src/USER-QTB/fix_qtb.h index 7ed3cca01c..ddf1bd8c7d 100644 --- a/src/USER-QTB/fix_qtb.h +++ b/src/USER-QTB/fix_qtb.h @@ -47,26 +47,26 @@ class FixQTB : public Fix { private: // qtb parameters - int counter_mu; // counter l and mu - double t_period, fric_coef; // friction coefficient - int seed; // seed for the random number generator - double f_max; // frequency cutoff - int N_f; // number of frequency grid - double t_target; // target qtb temperature + int counter_mu; // counter l and mu + double t_period, fric_coef; // friction coefficient + int seed; // seed for the random number generator + double f_max; // frequency cutoff + int N_f; // number of frequency grid + double t_target; // target qtb temperature char *id_temp; class Compute *temperature; - double h_timestep; // time step to update the random forces - int alpha; // number of time steps to update the random forces - class RanMars *random; // random number generator - double *gfactor1,*gfactor3; // factors of frictions and random forces - double *omega_H,*time_H; // H gives the desired power spectrum + double h_timestep; // time step to update the random forces + int alpha; // number of time steps to update the random forces + class RanMars *random; // random number generator + double *gfactor1, *gfactor3; // factors of frictions and random forces + double *omega_H, *time_H; // H gives the desired power spectrum // random number arrays give independence between atoms and directions double **random_array_0, **random_array_1, **random_array_2; int nlevels_respa; - double **fran, fsum[3], fsumall[3]; // random forces and their sums + double **fran, fsum[3], fsumall[3]; // random forces and their sums }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-QUIP/pair_quip.h b/src/USER-QUIP/pair_quip.h index edc2e8336a..3363bbf463 100644 --- a/src/USER-QUIP/pair_quip.h +++ b/src/USER-QUIP/pair_quip.h @@ -22,15 +22,11 @@ PairStyle(quip,PairQUIP); #include "pair.h" -extern "C" -{ - int quip_lammps_api_version(); - void quip_lammps_wrapper(int*, int*, int*, int*, - int*, int*, int*, - int*, int*, double*, - int*, int*, double*, - double*, double*, double*, double*, double*); - void quip_lammps_potential_initialise(int*, int*, double*, char*, int*, char*, int*); +extern "C" { +int quip_lammps_api_version(); +void quip_lammps_wrapper(int *, int *, int *, int *, int *, int *, int *, int *, int *, double *, + int *, int *, double *, double *, double *, double *, double *, double *); +void quip_lammps_potential_initialise(int *, int *, double *, char *, int *, char *, int *); } namespace LAMMPS_NS { @@ -49,17 +45,16 @@ class PairQUIP : public Pair { private: double cutoff; - int* quip_potential; + int *quip_potential; int n_quip_potential; - int *map; // mapping from atom types to elements - char *quip_file; // mapping from atom types to elements + int *map; // mapping from atom types to elements + char *quip_file; // mapping from atom types to elements int n_quip_file; - char *quip_string; // mapping from atom types to elements + char *quip_string; // mapping from atom types to elements int n_quip_string; - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index 36cba40d56..f367eadfb3 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -30,10 +30,9 @@ namespace LAMMPS_NS { class FixBondReact : public Fix { public: - - enum {MAXLINE=256}; // max length of line read from files - enum {MAXCONIDS=4}; // max # of IDs used by any constraint - enum {MAXCONPAR=5}; // max # of constraint parameters + enum { MAXLINE = 256 }; // max length of line read from files + enum { MAXCONIDS = 4 }; // max # of IDs used by any constraint + enum { MAXCONPAR = 5 }; // max # of constraint parameters FixBondReact(class LAMMPS *, int, char **); ~FixBondReact(); @@ -52,15 +51,15 @@ class FixBondReact : public Fix { double memory_usage(); private: - int me,nprocs; + int me, nprocs; int newton_bond; int nreacts; int *nevery; FILE *fp; - int *iatomtype,*jatomtype; + int *iatomtype, *jatomtype; int *seed; - double **cutsq,*fraction; - int *max_rxn,*nlocalskips,*nghostlyskips; + double **cutsq, *fraction; + int *max_rxn, *nlocalskips, *nghostlyskips; tagint lastcheck; int stabilization_flag; int reset_mol_ids_flag; @@ -77,100 +76,102 @@ class FixBondReact : public Fix { int nrxnfunction; std::vector rxnfunclist; int narrhenius; - int **var_flag,**var_id; // for keyword values with variable inputs + int **var_flag, **var_id; // for keyword values with variable inputs int status; int *groupbits; - int rxnID; // integer ID for identifying current bond/react - char **rxn_name; // name of reaction + int rxnID; // integer ID for identifying current bond/react + char **rxn_name; // name of reaction int *reaction_count; int *reaction_count_total; - int nmax; // max num local atoms - int max_natoms; // max natoms in a molecule template - tagint *partner,*finalpartner; + int nmax; // max num local atoms + int max_natoms; // max natoms in a molecule template + tagint *partner, *finalpartner; double **distsq; int *nattempt; int maxattempt; int allnattempt; tagint ***attempt; - class Molecule *onemol; // pre-reacted molecule template - class Molecule *twomol; // post-reacted molecule template - Fix *fix1; // nve/limit used to relax reaction sites - Fix *fix2; // properties/atom used to indicate 1) relaxing atoms - // 2) to which 'react' atom belongs - Fix *fix3; // property/atom used for system-wide thermostat - class RanMars **random; // random number for 'prob' keyword - class RanMars **rrhandom; // random number for Arrhenius constraint + class Molecule *onemol; // pre-reacted molecule template + class Molecule *twomol; // post-reacted molecule template + Fix *fix1; // nve/limit used to relax reaction sites + Fix *fix2; // properties/atom used to indicate 1) relaxing atoms + // 2) to which 'react' atom belongs + Fix *fix3; // property/atom used for system-wide thermostat + class RanMars **random; // random number for 'prob' keyword + class RanMars **rrhandom; // random number for Arrhenius constraint class NeighList *list; - class ResetMolIDs *reset_mol_ids; // class for resetting mol IDs + class ResetMolIDs *reset_mol_ids; // class for resetting mol IDs - int *reacted_mol,*unreacted_mol; - int *limit_duration; // indicates how long to relax - char *nve_limit_xmax; // indicates max distance allowed to move when relaxing - char *id_fix1; // id of internally created fix nve/limit - char *id_fix2; // id of internally created fix per-atom properties - char *id_fix3; // id of internally created 'stabilization group' per-atom property fix - char *statted_id; // name of 'stabilization group' per-atom property - char *master_group; // group containing relaxing atoms from all fix rxns - char *exclude_group; // group for system-wide thermostat + int *reacted_mol, *unreacted_mol; + int *limit_duration; // indicates how long to relax + char *nve_limit_xmax; // indicates max distance allowed to move when relaxing + char *id_fix1; // id of internally created fix nve/limit + char *id_fix2; // id of internally created fix per-atom properties + char *id_fix3; // id of internally created 'stabilization group' per-atom property fix + char *statted_id; // name of 'stabilization group' per-atom property + char *master_group; // group containing relaxing atoms from all fix rxns + char *exclude_group; // group for system-wide thermostat - int countflag,commflag; + int countflag, commflag; int nlevels_respa; - void superimpose_algorithm(); // main function of the superimpose algorithm + void superimpose_algorithm(); // main function of the superimpose algorithm - int *ibonding,*jbonding; - int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors - int nedge,nequivalent,ndelete,ncreate,nchiral; // # edge, equivalent atoms in mapping file - int attempted_rxn; // there was an attempt! + int *ibonding, *jbonding; + int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors + int nedge, nequivalent, ndelete, ncreate, nchiral; // # edge, equivalent atoms in mapping file + int attempted_rxn; // there was an attempt! int *local_rxn_count; int *ghostly_rxn_count; - int avail_guesses; // num of restore points available - int *guess_branch; // used when there is more than two choices when guessing - int **restore_pt; // contains info about restore points - tagint **restore; // contaings info about restore points - int *pioneer_count; // counts pioneers + int avail_guesses; // num of restore points available + int *guess_branch; // used when there is more than two choices when guessing + int **restore_pt; // contains info about restore points + tagint **restore; // contaings info about restore points + int *pioneer_count; // counts pioneers - int **edge; // atoms in molecule templates with incorrect valences - int ***equivalences; // relation between pre- and post-reacted templates - int ***reverse_equiv; // re-ordered equivalences - int **landlocked_atoms; // all atoms at least three bonds away from edge atoms - int **custom_charges; // atoms whose charge should be updated - int **delete_atoms; // atoms in pre-reacted templates to delete - int **create_atoms; // atoms in post-reacted templates to create - int ***chiral_atoms; // pre-react chiral atoms. 1) flag 2) orientation 3-4) ordered atom types + int **edge; // atoms in molecule templates with incorrect valences + int ***equivalences; // relation between pre- and post-reacted templates + int ***reverse_equiv; // re-ordered equivalences + int **landlocked_atoms; // all atoms at least three bonds away from edge atoms + int **custom_charges; // atoms whose charge should be updated + int **delete_atoms; // atoms in pre-reacted templates to delete + int **create_atoms; // atoms in post-reacted templates to create + int ***chiral_atoms; // pre-react chiral atoms. 1) flag 2) orientation 3-4) ordered atom types int nvvec; - double *vvec; // per-atom vector to store variable constraint atom-style variable values + double *vvec; // per-atom vector to store variable constraint atom-style variable values - int **nxspecial,**onemol_nxspecial,**twomol_nxspecial; // full number of 1-4 neighbors - tagint **xspecial,**onemol_xspecial,**twomol_xspecial; // full 1-4 neighbor list + int **nxspecial, **onemol_nxspecial, **twomol_nxspecial; // full number of 1-4 neighbors + tagint **xspecial, **onemol_xspecial, **twomol_xspecial; // full 1-4 neighbor list - int pion,neigh,trace; // important indices for various loops. required for restore points - int lcl_inst; // reaction instance - tagint **glove; // 1st colmn: pre-reacted template, 2nd colmn: global IDs + int pion, neigh, trace; // important indices for various loops. required for restore points + int lcl_inst; // reaction instance + tagint **glove; // 1st colmn: pre-reacted template, 2nd colmn: global IDs // for all mega_gloves and global_mega_glove: first row is the ID of bond/react - tagint **local_mega_glove; // consolidation local of reaction instances - tagint **ghostly_mega_glove; // consolidation nonlocal of reaction instances - tagint **global_mega_glove; // consolidation (inter-processor) of gloves containing nonlocal atoms - int *localsendlist; // indicates ghosts of other procs - int local_num_mega; // num of local reaction instances - int ghostly_num_mega; // num of ghostly reaction instances - int global_megasize; // num of reaction instances in global_mega_glove - int *pioneers; // during Superimpose Algorithm, atoms which have been assigned, but whose first neighbors haven't - int glove_counter; // used to determine when to terminate Superimpose Algorithm + tagint **local_mega_glove; // consolidation local of reaction instances + tagint **ghostly_mega_glove; // consolidation nonlocal of reaction instances + tagint * + *global_mega_glove; // consolidation (inter-processor) of gloves containing nonlocal atoms + int *localsendlist; // indicates ghosts of other procs + int local_num_mega; // num of local reaction instances + int ghostly_num_mega; // num of ghostly reaction instances + int global_megasize; // num of reaction instances in global_mega_glove + int * + pioneers; // during Superimpose Algorithm, atoms which have been assigned, but whose first neighbors haven't + int glove_counter; // used to determine when to terminate Superimpose Algorithm void read(int); void EdgeIDs(char *, int); void Equivalences(char *, int); void DeleteAtoms(char *, int); - void CreateAtoms(char *,int); + void CreateAtoms(char *, int); void CustomCharges(int, int); void ChiralCenters(char *, int); void ReadConstraints(char *, int); void readID(char *, int, int, int); - void make_a_guess (); + void make_a_guess(); void neighbor_loop(); void check_a_neighbor(); void crosscheck_the_neighbor(); @@ -181,7 +182,7 @@ class FixBondReact : public Fix { double get_temperature(tagint **, int, int); double custom_constraint(std::string); double rxnfunction(std::string, std::string, std::string); - int get_chirality(double[12]); // get handedness given an ordered set of coordinates + int get_chirality(double[12]); // get handedness given an ordered set of coordinates void open(char *); void readline(char *); @@ -197,7 +198,7 @@ class FixBondReact : public Fix { int insert_atoms(tagint **, int); void unlimit_bond(); void limit_bond(int); - void dedup_mega_gloves(int); //dedup global mega_glove + void dedup_mega_gloves(int); //dedup global mega_glove virtual void write_restart(FILE *); virtual void restart(char *buf); @@ -220,10 +221,9 @@ class FixBondReact : public Fix { // DEBUG void print_bb(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-REACTION/superpose3d.h b/src/USER-REACTION/superpose3d.h index 51de3ea739..cf1da549ca 100644 --- a/src/USER-REACTION/superpose3d.h +++ b/src/USER-REACTION/superpose3d.h @@ -25,7 +25,7 @@ #ifndef LMP_SUPERPOSE3D_H #define LMP_SUPERPOSE3D_H -#include "math_eigen_impl.h" //functions to calculate eigenvalues and eigenvectors +#include "math_eigen_impl.h" //functions to calculate eigenvalues and eigenvectors // ----------------------------------------------------------- // ------------------------ INTERFACE ------------------------ @@ -35,32 +35,30 @@ /// Superpose(). It is useful for calculating the optimal /// superposition (rotations, translations, and scale transformations) /// between two point clouds of the same size. -template +template class Superpose3D { -private: - size_t N; //number of points in the point clouds - Scalar *aWeights; //weights applied to points when computing RMSD - MathEigen::Jacobi eigen_calc; // calc eigenvectors - Scalar **aaXf_shifted; //preallocated space for fixed point cloud (Nx3 array) - Scalar **aaXm_shifted; //preallocated space for mobile point cloud (Nx3 array) + private: + size_t N; //number of points in the point clouds + Scalar *aWeights; //weights applied to points when computing RMSD + MathEigen::Jacobi eigen_calc; // calc eigenvectors + Scalar **aaXf_shifted; //preallocated space for fixed point cloud (Nx3 array) + Scalar **aaXm_shifted; //preallocated space for mobile point cloud (Nx3 array) -public: + public: // The following data members store the rotation, translation and scale // after optimal superposition - Scalar **R; //!< store optimal rotation here (this is a 3x3 array). - Scalar T[3]; //!< store optimal translation here - Scalar c; //!< store optimal scale (typically 1 unless requested by the user) - Scalar q[4]; //!< quaternion corresponding to the rotation stored in R. - // The first entry of q is cos(θ/2). The remaining 3 entries - // of q are the axis of rotation (with length sin(θ/2)). - // (Note: This is not the same as "p" from Diamond's 1988 paper.) + Scalar **R; //!< store optimal rotation here (this is a 3x3 array). + Scalar T[3]; //!< store optimal translation here + Scalar c; //!< store optimal scale (typically 1 unless requested by the user) + Scalar q[4]; //!< quaternion corresponding to the rotation stored in R. + // The first entry of q is cos(θ/2). The remaining 3 entries + // of q are the axis of rotation (with length sin(θ/2)). + // (Note: This is not the same as "p" from Diamond's 1988 paper.) - Superpose3D(size_t N = 0); //!< N=number of points in both point clouds + Superpose3D(size_t N = 0); //!< N=number of points in both point clouds - Superpose3D(size_t N, //!< N = number of points in both point clouds - ConstArray aWeights); //!< weight per point for computing RMSD + Superpose3D(size_t N, //!< N = number of points in both point clouds + ConstArray aWeights); //!< weight per point for computing RMSD ~Superpose3D(); @@ -108,65 +106,62 @@ public: /// After this function is called, the optimal rotation, translation, /// and scale (if requested) will be stored in the "R", "T", and "c" /// public data members. - Scalar Superpose(ConstArrayOfCoords aaXf, //!< coords for the "frozen" object - ConstArrayOfCoords aaXm, //!< coords for the "mobile" object - bool allow_rescale=false //!< rescale mobile object? (c≠1?) - ); + Scalar Superpose(ConstArrayOfCoords aaXf, //!< coords for the "frozen" object + ConstArrayOfCoords aaXm, //!< coords for the "mobile" object + bool allow_rescale = false //!< rescale mobile object? (c≠1?) + ); // C++ boilerplate: copy and move constructor, swap, and assignment operator - Superpose3D(const Superpose3D& source); - Superpose3D(Superpose3D&& other); - void swap(Superpose3D &other); - Superpose3D& operator = (Superpose3D source); - -private: + Superpose3D(const Superpose3D &source); + Superpose3D(Superpose3D &&other); + void swap(Superpose3D &other); + Superpose3D & + operator=(Superpose3D source); + private: // memory management: void Alloc(size_t N); void Init(); void Dealloc(); -}; // class Superpose3D - - - - +}; // class Superpose3D // -------------- IMPLEMENTATION -------------- +template static inline Scalar SQR(Scalar x) +{ + return x * x; +} -template -static inline Scalar SQR(Scalar x) {return x*x;} - -template -Scalar Superpose3D:: -Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object - ConstArrayOfCoords aaXm, // coords for the "mobile" object - bool allow_rescale) // rescale mobile object? (c!=1?) +template +Scalar Superpose3D::Superpose( + ConstArrayOfCoords aaXf, // coords for the "frozen" object + ConstArrayOfCoords aaXm, // coords for the "mobile" object + bool allow_rescale) // rescale mobile object? (c!=1?) { // Find the center of mass of each object: Scalar aCenter_f[3] = {0.0, 0.0, 0.0}; Scalar aCenter_m[3] = {0.0, 0.0, 0.0}; Scalar sum_weights = 0.0; - for (size_t n=0; n < N; n++) { + for (size_t n = 0; n < N; n++) { Scalar weight = aWeights[n]; - for (int d=0; d < 3; d++) { - aCenter_f[d] += aaXf[n][d]*weight; - aCenter_m[d] += aaXm[n][d]*weight; + for (int d = 0; d < 3; d++) { + aCenter_f[d] += aaXf[n][d] * weight; + aCenter_m[d] += aaXm[n][d] * weight; } sum_weights += weight; } //assert(sum_weights != 0.0); - for (int d=0; d < 3; d++) { + for (int d = 0; d < 3; d++) { aCenter_f[d] /= sum_weights; aCenter_m[d] /= sum_weights; } //Subtract the centers-of-mass from the original coordinates for each object - for (size_t n=0; n < N; n++) { - for (int d=0; d < 3; d++) { + for (size_t n = 0; n < N; n++) { + for (int d = 0; d < 3; d++) { // shift the coordinates so that the new center of mass is at the origin aaXf_shifted[n][d] = aaXf[n][d] - aCenter_f[d]; aaXm_shifted[n][d] = aaXm[n][d] - aCenter_m[d]; @@ -175,29 +170,24 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object // Calculate the "M" array from the Diamond paper (equation 16) Scalar M[3][3]; - for (int i=0; i < 3; i++) - for (int j=0; j < 3; j++) - M[i][j] = 0.0; + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) M[i][j] = 0.0; - for (size_t n=0; n < N; n++) { + for (size_t n = 0; n < N; n++) { Scalar weight = aWeights[n]; - for (int i=0; i < 3; i++) { - for (int j=0; j < 3; j++) { - M[i][j] += weight * aaXm_shifted[n][i] * aaXf_shifted[n][j]; - } + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { M[i][j] += weight * aaXm_shifted[n][i] * aaXf_shifted[n][j]; } } } // Calculate Q (equation 17) Scalar traceM = 0.0; - for (int i=0; i < 3; i++) - traceM += M[i][i]; + for (int i = 0; i < 3; i++) traceM += M[i][i]; Scalar Q[3][3]; - for (int i=0; i < 3; i++) { - for (int j=0; j < 3; j++) { + for (int i = 0; i < 3; i++) { + for (int j = 0; j < 3; j++) { Q[i][j] = M[i][j] + M[j][i]; - if (i==j) - Q[i][j] -= 2.0 * traceM; + if (i == j) Q[i][j] -= 2.0 * traceM; } } @@ -212,15 +202,14 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object // Scalar P[4][4]; // ...because most matrix solvers expect arrays in pointer-to-pointer format. // (a different format). Below I create a fixed size matrix P in this format. - Scalar _P[4*4]; // Contiguous 1D array for storing contents of the 2D P array - Scalar *P[4]; // This version of P has has ** (pointer-to-pointer) format. - for (int i=0; i < 4; i++) // We must make sure that - P[i] = &(_P[4*i]); // P[i] points to the appropriate location in memory + Scalar _P[4 * 4]; // Contiguous 1D array for storing contents of the 2D P array + Scalar *P[4]; // This version of P has has ** (pointer-to-pointer) format. + for (int i = 0; i < 4; i++) // We must make sure that + P[i] = &(_P[4 * i]); // P[i] points to the appropriate location in memory // Now fill the P array - for (int i=0; i < 3; i++) - for (int j=0; j < 3; j++) - P[i][j] = Q[i][j]; + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) P[i][j] = Q[i][j]; P[0][3] = V[0]; P[3][0] = V[0]; P[1][3] = V[1]; @@ -230,89 +219,86 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object P[3][3] = 0.0; // The vector "p" contains the optimal rotation (backwards quaternion format) - Scalar p[4] = {0.0, 0.0, 0.0, 1.0}; // default value - Scalar pPp = 0.0; // = p^T * P * p (zero by default) - Scalar rmsd = 0.0; // default value + Scalar p[4] = {0.0, 0.0, 0.0, 1.0}; // default value + Scalar pPp = 0.0; // = p^T * P * p (zero by default) + Scalar rmsd = 0.0; // default value - bool singular = N<2; // (it doesn't make sense to rotate a single point) + bool singular = N < 2; // (it doesn't make sense to rotate a single point) - if (! singular) { + if (!singular) { // Calculate the principal eigenvalue and eigenvector of matrix P. // Store the principal eigenvector in "p" // The vector "p" will contain the optimal rotation (in quaternion format) - Scalar Evl[4]; // Store the eigenvalues of P here. - Scalar *Evc[4]; // Store the eigevectors here. This version has ** format. - Scalar _Evc[4*4]; // Contiguous 1D array for storing contents of "Evc" array - for (int i=0; i < 4; i++) // We must make sure that - Evc[i] = &(_Evc[4*i]); // Evc[i] points to the correct location in memory + Scalar Evl[4]; // Store the eigenvalues of P here. + Scalar *Evc[4]; // Store the eigevectors here. This version has ** format. + Scalar _Evc[4 * 4]; // Contiguous 1D array for storing contents of "Evc" array + for (int i = 0; i < 4; i++) // We must make sure that + Evc[i] = &(_Evc[4 * i]); // Evc[i] points to the correct location in memory eigen_calc.Diagonalize(P, Evl, Evc); // Note: The eigenvalues are sorted in decreasing order by default. - pPp = Evl[0]; // = the maximum eigenvalue of P - for (int i=0; i < 4; i++) - p[i] = Evc[0][i]; //copy eigenvector corresponding to this eigenvalue to p - } //if (! singular) + pPp = Evl[0]; // = the maximum eigenvalue of P + for (int i = 0; i < 4; i++) + p[i] = Evc[0][i]; //copy eigenvector corresponding to this eigenvalue to p + } //if (! singular) // Now normalize p Scalar pnorm = 0.0; - for (int i=0; i < 4; i++) - pnorm += p[i]*p[i]; + for (int i = 0; i < 4; i++) pnorm += p[i] * p[i]; pnorm = sqrt(pnorm); - for (int i=0; i < 4; i++) - p[i] /= pnorm; + for (int i = 0; i < 4; i++) p[i] /= pnorm; // Finally, calculate the rotation matrix corresponding to "p" // (convert a quaternion into a 3x3 rotation matrix) - R[0][0] = (p[0]*p[0])-(p[1]*p[1])-(p[2]*p[2])+(p[3]*p[3]); - R[1][1] = -(p[0]*p[0])+(p[1]*p[1])-(p[2]*p[2])+(p[3]*p[3]); - R[2][2] = -(p[0]*p[0])-(p[1]*p[1])+(p[2]*p[2])+(p[3]*p[3]); - R[0][1] = 2*(p[0]*p[1] - p[2]*p[3]); - R[1][0] = 2*(p[0]*p[1] + p[2]*p[3]); - R[1][2] = 2*(p[1]*p[2] - p[0]*p[3]); - R[2][1] = 2*(p[1]*p[2] + p[0]*p[3]); - R[0][2] = 2*(p[0]*p[2] + p[1]*p[3]); - R[2][0] = 2*(p[0]*p[2] - p[1]*p[3]); + R[0][0] = (p[0] * p[0]) - (p[1] * p[1]) - (p[2] * p[2]) + (p[3] * p[3]); + R[1][1] = -(p[0] * p[0]) + (p[1] * p[1]) - (p[2] * p[2]) + (p[3] * p[3]); + R[2][2] = -(p[0] * p[0]) - (p[1] * p[1]) + (p[2] * p[2]) + (p[3] * p[3]); + R[0][1] = 2 * (p[0] * p[1] - p[2] * p[3]); + R[1][0] = 2 * (p[0] * p[1] + p[2] * p[3]); + R[1][2] = 2 * (p[1] * p[2] - p[0] * p[3]); + R[2][1] = 2 * (p[1] * p[2] + p[0] * p[3]); + R[0][2] = 2 * (p[0] * p[2] + p[1] * p[3]); + R[2][0] = 2 * (p[0] * p[2] - p[1] * p[3]); - q[0] = p[3]; // Note: The "p" variable is not a quaternion in the - q[1] = p[0]; // conventional sense because its elements - q[2] = p[1]; // are in the wrong order. I correct for that here. - q[3] = p[2]; // "q" is the quaternion correspond to rotation R. + q[0] = p[3]; // Note: The "p" variable is not a quaternion in the + q[1] = p[0]; // conventional sense because its elements + q[2] = p[1]; // are in the wrong order. I correct for that here. + q[3] = p[2]; // "q" is the quaternion correspond to rotation R. // Optional: Decide the scale factor, c - c = 1.0; // by default, don't rescale the coordinates + c = 1.0; // by default, don't rescale the coordinates - if ((allow_rescale) && (! singular)) { + if ((allow_rescale) && (!singular)) { Scalar Waxaixai = 0.0; Scalar WaxaiXai = 0.0; - for (size_t a=0; a < N; a++) { + for (size_t a = 0; a < N; a++) { Scalar weight = aWeights[a]; - for (int i=0; i < 3; i++) { + for (int i = 0; i < 3; i++) { Waxaixai += weight * aaXm_shifted[a][i] * aaXm_shifted[a][i]; WaxaiXai += weight * aaXm_shifted[a][i] * aaXf_shifted[a][i]; } } c = (WaxaiXai + pPp) / Waxaixai; - } // if (allow_rescale) + } // if (allow_rescale) // Finally compute the RMSD between the two coordinate sets: // First compute E0 from equation 24 of the paper Scalar E0 = 0.0; - for (size_t n=0; n < N; n++) { + for (size_t n = 0; n < N; n++) { Scalar weight = aWeights[n]; - for (int d=0; d < 3; d++) + for (int d = 0; d < 3; d++) // (remember to include the scale factor "c" that we inserted) - E0 += weight * (SQR(aaXf_shifted[n][d] - c*aaXm_shifted[n][d])); + E0 += weight * (SQR(aaXf_shifted[n][d] - c * aaXm_shifted[n][d])); } - Scalar sum_sqr_dist = E0 - c*2.0*pPp; - if (sum_sqr_dist < 0.0) //(edge case due to rounding error) + Scalar sum_sqr_dist = E0 - c * 2.0 * pPp; + if (sum_sqr_dist < 0.0) //(edge case due to rounding error) sum_sqr_dist = 0.0; - if (! singular) - rmsd = sqrt(sum_sqr_dist/sum_weights); + if (!singular) rmsd = sqrt(sum_sqr_dist / sum_weights); // Lastly, calculate the translational offset. // If c!=1, this is slightly more complicated than it seems. Recall that: @@ -328,58 +314,53 @@ Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object // In the code, Xcm_i is represented by "aCenter_f[i]" // and xcm_j is represented by "aCenter_m[j]" - for (int i=0; i < 3; i++) { + for (int i = 0; i < 3; i++) { T[i] = aCenter_f[i]; - for (int j=0; j < 3; j++) { - T[i] -= c*R[i][j]*aCenter_m[j]; - } + for (int j = 0; j < 3; j++) { T[i] -= c * R[i][j] * aCenter_m[j]; } } return rmsd; -} //Superpose3D::Superpose(aaXf, aaXm, allow_rescale) +} //Superpose3D::Superpose(aaXf, aaXm, allow_rescale) - -template -void Superpose3D:: -SetNumPoints(size_t N) { +template +void Superpose3D::SetNumPoints(size_t N) +{ Dealloc(); Alloc(N); } -template -void Superpose3D:: -SetWeights(ConstArray aWeights) { - for (size_t i = 0; i < N; i++) - this->aWeights[i] = aWeights[i]; +template +void Superpose3D::SetWeights(ConstArray aWeights) +{ + for (size_t i = 0; i < N; i++) this->aWeights[i] = aWeights[i]; } -template -Superpose3D::Superpose3D(size_t N) - :eigen_calc(4) +template +Superpose3D::Superpose3D(size_t N) : eigen_calc(4) { Init(); Alloc(N); } -template -Superpose3D:: -Superpose3D(size_t N, ConstArray aWeights) - :eigen_calc(4) +template +Superpose3D::Superpose3D(size_t N, ConstArray aWeights) : + eigen_calc(4) { Init(); Alloc(N); SetWeights(aWeights); } -template -Superpose3D::~Superpose3D() { +template +Superpose3D::~Superpose3D() +{ Dealloc(); } -template -void Superpose3D:: -Init() { +template +void Superpose3D::Init() +{ R = nullptr; aWeights = nullptr; aaXf_shifted = nullptr; @@ -388,37 +369,32 @@ Init() { // memory management: -template -void Superpose3D:: -Alloc(size_t N) { +template +void Superpose3D::Alloc(size_t N) +{ this->N = N; - aWeights = new Scalar [N]; - for (size_t i = 0; i < N; i++) - aWeights[i] = 1.0 / N; + aWeights = new Scalar[N]; + for (size_t i = 0; i < N; i++) aWeights[i] = 1.0 / N; MathEigen::Alloc2D(3, 3, &R); MathEigen::Alloc2D(N, 3, &aaXf_shifted); MathEigen::Alloc2D(N, 3, &aaXm_shifted); } -template -void Superpose3D:: -Dealloc() { - if (R) - MathEigen::Dealloc2D(&R); - if (aWeights) - delete [] aWeights; - if (aaXf_shifted) - MathEigen::Dealloc2D(&aaXf_shifted); - if (aaXm_shifted) - MathEigen::Dealloc2D(&aaXm_shifted); +template +void Superpose3D::Dealloc() +{ + if (R) MathEigen::Dealloc2D(&R); + if (aWeights) delete[] aWeights; + if (aaXf_shifted) MathEigen::Dealloc2D(&aaXf_shifted); + if (aaXm_shifted) MathEigen::Dealloc2D(&aaXm_shifted); } // memory management: copy and move constructor, swap, and assignment operator: -template -Superpose3D:: -Superpose3D(const Superpose3D& source) - :eigen_calc(4) +template +Superpose3D::Superpose3D( + const Superpose3D &source) : + eigen_calc(4) { Init(); Alloc(source.N); @@ -426,18 +402,15 @@ Superpose3D(const Superpose3D& source) //assert(N == source.N); for (int i = 0; i < N; i++) { - std::copy(source.aaXf_shifted[i], - source.aaXf_shifted[i] + 3, - aaXf_shifted[i]); - std::copy(source.aaXm_shifted[i], - source.aaXm_shifted[i] + 3, - aaXm_shifted[i]); + std::copy(source.aaXf_shifted[i], source.aaXf_shifted[i] + 3, aaXf_shifted[i]); + std::copy(source.aaXm_shifted[i], source.aaXm_shifted[i] + 3, aaXm_shifted[i]); } } -template -void Superpose3D:: -swap(Superpose3D &other) { +template +void Superpose3D::swap( + Superpose3D &other) +{ std::swap(N, other.N); std::swap(R, other.R); std::swap(aaXf_shifted, other.aaXf_shifted); @@ -445,21 +418,22 @@ swap(Superpose3D &other) { } // Move constructor (C++11) -template -Superpose3D:: -Superpose3D(Superpose3D&& other) { +template +Superpose3D::Superpose3D( + Superpose3D &&other) +{ Init(); swap(*this, other); } // Using the "copy-swap" idiom for the assignment operator -template -Superpose3D& -Superpose3D:: -operator = (Superpose3D source) { +template +Superpose3D & +Superpose3D::operator=( + Superpose3D source) +{ this->swap(source); return *this; } - -#endif //#ifndef LMP_SUPERPOSE3D_H +#endif //#ifndef LMP_SUPERPOSE3D_H diff --git a/src/USER-REAXC/compute_spec_atom.h b/src/USER-REAXC/compute_spec_atom.h index cab2d9ac6c..32ac9245f6 100644 --- a/src/USER-REAXC/compute_spec_atom.h +++ b/src/USER-REAXC/compute_spec_atom.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Labo0ratories diff --git a/src/USER-REAXC/fix_qeq_reax.h b/src/USER-REAXC/fix_qeq_reax.h index 7fb7783cb3..b8130b37c3 100644 --- a/src/USER-REAXC/fix_qeq_reax.h +++ b/src/USER-REAXC/fix_qeq_reax.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-REAXC/fix_reaxc.h b/src/USER-REAXC/fix_reaxc.h index d9caa65f47..bb11f6adb5 100644 --- a/src/USER-REAXC/fix_reaxc.h +++ b/src/USER-REAXC/fix_reaxc.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-REAXC/fix_reaxc_bonds.h b/src/USER-REAXC/fix_reaxc_bonds.h index f3fedad1f0..199f3b5b70 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.h +++ b/src/USER-REAXC/fix_reaxc_bonds.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-REAXC/fix_reaxc_species.h b/src/USER-REAXC/fix_reaxc_species.h index 6436257410..1829ef30b6 100644 --- a/src/USER-REAXC/fix_reaxc_species.h +++ b/src/USER-REAXC/fix_reaxc_species.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-REAXC/pair_reaxc.h b/src/USER-REAXC/pair_reaxc.h index 863f9a6d19..a3d18afab5 100644 --- a/src/USER-REAXC/pair_reaxc.h +++ b/src/USER-REAXC/pair_reaxc.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/USER-REAXC/reaxc_allocate.h b/src/USER-REAXC/reaxc_allocate.h index be203340f6..b5e6f542ee 100644 --- a/src/USER-REAXC/reaxc_allocate.h +++ b/src/USER-REAXC/reaxc_allocate.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_bond_orders.h b/src/USER-REAXC/reaxc_bond_orders.h index 3631d90c89..63550061d0 100644 --- a/src/USER-REAXC/reaxc_bond_orders.h +++ b/src/USER-REAXC/reaxc_bond_orders.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_bonds.h b/src/USER-REAXC/reaxc_bonds.h index a4a1fb0b44..49a869c766 100644 --- a/src/USER-REAXC/reaxc_bonds.h +++ b/src/USER-REAXC/reaxc_bonds.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_control.h b/src/USER-REAXC/reaxc_control.h index b2b455d6b8..9c818b0554 100644 --- a/src/USER-REAXC/reaxc_control.h +++ b/src/USER-REAXC/reaxc_control.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_defs.h b/src/USER-REAXC/reaxc_defs.h index 3ead22842a..b98d8a2828 100644 --- a/src/USER-REAXC/reaxc_defs.h +++ b/src/USER-REAXC/reaxc_defs.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- diff --git a/src/USER-REAXC/reaxc_ffield.h b/src/USER-REAXC/reaxc_ffield.h index b6fe1c9ea9..76edfe8b7e 100644 --- a/src/USER-REAXC/reaxc_ffield.h +++ b/src/USER-REAXC/reaxc_ffield.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_forces.h b/src/USER-REAXC/reaxc_forces.h index bfad2e9b71..ef23a84a18 100644 --- a/src/USER-REAXC/reaxc_forces.h +++ b/src/USER-REAXC/reaxc_forces.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_hydrogen_bonds.h b/src/USER-REAXC/reaxc_hydrogen_bonds.h index 04d3d26d5c..1d88f1edcf 100644 --- a/src/USER-REAXC/reaxc_hydrogen_bonds.h +++ b/src/USER-REAXC/reaxc_hydrogen_bonds.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_init_md.h b/src/USER-REAXC/reaxc_init_md.h index 5d593f50ea..b7c1d38bbc 100644 --- a/src/USER-REAXC/reaxc_init_md.h +++ b/src/USER-REAXC/reaxc_init_md.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_io_tools.h b/src/USER-REAXC/reaxc_io_tools.h index a3f22fccc2..b43d6cd11f 100644 --- a/src/USER-REAXC/reaxc_io_tools.h +++ b/src/USER-REAXC/reaxc_io_tools.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_list.h b/src/USER-REAXC/reaxc_list.h index 28567252da..323656537d 100644 --- a/src/USER-REAXC/reaxc_list.h +++ b/src/USER-REAXC/reaxc_list.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_lookup.h b/src/USER-REAXC/reaxc_lookup.h index 3aae7e0b63..abbac23e1f 100644 --- a/src/USER-REAXC/reaxc_lookup.h +++ b/src/USER-REAXC/reaxc_lookup.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_multi_body.h b/src/USER-REAXC/reaxc_multi_body.h index a17c9f484e..5d60140b44 100644 --- a/src/USER-REAXC/reaxc_multi_body.h +++ b/src/USER-REAXC/reaxc_multi_body.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_nonbonded.h b/src/USER-REAXC/reaxc_nonbonded.h index 9a29d4d8c1..64c69e9f30 100644 --- a/src/USER-REAXC/reaxc_nonbonded.h +++ b/src/USER-REAXC/reaxc_nonbonded.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_reset_tools.h b/src/USER-REAXC/reaxc_reset_tools.h index 20d1ab6964..15e584eaac 100644 --- a/src/USER-REAXC/reaxc_reset_tools.h +++ b/src/USER-REAXC/reaxc_reset_tools.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_system_props.h b/src/USER-REAXC/reaxc_system_props.h index 4d80e22966..27c80d02bf 100644 --- a/src/USER-REAXC/reaxc_system_props.h +++ b/src/USER-REAXC/reaxc_system_props.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_tool_box.h b/src/USER-REAXC/reaxc_tool_box.h index 773b4f3f3d..6dc6217c92 100644 --- a/src/USER-REAXC/reaxc_tool_box.h +++ b/src/USER-REAXC/reaxc_tool_box.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_torsion_angles.h b/src/USER-REAXC/reaxc_torsion_angles.h index 755e8c6532..e18bc9d4c7 100644 --- a/src/USER-REAXC/reaxc_torsion_angles.h +++ b/src/USER-REAXC/reaxc_torsion_angles.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_traj.h b/src/USER-REAXC/reaxc_traj.h index 2ff5995204..3321410a22 100644 --- a/src/USER-REAXC/reaxc_traj.h +++ b/src/USER-REAXC/reaxc_traj.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_types.h b/src/USER-REAXC/reaxc_types.h index 36678ad2b0..f4b8bb0a2e 100644 --- a/src/USER-REAXC/reaxc_types.h +++ b/src/USER-REAXC/reaxc_types.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_valence_angles.h b/src/USER-REAXC/reaxc_valence_angles.h index 31936ba190..a5dc12c16b 100644 --- a/src/USER-REAXC/reaxc_valence_angles.h +++ b/src/USER-REAXC/reaxc_valence_angles.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-REAXC/reaxc_vector.h b/src/USER-REAXC/reaxc_vector.h index 549c1f927c..f2068d4d4f 100644 --- a/src/USER-REAXC/reaxc_vector.h +++ b/src/USER-REAXC/reaxc_vector.h @@ -1,3 +1,4 @@ +// clang-format off /*---------------------------------------------------------------------- PuReMD - Purdue ReaxFF Molecular Dynamics Program diff --git a/src/USER-SCAFACOS/scafacos.h b/src/USER-SCAFACOS/scafacos.h index 65f4b023e5..a8c0586d29 100644 --- a/src/USER-SCAFACOS/scafacos.h +++ b/src/USER-SCAFACOS/scafacos.h @@ -41,30 +41,30 @@ class Scafacos : public KSpace { char *method; double tolerance; - double *xpbc,*epot,**efield; + double *xpbc, *epot, **efield; int tolerance_type; - int initialized,maxatom; + int initialized, maxatom; int fmm_tuning_flag; - void* fcs; // ScaFaCoS handle + void *fcs; // ScaFaCoS handle // simulation state: box, natoms // so ScaFaCoS can detect if changes, e.g. for NPT - double old_box_x[3],old_box_y[3],old_box_z[3]; + double old_box_x[3], old_box_y[3], old_box_z[3]; double old_origin[3]; int old_periodicity[3]; int old_natoms; double virial_int[9]; - void check_result(void*); + void check_result(void *); void setup_handle(); bool box_has_changed(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SDPD/fix_meso_move.h b/src/USER-SDPD/fix_meso_move.h index 9a41fdd76e..a2e346202b 100644 --- a/src/USER-SDPD/fix_meso_move.h +++ b/src/USER-SDPD/fix_meso_move.h @@ -26,48 +26,48 @@ namespace LAMMPS_NS { class FixMesoMove : public Fix { public: - FixMesoMove (class LAMMPS *, int, char **); - ~FixMesoMove (); - int setmask (); - void init (); - void setup_pre_force (int); - void initial_integrate (int); - void final_integrate (); + FixMesoMove(class LAMMPS *, int, char **); + ~FixMesoMove(); + int setmask(); + void init(); + void setup_pre_force(int); + void initial_integrate(int); + void final_integrate(); - double memory_usage (); - void write_restart (FILE *); - void restart (char *); - void grow_arrays (int); - void copy_arrays (int, int, int); - void set_arrays (int); - int pack_exchange (int, double *); - int unpack_exchange (int, double *); - int pack_restart (int, double *); - void unpack_restart (int, int); - int maxsize_restart (); - int size_restart (int); + double memory_usage(); + void write_restart(FILE *); + void restart(char *); + void grow_arrays(int); + void copy_arrays(int, int, int); + void set_arrays(int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); + int maxsize_restart(); + int size_restart(int); - void reset_dt (); + void reset_dt(); private: - char *xvarstr,*yvarstr,*zvarstr,*vxvarstr,*vyvarstr,*vzvarstr; + char *xvarstr, *yvarstr, *zvarstr, *vxvarstr, *vyvarstr, *vzvarstr; int mstyle; - int vxflag,vyflag,vzflag,axflag,ayflag,azflag; - double vx,vy,vz,ax,ay,az; - double period,omega_rotate; - double point[3],axis[3],runit[3]; - double dt,dtv,dtf; - int xvar,yvar,zvar,vxvar,vyvar,vzvar; - int xvarstyle,yvarstyle,zvarstyle,vxvarstyle,vyvarstyle,vzvarstyle; + int vxflag, vyflag, vzflag, axflag, ayflag, azflag; + double vx, vy, vz, ax, ay, az; + double period, omega_rotate; + double point[3], axis[3], runit[3]; + double dt, dtv, dtf; + int xvar, yvar, zvar, vxvar, vyvar, vzvar; + int xvarstyle, yvarstyle, zvarstyle, vxvarstyle, vyvarstyle, vzvarstyle; int time_origin; - double **xoriginal; // original coords of atoms - int displaceflag,velocityflag; + double **xoriginal; // original coords of atoms + int displaceflag, velocityflag; int maxatom; - double **displace,**velocity; + double **displace, **velocity; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SDPD/fix_rigid_meso.h b/src/USER-SDPD/fix_rigid_meso.h index cbf83bee6f..4a241f1af7 100644 --- a/src/USER-SDPD/fix_rigid_meso.h +++ b/src/USER-SDPD/fix_rigid_meso.h @@ -26,22 +26,22 @@ namespace LAMMPS_NS { class FixRigidMeso : public FixRigid { public: - FixRigidMeso (class LAMMPS *, int, char **); - ~FixRigidMeso (); - int setmask (); - void setup (int); - void initial_integrate (int); - void final_integrate (); - double compute_scalar () { return 0.0; } - double compute_array (int, int); + FixRigidMeso(class LAMMPS *, int, char **); + ~FixRigidMeso(); + int setmask(); + void setup(int); + void initial_integrate(int); + void final_integrate(); + double compute_scalar() { return 0.0; } + double compute_array(int, int); protected: - void set_xv (); - void set_v (); - double **conjqm; // conjugate quaternion momentum + void set_xv(); + void set_v(); + double **conjqm; // conjugate quaternion momentum }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h index 4f8316c69e..7eec9bbbe2 100644 --- a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h +++ b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.h @@ -22,20 +22,20 @@ PairStyle(sdpd/taitwater/isothermal,PairSDPDTaitwaterIsothermal); #include "pair.h" #ifdef USE_ZEST -#include #include "zest.hpp" +#include #endif namespace LAMMPS_NS { class PairSDPDTaitwaterIsothermal : public Pair { public: - PairSDPDTaitwaterIsothermal (class LAMMPS *); - virtual ~PairSDPDTaitwaterIsothermal (); - virtual void compute (int, int); - void settings (int, char **); - void coeff (int, char **); - virtual double init_one (int, int); + PairSDPDTaitwaterIsothermal(class LAMMPS *); + virtual ~PairSDPDTaitwaterIsothermal(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + virtual double init_one(int, int); virtual void init_style(); protected: @@ -43,18 +43,18 @@ class PairSDPDTaitwaterIsothermal : public Pair { double *rho0, *soundspeed, *B; double **cut; - void allocate (); + void allocate(); unsigned int seed; #ifdef USE_ZEST std::mt19937_64 generator; - Ziggurat gaussian; + Ziggurat gaussian; #else class RanMars *random; #endif }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/atom_vec_smd.h b/src/USER-SMD/atom_vec_smd.h index c0aec79a70..90f182f45c 100644 --- a/src/USER-SMD/atom_vec_smd.h +++ b/src/USER-SMD/atom_vec_smd.h @@ -46,12 +46,12 @@ class AtomVecSMD : public AtomVec { private: tagint *molecule; - double *esph,*desph,*vfrac,*rmass,*radius,*contact_radius; - double *eff_plastic_strain,*eff_plastic_strain_rate,*damage; - double **x0,**smd_data_9,**smd_stress,**vest; + double *esph, *desph, *vfrac, *rmass, *radius, *contact_radius; + double *eff_plastic_strain, *eff_plastic_strain_rate, *damage; + double **x0, **smd_data_9, **smd_stress, **vest; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_contact_radius.h b/src/USER-SMD/compute_smd_contact_radius.h index e591eee7bd..0bcbfc54db 100644 --- a/src/USER-SMD/compute_smd_contact_radius.h +++ b/src/USER-SMD/compute_smd_contact_radius.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDContactRadius : public Compute { double *contact_radius_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_damage.h b/src/USER-SMD/compute_smd_damage.h index b193f81c3f..a9ecafa824 100644 --- a/src/USER-SMD/compute_smd_damage.h +++ b/src/USER-SMD/compute_smd_damage.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDDamage : public Compute { double *damage_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_hourglass_error.h b/src/USER-SMD/compute_smd_hourglass_error.h index 95a0d0a986..5e24089de6 100644 --- a/src/USER-SMD/compute_smd_hourglass_error.h +++ b/src/USER-SMD/compute_smd_hourglass_error.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDHourglassError : public Compute { double *hourglass_error_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_internal_energy.h b/src/USER-SMD/compute_smd_internal_energy.h index 904e105749..05ed11a5bb 100644 --- a/src/USER-SMD/compute_smd_internal_energy.h +++ b/src/USER-SMD/compute_smd_internal_energy.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDInternalEnergy : public Compute { double *internal_energy_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_plastic_strain.h b/src/USER-SMD/compute_smd_plastic_strain.h index b7b90ac060..61454b7e65 100644 --- a/src/USER-SMD/compute_smd_plastic_strain.h +++ b/src/USER-SMD/compute_smd_plastic_strain.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDPlasticStrain : public Compute { double *plastic_strain_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_plastic_strain_rate.h b/src/USER-SMD/compute_smd_plastic_strain_rate.h index 3c9ae2de05..145b4da39b 100644 --- a/src/USER-SMD/compute_smd_plastic_strain_rate.h +++ b/src/USER-SMD/compute_smd_plastic_strain_rate.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDPlasticStrainRate : public Compute { double *plastic_strain_rate_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_rho.h b/src/USER-SMD/compute_smd_rho.h index 7fd7bcec81..b18d874a39 100644 --- a/src/USER-SMD/compute_smd_rho.h +++ b/src/USER-SMD/compute_smd_rho.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDRho : public Compute { double *rhoVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_defgrad.h b/src/USER-SMD/compute_smd_tlsph_defgrad.h index ab0064fd88..81c60e1897 100644 --- a/src/USER-SMD/compute_smd_tlsph_defgrad.h +++ b/src/USER-SMD/compute_smd_tlsph_defgrad.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDTLSPHDefgrad : public Compute { double **defgradVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_dt.h b/src/USER-SMD/compute_smd_tlsph_dt.h index 7316317ee3..50e3290e57 100644 --- a/src/USER-SMD/compute_smd_tlsph_dt.h +++ b/src/USER-SMD/compute_smd_tlsph_dt.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDTlsphDt : public Compute { double *dt_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_num_neighs.h b/src/USER-SMD/compute_smd_tlsph_num_neighs.h index c86ff2ab20..d8514f3573 100644 --- a/src/USER-SMD/compute_smd_tlsph_num_neighs.h +++ b/src/USER-SMD/compute_smd_tlsph_num_neighs.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDTLSPHNumNeighs : public Compute { double *numNeighsRefConfigOutput; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_shape.h b/src/USER-SMD/compute_smd_tlsph_shape.h index 2ddaf5818d..2c69003a18 100644 --- a/src/USER-SMD/compute_smd_tlsph_shape.h +++ b/src/USER-SMD/compute_smd_tlsph_shape.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSmdTlsphShape : public Compute { double **strainVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_strain.h b/src/USER-SMD/compute_smd_tlsph_strain.h index 50d0041384..8ff99f31c6 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain.h +++ b/src/USER-SMD/compute_smd_tlsph_strain.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDTLSPHstrain : public Compute { double **strainVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_strain_rate.h b/src/USER-SMD/compute_smd_tlsph_strain_rate.h index b5edc18fb2..a39b4dfb43 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain_rate.h +++ b/src/USER-SMD/compute_smd_tlsph_strain_rate.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDTLSPHStrainRate : public Compute { double **strain_rate_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_tlsph_stress.h b/src/USER-SMD/compute_smd_tlsph_stress.h index dac6384145..92304dc875 100644 --- a/src/USER-SMD/compute_smd_tlsph_stress.h +++ b/src/USER-SMD/compute_smd_tlsph_stress.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDTLSPHStress : public Compute { double **stress_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_triangle_vertices.h b/src/USER-SMD/compute_smd_triangle_vertices.h index 5d296621b2..2a5c92cffe 100644 --- a/src/USER-SMD/compute_smd_triangle_vertices.h +++ b/src/USER-SMD/compute_smd_triangle_vertices.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDTriangleVertices : public Compute { double **outputVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_effm.h b/src/USER-SMD/compute_smd_ulsph_effm.h index 9d46ebee3b..fef821a919 100644 --- a/src/USER-SMD/compute_smd_ulsph_effm.h +++ b/src/USER-SMD/compute_smd_ulsph_effm.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMD_Ulsph_Effm : public Compute { double *dt_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_num_neighs.h b/src/USER-SMD/compute_smd_ulsph_num_neighs.h index 7ca7096c25..c4591eba1d 100644 --- a/src/USER-SMD/compute_smd_ulsph_num_neighs.h +++ b/src/USER-SMD/compute_smd_ulsph_num_neighs.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDULSPHNumNeighs : public Compute { double *numNeighsOutput; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_strain.h b/src/USER-SMD/compute_smd_ulsph_strain.h index f047918bd0..db516caf9d 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain.h +++ b/src/USER-SMD/compute_smd_ulsph_strain.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDULSPHstrain : public Compute { double **strainVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_strain_rate.h b/src/USER-SMD/compute_smd_ulsph_strain_rate.h index 16bc888288..257853e5d1 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain_rate.h +++ b/src/USER-SMD/compute_smd_ulsph_strain_rate.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDULSPHStrainRate : public Compute { double **strain_rate_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_ulsph_stress.h b/src/USER-SMD/compute_smd_ulsph_stress.h index 0e923a853d..17a23c0af7 100644 --- a/src/USER-SMD/compute_smd_ulsph_stress.h +++ b/src/USER-SMD/compute_smd_ulsph_stress.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -49,7 +48,7 @@ class ComputeSMDULSPHStress : public Compute { double **stress_array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/compute_smd_vol.h b/src/USER-SMD/compute_smd_vol.h index ed3979915d..08d6db7c18 100644 --- a/src/USER-SMD/compute_smd_vol.h +++ b/src/USER-SMD/compute_smd_vol.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -50,7 +49,7 @@ class ComputeSMDVol : public Compute { double *volVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_adjust_dt.h b/src/USER-SMD/fix_smd_adjust_dt.h index b27e89d114..3c1e8c9b3b 100644 --- a/src/USER-SMD/fix_smd_adjust_dt.h +++ b/src/USER-SMD/fix_smd_adjust_dt.h @@ -35,26 +35,25 @@ FixStyle(smd/adjust_dt,FixSMDTlsphDtReset); namespace LAMMPS_NS { -class FixSMDTlsphDtReset: public Fix { -public: - FixSMDTlsphDtReset(class LAMMPS *, int, char **); - ~FixSMDTlsphDtReset() { - } - int setmask(); - void init(); - void setup(int); - void initial_integrate(int); - void end_of_step(); - double compute_scalar(); - void write_restart(FILE *); - void restart(char *); +class FixSMDTlsphDtReset : public Fix { + public: + FixSMDTlsphDtReset(class LAMMPS *, int, char **); + ~FixSMDTlsphDtReset() {} + int setmask(); + void init(); + void setup(int); + void initial_integrate(int); + void end_of_step(); + double compute_scalar(); + void write_restart(FILE *); + void restart(char *); -private: - double safety_factor; - double dt, t_elapsed; + private: + double safety_factor; + double dt, t_elapsed; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.h b/src/USER-SMD/fix_smd_integrate_tlsph.h index 594b2b1f83..4342ec3658 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.h +++ b/src/USER-SMD/fix_smd_integrate_tlsph.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -36,28 +35,28 @@ FixStyle(smd/integrate_tlsph,FixSMDIntegrateTlsph); namespace LAMMPS_NS { -class FixSMDIntegrateTlsph: public Fix { - friend class Neighbor; - friend class PairTlsph; -public: - FixSMDIntegrateTlsph(class LAMMPS *, int, char **); - virtual ~FixSMDIntegrateTlsph() { - } - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - virtual void final_integrate(); - virtual void reset_dt(); +class FixSMDIntegrateTlsph : public Fix { + friend class Neighbor; + friend class PairTlsph; -protected: - double dtv, dtf, vlimit, vlimitsq; - int mass_require; - bool xsphFlag; + public: + FixSMDIntegrateTlsph(class LAMMPS *, int, char **); + virtual ~FixSMDIntegrateTlsph() {} + int setmask(); + virtual void init(); + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void reset_dt(); - class Pair *pair; + protected: + double dtv, dtf, vlimit, vlimitsq; + int mass_require; + bool xsphFlag; + + class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.h b/src/USER-SMD/fix_smd_integrate_ulsph.h index 29e3f849e2..c3d9af8263 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.h +++ b/src/USER-SMD/fix_smd_integrate_ulsph.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -47,18 +46,19 @@ class FixSMDIntegrateUlsph : public Fix { private: class NeighList *list; + protected: - double dtv,dtf, vlimit, vlimitsq; + double dtv, dtf, vlimit, vlimitsq; int mass_require; bool xsphFlag; bool adjust_radius_flag; double adjust_radius_factor; - int min_nn, max_nn; // number of SPH neighbors should lie within this interval + int min_nn, max_nn; // number of SPH neighbors should lie within this interval class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_move_triangulated_surface.h b/src/USER-SMD/fix_smd_move_triangulated_surface.h index d0a20c914c..9d850a178a 100644 --- a/src/USER-SMD/fix_smd_move_triangulated_surface.h +++ b/src/USER-SMD/fix_smd_move_triangulated_surface.h @@ -31,33 +31,33 @@ FixStyle(smd/move_tri_surf,FixSMDMoveTriSurf); #ifndef LMP_FIX_SMD_INTEGRATE_TRIANGULAR_SURFACE_H #define LMP_FIX_SMD_INTEGRATE_TRIANGULAR_SURFACE_H -#include #include "fix.h" +#include namespace LAMMPS_NS { -class FixSMDMoveTriSurf: public Fix { -public: - FixSMDMoveTriSurf(class LAMMPS *, int, char **); - ~FixSMDMoveTriSurf(); - int setmask(); - virtual void init(); - virtual void initial_integrate(int); - void reset_dt(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); +class FixSMDMoveTriSurf : public Fix { + public: + FixSMDMoveTriSurf(class LAMMPS *, int, char **); + ~FixSMDMoveTriSurf(); + int setmask(); + virtual void init(); + virtual void initial_integrate(int); + void reset_dt(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); -protected: - double dtv; - bool linearFlag, wiggleFlag, rotateFlag; - double vx, vy, vz; - Eigen::Vector3d rotation_axis, origin; - double rotation_period; - Eigen::Matrix3d u_cross, uxu; - double wiggle_travel, wiggle_max_travel, wiggle_direction; + protected: + double dtv; + bool linearFlag, wiggleFlag, rotateFlag; + double vx, vy, vz; + Eigen::Vector3d rotation_axis, origin; + double rotation_period; + Eigen::Matrix3d u_cross, uxu; + double wiggle_travel, wiggle_max_travel, wiggle_direction; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_setvel.h b/src/USER-SMD/fix_smd_setvel.h index fa82452060..277fd6a390 100644 --- a/src/USER-SMD/fix_smd_setvel.h +++ b/src/USER-SMD/fix_smd_setvel.h @@ -49,19 +49,19 @@ class FixSMDSetVel : public Fix { double memory_usage(); private: - double xvalue,yvalue,zvalue; - int varflag,iregion; - char *xstr,*ystr,*zstr; + double xvalue, yvalue, zvalue; + int varflag, iregion; + char *xstr, *ystr, *zstr; char *idregion; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; - double foriginal[3],foriginal_all[3]; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; + double foriginal[3], foriginal_all[3]; int force_flag; int maxatom; double **sforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.h b/src/USER-SMD/fix_smd_tlsph_reference_configuration.h index 64e573a7ba..d369812c4f 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.h +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.h @@ -24,7 +24,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifdef FIX_CLASS // clang-format off FixStyle(SMD_TLSPH_NEIGHBORS,FixSMD_TLSPH_ReferenceConfiguration); @@ -38,48 +37,46 @@ FixStyle(SMD_TLSPH_NEIGHBORS,FixSMD_TLSPH_ReferenceConfiguration); namespace LAMMPS_NS { -class FixSMD_TLSPH_ReferenceConfiguration: public Fix { - friend class Neighbor; - friend class PairTlsph; +class FixSMD_TLSPH_ReferenceConfiguration : public Fix { + friend class Neighbor; + friend class PairTlsph; -public: - FixSMD_TLSPH_ReferenceConfiguration(class LAMMPS *, int, char **); - ~FixSMD_TLSPH_ReferenceConfiguration(); - int setmask(); - void init(); - void setup(int); - void pre_exchange(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); + public: + FixSMD_TLSPH_ReferenceConfiguration(class LAMMPS *, int, char **); + ~FixSMD_TLSPH_ReferenceConfiguration(); + int setmask(); + void init(); + void setup(int); + void pre_exchange(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); - double memory_usage(); - void grow_arrays(int); - void copy_arrays(int, int, int); - int pack_exchange(int, double *); - int unpack_exchange(int, double *); - int pack_restart(int, double *); - void unpack_restart(int, int); - int size_restart(int); - int maxsize_restart(); + double memory_usage(); + void grow_arrays(int); + void copy_arrays(int, int, int); + int pack_exchange(int, double *); + int unpack_exchange(int, double *); + int pack_restart(int, double *); + void unpack_restart(int, int); + int size_restart(int); + int maxsize_restart(); - bool crack_exclude(int i, int j); - bool get_line_intersection(int i, int j); + bool crack_exclude(int i, int j); + bool get_line_intersection(int i, int j); -protected: - int updateFlag; // flag to update reference configuration - int nmax; - int maxpartner; - int *npartner; // # of touching partners of each atom - tagint **partner; // global atom IDs for the partners - float **wfd_list, **wf_list, **energy_per_bond; - float **degradation_ij; // per-pair interaction degradation status - - class Pair *pair; + protected: + int updateFlag; // flag to update reference configuration + int nmax; + int maxpartner; + int *npartner; // # of touching partners of each atom + tagint **partner; // global atom IDs for the partners + float **wfd_list, **wf_list, **energy_per_bond; + float **degradation_ij; // per-pair interaction degradation status + class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/fix_smd_wall_surface.h b/src/USER-SMD/fix_smd_wall_surface.h index f29d743d26..b0c6883a8f 100644 --- a/src/USER-SMD/fix_smd_wall_surface.h +++ b/src/USER-SMD/fix_smd_wall_surface.h @@ -24,27 +24,26 @@ FixStyle(smd/wall_surface,FixSMDWallSurface); namespace LAMMPS_NS { -class FixSMDWallSurface: public Fix { +class FixSMDWallSurface : public Fix { -public: - FixSMDWallSurface(class LAMMPS *, int, char **); - virtual ~FixSMDWallSurface(); - int setmask(); - void init(); - void setup(int); - void min_setup(int); + public: + FixSMDWallSurface(class LAMMPS *, int, char **); + virtual ~FixSMDWallSurface(); + int setmask(); + void init(); + void setup(int); + void min_setup(int); - void read_triangles(int pass); + void read_triangles(int pass); -private: - int first; // flag for first time initialization - double sublo[3], subhi[3]; // epsilon-extended proc sub-box for adding atoms; - char *filename; - int wall_particle_type; - int wall_molecule_id; + private: + int first; // flag for first time initialization + double sublo[3], subhi[3]; // epsilon-extended proc sub-box for adding atoms; + char *filename; + int wall_particle_type; + int wall_molecule_id; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/pair_smd_hertz.h b/src/USER-SMD/pair_smd_hertz.h index fbe634d143..b9ec92de78 100644 --- a/src/USER-SMD/pair_smd_hertz.h +++ b/src/USER-SMD/pair_smd_hertz.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -53,17 +52,16 @@ class PairHertz : public Pair { double **bulkmodulus; double **kn; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; double scale; - double stable_time_increment; // stable time step size + double stable_time_increment; // stable time step size void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/pair_smd_tlsph.h b/src/USER-SMD/pair_smd_tlsph.h index 2c191db74b..a64c42ce78 100644 --- a/src/USER-SMD/pair_smd_tlsph.h +++ b/src/USER-SMD/pair_smd_tlsph.h @@ -36,169 +36,178 @@ PairStyle(smd/tlsph,PairTlsph); namespace LAMMPS_NS { -class PairTlsph: public Pair { -public: +class PairTlsph : public Pair { + public: + PairTlsph(class LAMMPS *); + virtual ~PairTlsph(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + double init_one(int, int); + void init_style(); + void init_list(int, class NeighList *); + void write_restart_settings(FILE *) {} + void read_restart_settings(FILE *) {} + virtual double memory_usage(); + void compute_shape_matrix(void); + void material_model(void); + void *extract(const char *, int &); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + void AssembleStress(); - PairTlsph(class LAMMPS *); - virtual ~PairTlsph(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - void write_restart_settings(FILE *) { - } - void read_restart_settings(FILE *) { - } - virtual double memory_usage(); - void compute_shape_matrix(void); - void material_model(void); - void *extract(const char *, int &); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - void AssembleStress(); + void PreCompute(); + void ComputeForces(int eflag, int vflag); + void effective_longitudinal_modulus(const int itype, const double dt, const double d_iso, + const double p_rate, const Eigen::Matrix3d d_dev, + const Eigen::Matrix3d sigma_dev_rate, const double damage, + double &K_eff, double &mu_eff, double &M_eff); - void PreCompute(); - void ComputeForces(int eflag, int vflag); - void effective_longitudinal_modulus(const int itype, const double dt, const double d_iso, const double p_rate, - const Eigen::Matrix3d d_dev, const Eigen::Matrix3d sigma_dev_rate, const double damage, double &K_eff, double &mu_eff, double &M_eff); + void ComputePressure(const int i, const double rho, const double mass_specific_energy, + const double vol_specific_energy, const double pInitial, const double d_iso, + double &pFinal, double &p_rate); + void ComputeStressDeviator(const int i, const Eigen::Matrix3d sigmaInitial_dev, + const Eigen::Matrix3d d_dev, Eigen::Matrix3d &sigmaFinal_dev, + Eigen::Matrix3d &sigma_dev_rate, double &plastic_strain_increment); + void ComputeDamage(const int i, const Eigen::Matrix3d strain, const Eigen::Matrix3d sigmaFinal, + Eigen::Matrix3d &sigma_damaged); - void ComputePressure(const int i, const double rho, const double mass_specific_energy, const double vol_specific_energy, - const double pInitial, const double d_iso, double &pFinal, double &p_rate); - void ComputeStressDeviator(const int i, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, Eigen::Matrix3d &sigmaFinal_dev, - Eigen::Matrix3d &sigma_dev_rate, double &plastic_strain_increment); - void ComputeDamage(const int i, const Eigen::Matrix3d strain, const Eigen::Matrix3d sigmaFinal, Eigen::Matrix3d &sigma_damaged); + protected: + void allocate(); + char *suffix; - -protected: - void allocate(); - char *suffix; - - /* + /* * per-type arrays */ - int *strengthModel, *eos; - double *onerad_dynamic, *onerad_frozen, *maxrad_dynamic, *maxrad_frozen; + int *strengthModel, *eos; + double *onerad_dynamic, *onerad_frozen, *maxrad_dynamic, *maxrad_frozen; - /* + /* * per atom arrays */ - Eigen::Matrix3d *K, *PK1, *Fdot, *Fincr; - Eigen::Matrix3d *R; // rotation matrix - Eigen::Matrix3d *FincrInv; - Eigen::Matrix3d *D, *W; // strain rate and spin tensor - Eigen::Vector3d *smoothVelDifference; - Eigen::Matrix3d *CauchyStress; - double *detF, *particle_dt; - double *hourglass_error; - int *numNeighsRefConfig; + Eigen::Matrix3d *K, *PK1, *Fdot, *Fincr; + Eigen::Matrix3d *R; // rotation matrix + Eigen::Matrix3d *FincrInv; + Eigen::Matrix3d *D, *W; // strain rate and spin tensor + Eigen::Vector3d *smoothVelDifference; + Eigen::Matrix3d *CauchyStress; + double *detF, *particle_dt; + double *hourglass_error; + int *numNeighsRefConfig; - int nmax; // max number of atoms on this proc - double hMin; // minimum kernel radius for two particles - double dtCFL; - double dtRelative; // relative velocity of two particles, divided by sound speed - int updateFlag; - double update_threshold; // updateFlage is set to one if the relative displacement of a pair exceeds update_threshold - double cut_comm; + int nmax; // max number of atoms on this proc + double hMin; // minimum kernel radius for two particles + double dtCFL; + double dtRelative; // relative velocity of two particles, divided by sound speed + int updateFlag; + double + update_threshold; // updateFlage is set to one if the relative displacement of a pair exceeds update_threshold + double cut_comm; - enum { - UPDATE_NONE = 5000, UPDATE_CONSTANT_THRESHOLD = 5001, UPDATE_PAIRWISE_RATIO = 5002, - }; + enum { + UPDATE_NONE = 5000, + UPDATE_CONSTANT_THRESHOLD = 5001, + UPDATE_PAIRWISE_RATIO = 5002, + }; - enum { - LINEAR_DEFGRAD = 0, - STRENGTH_LINEAR = 1, - STRENGTH_LINEAR_PLASTIC = 2, - STRENGTH_JOHNSON_COOK = 3, - STRENGTH_NONE = 4, - EOS_LINEAR = 5, - EOS_SHOCK = 6, - EOS_POLYNOMIAL = 7, - EOS_NONE = 8, - REFERENCE_DENSITY = 9, - YOUNGS_MODULUS = 10, - POISSON_RATIO = 11, - HOURGLASS_CONTROL_AMPLITUDE = 12, - HEAT_CAPACITY = 13, - LAME_LAMBDA = 14, - SHEAR_MODULUS = 15, - M_MODULUS = 16, - SIGNAL_VELOCITY = 17, - BULK_MODULUS = 18, - VISCOSITY_Q1 = 19, - VISCOSITY_Q2 = 20, - YIELD_STRESS = 21, - FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD = 22, - JC_A = 23, - JC_B = 24, - JC_a = 25, - JC_C = 26, - JC_epdot0 = 27, - JC_T0 = 28, - JC_Tmelt = 29, - JC_M = 30, - EOS_SHOCK_C0 = 31, - EOS_SHOCK_S = 32, - EOS_SHOCK_GAMMA = 33, - HARDENING_PARAMETER = 34, - FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD = 35, - FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD = 36, - FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD = 37, - EOS_POLYNOMIAL_C0 = 38, - EOS_POLYNOMIAL_C1 = 39, - EOS_POLYNOMIAL_C2 = 40, - EOS_POLYNOMIAL_C3 = 41, - EOS_POLYNOMIAL_C4 = 42, - EOS_POLYNOMIAL_C5 = 43, - EOS_POLYNOMIAL_C6 = 44, + enum { + LINEAR_DEFGRAD = 0, + STRENGTH_LINEAR = 1, + STRENGTH_LINEAR_PLASTIC = 2, + STRENGTH_JOHNSON_COOK = 3, + STRENGTH_NONE = 4, + EOS_LINEAR = 5, + EOS_SHOCK = 6, + EOS_POLYNOMIAL = 7, + EOS_NONE = 8, + REFERENCE_DENSITY = 9, + YOUNGS_MODULUS = 10, + POISSON_RATIO = 11, + HOURGLASS_CONTROL_AMPLITUDE = 12, + HEAT_CAPACITY = 13, + LAME_LAMBDA = 14, + SHEAR_MODULUS = 15, + M_MODULUS = 16, + SIGNAL_VELOCITY = 17, + BULK_MODULUS = 18, + VISCOSITY_Q1 = 19, + VISCOSITY_Q2 = 20, + YIELD_STRESS = 21, + FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD = 22, + JC_A = 23, + JC_B = 24, + JC_a = 25, + JC_C = 26, + JC_epdot0 = 27, + JC_T0 = 28, + JC_Tmelt = 29, + JC_M = 30, + EOS_SHOCK_C0 = 31, + EOS_SHOCK_S = 32, + EOS_SHOCK_GAMMA = 33, + HARDENING_PARAMETER = 34, + FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD = 35, + FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD = 36, + FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD = 37, + EOS_POLYNOMIAL_C0 = 38, + EOS_POLYNOMIAL_C1 = 39, + EOS_POLYNOMIAL_C2 = 40, + EOS_POLYNOMIAL_C3 = 41, + EOS_POLYNOMIAL_C4 = 42, + EOS_POLYNOMIAL_C5 = 43, + EOS_POLYNOMIAL_C6 = 44, - FAILURE_JC_D1 = 45, - FAILURE_JC_D2 = 46, - FAILURE_JC_D3 = 47, - FAILURE_JC_D4 = 48, - FAILURE_JC_EPDOT0 = 49, + FAILURE_JC_D1 = 45, + FAILURE_JC_D2 = 46, + FAILURE_JC_D3 = 47, + FAILURE_JC_D4 = 48, + FAILURE_JC_EPDOT0 = 49, - CRITICAL_ENERGY_RELEASE_RATE = 50, + CRITICAL_ENERGY_RELEASE_RATE = 50, - MAX_KEY_VALUE = 51 - }; + MAX_KEY_VALUE = 51 + }; - struct failure_types { // this is defined per type and determines which failure/damage model is active - bool failure_none; - bool failure_max_principal_strain; - bool failure_max_principal_stress; - bool failure_max_plastic_strain; - bool failure_johnson_cook; - bool failure_max_pairwise_strain; - bool integration_point_wise; // true if failure model applies to stress/strain state of integration point - bool failure_energy_release_rate; + struct + failure_types { // this is defined per type and determines which failure/damage model is active + bool failure_none; + bool failure_max_principal_strain; + bool failure_max_principal_stress; + bool failure_max_plastic_strain; + bool failure_johnson_cook; + bool failure_max_pairwise_strain; + bool + integration_point_wise; // true if failure model applies to stress/strain state of integration point + bool failure_energy_release_rate; - failure_types() { - failure_none = true; - failure_max_principal_strain = false; - failure_max_principal_stress = false; - failure_max_plastic_strain = false; - failure_johnson_cook = false; - failure_max_pairwise_strain = false; - integration_point_wise = false; - failure_energy_release_rate = false; - //printf("constructed failure type\n"); - } - }; - failure_types *failureModel; + failure_types() + { + failure_none = true; + failure_max_principal_strain = false; + failure_max_principal_stress = false; + failure_max_plastic_strain = false; + failure_johnson_cook = false; + failure_max_pairwise_strain = false; + integration_point_wise = false; + failure_energy_release_rate = false; + //printf("constructed failure type\n"); + } + }; + failure_types *failureModel; - int ifix_tlsph; - int update_method; + int ifix_tlsph; + int update_method; - class FixSMD_TLSPH_ReferenceConfiguration *fix_tlsph_reference_configuration; + class FixSMD_TLSPH_ReferenceConfiguration *fix_tlsph_reference_configuration; -private: - double **Lookup; // holds per-type material parameters for the quantities defined in enum statement above. - bool first; // if first is true, do not perform any computations, because reference configuration is not ready yet. + private: + double ** + Lookup; // holds per-type material parameters for the quantities defined in enum statement above. + bool + first; // if first is true, do not perform any computations, because reference configuration is not ready yet. }; -} +} // namespace LAMMPS_NS #endif #endif @@ -221,4 +230,3 @@ private: * Blei: rho = 11.34e-6, c0=2000, s=1.46, Gamma=2.77 * Stahl 1403: rho = 7.86e-3, c=4569, s=1.49, Gamma=2.17 */ - diff --git a/src/USER-SMD/pair_smd_triangulated_surface.h b/src/USER-SMD/pair_smd_triangulated_surface.h index fb2f4e1c35..71995d04c0 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.h +++ b/src/USER-SMD/pair_smd_triangulated_surface.h @@ -9,7 +9,6 @@ * * ----------------------------------------------------------------------- */ - /* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories @@ -35,7 +34,6 @@ PairStyle(smd/tri_surface,PairTriSurf); #include "pair.h" #include - namespace LAMMPS_NS { class PairTriSurf : public Pair { @@ -49,8 +47,9 @@ class PairTriSurf : public Pair { void init_style(); void init_list(int, class NeighList *); virtual double memory_usage(); - void PointTriangleDistance(const Eigen::Vector3d P, const Eigen::Vector3d TRI1, const Eigen::Vector3d TRI2, const Eigen::Vector3d TRI3, - Eigen::Vector3d &CP, double &dist); + void PointTriangleDistance(const Eigen::Vector3d P, const Eigen::Vector3d TRI1, + const Eigen::Vector3d TRI2, const Eigen::Vector3d TRI3, + Eigen::Vector3d &CP, double &dist); double clamp(const double a, const double min, const double max); void *extract(const char *, int &); @@ -58,16 +57,16 @@ class PairTriSurf : public Pair { double **bulkmodulus; double **kn; - double *onerad_dynamic,*onerad_frozen; - double *maxrad_dynamic,*maxrad_frozen; + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; double scale; - double stable_time_increment; // stable time step size + double stable_time_increment; // stable time step size void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SMD/pair_smd_ulsph.h b/src/USER-SMD/pair_smd_ulsph.h index 9d8e2b7d71..3af6bd68e0 100644 --- a/src/USER-SMD/pair_smd_ulsph.h +++ b/src/USER-SMD/pair_smd_ulsph.h @@ -36,101 +36,98 @@ PairStyle(smd/ulsph,PairULSPH); namespace LAMMPS_NS { -class PairULSPH: public Pair { -public: - PairULSPH(class LAMMPS *); - virtual ~PairULSPH(); - virtual void compute(int, int); - void settings(int, char **); - void coeff(int, char **); - double init_one(int, int); - void init_style(); - void init_list(int, class NeighList *); - virtual double memory_usage(); - int pack_forward_comm(int, int *, double *, int, int *); - void unpack_forward_comm(int, int, double *); - void AssembleStressTensor(); - void *extract(const char *, int &); - void PreCompute(); - void PreCompute_DensitySummation(); - double effective_shear_modulus(const Eigen::Matrix3d d_dev, const Eigen::Matrix3d deltaStressDev, const double dt, const int itype); +class PairULSPH : public Pair { + public: + PairULSPH(class LAMMPS *); + virtual ~PairULSPH(); + virtual void compute(int, int); + void settings(int, char **); + void coeff(int, char **); + double init_one(int, int); + void init_style(); + void init_list(int, class NeighList *); + virtual double memory_usage(); + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + void AssembleStressTensor(); + void *extract(const char *, int &); + void PreCompute(); + void PreCompute_DensitySummation(); + double effective_shear_modulus(const Eigen::Matrix3d d_dev, const Eigen::Matrix3d deltaStressDev, + const double dt, const int itype); - Eigen::Vector3d ComputeHourglassForce(const int i, const int itype, const int j, const int jtype, const Eigen::Vector3d dv, - const Eigen::Vector3d xij, const Eigen::Vector3d g, const double c_ij, const double mu_ij, const double rho_ij); + Eigen::Vector3d ComputeHourglassForce(const int i, const int itype, const int j, const int jtype, + const Eigen::Vector3d dv, const Eigen::Vector3d xij, + const Eigen::Vector3d g, const double c_ij, + const double mu_ij, const double rho_ij); -protected: + protected: + double *c0_type; // reference speed of sound defined per particle type + double *rho0; // reference mass density per type + double *Q1; // linear artificial viscosity coeff + int *eos, *viscosity, *strength; // eos and strength material models + double **artificial_pressure; // true/false: use Monaghan's artificial pressure correction? + double **artificial_stress; // artificial stress amplitude - double *c0_type; // reference speed of sound defined per particle type - double *rho0; // reference mass density per type - double *Q1; // linear artificial viscosity coeff - int *eos, *viscosity, *strength; // eos and strength material models - double **artificial_pressure; // true/false: use Monaghan's artificial pressure correction? - double **artificial_stress; // artificial stress amplitude + double *onerad_dynamic, *onerad_frozen; + double *maxrad_dynamic, *maxrad_frozen; - double *onerad_dynamic, *onerad_frozen; - double *maxrad_dynamic, *maxrad_frozen; + void allocate(); - void allocate(); + int nmax; // max number of atoms on this proc + int *numNeighs; + Eigen::Matrix3d *K; + double *shepardWeight, *c0, *rho; + Eigen::Vector3d *smoothVel; + Eigen::Matrix3d *stressTensor, *L, *F; - int nmax; // max number of atoms on this proc - int *numNeighs; - Eigen::Matrix3d *K; - double *shepardWeight, *c0, *rho; - Eigen::Vector3d *smoothVel; - Eigen::Matrix3d *stressTensor, *L, *F; + double dtCFL; - double dtCFL; + private: + // enumerate EOSs. MUST BE IN THE RANGE [1000, 2000) + enum { + EOS_LINEAR = 1000, + EOS_PERFECT_GAS = 1001, + EOS_TAIT = 1002, + }; -private: + // enumerate physical viscosity models. MUST BE IN THE RANGE [2000, 3000) + enum { VISCOSITY_NEWTON = 2000 }; - // enumerate EOSs. MUST BE IN THE RANGE [1000, 2000) - enum { - EOS_LINEAR = 1000, EOS_PERFECT_GAS = 1001, EOS_TAIT = 1002, - }; + // enumerate strength models. MUST BE IN THE RANGE [3000, 4000) + enum { STRENGTH_LINEAR = 3000, STRENGTH_LINEAR_PLASTIC = 3001 }; - // enumerate physical viscosity models. MUST BE IN THE RANGE [2000, 3000) - enum { - VISCOSITY_NEWTON = 2000 - }; + // enumerate some quantitities and associate these with integer values such that they can be used for lookup in an array structure + enum { + NONE = 0, + BULK_MODULUS = 1, + HOURGLASS_CONTROL_AMPLITUDE = 2, + EOS_TAIT_EXPONENT = 3, + REFERENCE_SOUNDSPEED = 4, + REFERENCE_DENSITY = 5, + EOS_PERFECT_GAS_GAMMA = 6, + SHEAR_MODULUS = 7, + YIELD_STRENGTH = 8, + YOUNGS_MODULUS = 9, + POISSON_RATIO = 10, + LAME_LAMBDA = 11, + HEAT_CAPACITY = 12, + M_MODULUS = 13, + HARDENING_PARAMETER = 14, + VISCOSITY_MU = 15, + MAX_KEY_VALUE = 16 + }; + double ** + Lookup; // holds per-type material parameters for the quantities defined in enum statement above. - // enumerate strength models. MUST BE IN THE RANGE [3000, 4000) - enum { - STRENGTH_LINEAR = 3000, STRENGTH_LINEAR_PLASTIC = 3001 - }; - - // enumerate some quantitities and associate these with integer values such that they can be used for lookup in an array structure - enum { - NONE = 0, - BULK_MODULUS = 1, - HOURGLASS_CONTROL_AMPLITUDE = 2, - EOS_TAIT_EXPONENT = 3, - REFERENCE_SOUNDSPEED = 4, - REFERENCE_DENSITY = 5, - EOS_PERFECT_GAS_GAMMA = 6, - SHEAR_MODULUS = 7, - YIELD_STRENGTH = 8, - YOUNGS_MODULUS = 9, - POISSON_RATIO = 10, - LAME_LAMBDA = 11, - HEAT_CAPACITY = 12, - M_MODULUS = 13, - HARDENING_PARAMETER = 14, - VISCOSITY_MU = 15, - MAX_KEY_VALUE = 16 - }; - double **Lookup; // holds per-type material parameters for the quantities defined in enum statement above. - - bool velocity_gradient_required; - int updateFlag; // indicates if any relative particle pair movement is significant compared to smoothing length - - - bool density_summation, density_continuity, velocity_gradient, gradient_correction_flag; - double *effm; + bool velocity_gradient_required; + int updateFlag; // indicates if any relative particle pair movement is significant compared to smoothing length + bool density_summation, density_continuity, velocity_gradient, gradient_correction_flag; + double *effm; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-SMD/smd_kernels.h b/src/USER-SMD/smd_kernels.h index 3bc89b7e64..67244b64d3 100644 --- a/src/USER-SMD/smd_kernels.h +++ b/src/USER-SMD/smd_kernels.h @@ -13,134 +13,142 @@ #define SMD_KERNEL_FUNCTIONS_H_ namespace SMD_Kernels { -static inline double Kernel_Wendland_Quintic_NotNormalized(const double r, const double h) { - if (r < h) { - double q = 2.0 * r / h; - return pow(1.0 - 0.5 * q, 4) * (2.0 * q + 1.0); - } else { - return 0.0; - } +static inline double Kernel_Wendland_Quintic_NotNormalized(const double r, const double h) +{ + if (r < h) { + double q = 2.0 * r / h; + return pow(1.0 - 0.5 * q, 4) * (2.0 * q + 1.0); + } else { + return 0.0; + } } -static inline double Kernel_Cubic_Spline(const double r, const double h) { - double q = 2.0 * r / h; - if (q > 2.0) { - return 0.0; - } else if ((q <= 2.0) && (q > 1.0)) { - return pow(2.0 - q, 3.0) / 6.0; - } else if ((q >= 0.0) && (q <= 1.0)) { - return 2. / 3. - q * q + 0.5 * q * q * q; - } else { - return 0.0; - } +static inline double Kernel_Cubic_Spline(const double r, const double h) +{ + double q = 2.0 * r / h; + if (q > 2.0) { + return 0.0; + } else if ((q <= 2.0) && (q > 1.0)) { + return pow(2.0 - q, 3.0) / 6.0; + } else if ((q >= 0.0) && (q <= 1.0)) { + return 2. / 3. - q * q + 0.5 * q * q * q; + } else { + return 0.0; + } } -static inline double Kernel_Barbara(const double r, const double h) { - double arg = (1.570796327 * (r + h)) / h; - double hsq = h * h; - //wf = (1.680351548 * (cos(arg) + 1.)) / hsq; - return -2.639490040 * sin(arg) / (hsq * h); +static inline double Kernel_Barbara(const double r, const double h) +{ + double arg = (1.570796327 * (r + h)) / h; + double hsq = h * h; + //wf = (1.680351548 * (cos(arg) + 1.)) / hsq; + return -2.639490040 * sin(arg) / (hsq * h); } -static inline void spiky_kernel_and_derivative(const double h, const double r, const int dimension, double &wf, double &wfd) { +static inline void spiky_kernel_and_derivative(const double h, const double r, const int dimension, + double &wf, double &wfd) +{ - /* + /* * Spiky kernel */ - if (r > h) { - printf("r=%f > h=%f in Spiky kernel\n", r, h); - wf = wfd = 0.0; - return; - } + if (r > h) { + printf("r=%f > h=%f in Spiky kernel\n", r, h); + wf = wfd = 0.0; + return; + } - double hr = h - r; // [m] - if (dimension == 2) { - double n = 0.3141592654e0 * h * h * h * h * h; // [m^5] - wfd = -3.0e0 * hr * hr / n; // [m*m/m^5] = [1/m^3] ==> correct for dW/dr in 2D - wf = -0.333333333333e0 * hr * wfd; // [m/m^3] ==> [1/m^2] correct for W in 2D - } else { - wfd = -14.0323944878e0 * hr * hr / (h * h * h * h * h * h); // [1/m^4] ==> correct for dW/dr in 3D - wf = -0.333333333333e0 * hr * wfd; // [m/m^4] ==> [1/m^3] correct for W in 3D - } - - // alternative formulation -// double hr = h - r; -// -// /* -// * Spiky kernel -// */ -// -// if (domain->dimension == 2) { -// double h5 = h * h * h * h * h; -// wf = 3.183098861e0 * hr * hr * hr / h5; -// wfd = -9.549296583 * hr * hr / h5; -// -// } else { -// double h6 = h * h * h * h * h * h; -// wf = 4.774648292 * hr * hr * hr / h6; -// wfd = -14.32394487 * hr * hr / h6; -// } -// } + double hr = h - r; // [m] + if (dimension == 2) { + double n = 0.3141592654e0 * h * h * h * h * h; // [m^5] + wfd = -3.0e0 * hr * hr / n; // [m*m/m^5] = [1/m^3] ==> correct for dW/dr in 2D + wf = -0.333333333333e0 * hr * wfd; // [m/m^3] ==> [1/m^2] correct for W in 2D + } else { + wfd = -14.0323944878e0 * hr * hr / + (h * h * h * h * h * h); // [1/m^4] ==> correct for dW/dr in 3D + wf = -0.333333333333e0 * hr * wfd; // [m/m^4] ==> [1/m^3] correct for W in 3D + } + // alternative formulation + // double hr = h - r; + // + // /* + // * Spiky kernel + // */ + // + // if (domain->dimension == 2) { + // double h5 = h * h * h * h * h; + // wf = 3.183098861e0 * hr * hr * hr / h5; + // wfd = -9.549296583 * hr * hr / h5; + // + // } else { + // double h6 = h * h * h * h * h * h; + // wf = 4.774648292 * hr * hr * hr / h6; + // wfd = -14.32394487 * hr * hr / h6; + // } + // } } -static inline void barbara_kernel_and_derivative(const double h, const double r, const int dimension, double &wf, double &wfd) { +static inline void barbara_kernel_and_derivative(const double h, const double r, + const int dimension, double &wf, double &wfd) +{ - /* + /* * Barbara kernel */ - double arg = (1.570796327 * (r + h)) / h; - double hsq = h * h; + double arg = (1.570796327 * (r + h)) / h; + double hsq = h * h; - if (r > h) { - printf("r = %f > h = %f in barbara kernel function\n", r, h); - exit(1); - //wf = wfd = 0.0; - //return; - } + if (r > h) { + printf("r = %f > h = %f in barbara kernel function\n", r, h); + exit(1); + //wf = wfd = 0.0; + //return; + } - if (dimension == 2) { - wf = (1.680351548 * (cos(arg) + 1.)) / hsq; - wfd = -2.639490040 * sin(arg) / (hsq * h); - } else { - wf = 2.051578323 * (cos(arg) + 1.) / (hsq * h); - wfd = -3.222611694 * sin(arg) / (hsq * hsq); - } + if (dimension == 2) { + wf = (1.680351548 * (cos(arg) + 1.)) / hsq; + wfd = -2.639490040 * sin(arg) / (hsq * h); + } else { + wf = 2.051578323 * (cos(arg) + 1.) / (hsq * h); + wfd = -3.222611694 * sin(arg) / (hsq * hsq); + } } /* * compute a normalized smoothing kernel only */ -static inline void Poly6Kernel(const double hsq, const double h, const double rsq, const int dimension, double &wf) { +static inline void Poly6Kernel(const double hsq, const double h, const double rsq, + const int dimension, double &wf) +{ - double tmp = hsq - rsq; - if (dimension == 2) { - wf = tmp * tmp * tmp / (0.7853981635e0 * hsq * hsq * hsq * hsq); - } else { - wf = tmp * tmp * tmp / (0.6382918409e0 * hsq * hsq * hsq * hsq * h); - } + double tmp = hsq - rsq; + if (dimension == 2) { + wf = tmp * tmp * tmp / (0.7853981635e0 * hsq * hsq * hsq * hsq); + } else { + wf = tmp * tmp * tmp / (0.6382918409e0 * hsq * hsq * hsq * hsq * h); + } } /* * M4 Prime Kernel */ -static inline void M4PrimeKernel(const double s, double &wf) { - if (s < 1.0) { - //wf = 1.0 - 2.5 * s * s + (3./2.) * s * s * s; - wf = 1.0 - s * s *(2.5 -1.5 *s); - } else if (s < 2.0) { - //wf = 0.5 * (1.0 - s) * ((2.0 - s) * (2.0 - s)); - wf = 2.0 + (-4.0 + (2.5 - 0.5 * s)*s)*s; - } else { - wf = 0.0; - } +static inline void M4PrimeKernel(const double s, double &wf) +{ + if (s < 1.0) { + //wf = 1.0 - 2.5 * s * s + (3./2.) * s * s * s; + wf = 1.0 - s * s * (2.5 - 1.5 * s); + } else if (s < 2.0) { + //wf = 0.5 * (1.0 - s) * ((2.0 - s) * (2.0 - s)); + wf = 2.0 + (-4.0 + (2.5 - 0.5 * s) * s) * s; + } else { + wf = 0.0; + } } -} - - +} // namespace SMD_Kernels #endif /* SMD_KERNEL_FUNCTIONS_H_ */ diff --git a/src/USER-SMD/smd_material_models.h b/src/USER-SMD/smd_material_models.h index 761ac4ec8a..1f86605ac8 100644 --- a/src/USER-SMD/smd_material_models.h +++ b/src/USER-SMD/smd_material_models.h @@ -31,25 +31,33 @@ * EOS models */ void LinearEOS(double lambda, double pInitial, double d, double dt, double &pFinal, double &p_rate); -void ShockEOS(double rho, double rho0, double e, double e0, double c0, double S, double Gamma, double pInitial, double dt, - double &pFinal, double &p_rate); -void polynomialEOS(double rho, double rho0, double e, double C0, double C1, double C2, double C3, double C4, double C5, double C6, - double pInitial, double dt, double &pFinal, double &p_rate); -void TaitEOS_density(const double exponent, const double c0_reference, const double rho_reference, const double rho_current, - double &pressure, double &sound_speed); -void PerfectGasEOS(const double gamma, const double vol, const double mass, const double energy, double &pFinal__, double &c0); +void ShockEOS(double rho, double rho0, double e, double e0, double c0, double S, double Gamma, + double pInitial, double dt, double &pFinal, double &p_rate); +void polynomialEOS(double rho, double rho0, double e, double C0, double C1, double C2, double C3, + double C4, double C5, double C6, double pInitial, double dt, double &pFinal, + double &p_rate); +void TaitEOS_density(const double exponent, const double c0_reference, const double rho_reference, + const double rho_current, double &pressure, double &sound_speed); +void PerfectGasEOS(const double gamma, const double vol, const double mass, const double energy, + double &pFinal__, double &c0); /* * Material strength models */ -void LinearStrength(const double mu, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, const double dt, - Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__); -void LinearPlasticStrength(const double G, const double yieldStress, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, - const double dt, Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); -void JohnsonCookStrength(const double G, const double cp, const double espec, const double A, const double B, const double a, - const double C, const double epdot0, const double T0, const double Tmelt, const double M, const double dt, const double ep, - const double epdot, const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, Eigen::Matrix3d &sigmaFinal_dev__, - Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); +void LinearStrength(const double mu, const Eigen::Matrix3d sigmaInitial_dev, + const Eigen::Matrix3d d_dev, const double dt, Eigen::Matrix3d &sigmaFinal_dev__, + Eigen::Matrix3d &sigma_dev_rate__); +void LinearPlasticStrength(const double G, const double yieldStress, + const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, + const double dt, Eigen::Matrix3d &sigmaFinal_dev__, + Eigen::Matrix3d &sigma_dev_rate__, double &plastic_strain_increment); +void JohnsonCookStrength(const double G, const double cp, const double espec, const double A, + const double B, const double a, const double C, const double epdot0, + const double T0, const double Tmelt, const double M, const double dt, + const double ep, const double epdot, + const Eigen::Matrix3d sigmaInitial_dev, const Eigen::Matrix3d d_dev, + Eigen::Matrix3d &sigmaFinal_dev__, Eigen::Matrix3d &sigma_dev_rate__, + double &plastic_strain_increment); /* * Damage models @@ -57,9 +65,8 @@ void JohnsonCookStrength(const double G, const double cp, const double espec, co bool IsotropicMaxStrainDamage(const Eigen::Matrix3d E, const double maxStrain); bool IsotropicMaxStressDamage(const Eigen::Matrix3d E, const double maxStrain); -double JohnsonCookFailureStrain(const double p, const Eigen::Matrix3d Sdev, const double d1, const double d2, const double d3, - const double d4, const double epdot0, const double epdot); - - +double JohnsonCookFailureStrain(const double p, const Eigen::Matrix3d Sdev, const double d1, + const double d2, const double d3, const double d4, + const double epdot0, const double epdot); #endif /* SMD_MATERIAL_MODELS_H_ */ diff --git a/src/USER-SMD/smd_math.h b/src/USER-SMD/smd_math.h index 52e7c983d5..de8658b59c 100644 --- a/src/USER-SMD/smd_math.h +++ b/src/USER-SMD/smd_math.h @@ -16,23 +16,25 @@ #include namespace SMD_Math { -static inline void LimitDoubleMagnitude(double &x, const double limit) { - /* +static inline void LimitDoubleMagnitude(double &x, const double limit) +{ + /* * if |x| exceeds limit, set x to limit with the sign of x */ - if (fabs(x) > limit) { // limit delVdotDelR to a fraction of speed of sound - x = limit * copysign(1.0, x); - } + if (fabs(x) > limit) { // limit delVdotDelR to a fraction of speed of sound + x = limit * copysign(1.0, x); + } } /* * deviator of a tensor */ -static inline Eigen::Matrix3d Deviator(const Eigen::Matrix3d M) { - Eigen::Matrix3d eye; - eye.setIdentity(); - eye *= M.trace() / 3.0; - return M - eye; +static inline Eigen::Matrix3d Deviator(const Eigen::Matrix3d M) +{ + Eigen::Matrix3d eye; + eye.setIdentity(); + eye *= M.trace() / 3.0; + return M - eye; } /* @@ -50,211 +52,230 @@ static inline Eigen::Matrix3d Deviator(const Eigen::Matrix3d M) { * obtained again from an SVD. The rotation should proper now, i.e., det(R) = +1. */ -static inline bool PolDec(Eigen::Matrix3d M, Eigen::Matrix3d &R, Eigen::Matrix3d &T, bool scaleF) { +static inline bool PolDec(Eigen::Matrix3d M, Eigen::Matrix3d &R, Eigen::Matrix3d &T, bool scaleF) +{ - Eigen::JacobiSVD svd(M, Eigen::ComputeFullU | Eigen::ComputeFullV); // SVD(A) = U S V* - Eigen::Vector3d S_eigenvalues = svd.singularValues(); - Eigen::Matrix3d S = svd.singularValues().asDiagonal(); - Eigen::Matrix3d U = svd.matrixU(); - Eigen::Matrix3d V = svd.matrixV(); - Eigen::Matrix3d eye; - eye.setIdentity(); + Eigen::JacobiSVD svd( + M, Eigen::ComputeFullU | Eigen::ComputeFullV); // SVD(A) = U S V* + Eigen::Vector3d S_eigenvalues = svd.singularValues(); + Eigen::Matrix3d S = svd.singularValues().asDiagonal(); + Eigen::Matrix3d U = svd.matrixU(); + Eigen::Matrix3d V = svd.matrixV(); + Eigen::Matrix3d eye; + eye.setIdentity(); - // now do polar decomposition into M = R * T, where R is rotation - // and T is translation matrix - R = U * V.transpose(); - T = V * S * V.transpose(); + // now do polar decomposition into M = R * T, where R is rotation + // and T is translation matrix + R = U * V.transpose(); + T = V * S * V.transpose(); - if (R.determinant() < 0.0) { // this is an improper rotation - // identify the smallest entry in S and flip its sign - int imin; - S_eigenvalues.minCoeff(&imin); - S(imin, imin) *= -1.0; + if (R.determinant() < 0.0) { // this is an improper rotation + // identify the smallest entry in S and flip its sign + int imin; + S_eigenvalues.minCoeff(&imin); + S(imin, imin) *= -1.0; - R = M * V * S.inverse() * V.transpose(); // recompute R using flipped stretch eigenvalues - } + R = M * V * S.inverse() * V.transpose(); // recompute R using flipped stretch eigenvalues + } - /* + /* * scale S to avoid small principal strains */ - if (scaleF) { - double min = 0.3; // 0.3^2 = 0.09, should suffice for most problems - double max = 2.0; - for (int i = 0; i < 3; i++) { - if (S(i, i) < min) { - S(i, i) = min; - } else if (S(i, i) > max) { - S(i, i) = max; - } - } - T = V * S * V.transpose(); - } + if (scaleF) { + double min = 0.3; // 0.3^2 = 0.09, should suffice for most problems + double max = 2.0; + for (int i = 0; i < 3; i++) { + if (S(i, i) < min) { + S(i, i) = min; + } else if (S(i, i) > max) { + S(i, i) = max; + } + } + T = V * S * V.transpose(); + } - if (R.determinant() > 0.0) { - return true; - } else { - return false; - } + if (R.determinant() > 0.0) { + return true; + } else { + return false; + } } /* * Pseudo-inverse via SVD */ -static inline void pseudo_inverse_SVD(Eigen::Matrix3d &M) { +static inline void pseudo_inverse_SVD(Eigen::Matrix3d &M) +{ - Eigen::JacobiSVD svd(M, Eigen::ComputeFullU); // one Eigevector base is sufficient because matrix is square and symmetric + Eigen::JacobiSVD svd( + M, + Eigen:: + ComputeFullU); // one Eigevector base is sufficient because matrix is square and symmetric - Eigen::Vector3d singularValuesInv; - Eigen::Vector3d singularValues = svd.singularValues(); + Eigen::Vector3d singularValuesInv; + Eigen::Vector3d singularValues = svd.singularValues(); - double pinvtoler = 1.0e-16; // 2d machining example goes unstable if this value is increased (1.0e-16). - for (int row = 0; row < 3; row++) { - if (singularValues(row) > pinvtoler) { - singularValuesInv(row) = 1.0 / singularValues(row); - } else { - singularValuesInv(row) = 0.0; - } - } + double pinvtoler = + 1.0e-16; // 2d machining example goes unstable if this value is increased (1.0e-16). + for (int row = 0; row < 3; row++) { + if (singularValues(row) > pinvtoler) { + singularValuesInv(row) = 1.0 / singularValues(row); + } else { + singularValuesInv(row) = 0.0; + } + } - M = svd.matrixU() * singularValuesInv.asDiagonal() * svd.matrixU().transpose(); + M = svd.matrixU() * singularValuesInv.asDiagonal() * svd.matrixU().transpose(); } /* * test if two matrices are equal */ -static inline double TestMatricesEqual(Eigen::Matrix3d A, Eigen::Matrix3d B, double eps) { - Eigen::Matrix3d diff; - diff = A - B; - double norm = diff.norm(); - if (norm > eps) { - std::cout << "Matrices A and B are not equal! The L2-norm difference is: " << norm << "\n" - << "Here is matrix A:\n" << A << "\n" - << "Here is matrix B:\n" << B << std::endl; - } - return norm; +static inline double TestMatricesEqual(Eigen::Matrix3d A, Eigen::Matrix3d B, double eps) +{ + Eigen::Matrix3d diff; + diff = A - B; + double norm = diff.norm(); + if (norm > eps) { + std::cout << "Matrices A and B are not equal! The L2-norm difference is: " << norm << "\n" + << "Here is matrix A:\n" + << A << "\n" + << "Here is matrix B:\n" + << B << std::endl; + } + return norm; } /* ---------------------------------------------------------------------- Limit eigenvalues of a matrix to upper and lower bounds. ------------------------------------------------------------------------- */ -static inline Eigen::Matrix3d LimitEigenvalues(Eigen::Matrix3d S, double limitEigenvalue) { +static inline Eigen::Matrix3d LimitEigenvalues(Eigen::Matrix3d S, double limitEigenvalue) +{ - /* + /* * compute Eigenvalues of matrix S */ - Eigen::SelfAdjointEigenSolver < Eigen::Matrix3d > es; - es.compute(S); + Eigen::SelfAdjointEigenSolver es; + es.compute(S); - double max_eigenvalue = es.eigenvalues().maxCoeff(); - double min_eigenvalue = es.eigenvalues().minCoeff(); - double amax_eigenvalue = fabs(max_eigenvalue); - double amin_eigenvalue = fabs(min_eigenvalue); + double max_eigenvalue = es.eigenvalues().maxCoeff(); + double min_eigenvalue = es.eigenvalues().minCoeff(); + double amax_eigenvalue = fabs(max_eigenvalue); + double amin_eigenvalue = fabs(min_eigenvalue); - if ((amax_eigenvalue > limitEigenvalue) || (amin_eigenvalue > limitEigenvalue)) { - if (amax_eigenvalue > amin_eigenvalue) { // need to scale with max_eigenvalue - double scale = amax_eigenvalue / limitEigenvalue; - Eigen::Matrix3d V = es.eigenvectors(); - Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix - S_diag /= scale; - Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix - return S_scaled; - } else { // need to scale using min_eigenvalue - double scale = amin_eigenvalue / limitEigenvalue; - Eigen::Matrix3d V = es.eigenvectors(); - Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix - S_diag /= scale; - Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix - return S_scaled; - } - } else { // limiting does not apply - return S; - } + if ((amax_eigenvalue > limitEigenvalue) || (amin_eigenvalue > limitEigenvalue)) { + if (amax_eigenvalue > amin_eigenvalue) { // need to scale with max_eigenvalue + double scale = amax_eigenvalue / limitEigenvalue; + Eigen::Matrix3d V = es.eigenvectors(); + Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix + S_diag /= scale; + Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix + return S_scaled; + } else { // need to scale using min_eigenvalue + double scale = amin_eigenvalue / limitEigenvalue; + Eigen::Matrix3d V = es.eigenvectors(); + Eigen::Matrix3d S_diag = V.inverse() * S * V; // diagonalized input matrix + S_diag /= scale; + Eigen::Matrix3d S_scaled = V * S_diag * V.inverse(); // undiagonalize matrix + return S_scaled; + } + } else { // limiting does not apply + return S; + } } -static inline bool LimitMinMaxEigenvalues(Eigen::Matrix3d &S, double min, double max) { +static inline bool LimitMinMaxEigenvalues(Eigen::Matrix3d &S, double min, double max) +{ - /* + /* * compute Eigenvalues of matrix S */ - Eigen::SelfAdjointEigenSolver < Eigen::Matrix3d > es; - es.compute(S); + Eigen::SelfAdjointEigenSolver es; + es.compute(S); - if ((es.eigenvalues().maxCoeff() > max) || (es.eigenvalues().minCoeff() < min)) { - Eigen::Matrix3d S_diag = es.eigenvalues().asDiagonal(); - Eigen::Matrix3d V = es.eigenvectors(); - for (int i = 0; i < 3; i++) { - if (S_diag(i, i) < min) { - //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), min); - //printf("these are the eigenvalues of U: %f %f %f\n", es.eigenvalues()(0), es.eigenvalues()(1), es.eigenvalues()(2)); - S_diag(i, i) = min; - } else if (S_diag(i, i) > max) { - //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), max); - S_diag(i, i) = max; - } - } - S = V * S_diag * V.inverse(); // undiagonalize matrix - return true; - } else { - return false; - } + if ((es.eigenvalues().maxCoeff() > max) || (es.eigenvalues().minCoeff() < min)) { + Eigen::Matrix3d S_diag = es.eigenvalues().asDiagonal(); + Eigen::Matrix3d V = es.eigenvectors(); + for (int i = 0; i < 3; i++) { + if (S_diag(i, i) < min) { + //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), min); + //printf("these are the eigenvalues of U: %f %f %f\n", es.eigenvalues()(0), es.eigenvalues()(1), es.eigenvalues()(2)); + S_diag(i, i) = min; + } else if (S_diag(i, i) > max) { + //printf("limiting eigenvalue %f --> %f\n", S_diag(i, i), max); + S_diag(i, i) = max; + } + } + S = V * S_diag * V.inverse(); // undiagonalize matrix + return true; + } else { + return false; + } } -static inline void reconstruct_rank_deficient_shape_matrix(Eigen::Matrix3d &K) { +static inline void reconstruct_rank_deficient_shape_matrix(Eigen::Matrix3d &K) +{ - Eigen::JacobiSVD svd(K, Eigen::ComputeFullU | Eigen::ComputeFullV); - Eigen::Vector3d singularValues = svd.singularValues(); + Eigen::JacobiSVD svd(K, Eigen::ComputeFullU | Eigen::ComputeFullV); + Eigen::Vector3d singularValues = svd.singularValues(); - for (int i = 0; i < 3; i++) { - if (singularValues(i) < 1.0e-8) { - singularValues(i) = 1.0; - } - } + for (int i = 0; i < 3; i++) { + if (singularValues(i) < 1.0e-8) { singularValues(i) = 1.0; } + } -// int imin; -// double minev = singularValues.minCoeff(&imin); -// -// printf("min eigenvalue=%f has index %d\n", minev, imin); -// Vector3d singularVec = U.col(0).cross(U.col(1)); -// cout << "the eigenvalues are " << endl << singularValues << endl; -// cout << "the singular vector is " << endl << singularVec << endl; -// -// // reconstruct original K -// -// singularValues(2) = 1.0; + // int imin; + // double minev = singularValues.minCoeff(&imin); + // + // printf("min eigenvalue=%f has index %d\n", minev, imin); + // Vector3d singularVec = U.col(0).cross(U.col(1)); + // cout << "the eigenvalues are " << endl << singularValues << endl; + // cout << "the singular vector is " << endl << singularVec << endl; + // + // // reconstruct original K + // + // singularValues(2) = 1.0; - K = svd.matrixU() * singularValues.asDiagonal() * svd.matrixV().transpose(); - //cout << "the reconstructed K is " << endl << K << endl; - //exit(1); + K = svd.matrixU() * singularValues.asDiagonal() * svd.matrixV().transpose(); + //cout << "the reconstructed K is " << endl << K << endl; + //exit(1); } /* ---------------------------------------------------------------------- helper functions for crack_exclude ------------------------------------------------------------------------- */ -static inline bool IsOnSegment(double xi, double yi, double xj, double yj, double xk, double yk) { - return (xi <= xk || xj <= xk) && (xk <= xi || xk <= xj) && (yi <= yk || yj <= yk) && (yk <= yi || yk <= yj); +static inline bool IsOnSegment(double xi, double yi, double xj, double yj, double xk, double yk) +{ + return (xi <= xk || xj <= xk) && (xk <= xi || xk <= xj) && (yi <= yk || yj <= yk) && + (yk <= yi || yk <= yj); } -static inline char ComputeDirection(double xi, double yi, double xj, double yj, double xk, double yk) { - double a = (xk - xi) * (yj - yi); - double b = (xj - xi) * (yk - yi); - return a < b ? -1.0 : a > b ? 1.0 : 0; +static inline char ComputeDirection(double xi, double yi, double xj, double yj, double xk, + double yk) +{ + double a = (xk - xi) * (yj - yi); + double b = (xj - xi) * (yk - yi); + return a < b ? -1.0 : a > b ? 1.0 : 0; } /** Do line segments (x1, y1)--(x2, y2) and (x3, y3)--(x4, y4) intersect? */ -static inline bool DoLineSegmentsIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) { - char d1 = ComputeDirection(x3, y3, x4, y4, x1, y1); - char d2 = ComputeDirection(x3, y3, x4, y4, x2, y2); - char d3 = ComputeDirection(x1, y1, x2, y2, x3, y3); - char d4 = ComputeDirection(x1, y1, x2, y2, x4, y4); - return (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) - || (d1 == 0 && IsOnSegment(x3, y3, x4, y4, x1, y1)) || (d2 == 0 && IsOnSegment(x3, y3, x4, y4, x2, y2)) - || (d3 == 0 && IsOnSegment(x1, y1, x2, y2, x3, y3)) || (d4 == 0 && IsOnSegment(x1, y1, x2, y2, x4, y4)); +static inline bool DoLineSegmentsIntersect(double x1, double y1, double x2, double y2, double x3, + double y3, double x4, double y4) +{ + char d1 = ComputeDirection(x3, y3, x4, y4, x1, y1); + char d2 = ComputeDirection(x3, y3, x4, y4, x2, y2); + char d3 = ComputeDirection(x1, y1, x2, y2, x3, y3); + char d4 = ComputeDirection(x1, y1, x2, y2, x4, y4); + return (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && + ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) || + (d1 == 0 && IsOnSegment(x3, y3, x4, y4, x1, y1)) || + (d2 == 0 && IsOnSegment(x3, y3, x4, y4, x2, y2)) || + (d3 == 0 && IsOnSegment(x1, y1, x2, y2, x3, y3)) || + (d4 == 0 && IsOnSegment(x1, y1, x2, y2, x4, y4)); } -} +} // namespace SMD_Math #endif /* SMD_MATH_H_ */ - diff --git a/src/USER-SMTBQ/pair_smtbq.h b/src/USER-SMTBQ/pair_smtbq.h index 5ec9e80a95..c72608d128 100644 --- a/src/USER-SMTBQ/pair_smtbq.h +++ b/src/USER-SMTBQ/pair_smtbq.h @@ -36,151 +36,150 @@ class PairSMTBQ : public Pair { double init_one(int, int); double memory_usage(); - -protected: + protected: struct Param { - double sto,n0,ne,chi,dj; - double R,dzeta; //Rayon slater + double sto, n0, ne, chi, dj; + double R, dzeta; //Rayon slater double cutsq; - double qform, masse; // Charge formelle + double qform, masse; // Charge formelle char *nom; }; struct Intparam { - double a,p,ksi,q,r0,dc1,dc2; - double abuck,rhobuck,neig_cut,aOO,bOO,r1OO,r2OO; - char *typepot,*mode; + double a, p, ksi, q, r0, dc1, dc2; + double abuck, rhobuck, neig_cut, aOO, bOO, r1OO, r2OO; + char *typepot, *mode; int intsm; }; - double rmin,dr,ds; // table parameter + double rmin, dr, ds; // table parameter int kmax; - bigint Qstep; // Frequency of charge resolution - double precision; // accuracy of convergence - int loopmax; // max of iteration + bigint Qstep; // Frequency of charge resolution + double precision; // accuracy of convergence + int loopmax; // max of iteration - double cutmax; // max cutoff for all elements - char *QEqMode; // name of QEqMode - char *Bavard; // Verbose parameter - char *writepot; // write or not the electronegativity component - char *writeenerg; // write or not the energy component - char *QInitMode; // mode of initialization of charges - double zlim1QEq; // z limit for QEq equilibration - double zlim2QEq; // z limit for QEq equilibration - double QOxInit; // Initial charge for oxygen atoms (if the charge is not specified) - int maxintparam; // max # of interaction sets - int maxintsm; // max # of interaction SM - double r1Coord,r2Coord; - Param *params; // parameter set for an I atom - Intparam *intparams; // parameter set for an I interaction + double cutmax; // max cutoff for all elements + char *QEqMode; // name of QEqMode + char *Bavard; // Verbose parameter + char *writepot; // write or not the electronegativity component + char *writeenerg; // write or not the energy component + char *QInitMode; // mode of initialization of charges + double zlim1QEq; // z limit for QEq equilibration + double zlim2QEq; // z limit for QEq equilibration + double QOxInit; // Initial charge for oxygen atoms (if the charge is not specified) + int maxintparam; // max # of interaction sets + int maxintsm; // max # of interaction SM + double r1Coord, r2Coord; + Param *params; // parameter set for an I atom + Intparam *intparams; // parameter set for an I interaction - int nmax,*nQEqall,*nQEqaall,*nQEqcall; - double *qf,*q1,*q2,Nevery,Neverypot; + int nmax, *nQEqall, *nQEqaall, *nQEqcall; + double *qf, *q1, *q2, Nevery, Neverypot; -// Coulombian interaction - double *esm, **fafb, **dfafb, *fafbOxOxSurf, *dfafbOxOxSurf, *fafbTiOxSurf,*dfafbTiOxSurf; - double *potqn, *dpotqn, Vself, *Zsm,*coord, *fafbOxOxBB, *dfafbOxOxBB,*fafbTiOxBB, *dfafbTiOxBB ; - int **intype, **coultype; - int *NCo; - double coordOxBulk,coordOxSurf,ROxSurf,coordOxBB,ROxBB; + // Coulombian interaction + double *esm, **fafb, **dfafb, *fafbOxOxSurf, *dfafbOxOxSurf, *fafbTiOxSurf, *dfafbTiOxSurf; + double *potqn, *dpotqn, Vself, *Zsm, *coord, *fafbOxOxBB, *dfafbOxOxBB, *fafbTiOxBB, *dfafbTiOxBB; + int **intype, **coultype; + int *NCo; + double coordOxBulk, coordOxSurf, ROxSurf, coordOxBB, ROxBB; -// Covalent interaction - double *ecov, *potmad, *potself, *potcov; //, *chimet; - double **tabsmb,**dtabsmb, **tabsmr, **dtabsmr, *sbcov, *sbmet; - double ncov; + // Covalent interaction + double *ecov, *potmad, *potself, *potcov; //, *chimet; + double **tabsmb, **dtabsmb, **tabsmr, **dtabsmr, *sbcov, *sbmet; + double ncov; -// Neighbor Table - int nteam,cluster,*hybrid; - int *nvsm, **vsm, *flag_QEq; + // Neighbor Table + int nteam, cluster, *hybrid; + int *nvsm, **vsm, *flag_QEq; -// Parallelisation - int me, nproc; - double *tab_comm; + // Parallelisation + int me, nproc; + double *tab_comm; -// GAMMAS function - double *fct; + // GAMMAS function + double *fct; -// HERE its routines -// ===================================== - void allocate(); - virtual void read_file(char *); + // HERE its routines + // ===================================== + void allocate(); + virtual void read_file(char *); - void tabsm(); - void tabqeq(); + void tabsm(); + void tabqeq(); - void potqeq(int, int, double, double, double, - double &, int, double &); - void pot_ES (int, int, double, double &); - void pot_ES2 (int, int, double, double &); + void potqeq(int, int, double, double, double, double &, int, double &); + void pot_ES(int, int, double, double &); + void pot_ES2(int, int, double, double &); - double self(Param *, double); - double qfo_self(Param *, double); + double self(Param *, double); + double qfo_self(Param *, double); - virtual void repulsive(Intparam *, double, int, int, double &, int, double &); - virtual void rep_OO (Intparam *, double, double &, int, double &); - virtual void Attr_OO (Intparam *, double, double &, int, double &); - virtual void attractive(Intparam *, double, int, int, double, int, double ); - void f_att(Intparam *, int, int, double, double &) ; - void pot_COV(Param *, int, double &); - double potmet(Intparam *, double, int, double, int, double); + virtual void repulsive(Intparam *, double, int, int, double &, int, double &); + virtual void rep_OO(Intparam *, double, double &, int, double &); + virtual void Attr_OO(Intparam *, double, double &, int, double &); + virtual void attractive(Intparam *, double, int, int, double, int, double); + void f_att(Intparam *, int, int, double, double &); + void pot_COV(Param *, int, double &); + double potmet(Intparam *, double, int, double, int, double); - double fcoupure(double, double, double); - double fcoupured(double, double, double); + double fcoupure(double, double, double); + double fcoupured(double, double, double); - double fcoup2(double, double, double); - double Intfcoup2(double, double, double); - double Primfcoup2(double, double, double); + double fcoup2(double, double, double); + double Intfcoup2(double, double, double); + double Primfcoup2(double, double, double); - void groupBulkFromSlab_QEq(); - void groupQEqAllParallel_QEq(); - void groupQEqAll_QEq(); - void groupSurface_QEq(); - void QForce_charge(int); - void Charge(); - void Init_charge(int*, int*, int*); - void CheckEnergyVSForce(); + void groupBulkFromSlab_QEq(); + void groupQEqAllParallel_QEq(); + void groupQEqAll_QEq(); + void groupSurface_QEq(); + void QForce_charge(int); + void Charge(); + void Init_charge(int *, int *, int *); + void CheckEnergyVSForce(); -// =========================================== -// Communication pack - int pack_forward_comm (int, int*, double*, int, int*); - void unpack_forward_comm (int, int, double*); - int pack_reverse_comm (int, int, double*); - void unpack_reverse_comm (int, int*, double*); - void forward (double*); void reverse (double*); - void forward_int (int*); void reverse_int (int*); + // =========================================== + // Communication pack + int pack_forward_comm(int, int *, double *, int, int *); + void unpack_forward_comm(int, int, double *); + int pack_reverse_comm(int, int, double *); + void unpack_reverse_comm(int, int *, double *); + void forward(double *); + void reverse(double *); + void forward_int(int *); + void reverse_int(int *); - int Tokenize( char* , char*** ); + int Tokenize(char *, char ***); - template const T& min ( const T& a, const T& b ) { - return !(b const T &min(const T &a, const T &b) + { + return !(b < a) ? a : b; // or: return !comp(b,a)?a:b; for the comp version + } -// ============================================= -// Gammas function - void gammas(double &, double &, double &, double &, double &, double &, - double &, double &, double &, double &, double &, double &, - double &, double &, double &); + // ============================================= + // Gammas function + void gammas(double &, double &, double &, double &, double &, double &, double &, double &, + double &, double &, double &, double &, double &, double &, double &); - void css(double &, double, double, double, double, double, - double &, double &, double &, double &,double &, - double &, double &, double &, double &); + void css(double &, double, double, double, double, double, double &, double &, double &, double &, + double &, double &, double &, double &, double &); - double coeffs(int, int, int); + double coeffs(int, int, int); - double binm(int, int); - void caintgs (double, int, double *); - void cbintgs( double, int, double *); + double binm(int, int); + void caintgs(double, int, double *); + void cbintgs(double, int, double *); -// ===================================== -// short range neighbor list + // ===================================== + // short range neighbor list void add_pages(int howmany = 1); -// void Short_neigh(); + // void Short_neigh(); int maxpage, pgsize, oneatom, **pages; double cutmin; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/atom_vec_sph.h b/src/USER-SPH/atom_vec_sph.h index 503b5f9f47..97f256abcb 100644 --- a/src/USER-SPH/atom_vec_sph.h +++ b/src/USER-SPH/atom_vec_sph.h @@ -36,11 +36,11 @@ class AtomVecSPH : public AtomVec { void pack_property_atom(int, double *, int, int); private: - double *rho,*drho,*esph,*desph,*cv; + double *rho, *drho, *esph, *desph, *cv; double **vest; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/compute_sph_e_atom.h b/src/USER-SPH/compute_sph_e_atom.h index f4b090726d..b0405e887c 100644 --- a/src/USER-SPH/compute_sph_e_atom.h +++ b/src/USER-SPH/compute_sph_e_atom.h @@ -37,7 +37,7 @@ class ComputeSPHEAtom : public Compute { double *evector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/compute_sph_rho_atom.h b/src/USER-SPH/compute_sph_rho_atom.h index f94bc2d240..fdfbbb26df 100644 --- a/src/USER-SPH/compute_sph_rho_atom.h +++ b/src/USER-SPH/compute_sph_rho_atom.h @@ -37,7 +37,7 @@ class ComputeSPHRhoAtom : public Compute { double *rhoVector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/compute_sph_t_atom.h b/src/USER-SPH/compute_sph_t_atom.h index e0f0030d38..bab8de5cb4 100644 --- a/src/USER-SPH/compute_sph_t_atom.h +++ b/src/USER-SPH/compute_sph_t_atom.h @@ -37,7 +37,7 @@ class ComputeSPHTAtom : public Compute { double *tvector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/fix_sph.h b/src/USER-SPH/fix_sph.h index 9f160258aa..127bfa85ad 100644 --- a/src/USER-SPH/fix_sph.h +++ b/src/USER-SPH/fix_sph.h @@ -36,15 +36,16 @@ class FixSPH : public Fix { private: class NeighList *list; + protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/fix_sph_stationary.h b/src/USER-SPH/fix_sph_stationary.h index 6ecc0323c1..75d8dc5ece 100644 --- a/src/USER-SPH/fix_sph_stationary.h +++ b/src/USER-SPH/fix_sph_stationary.h @@ -35,15 +35,16 @@ class FixSPHStationary : public Fix { private: class NeighList *list; + protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; class Pair *pair; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_heatconduction.h b/src/USER-SPH/pair_sph_heatconduction.h index 8ce641a949..0e5662c7be 100644 --- a/src/USER-SPH/pair_sph_heatconduction.h +++ b/src/USER-SPH/pair_sph_heatconduction.h @@ -39,7 +39,7 @@ class PairSPHHeatConduction : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_idealgas.h b/src/USER-SPH/pair_sph_idealgas.h index 335f2e03b5..b6a003c9e0 100644 --- a/src/USER-SPH/pair_sph_idealgas.h +++ b/src/USER-SPH/pair_sph_idealgas.h @@ -35,12 +35,12 @@ class PairSPHIdealGas : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double **cut,**viscosity; + double **cut, **viscosity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_lj.h b/src/USER-SPH/pair_sph_lj.h index aba0bf732f..f48645245c 100644 --- a/src/USER-SPH/pair_sph_lj.h +++ b/src/USER-SPH/pair_sph_lj.h @@ -37,12 +37,12 @@ class PairSPHLJ : public Pair { void LJEOS2(double, double, double, double *, double *); protected: - double **cut,**viscosity; + double **cut, **viscosity; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_rhosum.h b/src/USER-SPH/pair_sph_rhosum.h index 640e0e905e..cad8706b00 100644 --- a/src/USER-SPH/pair_sph_rhosum.h +++ b/src/USER-SPH/pair_sph_rhosum.h @@ -44,7 +44,7 @@ class PairSPHRhoSum : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_taitwater.h b/src/USER-SPH/pair_sph_taitwater.h index bf59c18bdb..78e8b8ba8c 100644 --- a/src/USER-SPH/pair_sph_taitwater.h +++ b/src/USER-SPH/pair_sph_taitwater.h @@ -35,13 +35,13 @@ class PairSPHTaitwater : public Pair { protected: double *rho0, *soundspeed, *B; - double **cut,**viscosity; + double **cut, **viscosity; int first; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-SPH/pair_sph_taitwater_morris.h b/src/USER-SPH/pair_sph_taitwater_morris.h index e04a96a6ea..d789d6ae89 100644 --- a/src/USER-SPH/pair_sph_taitwater_morris.h +++ b/src/USER-SPH/pair_sph_taitwater_morris.h @@ -35,13 +35,13 @@ class PairSPHTaitwaterMorris : public Pair { protected: double *rho0, *soundspeed, *B; - double **cut,**viscosity; + double **cut, **viscosity; int first; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_force_tally.h b/src/USER-TALLY/compute_force_tally.h index f112e23dd9..49dfdc3ced 100644 --- a/src/USER-TALLY/compute_force_tally.h +++ b/src/USER-TALLY/compute_force_tally.h @@ -40,17 +40,16 @@ class ComputeForceTally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); + private: bigint did_setup; - int nmax,igroup2,groupbit2; + int nmax, igroup2, groupbit2; double **fatom; double ftotal[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_heat_flux_tally.h b/src/USER-TALLY/compute_heat_flux_tally.h index 09d5cdeb1d..670c7d0ed8 100644 --- a/src/USER-TALLY/compute_heat_flux_tally.h +++ b/src/USER-TALLY/compute_heat_flux_tally.h @@ -39,18 +39,16 @@ class ComputeHeatFluxTally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int nmax,igroup2,groupbit2; - double **stress,*eatom; + int nmax, igroup2, groupbit2; + double **stress, *eatom; double *heatj; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_pe_mol_tally.h b/src/USER-TALLY/compute_pe_mol_tally.h index d53f70b94f..bee22acb0b 100644 --- a/src/USER-TALLY/compute_pe_mol_tally.h +++ b/src/USER-TALLY/compute_pe_mol_tally.h @@ -34,17 +34,15 @@ class ComputePEMolTally : public Compute { void compute_vector(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int igroup2,groupbit2; + int igroup2, groupbit2; double etotal[4]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_pe_tally.h b/src/USER-TALLY/compute_pe_tally.h index 05ca46c1f9..ba9909b138 100644 --- a/src/USER-TALLY/compute_pe_tally.h +++ b/src/USER-TALLY/compute_pe_tally.h @@ -40,18 +40,16 @@ class ComputePETally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int nmax,igroup2,groupbit2; + int nmax, igroup2, groupbit2; double **eatom; double etotal[2]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-TALLY/compute_stress_tally.h b/src/USER-TALLY/compute_stress_tally.h index e73a1a05e2..5cd3320a12 100644 --- a/src/USER-TALLY/compute_stress_tally.h +++ b/src/USER-TALLY/compute_stress_tally.h @@ -40,18 +40,16 @@ class ComputeStressTally : public Compute { double memory_usage(); void pair_setup_callback(int, int); - void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double); + void pair_tally_callback(int, int, int, int, double, double, double, double, double, double); private: bigint did_setup; - int nmax,igroup2,groupbit2; + int nmax, igroup2, groupbit2; double **stress; double *virial; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/compute_pressure_uef.h b/src/USER-UEF/compute_pressure_uef.h index b52217ee4f..bfb664a451 100644 --- a/src/USER-UEF/compute_pressure_uef.h +++ b/src/USER-UEF/compute_pressure_uef.h @@ -34,18 +34,16 @@ class ComputePressureUef : public ComputePressure { virtual void compute_vector(); virtual double compute_scalar(); void update_rot(); - bool in_fix; //true if this compute is used in fix/nvt/npt - + bool in_fix; //true if this compute is used in fix/nvt/npt protected: - bool ext_flags[3]; // true if used in average output pressure - void virial_rot(double*,const double[3][3]); + bool ext_flags[3]; // true if used in average output pressure + void virial_rot(double *, const double[3][3]); int ifix_uef; double rot[3][3]; }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/compute_temp_uef.h b/src/USER-UEF/compute_temp_uef.h index cb6b40d9a2..c41e6d0713 100644 --- a/src/USER-UEF/compute_temp_uef.h +++ b/src/USER-UEF/compute_temp_uef.h @@ -35,15 +35,13 @@ class ComputeTempUef : public ComputeTemp { void yes_rot(); void no_rot(); - protected: bool rot_flag; - void virial_rot(double*,const double[3][3]); + void virial_rot(double *, const double[3][3]); int ifix_uef; }; - -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/dump_cfg_uef.h b/src/USER-UEF/dump_cfg_uef.h index 1e9e5762a0..f3fcdd55c2 100644 --- a/src/USER-UEF/dump_cfg_uef.h +++ b/src/USER-UEF/dump_cfg_uef.h @@ -28,8 +28,7 @@ namespace LAMMPS_NS { class DumpCFGUef : public DumpCFG { public: - DumpCFGUef(LAMMPS *lmp, int narg, char **arg) : - DumpCFG(lmp, narg, arg) {} + DumpCFGUef(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg) {} void init_style(); void write_header(bigint); @@ -37,7 +36,7 @@ class DumpCFGUef : public DumpCFG { int ifix_uef; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/fix_nh_uef.h b/src/USER-UEF/fix_nh_uef.h index 0629db5aa1..b8fb776366 100644 --- a/src/USER-UEF/fix_nh_uef.h +++ b/src/USER-UEF/fix_nh_uef.h @@ -13,17 +13,16 @@ Contributing Author: David Nicholson (MIT) ------------------------------------------------------------------------- */ - #ifndef LMP_FIX_NH_UEF_H #define LMP_FIX_NH_UEF_H #include "fix_nh.h" namespace LAMMPS_NS { - // forward declaration - namespace UEF_utils { - class UEFBox; - } +// forward declaration +namespace UEF_utils { + class UEFBox; +} class FixNHUef : public FixNH { public: @@ -33,7 +32,7 @@ class FixNHUef : public FixNH { virtual void init(); virtual void setup(int); virtual void pre_exchange(); - virtual int pack_restart_data(double*); + virtual int pack_restart_data(double *); virtual void restart(char *); virtual void end_of_step(); virtual void initial_integrate(int); @@ -42,7 +41,7 @@ class FixNHUef : public FixNH { virtual void final_integrate_respa(int, int); virtual void post_run(); void get_rot(double[3][3]); - void get_ext_flags(bool*); + void get_ext_flags(bool *); void get_box(double[3][3]); protected: @@ -50,26 +49,26 @@ class FixNHUef : public FixNH { virtual int size_restart_global(); virtual void nve_x(); virtual void nve_v(); - void rotate_x(double [3][3]); + void rotate_x(double[3][3]); void inv_rotate_x(double[3][3]); void rotate_v(double[3][3]); void inv_rotate_v(double[3][3]); void rotate_f(double[3][3]); void inv_rotate_f(double[3][3]); - double strain[2],erate[2]; // strain/strain rate : [e_x, e_y] - // always assume traceless e_z = -e_x-e_y + double strain[2], erate[2]; // strain/strain rate : [e_x, e_y] + // always assume traceless e_z = -e_x-e_y - int rem; //this is for the narg kluge + int rem; //this is for the narg kluge - UEF_utils::UEFBox *uefbox; // interface for the special simulation box + UEF_utils::UEFBox *uefbox; // interface for the special simulation box - double rot[3][3]; // rotation matrix - bool ext_flags[3]; // flags for external "free surfaces" - bool nearly_equal(double,double,double); + double rot[3][3]; // rotation matrix + bool ext_flags[3]; // flags for external "free surfaces" + bool nearly_equal(double, double, double); //bool rotate_output; // experimental feature. Too many issues for now }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/USER-UEF/fix_npt_uef.h b/src/USER-UEF/fix_npt_uef.h index 675e3fccde..59589c7bbe 100644 --- a/src/USER-UEF/fix_npt_uef.h +++ b/src/USER-UEF/fix_npt_uef.h @@ -32,7 +32,7 @@ class FixNPTUef : public FixNHUef { ~FixNPTUef() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/fix_nvt_uef.h b/src/USER-UEF/fix_nvt_uef.h index d373fd6040..9c653929ab 100644 --- a/src/USER-UEF/fix_nvt_uef.h +++ b/src/USER-UEF/fix_nvt_uef.h @@ -32,7 +32,7 @@ class FixNVTUef : public FixNHUef { ~FixNVTUef() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-UEF/uef_utils.h b/src/USER-UEF/uef_utils.h index 13ee0dfa5a..e22f9fda0d 100644 --- a/src/USER-UEF/uef_utils.h +++ b/src/USER-UEF/uef_utils.h @@ -16,127 +16,116 @@ #ifndef LMP_UEF_UTILS_H #define LMP_UEF_UTILS_H -namespace LAMMPS_NS{ namespace UEF_utils { +namespace LAMMPS_NS { +namespace UEF_utils { -class UEFBox -{ - public: + class UEFBox { + public: UEFBox(); void set_strain(const double, const double); - void step_deform(const double,const double); + void step_deform(const double, const double); bool reduce(); void get_box(double[3][3], double); void get_rot(double[3][3]); void get_inverse_cob(int[3][3]); - private: - double l0[3][3]; // initial basis - double w1[3],w2[3],winv[3][3];//omega1 and omega2 (spectra of automorphisms) + + private: + double l0[3][3]; // initial basis + double w1[3], w2[3], winv[3][3]; //omega1 and omega2 (spectra of automorphisms) double theta[2]; double l[3][3], rot[3][3], lrot[3][3]; - int r[3][3],ri[3][3],a1[3][3],a2[3][3],a1i[3][3],a2i[3][3]; -}; + int r[3][3], ri[3][3], a1[3][3], a2[3][3], a1i[3][3], a2i[3][3]; + }; -// lattice reduction routines + // lattice reduction routines -void greedy(double[3][3],int[3][3],int[3][3]); -void col_sort(double[3][3],int[3][3],int[3][3]); -void red12(double[3][3],int[3][3],int[3][3]); -void greedy_recurse(double[3][3],int[3][3],int[3][3]); -void red3(double [3][3],int r[3][3],int[3][3]); -void make_unique(double[3][3],int[3][3],int[3][3]); -void rotation_matrix(double[3][3],double[3][3],const double [3][3]); + void greedy(double[3][3], int[3][3], int[3][3]); + void col_sort(double[3][3], int[3][3], int[3][3]); + void red12(double[3][3], int[3][3], int[3][3]); + void greedy_recurse(double[3][3], int[3][3], int[3][3]); + void red3(double[3][3], int r[3][3], int[3][3]); + void make_unique(double[3][3], int[3][3], int[3][3]); + void rotation_matrix(double[3][3], double[3][3], const double[3][3]); -// A few utility functions for 3x3 arrays + // A few utility functions for 3x3 arrays -template -T col_prod(T x[3][3], int c1, int c2) -{ - return x[0][c1]*x[0][c2]+x[1][c1]*x[1][c2]+x[2][c1]*x[2][c2]; -} - -template -void col_swap(T x[3][3], int c1, int c2) -{ - for (int k=0;k<3;k++) { - T t = x[k][c2]; - x[k][c2]=x[k][c1]; - x[k][c1]=t; + template T col_prod(T x[3][3], int c1, int c2) + { + return x[0][c1] * x[0][c2] + x[1][c1] * x[1][c2] + x[2][c1] * x[2][c2]; } -} -template -void neg_col(T x[3][3], int c1) -{ - x[0][c1] = -x[0][c1]; - x[1][c1] = -x[1][c1]; - x[2][c1] = -x[2][c1]; -} - -template -void neg_row(T x[3][3], int c1) -{ - x[c1][0] = -x[c1][0]; - x[c1][1] = -x[c1][1]; - x[c1][2] = -x[c1][2]; -} - -template -T det(T x[3][3]) -{ - double val; - val = x[0][0]*(x[1][1]*x[2][2] - x[1][2]*x[2][1]); - val -= x[0][1]*(x[1][0]*x[2][2] - x[1][2]*x[2][0]); - val += x[0][2]*(x[1][0]*x[2][1] - x[1][1]*x[2][0]); - return val; -} - -template -bool mat_same(T x1[3][3], T x2[3][3]) -{ - bool v = true; - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - v &= (x1[k][j]==x2[k][j]); - return v; -} - -template -void transpose(T m[3][3]) -{ - for (int k=0;k<3;k++) - for (int j=k+1;j<3;j++) { - T x = m[k][j]; - m[k][j] = m[j][k]; - m[j][k] = x; + template void col_swap(T x[3][3], int c1, int c2) + { + for (int k = 0; k < 3; k++) { + T t = x[k][c2]; + x[k][c2] = x[k][c1]; + x[k][c1] = t; } -} + } -template -void mul_m1(T1 m1[3][3], const T2 m2[3][3]) -{ - T1 t[3][3]; - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - t[k][j]=m1[k][j]; + template void neg_col(T x[3][3], int c1) + { + x[0][c1] = -x[0][c1]; + x[1][c1] = -x[1][c1]; + x[2][c1] = -x[2][c1]; + } - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - m1[k][j] = t[k][0]*m2[0][j] + t[k][1]*m2[1][j] + t[k][2]*m2[2][j]; -} + template void neg_row(T x[3][3], int c1) + { + x[c1][0] = -x[c1][0]; + x[c1][1] = -x[c1][1]; + x[c1][2] = -x[c1][2]; + } -template -void mul_m2(const T1 m1[3][3], T2 m2[3][3]) -{ - T2 t[3][3]; - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - t[k][j]=m2[k][j]; + template T det(T x[3][3]) + { + double val; + val = x[0][0] * (x[1][1] * x[2][2] - x[1][2] * x[2][1]); + val -= x[0][1] * (x[1][0] * x[2][2] - x[1][2] * x[2][0]); + val += x[0][2] * (x[1][0] * x[2][1] - x[1][1] * x[2][0]); + return val; + } - for (int k=0;k<3;k++) - for (int j=0;j<3;j++) - m2[k][j] = m1[k][0]*t[0][j] + m1[k][1]*t[1][j] + m1[k][2]*t[2][j]; -} + template bool mat_same(T x1[3][3], T x2[3][3]) + { + bool v = true; + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) v &= (x1[k][j] == x2[k][j]); + return v; + } -} -} + template void transpose(T m[3][3]) + { + for (int k = 0; k < 3; k++) + for (int j = k + 1; j < 3; j++) { + T x = m[k][j]; + m[k][j] = m[j][k]; + m[j][k] = x; + } + } + + template void mul_m1(T1 m1[3][3], const T2 m2[3][3]) + { + T1 t[3][3]; + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) t[k][j] = m1[k][j]; + + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) + m1[k][j] = t[k][0] * m2[0][j] + t[k][1] * m2[1][j] + t[k][2] * m2[2][j]; + } + + template void mul_m2(const T1 m1[3][3], T2 m2[3][3]) + { + T2 t[3][3]; + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) t[k][j] = m2[k][j]; + + for (int k = 0; k < 3; k++) + for (int j = 0; j < 3; j++) + m2[k][j] = m1[k][0] * t[0][j] + m1[k][1] * t[1][j] + m1[k][2] * t[2][j]; + } + +} // namespace UEF_utils +} // namespace LAMMPS_NS #endif diff --git a/src/USER-VTK/dump_vtk.h b/src/USER-VTK/dump_vtk.h index 21fc6f1c3d..d4fd53b5c2 100644 --- a/src/USER-VTK/dump_vtk.h +++ b/src/USER-VTK/dump_vtk.h @@ -28,10 +28,9 @@ DumpStyle(vtk,DumpVTK); #include #include - -#include -#include #include +#include +#include class vtkAbstractArray; class vtkRectilinearGrid; @@ -61,14 +60,15 @@ class DumpVTK : public DumpCustom { virtual ~DumpVTK(); virtual void write(); + protected: - char *label; // string for dump file header + char *label; // string for dump file header - int vtk_file_format; // which vtk file format to write (vtk, vtp, vtu ...) + int vtk_file_format; // which vtk file format to write (vtk, vtp, vtu ...) - std::map field2index; // which compute,fix,variable calcs this field - std::map argindex; // index into compute,fix scalar_atom,vector_atom - // 0 for scalar_atom, 1-N for vector_atom values + std::map field2index; // which compute,fix,variable calcs this field + std::map argindex; // index into compute,fix scalar_atom,vector_atom + // 0 for scalar_atom, 1-N for vector_atom values // private methods @@ -88,11 +88,11 @@ class DumpVTK : public DumpCustom { virtual int modify_param(int, char **); typedef void (DumpVTK::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_vtk(bigint); typedef void (DumpVTK::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_vtk(int, double *); void write_vtp(int, double *); void write_vtu(int, double *); @@ -105,26 +105,26 @@ class DumpVTK : public DumpCustom { void write_domain_vtu_triclinic(); typedef void (DumpVTK::*FnPtrPack)(int); - std::map pack_choice; // ptrs to pack functions - std::map vtype; // data type - std::map name; // attribute labels - std::set vector_set; // set of vector attributes + std::map pack_choice; // ptrs to pack functions + std::map vtype; // data type + std::map name; // attribute labels + std::set vector_set; // set of vector attributes int current_pack_choice_key; // vtk data containers vtkSmartPointer points; vtkSmartPointer pointsCells; - std::map > myarrays; + std::map> myarrays; int n_calls_; - double (*boxcorners)[3]; // corners of triclinic domain box + double (*boxcorners)[3]; // corners of triclinic domain box char *filecurrent; char *domainfilecurrent; char *parallelfilecurrent; char *multiname_ex; void setFileCurrent(); - void buf2arrays(int, double *); // transfer data from buf array to vtk arrays + void buf2arrays(int, double *); // transfer data from buf array to vtk arrays void reset_vtk_data_containers(); // customize by adding a method prototype @@ -134,7 +134,7 @@ class DumpVTK : public DumpCustom { void pack_custom(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/angle_cross.h b/src/USER-YAFF/angle_cross.h index e8ac17f75e..4fe8f5a1ad 100644 --- a/src/USER-YAFF/angle_cross.h +++ b/src/USER-YAFF/angle_cross.h @@ -37,12 +37,12 @@ class AngleCross : public Angle { double single(int, int, int, int); protected: - double *kss,*kbs0,*kbs1,*r00,*r01,*theta0; + double *kss, *kbs0, *kbs1, *r00, *r01, *theta0; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/angle_mm3.h b/src/USER-YAFF/angle_mm3.h index ce83ed43ae..574e626649 100644 --- a/src/USER-YAFF/angle_mm3.h +++ b/src/USER-YAFF/angle_mm3.h @@ -37,12 +37,12 @@ class AngleMM3 : public Angle { double single(int, int, int, int); protected: - double *theta0,*k2; + double *theta0, *k2; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/bond_mm3.h b/src/USER-YAFF/bond_mm3.h index 52b63f93bc..7e8f0589f1 100644 --- a/src/USER-YAFF/bond_mm3.h +++ b/src/USER-YAFF/bond_mm3.h @@ -37,12 +37,12 @@ class BondMM3 : public Bond { double single(int, double, int, int, double &); protected: - double *r0,*k2; + double *r0, *k2; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/improper_distharm.h b/src/USER-YAFF/improper_distharm.h index 85597f6878..d72a1c2681 100644 --- a/src/USER-YAFF/improper_distharm.h +++ b/src/USER-YAFF/improper_distharm.h @@ -34,13 +34,12 @@ class ImproperDistHarm : public Improper { void read_restart(FILE *); private: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-YAFF/improper_sqdistharm.h b/src/USER-YAFF/improper_sqdistharm.h index 20ee793425..f2fc04dfdc 100644 --- a/src/USER-YAFF/improper_sqdistharm.h +++ b/src/USER-YAFF/improper_sqdistharm.h @@ -34,13 +34,12 @@ class ImproperSQDistHarm : public Improper { void read_restart(FILE *); private: - double *k,*chi; + double *k, *chi; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h index 7b7568ff33..f8cfdea91f 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.h @@ -47,18 +47,18 @@ class PairLJSwitch3CoulGaussLong : public Pair { protected: double cut_lj_global; double truncw, truncwi; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma,**gamma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **gamma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h index e247460944..3dd95be4ac 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.h @@ -47,18 +47,18 @@ class PairMM3Switch3CoulGaussLong : public Pair { protected: double cut_lj_global; double truncw, truncwi; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **epsilon,**sigma,**gamma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **epsilon, **sigma, **gamma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; - double qdist; // TIP4P distance from O site to negative charge + double qdist; // TIP4P distance from O site to negative charge double g_ewald; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/VORONOI/compute_voronoi_atom.h b/src/VORONOI/compute_voronoi_atom.h index 3665f3c6f9..742e29f39e 100644 --- a/src/VORONOI/compute_voronoi_atom.h +++ b/src/VORONOI/compute_voronoi_atom.h @@ -23,10 +23,10 @@ ComputeStyle(voronoi/atom,ComputeVoronoi); #include "compute.h" namespace voro { - class container; - class container_poly; - class voronoicell_neighbor; -} +class container; +class container_poly; +class voronoicell_neighbor; +} // namespace voro namespace LAMMPS_NS { @@ -50,7 +50,7 @@ class ComputeVoronoi : public Compute { void buildCells(); void checkOccupation(); void loopCells(); - void processCell(voro::voronoicell_neighbor&, int); + void processCell(voro::voronoicell_neighbor &, int); int nmax, rmax, maxedge, sgroupbit; char *radstr; @@ -66,7 +66,7 @@ class ComputeVoronoi : public Compute { double **faces; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/accelerator_kokkos.h b/src/accelerator_kokkos.h index 5a510c77c3..eedffb6689 100644 --- a/src/accelerator_kokkos.h +++ b/src/accelerator_kokkos.h @@ -19,14 +19,14 @@ #ifdef LMP_KOKKOS -#include "kokkos.h" // IWYU pragma: export -#include "atom_kokkos.h" // IWYU pragma: export -#include "comm_kokkos.h" // IWYU pragma: export -#include "comm_tiled_kokkos.h" // IWYU pragma: export -#include "domain_kokkos.h" // IWYU pragma: export -#include "neighbor_kokkos.h" // IWYU pragma: export -#include "memory_kokkos.h" // IWYU pragma: export -#include "modify_kokkos.h" // IWYU pragma: export +#include "atom_kokkos.h" // IWYU pragma: export +#include "comm_kokkos.h" // IWYU pragma: export +#include "comm_tiled_kokkos.h" // IWYU pragma: export +#include "domain_kokkos.h" // IWYU pragma: export +#include "kokkos.h" // IWYU pragma: export +#include "memory_kokkos.h" // IWYU pragma: export +#include "modify_kokkos.h" // IWYU pragma: export +#include "neighbor_kokkos.h" // IWYU pragma: export #define LAMMPS_INLINE KOKKOS_INLINE_FUNCTION @@ -39,9 +39,9 @@ #include "comm_brick.h" #include "comm_tiled.h" #include "domain.h" -#include "neighbor.h" #include "memory.h" #include "modify.h" +#include "neighbor.h" #define LAMMPS_INLINE inline @@ -54,11 +54,11 @@ class KokkosLMP { int ngpus; int numa; - KokkosLMP(class LAMMPS *, int, char **) {kokkos_exists = 0;} + KokkosLMP(class LAMMPS *, int, char **) { kokkos_exists = 0; } ~KokkosLMP() {} void accelerator(int, char **) {} - int neigh_list_kokkos(int) {return 0;} - int neigh_count(int) {return 0;} + int neigh_list_kokkos(int) { return 0; } + int neigh_count(int) { return 0; } }; class Kokkos { @@ -84,7 +84,7 @@ class CommKokkos : public CommBrick { class CommTiledKokkos : public CommTiled { public: CommTiledKokkos(class LAMMPS *lmp) : CommTiled(lmp) {} - CommTiledKokkos(class LAMMPS *lmp, Comm *oldcomm) : CommTiled(lmp,oldcomm) {} + CommTiledKokkos(class LAMMPS *lmp, Comm *oldcomm) : CommTiled(lmp, oldcomm) {} ~CommTiledKokkos() {} }; @@ -104,7 +104,7 @@ class MemoryKokkos : public Memory { public: MemoryKokkos(class LAMMPS *lmp) : Memory(lmp) {} ~MemoryKokkos() {} - void grow_kokkos(tagint **, tagint **, int, int, const char*) {} + void grow_kokkos(tagint **, tagint **, int, int, const char *) {} }; class ModifyKokkos : public Modify { @@ -121,7 +121,7 @@ class DAT { typedef int tdual_int_2d; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/accelerator_omp.h b/src/accelerator_omp.h index 498f3dc417..52d46f29cf 100644 --- a/src/accelerator_omp.h +++ b/src/accelerator_omp.h @@ -33,11 +33,11 @@ class DomainOMP : public Domain { // multi-threaded versions virtual void pbc(); virtual void lamda2x(int); - virtual void lamda2x(double *lamda, double *x) {Domain::lamda2x(lamda,x);} + virtual void lamda2x(double *lamda, double *x) { Domain::lamda2x(lamda, x); } virtual void x2lamda(int); - virtual void x2lamda(double *x, double *lamda) {Domain::x2lamda(x,lamda);} + virtual void x2lamda(double *x, double *lamda) { Domain::x2lamda(x, lamda); } }; -} +} // namespace LAMMPS_NS #endif /* LMP_DOMAIN_OMP_H */ diff --git a/src/angle.h b/src/angle.h index bd48a9ee83..d74b5f9a7d 100644 --- a/src/angle.h +++ b/src/angle.h @@ -14,31 +14,32 @@ #ifndef LMP_ANGLE_H #define LMP_ANGLE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Angle : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - int writedata; // 1 if writes coeffs to data file - double energy; // accumulated energies - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double **cvatom; // accumulated per-atom centroid virial + int writedata; // 1 if writes coeffs to data file + double energy; // accumulated energies + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double **cvatom; // accumulated per-atom centroid virial - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Angle(class LAMMPS *); @@ -47,34 +48,38 @@ class Angle : protected Pointers { virtual void compute(int, int) = 0; virtual void settings(int, char **) {} virtual void coeff(int, char **) = 0; - virtual void init_style() {}; + virtual void init_style(){}; virtual double equilibrium_angle(int) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double single(int, int, int, int) = 0; virtual double memory_usage(); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; - int maxeatom,maxvatom,maxcvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; + int maxeatom, maxvatom, maxcvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = cvflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + cvflag_atom = 0; } void ev_setup(int, int, int alloc = 1); - void ev_tally(int, int, int, int, int, double, double *, double *, - double, double, double, double, double, double); + void ev_tally(int, int, int, int, int, double, double *, double *, double, double, double, double, + double, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/angle_deprecated.h b/src/angle_deprecated.h index a742bcd99d..df42c34d48 100644 --- a/src/angle_deprecated.h +++ b/src/angle_deprecated.h @@ -38,7 +38,7 @@ class AngleDeprecated : public Angle { virtual double single(int, int, int, int) { return 0.0; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/angle_hybrid.h b/src/angle_hybrid.h index a942353c2c..ca357bb505 100644 --- a/src/angle_hybrid.h +++ b/src/angle_hybrid.h @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class AngleHybrid : public Angle { public: - int nstyles; // # of different angle styles - Angle **styles; // class list for each Angle style - char **keywords; // keyword for each Angle style + int nstyles; // # of different angle styles + Angle **styles; // class list for each Angle style + char **keywords; // keyword for each Angle style AngleHybrid(class LAMMPS *); ~AngleHybrid(); @@ -43,16 +43,16 @@ class AngleHybrid : public Angle { double memory_usage(); private: - int *map; // which style each angle type points to + int *map; // which style each angle type points to - int *nanglelist; // # of angles in sub-style anglelists - int *maxangle; // max # of angles sub-style lists can store - int ***anglelist; // anglelist for each sub-style + int *nanglelist; // # of angles in sub-style anglelists + int *maxangle; // max # of angles sub-style lists can store + int ***anglelist; // anglelist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/angle_zero.h b/src/angle_zero.h index ad51886d8b..2f58378efa 100644 --- a/src/angle_zero.h +++ b/src/angle_zero.h @@ -46,7 +46,7 @@ class AngleZero : public Angle { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/arg_info.h b/src/arg_info.h index 7b8865a1f7..e629778b45 100644 --- a/src/arg_info.h +++ b/src/arg_info.h @@ -19,40 +19,41 @@ #include namespace LAMMPS_NS { - class ArgInfo { - public: - /*! constants for argument types */ - enum ArgTypes { - ERROR =-2, - UNKNOWN =-1, - NONE = 0, - X = 1<<0, - V = 1<<1, - F = 1<<2, - COMPUTE = 1<<3, - FIX = 1<<4, - VARIABLE = 1<<5, - KEYWORD = 1<<6, - TYPE = 1<<7, - MOLECULE = 1<<8, - DNAME = 1<<9, - INAME = 1<<10, - DENSITY_NUMBER = 1<<11, - DENSITY_MASS = 1<<12, - MASS = 1<<13, - TEMPERATURE = 1<<14, - BIN1D = 1<<15, - BIN2D = 1<<16, - BIN3D = 1<<17, - BINSPHERE = 1<<18, - BINCYLINDER = 1<<19 - }; +class ArgInfo { + public: + // clang-format off + /*! constants for argument types */ + enum ArgTypes { + ERROR =-2, + UNKNOWN =-1, + NONE = 0, + X = 1<<0, + V = 1<<1, + F = 1<<2, + COMPUTE = 1<<3, + FIX = 1<<4, + VARIABLE = 1<<5, + KEYWORD = 1<<6, + TYPE = 1<<7, + MOLECULE = 1<<8, + DNAME = 1<<9, + INAME = 1<<10, + DENSITY_NUMBER = 1<<11, + DENSITY_MASS = 1<<12, + MASS = 1<<13, + TEMPERATURE = 1<<14, + BIN1D = 1<<15, + BIN2D = 1<<16, + BIN3D = 1<<17, + BINSPHERE = 1<<18, + BINCYLINDER = 1<<19 + }; + // clang-format on + ArgInfo(const std::string &arg, int allowed = COMPUTE | FIX | VARIABLE); + virtual ~ArgInfo() {} - ArgInfo(const std::string &arg, int allowed=COMPUTE|FIX|VARIABLE); - virtual ~ArgInfo() {} - - public: - /*! get type of reference + public: + /*! get type of reference * * Return a type constant for the reference. This may be either * COMPUTE, FIX, VARIABLE (if not restricted to a subset of those @@ -62,33 +63,33 @@ namespace LAMMPS_NS { * * \return integer with a constant from ArgTypes enumerator */ - int get_type() const { return type; } + int get_type() const { return type; } - /*! get dimension of reference + /*! get dimension of reference * * This will return either 0, 1, 2 depending on whether the * reference has no, one or two "[{number}]" postfixes. * * \return integer with the dimensionality of the reference */ - int get_dim() const { return dim; } + int get_dim() const { return dim; } - /*! get index of first dimension + /*! get index of first dimension * * This will return the number in the first "[{number}]" * postfix or 0 if there is no postfix. * * \return integer with index or the postfix or 0 */ - int get_index1() const { return index1; } + int get_index1() const { return index1; } - /*! get index of second dimension + /*! get index of second dimension * * This will return the number in the second "[{number}]" * postfix or -1 if there is no second postfix. * * \return integer with index of the postfix or -1 */ - int get_index2() const { return index2; } + int get_index2() const { return index2; } - /*! return reference to the ID or name of the reference + /*! return reference to the ID or name of the reference * * This string is pointing to an internal storage element and * is only valid to use while the ArgInfo class instance is @@ -96,18 +97,18 @@ namespace LAMMPS_NS { * with copy_name(). * * \return C-style char * string */ - const char *get_name() const { return name.c_str(); } + const char *get_name() const { return name.c_str(); } - char *copy_name(); + char *copy_name(); - private: - std::string name; - int type, dim, index1, index2; + private: + std::string name; + int type, dim, index1, index2; - // disabled standard methods - ArgInfo() {} - ArgInfo(const ArgInfo &) {} - void operator=(const ArgInfo &) {} - }; -} + // disabled standard methods + ArgInfo() {} + ArgInfo(const ArgInfo &) {} + void operator=(const ArgInfo &) {} +}; +} // namespace LAMMPS_NS #endif diff --git a/src/atom.h b/src/atom.h index a8166bde65..6818b1a962 100644 --- a/src/atom.h +++ b/src/atom.h @@ -21,73 +21,73 @@ namespace LAMMPS_NS { - // forward declaration +// forward declaration - class AtomVec; +class AtomVec; class Atom : protected Pointers { public: char *atom_style; AtomVec *avec; - enum{DOUBLE,INT,BIGINT}; - enum{GROW=0,RESTART=1,BORDER=2}; - enum{ATOMIC=0,MOLECULAR=1,TEMPLATE=2}; - enum{MAP_NONE=0,MAP_ARRAY=1,MAP_HASH=2,MAP_YES=3}; + enum { DOUBLE, INT, BIGINT }; + enum { GROW = 0, RESTART = 1, BORDER = 2 }; + enum { ATOMIC = 0, MOLECULAR = 1, TEMPLATE = 2 }; + enum { MAP_NONE = 0, MAP_ARRAY = 1, MAP_HASH = 2, MAP_YES = 3 }; // atom counts - bigint natoms; // total # of atoms in system, could be 0 - // natoms may not be current if atoms lost - int nlocal,nghost; // # of owned and ghost atoms on this proc - int nmax; // max # of owned+ghost in arrays on this proc - int tag_enable; // 0/1 if atom ID tags are defined - int molecular; // 0 = atomic, 1 = standard molecular system, - // 2 = molecule template system - bigint nellipsoids; // number of ellipsoids - bigint nlines; // number of lines - bigint ntris; // number of triangles - bigint nbodies; // number of bodies + bigint natoms; // total # of atoms in system, could be 0 + // natoms may not be current if atoms lost + int nlocal, nghost; // # of owned and ghost atoms on this proc + int nmax; // max # of owned+ghost in arrays on this proc + int tag_enable; // 0/1 if atom ID tags are defined + int molecular; // 0 = atomic, 1 = standard molecular system, + // 2 = molecule template system + bigint nellipsoids; // number of ellipsoids + bigint nlines; // number of lines + bigint ntris; // number of triangles + bigint nbodies; // number of bodies // system properties - bigint nbonds,nangles,ndihedrals,nimpropers; - int ntypes,nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; - int extra_bond_per_atom,extra_angle_per_atom; - int extra_dihedral_per_atom,extra_improper_per_atom; + bigint nbonds, nangles, ndihedrals, nimpropers; + int ntypes, nbondtypes, nangletypes, ndihedraltypes, nimpropertypes; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; + int extra_bond_per_atom, extra_angle_per_atom; + int extra_dihedral_per_atom, extra_improper_per_atom; - int firstgroup; // store atoms in this group first, -1 if unset - int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, null pointer if unset + int firstgroup; // store atoms in this group first, -1 if unset + int nfirst; // # of atoms in first group on this proc + char *firstgroupname; // group-ID to store first, null pointer if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable // per-atom vectors and arrays tagint *tag; - int *type,*mask; + int *type, *mask; imageint *image; - double **x,**v,**f; + double **x, **v, **f; // charged and dipolar particles double *rmass; - double *q,**mu; + double *q, **mu; // finite-size particles double *radius; - double **omega,**angmom,**torque; - int *ellipsoid,*line,*tri,*body; + double **omega, **angmom, **torque; + int *ellipsoid, *line, *tri, *body; // molecular systems tagint *molecule; - int *molindex,*molatom; + int *molindex, *molatom; - int **nspecial; // 0,1,2 = cumulative # of 1-2,1-3,1-4 neighs - tagint **special; // IDs of 1-2,1-3,1-4 neighs of each atom - int maxspecial; // special[nlocal][maxspecial] + int **nspecial; // 0,1,2 = cumulative # of 1-2,1-3,1-4 neighs + tagint **special; // IDs of 1-2,1-3,1-4 neighs of each atom + int maxspecial; // special[nlocal][maxspecial] int *num_bond; int **bond_type; @@ -95,46 +95,46 @@ class Atom : protected Pointers { int *num_angle; int **angle_type; - tagint **angle_atom1,**angle_atom2,**angle_atom3; + tagint **angle_atom1, **angle_atom2, **angle_atom3; int *num_dihedral; int **dihedral_type; - tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4; + tagint **dihedral_atom1, **dihedral_atom2, **dihedral_atom3, **dihedral_atom4; int *num_improper; int **improper_type; - tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4; + tagint **improper_atom1, **improper_atom2, **improper_atom3, **improper_atom4; // PERI package - double *vfrac,*s0; + double *vfrac, *s0; double **x0; // SPIN package - double **sp,**fm,**fm_long; + double **sp, **fm, **fm_long; // USER_EFF and USER-AWPMD packages int *spin; - double *eradius,*ervel,*erforce; + double *eradius, *ervel, *erforce; double *ervelforce; - double **cs,**csforce,**vforce; + double **cs, **csforce, **vforce; int *etag; // USER-DPD package - double *uCond,*uMech,*uChem,*uCGnew,*uCG; + double *uCond, *uMech, *uChem, *uCGnew, *uCG; double *duChem; double *dpdTheta; int nspecies_dpd; // USER-MESO package - double **cc,**cc_flux; // cc = chemical concentration - double *edpd_temp,*edpd_flux; // temperature and heat flux + double **cc, **cc_flux; // cc = chemical concentration + double *edpd_temp, *edpd_flux; // temperature and heat flux double *vest_temp; - double *edpd_cv; // heat capacity + double *edpd_cv; // heat capacity int cc_species; // USER-MESONT package @@ -154,7 +154,7 @@ class Atom : protected Pointers { // USER-SPH package - double *rho,*drho,*esph,*desph,*cv; + double *rho, *drho, *esph, *desph, *cv; double **vest; // end of customization section @@ -166,17 +166,17 @@ class Atom : protected Pointers { // most are existence flags for per-atom vectors and arrays // 1 if variable is used, 0 if not - int sphere_flag,ellipsoid_flag,line_flag,tri_flag,body_flag; - int peri_flag,electron_flag; - int wavepacket_flag,sph_flag; + int sphere_flag, ellipsoid_flag, line_flag, tri_flag, body_flag; + int peri_flag, electron_flag; + int wavepacket_flag, sph_flag; - int molecule_flag,molindex_flag,molatom_flag; - int q_flag,mu_flag; - int rmass_flag,radius_flag,omega_flag,torque_flag,angmom_flag; - int vfrac_flag,spin_flag,eradius_flag,ervel_flag,erforce_flag; - int cs_flag,csforce_flag,vforce_flag,ervelforce_flag,etag_flag; - int rho_flag,esph_flag,cv_flag,vest_flag; - int dpd_flag,edpd_flag,tdpd_flag; + int molecule_flag, molindex_flag, molatom_flag; + int q_flag, mu_flag; + int rmass_flag, radius_flag, omega_flag, torque_flag, angmom_flag; + int vfrac_flag, spin_flag, eradius_flag, ervel_flag, erforce_flag; + int cs_flag, csforce_flag, vforce_flag, ervelforce_flag, etag_flag; + int rho_flag, esph_flag, cv_flag, vest_flag; + int dpd_flag, edpd_flag, tdpd_flag; int mesont_flag; // SPIN package @@ -186,9 +186,9 @@ class Atom : protected Pointers { // USER-SMD package int x0_flag; - int smd_flag,damage_flag; - int contact_radius_flag,smd_data_9_flag,smd_stress_flag; - int eff_plastic_strain_flag,eff_plastic_strain_rate_flag; + int smd_flag, damage_flag; + int contact_radius_flag, smd_data_9_flag, smd_stress_flag; + int eff_plastic_strain_flag, eff_plastic_strain_rate_flag; // Peridynamics scale factor, used by dump cfg @@ -211,14 +211,14 @@ class Atom : protected Pointers { }; PerAtom *peratom; - int nperatom,maxperatom; + int nperatom, maxperatom; // custom arrays used by fix property/atom int **ivector; double **dvector; - char **iname,**dname; - int nivector,ndvector; + char **iname, **dname; + int nivector, ndvector; // molecule templates // each template can be a set of consecutive molecules @@ -239,32 +239,32 @@ class Atom : protected Pointers { // callback ptrs for atom arrays managed by fix classes - int nextra_grow,nextra_restart,nextra_border; // # of callbacks of each type - int *extra_grow,*extra_restart,*extra_border; // index of fix to callback to - int nextra_grow_max,nextra_restart_max; // size of callback lists + int nextra_grow, nextra_restart, nextra_border; // # of callbacks of each type + int *extra_grow, *extra_restart, *extra_border; // index of fix to callback to + int nextra_grow_max, nextra_restart_max; // size of callback lists int nextra_border_max; int nextra_store; - int map_style; // style of atom map: 0=none, 1=array, 2=hash - int map_user; // user requested map style: - // 0 = no request, 1=array, 2=hash, 3=yes - tagint map_tag_max; // max atom ID that map() is setup for - std::set *unique_tags; // set to ensure that bodies have unique tags + int map_style; // style of atom map: 0=none, 1=array, 2=hash + int map_user; // user requested map style: + // 0 = no request, 1=array, 2=hash, 3=yes + tagint map_tag_max; // max atom ID that map() is setup for + std::set *unique_tags; // set to ensure that bodies have unique tags // spatial sorting of atoms - int sortfreq; // sort atoms every this many steps, 0 = off - bigint nextsort; // next timestep to sort on - double userbinsize; // requested sort bin size + int sortfreq; // sort atoms every this many steps, 0 = off + bigint nextsort; // next timestep to sort on + double userbinsize; // requested sort bin size // indices of atoms with same ID - int *sametag; // sametag[I] = next atom with same ID, -1 if no more + int *sametag; // sametag[I] = next atom with same ID, -1 if no more // AtomVec factory types and map typedef AtomVec *(*AtomVecCreator)(LAMMPS *); - typedef std::map AtomVecCreatorMap; + typedef std::map AtomVecCreatorMap; AtomVecCreatorMap *avec_map; // -------------------------------------------------------------------- @@ -275,10 +275,9 @@ class Atom : protected Pointers { void settings(class Atom *); void peratom_create(); - void add_peratom(const char *, void *, int, int, int threadflag=0); + void add_peratom(const char *, void *, int, int, int threadflag = 0); void add_peratom_change_columns(const char *, int); - void add_peratom_vary(const char *, void *, int, int *, - void *, int collength=0); + void add_peratom_vary(const char *, void *, int, int *, void *, int collength = 0); void create_avec(const std::string &, int, char **, int); virtual AtomVec *new_avec(const std::string &, int, int &); @@ -337,13 +336,13 @@ class Atom : protected Pointers { void *extract(const char *); int extract_datatype(const char *); - inline int* get_map_array() {return map_array;}; - inline int get_map_size() {return map_tag_max+1;}; - inline int get_max_same() {return max_same;}; - inline int get_map_maxarray() {return map_maxarray+1;}; + inline int *get_map_array() { return map_array; }; + inline int get_map_size() { return map_tag_max + 1; }; + inline int get_max_same() { return max_same; }; + inline int get_map_maxarray() { return map_maxarray + 1; }; // NOTE: placeholder method until KOKKOS/AtomVec is refactored - int memcheck(const char *) {return 1;} + int memcheck(const char *) { return 1; } double memory_usage(); @@ -351,10 +350,14 @@ class Atom : protected Pointers { // map lookup function inlined for efficiency // return -1 if no map defined - inline int map(tagint global) { - if (map_style == 1) return map_array[global]; - else if (map_style == 2) return map_find_hash(global); - else return -1; + inline int map(tagint global) + { + if (map_style == 1) + return map_array[global]; + else if (map_style == 2) + return map_find_hash(global); + else + return -1; }; void map_init(int check = 1); @@ -366,37 +369,36 @@ class Atom : protected Pointers { int map_find_hash(tagint); protected: - // global to local ID mapping - int *map_array; // direct map via array that holds map_tag_max - int map_maxarray; // allocated size of map_array (1 larger than this) + int *map_array; // direct map via array that holds map_tag_max + int map_maxarray; // allocated size of map_array (1 larger than this) - struct HashElem { // hashed map - tagint global; // key to search on = global ID - int local; // value associated with key = local index - int next; // next entry in this bucket, -1 if last + struct HashElem { // hashed map + tagint global; // key to search on = global ID + int local; // value associated with key = local index + int next; // next entry in this bucket, -1 if last }; - int map_nhash; // # of entries hash table can hold - int map_nused; // # of actual entries in hash table - int map_free; // ptr to 1st unused entry in hash table - int map_nbucket; // # of hash buckets - int *map_bucket; // ptr to 1st entry in each bucket - HashElem *map_hash; // hash table + int map_nhash; // # of entries hash table can hold + int map_nused; // # of actual entries in hash table + int map_free; // ptr to 1st unused entry in hash table + int map_nbucket; // # of hash buckets + int *map_bucket; // ptr to 1st entry in each bucket + HashElem *map_hash; // hash table - int max_same; // allocated size of sametag + int max_same; // allocated size of sametag // spatial sorting of atoms - int nbins; // # of sorting bins - int nbinx,nbiny,nbinz; // bins in each dimension - int maxbin; // max # of bins - int maxnext; // max size of next,permute - int *binhead; // 1st atom in each bin - int *next; // next atom in bin - int *permute; // permutation vector - double bininvx,bininvy,bininvz; // inverse actual bin sizes - double bboxlo[3],bboxhi[3]; // bounding box of my sub-domain + int nbins; // # of sorting bins + int nbinx, nbiny, nbinz; // bins in each dimension + int maxbin; // max # of bins + int maxnext; // max size of next,permute + int *binhead; // 1st atom in each bin + int *next; // next atom in bin + int *permute; // permutation vector + double bininvx, bininvy, bininvz; // inverse actual bin sizes + double bboxlo[3], bboxhi[3]; // bounding box of my sub-domain void set_atomflag_defaults(); void setup_sort_bins(); @@ -406,7 +408,7 @@ class Atom : protected Pointers { template static AtomVec *avec_creator(LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/atom_masks.h b/src/atom_masks.h index 84faa492fb..9fb4e8bdf0 100644 --- a/src/atom_masks.h +++ b/src/atom_masks.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/atom_vec.h b/src/atom_vec.h index a1bd8fd812..210ec720a7 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -14,56 +14,56 @@ #ifndef LMP_ATOM_VEC_H #define LMP_ATOM_VEC_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #include namespace LAMMPS_NS { class AtomVec : protected Pointers { public: - enum {PER_ATOM=0,PER_TYPE=1}; - int molecular; // 0 = atomic, 1 = molecular system, 2 = molecular template system - int bonds_allow,angles_allow; // 1 if bonds, angles are used - int dihedrals_allow,impropers_allow; // 1 if dihedrals, impropers used - int mass_type; // 1 if per-type masses - int dipole_type; // 1 if per-type dipole moments - int forceclearflag; // 1 if has forceclear() method + enum { PER_ATOM = 0, PER_TYPE = 1 }; + int molecular; // 0 = atomic, 1 = molecular system, 2 = molecular template system + int bonds_allow, angles_allow; // 1 if bonds, angles are used + int dihedrals_allow, impropers_allow; // 1 if dihedrals, impropers used + int mass_type; // 1 if per-type masses + int dipole_type; // 1 if per-type dipole moments + int forceclearflag; // 1 if has forceclear() method - int comm_x_only; // 1 if only exchange x in forward comm - int comm_f_only; // 1 if only exchange f in reverse comm + int comm_x_only; // 1 if only exchange x in forward comm + int comm_f_only; // 1 if only exchange f in reverse comm - int size_forward; // # of values per atom in comm - int size_reverse; // # in reverse comm - int size_border; // # in border comm - int size_velocity; // # of velocity based quantities - int size_data_atom; // number of values in Atom line - int size_data_vel; // number of values in Velocity line - int xcol_data; // column (1-N) where x is in Atom line - int maxexchange; // max size of exchanged atom - // only needs to be set if size > BUFEXTRA + int size_forward; // # of values per atom in comm + int size_reverse; // # in reverse comm + int size_border; // # in border comm + int size_velocity; // # of velocity based quantities + int size_data_atom; // number of values in Atom line + int size_data_vel; // number of values in Velocity line + int xcol_data; // column (1-N) where x is in Atom line + int maxexchange; // max size of exchanged atom + // only needs to be set if size > BUFEXTRA - int bonus_flag; // 1 if stores bonus data - int size_forward_bonus; // # in forward bonus comm - int size_border_bonus; // # in border bonus comm - int size_restart_bonus_one; // # in restart bonus comm - int size_data_bonus; // number of values in Bonus line + int bonus_flag; // 1 if stores bonus data + int size_forward_bonus; // # in forward bonus comm + int size_border_bonus; // # in border bonus comm + int size_restart_bonus_one; // # in restart bonus comm + int size_data_bonus; // number of values in Bonus line - class Molecule **onemols; // list of molecules for style template - int nset; // # of molecules in list + class Molecule **onemols; // list of molecules for style template + int nset; // # of molecules in list - int kokkosable; // 1 if atom style is KOKKOS-enabled + int kokkosable; // 1 if atom style is KOKKOS-enabled - int nargcopy; // copy of command-line args for atom_style command - char **argcopy; // used when AtomVec is realloced (restart,replicate) + int nargcopy; // copy of command-line args for atom_style command + char **argcopy; // used when AtomVec is realloced (restart,replicate) // additional list of peratom fields operated on by different methods // set or created by child styles - char *fields_grow,*fields_copy; - char *fields_comm,*fields_comm_vel,*fields_reverse; - char *fields_border,*fields_border_vel; - char *fields_exchange,*fields_restart; - char *fields_create,*fields_data_atom,*fields_data_vel; + char *fields_grow, *fields_copy; + char *fields_comm, *fields_comm_vel, *fields_reverse; + char *fields_border, *fields_border_vel; + char *fields_exchange, *fields_restart; + char *fields_create, *fields_data_atom, *fields_data_vel; // methods @@ -89,7 +89,7 @@ class AtomVec : protected Pointers { virtual void unpack_comm(int, int, double *); virtual void unpack_comm_vel(int, int, double *); - virtual int pack_comm_bonus(int, int *, double *) {return 0;} + virtual int pack_comm_bonus(int, int *, double *) { return 0; } virtual void unpack_comm_bonus(int, int, double *) {} virtual int pack_reverse(int, int, double *); @@ -100,14 +100,14 @@ class AtomVec : protected Pointers { virtual void unpack_border(int, int, double *); virtual void unpack_border_vel(int, int, double *); - virtual int pack_border_bonus(int, int *, double *) {return 0;} - virtual int unpack_border_bonus(int, int, double *) {return 0;} + virtual int pack_border_bonus(int, int *, double *) { return 0; } + virtual int unpack_border_bonus(int, int, double *) { return 0; } virtual int pack_exchange(int, double *); virtual int unpack_exchange(double *); - virtual int pack_exchange_bonus(int, double *) {return 0;} - virtual int unpack_exchange_bonus(int, double *) {return 0;} + virtual int pack_exchange_bonus(int, double *) { return 0; } + virtual int unpack_exchange_bonus(int, double *) { return 0; } virtual int size_restart(); virtual int pack_restart(int, double *); @@ -117,9 +117,9 @@ class AtomVec : protected Pointers { virtual void pack_restart_post(int) {} virtual void unpack_restart_init(int) {} - virtual int size_restart_bonus() {return 0;} - virtual int pack_restart_bonus(int, double *) {return 0;} - virtual int unpack_restart_bonus(int, double *) {return 0;} + virtual int size_restart_bonus() { return 0; } + virtual int pack_restart_bonus(int, double *) { return 0; } + virtual int unpack_restart_bonus(int, double *) { return 0; } virtual void create_atom(int, double *); virtual void create_atom_post(int) {} @@ -147,55 +147,55 @@ class AtomVec : protected Pointers { virtual int pack_improper(tagint **); virtual void write_improper(FILE *, int, tagint **, int); - virtual int pack_data_bonus(double *, int) {return 0;} + virtual int pack_data_bonus(double *, int) { return 0; } virtual void write_data_bonus(FILE *, int, double *, int) {} - virtual int property_atom(char *) {return -1;} + virtual int property_atom(char *) { return -1; } virtual void pack_property_atom(int, double *, int, int) {} virtual double memory_usage(); - virtual double memory_usage_bonus() {return 0;} + virtual double memory_usage_bonus() { return 0; } // old hybrid functions, needed by Kokkos package - virtual int pack_comm_hybrid(int, int *, double *) {return 0;} - virtual int unpack_comm_hybrid(int, int, double *) {return 0;} - virtual int pack_reverse_hybrid(int, int, double *) {return 0;} - virtual int unpack_reverse_hybrid(int, int *, double *) {return 0;} - virtual int pack_border_hybrid(int, int *, double *) {return 0;} - virtual int unpack_border_hybrid(int, int, double *) {return 0;} - virtual int data_atom_hybrid(int, char **) {return 0;} - virtual int data_vel_hybrid(int, char **) {return 0;} - virtual int pack_data_hybrid(int, double *) {return 0;} - virtual int write_data_hybrid(FILE *, double *) {return 0;} - virtual int pack_vel_hybrid(int, double *) {return 0;} - virtual int write_vel_hybrid(FILE *, double *) {return 0;} + virtual int pack_comm_hybrid(int, int *, double *) { return 0; } + virtual int unpack_comm_hybrid(int, int, double *) { return 0; } + virtual int pack_reverse_hybrid(int, int, double *) { return 0; } + virtual int unpack_reverse_hybrid(int, int *, double *) { return 0; } + virtual int pack_border_hybrid(int, int *, double *) { return 0; } + virtual int unpack_border_hybrid(int, int, double *) { return 0; } + virtual int data_atom_hybrid(int, char **) { return 0; } + virtual int data_vel_hybrid(int, char **) { return 0; } + virtual int pack_data_hybrid(int, double *) { return 0; } + virtual int write_data_hybrid(FILE *, double *) { return 0; } + virtual int pack_vel_hybrid(int, double *) { return 0; } + virtual int write_vel_hybrid(FILE *, double *) { return 0; } protected: - int nmax; // local copy of atom->nmax - int deform_vremap; // local copy of domain properties + int nmax; // local copy of atom->nmax + int deform_vremap; // local copy of domain properties int deform_groupbit; double *h_rate; - tagint *tag; // peratom fields common to all styles - int *type,*mask; + tagint *tag; // peratom fields common to all styles + int *type, *mask; imageint *image; - double **x,**v,**f; + double **x, **v, **f; // standard list of peratom fields always operated on by different methods // common to all styles, so not listed in field strings - const char *default_grow,*default_copy; - const char *default_comm,*default_comm_vel,*default_reverse; - const char *default_border,*default_border_vel; - const char *default_exchange,*default_restart; - const char *default_create,*default_data_atom,*default_data_vel; + const char *default_grow, *default_copy; + const char *default_comm, *default_comm_vel, *default_reverse; + const char *default_border, *default_border_vel; + const char *default_exchange, *default_restart; + const char *default_create, *default_data_atom, *default_data_vel; struct Method { std::vector pdata; std::vector datatype; std::vector cols; - std::vector maxcols; + std::vector maxcols; std::vector collength; std::vector plength; std::vector index; @@ -203,13 +203,13 @@ class AtomVec : protected Pointers { void resize(int nfield); }; - Method mgrow,mcopy; - Method mcomm,mcomm_vel,mreverse,mborder,mborder_vel,mexchange,mrestart; - Method mcreate,mdata_atom,mdata_vel; + Method mgrow, mcopy; + Method mcomm, mcomm_vel, mreverse, mborder, mborder_vel, mexchange, mrestart; + Method mcreate, mdata_atom, mdata_vel; - int ngrow,ncopy; - int ncomm,ncomm_vel,nreverse,nborder,nborder_vel,nexchange,nrestart; - int ncreate,ndata_atom,ndata_vel; + int ngrow, ncopy; + int ncomm, ncomm_vel, nreverse, nborder, nborder_vel, nexchange, nrestart; + int ncreate, ndata_atom, ndata_vel; // thread info for fields that are duplicated over threads // used by fields in grow() and memory_usage() @@ -225,7 +225,7 @@ class AtomVec : protected Pointers { void init_method(int, Method *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h index 4ec0ff2c10..00af1ce5ca 100644 --- a/src/atom_vec_atomic.h +++ b/src/atom_vec_atomic.h @@ -30,7 +30,7 @@ class AtomVecAtomic : public AtomVec { ~AtomVecAtomic() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h index 32af2838eb..3b2195b366 100644 --- a/src/atom_vec_body.h +++ b/src/atom_vec_body.h @@ -31,8 +31,8 @@ class AtomVecBody : public AtomVec { struct Bonus { double quat[4]; double inertia[3]; - int ninteger,ndouble; - int iindex,dindex; + int ninteger, ndouble; + int iindex, dindex; int *ivalue; double *dvalue; int ilocal; @@ -75,11 +75,11 @@ class AtomVecBody : public AtomVec { private: int *body; - double *rmass,*radius; + double *rmass, *radius; double **angmom; - int nghost_bonus,nmax_bonus; - int intdoubleratio; // sizeof(double) / sizeof(int) + int nghost_bonus, nmax_bonus; + int intdoubleratio; // sizeof(double) / sizeof(int) int body_flag; MyPoolChunk *icp; @@ -90,7 +90,7 @@ class AtomVecBody : public AtomVec { // check(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_charge.h b/src/atom_vec_charge.h index 4c5f2c2e81..8239ba6bb1 100644 --- a/src/atom_vec_charge.h +++ b/src/atom_vec_charge.h @@ -29,7 +29,7 @@ class AtomVecCharge : public AtomVec { AtomVecCharge(class LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h index 6b1636d7da..d014980e4f 100644 --- a/src/atom_vec_ellipsoid.h +++ b/src/atom_vec_ellipsoid.h @@ -70,7 +70,7 @@ class AtomVecEllipsoid : public AtomVec { double *rmass; double **angmom; - int nghost_bonus,nmax_bonus; + int nghost_bonus, nmax_bonus; int ellipsoid_flag; double rmass_one; @@ -78,7 +78,7 @@ class AtomVecEllipsoid : public AtomVec { void copy_bonus_all(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h index 203219861a..c9b52d2723 100644 --- a/src/atom_vec_hybrid.h +++ b/src/atom_vec_hybrid.h @@ -82,7 +82,7 @@ class AtomVecHybrid : public AtomVec { int known_style(char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h index d07d16e4bb..34da38bc1b 100644 --- a/src/atom_vec_line.h +++ b/src/atom_vec_line.h @@ -27,7 +27,7 @@ namespace LAMMPS_NS { class AtomVecLine : public AtomVec { public: struct Bonus { - double length,theta; + double length, theta; int ilocal; }; struct Bonus *bonus; @@ -67,10 +67,10 @@ class AtomVecLine : public AtomVec { private: int *line; - double *radius,*rmass; + double *radius, *rmass; double **omega; - int nghost_bonus,nmax_bonus; + int nghost_bonus, nmax_bonus; int line_flag; double rmass_one; @@ -79,7 +79,7 @@ class AtomVecLine : public AtomVec { // void consistency_check(int, char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_sphere.h b/src/atom_vec_sphere.h index 0fdf908f1c..ef93a39fbc 100644 --- a/src/atom_vec_sphere.h +++ b/src/atom_vec_sphere.h @@ -37,14 +37,14 @@ class AtomVecSphere : public AtomVec { void pack_data_post(int); private: - double *radius,*rmass; + double *radius, *rmass; double **omega; int radvary; - double radius_one,rmass_one; + double radius_one, rmass_one; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h index 8f873fa412..b29c9b94a8 100644 --- a/src/atom_vec_tri.h +++ b/src/atom_vec_tri.h @@ -28,7 +28,7 @@ class AtomVecTri : public AtomVec { public: struct Bonus { double quat[4]; - double c1[3],c2[3],c3[3]; + double c1[3], c2[3], c3[3]; double inertia[3]; int ilocal; }; @@ -69,10 +69,10 @@ class AtomVecTri : public AtomVec { private: int *tri; - double *radius,*rmass; - double **omega,**angmom; + double *radius, *rmass; + double **omega, **angmom; - int nghost_bonus,nmax_bonus; + int nghost_bonus, nmax_bonus; int tri_flag; double rmass_one; @@ -80,7 +80,7 @@ class AtomVecTri : public AtomVec { void copy_bonus_all(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/balance.h b/src/balance.h index 56551f65fe..930edba26c 100644 --- a/src/balance.h +++ b/src/balance.h @@ -27,10 +27,10 @@ namespace LAMMPS_NS { class Balance : public Command { public: class RCB *rcb; - class FixStore *fixstore; // per-atom weights stored in FixStore - int wtflag; // 1 if particle weighting is used - int varflag; // 1 if weight style var(iable) is used - int outflag; // 1 for output of balance results to file + class FixStore *fixstore; // per-atom weights stored in FixStore + int wtflag; // 1 if particle weighting is used + int varflag; // 1 if weight style var(iable) is used + int outflag; // 1 for output of balance results to file Balance(class LAMMPS *); ~Balance(); @@ -46,38 +46,38 @@ class Balance : public Command { void dumpout(bigint); private: - int me,nprocs; + int me, nprocs; - double thresh; // threshold to perform LB - int style; // style of LB - int xflag,yflag,zflag; // xyz LB flags - double *user_xsplit,*user_ysplit,*user_zsplit; // params for xyz LB - int oldrcb; // use old-style RCB compute + double thresh; // threshold to perform LB + int style; // style of LB + int xflag, yflag, zflag; // xyz LB flags + double *user_xsplit, *user_ysplit, *user_zsplit; // params for xyz LB + int oldrcb; // use old-style RCB compute - int nitermax; // params for shift LB + int nitermax; // params for shift LB double stopthresh; char bstr[4]; - int shift_allocate; // 1 if SHIFT vectors have been allocated - int ndim; // length of balance string bstr - int *bdim; // XYZ for each character in bstr - double *onecost; // work vector of counts in one dim - double *allcost; // counts for slices in one dim - double *sum; // cumulative count for slices in one dim - double *target; // target sum for slices in one dim - double *lo,*hi; // lo/hi split coords that bound each target - double *losum,*hisum; // cumulative counts at lo/hi coords - int rho; // 0 for geometric recursion - // 1 for density weighted recursion + int shift_allocate; // 1 if SHIFT vectors have been allocated + int ndim; // length of balance string bstr + int *bdim; // XYZ for each character in bstr + double *onecost; // work vector of counts in one dim + double *allcost; // counts for slices in one dim + double *sum; // cumulative count for slices in one dim + double *target; // target sum for slices in one dim + double *lo, *hi; // lo/hi split coords that bound each target + double *losum, *hisum; // cumulative counts at lo/hi coords + int rho; // 0 for geometric recursion + // 1 for density weighted recursion - double *proccost; // particle cost per processor - double *allproccost; // proccost summed across procs + double *proccost; // particle cost per processor + double *allproccost; // proccost summed across procs - int nimbalance; // number of user-specified weight styles - class Imbalance **imbalances; // list of Imb classes, one per weight style - double *weight; // ptr to FixStore weight vector + int nimbalance; // number of user-specified weight styles + class Imbalance **imbalances; // list of Imb classes, one per weight style + double *weight; // ptr to FixStore weight vector - FILE *fp; // balance output file + FILE *fp; // balance output file int firststep; double imbalance_splits(); @@ -90,7 +90,7 @@ class Balance : public Command { #endif }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/body.h b/src/body.h index 72e66a3a15..b278d67199 100644 --- a/src/body.h +++ b/src/body.h @@ -14,8 +14,8 @@ #ifndef LMP_BODY_H #define LMP_BODY_H +#include "atom_vec_body.h" // IWYU pragma: keep #include "pointers.h" -#include "atom_vec_body.h" // IWYU pragma: keep namespace LAMMPS_NS { @@ -25,24 +25,23 @@ class Body : protected Pointers { MyPoolChunk *dcp; char *style; - int size_forward; // max extra values packed for comm - int size_border; // max extra values packed for border comm - int maxexchange; // max size of exchanged atom + int size_forward; // max extra values packed for comm + int size_border; // max extra values packed for border comm + int maxexchange; // max size of exchanged atom - AtomVecBody *avec; // ptr to class that stores body bonus info + AtomVecBody *avec; // ptr to class that stores body bonus info Body(class LAMMPS *, int, char **); virtual ~Body(); // methods implemented by child classes - virtual int pack_comm_body(struct AtomVecBody::Bonus *, double *) {return 0;} - virtual int unpack_comm_body(struct AtomVecBody::Bonus *, double *) {return 0;} - virtual int pack_border_body(struct AtomVecBody::Bonus *, double *) {return 0;} - virtual int unpack_border_body(struct AtomVecBody::Bonus *, - double *) {return 0;} + virtual int pack_comm_body(struct AtomVecBody::Bonus *, double *) { return 0; } + virtual int unpack_comm_body(struct AtomVecBody::Bonus *, double *) { return 0; } + virtual int pack_border_body(struct AtomVecBody::Bonus *, double *) { return 0; } + virtual int unpack_border_body(struct AtomVecBody::Bonus *, double *) { return 0; } - virtual void data_body(int, int, int, int*, double *) = 0; + virtual void data_body(int, int, int, int *, double *) = 0; virtual int pack_data_body(tagint, int, double *) = 0; virtual int write_data_body(FILE *, double *) = 0; @@ -51,10 +50,10 @@ class Body : protected Pointers { virtual void output(int, int, double *) = 0; virtual int image(int, double, double, int *&, double **&) = 0; - virtual double radius_body(int, int, int *, double *) {return 0.0;} + virtual double radius_body(int, int, int *, double *) { return 0.0; } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/bond.h b/src/bond.h index e148113ea9..f5d7d95901 100644 --- a/src/bond.h +++ b/src/bond.h @@ -14,27 +14,28 @@ #ifndef LMP_BOND_H #define LMP_BOND_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Bond : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - int writedata; // 1 if writes coeffs to data file - double energy; // accumulated energies - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial + int writedata; // 1 if writes coeffs to data file + double energy; // accumulated energies + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial - int reinitflag; // 1 if compatible with fix adapt and alike + int reinitflag; // 1 if compatible with fix adapt and alike // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Bond(class LAMMPS *); @@ -47,33 +48,37 @@ class Bond : protected Pointers { virtual double equilibrium_distance(int) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double single(int, double, int, int, double &) = 0; virtual double memory_usage(); - virtual void *extract(const char *, int &) {return nullptr;} + virtual void *extract(const char *, int &) { return nullptr; } virtual void reinit(); - void write_file(int, char**); + void write_file(int, char **); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom; - int maxeatom,maxvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom; + int maxeatom, maxvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + 0; } void ev_setup(int, int, int alloc = 1); void ev_tally(int, int, int, int, double, double, double, double, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/bond_deprecated.h b/src/bond_deprecated.h index 3595e51da8..932c90349c 100644 --- a/src/bond_deprecated.h +++ b/src/bond_deprecated.h @@ -38,7 +38,7 @@ class BondDeprecated : public Bond { virtual double single(int, double, int, int, double &) { return 0.0; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/bond_hybrid.h b/src/bond_hybrid.h index 81514850e2..ba5da1a57f 100644 --- a/src/bond_hybrid.h +++ b/src/bond_hybrid.h @@ -28,9 +28,9 @@ class BondHybrid : public Bond { friend class Force; public: - int nstyles; // # of different bond styles - Bond **styles; // class list for each Bond style - char **keywords; // keyword for each Bond style + int nstyles; // # of different bond styles + Bond **styles; // class list for each Bond style + char **keywords; // keyword for each Bond style BondHybrid(class LAMMPS *); ~BondHybrid(); @@ -45,16 +45,16 @@ class BondHybrid : public Bond { double memory_usage(); private: - int *map; // which style each bond type points to - int has_quartic; // which style, if any is a quartic bond style - int *nbondlist; // # of bonds in sub-style bondlists - int *maxbond; // max # of bonds sub-style lists can store - int ***bondlist; // bondlist for each sub-style + int *map; // which style each bond type points to + int has_quartic; // which style, if any is a quartic bond style + int *nbondlist; // # of bonds in sub-style bondlists + int *maxbond; // max # of bonds sub-style lists can store + int ***bondlist; // bondlist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/bond_zero.h b/src/bond_zero.h index 5480b011e0..ce28cfe97e 100644 --- a/src/bond_zero.h +++ b/src/bond_zero.h @@ -47,7 +47,7 @@ class BondZero : public Bond { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/change_box.h b/src/change_box.h index c98afede3a..5b7e8e2988 100644 --- a/src/change_box.h +++ b/src/change_box.h @@ -34,25 +34,25 @@ class ChangeBox : public Command { double scale[3]; struct Operation { - int style,flavor; - int dim,boundindex; - int vdim1,vdim2; - double flo,fhi,ftilt; - double dlo,dhi,dtilt; + int style, flavor; + int dim, boundindex; + int vdim1, vdim2; + double flo, fhi, ftilt; + double dlo, dhi, dtilt; double scale; }; Operation *ops; int nops; - double boxlo[3],h_inv[6]; + double boxlo[3], h_inv[6]; void options(int, char **); void save_box_state(); void volume_preserve(int, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/citeme.h b/src/citeme.h index 4694b5b783..6b259fd418 100644 --- a/src/citeme.h +++ b/src/citeme.h @@ -23,21 +23,21 @@ class CiteMe : protected Pointers { public: CiteMe(class LAMMPS *, int, int, const char *); virtual ~CiteMe(); - void add(const std::string &); // register publication for output - void flush(); // flush buffers to screen and logfile - enum {VERBOSE, TERSE}; + void add(const std::string &); // register publication for output + void flush(); // flush buffers to screen and logfile + enum { VERBOSE, TERSE }; private: - FILE *fp; // explicit citation file pointer or NULL - std::string citefile; // name of the explicit citation file. - int screen_flag; // determine whether verbose or terse output - int logfile_flag; // determine whether verbose or terse output - std::string scrbuffer; // output buffer for screen - std::string logbuffer; // output buffer for logfile + FILE *fp; // explicit citation file pointer or NULL + std::string citefile; // name of the explicit citation file. + int screen_flag; // determine whether verbose or terse output + int logfile_flag; // determine whether verbose or terse output + std::string scrbuffer; // output buffer for screen + std::string logbuffer; // output buffer for logfile typedef std::set citeset; - citeset *cs; // registered set of publications + citeset *cs; // registered set of publications }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/comm.h b/src/comm.h index df016c0b72..1804ac173f 100644 --- a/src/comm.h +++ b/src/comm.h @@ -14,7 +14,7 @@ #ifndef LMP_COMM_H #define LMP_COMM_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -24,41 +24,41 @@ class Comm : protected Pointers { int layout; // LAYOUT_UNIFORM = equal-sized bricks // LAYOUT_NONUNIFORM = logical bricks, but diff sizes via LB // LAYOUT_TILED = general tiling, due to RCB LB - enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; - int mode; // 0 = single cutoff, 1 = multi-collection cutoff, 2 = multiold-type cutoff - enum{SINGLE,MULTI,MULTIOLD}; + enum { LAYOUT_UNIFORM, LAYOUT_NONUNIFORM, LAYOUT_TILED }; + int mode; // 0 = single cutoff, 1 = multi-collection cutoff, 2 = multiold-type cutoff + enum { SINGLE, MULTI, MULTIOLD }; - int me,nprocs; // proc info - int ghost_velocity; // 1 if ghost atoms have velocity, 0 if not - double cutghost[3]; // cutoffs used for acquiring ghost atoms - double cutghostuser; // user-specified ghost cutoff (mode == SINGLE) - double *cutusermulti; // per collection user ghost cutoff (mode == MULTI) - double *cutusermultiold; // per type user ghost cutoff (mode == MULTIOLD) - int ncollections; // # of collections known by comm, used to test if # has changed - int ncollections_cutoff; // # of collections stored b cutoff/multi - int recv_from_partition; // recv proc layout from this partition - int send_to_partition; // send my proc layout to this partition - // -1 if no recv or send - int other_partition_style; // 0 = recv layout dims must be multiple of - // my layout dims + int me, nprocs; // proc info + int ghost_velocity; // 1 if ghost atoms have velocity, 0 if not + double cutghost[3]; // cutoffs used for acquiring ghost atoms + double cutghostuser; // user-specified ghost cutoff (mode == SINGLE) + double *cutusermulti; // per collection user ghost cutoff (mode == MULTI) + double *cutusermultiold; // per type user ghost cutoff (mode == MULTIOLD) + int ncollections; // # of collections known by comm, used to test if # has changed + int ncollections_cutoff; // # of collections stored b cutoff/multi + int recv_from_partition; // recv proc layout from this partition + int send_to_partition; // send my proc layout to this partition + // -1 if no recv or send + int other_partition_style; // 0 = recv layout dims must be multiple of + // my layout dims - int nthreads; // OpenMP threads per MPI process + int nthreads; // OpenMP threads per MPI process // public settings specific to layout = UNIFORM, NONUNIFORM - int procgrid[3]; // procs assigned in each dim of 3d grid - int user_procgrid[3]; // user request for procs in each dim - int myloc[3]; // which proc I am in each dim - int procneigh[3][2]; // my 6 neighboring procs, 0/1 = left/right - double *xsplit,*ysplit,*zsplit; // fractional (0-1) sub-domain sizes - int ***grid2proc; // which proc owns i,j,k loc in 3d grid + int procgrid[3]; // procs assigned in each dim of 3d grid + int user_procgrid[3]; // user request for procs in each dim + int myloc[3]; // which proc I am in each dim + int procneigh[3][2]; // my 6 neighboring procs, 0/1 = left/right + double *xsplit, *ysplit, *zsplit; // fractional (0-1) sub-domain sizes + int ***grid2proc; // which proc owns i,j,k loc in 3d grid // public settings specific to layout = TILED - int rcbnew; // 1 if just reset by rebalance, else 0 - double mysplit[3][2]; // fractional (0-1) bounds of my sub-domain - double rcbcutfrac; // fractional RCB cut by this proc - int rcbcutdim; // dimension of RCB cut + int rcbnew; // 1 if just reset by rebalance, else 0 + double mysplit[3][2]; // fractional (0-1) bounds of my sub-domain + double rcbcutfrac; // fractional RCB cut by this proc + int rcbcutdim; // dimension of RCB cut // methods @@ -69,23 +69,23 @@ class Comm : protected Pointers { virtual void init(); void modify_params(int, char **); - void set_processors(int, char **); // set 3d processor grid attributes - virtual void set_proc_grid(int outflag = 1); // setup 3d grid of procs + void set_processors(int, char **); // set 3d processor grid attributes + virtual void set_proc_grid(int outflag = 1); // setup 3d grid of procs - double get_comm_cutoff(); // determine communication cutoff + double get_comm_cutoff(); // determine communication cutoff - virtual void setup() = 0; // setup 3d comm pattern - virtual void forward_comm(int dummy = 0) = 0; // forward comm of atom coords - virtual void reverse_comm() = 0; // reverse comm of forces - virtual void exchange() = 0; // move atoms to new procs - virtual void borders() = 0; // setup list of atoms to comm + virtual void setup() = 0; // setup 3d comm pattern + virtual void forward_comm(int dummy = 0) = 0; // forward comm of atom coords + virtual void reverse_comm() = 0; // reverse comm of forces + virtual void exchange() = 0; // move atoms to new procs + virtual void borders() = 0; // setup list of atoms to comm // forward/reverse comm from a Pair, Fix, Compute, Dump virtual void forward_comm_pair(class Pair *) = 0; virtual void reverse_comm_pair(class Pair *) = 0; - virtual void forward_comm_fix(class Fix *, int size=0) = 0; - virtual void reverse_comm_fix(class Fix *, int size=0) = 0; + virtual void forward_comm_fix(class Fix *, int size = 0) = 0; + virtual void reverse_comm_fix(class Fix *, int size = 0) = 0; virtual void reverse_comm_fix_variable(class Fix *) = 0; virtual void forward_comm_compute(class Compute *) = 0; virtual void reverse_comm_compute(class Compute *) = 0; @@ -111,63 +111,61 @@ class Comm : protected Pointers { // non-virtual functions common to all Comm styles - void ring(int, int, void *, int, void (*)(int, char *, void *), - void *, void *, int self = 1); + void ring(int, int, void *, int, void (*)(int, char *, void *), void *, void *, int self = 1); int rendezvous(int, int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), - int, char *&, int, void *, int statflag=0); + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, void *, + int statflag = 0); // extract data useful to other classes - virtual void *extract(const char *, int &) {return nullptr;} + virtual void *extract(const char *, int &) { return nullptr; } protected: - int bordergroup; // only communicate this group in borders + int bordergroup; // only communicate this group in borders - int triclinic; // 0 if domain is orthog, 1 if triclinic - int map_style; // non-0 if global->local mapping is done - int comm_x_only,comm_f_only; // 1 if only exchange x,f in for/rev comm + int triclinic; // 0 if domain is orthog, 1 if triclinic + int map_style; // non-0 if global->local mapping is done + int comm_x_only, comm_f_only; // 1 if only exchange x,f in for/rev comm - int size_forward; // # of per-atom datums in forward comm - int size_reverse; // # of datums in reverse comm - int size_border; // # of datums in forward border comm + int size_forward; // # of per-atom datums in forward comm + int size_reverse; // # of datums in reverse comm + int size_border; // # of datums in forward border comm - int maxforward,maxreverse; // max # of datums in forward/reverse comm - int maxexchange; // max size of one exchanged atom - int maxexchange_atom; // contribution to maxexchange from AtomVec - int maxexchange_fix; // static contribution to maxexchange from Fixes - int maxexchange_fix_dynamic; // 1 if a fix has a dynamic contribution - int bufextra; // augment send buf size for an exchange atom + int maxforward, maxreverse; // max # of datums in forward/reverse comm + int maxexchange; // max size of one exchanged atom + int maxexchange_atom; // contribution to maxexchange from AtomVec + int maxexchange_fix; // static contribution to maxexchange from Fixes + int maxexchange_fix_dynamic; // 1 if a fix has a dynamic contribution + int bufextra; // augment send buf size for an exchange atom + int gridflag; // option for creating 3d grid + int mapflag; // option for mapping procs to 3d grid + char xyz[4]; // xyz mapping of procs to 3d grid + char *customfile; // file with custom proc map + char *outfile; // proc grid/map output file - int gridflag; // option for creating 3d grid - int mapflag; // option for mapping procs to 3d grid - char xyz[4]; // xyz mapping of procs to 3d grid - char *customfile; // file with custom proc map - char *outfile; // proc grid/map output file - - int otherflag; // 1 if this partition dependent on another - int other_style; // style of dependency - int other_procgrid[3]; // proc layout of another partition - int other_coregrid[3]; // core layout of another partition - int ncores; // # of cores per node - int coregrid[3]; // 3d grid of cores within a node - int user_coregrid[3]; // user request for cores in each dim - int multi_reduce; // 1 if multi cutoff is intra-collection cutoff + int otherflag; // 1 if this partition dependent on another + int other_style; // style of dependency + int other_procgrid[3]; // proc layout of another partition + int other_coregrid[3]; // core layout of another partition + int ncores; // # of cores per node + int coregrid[3]; // 3d grid of cores within a node + int user_coregrid[3]; // user request for cores in each dim + int multi_reduce; // 1 if multi cutoff is intra-collection cutoff void init_exchange(); int rendezvous_irregular(int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), - int, char *&, int, void *, int); + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, + void *, int); int rendezvous_all2all(int, char *, int, int, int *, - int (*)(int, char *, int &, int *&, char *&, void *), - int, char *&, int, void *, int); + int (*)(int, char *, int &, int *&, char *&, void *), int, char *&, int, + void *, int); void rendezvous_stats(int, int, int, int, int, int, bigint); public: - enum{MULTIPLE}; + enum { MULTIPLE }; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/comm_brick.h b/src/comm_brick.h index aa75966249..069c6797c9 100644 --- a/src/comm_brick.h +++ b/src/comm_brick.h @@ -33,69 +33,69 @@ class CommBrick : public Comm { virtual void forward_comm_pair(class Pair *); // forward comm from a Pair virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair - virtual void forward_comm_fix(class Fix *, int size=0); - // forward comm from a Fix - virtual void reverse_comm_fix(class Fix *, int size=0); - // reverse comm from a Fix + virtual void forward_comm_fix(class Fix *, int size = 0); + // forward comm from a Fix + virtual void reverse_comm_fix(class Fix *, int size = 0); + // reverse comm from a Fix virtual void reverse_comm_fix_variable(class Fix *); - // variable size reverse comm from a Fix - virtual void forward_comm_compute(class Compute *); // forward from a Compute - virtual void reverse_comm_compute(class Compute *); // reverse from a Compute - virtual void forward_comm_dump(class Dump *); // forward comm from a Dump - virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump + // variable size reverse comm from a Fix + virtual void forward_comm_compute(class Compute *); // forward from a Compute + virtual void reverse_comm_compute(class Compute *); // reverse from a Compute + virtual void forward_comm_dump(class Dump *); // forward comm from a Dump + virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump - void forward_comm_array(int, double **); // forward comm of array - int exchange_variable(int, double *, double *&); // exchange on neigh stencil - void *extract(const char *,int &); + void forward_comm_array(int, double **); // forward comm of array + int exchange_variable(int, double *, double *&); // exchange on neigh stencil + void *extract(const char *, int &); virtual double memory_usage(); protected: - int nswap; // # of swaps to perform = sum of maxneed - int recvneed[3][2]; // # of procs away I recv atoms from - int sendneed[3][2]; // # of procs away I send atoms to - int maxneed[3]; // max procs away any proc needs, per dim - int maxswap; // max # of swaps memory is allocated for - int *sendnum,*recvnum; // # of atoms to send/recv in each swap - int *sendproc,*recvproc; // proc to send/recv to/from at each swap - int *size_forward_recv; // # of values to recv in each forward comm - int *size_reverse_send; // # to send in each reverse comm - int *size_reverse_recv; // # to recv in each reverse comm - double *slablo,*slabhi; // bounds of slab to send at each swap - double **multilo,**multihi; // bounds of slabs for multi-collection swap - double **multioldlo,**multioldhi; // bounds of slabs for multi-type swap - double **cutghostmulti; // cutghost on a per-collection basis - double **cutghostmultiold; // cutghost on a per-type basis - int *pbc_flag; // general flag for sending atoms thru PBC - int **pbc; // dimension flags for PBC adjustments + int nswap; // # of swaps to perform = sum of maxneed + int recvneed[3][2]; // # of procs away I recv atoms from + int sendneed[3][2]; // # of procs away I send atoms to + int maxneed[3]; // max procs away any proc needs, per dim + int maxswap; // max # of swaps memory is allocated for + int *sendnum, *recvnum; // # of atoms to send/recv in each swap + int *sendproc, *recvproc; // proc to send/recv to/from at each swap + int *size_forward_recv; // # of values to recv in each forward comm + int *size_reverse_send; // # to send in each reverse comm + int *size_reverse_recv; // # to recv in each reverse comm + double *slablo, *slabhi; // bounds of slab to send at each swap + double **multilo, **multihi; // bounds of slabs for multi-collection swap + double **multioldlo, **multioldhi; // bounds of slabs for multi-type swap + double **cutghostmulti; // cutghost on a per-collection basis + double **cutghostmultiold; // cutghost on a per-type basis + int *pbc_flag; // general flag for sending atoms thru PBC + int **pbc; // dimension flags for PBC adjustments - int *firstrecv; // where to put 1st recv atom in each swap - int **sendlist; // list of atoms to send in each swap - int *localsendlist; // indexed list of local sendlist atoms - int *maxsendlist; // max size of send list for each swap + int *firstrecv; // where to put 1st recv atom in each swap + int **sendlist; // list of atoms to send in each swap + int *localsendlist; // indexed list of local sendlist atoms + int *maxsendlist; // max size of send list for each swap - double *buf_send; // send buffer for all comm - double *buf_recv; // recv buffer for all comm - int maxsend,maxrecv; // current size of send/recv buffer - int smax,rmax; // max size in atoms of single borders send/recv + double *buf_send; // send buffer for all comm + double *buf_recv; // recv buffer for all comm + int maxsend, maxrecv; // current size of send/recv buffer + int smax, rmax; // max size in atoms of single borders send/recv // NOTE: init_buffers is called from a constructor and must not be made virtual void init_buffers(); int updown(int, int, int, double, int, double *); - // compare cutoff to procs - virtual void grow_send(int, int); // reallocate send buffer - virtual void grow_recv(int); // free/allocate recv buffer - virtual void grow_list(int, int); // reallocate one sendlist - virtual void grow_swap(int); // grow swap, multi, and multi/old arrays - virtual void allocate_swap(int); // allocate swap arrays - virtual void allocate_multi(int); // allocate multi arrays - virtual void allocate_multiold(int); // allocate multi/old arrays - virtual void free_swap(); // free swap arrays - virtual void free_multi(); // free multi arrays - virtual void free_multiold(); // free multi/old arrays + // compare cutoff to procs + virtual void grow_send(int, int); // reallocate send buffer + virtual void grow_recv(int); // free/allocate recv buffer + virtual void grow_list(int, int); // reallocate one sendlist + virtual void grow_swap(int); // grow swap, multi, and multi/old arrays + virtual void allocate_swap(int); // allocate swap arrays + virtual void allocate_multi(int); // allocate multi arrays + virtual void allocate_multiold(int); // allocate multi/old arrays + virtual void free_swap(); // free swap arrays + virtual void free_multi(); // free multi arrays + virtual void free_multiold(); // free multi/old arrays }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/comm_tiled.h b/src/comm_tiled.h index ed492f4a45..7337e87973 100644 --- a/src/comm_tiled.h +++ b/src/comm_tiled.h @@ -25,7 +25,7 @@ class CommTiled : public Comm { virtual ~CommTiled(); void init(); - void setup(); // setup comm pattern + void setup(); // setup comm pattern virtual void forward_comm(int dummy = 0); // forward comm of atom coords virtual void reverse_comm(); // reverse comm of forces virtual void exchange(); // move atoms to new procs @@ -33,19 +33,19 @@ class CommTiled : public Comm { virtual void forward_comm_pair(class Pair *); // forward comm from a Pair virtual void reverse_comm_pair(class Pair *); // reverse comm from a Pair - virtual void forward_comm_fix(class Fix *, int size=0); - // forward comm from a Fix - virtual void reverse_comm_fix(class Fix *, int size=0); - // reverse comm from a Fix + virtual void forward_comm_fix(class Fix *, int size = 0); + // forward comm from a Fix + virtual void reverse_comm_fix(class Fix *, int size = 0); + // reverse comm from a Fix virtual void reverse_comm_fix_variable(class Fix *); - // variable size reverse comm from a Fix - virtual void forward_comm_compute(class Compute *); // forward from a Compute - virtual void reverse_comm_compute(class Compute *); // reverse from a Compute - virtual void forward_comm_dump(class Dump *); // forward comm from a Dump - virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump + // variable size reverse comm from a Fix + virtual void forward_comm_compute(class Compute *); // forward from a Compute + virtual void reverse_comm_compute(class Compute *); // reverse from a Compute + virtual void forward_comm_dump(class Dump *); // forward comm from a Dump + virtual void reverse_comm_dump(class Dump *); // reverse comm from a Dump - virtual void forward_comm_array(int, double **); // forward comm of array - virtual int exchange_variable(int, double *, double *&); // exchange on neigh stencil + virtual void forward_comm_array(int, double **); // forward comm of array + virtual int exchange_variable(int, double *, double *&); // exchange on neigh stencil void coord2proc_setup(); int coord2proc(double *, int &, int &, int &); @@ -53,69 +53,69 @@ class CommTiled : public Comm { double memory_usage(); private: - int nswap; // # of swaps to perform = 2*dim - int maxswap; // largest nswap can be = 6 + int nswap; // # of swaps to perform = 2*dim + int maxswap; // largest nswap can be = 6 // forward/reverse comm info, proc lists include self - int *nsendproc,*nrecvproc; // # of procs to send/recv to/from per swap - int *sendother,*recvother; // 1 if send/recv to/from other proc per swap - int *sendself; // 1 if send to self per swap - int *nprocmax; // current max # of send procs per swap - int **sendproc,**recvproc; // procs to send/recv to/from per swap - int **sendnum,**recvnum; // # of atoms to send/recv per swap/proc - int **size_forward_recv; // # of values to recv in each forward swap/proc - int **firstrecv; // where to put 1st recv atom per swap/proc - int **size_reverse_send; // # of values to send in each reverse swap/proc - int **size_reverse_recv; // # of values to recv in each reverse swap/proc - int **forward_recv_offset; // forward comm offsets in buf_recv per swap/proc - int **reverse_recv_offset; // reverse comm offsets in buf_recv per swap/proc - int ***sendlist; // list of atoms to send per swap/proc - int **maxsendlist; // max size of send list per swap/proc - int **pbc_flag; // general flag for sending atoms thru PBC - int ***pbc; // dimension flags for PBC adjustments + int *nsendproc, *nrecvproc; // # of procs to send/recv to/from per swap + int *sendother, *recvother; // 1 if send/recv to/from other proc per swap + int *sendself; // 1 if send to self per swap + int *nprocmax; // current max # of send procs per swap + int **sendproc, **recvproc; // procs to send/recv to/from per swap + int **sendnum, **recvnum; // # of atoms to send/recv per swap/proc + int **size_forward_recv; // # of values to recv in each forward swap/proc + int **firstrecv; // where to put 1st recv atom per swap/proc + int **size_reverse_send; // # of values to send in each reverse swap/proc + int **size_reverse_recv; // # of values to recv in each reverse swap/proc + int **forward_recv_offset; // forward comm offsets in buf_recv per swap/proc + int **reverse_recv_offset; // reverse comm offsets in buf_recv per swap/proc + int ***sendlist; // list of atoms to send per swap/proc + int **maxsendlist; // max size of send list per swap/proc + int **pbc_flag; // general flag for sending atoms thru PBC + int ***pbc; // dimension flags for PBC adjustments - double ***sendbox; // bounding box of atoms to send per swap/proc + double ***sendbox; // bounding box of atoms to send per swap/proc - double **cutghostmulti; // cutghost on a per-collection basis - double **cutghostmultiold; // cutghost on a per-type basis - double ****sendbox_multi; // bounding box of atoms to send - // per swap/proc for multi comm - double ****sendbox_multiold; // bounding box of atoms to send - // per swap/proc for multi/old comm + double **cutghostmulti; // cutghost on a per-collection basis + double **cutghostmultiold; // cutghost on a per-type basis + double ****sendbox_multi; // bounding box of atoms to send + // per swap/proc for multi comm + double ****sendbox_multiold; // bounding box of atoms to send + // per swap/proc for multi/old comm // exchange comm info, proc lists do not include self - int *nexchproc; // # of procs to send/recv to/from in each dim - int *nexchprocmax; // current max # of exch procs for each dim - int **exchproc; // procs to exchange with per dim - int **exchnum; // # of values received per dim/proc + int *nexchproc; // # of procs to send/recv to/from in each dim + int *nexchprocmax; // current max # of exch procs for each dim + int **exchproc; // procs to exchange with per dim + int **exchnum; // # of values received per dim/proc - double *buf_send; // send buffer for all comm - double *buf_recv; // recv buffer for all comm - int maxsend,maxrecv; // current size of send/recv buffer - int smaxone,rmaxone; // max size in atoms of single borders send/recv - int smaxall,rmaxall; // max size in atoms of any borders send/recv - // for comm to all procs in one swap + double *buf_send; // send buffer for all comm + double *buf_recv; // recv buffer for all comm + int maxsend, maxrecv; // current size of send/recv buffer + int smaxone, rmaxone; // max size in atoms of single borders send/recv + int smaxall, rmaxall; // max size in atoms of any borders send/recv + // for comm to all procs in one swap - int maxrequest; // max size of Request vector + int maxrequest; // max size of Request vector MPI_Request *requests; struct RCBinfo { - double mysplit[3][2]; // fractional RCB bounding box for one proc - double cutfrac; // fractional position of cut this proc owns - int dim; // dimension = 0/1/2 of cut + double mysplit[3][2]; // fractional RCB bounding box for one proc + double cutfrac; // fractional position of cut this proc owns + int dim; // dimension = 0/1/2 of cut }; - RCBinfo *rcbinfo; // list of RCB info for all procs + RCBinfo *rcbinfo; // list of RCB info for all procs - int noverlap; // # of overlapping procs - int maxoverlap; // current max length of overlap - int *overlap; // list of overlapping procs + int noverlap; // # of overlapping procs + int maxoverlap; // current max length of overlap + int *overlap; // list of overlapping procs - double *prd; // local ptrs to Domain attributes - double *boxlo,*boxhi; - double *sublo,*subhi; + double *prd; // local ptrs to Domain attributes + double *boxlo, *boxhi; + double *sublo, *subhi; int dimension; // NOTE: init_buffers is called from a constructor and must not be made virtual @@ -146,18 +146,17 @@ class CommTiled : public Comm { int point_drop_tiled_recurse(double *, int, int); int closer_subbox_edge(int, double *); - void grow_send(int, int); // reallocate send buffer - void grow_recv(int); // free/allocate recv buffer - void grow_list(int, int, int); // reallocate sendlist for one swap/proc - void allocate_swap(int); // allocate swap arrays - void grow_swap_send(int, int, int); // grow swap arrays for send and recv - void grow_swap_send_multi(int, int); // grow multi swap arrays for send and recv + void grow_send(int, int); // reallocate send buffer + void grow_recv(int); // free/allocate recv buffer + void grow_list(int, int, int); // reallocate sendlist for one swap/proc + void allocate_swap(int); // allocate swap arrays + void grow_swap_send(int, int, int); // grow swap arrays for send and recv + void grow_swap_send_multi(int, int); // grow multi swap arrays for send and recv void grow_swap_recv(int, int); - void deallocate_swap(int); // deallocate swap arrays - + void deallocate_swap(int); // deallocate swap arrays }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/command.h b/src/command.h index 169fbc0c92..35334fb46e 100644 --- a/src/command.h +++ b/src/command.h @@ -20,10 +20,10 @@ namespace LAMMPS_NS { class Command : protected Pointers { public: - Command(class LAMMPS *lmp) : Pointers(lmp) {}; + Command(class LAMMPS *lmp) : Pointers(lmp){}; virtual void command(int, char **) = 0; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/compute.h b/src/compute.h index f0af428610..c1d733e50b 100644 --- a/src/compute.h +++ b/src/compute.h @@ -14,12 +14,13 @@ #ifndef LMP_COMPUTE_H #define LMP_COMPUTE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Compute : protected Pointers { public: + // clang-format off enum { INVOKED_NONE = 0, INVOKED_SCALAR = 1<<0, @@ -28,78 +29,79 @@ class Compute : protected Pointers { INVOKED_PERATOM = 1<<3, INVOKED_LOCAL = 1<<4, }; - static int instance_total; // # of Compute classes ever instantiated + // clang-format on + static int instance_total; // # of Compute classes ever instantiated - char *id,*style; - int igroup,groupbit; + char *id, *style; + int igroup, groupbit; - double scalar; // computed global scalar - double *vector; // computed global vector - double **array; // computed global array - double *vector_atom; // computed per-atom vector - double **array_atom; // computed per-atom array - double *vector_local; // computed local vector - double **array_local; // computed local array + double scalar; // computed global scalar + double *vector; // computed global vector + double **array; // computed global array + double *vector_atom; // computed per-atom vector + double **array_atom; // computed per-atom array + double *vector_local; // computed local vector + double **array_local; // computed local array - int scalar_flag; // 0/1 if compute_scalar() function exists - int vector_flag; // 0/1 if compute_vector() function exists - int array_flag; // 0/1 if compute_array() function exists - int size_vector; // length of global vector - int size_array_rows; // rows in global array - int size_array_cols; // columns in global array - int size_vector_variable; // 1 if vec length is unknown in advance - int size_array_rows_variable; // 1 if array rows is unknown in advance + int scalar_flag; // 0/1 if compute_scalar() function exists + int vector_flag; // 0/1 if compute_vector() function exists + int array_flag; // 0/1 if compute_array() function exists + int size_vector; // length of global vector + int size_array_rows; // rows in global array + int size_array_cols; // columns in global array + int size_vector_variable; // 1 if vec length is unknown in advance + int size_array_rows_variable; // 1 if array rows is unknown in advance int peratom_flag; // 0/1 if compute_peratom() function exists int size_peratom_cols; // 0 = vector, N = columns in peratom array - int local_flag; // 0/1 if compute_local() function exists - int size_local_rows; // rows in local vector or array - int size_local_cols; // 0 = vector, N = columns in local array + int local_flag; // 0/1 if compute_local() function exists + int size_local_rows; // rows in local vector or array + int size_local_cols; // 0 = vector, N = columns in local array - int extscalar; // 0/1 if global scalar is intensive/extensive - int extvector; // 0/1/-1 if global vector is all int/ext/extlist - int *extlist; // list of 0/1 int/ext for each vec component - int extarray; // 0/1 if global array is all intensive/extensive + int extscalar; // 0/1 if global scalar is intensive/extensive + int extvector; // 0/1/-1 if global vector is all int/ext/extlist + int *extlist; // list of 0/1 int/ext for each vec component + int extarray; // 0/1 if global array is all intensive/extensive - int tempflag; // 1 if Compute can be used as temperature - // must have both compute_scalar, compute_vector - int pressflag; // 1 if Compute can be used as pressure (uses virial) - // must have both compute_scalar, compute_vector - int pressatomflag; // 1 if Compute calculates per-atom virial - // 2 if Compute calculates per-atom centroid virial - // 3 if Compute calculates both - int peflag; // 1 if Compute calculates PE (uses Force energies) - int peatomflag; // 1 if Compute calculates per-atom PE + int tempflag; // 1 if Compute can be used as temperature + // must have both compute_scalar, compute_vector + int pressflag; // 1 if Compute can be used as pressure (uses virial) + // must have both compute_scalar, compute_vector + int pressatomflag; // 1 if Compute calculates per-atom virial + // 2 if Compute calculates per-atom centroid virial + // 3 if Compute calculates both + int peflag; // 1 if Compute calculates PE (uses Force energies) + int peatomflag; // 1 if Compute calculates per-atom PE int create_attribute; // 1 if compute stores attributes that need // setting when a new atom is created - int tempbias; // 0/1 if Compute temp includes self/extra bias + int tempbias; // 0/1 if Compute temp includes self/extra bias - int timeflag; // 1 if Compute stores list of timesteps it's called on - int ntime; // # of entries in time list - int maxtime; // max # of entries time list can hold - bigint *tlist; // list of timesteps the Compute is called on + int timeflag; // 1 if Compute stores list of timesteps it's called on + int ntime; // # of entries in time list + int maxtime; // max # of entries time list can hold + bigint *tlist; // list of timesteps the Compute is called on - int invoked_flag; // non-zero if invoked or accessed this step, 0 if not - bigint invoked_scalar; // last timestep on which compute_scalar() was invoked - bigint invoked_vector; // ditto for compute_vector() - bigint invoked_array; // ditto for compute_array() - bigint invoked_peratom; // ditto for compute_peratom() - bigint invoked_local; // ditto for compute_local() + int invoked_flag; // non-zero if invoked or accessed this step, 0 if not + bigint invoked_scalar; // last timestep on which compute_scalar() was invoked + bigint invoked_vector; // ditto for compute_vector() + bigint invoked_array; // ditto for compute_array() + bigint invoked_peratom; // ditto for compute_peratom() + bigint invoked_local; // ditto for compute_local() - double dof; // degrees-of-freedom for temperature + double dof; // degrees-of-freedom for temperature - int comm_forward; // size of forward communication (0 if none) - int comm_reverse; // size of reverse communication (0 if none) - int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) + int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; - int copymode,kokkosable; + int copymode, kokkosable; Compute(class LAMMPS *, int, char **); virtual ~Compute(); @@ -109,20 +111,20 @@ class Compute : protected Pointers { virtual void init() = 0; virtual void init_list(int, class NeighList *) {} virtual void setup() {} - virtual double compute_scalar() {return 0.0;} + virtual double compute_scalar() { return 0.0; } virtual void compute_vector() {} virtual void compute_array() {} virtual void compute_peratom() {} virtual void compute_local() {} virtual void set_arrays(int) {} - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + virtual int pack_forward_comm(int, int *, double *, int, int *) { return 0; } virtual void unpack_forward_comm(int, int, double *) {} - virtual int pack_reverse_comm(int, int, double *) {return 0;} + virtual int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} virtual void dof_remove_pre() {} - virtual int dof_remove(int) {return 0;} + virtual int dof_remove(int) { return 0; } virtual void remove_bias(int, double *) {} virtual void remove_bias_thr(int, double *, double *) {} virtual void remove_bias_all() {} @@ -135,7 +137,7 @@ class Compute : protected Pointers { virtual void lock_enable() {} virtual void lock_disable() {} - virtual int lock_length() {return 0;} + virtual int lock_length() { return 0; } virtual void lock(class Fix *, bigint, bigint) {} virtual void unlock(class Fix *) {} @@ -145,36 +147,35 @@ class Compute : protected Pointers { int matchstep(bigint); void clearstep(); - virtual double memory_usage() {return 0.0;} + virtual double memory_usage() { return 0.0; } virtual void pair_setup_callback(int, int) {} - virtual void pair_tally_callback(int, int, int, int, - double, double, double, - double, double, double) {} + virtual void pair_tally_callback(int, int, int, int, double, double, double, double, double, + double) + { + } protected: - int instance_me; // which Compute class instantiation I am + int instance_me; // which Compute class instantiation I am - double natoms_temp; // # of atoms used for temperature calculation - double extra_dof; // extra DOF for temperature computes - int fix_dof; // DOF due to fixes - int dynamic; // recount atoms for temperature computes - int dynamic_user; // user request for temp compute to be dynamic + double natoms_temp; // # of atoms used for temperature calculation + double extra_dof; // extra DOF for temperature computes + int fix_dof; // DOF due to fixes + int dynamic; // recount atoms for temperature computes + int dynamic_user; // user request for temp compute to be dynamic - double vbias[3]; // stored velocity bias for one atom - double **vbiasall; // stored velocity bias for all atoms - int maxbias; // size of vbiasall array + double vbias[3]; // stored velocity bias for one atom + double **vbiasall; // stored velocity bias for all atoms + int maxbias; // size of vbiasall array - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } // private methods void adjust_dof_fix(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/compute_adf.h b/src/compute_adf.h index f53c1f9fdf..64b78f4506 100644 --- a/src/compute_adf.h +++ b/src/compute_adf.h @@ -33,38 +33,38 @@ class ComputeADF : public Compute { void compute_array(); private: - int nbin; // # of adf bins - int ntriples; // # of adf triples - double deltax,deltaxinv; // bin width and inverse-width - int *ilo,*ihi,*jlo,*jhi,*klo,*khi; - double **hist; // histogram bins - double **histall; // summed histogram bins across all procs + int nbin; // # of adf bins + int ntriples; // # of adf triples + double deltax, deltaxinv; // bin width and inverse-width + int *ilo, *ihi, *jlo, *jhi, *klo, *khi; + double **hist; // histogram bins + double **histall; // summed histogram bins across all procs - double *rcutinnerj, *rcutinnerk; // list of inner cutoffs - double *rcutouterj, *rcutouterk; // list of outer cutoffs + double *rcutinnerj, *rcutinnerk; // list of inner cutoffs + double *rcutouterj, *rcutouterk; // list of outer cutoffs - class NeighList *list; // full neighbor list + class NeighList *list; // full neighbor list - int *iatomcount; // local number of central atoms - int *iatomcountall; // total number of central atoms - int **iatomflag; // 1 if type is central atom in ADF - int *maxjatom, *maxkatom; // allocated size jatom, katom neighlist - int *numjatom, *numkatom; // actual size of jatom, katom neighlist - int **neighjatom, **neighkatom;// list of short neighbor lists - int **jatomflag, **katomflag; // 1 if type is neighbor atom in ADF + int *iatomcount; // local number of central atoms + int *iatomcountall; // total number of central atoms + int **iatomflag; // 1 if type is central atom in ADF + int *maxjatom, *maxkatom; // allocated size jatom, katom neighlist + int *numjatom, *numkatom; // actual size of jatom, katom neighlist + int **neighjatom, **neighkatom; // list of short neighbor lists + int **jatomflag, **katomflag; // 1 if type is neighbor atom in ADF - int *maxjkatom; // allocated size short neighlist - int *numjkatom; // actual size of short neighlist - int **neighjkatom; // list of short neighbor lists - int **bothjkatom; // 1 if atom is in both jatom and katom lists - double ***delrjkatom; // list of 4-vectors: delx, dely, delx, and 1/r + int *maxjkatom; // allocated size short neighlist + int *numjkatom; // actual size of short neighlist + int **neighjkatom; // list of short neighbor lists + int **bothjkatom; // 1 if atom is in both jatom and katom lists + double ***delrjkatom; // list of 4-vectors: delx, dely, delx, and 1/r double rad2deg; // conversion factor from radians to degrees int ordinate_style; // DEGREE, RADIAN, or COSINE - int cutflag; // 1 if at least one outer cutoff specified + int cutflag; // 1 if at least one outer cutoff specified }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_aggregate_atom.h b/src/compute_aggregate_atom.h index 898946f8e8..151d8954ea 100644 --- a/src/compute_aggregate_atom.h +++ b/src/compute_aggregate_atom.h @@ -38,13 +38,13 @@ class ComputeAggregateAtom : public Compute { double memory_usage(); private: - int nmax,commflag; + int nmax, commflag; double cutsq; class NeighList *list; double *aggregateID; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_angle.h b/src/compute_angle.h index 7102f44047..9b0b4b1f67 100644 --- a/src/compute_angle.h +++ b/src/compute_angle.h @@ -37,7 +37,7 @@ class ComputeAngle : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_angle_local.h b/src/compute_angle_local.h index 80b6c8aa4d..1c74f6a8b0 100644 --- a/src/compute_angle_local.h +++ b/src/compute_angle_local.h @@ -33,10 +33,10 @@ class ComputeAngleLocal : public Compute { double memory_usage(); private: - int nvalues,nvar,ncount,setflag,tflag; + int nvalues, nvar, ncount, setflag, tflag; int tvar; - int *bstyle,*vvar; + int *bstyle, *vvar; char *tstr; char **vstr; @@ -48,7 +48,7 @@ class ComputeAngleLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_angmom_chunk.h b/src/compute_angmom_chunk.h index 6f931022f2..ca83589526 100644 --- a/src/compute_angmom_chunk.h +++ b/src/compute_angmom_chunk.h @@ -40,18 +40,18 @@ class ComputeAngmomChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **angmom,**angmomall; + double *massproc, *masstotal; + double **com, **comall; + double **angmom, **angmomall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_bond.h b/src/compute_bond.h index c00cba651e..c364bbf052 100644 --- a/src/compute_bond.h +++ b/src/compute_bond.h @@ -37,7 +37,7 @@ class ComputeBond : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_bond_local.h b/src/compute_bond_local.h index 0e7e6a15b0..ec20c4bf98 100644 --- a/src/compute_bond_local.h +++ b/src/compute_bond_local.h @@ -35,11 +35,11 @@ class ComputeBondLocal : public Compute { double memory_usage(); private: - int nvalues,nvar,ncount,setflag; + int nvalues, nvar, ncount, setflag; - int singleflag,velflag,ghostvelflag,initflag; + int singleflag, velflag, ghostvelflag, initflag; int dvar; - int *bstyle,*vvar; + int *bstyle, *vvar; char *dstr; char **vstr; @@ -51,7 +51,7 @@ class ComputeBondLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_centro_atom.h b/src/compute_centro_atom.h index bcbf3b26cd..c1bbc3f821 100644 --- a/src/compute_centro_atom.h +++ b/src/compute_centro_atom.h @@ -34,7 +34,7 @@ class ComputeCentroAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh,nnn; + int nmax, maxneigh, nnn; double *distsq; int *nearest; class NeighList *list; @@ -45,7 +45,7 @@ class ComputeCentroAtom : public Compute { void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_centroid_stress_atom.h b/src/compute_centroid_stress_atom.h index 18a3c2c303..d70c8d80f2 100644 --- a/src/compute_centroid_stress_atom.h +++ b/src/compute_centroid_stress_atom.h @@ -35,8 +35,8 @@ class ComputeCentroidStressAtom : public Compute { double memory_usage(); private: - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int kspaceflag,fixflag,biasflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int kspaceflag, fixflag, biasflag; Compute *temperature; char *id_temp; @@ -44,7 +44,7 @@ class ComputeCentroidStressAtom : public Compute { double **stress; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index e6d2a3d34a..2b91cfeca6 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -27,12 +27,12 @@ namespace LAMMPS_NS { class ComputeChunkAtom : public Compute { public: - int nchunk,ncoord,compress,idsflag,lockcount; + int nchunk, ncoord, compress, idsflag, lockcount; int computeflag; // 1 if this compute invokes other computes double chunk_volume_scalar; double *chunk_volume_vec; double **coord; - int *ichunk,*chunkID; + int *ichunk, *chunkID; ComputeChunkAtom(class LAMMPS *, int, char **); ~ComputeChunkAtom(); @@ -49,39 +49,39 @@ class ComputeChunkAtom : public Compute { void compute_ichunk(); private: - int which,binflag; - int regionflag,nchunksetflag,nchunkflag,discard; - int limit,limitstyle,limitfirst; - int scaleflag,pbcflag; - double xscale,yscale,zscale; + int which, binflag; + int regionflag, nchunksetflag, nchunkflag, discard; + int limit, limitstyle, limitfirst; + int scaleflag, pbcflag; + double xscale, yscale, zscale; int argindex; char *cfvid; // xyz spatial bins int ndim; - int dim[3],originflag[3],nlayers[3]; - int minflag[3],maxflag[3]; - double origin[3],delta[3]; - double offset[3],invdelta[3]; - double minvalue[3],maxvalue[3]; + int dim[3], originflag[3], nlayers[3]; + int minflag[3], maxflag[3]; + double origin[3], delta[3]; + double offset[3], invdelta[3]; + double minvalue[3], maxvalue[3]; // spherical spatial bins double sorigin_user[3]; double sorigin[3]; - double sradmin_user,sradmax_user; - double sradmin,sradmax,sinvrad; + double sradmin_user, sradmax_user; + double sradmin, sradmax, sinvrad; int nsbin; // cylindrical spatial bins double corigin_user[3]; double corigin[3]; - double cradmin_user,cradmax_user; - double cradmin,cradmax,cinvrad; - int cdim1,cdim2; - int ncbin,ncplane; + double cradmin_user, cradmax_user; + double cradmin, cradmax, cinvrad; + int cdim1, cdim2; + int ncbin, ncplane; char *idregion; class Region *region; @@ -95,18 +95,18 @@ class ComputeChunkAtom : public Compute { char *id_fix; class FixStore *fixstore; - class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // null pointer if no lock currently in place - bigint lockstart,lockstop; // timesteps for start and stop of locking + class Fix *lockfix; // ptr to FixAveChunk that is locking out setups + // null pointer if no lock currently in place + bigint lockstart, lockstop; // timesteps for start and stop of locking - bigint invoked_setup; // last timestep setup_chunks and nchunk calculated - bigint invoked_ichunk; // last timestep ichunk values calculated - int nmax,nmaxint; + bigint invoked_setup; // last timestep setup_chunks and nchunk calculated + bigint invoked_ichunk; // last timestep ichunk values calculated + int nmax, nmaxint; double *chunk; - int molcheck; // one-time check if all molecule atoms in chunk - int *exclude; // 1 if atom is not assigned to any chunk - std::map *hash; // store original chunks IDs before compression + int molcheck; // one-time check if all molecule atoms in chunk + int *exclude; // 1 if atom is not assigned to any chunk + std::map *hash; // store original chunks IDs before compression // callback function for ring communication @@ -127,7 +127,7 @@ class ComputeChunkAtom : public Compute { void readdim(int, char **, int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_chunk_spread_atom.h b/src/compute_chunk_spread_atom.h index 3c91a15da1..316becd8e5 100644 --- a/src/compute_chunk_spread_atom.h +++ b/src/compute_chunk_spread_atom.h @@ -33,10 +33,10 @@ class ComputeChunkSpreadAtom : public Compute { double memory_usage(); protected: - int mode,nvalues; + int mode, nvalues; char *idchunk; char **ids; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; int nmax; class ComputeChunkAtom *cchunk; @@ -44,7 +44,7 @@ class ComputeChunkSpreadAtom : public Compute { void init_chunk(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_cluster_atom.h b/src/compute_cluster_atom.h index 0125975e5a..4808b8aaf4 100644 --- a/src/compute_cluster_atom.h +++ b/src/compute_cluster_atom.h @@ -36,13 +36,13 @@ class ComputeClusterAtom : public Compute { double memory_usage(); private: - int nmax,commflag; + int nmax, commflag; double cutsq; class NeighList *list; double *clusterID; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_cna_atom.h b/src/compute_cna_atom.h index 77ba8cca47..f96c0efd12 100644 --- a/src/compute_cna_atom.h +++ b/src/compute_cna_atom.h @@ -42,7 +42,7 @@ class ComputeCNAAtom : public Compute { double *pattern; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_com.h b/src/compute_com.h index de828b133c..8a544a3d8a 100644 --- a/src/compute_com.h +++ b/src/compute_com.h @@ -35,7 +35,7 @@ class ComputeCOM : public Compute { double masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_com_chunk.h b/src/compute_com_chunk.h index 5de79b8aca..ee3f68c909 100644 --- a/src/compute_com_chunk.h +++ b/src/compute_com_chunk.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class ComputeCOMChunk : public Compute { public: - char *idchunk; // fields accessed by other classes + char *idchunk; // fields accessed by other classes double *masstotal; ComputeCOMChunk(class LAMMPS *, int, char **); @@ -44,17 +44,17 @@ class ComputeCOMChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; - int firstflag,massneed; + int nchunk, maxchunk; + int firstflag, massneed; class ComputeChunkAtom *cchunk; double *massproc; - double **com,**comall; + double **com, **comall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_contact_atom.h b/src/compute_contact_atom.h index 167b7dc479..7fc38d9794 100644 --- a/src/compute_contact_atom.h +++ b/src/compute_contact_atom.h @@ -41,7 +41,7 @@ class ComputeContactAtom : public Compute { double *contact; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_coord_atom.h b/src/compute_coord_atom.h index 0c30349694..4eb5e1ad6b 100644 --- a/src/compute_coord_atom.h +++ b/src/compute_coord_atom.h @@ -34,28 +34,28 @@ class ComputeCoordAtom : public Compute { int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); double memory_usage(); - enum {NONE,CUTOFF,ORIENT}; + enum { NONE, CUTOFF, ORIENT }; protected: - int nmax,ncol; + int nmax, ncol; double cutsq; class NeighList *list; - int *typelo,*typehi; + int *typelo, *typehi; double *cvec; double **carray; char *group2; - int jgroup,jgroupbit; + int jgroup, jgroupbit; class ComputeOrientOrderAtom *c_orientorder; char *id_orientorder; double threshold; double **normv; - int cstyle,nqlist,l; + int cstyle, nqlist, l; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_deprecated.h b/src/compute_deprecated.h index a6d968fe23..4a3e7bb033 100644 --- a/src/compute_deprecated.h +++ b/src/compute_deprecated.h @@ -32,7 +32,7 @@ class ComputeDeprecated : public Compute { void init() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_dihedral.h b/src/compute_dihedral.h index d400f3d989..9875cf6427 100644 --- a/src/compute_dihedral.h +++ b/src/compute_dihedral.h @@ -37,7 +37,7 @@ class ComputeDihedral : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_dihedral_local.h b/src/compute_dihedral_local.h index 73eb7be280..4d695fdbba 100644 --- a/src/compute_dihedral_local.h +++ b/src/compute_dihedral_local.h @@ -33,10 +33,10 @@ class ComputeDihedralLocal : public Compute { double memory_usage(); private: - int nvalues,nvar,ncount,setflag; + int nvalues, nvar, ncount, setflag; int pvar; - int *bstyle,*vvar; + int *bstyle, *vvar; char *pstr; char **vstr; @@ -48,7 +48,7 @@ class ComputeDihedralLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_dipole_chunk.h b/src/compute_dipole_chunk.h index 261e0dc2c5..3bdab111a4 100644 --- a/src/compute_dipole_chunk.h +++ b/src/compute_dipole_chunk.h @@ -40,20 +40,20 @@ class ComputeDipoleChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double *chrgproc,*chrgtotal; - double **com,**comall; - double **dipole,**dipoleall; + double *massproc, *masstotal; + double *chrgproc, *chrgtotal; + double **com, **comall; + double **dipole, **dipoleall; int usecenter; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_displace_atom.h b/src/compute_displace_atom.h index f635b153fd..b4d318c873 100644 --- a/src/compute_displace_atom.h +++ b/src/compute_displace_atom.h @@ -40,12 +40,12 @@ class ComputeDisplaceAtom : public Compute { char *id_fix; class FixStore *fix; - int refreshflag,ivar,nvmax; // refresh option is enabled - char *rvar; // for incremental dumps + int refreshflag, ivar, nvmax; // refresh option is enabled + char *rvar; // for incremental dumps double *varatom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_erotate_sphere.h b/src/compute_erotate_sphere.h index f6f31daf62..28110e26d8 100644 --- a/src/compute_erotate_sphere.h +++ b/src/compute_erotate_sphere.h @@ -35,7 +35,7 @@ class ComputeERotateSphere : public Compute { double pfactor; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_erotate_sphere_atom.h b/src/compute_erotate_sphere_atom.h index f9a2879832..6f6c798390 100644 --- a/src/compute_erotate_sphere_atom.h +++ b/src/compute_erotate_sphere_atom.h @@ -38,7 +38,7 @@ class ComputeErotateSphereAtom : public Compute { double *erot; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_fragment_atom.h b/src/compute_fragment_atom.h index f1a1751c79..e4d719f483 100644 --- a/src/compute_fragment_atom.h +++ b/src/compute_fragment_atom.h @@ -35,12 +35,12 @@ class ComputeFragmentAtom : public Compute { double memory_usage(); private: - int nmax,commflag,singleflag; - int *stack,*clist,*markflag; + int nmax, commflag, singleflag; + int *stack, *clist, *markflag; double *fragmentID; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_global_atom.h b/src/compute_global_atom.h index d6da23a693..73661ca178 100644 --- a/src/compute_global_atom.h +++ b/src/compute_global_atom.h @@ -33,20 +33,20 @@ class ComputeGlobalAtom : public Compute { double memory_usage(); protected: - int whichref,indexref,ref2index; + int whichref, indexref, ref2index; char *idref; int nvalues; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; char **ids; - int nmax,maxvector; + int nmax, maxvector; int *indices; double *varatom; double *vecglobal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_group_group.h b/src/compute_group_group.h index f54ff87eef..de2e08570b 100644 --- a/src/compute_group_group.h +++ b/src/compute_group_group.h @@ -35,10 +35,10 @@ class ComputeGroupGroup : public Compute { private: char *group2; - int jgroup,jgroupbit,othergroupbit; + int jgroup, jgroupbit, othergroupbit; double **cutsq; - double e_self,e_correction; - int pairflag,kspaceflag,boundaryflag,molflag; + double e_self, e_correction; + int pairflag, kspaceflag, boundaryflag, molflag; class Pair *pair; class NeighList *list; class KSpace *kspace; @@ -48,7 +48,7 @@ class ComputeGroupGroup : public Compute { void kspace_correction(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_gyration.h b/src/compute_gyration.h index 248d365755..a66e0dea5e 100644 --- a/src/compute_gyration.h +++ b/src/compute_gyration.h @@ -36,7 +36,7 @@ class ComputeGyration : public Compute { double masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_gyration_chunk.h b/src/compute_gyration_chunk.h index 7453642da1..b347f60a64 100644 --- a/src/compute_gyration_chunk.h +++ b/src/compute_gyration_chunk.h @@ -41,22 +41,22 @@ class ComputeGyrationChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; int tensor; - double *massproc,*masstotal; - double **com,**comall; - double *rg,*rgall; - double **rgt,**rgtall; + double *massproc, *masstotal; + double **com, **comall; + double *rg, *rgall; + double **rgt, **rgtall; void com_chunk(); void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_heat_flux.h b/src/compute_heat_flux.h index 9c3dbfcf4e..2972e7bf50 100644 --- a/src/compute_heat_flux.h +++ b/src/compute_heat_flux.h @@ -32,11 +32,11 @@ class ComputeHeatFlux : public Compute { void compute_vector(); private: - char *id_ke,*id_pe,*id_stress; - class Compute *c_ke,*c_pe,*c_stress; + char *id_ke, *id_pe, *id_stress; + class Compute *c_ke, *c_pe, *c_stress; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_hexorder_atom.h b/src/compute_hexorder_atom.h index 2fac2b993f..84f983a8f7 100644 --- a/src/compute_hexorder_atom.h +++ b/src/compute_hexorder_atom.h @@ -34,7 +34,7 @@ class ComputeHexOrderAtom : public Compute { double memory_usage(); private: - int nmax,maxneigh,ncol,nnn,ndegree; + int nmax, maxneigh, ncol, nnn, ndegree; double cutsq; class NeighList *list; double *distsq; @@ -42,12 +42,12 @@ class ComputeHexOrderAtom : public Compute { double **qnarray; - void calc_qn_complex(double, double, double&, double&); - void calc_qn_trig(double, double, double&, double&); + void calc_qn_complex(double, double, double &, double &); + void calc_qn_trig(double, double, double &, double &); void select2(int, int, double *, int *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_improper.h b/src/compute_improper.h index dae7ca5ff1..8bc57b92d4 100644 --- a/src/compute_improper.h +++ b/src/compute_improper.h @@ -37,7 +37,7 @@ class ComputeImproper : public Compute { double *emine; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_improper_local.h b/src/compute_improper_local.h index d5fdd2d378..791cd40d18 100644 --- a/src/compute_improper_local.h +++ b/src/compute_improper_local.h @@ -33,7 +33,7 @@ class ComputeImproperLocal : public Compute { double memory_usage(); private: - int nvalues,cflag; + int nvalues, cflag; int ncount; int nmax; @@ -44,7 +44,7 @@ class ComputeImproperLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_inertia_chunk.h b/src/compute_inertia_chunk.h index c0e0022141..279e9b1898 100644 --- a/src/compute_inertia_chunk.h +++ b/src/compute_inertia_chunk.h @@ -40,18 +40,18 @@ class ComputeInertiaChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **inertia,**inertiaall; + double *massproc, *masstotal; + double **com, **comall; + double **inertia, **inertiaall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_ke.h b/src/compute_ke.h index 8576883724..559954f5bd 100644 --- a/src/compute_ke.h +++ b/src/compute_ke.h @@ -34,7 +34,7 @@ class ComputeKE : public Compute { double pfactor; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_ke_atom.h b/src/compute_ke_atom.h index b5b8431e81..4ee65aecce 100644 --- a/src/compute_ke_atom.h +++ b/src/compute_ke_atom.h @@ -37,7 +37,7 @@ class ComputeKEAtom : public Compute { double *ke; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_msd.h b/src/compute_msd.h index 1bf3655c6a..2904d95ec9 100644 --- a/src/compute_msd.h +++ b/src/compute_msd.h @@ -33,16 +33,16 @@ class ComputeMSD : public Compute { void set_arrays(int); protected: - int comflag; // comflag = 1 if reference moves with center of mass - int avflag; // avflag = 1 if using average position as reference - int naverage; // number of samples for average position + int comflag; // comflag = 1 if reference moves with center of mass + int avflag; // avflag = 1 if using average position as reference + int naverage; // number of samples for average position bigint nmsd; double masstotal; char *id_fix; class FixStore *fix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_msd_chunk.h b/src/compute_msd_chunk.h index 9eeeb8f0b9..221c65d753 100644 --- a/src/compute_msd_chunk.h +++ b/src/compute_msd_chunk.h @@ -48,14 +48,14 @@ class ComputeMSDChunk : public Compute { class FixStore *fix; int firstflag; - double *massproc,*masstotal; - double **com,**comall; + double *massproc, *masstotal; + double **com, **comall; double **msd; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_omega_chunk.h b/src/compute_omega_chunk.h index 72adb732c6..580a0f52ad 100644 --- a/src/compute_omega_chunk.h +++ b/src/compute_omega_chunk.h @@ -40,20 +40,20 @@ class ComputeOmegaChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **inertia,**inertiaall; - double **angmom,**angmomall; + double *massproc, *masstotal; + double **com, **comall; + double **inertia, **inertiaall; + double **angmom, **angmomall; double **omega; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_orientorder_atom.h b/src/compute_orientorder_atom.h index e8d7c86f63..336eaddbce 100644 --- a/src/compute_orientorder_atom.h +++ b/src/compute_orientorder_atom.h @@ -38,7 +38,7 @@ class ComputeOrientOrderAtom : public Compute { int nqlist; protected: - int nmax,maxneigh,ncol,nnn; + int nmax, maxneigh, ncol, nnn; class NeighList *list; double *distsq; int *nearest; @@ -49,20 +49,19 @@ class ComputeOrientOrderAtom : public Compute { double **qnm_i; void select3(int, int, double *, int *, double **); - void calc_boop(double **rlist, int numNeighbors, - double qn[], int nlist[], int nnlist); + void calc_boop(double **rlist, int numNeighbors, double qn[], int nlist[], int nnlist); double dist(const double r[]); double polar_prefactor(int, int, double); double associated_legendre(int, int, double); virtual void init_clebsch_gordan(); - double *cglist; // Clebsch-Gordan coeffs + double *cglist; // Clebsch-Gordan coeffs int idxcg_max; int chunksize; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pair.h b/src/compute_pair.h index ea385eb99c..63ac5a582a 100644 --- a/src/compute_pair.h +++ b/src/compute_pair.h @@ -33,13 +33,13 @@ class ComputePair : public Compute { void compute_vector(); private: - int evalue,npair,nsub; + int evalue, npair, nsub; char *pstyle; class Pair *pair; double *one; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pair_local.h b/src/compute_pair_local.h index 66527b208a..9070fe728e 100644 --- a/src/compute_pair_local.h +++ b/src/compute_pair_local.h @@ -34,10 +34,10 @@ class ComputePairLocal : public Compute { double memory_usage(); private: - int nvalues,ncount,cutstyle; + int nvalues, ncount, cutstyle; - int *pstyle; // style of each requested output - int *pindex; // for pI, index of the output (0 to M-1) + int *pstyle; // style of each requested output + int *pindex; // for pI, index of the output (0 to M-1) int singleflag; int nmax; @@ -50,7 +50,7 @@ class ComputePairLocal : public Compute { void reallocate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pe.h b/src/compute_pe.h index 1a0ec088d9..8583efad74 100644 --- a/src/compute_pe.h +++ b/src/compute_pe.h @@ -32,10 +32,10 @@ class ComputePE : public Compute { double compute_scalar(); private: - int pairflag,bondflag,angleflag,dihedralflag,improperflag,kspaceflag,fixflag; + int pairflag, bondflag, angleflag, dihedralflag, improperflag, kspaceflag, fixflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pe_atom.h b/src/compute_pe_atom.h index 6f19d2d68a..718e1339fe 100644 --- a/src/compute_pe_atom.h +++ b/src/compute_pe_atom.h @@ -35,13 +35,13 @@ class ComputePEAtom : public Compute { double memory_usage(); private: - int pairflag,bondflag,angleflag,dihedralflag,improperflag; - int kspaceflag,fixflag; + int pairflag, bondflag, angleflag, dihedralflag, improperflag; + int kspaceflag, fixflag; int nmax; double *energy; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_pressure.h b/src/compute_pressure.h index 19e649d4ee..c4039729bb 100644 --- a/src/compute_pressure.h +++ b/src/compute_pressure.h @@ -34,17 +34,17 @@ class ComputePressure : public Compute { void reset_extra_compute_fix(const char *); protected: - double boltz,nktv2p,inv_volume; - int nvirial,dimension; + double boltz, nktv2p, inv_volume; + int nvirial, dimension; double **vptr; double *kspace_virial; Compute *temperature; char *id_temp; - double virial[6]; // ordering: xx,yy,zz,xy,xz,yz + double virial[6]; // ordering: xx,yy,zz,xy,xz,yz int pairhybridflag; class Pair *pairhybrid; - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int fixflag,kspaceflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int fixflag, kspaceflag; void virial_compute(int, int); @@ -53,7 +53,7 @@ class ComputePressure : public Compute { int nsub; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h index fd29be8b1b..0981921a92 100644 --- a/src/compute_property_atom.h +++ b/src/compute_property_atom.h @@ -43,7 +43,7 @@ class ComputePropertyAtom : public Compute { class AtomVecBody *avec_body; typedef void (ComputePropertyAtom::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_id(int); void pack_molecule(int); @@ -135,7 +135,7 @@ class ComputePropertyAtom : public Compute { void pack_property_atom(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_property_chunk.h b/src/compute_property_chunk.h index eef78e1e77..36bac44df0 100644 --- a/src/compute_property_chunk.h +++ b/src/compute_property_chunk.h @@ -41,19 +41,19 @@ class ComputePropertyChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; int *ichunk; - int nvalues,countflag; + int nvalues, countflag; double *buf; - int *count_one,*count_all; + int *count_one, *count_all; void allocate(); typedef void (ComputePropertyChunk::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_count(int); void pack_id(int); @@ -62,7 +62,7 @@ class ComputePropertyChunk : public Compute { void pack_coord3(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_property_local.h b/src/compute_property_local.h index aeeb4e47af..5dbdea3eca 100644 --- a/src/compute_property_local.h +++ b/src/compute_property_local.h @@ -34,7 +34,7 @@ class ComputePropertyLocal : public Compute { double memory_usage(); private: - int nvalues,kindflag,cutstyle; + int nvalues, kindflag, cutstyle; int nmax; double *vlocal; @@ -54,7 +54,7 @@ class ComputePropertyLocal : public Compute { void reallocate(int); typedef void (ComputePropertyLocal::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_patom1(int); void pack_patom2(int); @@ -83,7 +83,7 @@ class ComputePropertyLocal : public Compute { void pack_itype(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_rdf.h b/src/compute_rdf.h index 59300e501f..77a8a23c92 100644 --- a/src/compute_rdf.h +++ b/src/compute_rdf.h @@ -33,28 +33,28 @@ class ComputeRDF : public Compute { void compute_array(); private: - int nbin; // # of rdf bins - int cutflag; // user cutoff flag - int npairs; // # of rdf pairs - double delr,delrinv; // bin width and its inverse - double cutoff_user; // user-specified cutoff - double mycutneigh; // user-specified cutoff + neighbor skin - int ***rdfpair; // map 2 type pair to rdf pair for each histo - int **nrdfpair; // # of histograms for each type pair - int *ilo,*ihi,*jlo,*jhi; - double **hist; // histogram bins - double **histall; // summed histogram bins across all procs + int nbin; // # of rdf bins + int cutflag; // user cutoff flag + int npairs; // # of rdf pairs + double delr, delrinv; // bin width and its inverse + double cutoff_user; // user-specified cutoff + double mycutneigh; // user-specified cutoff + neighbor skin + int ***rdfpair; // map 2 type pair to rdf pair for each histo + int **nrdfpair; // # of histograms for each type pair + int *ilo, *ihi, *jlo, *jhi; + double **hist; // histogram bins + double **histall; // summed histogram bins across all procs int *typecount; - int *icount,*jcount; + int *icount, *jcount; int *duplicates; - class NeighList *list; // half neighbor list + class NeighList *list; // half neighbor list void init_norm(); bigint natoms_old; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_reduce.h b/src/compute_reduce.h index b5d8b10126..ec1ad85bfb 100644 --- a/src/compute_reduce.h +++ b/src/compute_reduce.h @@ -20,14 +20,14 @@ ComputeStyle(reduce,ComputeReduce); #ifndef LMP_COMPUTE_REDUCE_H #define LMP_COMPUTE_REDUCE_H -#include "compute.h" // IWYU pragma: export +#include "compute.h" // IWYU pragma: export namespace LAMMPS_NS { class ComputeReduce : public Compute { public: - enum {SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; - enum {PERATOM,LOCAL}; + enum { SUM, SUMSQ, MINN, MAXX, AVE, AVESQ }; + enum { PERATOM, LOCAL }; ComputeReduce(class LAMMPS *, int, char **); virtual ~ComputeReduce(); @@ -38,11 +38,11 @@ class ComputeReduce : public Compute { protected: int me; - int mode,nvalues,iregion; - int *which,*argindex,*flavor,*value2index; + int mode, nvalues, iregion; + int *which, *argindex, *flavor, *value2index; char **ids; double *onevec; - int *replace,*indices,*owner; + int *replace, *indices, *owner; int index; char *idregion; @@ -53,14 +53,14 @@ class ComputeReduce : public Compute { double value; int proc; }; - Pair pairme,pairall; + Pair pairme, pairall; virtual double compute_one(int, int); virtual bigint count(int); void combine(double &, double, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_reduce_chunk.h b/src/compute_reduce_chunk.h index d070f7063d..9b78068e14 100644 --- a/src/compute_reduce_chunk.h +++ b/src/compute_reduce_chunk.h @@ -41,16 +41,16 @@ class ComputeReduceChunk : public Compute { double memory_usage(); private: - int mode,nvalues; - int *which,*argindex,*value2index; + int mode, nvalues; + int *which, *argindex, *value2index; char *idchunk; char **ids; int nchunk; - int maxchunk,maxatom; + int maxchunk, maxatom; double initvalue; - double *vlocal,*vglobal; - double **alocal,**aglobal; + double *vlocal, *vglobal; + double **alocal, **aglobal; double *varatom; class ComputeChunkAtom *cchunk; @@ -61,7 +61,7 @@ class ComputeReduceChunk : public Compute { void combine(double &, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_reduce_region.h b/src/compute_reduce_region.h index 5475c9a109..2f984684ec 100644 --- a/src/compute_reduce_region.h +++ b/src/compute_reduce_region.h @@ -34,7 +34,7 @@ class ComputeReduceRegion : public ComputeReduce { bigint count(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_slice.h b/src/compute_slice.h index dc7404dba4..1fcf2f7683 100644 --- a/src/compute_slice.h +++ b/src/compute_slice.h @@ -34,14 +34,14 @@ class ComputeSlice : public Compute { private: int me; - int nstart,nstop,nskip,nvalues; - int *which,*argindex,*value2index; + int nstart, nstop, nskip, nvalues; + int *which, *argindex, *value2index; char **ids; void extract_one(int, double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_stress_atom.h b/src/compute_stress_atom.h index a2d5fc5da9..09e8e8f972 100644 --- a/src/compute_stress_atom.h +++ b/src/compute_stress_atom.h @@ -35,8 +35,8 @@ class ComputeStressAtom : public Compute { double memory_usage(); private: - int keflag,pairflag,bondflag,angleflag,dihedralflag,improperflag; - int kspaceflag,fixflag,biasflag; + int keflag, pairflag, bondflag, angleflag, dihedralflag, improperflag; + int kspaceflag, fixflag, biasflag; Compute *temperature; char *id_temp; @@ -44,7 +44,7 @@ class ComputeStressAtom : public Compute { double **stress; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp.h b/src/compute_temp.h index 3facc7fa1e..31b924d6c2 100644 --- a/src/compute_temp.h +++ b/src/compute_temp.h @@ -39,7 +39,7 @@ class ComputeTemp : public Compute { virtual void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_chunk.h b/src/compute_temp_chunk.h index 0ecde0394e..1a0a107fba 100644 --- a/src/compute_temp_chunk.h +++ b/src/compute_temp_chunk.h @@ -47,20 +47,20 @@ class ComputeTempChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk,comflag,biasflag; + int nchunk, maxchunk, comflag, biasflag; int nvalues; int *which; char *idchunk; class ComputeChunkAtom *cchunk; - double adof,cdof; + double adof, cdof; char *id_bias; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute bigint comstep; - double *sum,*sumall; - int *count,*countall; - double *massproc,*masstotal; - double **vcm,**vcmall; + double *sum, *sumall; + int *count, *countall; + double *massproc, *masstotal; + double **vcm, **vcmall; void vcm_compute(); void temperature(int); @@ -69,7 +69,7 @@ class ComputeTempChunk : public Compute { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_com.h b/src/compute_temp_com.h index 7b12666a2b..7e6e9dfa13 100644 --- a/src/compute_temp_com.h +++ b/src/compute_temp_com.h @@ -41,13 +41,12 @@ class ComputeTempCOM : public Compute { void restore_bias_thr(int, double *, double *); private: - double tfactor,masstotal; + double tfactor, masstotal; void dof_compute(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_deform.h b/src/compute_temp_deform.h index 8faaad250e..5549f11bf2 100644 --- a/src/compute_temp_deform.h +++ b/src/compute_temp_deform.h @@ -47,7 +47,7 @@ class ComputeTempDeform : public Compute { virtual void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_partial.h b/src/compute_temp_partial.h index db5b6d33d8..201a3b8d5b 100644 --- a/src/compute_temp_partial.h +++ b/src/compute_temp_partial.h @@ -44,13 +44,13 @@ class ComputeTempPartial : public Compute { double memory_usage(); protected: - int xflag,yflag,zflag; + int xflag, yflag, zflag; double tfactor; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_profile.h b/src/compute_temp_profile.h index 4e4b818da2..f2b0398ba5 100644 --- a/src/compute_temp_profile.h +++ b/src/compute_temp_profile.h @@ -43,20 +43,20 @@ class ComputeTempProfile : public Compute { double memory_usage(); private: - int xflag,yflag,zflag,ncount,outflag; - int nbinx,nbiny,nbinz,nbins; - int ivx,ivy,ivz; + int xflag, yflag, zflag, ncount, outflag; + int nbinx, nbiny, nbinz, nbins; + int ivx, ivy, ivz; double tfactor; - int box_change,triclinic; + int box_change, triclinic; int *periodicity; - double *boxlo,*boxhi,*prd; + double *boxlo, *boxhi, *prd; double invdelta[3]; int maxatom; int *bin; - double **vbin,**binave; - double *tbin,*tbinall; + double **vbin, **binave; + double *tbin, *tbinall; void dof_compute(); void bin_average(); @@ -64,7 +64,7 @@ class ComputeTempProfile : public Compute { void bin_assign(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_ramp.h b/src/compute_temp_ramp.h index bcef4473c1..1cf194d05e 100644 --- a/src/compute_temp_ramp.h +++ b/src/compute_temp_ramp.h @@ -43,16 +43,16 @@ class ComputeTempRamp : public Compute { private: int coord_dim; - double coord_lo,coord_hi; + double coord_lo, coord_hi; int v_dim; - double v_lo,v_hi; + double v_lo, v_hi; int scaleflag; - double tfactor,xscale,yscale,zscale; + double tfactor, xscale, yscale, zscale; void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_region.h b/src/compute_temp_region.h index fcff629715..d1cef3abb7 100644 --- a/src/compute_temp_region.h +++ b/src/compute_temp_region.h @@ -49,7 +49,7 @@ class ComputeTempRegion : public Compute { char *idregion; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_temp_sphere.h b/src/compute_temp_sphere.h index 5aaf551c81..81f3c8f625 100644 --- a/src/compute_temp_sphere.h +++ b/src/compute_temp_sphere.h @@ -42,12 +42,12 @@ class ComputeTempSphere : public Compute { int mode; double tfactor; char *id_bias; - Compute *tbias; // ptr to additional bias compute + Compute *tbias; // ptr to additional bias compute void dof_compute(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_torque_chunk.h b/src/compute_torque_chunk.h index 39d85cc8c0..fbae1e990d 100644 --- a/src/compute_torque_chunk.h +++ b/src/compute_torque_chunk.h @@ -40,18 +40,18 @@ class ComputeTorqueChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **com,**comall; - double **torque,**torqueall; + double *massproc, *masstotal; + double **com, **comall; + double **torque, **torqueall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_vacf.h b/src/compute_vacf.h index c79d508ee6..1956af1190 100644 --- a/src/compute_vacf.h +++ b/src/compute_vacf.h @@ -38,7 +38,7 @@ class ComputeVACF : public Compute { class FixStore *fix; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/compute_vcm_chunk.h b/src/compute_vcm_chunk.h index 7acb1d3dd1..f58426f330 100644 --- a/src/compute_vcm_chunk.h +++ b/src/compute_vcm_chunk.h @@ -41,18 +41,18 @@ class ComputeVCMChunk : public Compute { double memory_usage(); private: - int nchunk,maxchunk; - int firstflag,massneed; + int nchunk, maxchunk; + int firstflag, massneed; char *idchunk; class ComputeChunkAtom *cchunk; - double *massproc,*masstotal; - double **vcm,**vcmall; + double *massproc, *masstotal; + double **vcm, **vcmall; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/create_atoms.h b/src/create_atoms.h index a5de8d29fa..a3cf95b08e 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -30,25 +30,25 @@ class CreateAtoms : public Command { void command(int, char **); private: - int me,nprocs; - int ntype,style,mode,nregion,nbasis,nrandom,seed; + int me, nprocs; + int ntype, style, mode, nregion, nbasis, nrandom, seed; int remapflag; int subsetflag; bigint nsubset; double subsetfrac; int *basistype; - double xone[3],quatone[4]; + double xone[3], quatone[4]; - int varflag,vvar,xvar,yvar,zvar; - char *vstr,*xstr,*ystr,*zstr; - char *xstr_copy,*ystr_copy,*zstr_copy; + int varflag, vvar, xvar, yvar, zvar; + char *vstr, *xstr, *ystr, *zstr; + char *xstr_copy, *ystr_copy, *zstr_copy; - int ilo,ihi,jlo,jhi,klo,khi; + int ilo, ihi, jlo, jhi, klo, khi; - int nlatt; // number of owned lattice sites - int nlatt_overflow; // 1 if local nlatt exceeds a 32-bit int + int nlatt; // number of owned lattice sites + int nlatt_overflow; // 1 if local nlatt exceeds a 32-bit int - int *flag; // flag subset of particles to insert on lattice + int *flag; // flag subset of particles to insert on lattice int *next; class Molecule *onemol; @@ -56,17 +56,17 @@ class CreateAtoms : public Command { class RanMars *ranlatt; int triclinic; - double sublo[3],subhi[3]; // epsilon-extended proc sub-box for adding atoms + double sublo[3], subhi[3]; // epsilon-extended proc sub-box for adding atoms void add_single(); void add_random(); void add_lattice(); void loop_lattice(int); void add_molecule(double *, double * = nullptr); - int vartest(double *); // evaluate a variable with new atom position + int vartest(double *); // evaluate a variable with new atom position }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/create_bonds.h b/src/create_bonds.h index 9b4bee920a..1e0d3f3a40 100644 --- a/src/create_bonds.h +++ b/src/create_bonds.h @@ -30,10 +30,10 @@ class CreateBonds : public Command { void command(int, char **); private: - int igroup,group1bit,group2bit; - int btype,atype,dtype; - tagint batom1,batom2,aatom1,aatom2,aatom3,datom1,datom2,datom3,datom4; - double rmin,rmax; + int igroup, group1bit, group2bit; + int btype, atype, dtype; + tagint batom1, batom2, aatom1, aatom2, aatom3, datom1, datom2, datom3, datom4; + double rmin, rmax; void many(); void single_bond(); @@ -42,7 +42,7 @@ class CreateBonds : public Command { void single_improper(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/create_box.h b/src/create_box.h index 524922b90a..4738c82a02 100644 --- a/src/create_box.h +++ b/src/create_box.h @@ -30,7 +30,7 @@ class CreateBox : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/delete_atoms.h b/src/delete_atoms.h index b3e6e8be52..5be7bdeeca 100644 --- a/src/delete_atoms.h +++ b/src/delete_atoms.h @@ -32,8 +32,8 @@ class DeleteAtoms : public Command { private: int *dlist; - int allflag,compress_flag,bond_flag,mol_flag; - std::map *hash; + int allflag, compress_flag, bond_flag, mol_flag; + std::map *hash; void delete_group(int, char **); void delete_region(int, char **); @@ -45,9 +45,7 @@ class DeleteAtoms : public Command { void recount_topology(); void options(int, char **); - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } // callback functions for ring communication @@ -55,7 +53,7 @@ class DeleteAtoms : public Command { static void molring(int, char *, void *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/delete_bonds.h b/src/delete_bonds.h index 06453fa0ec..991a962343 100644 --- a/src/delete_bonds.h +++ b/src/delete_bonds.h @@ -30,7 +30,7 @@ class DeleteBonds : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/deprecated.h b/src/deprecated.h index f03f5630c4..a96f3cba1a 100644 --- a/src/deprecated.h +++ b/src/deprecated.h @@ -32,11 +32,11 @@ namespace LAMMPS_NS { class Deprecated : public Command { public: - Deprecated(class LAMMPS *lmp) : Command(lmp) {}; + Deprecated(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dihedral.h b/src/dihedral.h index 718b7675ee..1df30902aa 100644 --- a/src/dihedral.h +++ b/src/dihedral.h @@ -14,31 +14,32 @@ #ifndef LMP_DIHEDRAL_H #define LMP_DIHEDRAL_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Dihedral : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - int writedata; // 1 if writes coeffs to data file - double energy; // accumulated energy - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double **cvatom; // accumulated per-atom centroid virial + int writedata; // 1 if writes coeffs to data file + double energy; // accumulated energy + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double **cvatom; // accumulated per-atom centroid virial - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Dihedral(class LAMMPS *); @@ -50,32 +51,34 @@ class Dihedral : protected Pointers { virtual void coeff(int, char **) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double memory_usage(); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; - int maxeatom,maxvatom,maxcvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; + int maxeatom, maxvatom, maxcvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom - = vflag_either = vflag_global = vflag_atom = cvflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + cvflag_atom = 0; } void ev_setup(int, int, int alloc = 1); - void ev_tally(int, int, int, int, int, int, double, - double *, double *, double *, double, double, double, - double, double, double, double, double, double); + void ev_tally(int, int, int, int, int, int, double, double *, double *, double *, double, double, + double, double, double, double, double, double, double); void problem(const char *, int, int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/dihedral_deprecated.h b/src/dihedral_deprecated.h index 574541bc7c..0f09b83f18 100644 --- a/src/dihedral_deprecated.h +++ b/src/dihedral_deprecated.h @@ -36,7 +36,7 @@ class DihedralDeprecated : public Dihedral { virtual void read_restart(FILE *) {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dihedral_hybrid.h b/src/dihedral_hybrid.h index 7fb31e52e3..85bbb1bbfd 100644 --- a/src/dihedral_hybrid.h +++ b/src/dihedral_hybrid.h @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class DihedralHybrid : public Dihedral { public: - int nstyles; // # of different dihedral styles - Dihedral **styles; // class list for each Dihedral style - char **keywords; // keyword for each dihedral style + int nstyles; // # of different dihedral styles + Dihedral **styles; // class list for each Dihedral style + char **keywords; // keyword for each dihedral style DihedralHybrid(class LAMMPS *); ~DihedralHybrid(); @@ -41,16 +41,16 @@ class DihedralHybrid : public Dihedral { double memory_usage(); private: - int *map; // which style each dihedral type points to + int *map; // which style each dihedral type points to - int *ndihedrallist; // # of dihedrals in sub-style dihedrallists - int *maxdihedral; // max # of dihedrals sub-style lists can store - int ***dihedrallist; // dihedrallist for each sub-style + int *ndihedrallist; // # of dihedrals in sub-style dihedrallists + int *maxdihedral; // max # of dihedrals sub-style lists can store + int ***dihedrallist; // dihedrallist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dihedral_zero.h b/src/dihedral_zero.h index cc896167ae..36a4bc1d52 100644 --- a/src/dihedral_zero.h +++ b/src/dihedral_zero.h @@ -46,7 +46,7 @@ class DihedralZero : public Dihedral { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/displace_atoms.h b/src/displace_atoms.h index 8e42ecaecb..fec9f49714 100644 --- a/src/displace_atoms.h +++ b/src/displace_atoms.h @@ -31,7 +31,7 @@ class DisplaceAtoms : public Command { void command(int, char **); private: - int igroup,groupbit; + int igroup, groupbit; int scaleflag; double *mvec; @@ -39,7 +39,7 @@ class DisplaceAtoms : public Command { void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/domain.h b/src/domain.h index 89b326f83b..455418ad9d 100644 --- a/src/domain.h +++ b/src/domain.h @@ -20,91 +20,91 @@ #include namespace LAMMPS_NS { - class Region; +class Region; class Domain : protected Pointers { public: - int box_exist; // 0 = not yet created, 1 = exists - int dimension; // 2 = 2d, 3 = 3d - int nonperiodic; // 0 = periodic in all 3 dims - // 1 = periodic or fixed in all 6 - // 2 = shrink-wrap in any of 6 - int xperiodic,yperiodic,zperiodic; // 0 = non-periodic, 1 = periodic - int periodicity[3]; // xyz periodicity as array + int box_exist; // 0 = not yet created, 1 = exists + int dimension; // 2 = 2d, 3 = 3d + int nonperiodic; // 0 = periodic in all 3 dims + // 1 = periodic or fixed in all 6 + // 2 = shrink-wrap in any of 6 + int xperiodic, yperiodic, zperiodic; // 0 = non-periodic, 1 = periodic + int periodicity[3]; // xyz periodicity as array - int boundary[3][2]; // settings for 6 boundaries - // 0 = periodic - // 1 = fixed non-periodic - // 2 = shrink-wrap non-periodic - // 3 = shrink-wrap non-per w/ min + int boundary[3][2]; // settings for 6 boundaries + // 0 = periodic + // 1 = fixed non-periodic + // 2 = shrink-wrap non-periodic + // 3 = shrink-wrap non-per w/ min - int triclinic; // 0 = orthog box, 1 = triclinic - int tiltsmall; // 1 if limit tilt, else 0 + int triclinic; // 0 = orthog box, 1 = triclinic + int tiltsmall; // 1 if limit tilt, else 0 - // orthogonal box - double xprd,yprd,zprd; // global box dimensions - double xprd_half,yprd_half,zprd_half; // half dimensions - double prd[3]; // array form of dimensions - double prd_half[3]; // array form of half dimensions + // orthogonal box + double xprd, yprd, zprd; // global box dimensions + double xprd_half, yprd_half, zprd_half; // half dimensions + double prd[3]; // array form of dimensions + double prd_half[3]; // array form of half dimensions - // triclinic box - // xprd,xprd_half,prd,prd_half = - // same as if untilted - double prd_lamda[3]; // lamda box = (1,1,1) - double prd_half_lamda[3]; // lamda half box = (0.5,0.5,0.5) + // triclinic box + // xprd,xprd_half,prd,prd_half = + // same as if untilted + double prd_lamda[3]; // lamda box = (1,1,1) + double prd_half_lamda[3]; // lamda half box = (0.5,0.5,0.5) - double boxlo[3],boxhi[3]; // orthogonal box global bounds + double boxlo[3], boxhi[3]; // orthogonal box global bounds - // triclinic box - // boxlo/hi = same as if untilted - double boxlo_lamda[3],boxhi_lamda[3]; // lamda box = (0,1) - double boxlo_bound[3],boxhi_bound[3]; // bounding box of tilted domain - double corners[8][3]; // 8 corner points + // triclinic box + // boxlo/hi = same as if untilted + double boxlo_lamda[3], boxhi_lamda[3]; // lamda box = (0,1) + double boxlo_bound[3], boxhi_bound[3]; // bounding box of tilted domain + double corners[8][3]; // 8 corner points - // orthogonal box & triclinic box - double minxlo,minxhi; // minimum size of global box - double minylo,minyhi; // when shrink-wrapping - double minzlo,minzhi; // tri only possible for non-skew dims + // orthogonal box & triclinic box + double minxlo, minxhi; // minimum size of global box + double minylo, minyhi; // when shrink-wrapping + double minzlo, minzhi; // tri only possible for non-skew dims - // orthogonal box - double sublo[3],subhi[3]; // sub-box bounds on this proc + // orthogonal box + double sublo[3], subhi[3]; // sub-box bounds on this proc - // triclinic box - // sublo/hi = undefined - double sublo_lamda[3],subhi_lamda[3]; // bounds of subbox in lamda + // triclinic box + // sublo/hi = undefined + double sublo_lamda[3], subhi_lamda[3]; // bounds of subbox in lamda - // triclinic box - double xy,xz,yz; // 3 tilt factors - double h[6],h_inv[6]; // shape matrix in Voigt ordering - // Voigt = xx,yy,zz,yz,xz,xy - double h_rate[6],h_ratelo[3]; // rate of box size/shape change + // triclinic box + double xy, xz, yz; // 3 tilt factors + double h[6], h_inv[6]; // shape matrix in Voigt ordering + // Voigt = xx,yy,zz,yz,xz,xy + double h_rate[6], h_ratelo[3]; // rate of box size/shape change - int box_change; // 1 if any of next 3 flags are set, else 0 - int box_change_size; // 1 if box size changes, 0 if not - int box_change_shape; // 1 if box shape changes, 0 if not - int box_change_domain; // 1 if proc sub-domains change, 0 if not + int box_change; // 1 if any of next 3 flags are set, else 0 + int box_change_size; // 1 if box size changes, 0 if not + int box_change_shape; // 1 if box shape changes, 0 if not + int box_change_domain; // 1 if proc sub-domains change, 0 if not - int deform_flag; // 1 if fix deform exist, else 0 - int deform_vremap; // 1 if fix deform remaps v, else 0 - int deform_groupbit; // atom group to perform v remap for + int deform_flag; // 1 if fix deform exist, else 0 + int deform_vremap; // 1 if fix deform remaps v, else 0 + int deform_groupbit; // atom group to perform v remap for - class Lattice *lattice; // user-defined lattice + class Lattice *lattice; // user-defined lattice - int nregion; // # of defined Regions - int maxregion; // max # list can hold - Region **regions; // list of defined Regions + int nregion; // # of defined Regions + int maxregion; // max # list can hold + Region **regions; // list of defined Regions int copymode; - enum{NO_REMAP,X_REMAP,V_REMAP}; + enum { NO_REMAP, X_REMAP, V_REMAP }; - typedef Region *(*RegionCreator)(LAMMPS *,int,char**); - typedef std::map RegionCreatorMap; + typedef Region *(*RegionCreator)(LAMMPS *, int, char **); + typedef std::map RegionCreatorMap; RegionCreatorMap *region_map; Domain(class LAMMPS *); virtual ~Domain(); virtual void init(); - void set_initial_box(int expandflag=1); + void set_initial_box(int expandflag = 1); virtual void set_global_box(); virtual void set_lamda_box(); virtual void set_local_box(); @@ -117,8 +117,8 @@ class Domain : protected Pointers { void minimum_image(double *); void minimum_image_once(double *); int closest_image(int, int); - int closest_image(const double * const, int); - void closest_image(const double * const, const double * const, double * const); + int closest_image(const double *const, int); + void closest_image(const double *const, const double *const, double *const); void remap(double *, imageint &); void remap(double *); void remap_near(double *, double *); @@ -156,7 +156,8 @@ class Domain : protected Pointers { // but is a far-away image that should be treated as an unbonded neighbor // inline since called from neighbor build inner loop - inline int minimum_image_check(double dx, double dy, double dz) { + inline int minimum_image_check(double dx, double dy, double dz) + { if (xperiodic && fabs(dx) > xprd_half) return 1; if (yperiodic && fabs(dy) > yprd_half) return 1; if (zperiodic && fabs(dz) > zprd_half) return 1; @@ -164,13 +165,13 @@ class Domain : protected Pointers { } protected: - double small[3]; // fractions of box lengths + double small[3]; // fractions of box lengths private: - template static Region *region_creator(LAMMPS *,int,char**); + template static Region *region_creator(LAMMPS *, int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/dump.h b/src/dump.h index 351365fa0e..7c4fb218bf 100644 --- a/src/dump.h +++ b/src/dump.h @@ -14,26 +14,26 @@ #ifndef LMP_DUMP_H #define LMP_DUMP_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Dump : protected Pointers { public: - char *id; // user-defined name of Dump - char *style; // style of Dump - char *filename; // user-specified file - int igroup,groupbit; // group that Dump is performed on + char *id; // user-defined name of Dump + char *style; // style of Dump + char *filename; // user-specified file + int igroup, groupbit; // group that Dump is performed on - int first_flag; // 0 if no initial dump, 1 if yes initial dump - int clearstep; // 1 if dump invokes computes, 0 if not + int first_flag; // 0 if no initial dump, 1 if yes initial dump + int clearstep; // 1 if dump invokes computes, 0 if not - int comm_forward; // size of forward communication (0 if none) - int comm_reverse; // size of reverse communication (0 if none) + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) #if defined(LMP_QSORT) // static variable across all Dump objects - static Dump *dumpptr; // holds a ptr to Dump currently being used + static Dump *dumpptr; // holds a ptr to Dump currently being used #endif Dump(class LAMMPS *, int, char **); @@ -41,97 +41,97 @@ class Dump : protected Pointers { void init(); virtual void write(); - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + virtual int pack_forward_comm(int, int *, double *, int, int *) { return 0; } virtual void unpack_forward_comm(int, int, double *) {} - virtual int pack_reverse_comm(int, int, double *) {return 0;} + virtual int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} void modify_params(int, char **); virtual double memory_usage(); protected: - int me,nprocs; // proc info + int me, nprocs; // proc info - int compressed; // 1 if dump file is written compressed, 0 no - int binary; // 1 if dump file is written binary, 0 no - int multifile; // 0 = one big file, 1 = one file per timestep - int multiproc; // 0 = proc 0 writes for all, - // else # of procs writing files - int nclusterprocs; // # of procs in my cluster that write to one file - int filewriter; // 1 if this proc writes a file, else 0 - int fileproc; // ID of proc in my cluster who writes to file - char *multiname; // filename with % converted to cluster ID - MPI_Comm clustercomm; // MPI communicator within my cluster of procs + int compressed; // 1 if dump file is written compressed, 0 no + int binary; // 1 if dump file is written binary, 0 no + int multifile; // 0 = one big file, 1 = one file per timestep + int multiproc; // 0 = proc 0 writes for all, + // else # of procs writing files + int nclusterprocs; // # of procs in my cluster that write to one file + int filewriter; // 1 if this proc writes a file, else 0 + int fileproc; // ID of proc in my cluster who writes to file + char *multiname; // filename with % converted to cluster ID + MPI_Comm clustercomm; // MPI communicator within my cluster of procs - int header_flag; // 0 = item, 2 = xyz - int flush_flag; // 0 if no flush, 1 if flush every dump - int sort_flag; // 1 if sorted output - int append_flag; // 1 if open file in append mode, 0 if not - int buffer_allow; // 1 if style allows for buffer_flag, 0 if not - int buffer_flag; // 1 if buffer output as one big string, 0 if not - int padflag; // timestep padding in filename - int pbcflag; // 1 if remap dumped atoms via PBC, 0 if not - int singlefile_opened; // 1 = one big file, already opened, else 0 - int sortcol; // 0 to sort on ID, 1-N on columns - int sortcolm1; // sortcol - 1 - int sortorder; // ASCEND or DESCEND - int time_flag; // 1 if output accumulated time - int unit_flag; // 1 if dump should contain unit information - int unit_count; // # of times the unit information was written - int delay_flag; // 1 if delay output until delaystep + int header_flag; // 0 = item, 2 = xyz + int flush_flag; // 0 if no flush, 1 if flush every dump + int sort_flag; // 1 if sorted output + int append_flag; // 1 if open file in append mode, 0 if not + int buffer_allow; // 1 if style allows for buffer_flag, 0 if not + int buffer_flag; // 1 if buffer output as one big string, 0 if not + int padflag; // timestep padding in filename + int pbcflag; // 1 if remap dumped atoms via PBC, 0 if not + int singlefile_opened; // 1 = one big file, already opened, else 0 + int sortcol; // 0 to sort on ID, 1-N on columns + int sortcolm1; // sortcol - 1 + int sortorder; // ASCEND or DESCEND + int time_flag; // 1 if output accumulated time + int unit_flag; // 1 if dump should contain unit information + int unit_count; // # of times the unit information was written + int delay_flag; // 1 if delay output until delaystep bigint delaystep; - int refreshflag; // 1 if dump_modify refresh specified - char *refresh; // compute ID to invoke refresh() on - int irefresh; // index of compute + int refreshflag; // 1 if dump_modify refresh specified + char *refresh; // compute ID to invoke refresh() on + int irefresh; // index of compute - char boundstr[9]; // encoding of boundary flags + char boundstr[9]; // encoding of boundary flags - char *format; // format string for the file write - char *format_default; // default format string + char *format; // format string for the file write + char *format_default; // default format string char *format_line_user; // user-specified format strings char *format_float_user; char *format_int_user; char *format_bigint_user; char **format_column_user; - enum{INT,DOUBLE,STRING,BIGINT}; + enum { INT, DOUBLE, STRING, BIGINT }; - FILE *fp; // file to write dump to - int size_one; // # of quantities for one atom - int nme; // # of atoms in this dump from me - int nsme; // # of chars in string output from me + FILE *fp; // file to write dump to + int size_one; // # of quantities for one atom + int nme; // # of atoms in this dump from me + int nsme; // # of chars in string output from me - double boxxlo,boxxhi; // local copies of domain values - double boxylo,boxyhi; // lo/hi are bounding box for triclinic - double boxzlo,boxzhi; - double boxxy,boxxz,boxyz; + double boxxlo, boxxhi; // local copies of domain values + double boxylo, boxyhi; // lo/hi are bounding box for triclinic + double boxzlo, boxzhi; + double boxxy, boxxz, boxyz; - int maxfiles; // max number of files created, -1 == infinite - int numfiles; // number of files in names list - int fileidx; // index of file in names list - char **nameslist; // list of history file names + int maxfiles; // max number of files created, -1 == infinite + int numfiles; // number of files in names list + int fileidx; // index of file in names list + char **nameslist; // list of history file names - bigint ntotal; // total # of per-atom lines in snapshot - int reorderflag; // 1 if OK to reorder instead of sort - int ntotal_reorder; // # of atoms that must be in snapshot - int nme_reorder; // # of atoms I must own in snapshot - tagint idlo; // lowest ID I own when reordering + bigint ntotal; // total # of per-atom lines in snapshot + int reorderflag; // 1 if OK to reorder instead of sort + int ntotal_reorder; // # of atoms that must be in snapshot + int nme_reorder; // # of atoms I must own in snapshot + tagint idlo; // lowest ID I own when reordering - int maxbuf; // size of buf - double *buf; // memory for atom quantities - int maxsbuf; // size of sbuf - char *sbuf; // memory for atom quantities in string format + int maxbuf; // size of buf + double *buf; // memory for atom quantities + int maxsbuf; // size of sbuf + char *sbuf; // memory for atom quantities in string format - int maxids; // size of ids - int maxsort; // size of bufsort, idsort, index - int maxproc; // size of proclist - tagint *ids; // list of atom IDs, if sorting on IDs + int maxids; // size of ids + int maxsort; // size of bufsort, idsort, index + int maxproc; // size of proclist + tagint *ids; // list of atom IDs, if sorting on IDs double *bufsort; tagint *idsort; - int *index,*proclist; + int *index, *proclist; - double **xpbc,**vpbc; + double **xpbc, **vpbc; imageint *imagepbc; int maxpbc; @@ -139,11 +139,11 @@ class Dump : protected Pointers { virtual void init_style() = 0; virtual void openfile(); - virtual int modify_param(int, char **) {return 0;} + virtual int modify_param(int, char **) { return 0; } virtual void write_header(bigint) = 0; virtual int count(); virtual void pack(tagint *) = 0; - virtual int convert_string(int, double *) {return 0;} + virtual int convert_string(int, double *) { return 0; } virtual void write_data(int, double *) = 0; void pbc_allocate(); double compute_time(); @@ -160,7 +160,7 @@ class Dump : protected Pointers { #endif }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/dump_atom.h b/src/dump_atom.h index 734349f9d2..20b042b23d 100644 --- a/src/dump_atom.h +++ b/src/dump_atom.h @@ -26,17 +26,17 @@ namespace LAMMPS_NS { class DumpAtom : public Dump { public: - DumpAtom(LAMMPS *, int, char**); + DumpAtom(LAMMPS *, int, char **); - const char * MAGIC_STRING = "DUMPATOM"; - const int FORMAT_REVISION = 0x0002; - const int ENDIAN = 0x0001; + const char *MAGIC_STRING = "DUMPATOM"; + const int FORMAT_REVISION = 0x0002; + const int ENDIAN = 0x0001; protected: - int scale_flag; // 1 if atom coords are scaled, 0 if no - int image_flag; // 1 if append box count to atom coords, 0 if no + int scale_flag; // 1 if atom coords are scaled, 0 if no + int image_flag; // 1 if append box count to atom coords, 0 if no - char *columns; // column labels + char *columns; // column labels void init_style(); int modify_param(int, char **); @@ -54,14 +54,14 @@ class DumpAtom : public Dump { void format_revision_binary(); typedef void (DumpAtom::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); typedef void (DumpAtom::*FnPtrPack)(tagint *); - FnPtrPack pack_choice; // ptr to pack functions + FnPtrPack pack_choice; // ptr to pack functions void pack_scale_image(tagint *); void pack_scale_noimage(tagint *); void pack_noscale_image(tagint *); @@ -70,19 +70,19 @@ class DumpAtom : public Dump { void pack_scale_noimage_triclinic(tagint *); typedef int (DumpAtom::*FnPtrConvert)(int, double *); - FnPtrConvert convert_choice; // ptr to convert data functions + FnPtrConvert convert_choice; // ptr to convert data functions int convert_image(int, double *); int convert_noimage(int, double *); typedef void (DumpAtom::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); void write_lines_image(int, double *); void write_lines_noimage(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_cfg.h b/src/dump_cfg.h index 9ae2d9f03b..30ea2259ee 100644 --- a/src/dump_cfg.h +++ b/src/dump_cfg.h @@ -26,14 +26,14 @@ namespace LAMMPS_NS { class DumpCFG : public DumpCustom { public: - int multifile_override; // used by write_dump command + int multifile_override; // used by write_dump command DumpCFG(class LAMMPS *, int, char **); virtual ~DumpCFG(); protected: - char **auxname; // name strings of auxiliary properties - int unwrapflag; // 1 if unwrapped coordinates are requested + char **auxname; // name strings of auxiliary properties + int unwrapflag; // 1 if unwrapped coordinates are requested void init_style(); virtual void write_header(bigint); @@ -41,12 +41,12 @@ class DumpCFG : public DumpCustom { virtual void write_data(int, double *); typedef void (DumpCFG::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_string(int, double *); void write_lines(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_custom.h b/src/dump_custom.h index 496887a312..d981a18bc2 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -29,70 +29,70 @@ class DumpCustom : public Dump { DumpCustom(class LAMMPS *, int, char **); virtual ~DumpCustom(); - const char * MAGIC_STRING = "DUMPCUSTOM"; - const int FORMAT_REVISION = 0x0002; - const int ENDIAN = 0x0001; + const char *MAGIC_STRING = "DUMPCUSTOM"; + const int FORMAT_REVISION = 0x0002; + const int ENDIAN = 0x0001; protected: - int nevery; // dump frequency for output - int iregion; // -1 if no region, else which region - char *idregion; // region ID + int nevery; // dump frequency for output + int iregion; // -1 if no region, else which region + char *idregion; // region ID - int nthresh; // # of defined thresholds - int nthreshlast; // # of defined thresholds with value = LAST + int nthresh; // # of defined thresholds + int nthreshlast; // # of defined thresholds with value = LAST - int *thresh_array; // array to threshold on for each nthresh - int *thresh_op; // threshold operation for each nthresh - double *thresh_value; // threshold value for each nthresh - int *thresh_last; // for threshold value = LAST, - // index into thresh_fix - // -1 if not LAST, value is numeric + int *thresh_array; // array to threshold on for each nthresh + int *thresh_op; // threshold operation for each nthresh + double *thresh_value; // threshold value for each nthresh + int *thresh_last; // for threshold value = LAST, + // index into thresh_fix + // -1 if not LAST, value is numeric - class FixStore **thresh_fix; // stores values for each threshold LAST - char **thresh_fixID; // IDs of thresh_fixes - int *thresh_first; // 1 the first time a FixStore values accessed + class FixStore **thresh_fix; // stores values for each threshold LAST + char **thresh_fixID; // IDs of thresh_fixes + int *thresh_first; // 1 the first time a FixStore values accessed - int expand; // flag for whether field args were expanded - char **earg; // field names with wildcard expansion - int nargnew; // size of earg + int expand; // flag for whether field args were expanded + char **earg; // field names with wildcard expansion + int nargnew; // size of earg - int *vtype; // type of each vector (INT, DOUBLE) - char **vformat; // format string for each vector element + int *vtype; // type of each vector (INT, DOUBLE) + char **vformat; // format string for each vector element - char *columns; // column labels + char *columns; // column labels - int nchoose; // # of selected atoms - int maxlocal; // size of atom selection and variable arrays - int *choose; // local indices of selected atoms - double *dchoose; // value for each atom to threshold against - int *clist; // compressed list of indices of selected atoms + int nchoose; // # of selected atoms + int maxlocal; // size of atom selection and variable arrays + int *choose; // local indices of selected atoms + double *dchoose; // value for each atom to threshold against + int *clist; // compressed list of indices of selected atoms - int nfield; // # of keywords listed by user - int ioptional; // index of start of optional args + int nfield; // # of keywords listed by user + int ioptional; // index of start of optional args - int *field2index; // which compute,fix,variable calcs this field - int *argindex; // index into compute,fix scalar_atom,vector_atom - // 0 for scalar_atom, 1-N for vector_atom values + int *field2index; // which compute,fix,variable calcs this field + int *argindex; // index into compute,fix scalar_atom,vector_atom + // 0 for scalar_atom, 1-N for vector_atom values - int ncompute; // # of Compute objects used by dump - char **id_compute; // their IDs - class Compute **compute; // list of ptrs to the Compute objects + int ncompute; // # of Compute objects used by dump + char **id_compute; // their IDs + class Compute **compute; // list of ptrs to the Compute objects - int nfix; // # of Fix objects used by dump - char **id_fix; // their IDs - class Fix **fix; // list of ptrs to the Fix objects + int nfix; // # of Fix objects used by dump + char **id_fix; // their IDs + class Fix **fix; // list of ptrs to the Fix objects - int nvariable; // # of Variables used by dump - char **id_variable; // their names - int *variable; // list of indices for the Variables - double **vbuf; // local storage for variable evaluation + int nvariable; // # of Variables used by dump + char **id_variable; // their names + int *variable; // list of indices for the Variables + double **vbuf; // local storage for variable evaluation - int ncustom; // # of custom atom properties - char **id_custom; // their names - int *flag_custom; // their data type + int ncustom; // # of custom atom properties + char **id_custom; // their names + int *flag_custom; // their data type - int ntypes; // # of atom types - char **typenames; // array of element names for each type + int ntypes; // # of atom types + char **typenames; // array of element names for each type // private methods @@ -120,19 +120,19 @@ class DumpCustom : public Dump { void format_revision_binary(); typedef void (DumpCustom::*FnPtrHeader)(bigint); - FnPtrHeader header_choice; // ptr to write header functions + FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); void header_binary_triclinic(bigint); void header_item(bigint); void header_item_triclinic(bigint); typedef int (DumpCustom::*FnPtrConvert)(int, double *); - FnPtrConvert convert_choice; // ptr to convert data functions + FnPtrConvert convert_choice; // ptr to convert data functions int convert_image(int, double *); int convert_noimage(int, double *); typedef void (DumpCustom::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_binary(int, double *); void write_string(int, double *); void write_lines(int, double *); @@ -140,7 +140,7 @@ class DumpCustom : public Dump { // customize by adding a method prototype typedef void (DumpCustom::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_compute(int); void pack_fix(int); @@ -204,7 +204,7 @@ class DumpCustom : public Dump { void pack_tqz(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_dcd.h b/src/dump_dcd.h index 3d602f2d9d..80e08c2394 100644 --- a/src/dump_dcd.h +++ b/src/dump_dcd.h @@ -26,15 +26,15 @@ namespace LAMMPS_NS { class DumpDCD : public Dump { public: - DumpDCD(LAMMPS *, int, char**); + DumpDCD(LAMMPS *, int, char **); virtual ~DumpDCD(); private: - int natoms,ntotal; - int headerflag,nevery_save,nframes; + int natoms, ntotal; + int headerflag, nevery_save, nframes; - float *coords,*xf,*yf,*zf; - int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no + float *coords, *xf, *yf, *zf; + int unwrap_flag; // 1 if atom coords are unwrapped, 0 if no void init_style(); void openfile(); @@ -48,7 +48,7 @@ class DumpDCD : public Dump { void write_dcd_header(const char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_deprecated.h b/src/dump_deprecated.h index cd5e1fc325..2fdb297312 100644 --- a/src/dump_deprecated.h +++ b/src/dump_deprecated.h @@ -33,9 +33,9 @@ class DumpDeprecated : public Dump { virtual void write_header(bigint) {} virtual void pack(tagint *) {} virtual void write_data(int, double *) {} - }; +}; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_image.h b/src/dump_image.h index f4e6f51b5f..a65815db90 100644 --- a/src/dump_image.h +++ b/src/dump_image.h @@ -26,69 +26,69 @@ namespace LAMMPS_NS { class DumpImage : public DumpCustom { public: - int multifile_override; // used by write_dump command + int multifile_override; // used by write_dump command - DumpImage(class LAMMPS *, int, char**); + DumpImage(class LAMMPS *, int, char **); virtual ~DumpImage(); int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); protected: int filetype; - enum{PPM,JPG,PNG}; + enum { PPM, JPG, PNG }; - int atomflag; // 0/1 for draw atoms - int acolor,adiam; // what determines color/diam of atoms - double adiamvalue; // atom diameter value + int atomflag; // 0/1 for draw atoms + int acolor, adiam; // what determines color/diam of atoms + double adiamvalue; // atom diameter value - int lineflag; // 0/1 for draw atoms as lines - int lcolor,ldiam; // what determines color/diam of lines - double ldiamvalue; // line diameter value - int triflag; // 0/1 for draw atoms as triangles - int tcolor,tstyle; // what determines color/style of tris - double tdiamvalue; // tri edge diameter value - int bodyflag; // 0/1 for draw atoms as bodies - int bodycolor; // what determines color of bodies - double bodyflag1,bodyflag2; // user-specified params for drawing bodies - int fixflag; // 0/1 to draw what fix provides - int fixcolor; // what determines color of fix objects - double fixflag1,fixflag2; // user-specified params for fix objects + int lineflag; // 0/1 for draw atoms as lines + int lcolor, ldiam; // what determines color/diam of lines + double ldiamvalue; // line diameter value + int triflag; // 0/1 for draw atoms as triangles + int tcolor, tstyle; // what determines color/style of tris + double tdiamvalue; // tri edge diameter value + int bodyflag; // 0/1 for draw atoms as bodies + int bodycolor; // what determines color of bodies + double bodyflag1, bodyflag2; // user-specified params for drawing bodies + int fixflag; // 0/1 to draw what fix provides + int fixcolor; // what determines color of fix objects + double fixflag1, fixflag2; // user-specified params for fix objects - int bondflag; // 0/1 for draw bonds - int bcolor,bdiam; // what determines color/diam of bonds - double bdiamvalue; // bond diameter value + int bondflag; // 0/1 for draw bonds + int bcolor, bdiam; // what determines color/diam of bonds + double bdiamvalue; // bond diameter value - int extraflag; // 0/1 for any of line/tri/body flag set - char *thetastr,*phistr; // variables for view theta,phi - int thetavar,phivar; // index to theta,phi vars - int cflag; // static/dynamic box center - double cx,cy,cz; // fractional box center - char *cxstr,*cystr,*czstr; // variables for box center - int cxvar,cyvar,czvar; // index to box center vars - char *upxstr,*upystr,*upzstr; // view up vector variables - int upxvar,upyvar,upzvar; // index to up vector vars - char *zoomstr; // view zoom variable name - int zoomvar; // index to zoom variable - int boxflag,axesflag; // 0/1 for draw box and axes - double boxdiam,axeslen,axesdiam; // params for drawing box and axes + int extraflag; // 0/1 for any of line/tri/body flag set + char *thetastr, *phistr; // variables for view theta,phi + int thetavar, phivar; // index to theta,phi vars + int cflag; // static/dynamic box center + double cx, cy, cz; // fractional box center + char *cxstr, *cystr, *czstr; // variables for box center + int cxvar, cyvar, czvar; // index to box center vars + char *upxstr, *upystr, *upzstr; // view up vector variables + int upxvar, upyvar, upzvar; // index to up vector vars + char *zoomstr; // view zoom variable name + int zoomvar; // index to zoom variable + int boxflag, axesflag; // 0/1 for draw box and axes + double boxdiam, axeslen, axesdiam; // params for drawing box and axes int subboxflag; double subboxdiam; - int viewflag; // overall view is static or dynamic + int viewflag; // overall view is static or dynamic - double *diamtype,*diamelement,*bdiamtype; // per-type diameters - double **colortype,**colorelement,**bcolortype; // per-type colors + double *diamtype, *diamelement, *bdiamtype; // per-type diameters + double **colortype, **colorelement, **bcolortype; // per-type colors class AtomVecLine *avec_line; // ptrs to atom style (sub)classes class AtomVecTri *avec_tri; class AtomVecBody *avec_body; - class Fix *fixptr; // ptr to Fix that provides image data + class Fix *fixptr; // ptr to Fix that provides image data - class Image *image; // class that renders each image + class Image *image; // class that renders each image - int *chooseghost; // extended choose array for comm - double **bufcopy; // buffer for communicating bond/atom info + int *chooseghost; // extended choose array for comm + double **bufcopy; // buffer for communicating bond/atom info int maxbufcopy; virtual void init_style(); @@ -102,7 +102,7 @@ class DumpImage : public DumpCustom { void create_image(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_local.h b/src/dump_local.h index 8b413b765a..80dde7e300 100644 --- a/src/dump_local.h +++ b/src/dump_local.h @@ -30,28 +30,28 @@ class DumpLocal : public Dump { virtual ~DumpLocal(); protected: - int nevery; // dump frequency to check Fix against - char *label; // string for dump file header + int nevery; // dump frequency to check Fix against + char *label; // string for dump file header - int nmine; // # of lines I am dumping - int *vtype; // type of each vector (INT, DOUBLE) - char **vformat; // format string for each vector element + int nmine; // # of lines I am dumping + int *vtype; // type of each vector (INT, DOUBLE) + char **vformat; // format string for each vector element - char *columns; // column labels + char *columns; // column labels - int nfield; // # of keywords listed by user + int nfield; // # of keywords listed by user - int *field2index; // which compute,fix,variable calcs this field - int *argindex; // index into compute,fix scalar_atom,vector_atom - // 0 for scalar_atom, 1-N for vector_atom values + int *field2index; // which compute,fix,variable calcs this field + int *argindex; // index into compute,fix scalar_atom,vector_atom + // 0 for scalar_atom, 1-N for vector_atom values - int ncompute; // # of Compute objects used by dump - char **id_compute; // their IDs - class Compute **compute; // list of ptrs to the Compute objects + int ncompute; // # of Compute objects used by dump + char **id_compute; // their IDs + class Compute **compute; // list of ptrs to the Compute objects - int nfix; // # of Fix objects used by dump - char **id_fix; // their IDs - class Fix **fix; // list of ptrs to the Fix objects + int nfix; // # of Fix objects used by dump + char **id_fix; // their IDs + class Fix **fix; // list of ptrs to the Fix objects void init_style(); int modify_param(int, char **); @@ -66,21 +66,21 @@ class DumpLocal : public Dump { int add_fix(const char *); typedef void (DumpLocal::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_string(int, double *); void write_lines(int, double *); // customize by adding a method prototype typedef void (DumpLocal::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_index(int); void pack_compute(int); void pack_fix(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_movie.h b/src/dump_movie.h index 152c100fbe..ed2531360a 100644 --- a/src/dump_movie.h +++ b/src/dump_movie.h @@ -26,18 +26,18 @@ namespace LAMMPS_NS { class DumpMovie : public DumpImage { public: - DumpMovie(LAMMPS *, int, char**); + DumpMovie(LAMMPS *, int, char **); virtual void openfile(); virtual void init_style(); virtual int modify_param(int, char **); protected: - double framerate; // frame rate of animation - int bitrate; // bitrate of video file in kbps + double framerate; // frame rate of animation + int bitrate; // bitrate of video file in kbps }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/dump_xyz.h b/src/dump_xyz.h index e4a7bd2f55..88f20e7f81 100644 --- a/src/dump_xyz.h +++ b/src/dump_xyz.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class DumpXYZ : public Dump { public: - DumpXYZ(class LAMMPS *, int, char**); + DumpXYZ(class LAMMPS *, int, char **); virtual ~DumpXYZ(); protected: @@ -41,12 +41,12 @@ class DumpXYZ : public Dump { int modify_param(int, char **); typedef void (DumpXYZ::*FnPtrWrite)(int, double *); - FnPtrWrite write_choice; // ptr to write data functions + FnPtrWrite write_choice; // ptr to write data functions void write_string(int, double *); void write_lines(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/error.h b/src/error.h index fb82b05b34..42bbc29fcd 100644 --- a/src/error.h +++ b/src/error.h @@ -26,36 +26,38 @@ class Error : protected Pointers { public: Error(class LAMMPS *); - [[ noreturn ]] void universe_all(const std::string &, int, const std::string &); - [[ noreturn ]] void universe_one(const std::string &, int, const std::string &); + [[noreturn]] void universe_all(const std::string &, int, const std::string &); + [[noreturn]] void universe_one(const std::string &, int, const std::string &); void universe_warn(const std::string &, int, const std::string &); - [[ noreturn ]] void all(const std::string &, int, const std::string &); + [[noreturn]] void all(const std::string &, int, const std::string &); template - void all(const std::string &file, int line, const S &format, - Args&&... args) { + void all(const std::string &file, int line, const S &format, Args &&...args) + { _all(file, line, format, fmt::make_args_checked(format, args...)); } - [[ noreturn ]] void one(const std::string &, int, const std::string &); + [[noreturn]] void one(const std::string &, int, const std::string &); template - void one(const std::string &file, int line, const S &format, - Args&&... args) { + void one(const std::string &file, int line, const S &format, Args &&...args) + { _one(file, line, format, fmt::make_args_checked(format, args...)); } void warning(const std::string &, int, const std::string &); template - void warning(const std::string &file, int line, const S &format, Args&&... args) { + void warning(const std::string &file, int line, const S &format, Args &&...args) + { _warning(file, line, format, fmt::make_args_checked(format, args...)); } void message(const std::string &, int, const std::string &); template - void message(const std::string &file, int line, const S &format, Args&&... args) { + void message(const std::string &file, int line, const S &format, Args &&...args) + { _message(file, line, format, fmt::make_args_checked(format, args...)); } - [[ noreturn ]] void done(int = 0); // 1 would be fully backwards compatible + [[noreturn]] void done(int = 0); // 1 would be fully backwards compatible int get_numwarn() const { return numwarn; } int get_maxwarn() const { return maxwarn; } @@ -76,15 +78,13 @@ class Error : protected Pointers { private: int numwarn, maxwarn, allwarn; // internal versions that accept explicit fmtlib arguments - [[ noreturn ]] void _all(const std::string &, int, fmt::string_view, - fmt::format_args args); - [[ noreturn ]] void _one(const std::string &, int, fmt::string_view, - fmt::format_args args); + [[noreturn]] void _all(const std::string &, int, fmt::string_view, fmt::format_args args); + [[noreturn]] void _one(const std::string &, int, fmt::string_view, fmt::format_args args); void _warning(const std::string &, int, fmt::string_view, fmt::format_args args); void _message(const std::string &, int, fmt::string_view, fmt::format_args args); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/exceptions.h b/src/exceptions.h index 53d49b6fde..3610a6fcbf 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -14,45 +14,35 @@ #ifndef LMP_EXCEPTIONS_H #define LMP_EXCEPTIONS_H +#include #include #include -#include namespace LAMMPS_NS { -class LAMMPSException : public std::exception -{ -public: +class LAMMPSException : public std::exception { + public: std::string message; - LAMMPSException(const std::string &msg) : message(msg) { - } + LAMMPSException(const std::string &msg) : message(msg) {} - ~LAMMPSException() throw() { - } + ~LAMMPSException() throw() {} - virtual const char * what() const throw() { - return message.c_str(); - } + virtual const char *what() const throw() { return message.c_str(); } }; class LAMMPSAbortException : public LAMMPSException { -public: + public: MPI_Comm universe; LAMMPSAbortException(const std::string &msg, MPI_Comm universe) : - LAMMPSException(msg), - universe(universe) + LAMMPSException(msg), universe(universe) { } }; -enum ErrorType { - ERROR_NONE = 0, - ERROR_NORMAL = 1, - ERROR_ABORT = 2 -}; +enum ErrorType { ERROR_NONE = 0, ERROR_NORMAL = 1, ERROR_ABORT = 2 }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/file_writer.h b/src/file_writer.h index f9b4abcb59..8efbd66c8e 100644 --- a/src/file_writer.h +++ b/src/file_writer.h @@ -23,30 +23,27 @@ namespace LAMMPS_NS { class FileWriter { -public: - FileWriter() = default; - virtual ~FileWriter() = default; - virtual void open(const std::string &path, bool append = false) = 0; - virtual void close() = 0; - virtual void flush() = 0; - virtual size_t write(const void * buffer, size_t length) = 0; - virtual bool isopen() const = 0; + public: + FileWriter() = default; + virtual ~FileWriter() = default; + virtual void open(const std::string &path, bool append = false) = 0; + virtual void close() = 0; + virtual void flush() = 0; + virtual size_t write(const void *buffer, size_t length) = 0; + virtual bool isopen() const = 0; }; class FileWriterException : public std::exception { std::string message; -public: - FileWriterException(const std::string &msg) : message(msg) { - } - ~FileWriterException() throw() { - } + public: + FileWriterException(const std::string &msg) : message(msg) {} - virtual const char * what() const throw() { - return message.c_str(); - } + ~FileWriterException() throw() {} + + virtual const char *what() const throw() { return message.c_str(); } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/finish.h b/src/finish.h index 08ee4e571a..3dce1f70b3 100644 --- a/src/finish.h +++ b/src/finish.h @@ -27,7 +27,7 @@ class Finish : protected Pointers { void stats(int, double *, double *, double *, double *, int, int *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix.h b/src/fix.h index c8e5d0900e..2aa2c35a98 100644 --- a/src/fix.h +++ b/src/fix.h @@ -14,111 +14,119 @@ #ifndef LMP_FIX_H #define LMP_FIX_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Fix : protected Pointers { public: - static int instance_total; // # of Fix classes ever instantiated + static int instance_total; // # of Fix classes ever instantiated - char *id,*style; - int igroup,groupbit; + char *id, *style; + int igroup, groupbit; - int restart_global; // 1 if Fix saves global state, 0 if not - int restart_peratom; // 1 if Fix saves peratom state, 0 if not - int restart_file; // 1 if Fix writes own restart file, 0 if not - int force_reneighbor; // 1 if Fix forces reneighboring, 0 if not + int restart_global; // 1 if Fix saves global state, 0 if not + int restart_peratom; // 1 if Fix saves peratom state, 0 if not + int restart_file; // 1 if Fix writes own restart file, 0 if not + int force_reneighbor; // 1 if Fix forces reneighboring, 0 if not - int box_change; // >0 if Fix changes box size, shape, or sub-domains, 0 if not + int box_change; // >0 if Fix changes box size, shape, or sub-domains, 0 if not + // clang-format off enum { - NO_BOX_CHANGE = 0, BOX_CHANGE_ANY = 1<<0, BOX_CHANGE_DOMAIN = 1<<1, - BOX_CHANGE_X = 1<<2, BOX_CHANGE_Y = 1<<3, BOX_CHANGE_Z = 1<<4, - BOX_CHANGE_YZ = 1<<5, BOX_CHANGE_XZ = 1<<6, BOX_CHANGE_XY = 1<<7, - BOX_CHANGE_SIZE = BOX_CHANGE_X | BOX_CHANGE_Y | BOX_CHANGE_Z, - BOX_CHANGE_SHAPE = BOX_CHANGE_YZ | BOX_CHANGE_XZ | BOX_CHANGE_XY + NO_BOX_CHANGE = 0, + BOX_CHANGE_ANY = 1 << 0, + BOX_CHANGE_DOMAIN = 1 << 1, + BOX_CHANGE_X = 1 << 2, + BOX_CHANGE_Y = 1 << 3, + BOX_CHANGE_Z = 1 << 4, + BOX_CHANGE_YZ = 1 << 5, + BOX_CHANGE_XZ = 1 << 6, + BOX_CHANGE_XY = 1 << 7, + BOX_CHANGE_SIZE = BOX_CHANGE_X | BOX_CHANGE_Y | BOX_CHANGE_Z, + BOX_CHANGE_SHAPE = BOX_CHANGE_YZ | BOX_CHANGE_XZ | BOX_CHANGE_XY }; + // clang-format on - bigint next_reneighbor; // next timestep to force a reneighboring - int nevery; // how often to call an end_of_step fix - int thermo_energy; // 1 if fix_modify energy enabled, 0 if not - int thermo_virial; // 1 if fix_modify virial enabled, 0 if not - int energy_global_flag; // 1 if contributes to global eng - int energy_peratom_flag; // 1 if contributes to peratom eng - int virial_global_flag; // 1 if contributes to global virial - int virial_peratom_flag; // 1 if contributes to peratom virial - int ecouple_flag; // 1 if thermostat fix outputs cumulative - // reservoir energy via compute_scalar() - int time_integrate; // 1 if performs time integration, 0 if no - int rigid_flag; // 1 if integrates rigid bodies, 0 if not - int no_change_box; // 1 if cannot swap ortho <-> triclinic - int time_depend; // 1 if requires continuous timestepping - int create_attribute; // 1 if fix stores attributes that need - // setting when a new atom is created - int restart_pbc; // 1 if fix moves atoms (except integrate) - // so write_restart must remap to PBC - int wd_header; // # of header values fix writes to data file - int wd_section; // # of sections fix writes to data file - int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 - int dof_flag; // 1 if has dof() method (not min_dof()) - int special_alter_flag; // 1 if has special_alter() meth for spec lists - int enforce2d_flag; // 1 if has enforce2d method - int respa_level_support; // 1 if fix supports fix_modify respa - int respa_level; // which respa level to apply fix (1-Nrespa) - int maxexchange; // max # of per-atom values for Comm::exchange() - int maxexchange_dynamic; // 1 if fix sets maxexchange dynamically - int pre_exchange_migrate; // 1 if fix migrates atoms in pre_exchange() - int stores_ids; // 1 if fix stores atom IDs + bigint next_reneighbor; // next timestep to force a reneighboring + int nevery; // how often to call an end_of_step fix + int thermo_energy; // 1 if fix_modify energy enabled, 0 if not + int thermo_virial; // 1 if fix_modify virial enabled, 0 if not + int energy_global_flag; // 1 if contributes to global eng + int energy_peratom_flag; // 1 if contributes to peratom eng + int virial_global_flag; // 1 if contributes to global virial + int virial_peratom_flag; // 1 if contributes to peratom virial + int ecouple_flag; // 1 if thermostat fix outputs cumulative + // reservoir energy via compute_scalar() + int time_integrate; // 1 if performs time integration, 0 if no + int rigid_flag; // 1 if integrates rigid bodies, 0 if not + int no_change_box; // 1 if cannot swap ortho <-> triclinic + int time_depend; // 1 if requires continuous timestepping + int create_attribute; // 1 if fix stores attributes that need + // setting when a new atom is created + int restart_pbc; // 1 if fix moves atoms (except integrate) + // so write_restart must remap to PBC + int wd_header; // # of header values fix writes to data file + int wd_section; // # of sections fix writes to data file + int dynamic_group_allow; // 1 if can be used with dynamic group, else 0 + int dof_flag; // 1 if has dof() method (not min_dof()) + int special_alter_flag; // 1 if has special_alter() meth for spec lists + int enforce2d_flag; // 1 if has enforce2d method + int respa_level_support; // 1 if fix supports fix_modify respa + int respa_level; // which respa level to apply fix (1-Nrespa) + int maxexchange; // max # of per-atom values for Comm::exchange() + int maxexchange_dynamic; // 1 if fix sets maxexchange dynamically + int pre_exchange_migrate; // 1 if fix migrates atoms in pre_exchange() + int stores_ids; // 1 if fix stores atom IDs - int scalar_flag; // 0/1 if compute_scalar() function exists - int vector_flag; // 0/1 if compute_vector() function exists - int array_flag; // 0/1 if compute_array() function exists - int size_vector; // length of global vector - int size_array_rows; // rows in global array - int size_array_cols; // columns in global array - int size_vector_variable; // 1 if vec length is unknown in advance - int size_array_rows_variable; // 1 if array rows is unknown in advance - int global_freq; // frequency s/v data is available at + int scalar_flag; // 0/1 if compute_scalar() function exists + int vector_flag; // 0/1 if compute_vector() function exists + int array_flag; // 0/1 if compute_array() function exists + int size_vector; // length of global vector + int size_array_rows; // rows in global array + int size_array_cols; // columns in global array + int size_vector_variable; // 1 if vec length is unknown in advance + int size_array_rows_variable; // 1 if array rows is unknown in advance + int global_freq; // frequency s/v data is available at - int peratom_flag; // 0/1 if per-atom data is stored - int size_peratom_cols; // 0 = vector, N = columns in peratom array - int peratom_freq; // frequency per-atom data is available at + int peratom_flag; // 0/1 if per-atom data is stored + int size_peratom_cols; // 0 = vector, N = columns in peratom array + int peratom_freq; // frequency per-atom data is available at - int local_flag; // 0/1 if local data is stored - int size_local_rows; // rows in local vector or array - int size_local_cols; // 0 = vector, N = columns in local array - int local_freq; // frequency local data is available at + int local_flag; // 0/1 if local data is stored + int size_local_rows; // rows in local vector or array + int size_local_cols; // 0 = vector, N = columns in local array + int local_freq; // frequency local data is available at - int extscalar; // 0/1 if global scalar is intensive/extensive - int extvector; // 0/1/-1 if global vector is all int/ext/extlist - int *extlist; // list of 0/1 int/ext for each vec component - int extarray; // 0/1 if global array is intensive/extensive + int extscalar; // 0/1 if global scalar is intensive/extensive + int extvector; // 0/1/-1 if global vector is all int/ext/extlist + int *extlist; // list of 0/1 int/ext for each vec component + int extarray; // 0/1 if global array is intensive/extensive - double *vector_atom; // computed per-atom vector - double **array_atom; // computed per-atom array - double *vector_local; // computed local vector - double **array_local; // computed local array + double *vector_atom; // computed per-atom vector + double **array_atom; // computed per-atom array + double *vector_local; // computed local vector + double **array_local; // computed local array - int comm_forward; // size of forward communication (0 if none) - int comm_reverse; // size of reverse communication (0 if none) - int comm_border; // size of border communication (0 if none) + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) + int comm_border; // size of border communication (0 if none) - double virial[6]; // virial for this timestep - double *eatom,**vatom; // per-atom energy/virial for this timestep + double virial[6]; // virial for this timestep + double *eatom, **vatom; // per-atom energy/virial for this timestep - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented - int restart_reset; // 1 if restart just re-initialized fix + int restart_reset; // 1 if restart just re-initialized fix // KOKKOS host/device flag and data masks - int kokkosable; // 1 if Kokkos fix - int forward_comm_device; // 1 if forward comm on Device + int kokkosable; // 1 if Kokkos fix + int forward_comm_device; // 1 if forward comm on Device ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; Fix(class LAMMPS *, int, char **); virtual ~Fix(); @@ -142,7 +150,7 @@ class Fix : protected Pointers { virtual void pre_neighbor() {} virtual void post_neighbor() {} virtual void pre_force(int) {} - virtual void pre_reverse(int,int) {} + virtual void pre_reverse(int, int) {} virtual void post_force(int) {} virtual void final_integrate() {} virtual void end_of_step() {} @@ -158,14 +166,14 @@ class Fix : protected Pointers { virtual void set_molecule(int, tagint, int, double *, double *, double *); virtual void clear_bonus() {} - virtual int pack_border(int, int *, double *) {return 0;} - virtual int unpack_border(int, int, double *) {return 0;} - virtual int pack_exchange(int, double *) {return 0;} - virtual int unpack_exchange(int, double *) {return 0;} - virtual int pack_restart(int, double *) {return 0;} + virtual int pack_border(int, int *, double *) { return 0; } + virtual int unpack_border(int, int, double *) { return 0; } + virtual int pack_exchange(int, double *) { return 0; } + virtual int unpack_exchange(int, double *) { return 0; } + virtual int pack_restart(int, double *) { return 0; } virtual void unpack_restart(int, int) {} - virtual int size_restart(int) {return 0;} - virtual int maxsize_restart() {return 0;} + virtual int size_restart(int) { return 0; } + virtual int maxsize_restart() { return 0; } virtual void setup_pre_force_respa(int, int) {} virtual void initial_integrate_respa(int, int, int) {} @@ -178,30 +186,30 @@ class Fix : protected Pointers { virtual void min_pre_neighbor() {} virtual void min_post_neighbor() {} virtual void min_pre_force(int) {} - virtual void min_pre_reverse(int,int) {} + virtual void min_pre_reverse(int, int) {} virtual void min_post_force(int) {} - virtual double min_energy(double *) {return 0.0;} + virtual double min_energy(double *) { return 0.0; } virtual void min_store() {} virtual void min_clearstore() {} virtual void min_pushstore() {} virtual void min_popstore() {} - virtual int min_reset_ref() {return 0;} + virtual int min_reset_ref() { return 0; } virtual void min_step(double, double *) {} - virtual double max_alpha(double *) {return 0.0;} - virtual int min_dof() {return 0;} + virtual double max_alpha(double *) { return 0.0; } + virtual int min_dof() { return 0; } - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + virtual int pack_forward_comm(int, int *, double *, int, int *) { return 0; } virtual void unpack_forward_comm(int, int, double *) {} - virtual int pack_reverse_comm_size(int, int) {return 0;} - virtual int pack_reverse_comm(int, int, double *) {return 0;} + virtual int pack_reverse_comm_size(int, int) { return 0; } + virtual int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} - virtual double compute_scalar() {return 0.0;} - virtual double compute_vector(int) {return 0.0;} - virtual double compute_array(int,int) {return 0.0;} + virtual double compute_scalar() { return 0.0; } + virtual double compute_vector(int) { return 0.0; } + virtual double compute_array(int, int) { return 0.0; } - virtual int dof(int) {return 0;} + virtual int dof(int) { return 0; } virtual void deform(int) {} virtual void reset_target(double) {} virtual void reset_dt() {} @@ -209,7 +217,7 @@ class Fix : protected Pointers { virtual void read_data_header(char *) {} virtual void read_data_section(char *, int, char *, tagint) {} - virtual bigint read_data_skip_lines(char *) {return 0;} + virtual bigint read_data_skip_lines(char *) { return 0; } virtual void write_data_header(FILE *, int) {} virtual void write_data_section_size(int, int &, int &) {} @@ -222,37 +230,43 @@ class Fix : protected Pointers { virtual void rebuild_special() {} - virtual int image(int *&, double **&) {return 0;} + virtual int image(int *&, double **&) { return 0; } - virtual int modify_param(int, char **) {return 0;} - virtual void *extract(const char *, int &) {return nullptr;} + virtual int modify_param(int, char **) { return 0; } + virtual void *extract(const char *, int &) { return nullptr; } - virtual double memory_usage() {return 0.0;} + virtual double memory_usage() { return 0.0; } protected: - int instance_me; // which Fix class instantiation I am + int instance_me; // which Fix class instantiation I am int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom; - int maxeatom,maxvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom; + int maxeatom, maxvatom; - int copymode; // if set, do not deallocate during destruction - // required when classes are used as functors by Kokkos + int copymode; // if set, do not deallocate during destruction + // required when classes are used as functors by Kokkos int dynamic; // recount atoms for temperature computes - void ev_init(int eflag, int vflag) { - if ((eflag && thermo_energy) || (vflag && thermo_virial)) ev_setup(eflag, vflag); - else evflag = eflag_either = eflag_global = eflag_atom = - vflag_either = vflag_global = vflag_atom = 0; + void ev_init(int eflag, int vflag) + { + if ((eflag && thermo_energy) || (vflag && thermo_virial)) + ev_setup(eflag, vflag); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + 0; } void ev_setup(int, int); void ev_tally(int, int *, double, double, double *); - void v_init(int vflag) { - if (vflag && thermo_virial) v_setup(vflag); - else evflag = vflag_either = vflag_global = vflag_atom = 0; + void v_init(int vflag) + { + if (vflag && thermo_virial) + v_setup(vflag); + else + evflag = vflag_either = vflag_global = vflag_atom = 0; } void v_setup(int); void v_tally(int, int *, double, double *); @@ -262,33 +276,33 @@ class Fix : protected Pointers { namespace FixConst { enum { - INITIAL_INTEGRATE = 1<<0, - POST_INTEGRATE = 1<<1, - PRE_EXCHANGE = 1<<2, - PRE_NEIGHBOR = 1<<3, - POST_NEIGHBOR = 1<<4, - PRE_FORCE = 1<<5, - PRE_REVERSE = 1<<6, - POST_FORCE = 1<<7, - FINAL_INTEGRATE = 1<<8, - END_OF_STEP = 1<<9, - POST_RUN = 1<<10, - INITIAL_INTEGRATE_RESPA = 1<<11, - POST_INTEGRATE_RESPA = 1<<12, - PRE_FORCE_RESPA = 1<<13, - POST_FORCE_RESPA = 1<<14, - FINAL_INTEGRATE_RESPA = 1<<15, - MIN_PRE_EXCHANGE = 1<<16, - MIN_PRE_NEIGHBOR = 1<<17, - MIN_POST_NEIGHBOR = 1<<18, - MIN_PRE_FORCE = 1<<19, - MIN_PRE_REVERSE = 1<<20, - MIN_POST_FORCE = 1<<21, - MIN_ENERGY = 1<<22 + INITIAL_INTEGRATE = 1 << 0, + POST_INTEGRATE = 1 << 1, + PRE_EXCHANGE = 1 << 2, + PRE_NEIGHBOR = 1 << 3, + POST_NEIGHBOR = 1 << 4, + PRE_FORCE = 1 << 5, + PRE_REVERSE = 1 << 6, + POST_FORCE = 1 << 7, + FINAL_INTEGRATE = 1 << 8, + END_OF_STEP = 1 << 9, + POST_RUN = 1 << 10, + INITIAL_INTEGRATE_RESPA = 1 << 11, + POST_INTEGRATE_RESPA = 1 << 12, + PRE_FORCE_RESPA = 1 << 13, + POST_FORCE_RESPA = 1 << 14, + FINAL_INTEGRATE_RESPA = 1 << 15, + MIN_PRE_EXCHANGE = 1 << 16, + MIN_PRE_NEIGHBOR = 1 << 17, + MIN_POST_NEIGHBOR = 1 << 18, + MIN_PRE_FORCE = 1 << 19, + MIN_PRE_REVERSE = 1 << 20, + MIN_POST_FORCE = 1 << 21, + MIN_ENERGY = 1 << 22 }; } -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_adapt.h b/src/fix_adapt.h index 080f8ee700..56ba91363c 100644 --- a/src/fix_adapt.h +++ b/src/fix_adapt.h @@ -26,7 +26,7 @@ namespace LAMMPS_NS { class FixAdapt : public Fix { public: - int diamflag; // 1 if atom diameters will vary, for AtomVecGranular + int diamflag; // 1 if atom diameters will vary, for AtomVecGranular int chgflag; FixAdapt(class LAMMPS *, int, char **); @@ -37,31 +37,31 @@ class FixAdapt : public Fix { void setup_pre_force(int); void pre_force(int); void post_run(); - void setup_pre_force_respa(int,int); - void pre_force_respa(int,int,int); + void setup_pre_force_respa(int, int); + void pre_force_respa(int, int, int); void set_arrays(int); void write_restart(FILE *); void restart(char *); private: - int nadapt,resetflag,scaleflag,massflag; + int nadapt, resetflag, scaleflag, massflag; int anypair, anybond; int nlevels_respa; - char *id_fix_diam,*id_fix_chg; - class FixStore *fix_diam,*fix_chg; - double previous_diam_scale,previous_chg_scale; + char *id_fix_diam, *id_fix_chg; + class FixStore *fix_diam, *fix_chg; + double previous_diam_scale, previous_chg_scale; int discflag; struct Adapt { - int which,ivar; + int which, ivar; char *var; - char *pstyle,*pparam; - char *bstyle,*bparam; - int ilo,ihi,jlo,jhi; - int pdim,bdim; - double *scalar,scalar_orig; - double *vector,*vector_orig; - double **array,**array_orig; + char *pstyle, *pparam; + char *bstyle, *bparam; + int ilo, ihi, jlo, jhi; + int pdim, bdim; + double *scalar, scalar_orig; + double *vector, *vector_orig; + double **array, **array_orig; int aparam; class Pair *pair; class Bond *bond; @@ -74,7 +74,7 @@ class FixAdapt : public Fix { void restore_settings(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_addforce.h b/src/fix_addforce.h index 8c82bdc826..9f08c2381e 100644 --- a/src/fix_addforce.h +++ b/src/fix_addforce.h @@ -40,12 +40,12 @@ class FixAddForce : public Fix { double memory_usage(); private: - double xvalue,yvalue,zvalue; - int varflag,iregion; - char *xstr,*ystr,*zstr,*estr; + double xvalue, yvalue, zvalue; + int varflag, iregion; + char *xstr, *ystr, *zstr, *estr; char *idregion; - int xvar,yvar,zvar,evar,xstyle,ystyle,zstyle,estyle; - double foriginal[4],foriginal_all[4]; + int xvar, yvar, zvar, evar, xstyle, ystyle, zstyle, estyle; + double foriginal[4], foriginal_all[4]; int force_flag; int ilevel_respa; @@ -53,7 +53,7 @@ class FixAddForce : public Fix { double **sforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_atom.h b/src/fix_ave_atom.h index 2cdf66274f..b33cc8e250 100644 --- a/src/fix_ave_atom.h +++ b/src/fix_ave_atom.h @@ -41,16 +41,16 @@ class FixAveAtom : public Fix { private: int nvalues; - int nrepeat,irepeat; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index; + int nrepeat, irepeat; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index; char **ids; double **array; bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_chunk.h b/src/fix_ave_chunk.h index 07ff553a92..ceb34e2ce7 100644 --- a/src/fix_ave_chunk.h +++ b/src/fix_ave_chunk.h @@ -32,31 +32,31 @@ class FixAveChunk : public Fix { void init(); void setup(int); void end_of_step(); - double compute_array(int,int); + double compute_array(int, int); double memory_usage(); private: int nvalues; - int nrepeat,nfreq,irepeat; - int normflag,scaleflag,overwrite,biasflag,colextra; - bigint nvalid,nvalid_last; - double adof,cdof; - char *format,*format_user; - char *tstring,*sstring,*id_bias; - int *which,*argindex,*value2index; + int nrepeat, nfreq, irepeat; + int normflag, scaleflag, overwrite, biasflag, colextra; + bigint nvalid, nvalid_last; + double adof, cdof; + char *format, *format_user; + char *tstring, *sstring, *id_bias; + int *which, *argindex, *value2index; char **ids; - class Compute *tbias; // ptr to additional bias compute + class Compute *tbias; // ptr to additional bias compute FILE *fp; - int densityflag; // 1 if density/number or density/mass requested - int volflag; // SCALAR/VECTOR for density normalization by volume + int densityflag; // 1 if density/number or density/mass requested + int volflag; // SCALAR/VECTOR for density normalization by volume double chunk_volume_scalar; double *chunk_volume_vec; - int ave,nwindow; - int normcount,iwindow,window_limit; + int ave, nwindow; + int normcount, iwindow, window_limit; - int nchunk,maxchunk; + int nchunk, maxchunk; char *idchunk; class ComputeChunkAtom *cchunk; int lockforever; @@ -69,16 +69,16 @@ class FixAveChunk : public Fix { // one,many,sum vecs/arrays are used with a single Nfreq epoch // total,list vecs/arrays are used across epochs - double *count_one,*count_many,*count_sum; - double **values_one,**values_many,**values_sum; - double *count_total,**count_list; - double **values_total,***values_list; + double *count_one, *count_many, *count_sum; + double **values_one, **values_many, **values_sum; + double *count_total, **count_list; + double **values_total, ***values_list; void allocate(); bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_correlate.h b/src/fix_ave_correlate.h index 9b6c185ab7..3331b5070e 100644 --- a/src/fix_ave_correlate.h +++ b/src/fix_ave_correlate.h @@ -32,36 +32,36 @@ class FixAveCorrelate : public Fix { void init(); void setup(int); void end_of_step(); - double compute_array(int,int); + double compute_array(int, int); private: - int me,nvalues; - int nrepeat,nfreq; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index; + int me, nvalues; + int nrepeat, nfreq; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index; char **ids; FILE *fp; - int type,ave,startstep,overwrite; + int type, ave, startstep, overwrite; double prefactor; long filepos; - int firstindex; // index in values ring of earliest time sample - int lastindex; // index in values ring of latest time sample - int nsample; // number of time samples in values ring + int firstindex; // index in values ring of earliest time sample + int lastindex; // index in values ring of latest time sample + int nsample; // number of time samples in values ring - int npair; // number of correlation pairs to calculate + int npair; // number of correlation pairs to calculate int *count; - double **values,**corr; + double **values, **corr; - int *save_count; // saved values at Nfreq for output via compute_array() + int *save_count; // saved values at Nfreq for output via compute_array() double **save_corr; void accumulate(); bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_histo.h b/src/fix_ave_histo.h index 647bbaff14..d50098d2c6 100644 --- a/src/fix_ave_histo.h +++ b/src/fix_ave_histo.h @@ -33,33 +33,33 @@ class FixAveHisto : public Fix { void setup(int); virtual void end_of_step(); double compute_vector(int); - double compute_array(int,int); + double compute_array(int, int); protected: - int me,nvalues; - int nrepeat,nfreq,irepeat; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index; + int me, nvalues; + int nrepeat, nfreq, irepeat; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index; char **ids; FILE *fp; - double lo,hi,binsize,bininv; - int kind,beyond,overwrite; + double lo, hi, binsize, bininv; + int kind, beyond, overwrite; long filepos; - double stats[4],stats_total[4],stats_all[4]; + double stats[4], stats_total[4], stats_all[4]; double **stats_list; int nbins; - double *bin,*bin_total,*bin_all; + double *bin, *bin_total, *bin_all; double **bin_list; double *coord; double *vector; int maxatom; - int ave,nwindow,startstep,mode; - char *title1,*title2,*title3; - int iwindow,window_limit; + int ave, nwindow, startstep, mode; + char *title1, *title2, *title3; + int iwindow, window_limit; void bin_one(double); void bin_vector(int, double *, int); @@ -68,7 +68,7 @@ class FixAveHisto : public Fix { bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_histo_weight.h b/src/fix_ave_histo_weight.h index fb4557fd14..6fd35ab8b0 100644 --- a/src/fix_ave_histo_weight.h +++ b/src/fix_ave_histo_weight.h @@ -36,7 +36,7 @@ class FixAveHistoWeight : public FixAveHisto { void bin_atoms_weights(double *, int, double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_ave_time.h b/src/fix_ave_time.h index c84d8ed5bd..d8b131db3c 100644 --- a/src/fix_ave_time.h +++ b/src/fix_ave_time.h @@ -34,14 +34,14 @@ class FixAveTime : public Fix { void end_of_step(); double compute_scalar(); double compute_vector(int); - double compute_array(int,int); + double compute_array(int, int); private: - int me,nvalues; - int nrepeat,nfreq,irepeat; - bigint nvalid,nvalid_last; - int *which,*argindex,*value2index,*offcol; - int *varlen; // 1 if value is from variable-length compute + int me, nvalues; + int nrepeat, nfreq, irepeat; + bigint nvalid, nvalid_last; + int *which, *argindex, *value2index, *offcol; + int *varlen; // 1 if value is from variable-length compute char **ids; FILE *fp; int nrows; @@ -49,14 +49,14 @@ class FixAveTime : public Fix { int all_variable_length; int lockforever; - int ave,nwindow,startstep,mode; - int noff,overwrite; + int ave, nwindow, startstep, mode; + int noff, overwrite; int *offlist; - char *format,*format_user; - char *title1,*title2,*title3; + char *format, *format_user; + char *title1, *title2, *title3; long filepos; - int norm,iwindow,window_limit; + int norm, iwindow, window_limit; double *vector; double *vector_total; double **vector_list; @@ -73,7 +73,7 @@ class FixAveTime : public Fix { bigint nextvalid(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_aveforce.h b/src/fix_aveforce.h index 35f75dcb97..9749e116b6 100644 --- a/src/fix_aveforce.h +++ b/src/fix_aveforce.h @@ -38,17 +38,17 @@ class FixAveForce : public Fix { double compute_vector(int); private: - double xvalue,yvalue,zvalue; + double xvalue, yvalue, zvalue; int varflag; - char *xstr,*ystr,*zstr; + char *xstr, *ystr, *zstr; char *idregion; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; int iregion; double foriginal_all[4]; - int nlevels_respa,ilevel_respa; + int nlevels_respa, ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_balance.h b/src/fix_balance.h index 26b91980c9..b72148a640 100644 --- a/src/fix_balance.h +++ b/src/fix_balance.h @@ -40,19 +40,19 @@ class FixBalance : public Fix { double memory_usage(); private: - int nevery,lbstyle,nitermax; - double thresh,stopthresh; + int nevery, lbstyle, nitermax; + double thresh, stopthresh; char bstr[4]; - int wtflag; // 1 for weighted balancing + int wtflag; // 1 for weighted balancing - double imbnow; // current imbalance factor - double imbprev; // imbalance factor before last rebalancing - double imbfinal; // imbalance factor after last rebalancing - double maxloadperproc; // max load on any processor - int itercount; // iteration count of last call to Balance - int kspace_flag; // 1 if KSpace solver defined + double imbnow; // current imbalance factor + double imbprev; // imbalance factor before last rebalancing + double imbfinal; // imbalance factor after last rebalancing + double maxloadperproc; // max load on any processor + int itercount; // iteration count of last call to Balance + int kspace_flag; // 1 if KSpace solver defined int pending; - bigint lastbalance; // last timestep balancing was attempted + bigint lastbalance; // last timestep balancing was attempted class Balance *balance; class Irregular *irregular; @@ -60,7 +60,7 @@ class FixBalance : public Fix { void rebalance(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_box_relax.h b/src/fix_box_relax.h index c11b0e95bf..34b90f0c5a 100644 --- a/src/fix_box_relax.h +++ b/src/fix_box_relax.h @@ -45,42 +45,42 @@ class FixBoxRelax : public Fix { private: int p_flag[6]; - int pstyle,pcouple,allremap; + int pstyle, pcouple, allremap; int dimension; - double p_target[6],p_current[6]; - double vol0,xprdinit,yprdinit,zprdinit; - double vmax,pv2e,pflagsum; + double p_target[6], p_current[6]; + double vol0, xprdinit, yprdinit, zprdinit; + double vmax, pv2e, pflagsum; int kspace_flag; - int current_lifo; // LIFO stack pointer - double boxlo0[2][3]; // box bounds at start of line search + int current_lifo; // LIFO stack pointer + double boxlo0[2][3]; // box bounds at start of line search double boxhi0[2][3]; - double boxtilt0[2][3]; // xy,xz,yz tilts at start of line search - double ds[6]; // increment in scale matrix + double boxtilt0[2][3]; // xy,xz,yz tilts at start of line search + double ds[6]; // increment in scale matrix - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly - double fixedpoint[3]; // Location of dilation fixed-point + double fixedpoint[3]; // Location of dilation fixed-point - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tflag,pflag; + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tflag, pflag; int nrigid; int *rfix; - double sigma[6]; // scaled target stress - double utsigma[3]; // weighting for upper-tri elements - // of modified sigma - int sigmamod_flag; // 1 if modified sigma to be used - double fdev[6]; // Deviatoric force on cell - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0[6]; // h_inv of reference (zero strain) box - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 - double p_hydro; // hydrostatic component of target stress + double sigma[6]; // scaled target stress + double utsigma[3]; // weighting for upper-tri elements + // of modified sigma + int sigmamod_flag; // 1 if modified sigma to be used + double fdev[6]; // Deviatoric force on cell + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0[6]; // h_inv of reference (zero strain) box + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 + double p_hydro; // hydrostatic component of target stress void remap(); void couple(); @@ -92,7 +92,7 @@ class FixBoxRelax : public Fix { double compute_scalar(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_controller.h b/src/fix_controller.h index f97088e18b..4ceae85148 100644 --- a/src/fix_controller.h +++ b/src/fix_controller.h @@ -35,20 +35,20 @@ class FixController : public Fix { double compute_vector(int); private: - double kp,ki,kd,alpha,tau; + double kp, ki, kd, alpha, tau; double setpoint; - int pvwhich,pvindex; - char *pvID,*cvID; + int pvwhich, pvindex; + char *pvID, *cvID; int firsttime; - double control,err,olderr,deltaerr,sumerr; + double control, err, olderr, deltaerr, sumerr; class Compute *pcompute; class Fix *pfix; - int pvar,cvar; + int pvar, cvar; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_deform.h b/src/fix_deform.h index 7e3c90dd09..b63ded1588 100644 --- a/src/fix_deform.h +++ b/src/fix_deform.h @@ -26,8 +26,8 @@ namespace LAMMPS_NS { class FixDeform : public Fix { public: - int remapflag; // whether x,v are remapped across PBC - int dimflag[6]; // which dims are deformed + int remapflag; // whether x,v are remapped across PBC + int dimflag[6]; // which dims are deformed FixDeform(class LAMMPS *, int, char **); virtual ~FixDeform(); @@ -40,38 +40,38 @@ class FixDeform : public Fix { double memory_usage(); protected: - int triclinic,scaleflag,flipflag; - int flip,flipxy,flipxz,flipyz; - double *h_rate,*h_ratelo; - int varflag; // 1 if VARIABLE option is used, 0 if not - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes - class Irregular *irregular; // for migrating atoms after box flips + int triclinic, scaleflag, flipflag; + int flip, flipxy, flipxz, flipyz; + double *h_rate, *h_ratelo; + int varflag; // 1 if VARIABLE option is used, 0 if not + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes + class Irregular *irregular; // for migrating atoms after box flips double TWOPI; struct Set { - int style,substyle; - double flo,fhi,ftilt; - double dlo,dhi,dtilt; - double scale,vel,rate; - double amplitude,tperiod; - double lo_initial,hi_initial; - double lo_start,hi_start,lo_stop,hi_stop,lo_target,hi_target; - double tilt_initial,tilt_start,tilt_stop,tilt_target,tilt_flip; - double tilt_min,tilt_max; - double vol_initial,vol_start; - int fixed,dynamic1,dynamic2; - char *hstr,*hratestr; - int hvar,hratevar; + int style, substyle; + double flo, fhi, ftilt; + double dlo, dhi, dtilt; + double scale, vel, rate; + double amplitude, tperiod; + double lo_initial, hi_initial; + double lo_start, hi_start, lo_stop, hi_stop, lo_target, hi_target; + double tilt_initial, tilt_start, tilt_stop, tilt_target, tilt_flip; + double tilt_min, tilt_max; + double vol_initial, vol_start; + int fixed, dynamic1, dynamic2; + char *hstr, *hratestr; + int hvar, hratevar; }; Set *set; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_deprecated.h b/src/fix_deprecated.h index 619211bd81..72a24b61bd 100644 --- a/src/fix_deprecated.h +++ b/src/fix_deprecated.h @@ -31,11 +31,11 @@ class FixDeprecated : public Fix { public: FixDeprecated(class LAMMPS *, int, char **); ~FixDeprecated() {} - int setmask() {return 0;} + int setmask() { return 0; } void init() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_drag.h b/src/fix_drag.h index 48cdcd66de..589dd2a41a 100644 --- a/src/fix_drag.h +++ b/src/fix_drag.h @@ -35,16 +35,16 @@ class FixDrag : public Fix { double compute_vector(int); private: - double xc,yc,zc; + double xc, yc, zc; double f_mag; - int xflag,yflag,zflag; + int xflag, yflag, zflag; double delta; int ilevel_respa; - double ftotal[3],ftotal_all[3]; + double ftotal[3], ftotal_all[3]; int force_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_dt_reset.h b/src/fix_dt_reset.h index 5dafd21515..5ffbbc2008 100644 --- a/src/fix_dt_reset.h +++ b/src/fix_dt_reset.h @@ -36,14 +36,14 @@ class FixDtReset : public Fix { private: bigint laststep; - int minbound,maxbound; - double tmin,tmax,xmax,emax; - double ftm2v,mvv2e; - double dt,t_laststep; + int minbound, maxbound; + double tmin, tmax, xmax, emax; + double ftm2v, mvv2e; + double dt, t_laststep; int respaflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_dummy.h b/src/fix_dummy.h index 66a38b60ce..5c04135f30 100644 --- a/src/fix_dummy.h +++ b/src/fix_dummy.h @@ -31,13 +31,13 @@ class FixDummy : public Fix { int setmask(); protected: - int initial_integrate_flag,final_integrate_flag; - int pre_exchange_flag,pre_neighbor_flag; - int pre_force_flag,post_force_flag; + int initial_integrate_flag, final_integrate_flag; + int pre_exchange_flag, pre_neighbor_flag; + int pre_force_flag, post_force_flag; int end_of_step_flag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_enforce2d.h b/src/fix_enforce2d.h index be2a1540e2..9625bdcd60 100644 --- a/src/fix_enforce2d.h +++ b/src/fix_enforce2d.h @@ -41,7 +41,7 @@ class FixEnforce2D : public Fix { class Fix **flist; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_external.h b/src/fix_external.h index 59fb2c975d..65d3512bc3 100644 --- a/src/fix_external.h +++ b/src/fix_external.h @@ -46,7 +46,7 @@ class FixExternal : public Fix { void set_energy_peratom(double *); void set_virial_peratom(double **); void set_vector_length(int); - void set_vector(int,double); + void set_vector(int, double); double memory_usage(); void grow_arrays(int); @@ -58,14 +58,14 @@ class FixExternal : public Fix { void set_callback(FnPtr, void *); private: - int mode,ncall,napply,eflag_caller; + int mode, ncall, napply, eflag_caller; FnPtr callback; void *ptr_caller; double user_energy; double *caller_vector; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_gravity.h b/src/fix_gravity.h index 75b5cfaa07..efa88e917c 100644 --- a/src/fix_gravity.h +++ b/src/fix_gravity.h @@ -39,28 +39,28 @@ class FixGravity : public Fix { void *extract(const char *, int &); protected: - int style,disable; + int style, disable; double magnitude; - double vert,phi,theta; - double xdir,ydir,zdir; - double xgrav,ygrav,zgrav,xacc,yacc,zacc; + double vert, phi, theta; + double xdir, ydir, zdir; + double xgrav, ygrav, zgrav, xacc, yacc, zacc; double degree2rad; int ilevel_respa; int time_origin; double gvec[3]; int eflag; - double egrav,egrav_all; + double egrav, egrav_all; int varflag; - int mstyle,vstyle,pstyle,tstyle,xstyle,ystyle,zstyle; - int mvar,vvar,pvar,tvar,xvar,yvar,zvar; - char *mstr,*vstr,*pstr,*tstr,*xstr,*ystr,*zstr; + int mstyle, vstyle, pstyle, tstyle, xstyle, ystyle, zstyle; + int mvar, vvar, pvar, tvar, xvar, yvar, zvar; + char *mstr, *vstr, *pstr, *tstr, *xstr, *ystr, *zstr; void set_acceleration(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_group.h b/src/fix_group.h index a1f200934f..bf64422d4c 100644 --- a/src/fix_group.h +++ b/src/fix_group.h @@ -32,14 +32,14 @@ class FixGroup : public Fix { void init(); void setup(int); void post_integrate(); - void post_integrate_respa(int,int); - void *extract(const char *,int &); + void post_integrate_respa(int, int); + void *extract(const char *, int &); private: - int gbit,gbitinverse; - int regionflag,varflag,propflag,typeflag; - int iregion,ivar,iprop; - char *idregion,*idvar,*idprop; + int gbit, gbitinverse; + int regionflag, varflag, propflag, typeflag; + int iregion, ivar, iprop; + char *idregion, *idvar, *idprop; class Region *region; int nlevels_respa; @@ -47,7 +47,7 @@ class FixGroup : public Fix { void set_group(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_halt.h b/src/fix_halt.h index 6973339844..d798cb642a 100644 --- a/src/fix_halt.h +++ b/src/fix_halt.h @@ -35,9 +35,9 @@ class FixHalt : public Fix { void post_run(); private: - int attribute,operation,eflag,msgflag,ivar; - bigint nextstep,thisstep; - double value,tratio; + int attribute, operation, eflag, msgflag, ivar; + bigint nextstep, thisstep; + double value, tratio; char *idvar; char *dlimit_path; @@ -46,7 +46,7 @@ class FixHalt : public Fix { double diskfree(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_heat.h b/src/fix_heat.h index 5a80a69523..65876786bf 100644 --- a/src/fix_heat.h +++ b/src/fix_heat.h @@ -41,14 +41,14 @@ class FixHeat : public Fix { double scale; char *idregion; char *hstr; - int hstyle,hvar; + int hstyle, hvar; int maxatom; double *vheat; double *vscale; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_indent.h b/src/fix_indent.h index 1b4b0426d4..3c7cb13adf 100644 --- a/src/fix_indent.h +++ b/src/fix_indent.h @@ -39,20 +39,20 @@ class FixIndent : public Fix { double compute_vector(int); private: - int istyle,scaleflag,side; - double k,k3; - char *xstr,*ystr,*zstr,*rstr,*pstr; - int xvar,yvar,zvar,rvar,pvar; - double xvalue,yvalue,zvalue,rvalue,pvalue; - int indenter_flag,planeside; - double indenter[4],indenter_all[4]; - int cdim,varflag; + int istyle, scaleflag, side; + double k, k3; + char *xstr, *ystr, *zstr, *rstr, *pstr; + int xvar, yvar, zvar, rvar, pvar; + double xvalue, yvalue, zvalue, rvalue, pvalue; + int indenter_flag, planeside; + double indenter[4], indenter_all[4]; + int cdim, varflag; int ilevel_respa; void options(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_langevin.h b/src/fix_langevin.h index a1bd7aca18..6c18737dc3 100644 --- a/src/fix_langevin.h +++ b/src/fix_langevin.h @@ -47,24 +47,24 @@ class FixLangevin : public Fix { int unpack_exchange(int, double *); protected: - int gjfflag,nvalues,osflag,oflag,tallyflag,zeroflag,tbiasflag; + int gjfflag, nvalues, osflag, oflag, tallyflag, zeroflag, tbiasflag; int flangevin_allocated; double ascale; - double t_start,t_stop,t_period,t_target; - double *gfactor1,*gfactor2,*ratio; - double energy,energy_onestep; + double t_start, t_stop, t_period, t_target; + double *gfactor1, *gfactor2, *ratio; + double energy, energy_onestep; double tsqrt; - int tstyle,tvar; - double gjfa, gjfsib; //gjf a and gjf sqrt inverse b + int tstyle, tvar; + double gjfa, gjfsib; //gjf a and gjf sqrt inverse b char *tstr; class AtomVecEllipsoid *avec; - int maxatom1,maxatom2; + int maxatom1, maxatom2; double **flangevin; double *tforce; double **franprev; - double **lv; //half step velocity + double **lv; //half step velocity char *id_temp; class Compute *temperature; @@ -73,8 +73,7 @@ class FixLangevin : public Fix { class RanMars *random; int seed; - template < int Tp_TSTYLEATOM, int Tp_GJF, int Tp_TALLY, - int Tp_BIAS, int Tp_RMASS, int Tp_ZERO > + template void post_force_templated(); void omega_thermostat(); @@ -82,7 +81,7 @@ class FixLangevin : public Fix { void compute_target(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_lineforce.h b/src/fix_lineforce.h index 4cfcc94e53..9cff8c0575 100644 --- a/src/fix_lineforce.h +++ b/src/fix_lineforce.h @@ -35,10 +35,10 @@ class FixLineForce : public Fix { void min_post_force(int); private: - double xdir,ydir,zdir; + double xdir, ydir, zdir; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_minimize.h b/src/fix_minimize.h index c71b871d19..2a796e0de7 100644 --- a/src/fix_minimize.h +++ b/src/fix_minimize.h @@ -48,12 +48,12 @@ class FixMinimize : public Fix { int nvector; int *peratom; double **vectors; - double boxlo[3],boxhi[3]; + double boxlo[3], boxhi[3]; void box_swap(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_momentum.h b/src/fix_momentum.h index 24330366c3..1e5ea8f160 100644 --- a/src/fix_momentum.h +++ b/src/fix_momentum.h @@ -32,12 +32,12 @@ class FixMomentum : public Fix { void end_of_step(); protected: - int linear,angular,rescale; - int xflag,yflag,zflag; + int linear, angular, rescale; + int xflag, yflag, zflag; double masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_move.h b/src/fix_move.h index 32dc4d1168..d346bc8fc6 100644 --- a/src/fix_move.h +++ b/src/fix_move.h @@ -51,27 +51,27 @@ class FixMove : public Fix { void reset_dt(); private: - char *xvarstr,*yvarstr,*zvarstr,*vxvarstr,*vyvarstr,*vzvarstr; + char *xvarstr, *yvarstr, *zvarstr, *vxvarstr, *vyvarstr, *vzvarstr; int mstyle; - int vxflag,vyflag,vzflag,axflag,ayflag,azflag; - double vx,vy,vz,ax,ay,az; - double period,omega_rotate; - double point[3],axis[3],runit[3]; - double dt,dtv,dtf; - int xvar,yvar,zvar,vxvar,vyvar,vzvar; - int xvarstyle,yvarstyle,zvarstyle,vxvarstyle,vyvarstyle,vzvarstyle; - int extra_flag,omega_flag,angmom_flag; - int radius_flag,ellipsoid_flag,line_flag,tri_flag,body_flag; - int theta_flag,quat_flag; - int nlevels_respa,nrestart; + int vxflag, vyflag, vzflag, axflag, ayflag, azflag; + double vx, vy, vz, ax, ay, az; + double period, omega_rotate; + double point[3], axis[3], runit[3]; + double dt, dtv, dtf; + int xvar, yvar, zvar, vxvar, vyvar, vzvar; + int xvarstyle, yvarstyle, zvarstyle, vxvarstyle, vyvarstyle, vzvarstyle; + int extra_flag, omega_flag, angmom_flag; + int radius_flag, ellipsoid_flag, line_flag, tri_flag, body_flag; + int theta_flag, quat_flag; + int nlevels_respa, nrestart; int time_origin; - double **xoriginal; // original coords of atoms - double *toriginal; // original theta of atoms - double **qoriginal; // original quat of atoms - int displaceflag,velocityflag; + double **xoriginal; // original coords of atoms + double *toriginal; // original theta of atoms + double **qoriginal; // original quat of atoms + int displaceflag, velocityflag; int maxatom; - double **displace,**velocity; + double **displace, **velocity; class AtomVecEllipsoid *avec_ellipsoid; class AtomVecLine *avec_line; @@ -79,7 +79,7 @@ class FixMove : public Fix { class AtomVecBody *avec_body; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_neigh_history.h b/src/fix_neigh_history.h index 5fe714bb49..2d26d26a19 100644 --- a/src/fix_neigh_history.h +++ b/src/fix_neigh_history.h @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class FixNeighHistory : public Fix { public: - int nlocal_neigh; // nlocal at last time neigh list was built - int nall_neigh; // ditto for nlocal+nghost - int **firstflag; // ptr to each atom's neighbor flsg - double **firstvalue; // ptr to each atom's values - class Pair *pair; // ptr to pair style that uses neighbor history + int nlocal_neigh; // nlocal at last time neigh list was built + int nall_neigh; // ditto for nlocal+nghost + int **firstflag; // ptr to each atom's neighbor flsg + double **firstvalue; // ptr to each atom's values + class Pair *pair; // ptr to pair style that uses neighbor history FixNeighHistory(class LAMMPS *, int, char **); ~FixNeighHistory(); @@ -60,44 +60,42 @@ class FixNeighHistory : public Fix { int maxsize_restart(); protected: - int newton_pair; // same as force setting - int dnum,dnumbytes; // dnum = # of values per neighbor - int onesided; // 1 for line/tri history, else 0 + int newton_pair; // same as force setting + int dnum, dnumbytes; // dnum = # of values per neighbor + int onesided; // 1 for line/tri history, else 0 - int maxatom; // max size of firstflag and firstvalue - int commflag; // mode of reverse comm to get ghost info + int maxatom; // max size of firstflag and firstvalue + int commflag; // mode of reverse comm to get ghost info double *zeroes; // per-atom data structures // partners = flagged neighbors of an atom - int *npartner; // # of partners of each atom - tagint **partner; // global atom IDs for the partners - double **valuepartner; // values for the partners - int maxpartner; // max # of partners for any of my atoms + int *npartner; // # of partners of each atom + tagint **partner; // global atom IDs for the partners + double **valuepartner; // values for the partners + int maxpartner; // max # of partners for any of my atoms // per-atom data structs pointed to by partner & valuepartner - int pgsize,oneatom; // copy of settings in Neighbor - MyPage *ipage_atom; // pages of partner atom IDs - MyPage *dpage_atom; // pages of partner values + int pgsize, oneatom; // copy of settings in Neighbor + MyPage *ipage_atom; // pages of partner atom IDs + MyPage *dpage_atom; // pages of partner values // per-neighbor data structs pointed to by firstflag & firstvalue - MyPage *ipage_neigh; // pages of local atom indices - MyPage *dpage_neigh; // pages of partner values + MyPage *ipage_neigh; // pages of local atom indices + MyPage *dpage_neigh; // pages of partner values virtual void pre_exchange_onesided(); virtual void pre_exchange_newton(); virtual void pre_exchange_no_newton(); void allocate_pages(); - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nh.h b/src/fix_nh.h index f784afefd8..da7c25b357 100644 --- a/src/fix_nh.h +++ b/src/fix_nh.h @@ -14,7 +14,7 @@ #ifndef LMP_FIX_NH_H #define LMP_FIX_NH_H -#include "fix.h" // IWYU pragma: export +#include "fix.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -33,104 +33,104 @@ class FixNH : public Fix { double compute_scalar(); virtual double compute_vector(int); void write_restart(FILE *); - virtual int pack_restart_data(double *); // pack restart data + virtual int pack_restart_data(double *); // pack restart data virtual void restart(char *); int modify_param(int, char **); void reset_target(double); void reset_dt(); - virtual void *extract(const char*,int &); + virtual void *extract(const char *, int &); double memory_usage(); protected: - int dimension,which; - double dtv,dtf,dthalf,dt4,dt8,dto; - double boltz,nktv2p,tdof; - double vol0; // reference volume - double t0; // reference temperature - // used for barostat mass - double t_start,t_stop; - double t_current,t_target,ke_target; + int dimension, which; + double dtv, dtf, dthalf, dt4, dt8, dto; + double boltz, nktv2p, tdof; + double vol0; // reference volume + double t0; // reference temperature + // used for barostat mass + double t_start, t_stop; + double t_current, t_target, ke_target; double t_freq; - int tstat_flag; // 1 if control T - int pstat_flag; // 1 if control P + int tstat_flag; // 1 if control T + int pstat_flag; // 1 if control P - int pstyle,pcouple,allremap; - int p_flag[6]; // 1 if control P on this dim, 0 if not - double p_start[6],p_stop[6]; - double p_freq[6],p_target[6]; - double omega[6],omega_dot[6]; + int pstyle, pcouple, allremap; + int p_flag[6]; // 1 if control P on this dim, 0 if not + double p_start[6], p_stop[6]; + double p_freq[6], p_target[6]; + double omega[6], omega_dot[6]; double omega_mass[6]; double p_current[6]; - double drag,tdrag_factor; // drag factor on particle thermostat - double pdrag_factor; // drag factor on barostat - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int dilate_group_bit; // mask for dilation group - int *rfix; // indices of rigid fixes - char *id_dilate; // group name to dilate - class Irregular *irregular; // for migrating atoms after box flips + double drag, tdrag_factor; // drag factor on particle thermostat + double pdrag_factor; // drag factor on barostat + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int dilate_group_bit; // mask for dilation group + int *rfix; // indices of rigid fixes + char *id_dilate; // group name to dilate + class Irregular *irregular; // for migrating atoms after box flips - double p_temp; // target temperature for barostat + double p_temp; // target temperature for barostat int p_temp_flag; int nlevels_respa; double *step_respa; - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tcomputeflag,pcomputeflag; // 1 = compute was created by fix - // 0 = created externally + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tcomputeflag, pcomputeflag; // 1 = compute was created by fix + // 0 = created externally - double *eta,*eta_dot; // chain thermostat for particles + double *eta, *eta_dot; // chain thermostat for particles double *eta_dotdot; double *eta_mass; - int mtchain; // length of chain - int mtchain_default_flag; // 1 = mtchain is default + int mtchain; // length of chain + int mtchain_default_flag; // 1 = mtchain is default - double *etap; // chain thermostat for barostat + double *etap; // chain thermostat for barostat double *etap_dot; double *etap_dotdot; double *etap_mass; - int mpchain; // length of chain + int mpchain; // length of chain - int mtk_flag; // 0 if using Hoover barostat - int pdim; // number of barostatted dims - double p_freq_max; // maximum barostat frequency + int mtk_flag; // 0 if using Hoover barostat + int pdim; // number of barostatted dims + double p_freq_max; // maximum barostat frequency - double p_hydro; // hydrostatic target pressure + double p_hydro; // hydrostatic target pressure - int nc_tchain,nc_pchain; + int nc_tchain, nc_pchain; double factor_eta; - double sigma[6]; // scaled target stress - double fdev[6]; // deviatoric force on barostat - int deviatoric_flag; // 0 if target stress tensor is hydrostatic - double h0_inv[6]; // h_inv of reference (zero strain) box - int nreset_h0; // interval for resetting h0 + double sigma[6]; // scaled target stress + double fdev[6]; // deviatoric force on barostat + int deviatoric_flag; // 0 if target stress tensor is hydrostatic + double h0_inv[6]; // h_inv of reference (zero strain) box + int nreset_h0; // interval for resetting h0 - double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections + double mtk_term1, mtk_term2; // Martyna-Tobias-Klein corrections - int eta_mass_flag; // 1 if eta_mass updated, 0 if not. - int omega_mass_flag; // 1 if omega_mass updated, 0 if not. - int etap_mass_flag; // 1 if etap_mass updated, 0 if not. - int dipole_flag; // 1 if dipole is updated, 0 if not. - int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not + int eta_mass_flag; // 1 if eta_mass updated, 0 if not. + int omega_mass_flag; // 1 if omega_mass updated, 0 if not. + int etap_mass_flag; // 1 if etap_mass updated, 0 if not. + int dipole_flag; // 1 if dipole is updated, 0 if not. + int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not - int scaleyz; // 1 if yz scaled with lz - int scalexz; // 1 if xz scaled with lz - int scalexy; // 1 if xy scaled with ly - int flipflag; // 1 if box flips are invoked as needed + int scaleyz; // 1 if yz scaled with lz + int scalexz; // 1 if xz scaled with lz + int scalexy; // 1 if xy scaled with ly + int flipflag; // 1 if box flips are invoked as needed - int pre_exchange_flag; // set if pre_exchange needed for box flips + int pre_exchange_flag; // set if pre_exchange needed for box flips - double fixedpoint[3]; // location of dilation fixed-point + double fixedpoint[3]; // location of dilation fixed-point void couple(); virtual void remap(); void nhc_temp_integrate(); void nhc_press_integrate(); - virtual void nve_x(); // may be overwritten by child classes + virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); virtual void nh_v_press(); virtual void nh_v_temp(); @@ -144,7 +144,7 @@ class FixNH : public Fix { void nh_omega_dot(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_nh_sphere.h b/src/fix_nh_sphere.h index a4710f2691..0aa5d7fd9f 100644 --- a/src/fix_nh_sphere.h +++ b/src/fix_nh_sphere.h @@ -32,7 +32,7 @@ class FixNHSphere : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_nph.h b/src/fix_nph.h index a5affbf850..0ef84a6a2f 100644 --- a/src/fix_nph.h +++ b/src/fix_nph.h @@ -30,7 +30,7 @@ class FixNPH : public FixNH { ~FixNPH() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nph_sphere.h b/src/fix_nph_sphere.h index 333efb5f70..bccdf4a209 100644 --- a/src/fix_nph_sphere.h +++ b/src/fix_nph_sphere.h @@ -30,7 +30,7 @@ class FixNPHSphere : public FixNHSphere { ~FixNPHSphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_npt.h b/src/fix_npt.h index 0c656c3c2b..5e647363e2 100644 --- a/src/fix_npt.h +++ b/src/fix_npt.h @@ -30,7 +30,7 @@ class FixNPT : public FixNH { ~FixNPT() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_npt_sphere.h b/src/fix_npt_sphere.h index 73ce35a7c1..7a3c052e08 100644 --- a/src/fix_npt_sphere.h +++ b/src/fix_npt_sphere.h @@ -30,7 +30,7 @@ class FixNPTSphere : public FixNHSphere { ~FixNPTSphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_numdiff.h b/src/fix_numdiff.h index 9641ce4946..2297331a31 100644 --- a/src/fix_numdiff.h +++ b/src/fix_numdiff.h @@ -37,20 +37,20 @@ class FixNumDiff : public Fix { void min_post_force(int); double memory_usage(); -private: + private: double delta; int maxatom; int ilevel_respa; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped char *id_pe; class Compute *pe; - double **numdiff_forces; // finite diff forces - double **temp_x; // original coords - double **temp_f; // original forces + double **numdiff_forces; // finite diff forces + double **temp_x; // original coords + double **temp_f; // original forces void calculate_forces(); void displace_atoms(int, int, int); @@ -60,7 +60,7 @@ private: void reallocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve.h b/src/fix_nve.h index 21ff64410f..6a4e3b1ce4 100644 --- a/src/fix_nve.h +++ b/src/fix_nve.h @@ -37,12 +37,12 @@ class FixNVE : public Fix { virtual void reset_dt(); protected: - double dtv,dtf; + double dtv, dtf; double *step_respa; int mass_require; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve_limit.h b/src/fix_nve_limit.h index a31ff496e3..0fcd02c14e 100644 --- a/src/fix_nve_limit.h +++ b/src/fix_nve_limit.h @@ -37,13 +37,13 @@ class FixNVELimit : public Fix { double compute_scalar(); private: - double dtv,dtf; + double dtv, dtf; double *step_respa; int ncount; - double xlimit,vlimitsq; + double xlimit, vlimitsq; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve_noforce.h b/src/fix_nve_noforce.h index b3ee02a489..75fbb3446c 100644 --- a/src/fix_nve_noforce.h +++ b/src/fix_nve_noforce.h @@ -38,7 +38,7 @@ class FixNVENoforce : public Fix { double *step_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nve_sphere.h b/src/fix_nve_sphere.h index 98d5514cd0..b197f6d1fc 100644 --- a/src/fix_nve_sphere.h +++ b/src/fix_nve_sphere.h @@ -38,7 +38,7 @@ class FixNVESphere : public FixNVE { int dlm; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nvt.h b/src/fix_nvt.h index f0e1f1ca86..2a13037b15 100644 --- a/src/fix_nvt.h +++ b/src/fix_nvt.h @@ -30,7 +30,7 @@ class FixNVT : public FixNH { ~FixNVT() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nvt_sllod.h b/src/fix_nvt_sllod.h index 0a6e2dfabb..dbd15458ca 100644 --- a/src/fix_nvt_sllod.h +++ b/src/fix_nvt_sllod.h @@ -36,7 +36,7 @@ class FixNVTSllod : public FixNH { void nh_v_temp(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_nvt_sphere.h b/src/fix_nvt_sphere.h index 443df59a6d..ed21d3e7f5 100644 --- a/src/fix_nvt_sphere.h +++ b/src/fix_nvt_sphere.h @@ -30,7 +30,7 @@ class FixNVTSphere : public FixNHSphere { ~FixNVTSphere() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_planeforce.h b/src/fix_planeforce.h index e27dbf1324..2672a23fe3 100644 --- a/src/fix_planeforce.h +++ b/src/fix_planeforce.h @@ -35,10 +35,10 @@ class FixPlaneForce : public Fix { void min_post_force(int); private: - double xdir,ydir,zdir; + double xdir, ydir, zdir; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_press_berendsen.h b/src/fix_press_berendsen.h index 9e3ea82e73..e2b8467f2e 100644 --- a/src/fix_press_berendsen.h +++ b/src/fix_press_berendsen.h @@ -35,28 +35,28 @@ class FixPressBerendsen : public Fix { int modify_param(int, char **); protected: - int dimension,which; + int dimension, which; double bulkmodulus; - int pstyle,pcouple,allremap; - int p_flag[3]; // 1 if control P on this dim, 0 if not - double p_start[3],p_stop[3]; - double p_period[3],p_target[3]; - double p_current[3],dilation[3]; + int pstyle, pcouple, allremap; + int p_flag[3]; // 1 if control P on this dim, 0 if not + double p_start[3], p_stop[3]; + double p_period[3], p_target[3]; + double p_current[3], dilation[3]; double factor[3]; - int kspace_flag; // 1 if KSpace invoked, 0 if not - int nrigid; // number of rigid fixes - int *rfix; // indices of rigid fixes + int kspace_flag; // 1 if KSpace invoked, 0 if not + int nrigid; // number of rigid fixes + int *rfix; // indices of rigid fixes - char *id_temp,*id_press; - class Compute *temperature,*pressure; - int tflag,pflag; + char *id_temp, *id_press; + class Compute *temperature, *pressure; + int tflag, pflag; void couple(); void remap(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_print.h b/src/fix_print.h index dc83d3de11..d900c2ae0a 100644 --- a/src/fix_print.h +++ b/src/fix_print.h @@ -34,16 +34,16 @@ class FixPrint : public Fix { void end_of_step(); private: - int me,screenflag; + int me, screenflag; FILE *fp; - char *text,*copy,*work; - int maxcopy,maxwork; + char *text, *copy, *work; + int maxcopy, maxwork; char *var_print; int ivar_print; bigint next_print; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_property_atom.h b/src/fix_property_atom.h index 15f96c1407..6884c548dc 100644 --- a/src/fix_property_atom.h +++ b/src/fix_property_atom.h @@ -51,15 +51,15 @@ class FixPropertyAtom : public Fix { double memory_usage(); protected: - int nvalue,border; - int molecule_flag,q_flag,rmass_flag; - int *style,*index; + int nvalue, border; + int molecule_flag, q_flag, rmass_flag; + int *style, *index; char *astyle; - int nmax_old; // length of peratom arrays the last time they grew + int nmax_old; // length of peratom arrays the last time they grew }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_read_restart.h b/src/fix_read_restart.h index acafd88800..17fce1ed26 100644 --- a/src/fix_read_restart.h +++ b/src/fix_read_restart.h @@ -40,10 +40,10 @@ class FixReadRestart : public Fix { int unpack_exchange(int, double *); private: - int nextra; // max number of extra values for any atom + int nextra; // max number of extra values for any atom }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_recenter.h b/src/fix_recenter.h index 4bac4b7757..1aedb8e7fc 100644 --- a/src/fix_recenter.h +++ b/src/fix_recenter.h @@ -35,14 +35,14 @@ class FixRecenter : public Fix { double compute_vector(int); private: - int group2bit,scaleflag; - int xflag,yflag,zflag; - int xinitflag,yinitflag,zinitflag; + int group2bit, scaleflag; + int xflag, yflag, zflag; + int xinitflag, yinitflag, zinitflag; int nlevels_respa; - double xcom,ycom,zcom,xinit,yinit,zinit,masstotal,distance,shift[3]; + double xcom, ycom, zcom, xinit, yinit, zinit, masstotal, distance, shift[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_respa.h b/src/fix_respa.h index fb7514c2b7..5c6a3087bf 100644 --- a/src/fix_respa.h +++ b/src/fix_respa.h @@ -43,12 +43,12 @@ class FixRespa : public Fix { private: int nlevels; - int store_torque; // 1 if torques should be stored in addition to forces - double ***f_level; // force at each rRESPA level - double ***t_level; // torque at each rRESPA level + int store_torque; // 1 if torques should be stored in addition to forces + double ***f_level; // force at each rRESPA level + double ***t_level; // torque at each rRESPA level }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_restrain.h b/src/fix_restrain.h index a6d2cf7627..c8c09e2df4 100644 --- a/src/fix_restrain.h +++ b/src/fix_restrain.h @@ -40,17 +40,17 @@ class FixRestrain : public Fix { private: int ilevel_respa; - int nrestrain,maxrestrain; + int nrestrain, maxrestrain; int *rstyle; int *mult; tagint **ids; - double *kstart,*kstop,*deqstart,*deqstop,*target; - double *cos_target,*sin_target; - double energy,energy_all; - double ebond,ebond_all; - double elbound,elbound_all; - double eangle,eangle_all; - double edihed,edihed_all; + double *kstart, *kstop, *deqstart, *deqstop, *target; + double *cos_target, *sin_target; + double energy, energy_all; + double ebond, ebond_all; + double elbound, elbound_all; + double eangle, eangle_all; + double edihed, edihed_all; void restrain_bond(int); void restrain_lbound(int); @@ -58,7 +58,7 @@ class FixRestrain : public Fix { void restrain_dihedral(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_setforce.h b/src/fix_setforce.h index ecbd130595..dee3adeff5 100644 --- a/src/fix_setforce.h +++ b/src/fix_setforce.h @@ -40,20 +40,20 @@ class FixSetForce : public Fix { double memory_usage(); protected: - double xvalue,yvalue,zvalue; - int varflag,iregion; - char *xstr,*ystr,*zstr; + double xvalue, yvalue, zvalue; + int varflag, iregion; + char *xstr, *ystr, *zstr; char *idregion; - int xvar,yvar,zvar,xstyle,ystyle,zstyle; - double foriginal[3],foriginal_all[3],foriginal_saved[3]; + int xvar, yvar, zvar, xstyle, ystyle, zstyle; + double foriginal[3], foriginal_all[3], foriginal_saved[3]; int force_flag; - int nlevels_respa,ilevel_respa; + int nlevels_respa, ilevel_respa; int maxatom; double **sforce; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring.h b/src/fix_spring.h index bb546ef9bd..b8c9215b56 100644 --- a/src/fix_spring.h +++ b/src/fix_spring.h @@ -39,21 +39,21 @@ class FixSpring : public Fix { double compute_vector(int); private: - double xc,yc,zc,r0; + double xc, yc, zc, r0; double k_spring; - int xflag,yflag,zflag; + int xflag, yflag, zflag; int styleflag; char *group2; - int igroup2,group2bit; - double masstotal,masstotal2; + int igroup2, group2bit; + double masstotal, masstotal2; int ilevel_respa; - double espring,ftotal[4]; + double espring, ftotal[4]; void spring_tether(); void spring_couple(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring_chunk.h b/src/fix_spring_chunk.h index 554c9c59e4..7b60f4a4f6 100644 --- a/src/fix_spring_chunk.h +++ b/src/fix_spring_chunk.h @@ -43,16 +43,16 @@ class FixSpringChunk : public Fix { int ilevel_respa; double k_spring; double esprings; - char *idchunk,*idcom; + char *idchunk, *idcom; int nchunk; - double **com0,**fcom; + double **com0, **fcom; class ComputeChunkAtom *cchunk; class ComputeCOMChunk *ccom; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring_rg.h b/src/fix_spring_rg.h index 6e6d72cac7..4c4a8e4c86 100644 --- a/src/fix_spring_rg.h +++ b/src/fix_spring_rg.h @@ -37,11 +37,11 @@ class FixSpringRG : public Fix { double compute_scalar(); private: - int ilevel_respa,rg0_flag; - double rg0,k,masstotal; + int ilevel_respa, rg0_flag; + double rg0, k, masstotal; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_spring_self.h b/src/fix_spring_self.h index 2201679491..615cfcc010 100644 --- a/src/fix_spring_self.h +++ b/src/fix_spring_self.h @@ -48,13 +48,13 @@ class FixSpringSelf : public Fix { int maxsize_restart(); private: - double k,espring; - double **xoriginal; // original coords of atoms + double k, espring; + double **xoriginal; // original coords of atoms int xflag, yflag, zflag; int ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_store.h b/src/fix_store.h index 0a80548c2c..b96c8aeb79 100644 --- a/src/fix_store.h +++ b/src/fix_store.h @@ -26,10 +26,10 @@ namespace LAMMPS_NS { class FixStore : public Fix { public: - int nrow,ncol; // size of global data array - int nvalues; // number of per-atom values - double *vstore; // vector storage for GLOBAL or PERATOM - double **astore; // array storage for GLOBAL or PERATOM + int nrow, ncol; // size of global data array + int nvalues; // number of per-atom values + double *vstore; // vector storage for GLOBAL or PERATOM + double **astore; // array storage for GLOBAL or PERATOM int disable; // 1 if operations (except grow) are currently disabled FixStore(class LAMMPS *, int, char **); @@ -52,13 +52,13 @@ class FixStore : public Fix { double memory_usage(); private: - int flavor; // GLOBAL or PERATOM - int vecflag; // 1 if ncol=1 or nvalues=1 + int flavor; // GLOBAL or PERATOM + int vecflag; // 1 if ncol=1 or nvalues=1 - double *rbuf; // restart buffer for GLOBAL vec/array + double *rbuf; // restart buffer for GLOBAL vec/array }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_store_force.h b/src/fix_store_force.h index 88a7a2666f..08f5a59235 100644 --- a/src/fix_store_force.h +++ b/src/fix_store_force.h @@ -40,10 +40,10 @@ class FixStoreForce : public Fix { private: int nlevels_respa; int nmax; - double **foriginal; // stored force on atoms + double **foriginal; // stored force on atoms }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_store_state.h b/src/fix_store_state.h index 19298cb4aa..1aebe1541a 100644 --- a/src/fix_store_state.h +++ b/src/fix_store_state.h @@ -45,19 +45,19 @@ class FixStoreState : public Fix { private: int nvalues; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; char **ids; - double **values; // archived atom properties - double *vbuf; // 1d ptr to values + double **values; // archived atom properties + double *vbuf; // 1d ptr to values int comflag; - double cm[3]; // center of mass + double cm[3]; // center of mass - int kflag,cfv_flag,firstflag; - int cfv_any; // 1 if any compute/fix/variable specified + int kflag, cfv_flag, firstflag; + int cfv_any; // 1 if any compute/fix/variable specified typedef void (FixStoreState::*FnPtrPack)(int); - FnPtrPack *pack_choice; // ptrs to pack functions + FnPtrPack *pack_choice; // ptrs to pack functions void pack_id(int); void pack_molecule(int); @@ -114,7 +114,7 @@ class FixStoreState : public Fix { void pack_tqz(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_berendsen.h b/src/fix_temp_berendsen.h index 43b733314e..833474a76f 100644 --- a/src/fix_temp_berendsen.h +++ b/src/fix_temp_berendsen.h @@ -40,9 +40,9 @@ class FixTempBerendsen : public Fix { private: int which; - double t_start,t_stop,t_period,t_target; + double t_start, t_stop, t_period, t_target; double energy; - int tstyle,tvar; + int tstyle, tvar; char *tstr; char *id_temp; @@ -50,7 +50,7 @@ class FixTempBerendsen : public Fix { int tflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_csld.h b/src/fix_temp_csld.h index 396e11a277..57b04981af 100644 --- a/src/fix_temp_csld.h +++ b/src/fix_temp_csld.h @@ -39,11 +39,11 @@ class FixTempCSLD : public Fix { virtual void *extract(const char *, int &); private: - double t_start,t_stop,t_period,t_target; + double t_start, t_stop, t_period, t_target; double **vhold; double energy; - int nmax,which; - int tstyle,tvar; + int nmax, which; + int tstyle, tvar; char *tstr; char *id_temp; @@ -53,7 +53,7 @@ class FixTempCSLD : public Fix { class RanMars *random; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_csvr.h b/src/fix_temp_csvr.h index 2528d4a84f..b62e74498e 100644 --- a/src/fix_temp_csvr.h +++ b/src/fix_temp_csvr.h @@ -39,10 +39,10 @@ class FixTempCSVR : public Fix { virtual void *extract(const char *, int &); private: - double t_start,t_stop,t_period,t_target; + double t_start, t_stop, t_period, t_target; double energy; - int nmax,which; - int tstyle,tvar; + int nmax, which; + int tstyle, tvar; char *tstr; char *id_temp; @@ -57,7 +57,7 @@ class FixTempCSVR : public Fix { double gamdev(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_temp_rescale.h b/src/fix_temp_rescale.h index 12fb6448fe..56c266810d 100644 --- a/src/fix_temp_rescale.h +++ b/src/fix_temp_rescale.h @@ -40,9 +40,9 @@ class FixTempRescale : public Fix { protected: int which; - double t_start,t_stop,t_window,t_target; - double fraction,energy,efactor; - int tstyle,tvar; + double t_start, t_stop, t_window, t_target; + double fraction, energy, efactor; + int tstyle, tvar; char *tstr; char *id_temp; @@ -50,7 +50,7 @@ class FixTempRescale : public Fix { int tflag; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_tmd.h b/src/fix_tmd.h index e7977b281b..1fa020bf1f 100644 --- a/src/fix_tmd.h +++ b/src/fix_tmd.h @@ -42,20 +42,20 @@ class FixTMD : public Fix { private: int me; - int nfileevery,compressed; + int nfileevery, compressed; bigint previous_stat; FILE *fp; - double rho_start,rho_stop,rho_old,masstotal; - double dtv,dtf; + double rho_start, rho_stop, rho_old, masstotal; + double dtv, dtf; double *step_respa; - double work_lambda,work_analytical; - double **xf,**xold; + double work_lambda, work_analytical; + double **xf, **xold; void readfile(char *); void open(char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_vector.h b/src/fix_vector.h index ae1f4696d5..035b87eeb3 100644 --- a/src/fix_vector.h +++ b/src/fix_vector.h @@ -33,22 +33,22 @@ class FixVector : public Fix { void setup(int); void end_of_step(); double compute_vector(int); - double compute_array(int,int); + double compute_array(int, int); private: int nvalues; - int *which,*argindex,*value2index; + int *which, *argindex, *value2index; char **ids; - bigint nextstep,initialstep; + bigint nextstep, initialstep; - int ncount; // # of values currently in growing vector or array - int ncountmax; // max # of values vector/array can hold + int ncount; // # of values currently in growing vector or array + int ncountmax; // max # of values vector/array can hold double *vector; double **array; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_viscous.h b/src/fix_viscous.h index 2bf9242d98..32b0bc1c9c 100644 --- a/src/fix_viscous.h +++ b/src/fix_viscous.h @@ -41,7 +41,7 @@ class FixViscous : public Fix { int ilevel_respa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall.h b/src/fix_wall.h index 680fb50eb7..5a97289ff1 100644 --- a/src/fix_wall.h +++ b/src/fix_wall.h @@ -23,7 +23,7 @@ class FixWall : public Fix { int nwall; int wallwhich[6]; double coord0[6]; - int xflag; // 1 if any wall position is a variable + int xflag; // 1 if any wall position is a variable int xstyle[6]; int xindex[6]; char *xstr[6]; @@ -45,19 +45,19 @@ class FixWall : public Fix { virtual void wall_particle(int, int, double) = 0; protected: - double epsilon[6],sigma[6],alpha[6],cutoff[6]; - double ewall[7],ewall_all[7]; - double xscale,yscale,zscale; - int estyle[6],sstyle[6],astyle[6],wstyle[6]; - int eindex[6],sindex[6]; - char *estr[6],*sstr[6],*astr[6]; - int varflag; // 1 if any wall position,epsilon,sigma is a var - int eflag; // per-wall flag for energy summation + double epsilon[6], sigma[6], alpha[6], cutoff[6]; + double ewall[7], ewall_all[7]; + double xscale, yscale, zscale; + int estyle[6], sstyle[6], astyle[6], wstyle[6]; + int eindex[6], sindex[6]; + char *estr[6], *sstr[6], *astr[6]; + int varflag; // 1 if any wall position,epsilon,sigma is a var + int eflag; // per-wall flag for energy summation int ilevel_respa; int fldflag; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/fix_wall_harmonic.h b/src/fix_wall_harmonic.h index 173bf57a6a..0d8eb61aef 100644 --- a/src/fix_wall_harmonic.h +++ b/src/fix_wall_harmonic.h @@ -31,7 +31,7 @@ class FixWallHarmonic : public FixWall { void wall_particle(int, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_lj1043.h b/src/fix_wall_lj1043.h index d3d060d5de..be1adf45f0 100644 --- a/src/fix_wall_lj1043.h +++ b/src/fix_wall_lj1043.h @@ -31,12 +31,10 @@ class FixWallLJ1043 : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],coeff5[6],coeff6[6], - coeff7[6],offset[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], coeff5[6], coeff6[6], coeff7[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif - diff --git a/src/fix_wall_lj126.h b/src/fix_wall_lj126.h index 19ce87f028..fae77ea418 100644 --- a/src/fix_wall_lj126.h +++ b/src/fix_wall_lj126.h @@ -31,10 +31,10 @@ class FixWallLJ126 : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_lj93.h b/src/fix_wall_lj93.h index cba696464d..4666a6c49c 100644 --- a/src/fix_wall_lj93.h +++ b/src/fix_wall_lj93.h @@ -31,10 +31,10 @@ class FixWallLJ93 : public FixWall { virtual void wall_particle(int, int, double); protected: - double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6]; + double coeff1[6], coeff2[6], coeff3[6], coeff4[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_morse.h b/src/fix_wall_morse.h index fab19848c5..92c8f0d58f 100644 --- a/src/fix_wall_morse.h +++ b/src/fix_wall_morse.h @@ -31,10 +31,10 @@ class FixWallMorse : public FixWall { void wall_particle(int, int, double); private: - double coeff1[6],offset[6]; + double coeff1[6], offset[6]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_reflect.h b/src/fix_wall_reflect.h index 82ca69d2c6..38ee699ad6 100644 --- a/src/fix_wall_reflect.h +++ b/src/fix_wall_reflect.h @@ -26,8 +26,8 @@ namespace LAMMPS_NS { class FixWallReflect : public Fix { public: - enum{XLO=0,XHI=1,YLO=2,YHI=3,ZLO=4,ZHI=5}; - enum{NONE=0,EDGE,CONSTANT,VARIABLE}; + enum { XLO = 0, XHI = 1, YLO = 2, YHI = 3, ZLO = 4, ZHI = 5 }; + enum { NONE = 0, EDGE, CONSTANT, VARIABLE }; FixWallReflect(class LAMMPS *, int, char **); virtual ~FixWallReflect(); @@ -37,17 +37,17 @@ class FixWallReflect : public Fix { protected: int nwall; - int wallwhich[6],wallstyle[6]; + int wallwhich[6], wallstyle[6]; double coord0[6]; char *varstr[6]; int varindex[6]; int varflag; - double xscale,yscale,zscale; + double xscale, yscale, zscale; virtual void wall_particle(int m, int which, double coord); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fix_wall_region.h b/src/fix_wall_region.h index 45a8e2d401..85bda79805 100644 --- a/src/fix_wall_region.h +++ b/src/fix_wall_region.h @@ -39,17 +39,17 @@ class FixWallRegion : public Fix { double compute_vector(int); private: - int style,iregion; - double epsilon,sigma,cutoff; + int style, iregion; + double epsilon, sigma, cutoff; double alpha; int eflag; - double ewall[4],ewall_all[4]; + double ewall[4], ewall_all[4]; int ilevel_respa; char *idregion; - double coeff1,coeff2,coeff3,coeff4,offset; - double coeff5,coeff6,coeff7; - double eng,fwall; + double coeff1, coeff2, coeff3, coeff4, offset; + double coeff5, coeff6, coeff7; + double eng, fwall; void lj93(double); void lj126(double); @@ -59,7 +59,7 @@ class FixWallRegion : public Fix { void harmonic(double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/fmt/.clang-format b/src/fmt/.clang-format new file mode 100644 index 0000000000..9d159247d5 --- /dev/null +++ b/src/fmt/.clang-format @@ -0,0 +1,2 @@ +DisableFormat: true +SortIncludes: false diff --git a/src/force.h b/src/force.h index e2ad12be97..cd0b3bce6b 100644 --- a/src/force.h +++ b/src/force.h @@ -19,19 +19,16 @@ #include namespace LAMMPS_NS { - class Angle; - class Bond; - class Dihedral; - class Improper; - class KSpace; - class Pair; +class Angle; +class Bond; +class Dihedral; +class Improper; +class KSpace; +class Pair; -enum { - ENERGY_NONE = 0x00, - ENERGY_GLOBAL = 0x01, - ENERGY_ATOM = 0x02 -}; +enum { ENERGY_NONE = 0x00, ENERGY_GLOBAL = 0x01, ENERGY_ATOM = 0x02 }; +// clang-format off enum { VIRIAL_NONE = 0x00, VIRIAL_PAIR = 0x01, @@ -39,39 +36,36 @@ enum { VIRIAL_ATOM = 0x04, VIRIAL_CENTROID = 0x08 }; +// clang-format on -enum { - CENTROID_SAME = 0, - CENTROID_AVAIL = 1, - CENTROID_NOTAVAIL = 2 -}; +enum { CENTROID_SAME = 0, CENTROID_AVAIL = 1, CENTROID_NOTAVAIL = 2 }; class Force : protected Pointers { public: - double boltz; // Boltzmann constant (eng/degree-K) - double hplanck; // Planck's constant (energy-time) - double mvv2e; // conversion of mv^2 to energy - double ftm2v; // conversion of ft/m to velocity - double mv2d; // conversion of mass/volume to density - double nktv2p; // conversion of NkT/V to pressure - double qqr2e; // conversion of q^2/r to energy - double qe2f; // conversion of qE to force - double vxmu2f; // conversion of vx dynamic-visc to force - double xxt2kmu; // conversion of xx/t to kinematic-visc - double dielectric; // dielectric constant - double qqrd2e; // q^2/r to energy w/ dielectric constant - double e_mass; // electron mass - double hhmrr2e; // conversion of (hbar)^2/(mr^2) to energy - double mvh2r; // conversion of mv/hbar to distance - // hbar = h/(2*pi) - double angstrom; // 1 angstrom in native units - double femtosecond; // 1 femtosecond in native units - double qelectron; // 1 electron charge abs() in native units + double boltz; // Boltzmann constant (eng/degree-K) + double hplanck; // Planck's constant (energy-time) + double mvv2e; // conversion of mv^2 to energy + double ftm2v; // conversion of ft/m to velocity + double mv2d; // conversion of mass/volume to density + double nktv2p; // conversion of NkT/V to pressure + double qqr2e; // conversion of q^2/r to energy + double qe2f; // conversion of qE to force + double vxmu2f; // conversion of vx dynamic-visc to force + double xxt2kmu; // conversion of xx/t to kinematic-visc + double dielectric; // dielectric constant + double qqrd2e; // q^2/r to energy w/ dielectric constant + double e_mass; // electron mass + double hhmrr2e; // conversion of (hbar)^2/(mr^2) to energy + double mvh2r; // conversion of mv/hbar to distance + // hbar = h/(2*pi) + double angstrom; // 1 angstrom in native units + double femtosecond; // 1 femtosecond in native units + double qelectron; // 1 electron charge abs() in native units - double qqr2e_lammps_real; // different versions of this constant - double qqr2e_charmm_real; // used by new CHARMM pair styles + double qqr2e_lammps_real; // different versions of this constant + double qqr2e_charmm_real; // used by new CHARMM pair styles - int newton,newton_pair,newton_bond; // Newton's 3rd law settings + int newton, newton_pair, newton_bond; // Newton's 3rd law settings Pair *pair; char *pair_style; @@ -99,12 +93,12 @@ class Force : protected Pointers { typedef Improper *(*ImproperCreator)(LAMMPS *); typedef KSpace *(*KSpaceCreator)(LAMMPS *); - typedef std::map PairCreatorMap; - typedef std::map BondCreatorMap; - typedef std::map AngleCreatorMap; - typedef std::map DihedralCreatorMap; - typedef std::map ImproperCreatorMap; - typedef std::map KSpaceCreatorMap; + typedef std::map PairCreatorMap; + typedef std::map BondCreatorMap; + typedef std::map AngleCreatorMap; + typedef std::map DihedralCreatorMap; + typedef std::map ImproperCreatorMap; + typedef std::map KSpaceCreatorMap; PairCreatorMap *pair_map; BondCreatorMap *bond_map; @@ -113,7 +107,7 @@ class Force : protected Pointers { ImproperCreatorMap *improper_map; KSpaceCreatorMap *kspace_map; - // index [0] is not used in these arrays + // index [0] is not used in these arrays double special_lj[4]; // 1-2, 1-3, 1-4 prefactors for LJ double special_coul[4]; // 1-2, 1-3, 1-4 prefactors for Coulombics int special_angle; // 0 if defined angles are ignored @@ -129,7 +123,7 @@ class Force : protected Pointers { void create_pair(const std::string &, int); Pair *new_pair(const std::string &, int, int &); - Pair *pair_match(const std::string &, int, int nsub=0); + Pair *pair_match(const std::string &, int, int nsub = 0); char *pair_match_ptr(Pair *); void create_bond(const std::string &, int); @@ -167,7 +161,7 @@ class Force : protected Pointers { template static KSpace *kspace_creator(LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/group.h b/src/group.h index 17f9b4d564..9197169a0c 100644 --- a/src/group.h +++ b/src/group.h @@ -22,52 +22,52 @@ namespace LAMMPS_NS { class Group : protected Pointers { public: - int ngroup; // # of defined groups - char **names; // name of each group - int *bitmask; // one-bit mask for each group - int *inversemask; // inverse mask for each group - int *dynamic; // 1 if dynamic, 0 if not + int ngroup; // # of defined groups + char **names; // name of each group + int *bitmask; // one-bit mask for each group + int *inversemask; // inverse mask for each group + int *dynamic; // 1 if dynamic, 0 if not Group(class LAMMPS *); ~Group(); - void assign(int, char **); // assign atoms to a group - void assign(const std::string &); // convenience function - void create(const std::string &, int *); // add flagged atoms to a group - int find(const std::string &); // lookup name in list of groups - int find_or_create(const char *); // lookup name or create new group + void assign(int, char **); // assign atoms to a group + void assign(const std::string &); // convenience function + void create(const std::string &, int *); // add flagged atoms to a group + int find(const std::string &); // lookup name in list of groups + int find_or_create(const char *); // lookup name or create new group void write_restart(FILE *); void read_restart(FILE *); - bigint count_all(); // count atoms in group all - bigint count(int); // count atoms in group - bigint count(int,int); // count atoms in group & region - double mass(int); // total mass of atoms in group - double mass(int,int); - double charge(int); // total charge of atoms in group - double charge(int,int); - void bounds(int, double *); // bounds of atoms in group + bigint count_all(); // count atoms in group all + bigint count(int); // count atoms in group + bigint count(int, int); // count atoms in group & region + double mass(int); // total mass of atoms in group + double mass(int, int); + double charge(int); // total charge of atoms in group + double charge(int, int); + void bounds(int, double *); // bounds of atoms in group void bounds(int, double *, int); - void xcm(int, double, double *); // center-of-mass coords of group + void xcm(int, double, double *); // center-of-mass coords of group void xcm(int, double, double *, int); - void vcm(int, double, double *); // center-of-mass velocity of group + void vcm(int, double, double *); // center-of-mass velocity of group void vcm(int, double, double *, int); - void fcm(int, double *); // total force on group + void fcm(int, double *); // total force on group void fcm(int, double *, int); - double ke(int); // kinetic energy of group + double ke(int); // kinetic energy of group double ke(int, int); - double gyration(int, double, double *); // radius-of-gyration of group + double gyration(int, double, double *); // radius-of-gyration of group double gyration(int, double, double *, int); void angmom(int, double *, double *); // angular momentum of group void angmom(int, double *, double *, int); void torque(int, double *, double *); // torque on group void torque(int, double *, double *, int); - void inertia(int, double *, double [3][3]); // inertia tensor - void inertia(int, double *, double [3][3], int); - void omega(double *, double [3][3], double *); // angular velocity + void inertia(int, double *, double[3][3]); // inertia tensor + void inertia(int, double *, double[3][3], int); + void omega(double *, double[3][3], double *); // angular velocity private: int me; - std::map *hash; + std::map *hash; int find_unused(); void add_molecules(int, int); @@ -78,7 +78,7 @@ class Group : protected Pointers { int molbit; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/hashlittle.h b/src/hashlittle.h index aafde922b7..95f8da2170 100644 --- a/src/hashlittle.h +++ b/src/hashlittle.h @@ -9,6 +9,6 @@ #include namespace LAMMPS_NS { - uint32_t hashlittle(const void *key, size_t length, uint32_t); +uint32_t hashlittle(const void *key, size_t length, uint32_t); } #endif diff --git a/src/image.h b/src/image.h index 5a08430fc9..eda9641bb5 100644 --- a/src/image.h +++ b/src/image.h @@ -14,25 +14,25 @@ #ifndef LMP_IMAGE_H #define LMP_IMAGE_H -#include #include "pointers.h" +#include namespace LAMMPS_NS { class Image : protected Pointers { public: - int width,height; // size of image - double theta,phi; // view image from theta,phi - double xctr,yctr,zctr; // center of image in user coords - double up[3]; // up direction in image - double zoom; // zoom factor - double persp; // perspective factor - double shiny; // shininess of objects - int ssao; // SSAO on or off - int seed; // RN seed for SSAO - double ssaoint; // strength of shading from 0 to 1 - double *boxcolor; // color to draw box outline with - int background[3]; // RGB values of background + int width, height; // size of image + double theta, phi; // view image from theta,phi + double xctr, yctr, zctr; // center of image in user coords + double up[3]; // up direction in image + double zoom; // zoom factor + double persp; // perspective factor + double shiny; // shininess of objects + int ssao; // SSAO on or off + int seed; // RN seed for SSAO + double ssaoint; // strength of shading from 0 to 1 + double *boxcolor; // color to draw box outline with + int background[3]; // RGB values of background Image(class LAMMPS *, int); ~Image(); @@ -59,23 +59,23 @@ class Image : protected Pointers { int addcolor(char *, double, double, double); double *element2color(char *); double element2diam(char *); - double *color2rgb(const char *, int index=0); + double *color2rgb(const char *, int index = 0); int default_colors(); private: - int me,nprocs; + int me, nprocs; int npixels; class ColorMap **maps; int nmap; - double *depthBuffer,*surfaceBuffer; - double *depthcopy,*surfacecopy; - unsigned char *imageBuffer,*rgbcopy,*writeBuffer; + double *depthBuffer, *surfaceBuffer; + double *depthcopy, *surfacecopy; + unsigned char *imageBuffer, *rgbcopy, *writeBuffer; // MPI_Gatherv - int *recvcounts,*displs; + int *recvcounts, *displs; // constant view params @@ -105,8 +105,8 @@ class Image : protected Pointers { double zdist; double tanPerPixel; - double camDir[3],camUp[3],camRight[4],camPos[3]; - double keyLightDir[3],fillLightDir[3],backLightDir[3]; + double camDir[3], camUp[3], camRight[4], camPos[3]; + double keyLightDir[3], fillLightDir[3], backLightDir[3]; double keyHalfDir[3]; // color values @@ -121,20 +121,24 @@ class Image : protected Pointers { // internal methods - void draw_pixel(int, int, double, double *, double*); + void draw_pixel(int, int, double, double *, double *); void compute_SSAO(); // inline functions - inline double saturate(double v) { - if (v < 0.0) return 0.0; - else if (v > 1.0) return 1.0; - else return v; + inline double saturate(double v) + { + if (v < 0.0) + return 0.0; + else if (v > 1.0) + return 1.0; + else + return v; } - inline double distance(double* a, double* b) { - return sqrt((a[0] - b[0]) * (a[0] - b[0]) + - (a[1] - b[1]) * (a[1] - b[1]) + + inline double distance(double *a, double *b) + { + return sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]) + (a[2] - b[2]) * (a[2] - b[2])); } }; @@ -143,9 +147,9 @@ class Image : protected Pointers { class ColorMap : protected Pointers { public: - int dynamic; // 0/1 if lo/hi bounds are static/dynamic + int dynamic; // 0/1 if lo/hi bounds are static/dynamic - ColorMap(class LAMMPS *, class Image*); + ColorMap(class LAMMPS *, class Image *); ~ColorMap(); int reset(int, char **); int minmax(double, double); @@ -153,24 +157,24 @@ class ColorMap : protected Pointers { private: class Image *image; // caller with color2rgb() method - int mstyle,mrange; // 2-letter style/range of color map - int mlo,mhi; // bounds = NUMERIC or MINVALUE or MAXVALUE - double mlovalue,mhivalue; // user bounds if NUMERIC - double locurrent,hicurrent; // current bounds for this snapshot - double mbinsize,mbinsizeinv; // bin size for sequential color map + int mstyle, mrange; // 2-letter style/range of color map + int mlo, mhi; // bounds = NUMERIC or MINVALUE or MAXVALUE + double mlovalue, mhivalue; // user bounds if NUMERIC + double locurrent, hicurrent; // current bounds for this snapshot + double mbinsize, mbinsizeinv; // bin size for sequential color map double interpolate[3]; // local storage for returned RGB color struct MapEntry { - int single,lo,hi; // NUMERIC or MINVALUE or MAXVALUE - double svalue,lvalue,hvalue; // actual value - double *color; // RGB values + int single, lo, hi; // NUMERIC or MINVALUE or MAXVALUE + double svalue, lvalue, hvalue; // actual value + double *color; // RGB values }; MapEntry *mentry; int nentry; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance.h b/src/imbalance.h index cd6ad81389..d05b8b4888 100644 --- a/src/imbalance.h +++ b/src/imbalance.h @@ -14,7 +14,7 @@ #ifndef LMP_IMBALANCE_H #define LMP_IMBALANCE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #include namespace LAMMPS_NS { @@ -22,12 +22,12 @@ namespace LAMMPS_NS { class Imbalance : protected Pointers { public: Imbalance(class LAMMPS *); - virtual ~Imbalance() {}; + virtual ~Imbalance(){}; // parse options. return number of arguments consumed (required) virtual int options(int, char **) = 0; // reinitialize internal data (needed for fix balance) (optional) - virtual void init(int) {}; + virtual void init(int){}; // compute and apply weight factors to local atom array (required) virtual void compute(double *) = 0; // print information about the state of this imbalance compute (required) @@ -40,6 +40,6 @@ class Imbalance : protected Pointers { //Imbalance &operator=(const Imbalance &) {return *this;}; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_group.h b/src/imbalance_group.h index 2eec6eb494..029cacaa76 100644 --- a/src/imbalance_group.h +++ b/src/imbalance_group.h @@ -31,12 +31,12 @@ class ImbalanceGroup : public Imbalance { virtual std::string info() override; private: - int num; // number of groups with weights - int *id; // numerical IDs of groups - double *factor; // group weight factors + int num; // number of groups with weights + int *id; // numerical IDs of groups + double *factor; // group weight factors }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_neigh.h b/src/imbalance_neigh.h index 40dc090030..51e2706a1a 100644 --- a/src/imbalance_neigh.h +++ b/src/imbalance_neigh.h @@ -32,11 +32,11 @@ class ImbalanceNeigh : public Imbalance { virtual std::string info() override; private: - double factor; // weight factor for neighbor imbalance - int did_warn; // 1 if warned about no suitable neighbor list + double factor; // weight factor for neighbor imbalance + int did_warn; // 1 if warned about no suitable neighbor list }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_store.h b/src/imbalance_store.h index 2328c61966..1c7949a2f4 100644 --- a/src/imbalance_store.h +++ b/src/imbalance_store.h @@ -32,10 +32,10 @@ class ImbalanceStore : public Imbalance { virtual std::string info() override; private: - char *name; // property name + char *name; // property name }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_time.h b/src/imbalance_time.h index 3617bf1abd..9ba30a2f72 100644 --- a/src/imbalance_time.h +++ b/src/imbalance_time.h @@ -34,11 +34,11 @@ class ImbalanceTime : public Imbalance { virtual std::string info() override; private: - double factor; // weight factor for time imbalance - double last; // combined wall time from last call + double factor; // weight factor for time imbalance + double last; // combined wall time from last call }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/imbalance_var.h b/src/imbalance_var.h index 6c852f00d2..edfbb714e0 100644 --- a/src/imbalance_var.h +++ b/src/imbalance_var.h @@ -34,11 +34,11 @@ class ImbalanceVar : public Imbalance { virtual std::string info() override; private: - char *name; // variable name - int id; // variable index + char *name; // variable name + int id; // variable index }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/improper.h b/src/improper.h index 8be2516eac..c7823fb971 100644 --- a/src/improper.h +++ b/src/improper.h @@ -14,31 +14,32 @@ #ifndef LMP_IMPROPER_H #define LMP_IMPROPER_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Improper : protected Pointers { friend class ThrOMP; friend class FixOMP; + public: int allocated; int *setflag; - int writedata; // 1 if writes coeffs to data file - double energy; // accumulated energies - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double **cvatom; // accumulated per-atom centroid virial + int writedata; // 1 if writes coeffs to data file + double energy; // accumulated energies + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double **cvatom; // accumulated per-atom centroid virial - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; Improper(class LAMMPS *); @@ -50,31 +51,34 @@ class Improper : protected Pointers { virtual void coeff(int, char **) = 0; virtual void write_restart(FILE *) = 0; virtual void read_restart(FILE *) = 0; - virtual void write_restart_settings(FILE *) {}; - virtual void read_restart_settings(FILE *) {}; + virtual void write_restart_settings(FILE *){}; + virtual void read_restart_settings(FILE *){}; virtual void write_data(FILE *) {} virtual double memory_usage(); protected: - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag int evflag; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; - int maxeatom,maxvatom,maxcvatom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; + int maxeatom, maxvatom, maxcvatom; - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = cvflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = + cvflag_atom = 0; } void ev_setup(int, int, int alloc = 1); - void ev_tally(int, int, int, int, int, int, double, - double *, double *, double *, double, double, double, - double, double, double, double, double, double); + void ev_tally(int, int, int, int, int, int, double, double *, double *, double *, double, double, + double, double, double, double, double, double, double); void problem(const char *, int, int, int, int, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/improper_deprecated.h b/src/improper_deprecated.h index 23b2f1b929..0be868e4f0 100644 --- a/src/improper_deprecated.h +++ b/src/improper_deprecated.h @@ -36,7 +36,7 @@ class ImproperDeprecated : public Improper { virtual void read_restart(FILE *) {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/improper_hybrid.h b/src/improper_hybrid.h index ce33d1e0fa..c7d1f729be 100644 --- a/src/improper_hybrid.h +++ b/src/improper_hybrid.h @@ -26,9 +26,9 @@ namespace LAMMPS_NS { class ImproperHybrid : public Improper { public: - int nstyles; // # of different improper styles - Improper **styles; // class list for each Improper style - char **keywords; // keyword for each improper style + int nstyles; // # of different improper styles + Improper **styles; // class list for each Improper style + char **keywords; // keyword for each improper style ImproperHybrid(class LAMMPS *); ~ImproperHybrid(); @@ -41,16 +41,16 @@ class ImproperHybrid : public Improper { double memory_usage(); private: - int *map; // which style each improper type points to + int *map; // which style each improper type points to - int *nimproperlist; // # of impropers in sub-style improperlists - int *maximproper; // max # of impropers sub-style lists can store - int ***improperlist; // improperlist for each sub-style + int *nimproperlist; // # of impropers in sub-style improperlists + int *maximproper; // max # of impropers sub-style lists can store + int ***improperlist; // improperlist for each sub-style void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/improper_zero.h b/src/improper_zero.h index 9ee74a67a3..ab9111d50d 100644 --- a/src/improper_zero.h +++ b/src/improper_zero.h @@ -42,7 +42,7 @@ class ImproperZero : public Improper { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/info.h b/src/info.h index b672e04b7e..35cebc0764 100644 --- a/src/info.h +++ b/src/info.h @@ -28,7 +28,7 @@ namespace LAMMPS_NS { class Info : public Command { public: - Info(class LAMMPS *lmp) : Command(lmp) {}; + Info(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); bool is_active(const char *, const char *); @@ -44,8 +44,7 @@ class Info : public Command { static bool has_ffmpeg_support(); static bool has_exceptions(); static bool has_package(const std::string &); - static bool has_accelerator_feature(const std::string &, - const std::string &, + static bool has_accelerator_feature(const std::string &, const std::string &, const std::string &); static bool has_gpu_device(); static std::string get_gpu_device_info(); @@ -56,31 +55,31 @@ class Info : public Command { static std::string get_mpi_vendor(); static std::string get_mpi_info(int &, int &); static std::string get_cxx_info(); - static std::string get_accelerator_info(const std::string &pkg=""); + static std::string get_accelerator_info(const std::string &pkg = ""); void get_memory_info(double *); char **get_variable_names(int &num); -private: - void available_styles(FILE * out, int flags); + private: + void available_styles(FILE *out, int flags); - void atom_styles(FILE * out); - void integrate_styles(FILE * out); - void minimize_styles(FILE * out); - void pair_styles(FILE * out); - void bond_styles(FILE * out); - void angle_styles(FILE * out); - void dihedral_styles(FILE * out); - void improper_styles(FILE * out); - void kspace_styles(FILE * out); - void fix_styles(FILE * out); - void compute_styles(FILE * out); - void region_styles(FILE * out); - void dump_styles(FILE * out); - void command_styles(FILE * out); + void atom_styles(FILE *out); + void integrate_styles(FILE *out); + void minimize_styles(FILE *out); + void pair_styles(FILE *out); + void bond_styles(FILE *out); + void angle_styles(FILE *out); + void dihedral_styles(FILE *out); + void improper_styles(FILE *out); + void kspace_styles(FILE *out); + void fix_styles(FILE *out); + void compute_styles(FILE *out); + void region_styles(FILE *out); + void dump_styles(FILE *out); + void command_styles(FILE *out); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/input.h b/src/input.h index 59369ac7cf..9d5d4efa4d 100644 --- a/src/input.h +++ b/src/input.h @@ -19,7 +19,7 @@ #include namespace LAMMPS_NS { - class Command; +class Command; class Input : protected Pointers { friend class Info; @@ -34,47 +34,47 @@ class Input : protected Pointers { Input(class LAMMPS *, int, char **); ~Input(); - void file(); // process all input - void file(const char *); // process an input script - char *one(const std::string&); // process a single command + void file(); // process all input + void file(const char *); // process an input script + char *one(const std::string &); // process a single command void substitute(char *&, char *&, int &, int &, int); - // substitute for variables in a string - void write_echo(const std::string &); // send text to active echo file pointers + // substitute for variables in a string + void write_echo(const std::string &); // send text to active echo file pointers protected: - char *command; // ptr to current command - int echo_screen; // 0 = no, 1 = yes - int echo_log; // 0 = no, 1 = yes + char *command; // ptr to current command + int echo_screen; // 0 = no, 1 = yes + int echo_log; // 0 = no, 1 = yes private: - int me; // proc ID - int maxarg; // max # of args in arg - char *line,*copy,*work; // input line & copy and work string - int maxline,maxcopy,maxwork; // max lengths of char strings - int nfile,maxfile; // current # and max # of open input files - int label_active; // 0 = no label, 1 = looking for label - char *labelstr; // label string being looked for - int jump_skip; // 1 if skipping next jump, 0 otherwise - bool utf8_warn; // true if need to warn about UTF-8 chars + int me; // proc ID + int maxarg; // max # of args in arg + char *line, *copy, *work; // input line & copy and work string + int maxline, maxcopy, maxwork; // max lengths of char strings + int nfile, maxfile; // current # and max # of open input files + int label_active; // 0 = no label, 1 = looking for label + char *labelstr; // label string being looked for + int jump_skip; // 1 if skipping next jump, 0 otherwise + bool utf8_warn; // true if need to warn about UTF-8 chars - FILE **infiles; // list of open input files + FILE **infiles; // list of open input files public: - typedef Command * (*CommandCreator)(LAMMPS *); - typedef std::map CommandCreatorMap; + typedef Command *(*CommandCreator)(LAMMPS *); + typedef std::map CommandCreatorMap; CommandCreatorMap *command_map; protected: template static Command *command_creator(LAMMPS *); private: - void parse(); // parse an input text line - char *nextword(char *, char **); // find next word in string with quotes - int numtriple(char *); // count number of triple quotes - void reallocate(char *&, int &, int); // reallocate a char string - int execute_command(); // execute a single command + void parse(); // parse an input text line + char *nextword(char *, char **); // find next word in string with quotes + int numtriple(char *); // count number of triple quotes + void reallocate(char *&, int &, int); // reallocate a char string + int execute_command(); // execute a single command - void clear(); // input script commands + void clear(); // input script commands void echo(); void ifthenelse(); void include(); @@ -90,7 +90,7 @@ class Input : protected Pointers { void shell(); void variable_command(); - void angle_coeff(); // LAMMPS commands + void angle_coeff(); // LAMMPS commands void angle_style(); void atom_modify(); void atom_style(); @@ -147,7 +147,7 @@ class Input : protected Pointers { void units(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/integrate.h b/src/integrate.h index eb4e3107f9..1b0e08b504 100644 --- a/src/integrate.h +++ b/src/integrate.h @@ -28,29 +28,29 @@ class Integrate : protected Pointers { virtual void run(int) = 0; virtual void cleanup() {} virtual void reset_dt() {} - virtual double memory_usage() {return 0;} + virtual double memory_usage() { return 0; } protected: - int eflag,vflag; // flags for energy/virial computation - int virial_style; // compute virial explicitly or implicitly - int external_force_clear; // clear forces locally or externally + int eflag, vflag; // flags for energy/virial computation + int virial_style; // compute virial explicitly or implicitly + int external_force_clear; // clear forces locally or externally - int nelist_global,nelist_atom; // # of PE,virial computes to check - int nvlist_global,nvlist_atom,ncvlist_atom; - class Compute **elist_global; // lists of PE,virial Computes + int nelist_global, nelist_atom; // # of PE,virial computes to check + int nvlist_global, nvlist_atom, ncvlist_atom; + class Compute **elist_global; // lists of PE,virial Computes class Compute **elist_atom; class Compute **vlist_global; class Compute **vlist_atom; class Compute **cvlist_atom; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped void ev_setup(); void ev_set(bigint); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/irregular.h b/src/irregular.h index 1a30cb05e7..ddef433649 100644 --- a/src/irregular.h +++ b/src/irregular.h @@ -20,7 +20,6 @@ namespace LAMMPS_NS { class Irregular : protected Pointers { public: - #if defined(LMP_QSORT) // static variable across all Irregular objects, for qsort callback @@ -29,8 +28,7 @@ class Irregular : protected Pointers { Irregular(class LAMMPS *); ~Irregular(); - void migrate_atoms(int sortflag = 0, int preassign = 0, - int *procassign = nullptr); + void migrate_atoms(int sortflag = 0, int preassign = 0, int *procassign = nullptr); int migrate_check(); int create_data(int, int *, int sortflag = 0); int create_data_grouped(int, int *, int sortflag = 0); @@ -39,50 +37,50 @@ class Irregular : protected Pointers { double memory_usage(); private: - int me,nprocs; + int me, nprocs; int triclinic; int map_style; - int bufextra; // augment send buf size for a migrating atom - int maxsend,maxrecv; // size of buf send/recv in # of doubles - double *buf_send,*buf_recv; // bufs used in migrate_atoms - int maxdbuf; // size of double buf in bytes - double *dbuf; // double buf for largest single atom send - int maxbuf; // size of char buf in bytes - char *buf; // char buf for largest single data send - int maxindex; // combined size of index_send + index_self + int bufextra; // augment send buf size for a migrating atom + int maxsend, maxrecv; // size of buf send/recv in # of doubles + double *buf_send, *buf_recv; // bufs used in migrate_atoms + int maxdbuf; // size of double buf in bytes + double *dbuf; // double buf for largest single atom send + int maxbuf; // size of char buf in bytes + char *buf; // char buf for largest single data send + int maxindex; // combined size of index_send + index_self - int *mproclist,*msizes; // persistent vectors in migrate_atoms - int maxlocal; // allocated size of mproclist and msizes + int *mproclist, *msizes; // persistent vectors in migrate_atoms + int maxlocal; // allocated size of mproclist and msizes - int *work1,*work2; // work vectors + int *work1, *work2; // work vectors // plan params for irregular communication of atoms or datums // no params refer to atoms/data copied to self - int nsend_proc; // # of messages to send - int nrecv_proc; // # of messages to recv - int sendmax_proc; // # of doubles/datums in largest send message - int *proc_send; // list of procs to send to - int *num_send; // # of atoms/datums to send to each proc - int *index_send; // list of which atoms/datums to send to each proc - int *proc_recv; // list of procs to recv from - MPI_Request *request; // MPI requests for posted recvs - MPI_Status *status; // MPI statuses for WaitAll + int nsend_proc; // # of messages to send + int nrecv_proc; // # of messages to recv + int sendmax_proc; // # of doubles/datums in largest send message + int *proc_send; // list of procs to send to + int *num_send; // # of atoms/datums to send to each proc + int *index_send; // list of which atoms/datums to send to each proc + int *proc_recv; // list of procs to recv from + MPI_Request *request; // MPI requests for posted recvs + MPI_Status *status; // MPI statuses for WaitAll // extra plan params plan for irregular communication of atoms // no params refer to atoms copied to self - int *length_send; // # of doubles to send to each proc - int *length_recv; // # of doubles to recv from each proc - int *offset_send; // where each atom starts in send buffer + int *length_send; // # of doubles to send to each proc + int *length_recv; // # of doubles to recv from each proc + int *offset_send; // where each atom starts in send buffer // extra plan params plan for irregular communication of datums // 2 self params refer to data copied to self - int *num_recv; // # of datums to recv from each proc - int num_self; // # of datums to copy to self - int *index_self; // list of which datums to copy to self + int *num_recv; // # of datums to recv from each proc + int num_self; // # of datums to copy to self + int *index_self; // list of which datums to copy to self // private methods @@ -92,12 +90,12 @@ class Irregular : protected Pointers { int binary(double, int, double *); - void init_exchange(); // reset bufxtra - void grow_send(int,int); // reallocate send buffer - void grow_recv(int); // free/allocate recv buffer + void init_exchange(); // reset bufxtra + void grow_send(int, int); // reallocate send buffer + void grow_recv(int); // free/allocate recv buffer }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/kspace.h b/src/kspace.h index 8f081487a6..0fc5cd4584 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -14,7 +14,7 @@ #ifndef LMP_KSPACE_H #define LMP_KSPACE_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #ifdef FFT_SINGLE typedef float FFT_SCALAR; @@ -29,74 +29,75 @@ namespace LAMMPS_NS { class KSpace : protected Pointers { friend class ThrOMP; friend class FixOMP; - public: - double energy; // accumulated energies - double energy_1,energy_6; - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double e2group; // accumulated group-group energy - double f2group[3]; // accumulated group-group force - int triclinic_support; // 1 if supports triclinic geometries - int ewaldflag; // 1 if a Ewald solver - int pppmflag; // 1 if a PPPM solver - int msmflag; // 1 if a MSM solver - int dispersionflag; // 1 if a LJ/dispersion solver - int tip4pflag; // 1 if a TIP4P solver - int dipoleflag; // 1 if a dipole solver - int spinflag; // 1 if a spin solver + public: + double energy; // accumulated energies + double energy_1, energy_6; + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double e2group; // accumulated group-group energy + double f2group[3]; // accumulated group-group force + int triclinic_support; // 1 if supports triclinic geometries + + int ewaldflag; // 1 if a Ewald solver + int pppmflag; // 1 if a PPPM solver + int msmflag; // 1 if a MSM solver + int dispersionflag; // 1 if a LJ/dispersion solver + int tip4pflag; // 1 if a TIP4P solver + int dipoleflag; // 1 if a dipole solver + int spinflag; // 1 if a spin solver int differentiation_flag; - int neighrequest_flag; // used to avoid obsolete construction - // of neighbor lists - int mixflag; // 1 if geometric mixing rules are enforced - // for LJ coefficients + int neighrequest_flag; // used to avoid obsolete construction + // of neighbor lists + int mixflag; // 1 if geometric mixing rules are enforced + // for LJ coefficients int slabflag; - int scalar_pressure_flag; // 1 if using MSM fast scalar pressure + int scalar_pressure_flag; // 1 if using MSM fast scalar pressure double slab_volfactor; - int warn_nonneutral; // 0 = error if non-neutral system - // 1 = warn once if non-neutral system - // 2 = warn, but already warned - int warn_nocharge; // 0 = already warned - // 1 = warn if zero charge + int warn_nonneutral; // 0 = error if non-neutral system + // 1 = warn once if non-neutral system + // 2 = warn, but already warned + int warn_nocharge; // 0 = already warned + // 1 = warn if zero charge - int order,order_6,order_allocated; - double accuracy; // accuracy of KSpace solver (force units) - double accuracy_absolute; // user-specified accuracy in force units - double accuracy_relative; // user-specified dimensionless accuracy - // accuracy = acc_rel * two_charge_force - double accuracy_real_6; // real space accuracy for - // dispersion solver (force units) - double accuracy_kspace_6; // reciprocal space accuracy for - // dispersion solver (force units) - int auto_disp_flag; // use automatic parameter generation for pppm/disp - double two_charge_force; // force in user units of two point - // charges separated by 1 Angstrom + int order, order_6, order_allocated; + double accuracy; // accuracy of KSpace solver (force units) + double accuracy_absolute; // user-specified accuracy in force units + double accuracy_relative; // user-specified dimensionless accuracy + // accuracy = acc_rel * two_charge_force + double accuracy_real_6; // real space accuracy for + // dispersion solver (force units) + double accuracy_kspace_6; // reciprocal space accuracy for + // dispersion solver (force units) + int auto_disp_flag; // use automatic parameter generation for pppm/disp + double two_charge_force; // force in user units of two point + // charges separated by 1 Angstrom - double g_ewald,g_ewald_6; - int nx_pppm,ny_pppm,nz_pppm; // global FFT grid for Coulombics - int nx_pppm_6,ny_pppm_6,nz_pppm_6; // global FFT grid for dispersion - int nx_msm_max,ny_msm_max,nz_msm_max; + double g_ewald, g_ewald_6; + int nx_pppm, ny_pppm, nz_pppm; // global FFT grid for Coulombics + int nx_pppm_6, ny_pppm_6, nz_pppm_6; // global FFT grid for dispersion + int nx_msm_max, ny_msm_max, nz_msm_max; - int group_group_enable; // 1 if style supports group/group calculation + int group_group_enable; // 1 if style supports group/group calculation - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; + unsigned int datamask_read, datamask_modify; int copymode; - int compute_flag; // 0 if skip compute() - int fftbench; // 0 if skip FFT timing - int collective_flag; // 1 if use MPI collectives for FFT/remap - int stagger_flag; // 1 if using staggered PPPM grids + int compute_flag; // 0 if skip compute() + int fftbench; // 0 if skip FFT timing + int collective_flag; // 1 if use MPI collectives for FFT/remap + int stagger_flag; // 1 if using staggered PPPM grids - double splittol; // tolerance for when to truncate splitting + double splittol; // tolerance for when to truncate splitting KSpace(class LAMMPS *); virtual ~KSpace(); @@ -119,26 +120,26 @@ class KSpace : protected Pointers { // general child-class methods - virtual void settings(int, char **) {}; + virtual void settings(int, char **){}; virtual void init() = 0; virtual void setup() = 0; - virtual void setup_grid() {}; + virtual void setup_grid(){}; virtual void compute(int, int) = 0; - virtual void compute_group_group(int, int, int) {}; + virtual void compute_group_group(int, int, int){}; - virtual void pack_forward_grid(int, void *, int, int *) {}; - virtual void unpack_forward_grid(int, void *, int, int *) {}; - virtual void pack_reverse_grid(int, void *, int, int *) {}; - virtual void unpack_reverse_grid(int, void *, int, int *) {}; + virtual void pack_forward_grid(int, void *, int, int *){}; + virtual void unpack_forward_grid(int, void *, int, int *){}; + virtual void pack_reverse_grid(int, void *, int, int *){}; + virtual void unpack_reverse_grid(int, void *, int, int *){}; - virtual int timing(int, double &, double &) {return 0;} - virtual int timing_1d(int, double &) {return 0;} - virtual int timing_3d(int, double &) {return 0;} + virtual int timing(int, double &, double &) { return 0; } + virtual int timing_1d(int, double &) { return 0; } + virtual int timing_3d(int, double &) { return 0; } - virtual int modify_param(int, char **) {return 0;} - virtual double memory_usage() {return 0.0;} + virtual int modify_param(int, char **) { return 0; } + virtual double memory_usage() { return 0.0; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- compute gamma for MSM and pair styles see Eq 4 from Parallel Computing 35 (2009) 164-177 ------------------------------------------------------------------------- */ @@ -146,19 +147,20 @@ class KSpace : protected Pointers { double gamma(const double &rho) const { if (rho <= 1.0) { - const int split_order = order/2; - const double rho2 = rho*rho; + const int split_order = order / 2; + const double rho2 = rho * rho; double g = gcons[split_order][0]; double rho_n = rho2; for (int n = 1; n <= split_order; n++) { - g += gcons[split_order][n]*rho_n; + g += gcons[split_order][n] * rho_n; rho_n *= rho2; } return g; - } else return (1.0/rho); + } else + return (1.0 / rho); } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- compute the derivative of gamma for MSM and pair styles see Eq 4 from Parallel Computing 35 (2009) 164-177 ------------------------------------------------------------------------- */ @@ -166,50 +168,55 @@ class KSpace : protected Pointers { double dgamma(const double &rho) const { if (rho <= 1.0) { - const int split_order = order/2; - const double rho2 = rho*rho; - double dg = dgcons[split_order][0]*rho; - double rho_n = rho*rho2; + const int split_order = order / 2; + const double rho2 = rho * rho; + double dg = dgcons[split_order][0] * rho; + double rho_n = rho * rho2; for (int n = 1; n < split_order; n++) { - dg += dgcons[split_order][n]*rho_n; + dg += dgcons[split_order][n] * rho_n; rho_n *= rho2; } return dg; - } else return (-1.0/rho/rho); + } else + return (-1.0 / rho / rho); } double **get_gcons() { return gcons; } double **get_dgcons() { return dgcons; } protected: - int gridflag,gridflag_6; - int gewaldflag,gewaldflag_6; - int minorder,overlap_allowed; + int gridflag, gridflag_6; + int gewaldflag, gewaldflag_6; + int minorder, overlap_allowed; int adjust_cutoff_flag; - int suffix_flag; // suffix compatibility flag + int suffix_flag; // suffix compatibility flag bigint natoms_original; - double scale,qqrd2e; - double qsum,qsqsum,q2; - double **gcons,**dgcons; // accumulated per-atom energy/virial + double scale, qqrd2e; + double qsum, qsqsum, q2; + double **gcons, **dgcons; // accumulated per-atom energy/virial - int evflag,evflag_atom; - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom; - int maxeatom,maxvatom; + int evflag, evflag_atom; + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom; + int maxeatom, maxvatom; - int kewaldflag; // 1 if kspace range set for Ewald sum - int kx_ewald,ky_ewald,kz_ewald; // kspace settings for Ewald sum + int kewaldflag; // 1 if kspace range set for Ewald sum + int kx_ewald, ky_ewald, kz_ewald; // kspace settings for Ewald sum void pair_check(); - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else evflag = evflag_atom = eflag_either = eflag_global = eflag_atom = vflag_either = vflag_global = vflag_atom = 0; + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + evflag = evflag_atom = eflag_either = eflag_global = eflag_atom = vflag_either = + vflag_global = vflag_atom = 0; } void ev_setup(int, int, int alloc = 1); double estimate_table_accuracy(double, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/kspace_deprecated.h b/src/kspace_deprecated.h index 245d4e9d7c..cb0c0bffb9 100644 --- a/src/kspace_deprecated.h +++ b/src/kspace_deprecated.h @@ -30,12 +30,12 @@ class KSpaceDeprecated : public KSpace { virtual ~KSpaceDeprecated() {} virtual void init() {} - virtual void settings(int, char**); + virtual void settings(int, char **); virtual void setup() {} virtual void compute(int, int) {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/lammps.h b/src/lammps.h index b8e084edba..b0fe2284f7 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -14,63 +14,63 @@ #ifndef LMP_LAMMPS_H #define LMP_LAMMPS_H -#include #include +#include namespace LAMMPS_NS { class LAMMPS { public: - // ptrs to fundamental LAMMPS classes - class Memory *memory; // memory allocation functions - class Error *error; // error handling - class Universe *universe; // universe of processors - class Input *input; // input script processing - // ptrs to top-level LAMMPS-specific classes - class Atom *atom; // atom-based quantities - class Update *update; // integrators/minimizers - class Neighbor *neighbor; // neighbor lists - class Comm *comm; // inter-processor communication - class Domain *domain; // simulation box - class Force *force; // inter-particle forces - class Modify *modify; // fixes and computes - class Group *group; // groups of atoms - class Output *output; // thermo/dump/restart - class Timer *timer; // CPU timing info + // ptrs to fundamental LAMMPS classes + class Memory *memory; // memory allocation functions + class Error *error; // error handling + class Universe *universe; // universe of processors + class Input *input; // input script processing + // ptrs to top-level LAMMPS-specific classes + class Atom *atom; // atom-based quantities + class Update *update; // integrators/minimizers + class Neighbor *neighbor; // neighbor lists + class Comm *comm; // inter-processor communication + class Domain *domain; // simulation box + class Force *force; // inter-particle forces + class Modify *modify; // fixes and computes + class Group *group; // groups of atoms + class Output *output; // thermo/dump/restart + class Timer *timer; // CPU timing info - const char *version; // LAMMPS version string = date - int num_ver; // numeric version id derived from *version* - // that is constructed so that will be greater - // for newer versions in numeric or string - // value comparisons + const char *version; // LAMMPS version string = date + int num_ver; // numeric version id derived from *version* + // that is constructed so that will be greater + // for newer versions in numeric or string + // value comparisons - MPI_Comm world; // MPI communicator - FILE *infile; // infile - FILE *screen; // screen output - FILE *logfile; // logfile + MPI_Comm world; // MPI communicator + FILE *infile; // infile + FILE *screen; // screen output + FILE *logfile; // logfile - double initclock; // wall clock at instantiation + double initclock; // wall clock at instantiation - char *suffix,*suffix2,*suffixp;// suffixes to add to input script style names - int suffix_enable; // 1 if suffixes are enabled, 0 if disabled - char *exename; // pointer to argv[0] - char ***packargs; // arguments for cmdline package commands - int num_package; // number of cmdline package commands + char *suffix, *suffix2, *suffixp; // suffixes to add to input script style names + int suffix_enable; // 1 if suffixes are enabled, 0 if disabled + char *exename; // pointer to argv[0] + char ***packargs; // arguments for cmdline package commands + int num_package; // number of cmdline package commands - int clientserver; // 0 = neither, 1 = client, 2 = server - void *cslib; // client/server messaging via CSlib - MPI_Comm cscomm; // MPI comm for client+server in mpi/one mode + int clientserver; // 0 = neither, 1 = client, 2 = server + void *cslib; // client/server messaging via CSlib + MPI_Comm cscomm; // MPI comm for client+server in mpi/one mode - class KokkosLMP *kokkos; // KOKKOS accelerator class - class AtomKokkos *atomKK; // KOKKOS version of Atom class - class MemoryKokkos *memoryKK; // KOKKOS version of Memory class + class KokkosLMP *kokkos; // KOKKOS accelerator class + class AtomKokkos *atomKK; // KOKKOS version of Atom class + class MemoryKokkos *memoryKK; // KOKKOS version of Memory class - class Python *python; // Python interface + class Python *python; // Python interface - class CiteMe *citeme; // handle citation info + class CiteMe *citeme; // handle citation info const char *match_style(const char *style, const char *name); - static const char * installed_packages[]; + static const char *installed_packages[]; static bool is_installed_pkg(const char *pkg); static const bool has_git_info; @@ -91,12 +91,12 @@ class LAMMPS { void init_pkg_lists(); void help(); /// Default constructor. Declared private to prohibit its use - LAMMPS() {}; + LAMMPS(){}; /// Copy constructor. Declared private to prohibit its use - LAMMPS(const LAMMPS &) {}; + LAMMPS(const LAMMPS &){}; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/lammpsplugin.h b/src/lammpsplugin.h index 0884ac8f84..9152af8b31 100644 --- a/src/lammpsplugin.h +++ b/src/lammpsplugin.h @@ -18,29 +18,29 @@ extern "C" { - typedef void *(lammpsplugin_factory1)(void *); - typedef void *(lammpsplugin_factory2)(void *, int, char **); +typedef void *(lammpsplugin_factory1) (void *); +typedef void *(lammpsplugin_factory2) (void *, int, char **); - typedef struct { - const char *version; - const char *style; - const char *name; - const char *info; - const char *author; - union { - lammpsplugin_factory1 *v1; - lammpsplugin_factory2 *v2; - } creator; - void *handle; - } lammpsplugin_t; +typedef struct { + const char *version; + const char *style; + const char *name; + const char *info; + const char *author; + union { + lammpsplugin_factory1 *v1; + lammpsplugin_factory2 *v2; + } creator; + void *handle; +} lammpsplugin_t; - typedef void (*lammpsplugin_regfunc)(lammpsplugin_t *, void *); - typedef void (*lammpsplugin_initfunc)(void *, void *, void *); +typedef void (*lammpsplugin_regfunc)(lammpsplugin_t *, void *); +typedef void (*lammpsplugin_initfunc)(void *, void *, void *); - // prototype for initializer function required - // to load a plugin; uses C bindings +// prototype for initializer function required +// to load a plugin; uses C bindings - void lammpsplugin_init(void *, void *, void *); +void lammpsplugin_init(void *, void *, void *); } #endif diff --git a/src/lattice.h b/src/lattice.h index eae97c3506..8fb2c3775e 100644 --- a/src/lattice.h +++ b/src/lattice.h @@ -20,30 +20,30 @@ namespace LAMMPS_NS { class Lattice : protected Pointers { public: - enum{NONE,SC,BCC,FCC,HCP,DIAMOND,SQ,SQ2,HEX,CUSTOM}; + enum { NONE, SC, BCC, FCC, HCP, DIAMOND, SQ, SQ2, HEX, CUSTOM }; - int style; // NONE,SC,FCC,etc - double xlattice,ylattice,zlattice; // lattice scale factors in 3 dims - double a1[3],a2[3],a3[3]; // edge vectors of unit cell - int nbasis; // # of basis atoms in unit cell - double **basis; // fractional coords of each basis atom - // within unit cell (0 <= coord < 1) + int style; // NONE,SC,FCC,etc + double xlattice, ylattice, zlattice; // lattice scale factors in 3 dims + double a1[3], a2[3], a3[3]; // edge vectors of unit cell + int nbasis; // # of basis atoms in unit cell + double **basis; // fractional coords of each basis atom + // within unit cell (0 <= coord < 1) Lattice(class LAMMPS *, int, char **); ~Lattice(); void lattice2box(double &, double &, double &); void box2lattice(double &, double &, double &); - void bbox(int, double, double, double, - double &, double &, double &, double &, double &, double &); + void bbox(int, double, double, double, double &, double &, double &, double &, double &, + double &); -private: + private: double scale; - double origin[3]; // lattice origin - int orientx[3]; // lattice orientation vecs - int orienty[3]; // orientx = what lattice dir lies - int orientz[3]; // along x dim in box + double origin[3]; // lattice origin + int orientx[3]; // lattice orientation vecs + int orienty[3]; // orientx = what lattice dir lies + int orientz[3]; // along x dim in box - double primitive[3][3]; // lattice <-> box transform matrices + double primitive[3][3]; // lattice <-> box transform matrices double priminv[3][3]; double rotaterow[3][3]; double rotatecol[3][3]; @@ -57,7 +57,7 @@ private: void cross(double *, double *, double *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/library.h b/src/library.h index a199c86652..68f8937e7f 100644 --- a/src/library.h +++ b/src/library.h @@ -24,9 +24,7 @@ /* We follow the behavior of regular LAMMPS compilation and assume * -DLAMMPS_SMALLBIG when no define is set. */ -#if !defined(LAMMPS_BIGBIG) \ - && !defined(LAMMPS_SMALLBIG) \ - && !defined(LAMMPS_SMALLSMALL) +#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG) && !defined(LAMMPS_SMALLSMALL) #define LAMMPS_SMALLBIG #endif @@ -37,7 +35,7 @@ #endif #if defined(LAMMPS_BIGBIG) || defined(LAMMPS_SMALLBIG) -#include /* for int64_t */ +#include /* for int64_t */ #endif /** Data type constants for extracting data from atoms, computes and fixes @@ -45,13 +43,13 @@ * Must be kept in sync with the equivalent constants in lammps/constants.py */ enum _LMP_DATATYPE_CONST { - LAMMPS_INT = 0, /*!< 32-bit integer (array) */ - LAMMPS_INT_2D = 1, /*!< two-dimensional 32-bit integer array */ - LAMMPS_DOUBLE = 2, /*!< 64-bit double (array) */ - LAMMPS_DOUBLE_2D = 3, /*!< two-dimensional 64-bit double array */ - LAMMPS_INT64 = 4, /*!< 64-bit integer (array) */ - LAMMPS_INT64_2D = 5, /*!< two-dimensional 64-bit integer array */ - LAMMPS_STRING = 6 /*!< C-String */ + LAMMPS_INT = 0, /*!< 32-bit integer (array) */ + LAMMPS_INT_2D = 1, /*!< two-dimensional 32-bit integer array */ + LAMMPS_DOUBLE = 2, /*!< 64-bit double (array) */ + LAMMPS_DOUBLE_2D = 3, /*!< two-dimensional 64-bit double array */ + LAMMPS_INT64 = 4, /*!< 64-bit integer (array) */ + LAMMPS_INT64_2D = 5, /*!< two-dimensional 64-bit integer array */ + LAMMPS_STRING = 6 /*!< C-String */ }; /** Style constants for extracting data from computes and fixes. @@ -59,9 +57,9 @@ enum _LMP_DATATYPE_CONST { * Must be kept in sync with the equivalent constants in lammps/constants.py */ enum _LMP_STYLE_CONST { - LMP_STYLE_GLOBAL=0, /*!< return global data */ - LMP_STYLE_ATOM =1, /*!< return per-atom data */ - LMP_STYLE_LOCAL =2 /*!< return local data */ + LMP_STYLE_GLOBAL = 0, /*!< return global data */ + LMP_STYLE_ATOM = 1, /*!< return per-atom data */ + LMP_STYLE_LOCAL = 2 /*!< return local data */ }; /** Type and size constants for extracting data from computes and fixes. @@ -69,12 +67,12 @@ enum _LMP_STYLE_CONST { * Must be kept in sync with the equivalent constants in lammps/constants.py */ enum _LMP_TYPE_CONST { - LMP_TYPE_SCALAR=0, /*!< return scalar */ - LMP_TYPE_VECTOR=1, /*!< return vector */ - LMP_TYPE_ARRAY =2, /*!< return array */ - LMP_SIZE_VECTOR=3, /*!< return length of vector */ - LMP_SIZE_ROWS =4, /*!< return number of rows */ - LMP_SIZE_COLS =5 /*!< return number of columns */ + LMP_TYPE_SCALAR = 0, /*!< return scalar */ + LMP_TYPE_VECTOR = 1, /*!< return vector */ + LMP_TYPE_ARRAY = 2, /*!< return array */ + LMP_SIZE_VECTOR = 3, /*!< return length of vector */ + LMP_SIZE_ROWS = 4, /*!< return number of rows */ + LMP_SIZE_COLS = 5 /*!< return number of columns */ }; /* Ifdefs to allow this file to be included in C and C++ programs */ @@ -92,20 +90,20 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr); #endif void *lammps_open_no_mpi(int argc, char **argv, void **ptr); void *lammps_open_fortran(int argc, char **argv, int f_comm); -void lammps_close(void *handle); +void lammps_close(void *handle); -void lammps_mpi_init(); -void lammps_mpi_finalize(); +void lammps_mpi_init(); +void lammps_mpi_finalize(); /* ---------------------------------------------------------------------- * Library functions to process commands * ---------------------------------------------------------------------- */ -void lammps_file(void *handle, const char *file); +void lammps_file(void *handle, const char *file); char *lammps_command(void *handle, const char *cmd); -void lammps_commands_list(void *handle, int ncmd, const char **cmds); -void lammps_commands_string(void *handle, const char *str); +void lammps_commands_list(void *handle, int ncmd, const char **cmds); +void lammps_commands_string(void *handle, const char *str); /* ----------------------------------------------------------------------- * Library functions to extract info from LAMMPS or set data in LAMMPS @@ -114,17 +112,15 @@ void lammps_commands_string(void *handle, const char *str); double lammps_get_natoms(void *handle); double lammps_get_thermo(void *handle, const char *keyword); -void lammps_extract_box(void *handle, double *boxlo, double *boxhi, - double *xy, double *yz, double *xz, - int *pflags, int *boxflag); -void lammps_reset_box(void *handle, double *boxlo, double *boxhi, - double xy, double yz, double xz); +void lammps_extract_box(void *handle, double *boxlo, double *boxhi, double *xy, double *yz, + double *xz, int *pflags, int *boxflag); +void lammps_reset_box(void *handle, double *boxlo, double *boxhi, double xy, double yz, double xz); void lammps_memory_usage(void *handle, double *meminfo); -int lammps_get_mpi_comm(void *handle); +int lammps_get_mpi_comm(void *handle); -int lammps_extract_setting(void *handle, const char *keyword); -int lammps_extract_global_datatype(void *handle, const char *name); +int lammps_extract_setting(void *handle, const char *keyword); +int lammps_extract_global_datatype(void *handle, const char *name); void *lammps_extract_global(void *handle, const char *name); /* ---------------------------------------------------------------------- @@ -132,7 +128,7 @@ void *lammps_extract_global(void *handle, const char *name); * ---------------------------------------------------------------------- */ int lammps_extract_atom_datatype(void *handle, const char *name); -void *lammps_extract_atom(void *handle, const char *name); +void *lammps_extract_atom(void *handle, const char *name); /* ---------------------------------------------------------------------- * Library functions to access data from computes, fixes, variables in LAMMPS @@ -141,7 +137,7 @@ void *lammps_extract_atom(void *handle, const char *name); void *lammps_extract_compute(void *handle, const char *, int, int); void *lammps_extract_fix(void *handle, const char *, int, int, int, int); void *lammps_extract_variable(void *handle, const char *, const char *); -int lammps_set_variable(void *, char *, char *); +int lammps_set_variable(void *, char *, char *); /* ---------------------------------------------------------------------- * Library functions for scatter/gather operations of data @@ -149,22 +145,26 @@ int lammps_set_variable(void *, char *, char *); void lammps_gather_atoms(void *handle, char *name, int type, int count, void *data); void lammps_gather_atoms_concat(void *handle, char *name, int type, int count, void *data); -void lammps_gather_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data); +void lammps_gather_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); void lammps_scatter_atoms(void *handle, char *name, int type, int count, void *data); -void lammps_scatter_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data); +void lammps_scatter_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); void lammps_gather(void *handle, char *name, int type, int count, void *data); void lammps_gather_concat(void *handle, char *name, int type, int count, void *data); -void lammps_gather_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data); +void lammps_gather_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); void lammps_scatter(void *handle, char *name, int type, int count, void *data); -void lammps_scatter_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data); +void lammps_scatter_subset(void *handle, char *name, int type, int count, int ndata, int *ids, + void *data); #if !defined(LAMMPS_BIGBIG) -int lammps_create_atoms(void *handle, int n, const int *id, const int *type, - const double *x, const double *v, const int *image, int bexpand); +int lammps_create_atoms(void *handle, int n, const int *id, const int *type, const double *x, + const double *v, const int *image, int bexpand); #else -int lammps_create_atoms(void *handle, int n, const int64_t *id, const int *type, - const double *x, const double *v, const int64_t* image, int bexpand); +int lammps_create_atoms(void *handle, int n, const int64_t *id, const int *type, const double *x, + const double *v, const int64_t *image, int bexpand); #endif /* ---------------------------------------------------------------------- @@ -175,13 +175,14 @@ int lammps_find_pair_neighlist(void *handle, const char *style, int exact, int n int lammps_find_fix_neighlist(void *handle, const char *id, int request); int lammps_find_compute_neighlist(void *handle, const char *id, int request); int lammps_neighlist_num_elements(void *handle, int idx); -void lammps_neighlist_element_neighbors(void *handle, int idx, int element, int *iatom, int *numneigh, int **neighbors); +void lammps_neighlist_element_neighbors(void *handle, int idx, int element, int *iatom, + int *numneigh, int **neighbors); /* ---------------------------------------------------------------------- * Library functions for retrieving configuration information * ---------------------------------------------------------------------- */ -int lammps_version(void *handle); +int lammps_version(void *handle); void lammps_get_os_info(char *buffer, int buf_size); int lammps_config_has_mpi_support(); @@ -224,20 +225,20 @@ void lammps_decode_image_flags(int64_t image, int *flags); #if defined(LAMMPS_BIGBIG) typedef void (*FixExternalFnPtr)(void *, int64_t, int, int64_t *, double **, double **); -void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); +void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void *); #elif defined(LAMMPS_SMALLBIG) typedef void (*FixExternalFnPtr)(void *, int64_t, int, int *, double **, double **); -void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); +void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void *); #else typedef void (*FixExternalFnPtr)(void *, int, int, int *, double **, double **); -void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); +void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void *); #endif void lammps_fix_external_set_energy_global(void *, char *, double); void lammps_fix_external_set_virial_global(void *, char *, double *); void lammps_free(void *ptr); -int lammps_is_running(void *handle); +int lammps_is_running(void *handle); void lammps_force_timeout(void *handle); int lammps_has_error(void *handle); diff --git a/src/lmppython.h b/src/lmppython.h index 57a77628a7..b181f95185 100644 --- a/src/lmppython.h +++ b/src/lmppython.h @@ -19,7 +19,7 @@ namespace LAMMPS_NS { class PythonInterface { -public: + public: virtual ~PythonInterface(); virtual void command(int, char **) = 0; virtual void invoke_function(int, char *) = 0; @@ -32,7 +32,7 @@ public: }; class Python : protected Pointers { -public: + public: Python(class LAMMPS *); ~Python(); @@ -40,7 +40,7 @@ public: void invoke_function(int, char *); int find(const char *); int variable_match(const char *, const char *, int); - char * long_string(int ifunc); + char *long_string(int ifunc); int execute_string(char *); int execute_file(char *); bool has_minimum_version(int major, int minor); @@ -48,11 +48,11 @@ public: bool is_enabled() const; void init(); -private: - PythonInterface * impl; + private: + PythonInterface *impl; }; -} +} // namespace LAMMPS_NS #endif /* ERROR/WARNING messages: diff --git a/src/lmprestart.h b/src/lmprestart.h index 745a1c45d1..3d51913603 100644 --- a/src/lmprestart.h +++ b/src/lmprestart.h @@ -10,7 +10,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - +// clang-format off #ifndef LMP_RESTART_H #define LMP_RESTART_H diff --git a/src/lmptype.h b/src/lmptype.h index 3134624004..90ba486559 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -42,10 +42,10 @@ #define __STDC_FORMAT_MACROS #endif -#include // IWYU pragma: export -#include // IWYU pragma: export -#include // IWYU pragma: export -#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export // grrr - IBM Power6 does not provide this def in their system header files @@ -102,9 +102,9 @@ typedef int64_t bigint; #define ATOTAGINT atoi #define ATOBIGINT ATOLL -#define LAMMPS_TAGINT LAMMPS_INT +#define LAMMPS_TAGINT LAMMPS_INT #define LAMMPS_TAGINT_2D LAMMPS_INT_2D -#define LAMMPS_BIGINT LAMMPS_INT64 +#define LAMMPS_BIGINT LAMMPS_INT64 #define LAMMPS_BIGINT_2D LAMMPS_INT64_2D #define IMGMASK 1023 @@ -139,9 +139,9 @@ typedef int64_t bigint; #define ATOTAGINT ATOLL #define ATOBIGINT ATOLL -#define LAMMPS_TAGINT LAMMPS_INT64 +#define LAMMPS_TAGINT LAMMPS_INT64 #define LAMMPS_TAGINT_2D LAMMPS_INT64_2D -#define LAMMPS_BIGINT LAMMPS_INT64 +#define LAMMPS_BIGINT LAMMPS_INT64 #define LAMMPS_BIGINT_2D LAMMPS_INT64_2D #define IMGMASK 2097151 @@ -175,9 +175,9 @@ typedef int bigint; #define ATOTAGINT atoi #define ATOBIGINT atoi -#define LAMMPS_TAGINT LAMMPS_INT +#define LAMMPS_TAGINT LAMMPS_INT #define LAMMPS_TAGINT_2D LAMMPS_INT_2D -#define LAMMPS_BIGINT LAMMPS_INT +#define LAMMPS_BIGINT LAMMPS_INT #define LAMMPS_BIGINT_2D LAMMPS_INT_2D #define IMGMASK 1023 @@ -218,14 +218,14 @@ typedef int bigint; The typecasts prevent compiler warnings about possible truncation issues. \endverbatim */ - union ubuf { - double d; - int64_t i; - ubuf(const double &arg) : d(arg) {} - ubuf(const int64_t &arg) : i(arg) {} - ubuf(const int &arg) : i(arg) {} - }; -} +union ubuf { + double d; + int64_t i; + ubuf(const double &arg) : d(arg) {} + ubuf(const int64_t &arg) : i(arg) {} + ubuf(const int &arg) : i(arg) {} +}; +} // namespace LAMMPS_NS // preprocessor macros for compiler specific settings // clear previous definitions to avoid redefinition warning @@ -243,11 +243,11 @@ The typecasts prevent compiler warnings about possible truncation issues. // define stack variable alignment #if defined(__INTEL_LLVM_COMPILER) || defined(__INTEL_COMPILER) -#define _alignvar(expr,val) __declspec(align(val)) expr +#define _alignvar(expr, val) __declspec(align(val)) expr #elif defined(__GNUC__) -#define _alignvar(expr,val) expr __attribute((aligned(val))) +#define _alignvar(expr, val) expr __attribute((aligned(val))) #else -#define _alignvar(expr,val) expr +#define _alignvar(expr, val) expr #endif // declaration to lift aliasing restrictions @@ -265,27 +265,27 @@ The typecasts prevent compiler warnings about possible truncation issues. // Disable for broken -D_FORTIFY_SOURCE feature. #if defined(__clang__) -# define _noopt __attribute__((optnone)) +#define _noopt __attribute__((optnone)) #elif defined(__INTEL_COMPILER) -# define _noopt +#define _noopt #elif defined(__PGI) -# define _noopt +#define _noopt #elif defined(__GNUC__) -# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) -# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) -# define _noopt __attribute__((optimize("no-var-tracking-assignments"))) -# else -# define _noopt __attribute__((optimize("O0","no-var-tracking-assignments"))) -# endif -# else -# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) -# define _noopt -# else -# define _noopt __attribute__((optimize("O0"))) -# endif -# endif +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) +#if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) +#define _noopt __attribute__((optimize("no-var-tracking-assignments"))) #else -# define _noopt +#define _noopt __attribute__((optimize("O0", "no-var-tracking-assignments"))) +#endif +#else +#if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) +#define _noopt +#else +#define _noopt __attribute__((optimize("O0"))) +#endif +#endif +#else +#define _noopt #endif // settings to enable LAMMPS to build under Windows @@ -296,6 +296,6 @@ The typecasts prevent compiler warnings about possible truncation issues. // suppress unused parameter warning -#define LMP_UNUSED_PARAM(x) (void)(x) +#define LMP_UNUSED_PARAM(x) (void) (x) #endif diff --git a/src/lmpwindows.h b/src/lmpwindows.h index 59210f35c3..7189fd2294 100644 --- a/src/lmpwindows.h +++ b/src/lmpwindows.h @@ -15,9 +15,9 @@ #if !defined(__MINGW32__) #include "erf.h" #endif -#include #include #include +#include // LAMMPS uses usleep with 100 ms arguments, no microsecond precision needed #if !defined(__MINGW32__) #include "sleep.h" @@ -34,32 +34,36 @@ // the following functions are defined to get rid of // 'ambiguous call to overloaded function' error in VSS for mismatched type arguments #if !defined(__MINGW32__) -inline double pow(int i, int j){ - return pow((double)i,j); +inline double pow(int i, int j) +{ + return pow((double) i, j); } -inline double fabs(int i){ +inline double fabs(int i) +{ return fabs((double) i); } -inline double sqrt(int i){ +inline double sqrt(int i) +{ return sqrt((double) i); } #endif -inline double trunc(double x) { +inline double trunc(double x) +{ return x > 0 ? floor(x) : ceil(x); } // Windows version of mkdir function does not have permission flags #ifndef S_IRWXU -# define S_IRWXU 0 +#define S_IRWXU 0 #endif #ifndef S_IRGRP -# define S_IRGRP 0 +#define S_IRGRP 0 #endif #ifndef S_IXGRP -# define S_IXGRP 0 +#define S_IXGRP 0 #endif -inline int mkdir(const char *path, int){ +inline int mkdir(const char *path, int) +{ return _mkdir(path); } - diff --git a/src/main.cpp b/src/main.cpp index 69d4547816..ac84987e89 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -56,7 +56,6 @@ int main(int argc, char **argv) // get the MPI communicator that spans all ranks running LAMMPS // when using MDI, this may be a subset of MPI_COMM_WORLD - if (mdi_flag) if (MDI_MPI_get_world_comm(&lammps_comm)) MPI_Abort(MPI_COMM_WORLD, 1); #endif diff --git a/src/math_const.h b/src/math_const.h index f8740a5d8c..9234594517 100644 --- a/src/math_const.h +++ b/src/math_const.h @@ -17,20 +17,20 @@ namespace LAMMPS_NS { namespace MathConst { - static constexpr double THIRD = 1.0/3.0; - static constexpr double TWOTHIRDS = 2.0/3.0; - static constexpr double MY_PI = 3.14159265358979323846; // pi - static constexpr double MY_2PI = 6.28318530717958647692; // 2pi - static constexpr double MY_3PI = 9.42477796076937971538; // 3pi - static constexpr double MY_4PI = 12.56637061435917295384; // 4pi - static constexpr double MY_PI2 = 1.57079632679489661923; // pi/2 - static constexpr double MY_PI4 = 0.78539816339744830962; // pi/4 - static constexpr double MY_PIS = 1.77245385090551602729; // sqrt(pi) - static constexpr double MY_ISPI4 = 1.12837916709551257389; // 1/sqrt(pi/4) - static constexpr double MY_SQRT2 = 1.41421356237309504880; // sqrt(2) - static constexpr double MY_CUBEROOT2 = 1.25992104989487316476; // 2*(1/3) -} + static constexpr double THIRD = 1.0 / 3.0; + static constexpr double TWOTHIRDS = 2.0 / 3.0; + static constexpr double MY_PI = 3.14159265358979323846; // pi + static constexpr double MY_2PI = 6.28318530717958647692; // 2pi + static constexpr double MY_3PI = 9.42477796076937971538; // 3pi + static constexpr double MY_4PI = 12.56637061435917295384; // 4pi + static constexpr double MY_PI2 = 1.57079632679489661923; // pi/2 + static constexpr double MY_PI4 = 0.78539816339744830962; // pi/4 + static constexpr double MY_PIS = 1.77245385090551602729; // sqrt(pi) + static constexpr double MY_ISPI4 = 1.12837916709551257389; // 1/sqrt(pi/4) + static constexpr double MY_SQRT2 = 1.41421356237309504880; // sqrt(2) + static constexpr double MY_CUBEROOT2 = 1.25992104989487316476; // 2*(1/3) +} // namespace MathConst -} +} // namespace LAMMPS_NS #endif diff --git a/src/math_eigen.h b/src/math_eigen.h index 4ecc0d6fc9..deab603963 100644 --- a/src/math_eigen.h +++ b/src/math_eigen.h @@ -11,7 +11,6 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - #ifndef LMP_MATH_EIGEN_H #define LMP_MATH_EIGEN_H @@ -25,12 +24,12 @@ namespace MathEigen { * \param evec store the eigenvectors here... * \return 0 if eigenvalue calculation converged, 1 if it failed */ -int jacobi3(double const* const* mat, double *eval, double **evec); +int jacobi3(double const *const *mat, double *eval, double **evec); /** \overload */ int jacobi3(double const mat[3][3], double *eval, double evec[3][3]); -} +} // namespace MathEigen -#endif //#ifndef LMP_MATH_EIGEN_H +#endif //#ifndef LMP_MATH_EIGEN_H diff --git a/src/math_eigen_impl.h b/src/math_eigen_impl.h index 26867083f7..89d3d099b3 100644 --- a/src/math_eigen_impl.h +++ b/src/math_eigen_impl.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/math_extra.h b/src/math_extra.h index 90b8f8a686..718dbf8e6f 100644 --- a/src/math_extra.h +++ b/src/math_extra.h @@ -22,126 +22,102 @@ namespace MathExtra { - // 3 vector operations +// 3 vector operations - inline void copy3(const double *v, double *ans); - inline void zero3(double *v); - inline void norm3(double *v); - inline void normalize3(const double *v, double *ans); - inline void snormalize3(const double, const double *v, double *ans); - inline void negate3(double *v); - inline void scale3(const double s, double *v); - inline void scale3(const double s, const double *v, double *ans); - inline void add3(const double *v1, const double *v2, double *ans); - inline void scaleadd3(const double s, const double *v1, const double *v2, - double *ans); - inline void scaleadd3(const double s1, const double *v1, - const double s2, const double *v2, double *ans); - inline void sub3(const double *v1, const double *v2, double *ans); - inline double len3(const double *v); - inline double lensq3(const double *v); - inline double distsq3(const double *v1, const double *v2); - inline double dot3(const double *v1, const double *v2); - inline void cross3(const double *v1, const double *v2, double *ans); +inline void copy3(const double *v, double *ans); +inline void zero3(double *v); +inline void norm3(double *v); +inline void normalize3(const double *v, double *ans); +inline void snormalize3(const double, const double *v, double *ans); +inline void negate3(double *v); +inline void scale3(const double s, double *v); +inline void scale3(const double s, const double *v, double *ans); +inline void add3(const double *v1, const double *v2, double *ans); +inline void scaleadd3(const double s, const double *v1, const double *v2, double *ans); +inline void scaleadd3(const double s1, const double *v1, const double s2, const double *v2, + double *ans); +inline void sub3(const double *v1, const double *v2, double *ans); +inline double len3(const double *v); +inline double lensq3(const double *v); +inline double distsq3(const double *v1, const double *v2); +inline double dot3(const double *v1, const double *v2); +inline void cross3(const double *v1, const double *v2, double *ans); - // 3x3 matrix operations +// 3x3 matrix operations - inline void zeromat3(double m[3][3]); - inline void zeromat3(double **m); +inline void zeromat3(double m[3][3]); +inline void zeromat3(double **m); - inline void col2mat(const double *ex, const double *ey, const double *ez, - double m[3][3]); - inline double det3(const double mat[3][3]); - inline void diag_times3(const double *d, const double m[3][3], - double ans[3][3]); - inline void times3_diag(const double m[3][3], const double *d, - double ans[3][3]); - inline void plus3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void plus3(const double m[3][3], double **m2, double **ans); - inline void minus3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void minus3(double **m, const double m2[3][3], - double ans[3][3]); +inline void col2mat(const double *ex, const double *ey, const double *ez, double m[3][3]); +inline double det3(const double mat[3][3]); +inline void diag_times3(const double *d, const double m[3][3], double ans[3][3]); +inline void times3_diag(const double m[3][3], const double *d, double ans[3][3]); +inline void plus3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void plus3(const double m[3][3], double **m2, double **ans); +inline void minus3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void minus3(double **m, const double m2[3][3], double ans[3][3]); - inline void times3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void transpose_times3(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void times3_transpose(const double m[3][3], const double m2[3][3], - double ans[3][3]); - inline void invert3(const double mat[3][3], double ans[3][3]); - inline void matvec(const double mat[3][3], const double *vec, double *ans); - inline void matvec(const double *ex, const double *ey, const double *ez, - const double *vec, double *ans); - inline void transpose_matvec(const double mat[3][3], const double *vec, - double *ans); - inline void transpose_matvec(const double *ex, const double *ey, - const double *ez, const double *v, - double *ans); - inline void transpose_diag3(const double m[3][3], const double *d, - double ans[3][3]); - inline void vecmat(const double *v, const double m[3][3], double *ans); - inline void scalar_times3(const double f, double m[3][3]); - inline void outer3(const double *v1, const double *v2, - double ans[3][3]); +inline void times3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void transpose_times3(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void times3_transpose(const double m[3][3], const double m2[3][3], double ans[3][3]); +inline void invert3(const double mat[3][3], double ans[3][3]); +inline void matvec(const double mat[3][3], const double *vec, double *ans); +inline void matvec(const double *ex, const double *ey, const double *ez, const double *vec, + double *ans); +inline void transpose_matvec(const double mat[3][3], const double *vec, double *ans); +inline void transpose_matvec(const double *ex, const double *ey, const double *ez, const double *v, + double *ans); +inline void transpose_diag3(const double m[3][3], const double *d, double ans[3][3]); +inline void vecmat(const double *v, const double m[3][3], double *ans); +inline void scalar_times3(const double f, double m[3][3]); +inline void outer3(const double *v1, const double *v2, double ans[3][3]); - void write3(const double mat[3][3]); - int mldivide3(const double mat[3][3], const double *vec, double *ans); - void rotate(double matrix[3][3], int i, int j, int k, int l, - double s, double tau); - void richardson(double *q, double *m, double *w, double *moments, double dtq); - void no_squish_rotate(int k, double *p, double *q, double *inertia, - double dt); +void write3(const double mat[3][3]); +int mldivide3(const double mat[3][3], const double *vec, double *ans); +void rotate(double matrix[3][3], int i, int j, int k, int l, double s, double tau); +void richardson(double *q, double *m, double *w, double *moments, double dtq); +void no_squish_rotate(int k, double *p, double *q, double *inertia, double dt); - // shape matrix operations - // upper-triangular 3x3 matrix stored in Voigt ordering as 6-vector +// shape matrix operations +// upper-triangular 3x3 matrix stored in Voigt ordering as 6-vector - inline void multiply_shape_shape(const double *one, const double *two, - double *ans); +inline void multiply_shape_shape(const double *one, const double *two, double *ans); - // quaternion operations +// quaternion operations - inline void qnormalize(double *q); - inline void qconjugate(double *q, double *qc); - inline void vecquat(double *a, double *b, double *c); - inline void quatvec(double *a, double *b, double *c); - inline void quatquat(double *a, double *b, double *c); - inline void invquatvec(double *a, double *b, double *c); - inline void axisangle_to_quat(const double *v, const double angle, - double *quat); +inline void qnormalize(double *q); +inline void qconjugate(double *q, double *qc); +inline void vecquat(double *a, double *b, double *c); +inline void quatvec(double *a, double *b, double *c); +inline void quatquat(double *a, double *b, double *c); +inline void invquatvec(double *a, double *b, double *c); +inline void axisangle_to_quat(const double *v, const double angle, double *quat); - void angmom_to_omega(double *m, double *ex, double *ey, double *ez, - double *idiag, double *w); - void omega_to_angmom(double *w, double *ex, double *ey, double *ez, - double *idiag, double *m); - void mq_to_omega(double *m, double *q, double *moments, double *w); - void exyz_to_q(double *ex, double *ey, double *ez, double *q); - void q_to_exyz(double *q, double *ex, double *ey, double *ez); - void quat_to_mat(const double *quat, double mat[3][3]); - void quat_to_mat_trans(const double *quat, double mat[3][3]); +void angmom_to_omega(double *m, double *ex, double *ey, double *ez, double *idiag, double *w); +void omega_to_angmom(double *w, double *ex, double *ey, double *ez, double *idiag, double *m); +void mq_to_omega(double *m, double *q, double *moments, double *w); +void exyz_to_q(double *ex, double *ey, double *ez, double *q); +void q_to_exyz(double *q, double *ex, double *ey, double *ez); +void quat_to_mat(const double *quat, double mat[3][3]); +void quat_to_mat_trans(const double *quat, double mat[3][3]); - // rotation operations +// rotation operations - inline void rotation_generator_x(const double m[3][3], double ans[3][3]); - inline void rotation_generator_y(const double m[3][3], double ans[3][3]); - inline void rotation_generator_z(const double m[3][3], double ans[3][3]); +inline void rotation_generator_x(const double m[3][3], double ans[3][3]); +inline void rotation_generator_y(const double m[3][3], double ans[3][3]); +inline void rotation_generator_z(const double m[3][3], double ans[3][3]); - void BuildRxMatrix(double R[3][3], const double angle); - void BuildRyMatrix(double R[3][3], const double angle); - void BuildRzMatrix(double R[3][3], const double angle); +void BuildRxMatrix(double R[3][3], const double angle); +void BuildRyMatrix(double R[3][3], const double angle); +void BuildRzMatrix(double R[3][3], const double angle); - // moment of inertia operations +// moment of inertia operations - void inertia_ellipsoid(double *shape, double *quat, double mass, - double *inertia); - void inertia_line(double length, double theta, double mass, - double *inertia); - void inertia_triangle(double *v0, double *v1, double *v2, - double mass, double *inertia); - void inertia_triangle(double *idiag, double *quat, double mass, - double *inertia); -} +void inertia_ellipsoid(double *shape, double *quat, double mass, double *inertia); +void inertia_line(double length, double theta, double mass, double *inertia); +void inertia_triangle(double *v0, double *v1, double *v2, double mass, double *inertia); +void inertia_triangle(double *idiag, double *quat, double mass, double *inertia); +} // namespace MathExtra /* ---------------------------------------------------------------------- copy a vector, return in ans @@ -171,9 +147,9 @@ inline void MathExtra::zero3(double *v) inline void MathExtra::norm3(double *v) { - const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + const double val = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; if (val > 0.0) { - const double scale = 1.0/sqrt(val); + const double scale = 1.0 / sqrt(val); v[0] *= scale; v[1] *= scale; v[2] *= scale; @@ -186,12 +162,12 @@ inline void MathExtra::norm3(double *v) inline void MathExtra::normalize3(const double *v, double *ans) { - const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + const double val = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; if (val > 0.0) { - double scale = 1.0/sqrt(val); - ans[0] = v[0]*scale; - ans[1] = v[1]*scale; - ans[2] = v[2]*scale; + double scale = 1.0 / sqrt(val); + ans[0] = v[0] * scale; + ans[1] = v[1] * scale; + ans[2] = v[2] * scale; } } @@ -199,15 +175,14 @@ inline void MathExtra::normalize3(const double *v, double *ans) scale a vector to length ------------------------------------------------------------------------- */ -inline void MathExtra::snormalize3(const double length, const double *v, - double *ans) +inline void MathExtra::snormalize3(const double length, const double *v, double *ans) { - const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + const double val = v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; if (val > 0.0) { - double scale = length/sqrt(val); - ans[0] = v[0]*scale; - ans[1] = v[1]*scale; - ans[2] = v[2]*scale; + double scale = length / sqrt(val); + ans[0] = v[0] * scale; + ans[1] = v[1] * scale; + ans[2] = v[2] * scale; } } @@ -239,9 +214,9 @@ inline void MathExtra::scale3(const double s, double *v) inline void MathExtra::scale3(const double s, const double *v, double *ans) { - ans[0] = s*v[0]; - ans[1] = s*v[1]; - ans[2] = s*v[2]; + ans[0] = s * v[0]; + ans[1] = s * v[1]; + ans[2] = s * v[2]; } /* ---------------------------------------------------------------------- @@ -259,25 +234,23 @@ inline void MathExtra::add3(const double *v1, const double *v2, double *ans) ans = s*v1 + v2 ------------------------------------------------------------------------- */ -inline void MathExtra::scaleadd3(const double s, const double *v1, - const double *v2, double *ans) +inline void MathExtra::scaleadd3(const double s, const double *v1, const double *v2, double *ans) { - ans[0] = s*v1[0] + v2[0]; - ans[1] = s*v1[1] + v2[1]; - ans[2] = s*v1[2] + v2[2]; + ans[0] = s * v1[0] + v2[0]; + ans[1] = s * v1[1] + v2[1]; + ans[2] = s * v1[2] + v2[2]; } /* ---------------------------------------------------------------------- ans = s1*v1 + s2*v2 ------------------------------------------------------------------------- */ -inline void MathExtra::scaleadd3(const double s1, const double *v1, - const double s2, const double *v2, - double *ans) +inline void MathExtra::scaleadd3(const double s1, const double *v1, const double s2, + const double *v2, double *ans) { - ans[0] = s1*v1[0] + s2*v2[0]; - ans[1] = s1*v1[1] + s2*v2[1]; - ans[2] = s1*v1[2] + s2*v2[2]; + ans[0] = s1 * v1[0] + s2 * v2[0]; + ans[1] = s1 * v1[1] + s2 * v2[1]; + ans[2] = s1 * v1[2] + s2 * v2[2]; } /* ---------------------------------------------------------------------- @@ -297,7 +270,7 @@ inline void MathExtra::sub3(const double *v1, const double *v2, double *ans) inline double MathExtra::len3(const double *v) { - return sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]); + return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]); } /* ---------------------------------------------------------------------- @@ -306,7 +279,7 @@ inline double MathExtra::len3(const double *v) inline double MathExtra::lensq3(const double *v) { - return v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; + return v[0] * v[0] + v[1] * v[1] + v[2] * v[2]; } /* ---------------------------------------------------------------------- @@ -318,7 +291,7 @@ inline double MathExtra::distsq3(const double *v1, const double *v2) double dx = v1[0] - v2[0]; double dy = v1[1] - v2[1]; double dz = v1[2] - v2[2]; - return dx*dx + dy*dy + dz*dz; + return dx * dx + dy * dy + dz * dz; } /* ---------------------------------------------------------------------- @@ -327,7 +300,7 @@ inline double MathExtra::distsq3(const double *v1, const double *v2) inline double MathExtra::dot3(const double *v1, const double *v2) { - return v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]; + return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; } /* ---------------------------------------------------------------------- @@ -336,17 +309,16 @@ inline double MathExtra::dot3(const double *v1, const double *v2) inline void MathExtra::cross3(const double *v1, const double *v2, double *ans) { - ans[0] = v1[1]*v2[2] - v1[2]*v2[1]; - ans[1] = v1[2]*v2[0] - v1[0]*v2[2]; - ans[2] = v1[0]*v2[1] - v1[1]*v2[0]; + ans[0] = v1[1] * v2[2] - v1[2] * v2[1]; + ans[1] = v1[2] * v2[0] - v1[0] * v2[2]; + ans[2] = v1[0] * v2[1] - v1[1] * v2[0]; } /* ---------------------------------------------------------------------- construct matrix from 3 column vectors ------------------------------------------------------------------------- */ -void MathExtra::col2mat(const double *ex, const double *ey, const double *ez, - double m[3][3]) +void MathExtra::col2mat(const double *ex, const double *ey, const double *ez, double m[3][3]) { m[0][0] = ex[0]; m[1][0] = ex[1]; @@ -365,9 +337,9 @@ void MathExtra::col2mat(const double *ex, const double *ey, const double *ez, inline double MathExtra::det3(const double m[3][3]) { - double ans = m[0][0]*m[1][1]*m[2][2] - m[0][0]*m[1][2]*m[2][1] - - m[1][0]*m[0][1]*m[2][2] + m[1][0]*m[0][2]*m[2][1] + - m[2][0]*m[0][1]*m[1][2] - m[2][0]*m[0][2]*m[1][1]; + double ans = m[0][0] * m[1][1] * m[2][2] - m[0][0] * m[1][2] * m[2][1] - + m[1][0] * m[0][1] * m[2][2] + m[1][0] * m[0][2] * m[2][1] + m[2][0] * m[0][1] * m[1][2] - + m[2][0] * m[0][2] * m[1][1]; return ans; } @@ -375,108 +347,104 @@ inline double MathExtra::det3(const double m[3][3]) diagonal matrix times a full matrix ------------------------------------------------------------------------- */ -inline void MathExtra::diag_times3(const double *d, const double m[3][3], - double ans[3][3]) +inline void MathExtra::diag_times3(const double *d, const double m[3][3], double ans[3][3]) { - ans[0][0] = d[0]*m[0][0]; - ans[0][1] = d[0]*m[0][1]; - ans[0][2] = d[0]*m[0][2]; - ans[1][0] = d[1]*m[1][0]; - ans[1][1] = d[1]*m[1][1]; - ans[1][2] = d[1]*m[1][2]; - ans[2][0] = d[2]*m[2][0]; - ans[2][1] = d[2]*m[2][1]; - ans[2][2] = d[2]*m[2][2]; + ans[0][0] = d[0] * m[0][0]; + ans[0][1] = d[0] * m[0][1]; + ans[0][2] = d[0] * m[0][2]; + ans[1][0] = d[1] * m[1][0]; + ans[1][1] = d[1] * m[1][1]; + ans[1][2] = d[1] * m[1][2]; + ans[2][0] = d[2] * m[2][0]; + ans[2][1] = d[2] * m[2][1]; + ans[2][2] = d[2] * m[2][2]; } /* ---------------------------------------------------------------------- full matrix times a diagonal matrix ------------------------------------------------------------------------- */ -void MathExtra::times3_diag(const double m[3][3], const double *d, - double ans[3][3]) +void MathExtra::times3_diag(const double m[3][3], const double *d, double ans[3][3]) { - ans[0][0] = m[0][0]*d[0]; - ans[0][1] = m[0][1]*d[1]; - ans[0][2] = m[0][2]*d[2]; - ans[1][0] = m[1][0]*d[0]; - ans[1][1] = m[1][1]*d[1]; - ans[1][2] = m[1][2]*d[2]; - ans[2][0] = m[2][0]*d[0]; - ans[2][1] = m[2][1]*d[1]; - ans[2][2] = m[2][2]*d[2]; + ans[0][0] = m[0][0] * d[0]; + ans[0][1] = m[0][1] * d[1]; + ans[0][2] = m[0][2] * d[2]; + ans[1][0] = m[1][0] * d[0]; + ans[1][1] = m[1][1] * d[1]; + ans[1][2] = m[1][2] * d[2]; + ans[2][0] = m[2][0] * d[0]; + ans[2][1] = m[2][1] * d[1]; + ans[2][2] = m[2][2] * d[2]; } /* ---------------------------------------------------------------------- add two matrices ------------------------------------------------------------------------- */ -inline void MathExtra::plus3(const double m[3][3], const double m2[3][3], - double ans[3][3]) +inline void MathExtra::plus3(const double m[3][3], const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]+m2[0][0]; - ans[0][1] = m[0][1]+m2[0][1]; - ans[0][2] = m[0][2]+m2[0][2]; - ans[1][0] = m[1][0]+m2[1][0]; - ans[1][1] = m[1][1]+m2[1][1]; - ans[1][2] = m[1][2]+m2[1][2]; - ans[2][0] = m[2][0]+m2[2][0]; - ans[2][1] = m[2][1]+m2[2][1]; - ans[2][2] = m[2][2]+m2[2][2]; + ans[0][0] = m[0][0] + m2[0][0]; + ans[0][1] = m[0][1] + m2[0][1]; + ans[0][2] = m[0][2] + m2[0][2]; + ans[1][0] = m[1][0] + m2[1][0]; + ans[1][1] = m[1][1] + m2[1][1]; + ans[1][2] = m[1][2] + m2[1][2]; + ans[2][0] = m[2][0] + m2[2][0]; + ans[2][1] = m[2][1] + m2[2][1]; + ans[2][2] = m[2][2] + m2[2][2]; } /* ---------------------------------------------------------------------- multiply mat1 times mat2 ------------------------------------------------------------------------- */ -inline void MathExtra::times3(const double m[3][3], const double m2[3][3], - double ans[3][3]) +inline void MathExtra::times3(const double m[3][3], const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]*m2[0][0] + m[0][1]*m2[1][0] + m[0][2]*m2[2][0]; - ans[0][1] = m[0][0]*m2[0][1] + m[0][1]*m2[1][1] + m[0][2]*m2[2][1]; - ans[0][2] = m[0][0]*m2[0][2] + m[0][1]*m2[1][2] + m[0][2]*m2[2][2]; - ans[1][0] = m[1][0]*m2[0][0] + m[1][1]*m2[1][0] + m[1][2]*m2[2][0]; - ans[1][1] = m[1][0]*m2[0][1] + m[1][1]*m2[1][1] + m[1][2]*m2[2][1]; - ans[1][2] = m[1][0]*m2[0][2] + m[1][1]*m2[1][2] + m[1][2]*m2[2][2]; - ans[2][0] = m[2][0]*m2[0][0] + m[2][1]*m2[1][0] + m[2][2]*m2[2][0]; - ans[2][1] = m[2][0]*m2[0][1] + m[2][1]*m2[1][1] + m[2][2]*m2[2][1]; - ans[2][2] = m[2][0]*m2[0][2] + m[2][1]*m2[1][2] + m[2][2]*m2[2][2]; + ans[0][0] = m[0][0] * m2[0][0] + m[0][1] * m2[1][0] + m[0][2] * m2[2][0]; + ans[0][1] = m[0][0] * m2[0][1] + m[0][1] * m2[1][1] + m[0][2] * m2[2][1]; + ans[0][2] = m[0][0] * m2[0][2] + m[0][1] * m2[1][2] + m[0][2] * m2[2][2]; + ans[1][0] = m[1][0] * m2[0][0] + m[1][1] * m2[1][0] + m[1][2] * m2[2][0]; + ans[1][1] = m[1][0] * m2[0][1] + m[1][1] * m2[1][1] + m[1][2] * m2[2][1]; + ans[1][2] = m[1][0] * m2[0][2] + m[1][1] * m2[1][2] + m[1][2] * m2[2][2]; + ans[2][0] = m[2][0] * m2[0][0] + m[2][1] * m2[1][0] + m[2][2] * m2[2][0]; + ans[2][1] = m[2][0] * m2[0][1] + m[2][1] * m2[1][1] + m[2][2] * m2[2][1]; + ans[2][2] = m[2][0] * m2[0][2] + m[2][1] * m2[1][2] + m[2][2] * m2[2][2]; } /* ---------------------------------------------------------------------- multiply the transpose of mat1 times mat2 ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_times3(const double m[3][3], - const double m2[3][3],double ans[3][3]) +inline void MathExtra::transpose_times3(const double m[3][3], const double m2[3][3], + double ans[3][3]) { - ans[0][0] = m[0][0]*m2[0][0] + m[1][0]*m2[1][0] + m[2][0]*m2[2][0]; - ans[0][1] = m[0][0]*m2[0][1] + m[1][0]*m2[1][1] + m[2][0]*m2[2][1]; - ans[0][2] = m[0][0]*m2[0][2] + m[1][0]*m2[1][2] + m[2][0]*m2[2][2]; - ans[1][0] = m[0][1]*m2[0][0] + m[1][1]*m2[1][0] + m[2][1]*m2[2][0]; - ans[1][1] = m[0][1]*m2[0][1] + m[1][1]*m2[1][1] + m[2][1]*m2[2][1]; - ans[1][2] = m[0][1]*m2[0][2] + m[1][1]*m2[1][2] + m[2][1]*m2[2][2]; - ans[2][0] = m[0][2]*m2[0][0] + m[1][2]*m2[1][0] + m[2][2]*m2[2][0]; - ans[2][1] = m[0][2]*m2[0][1] + m[1][2]*m2[1][1] + m[2][2]*m2[2][1]; - ans[2][2] = m[0][2]*m2[0][2] + m[1][2]*m2[1][2] + m[2][2]*m2[2][2]; + ans[0][0] = m[0][0] * m2[0][0] + m[1][0] * m2[1][0] + m[2][0] * m2[2][0]; + ans[0][1] = m[0][0] * m2[0][1] + m[1][0] * m2[1][1] + m[2][0] * m2[2][1]; + ans[0][2] = m[0][0] * m2[0][2] + m[1][0] * m2[1][2] + m[2][0] * m2[2][2]; + ans[1][0] = m[0][1] * m2[0][0] + m[1][1] * m2[1][0] + m[2][1] * m2[2][0]; + ans[1][1] = m[0][1] * m2[0][1] + m[1][1] * m2[1][1] + m[2][1] * m2[2][1]; + ans[1][2] = m[0][1] * m2[0][2] + m[1][1] * m2[1][2] + m[2][1] * m2[2][2]; + ans[2][0] = m[0][2] * m2[0][0] + m[1][2] * m2[1][0] + m[2][2] * m2[2][0]; + ans[2][1] = m[0][2] * m2[0][1] + m[1][2] * m2[1][1] + m[2][2] * m2[2][1]; + ans[2][2] = m[0][2] * m2[0][2] + m[1][2] * m2[1][2] + m[2][2] * m2[2][2]; } /* ---------------------------------------------------------------------- multiply mat1 times transpose of mat2 ------------------------------------------------------------------------- */ -inline void MathExtra::times3_transpose(const double m[3][3], - const double m2[3][3],double ans[3][3]) +inline void MathExtra::times3_transpose(const double m[3][3], const double m2[3][3], + double ans[3][3]) { - ans[0][0] = m[0][0]*m2[0][0] + m[0][1]*m2[0][1] + m[0][2]*m2[0][2]; - ans[0][1] = m[0][0]*m2[1][0] + m[0][1]*m2[1][1] + m[0][2]*m2[1][2]; - ans[0][2] = m[0][0]*m2[2][0] + m[0][1]*m2[2][1] + m[0][2]*m2[2][2]; - ans[1][0] = m[1][0]*m2[0][0] + m[1][1]*m2[0][1] + m[1][2]*m2[0][2]; - ans[1][1] = m[1][0]*m2[1][0] + m[1][1]*m2[1][1] + m[1][2]*m2[1][2]; - ans[1][2] = m[1][0]*m2[2][0] + m[1][1]*m2[2][1] + m[1][2]*m2[2][2]; - ans[2][0] = m[2][0]*m2[0][0] + m[2][1]*m2[0][1] + m[2][2]*m2[0][2]; - ans[2][1] = m[2][0]*m2[1][0] + m[2][1]*m2[1][1] + m[2][2]*m2[1][2]; - ans[2][2] = m[2][0]*m2[2][0] + m[2][1]*m2[2][1] + m[2][2]*m2[2][2]; + ans[0][0] = m[0][0] * m2[0][0] + m[0][1] * m2[0][1] + m[0][2] * m2[0][2]; + ans[0][1] = m[0][0] * m2[1][0] + m[0][1] * m2[1][1] + m[0][2] * m2[1][2]; + ans[0][2] = m[0][0] * m2[2][0] + m[0][1] * m2[2][1] + m[0][2] * m2[2][2]; + ans[1][0] = m[1][0] * m2[0][0] + m[1][1] * m2[0][1] + m[1][2] * m2[0][2]; + ans[1][1] = m[1][0] * m2[1][0] + m[1][1] * m2[1][1] + m[1][2] * m2[1][2]; + ans[1][2] = m[1][0] * m2[2][0] + m[1][1] * m2[2][1] + m[1][2] * m2[2][2]; + ans[2][0] = m[2][0] * m2[0][0] + m[2][1] * m2[0][1] + m[2][2] * m2[0][2]; + ans[2][1] = m[2][0] * m2[1][0] + m[2][1] * m2[1][1] + m[2][2] * m2[1][2]; + ans[2][2] = m[2][0] * m2[2][0] + m[2][1] * m2[2][1] + m[2][2] * m2[2][2]; } /* ---------------------------------------------------------------------- @@ -486,98 +454,93 @@ inline void MathExtra::times3_transpose(const double m[3][3], inline void MathExtra::invert3(const double m[3][3], double ans[3][3]) { - double den = m[0][0]*m[1][1]*m[2][2]-m[0][0]*m[1][2]*m[2][1]; - den += -m[1][0]*m[0][1]*m[2][2]+m[1][0]*m[0][2]*m[2][1]; - den += m[2][0]*m[0][1]*m[1][2]-m[2][0]*m[0][2]*m[1][1]; + double den = m[0][0] * m[1][1] * m[2][2] - m[0][0] * m[1][2] * m[2][1]; + den += -m[1][0] * m[0][1] * m[2][2] + m[1][0] * m[0][2] * m[2][1]; + den += m[2][0] * m[0][1] * m[1][2] - m[2][0] * m[0][2] * m[1][1]; - ans[0][0] = (m[1][1]*m[2][2]-m[1][2]*m[2][1]) / den; - ans[0][1] = -(m[0][1]*m[2][2]-m[0][2]*m[2][1]) / den; - ans[0][2] = (m[0][1]*m[1][2]-m[0][2]*m[1][1]) / den; - ans[1][0] = -(m[1][0]*m[2][2]-m[1][2]*m[2][0]) / den; - ans[1][1] = (m[0][0]*m[2][2]-m[0][2]*m[2][0]) / den; - ans[1][2] = -(m[0][0]*m[1][2]-m[0][2]*m[1][0]) / den; - ans[2][0] = (m[1][0]*m[2][1]-m[1][1]*m[2][0]) / den; - ans[2][1] = -(m[0][0]*m[2][1]-m[0][1]*m[2][0]) / den; - ans[2][2] = (m[0][0]*m[1][1]-m[0][1]*m[1][0]) / den; + ans[0][0] = (m[1][1] * m[2][2] - m[1][2] * m[2][1]) / den; + ans[0][1] = -(m[0][1] * m[2][2] - m[0][2] * m[2][1]) / den; + ans[0][2] = (m[0][1] * m[1][2] - m[0][2] * m[1][1]) / den; + ans[1][0] = -(m[1][0] * m[2][2] - m[1][2] * m[2][0]) / den; + ans[1][1] = (m[0][0] * m[2][2] - m[0][2] * m[2][0]) / den; + ans[1][2] = -(m[0][0] * m[1][2] - m[0][2] * m[1][0]) / den; + ans[2][0] = (m[1][0] * m[2][1] - m[1][1] * m[2][0]) / den; + ans[2][1] = -(m[0][0] * m[2][1] - m[0][1] * m[2][0]) / den; + ans[2][2] = (m[0][0] * m[1][1] - m[0][1] * m[1][0]) / den; } /* ---------------------------------------------------------------------- matrix times vector ------------------------------------------------------------------------- */ -inline void MathExtra::matvec(const double m[3][3], const double *v, +inline void MathExtra::matvec(const double m[3][3], const double *v, double *ans) +{ + ans[0] = m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2]; + ans[1] = m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2]; + ans[2] = m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2]; +} + +/* ---------------------------------------------------------------------- + matrix times vector +------------------------------------------------------------------------- */ + +inline void MathExtra::matvec(const double *ex, const double *ey, const double *ez, const double *v, double *ans) { - ans[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2]; - ans[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2]; - ans[2] = m[2][0]*v[0] + m[2][1]*v[1] + m[2][2]*v[2]; -} - -/* ---------------------------------------------------------------------- - matrix times vector -------------------------------------------------------------------------- */ - -inline void MathExtra::matvec(const double *ex, const double *ey, - const double *ez, const double *v, double *ans) -{ - ans[0] = ex[0]*v[0] + ey[0]*v[1] + ez[0]*v[2]; - ans[1] = ex[1]*v[0] + ey[1]*v[1] + ez[1]*v[2]; - ans[2] = ex[2]*v[0] + ey[2]*v[1] + ez[2]*v[2]; + ans[0] = ex[0] * v[0] + ey[0] * v[1] + ez[0] * v[2]; + ans[1] = ex[1] * v[0] + ey[1] * v[1] + ez[1] * v[2]; + ans[2] = ex[2] * v[0] + ey[2] * v[1] + ez[2] * v[2]; } /* ---------------------------------------------------------------------- transposed matrix times vector ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_matvec(const double m[3][3], const double *v, - double *ans) +inline void MathExtra::transpose_matvec(const double m[3][3], const double *v, double *ans) { - ans[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2]; - ans[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2]; - ans[2] = m[0][2]*v[0] + m[1][2]*v[1] + m[2][2]*v[2]; + ans[0] = m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2]; + ans[1] = m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2]; + ans[2] = m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2]; } /* ---------------------------------------------------------------------- transposed matrix times vector ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_matvec(const double *ex, const double *ey, - const double *ez, const double *v, - double *ans) +inline void MathExtra::transpose_matvec(const double *ex, const double *ey, const double *ez, + const double *v, double *ans) { - ans[0] = ex[0]*v[0] + ex[1]*v[1] + ex[2]*v[2]; - ans[1] = ey[0]*v[0] + ey[1]*v[1] + ey[2]*v[2]; - ans[2] = ez[0]*v[0] + ez[1]*v[1] + ez[2]*v[2]; + ans[0] = ex[0] * v[0] + ex[1] * v[1] + ex[2] * v[2]; + ans[1] = ey[0] * v[0] + ey[1] * v[1] + ey[2] * v[2]; + ans[2] = ez[0] * v[0] + ez[1] * v[1] + ez[2] * v[2]; } /* ---------------------------------------------------------------------- transposed matrix times diagonal matrix ------------------------------------------------------------------------- */ -inline void MathExtra::transpose_diag3(const double m[3][3], const double *d, - double ans[3][3]) +inline void MathExtra::transpose_diag3(const double m[3][3], const double *d, double ans[3][3]) { - ans[0][0] = m[0][0]*d[0]; - ans[0][1] = m[1][0]*d[1]; - ans[0][2] = m[2][0]*d[2]; - ans[1][0] = m[0][1]*d[0]; - ans[1][1] = m[1][1]*d[1]; - ans[1][2] = m[2][1]*d[2]; - ans[2][0] = m[0][2]*d[0]; - ans[2][1] = m[1][2]*d[1]; - ans[2][2] = m[2][2]*d[2]; + ans[0][0] = m[0][0] * d[0]; + ans[0][1] = m[1][0] * d[1]; + ans[0][2] = m[2][0] * d[2]; + ans[1][0] = m[0][1] * d[0]; + ans[1][1] = m[1][1] * d[1]; + ans[1][2] = m[2][1] * d[2]; + ans[2][0] = m[0][2] * d[0]; + ans[2][1] = m[1][2] * d[1]; + ans[2][2] = m[2][2] * d[2]; } /* ---------------------------------------------------------------------- row vector times matrix ------------------------------------------------------------------------- */ -inline void MathExtra::vecmat(const double *v, const double m[3][3], - double *ans) +inline void MathExtra::vecmat(const double *v, const double m[3][3], double *ans) { - ans[0] = v[0]*m[0][0] + v[1]*m[1][0] + v[2]*m[2][0]; - ans[1] = v[0]*m[0][1] + v[1]*m[1][1] + v[2]*m[2][1]; - ans[2] = v[0]*m[0][2] + v[1]*m[1][2] + v[2]*m[2][2]; + ans[0] = v[0] * m[0][0] + v[1] * m[1][0] + v[2] * m[2][0]; + ans[1] = v[0] * m[0][1] + v[1] * m[1][1] + v[2] * m[2][1]; + ans[2] = v[0] * m[0][2] + v[1] * m[1][2] + v[2] * m[2][2]; } /* ---------------------------------------------------------------------- @@ -586,9 +549,15 @@ inline void MathExtra::vecmat(const double *v, const double m[3][3], inline void MathExtra::scalar_times3(const double f, double m[3][3]) { - m[0][0] *= f; m[0][1] *= f; m[0][2] *= f; - m[1][0] *= f; m[1][1] *= f; m[1][2] *= f; - m[2][0] *= f; m[2][1] *= f; m[2][2] *= f; + m[0][0] *= f; + m[0][1] *= f; + m[0][2] *= f; + m[1][0] *= f; + m[1][1] *= f; + m[1][2] *= f; + m[2][0] *= f; + m[2][1] *= f; + m[2][2] *= f; } /* ---------------------------------------------------------------------- @@ -596,15 +565,14 @@ inline void MathExtra::scalar_times3(const double f, double m[3][3]) upper-triangular 3x3, stored as 6-vector in Voigt ordering ------------------------------------------------------------------------- */ -inline void MathExtra::multiply_shape_shape(const double *one, - const double *two, double *ans) +inline void MathExtra::multiply_shape_shape(const double *one, const double *two, double *ans) { - ans[0] = one[0]*two[0]; - ans[1] = one[1]*two[1]; - ans[2] = one[2]*two[2]; - ans[3] = one[1]*two[3] + one[3]*two[2]; - ans[4] = one[0]*two[4] + one[5]*two[3] + one[4]*two[2]; - ans[5] = one[0]*two[5] + one[5]*two[1]; + ans[0] = one[0] * two[0]; + ans[1] = one[1] * two[1]; + ans[2] = one[2] * two[2]; + ans[3] = one[1] * two[3] + one[3] * two[2]; + ans[4] = one[0] * two[4] + one[5] * two[3] + one[4] * two[2]; + ans[5] = one[0] * two[5] + one[5] * two[1]; } /* ---------------------------------------------------------------------- @@ -613,7 +581,7 @@ inline void MathExtra::multiply_shape_shape(const double *one, inline void MathExtra::qnormalize(double *q) { - double norm = 1.0 / sqrt(q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]); + double norm = 1.0 / sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]); q[0] *= norm; q[1] *= norm; q[2] *= norm; @@ -639,10 +607,10 @@ inline void MathExtra::qconjugate(double *q, double *qc) inline void MathExtra::vecquat(double *a, double *b, double *c) { - c[0] = -a[0]*b[1] - a[1]*b[2] - a[2]*b[3]; - c[1] = b[0]*a[0] + a[1]*b[3] - a[2]*b[2]; - c[2] = b[0]*a[1] + a[2]*b[1] - a[0]*b[3]; - c[3] = b[0]*a[2] + a[0]*b[2] - a[1]*b[1]; + c[0] = -a[0] * b[1] - a[1] * b[2] - a[2] * b[3]; + c[1] = b[0] * a[0] + a[1] * b[3] - a[2] * b[2]; + c[2] = b[0] * a[1] + a[2] * b[1] - a[0] * b[3]; + c[3] = b[0] * a[2] + a[0] * b[2] - a[1] * b[1]; } /* ---------------------------------------------------------------------- @@ -651,10 +619,10 @@ inline void MathExtra::vecquat(double *a, double *b, double *c) inline void MathExtra::quatvec(double *a, double *b, double *c) { - c[0] = -a[1]*b[0] - a[2]*b[1] - a[3]*b[2]; - c[1] = a[0]*b[0] + a[2]*b[2] - a[3]*b[1]; - c[2] = a[0]*b[1] + a[3]*b[0] - a[1]*b[2]; - c[3] = a[0]*b[2] + a[1]*b[1] - a[2]*b[0]; + c[0] = -a[1] * b[0] - a[2] * b[1] - a[3] * b[2]; + c[1] = a[0] * b[0] + a[2] * b[2] - a[3] * b[1]; + c[2] = a[0] * b[1] + a[3] * b[0] - a[1] * b[2]; + c[3] = a[0] * b[2] + a[1] * b[1] - a[2] * b[0]; } /* ---------------------------------------------------------------------- @@ -663,10 +631,10 @@ inline void MathExtra::quatvec(double *a, double *b, double *c) inline void MathExtra::quatquat(double *a, double *b, double *c) { - c[0] = a[0]*b[0] - a[1]*b[1] - a[2]*b[2] - a[3]*b[3]; - c[1] = a[0]*b[1] + b[0]*a[1] + a[2]*b[3] - a[3]*b[2]; - c[2] = a[0]*b[2] + b[0]*a[2] + a[3]*b[1] - a[1]*b[3]; - c[3] = a[0]*b[3] + b[0]*a[3] + a[1]*b[2] - a[2]*b[1]; + c[0] = a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a[3] * b[3]; + c[1] = a[0] * b[1] + b[0] * a[1] + a[2] * b[3] - a[3] * b[2]; + c[2] = a[0] * b[2] + b[0] * a[2] + a[3] * b[1] - a[1] * b[3]; + c[3] = a[0] * b[3] + b[0] * a[3] + a[1] * b[2] - a[2] * b[1]; } /* ---------------------------------------------------------------------- @@ -678,9 +646,9 @@ inline void MathExtra::quatquat(double *a, double *b, double *c) inline void MathExtra::invquatvec(double *a, double *b, double *c) { - c[0] = -a[1]*b[0] + a[0]*b[1] + a[3]*b[2] - a[2]*b[3]; - c[1] = -a[2]*b[0] - a[3]*b[1] + a[0]*b[2] + a[1]*b[3]; - c[2] = -a[3]*b[0] + a[2]*b[1] - a[1]*b[2] + a[0]*b[3]; + c[0] = -a[1] * b[0] + a[0] * b[1] + a[3] * b[2] - a[2] * b[3]; + c[1] = -a[2] * b[0] - a[3] * b[1] + a[0] * b[2] + a[1] * b[3]; + c[2] = -a[3] * b[0] + a[2] * b[1] - a[1] * b[2] + a[0] * b[3]; } /* ---------------------------------------------------------------------- @@ -688,23 +656,21 @@ inline void MathExtra::invquatvec(double *a, double *b, double *c) v MUST be a unit vector ------------------------------------------------------------------------- */ -inline void MathExtra::axisangle_to_quat(const double *v, const double angle, - double *quat) +inline void MathExtra::axisangle_to_quat(const double *v, const double angle, double *quat) { - double halfa = 0.5*angle; + double halfa = 0.5 * angle; double sina = sin(halfa); quat[0] = cos(halfa); - quat[1] = v[0]*sina; - quat[2] = v[1]*sina; - quat[3] = v[2]*sina; + quat[1] = v[0] * sina; + quat[2] = v[1] * sina; + quat[3] = v[2] * sina; } /* ---------------------------------------------------------------------- Apply principal rotation generator about x to rotation matrix m ------------------------------------------------------------------------- */ -inline void MathExtra::rotation_generator_x(const double m[3][3], - double ans[3][3]) +inline void MathExtra::rotation_generator_x(const double m[3][3], double ans[3][3]) { ans[0][0] = 0; ans[0][1] = -m[0][2]; @@ -721,8 +687,7 @@ inline void MathExtra::rotation_generator_x(const double m[3][3], Apply principal rotation generator about y to rotation matrix m ------------------------------------------------------------------------- */ -inline void MathExtra::rotation_generator_y(const double m[3][3], - double ans[3][3]) +inline void MathExtra::rotation_generator_y(const double m[3][3], double ans[3][3]) { ans[0][0] = m[0][2]; ans[0][1] = 0; @@ -739,8 +704,7 @@ inline void MathExtra::rotation_generator_y(const double m[3][3], Apply principal rotation generator about z to rotation matrix m ------------------------------------------------------------------------- */ -inline void MathExtra::rotation_generator_z(const double m[3][3], - double ans[3][3]) +inline void MathExtra::rotation_generator_z(const double m[3][3], double ans[3][3]) { ans[0][0] = -m[0][1]; ans[0][1] = m[0][0]; @@ -753,7 +717,7 @@ inline void MathExtra::rotation_generator_z(const double m[3][3], ans[2][2] = 0; } - // set matrix to zero +// set matrix to zero inline void MathExtra::zeromat3(double m[3][3]) { @@ -771,58 +735,60 @@ inline void MathExtra::zeromat3(double **m) // add two matrices -inline void MathExtra::plus3(const double m[3][3], double **m2, - double **ans) +inline void MathExtra::plus3(const double m[3][3], double **m2, double **ans) { - ans[0][0] = m[0][0]+m2[0][0]; - ans[0][1] = m[0][1]+m2[0][1]; - ans[0][2] = m[0][2]+m2[0][2]; - ans[1][0] = m[1][0]+m2[1][0]; - ans[1][1] = m[1][1]+m2[1][1]; - ans[1][2] = m[1][2]+m2[1][2]; - ans[2][0] = m[2][0]+m2[2][0]; - ans[2][1] = m[2][1]+m2[2][1]; - ans[2][2] = m[2][2]+m2[2][2]; + ans[0][0] = m[0][0] + m2[0][0]; + ans[0][1] = m[0][1] + m2[0][1]; + ans[0][2] = m[0][2] + m2[0][2]; + ans[1][0] = m[1][0] + m2[1][0]; + ans[1][1] = m[1][1] + m2[1][1]; + ans[1][2] = m[1][2] + m2[1][2]; + ans[2][0] = m[2][0] + m2[2][0]; + ans[2][1] = m[2][1] + m2[2][1]; + ans[2][2] = m[2][2] + m2[2][2]; } // subtract two matrices -inline void MathExtra::minus3(const double m[3][3], const double m2[3][3], - double ans[3][3]) +inline void MathExtra::minus3(const double m[3][3], const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]-m2[0][0]; - ans[0][1] = m[0][1]-m2[0][1]; - ans[0][2] = m[0][2]-m2[0][2]; - ans[1][0] = m[1][0]-m2[1][0]; - ans[1][1] = m[1][1]-m2[1][1]; - ans[1][2] = m[1][2]-m2[1][2]; - ans[2][0] = m[2][0]-m2[2][0]; - ans[2][1] = m[2][1]-m2[2][1]; - ans[2][2] = m[2][2]-m2[2][2]; + ans[0][0] = m[0][0] - m2[0][0]; + ans[0][1] = m[0][1] - m2[0][1]; + ans[0][2] = m[0][2] - m2[0][2]; + ans[1][0] = m[1][0] - m2[1][0]; + ans[1][1] = m[1][1] - m2[1][1]; + ans[1][2] = m[1][2] - m2[1][2]; + ans[2][0] = m[2][0] - m2[2][0]; + ans[2][1] = m[2][1] - m2[2][1]; + ans[2][2] = m[2][2] - m2[2][2]; } -inline void MathExtra::minus3(double **m, const double m2[3][3], - double ans[3][3]) +inline void MathExtra::minus3(double **m, const double m2[3][3], double ans[3][3]) { - ans[0][0] = m[0][0]-m2[0][0]; - ans[0][1] = m[0][1]-m2[0][1]; - ans[0][2] = m[0][2]-m2[0][2]; - ans[1][0] = m[1][0]-m2[1][0]; - ans[1][1] = m[1][1]-m2[1][1]; - ans[1][2] = m[1][2]-m2[1][2]; - ans[2][0] = m[2][0]-m2[2][0]; - ans[2][1] = m[2][1]-m2[2][1]; - ans[2][2] = m[2][2]-m2[2][2]; + ans[0][0] = m[0][0] - m2[0][0]; + ans[0][1] = m[0][1] - m2[0][1]; + ans[0][2] = m[0][2] - m2[0][2]; + ans[1][0] = m[1][0] - m2[1][0]; + ans[1][1] = m[1][1] - m2[1][1]; + ans[1][2] = m[1][2] - m2[1][2]; + ans[2][0] = m[2][0] - m2[2][0]; + ans[2][1] = m[2][1] - m2[2][1]; + ans[2][2] = m[2][2] - m2[2][2]; } // compute outer product of two vectors -inline void MathExtra::outer3(const double *v1, const double *v2, - double ans[3][3]) +inline void MathExtra::outer3(const double *v1, const double *v2, double ans[3][3]) { - ans[0][0] = v1[0]*v2[0]; ans[0][1] = v1[0]*v2[1]; ans[0][2] = v1[0]*v2[2]; - ans[1][0] = v1[1]*v2[0]; ans[1][1] = v1[1]*v2[1]; ans[1][2] = v1[1]*v2[2]; - ans[2][0] = v1[2]*v2[0]; ans[2][1] = v1[2]*v2[1]; ans[2][2] = v1[2]*v2[2]; + ans[0][0] = v1[0] * v2[0]; + ans[0][1] = v1[0] * v2[1]; + ans[0][2] = v1[0] * v2[2]; + ans[1][0] = v1[1] * v2[0]; + ans[1][1] = v1[1] * v2[1]; + ans[1][2] = v1[1] * v2[2]; + ans[2][0] = v1[2] * v2[0]; + ans[2][1] = v1[2] * v2[1]; + ans[2][2] = v1[2] * v2[2]; } #endif diff --git a/src/math_special.h b/src/math_special.h index cf435db281..f21e80e75f 100644 --- a/src/math_special.h +++ b/src/math_special.h @@ -31,15 +31,17 @@ namespace MathSpecial { // fast 2**x function without argument checks for little endian CPUs extern double exp2_x86(double x); -// fast e**x function for little endian CPUs, falls back to libc on other platforms + // fast e**x function for little endian CPUs, falls back to libc on other platforms extern double fm_exp(double x); // scaled error function complement exp(x*x)*erfc(x) for coul/long styles static inline double my_erfcx(const double x) { - if (x >= 0.0) return erfcx_y100(400.0/(4.0+x)); - else return 2.0*exp(x*x) - erfcx_y100(400.0/(4.0-x)); + if (x >= 0.0) + return erfcx_y100(400.0 / (4.0 + x)); + else + return 2.0 * exp(x * x) - erfcx_y100(400.0 / (4.0 - x)); } // exp(-x*x) for coul/long styles @@ -47,7 +49,7 @@ namespace MathSpecial { static inline double expmsq(double x) { x *= x; - x *= 1.4426950408889634074; // log_2(e) + x *= 1.4426950408889634074; // log_2(e) #if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ return (x < 1023.0) ? exp2_x86(-x) : 0.0; #else @@ -57,10 +59,10 @@ namespace MathSpecial { // x**2, use instead of pow(x,2.0) - static inline double square(const double &x) { return x*x; } + static inline double square(const double &x) { return x * x; } // x**3, use instead of pow(x,3.0) - static inline double cube(const double &x) { return x*x*x; } + static inline double cube(const double &x) { return x * x * x; } // return -1.0 for odd n, 1.0 for even n, like pow(-1.0,n) static inline double powsign(const int n) { return (n & 1) ? -1.0 : 1.0; } @@ -68,34 +70,36 @@ namespace MathSpecial { // optimized version of pow(x,n) with n being integer // up to 10x faster than pow(x,y) - static inline double powint(const double &x, const int n) { - double yy,ww; + static inline double powint(const double &x, const int n) + { + double yy, ww; if (x == 0.0) return 0.0; int nn = (n > 0) ? n : -n; ww = x; - for (yy = 1.0; nn != 0; nn >>= 1, ww *=ww) + for (yy = 1.0; nn != 0; nn >>= 1, ww *= ww) if (nn & 1) yy *= ww; - return (n > 0) ? yy : 1.0/yy; + return (n > 0) ? yy : 1.0 / yy; } // optimized version of (sin(x)/x)**n with n being a _positive_ integer - static inline double powsinxx(const double &x, int n) { - double yy,ww; + static inline double powsinxx(const double &x, int n) + { + double yy, ww; if (x == 0.0) return 1.0; - ww = sin(x)/x; + ww = sin(x) / x; - for (yy = 1.0; n != 0; n >>= 1, ww *=ww) + for (yy = 1.0; n != 0; n >>= 1, ww *= ww) if (n & 1) yy *= ww; return yy; } -} -} +} // namespace MathSpecial +} // namespace LAMMPS_NS #endif diff --git a/src/memory.h b/src/memory.h index b3ce1aa667..b363b7ad0b 100644 --- a/src/memory.h +++ b/src/memory.h @@ -27,7 +27,7 @@ class Memory : protected Pointers { void sfree(void *); void fail(const char *); -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create/grow/destroy vecs and multidim arrays with contiguous memory blocks only use with primitive data types, e.g. 1d vec of ints, 2d array of doubles fail() prevents use with pointers, @@ -36,90 +36,92 @@ class Memory : protected Pointers { for these other cases, use smalloc/srealloc/sfree directly ------------------------------------------------------------------------- */ -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 1d array ------------------------------------------------------------------------- */ - template - TYPE *create(TYPE *&array, int n, const char *name) + template TYPE *create(TYPE *&array, int n, const char *name) { bigint nbytes = ((bigint) sizeof(TYPE)) * n; - array = (TYPE *) smalloc(nbytes,name); + array = (TYPE *) smalloc(nbytes, name); return array; } - template - TYPE **create(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return nullptr;} + template TYPE **create(TYPE **& /*array*/, int /*n*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1d array ------------------------------------------------------------------------- */ - template - TYPE *grow(TYPE *&array, int n, const char *name) + template TYPE *grow(TYPE *&array, int n, const char *name) { - if (array == nullptr) return create(array,n,name); + if (array == nullptr) return create(array, n, name); bigint nbytes = ((bigint) sizeof(TYPE)) * n; - array = (TYPE *) srealloc(array,nbytes,name); + array = (TYPE *) srealloc(array, nbytes, name); return array; } - template - TYPE **grow(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return nullptr;} + template TYPE **grow(TYPE **& /*array*/, int /*n*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 1d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE *&array) { + template void destroy(TYPE *&array) + { sfree(array); array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 1d array with index from nlo to nhi inclusive cannot grow it ------------------------------------------------------------------------- */ - template - TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name) + template TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * (nhi-nlo+1); - array = (TYPE *) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * (nhi - nlo + 1); + array = (TYPE *) smalloc(nbytes, name); array -= nlo; return array; } template TYPE **create1d_offset(TYPE **& /*array*/, int /*nlo*/, int /*nhi*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 1d array with index offset ------------------------------------------------------------------------- */ - template - void destroy1d_offset(TYPE *&array, int offset) + template void destroy1d_offset(TYPE *&array, int offset) { if (array) sfree(&array[offset]); array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 2d array ------------------------------------------------------------------------- */ - template - TYPE **create(TYPE **&array, int n1, int n2, const char *name) + template TYPE **create(TYPE **&array, int n1, int n2, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2; - TYPE *data = (TYPE *) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2; + TYPE *data = (TYPE *) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE *)) * n1; - array = (TYPE **) smalloc(nbytes,name); + array = (TYPE **) smalloc(nbytes, name); bigint n = 0; for (int i = 0; i < n1; i++) { @@ -131,22 +133,24 @@ class Memory : protected Pointers { template TYPE ***create(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 2d array last dim must stay the same ------------------------------------------------------------------------- */ - template - TYPE **grow(TYPE **&array, int n1, int n2, const char *name) + template TYPE **grow(TYPE **&array, int n1, int n2, const char *name) { - if (array == nullptr) return create(array,n1,n2,name); + if (array == nullptr) return create(array, n1, n2, name); - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2; - TYPE *data = (TYPE *) srealloc(array[0],nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2; + TYPE *data = (TYPE *) srealloc(array[0], nbytes, name); nbytes = ((bigint) sizeof(TYPE *)) * n1; - array = (TYPE **) srealloc(array,nbytes,name); + array = (TYPE **) srealloc(array, nbytes, name); bigint n = 0; for (int i = 0; i < n1; i++) { @@ -158,14 +162,16 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 2d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE **&array) + template void destroy(TYPE **&array) { if (array == nullptr) return; sfree(array[0]); @@ -173,20 +179,19 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 2d array with a ragged 2nd dimension ------------------------------------------------------------------------- */ - template - TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name) + template TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name) { bigint n2sum = 0; for (int i = 0; i < n1; i++) n2sum += n2[i]; bigint nbytes = ((bigint) sizeof(TYPE)) * n2sum; - TYPE *data = (TYPE *) smalloc(nbytes,name); + TYPE *data = (TYPE *) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE *)) * n1; - array = (TYPE **) smalloc(nbytes,name); + array = (TYPE **) smalloc(nbytes, name); bigint n = 0; for (int i = 0; i < n1; i++) { @@ -198,33 +203,38 @@ class Memory : protected Pointers { template TYPE ***create_ragged(TYPE ***& /*array*/, int /*n1*/, int * /*n2*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 2d array with 2nd index from n2lo to n2hi inclusive cannot grow it ------------------------------------------------------------------------- */ template - TYPE **create2d_offset(TYPE **&array, int n1, int n2lo, int n2hi, - const char *name) + TYPE **create2d_offset(TYPE **&array, int n1, int n2lo, int n2hi, const char *name) { int n2 = n2hi - n2lo + 1; - create(array,n1,n2,name); + create(array, n1, n2, name); for (int i = 0; i < n1; i++) array[i] -= n2lo; return array; } template TYPE ***create2d_offset(TYPE ***& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, - const char *name) {fail(name); return nullptr;} + const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 2d array with 2nd index offset ------------------------------------------------------------------------- */ - template - void destroy2d_offset(TYPE **&array, int offset) + template void destroy2d_offset(TYPE **&array, int offset) { if (array == nullptr) return; sfree(&array[0][offset]); @@ -232,28 +242,27 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 3d array ------------------------------------------------------------------------- */ - template - TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name) + template TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; - TYPE *data = (TYPE *) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2; - TYPE **plane = (TYPE **) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3; + TYPE *data = (TYPE *) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2; + TYPE **plane = (TYPE **) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE **)) * n1; - array = (TYPE ***) smalloc(nbytes,name); + array = (TYPE ***) smalloc(nbytes, name); - int i,j; + int i, j; bigint m; bigint n = 0; for (i = 0; i < n1; i++) { m = ((bigint) i) * n2; array[i] = &plane[m]; for (j = 0; j < n2; j++) { - plane[m+j] = &data[n]; + plane[m + j] = &data[n]; n += n3; } } @@ -262,33 +271,35 @@ class Memory : protected Pointers { template TYPE ****create(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 3d array last 2 dims must stay the same ------------------------------------------------------------------------- */ - template - TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) + template TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) { - if (array == nullptr) return create(array,n1,n2,n3,name); + if (array == nullptr) return create(array, n1, n2, n3, name); - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; - TYPE *data = (TYPE *) srealloc(array[0][0],nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2; - TYPE **plane = (TYPE **) srealloc(array[0],nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3; + TYPE *data = (TYPE *) srealloc(array[0][0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2; + TYPE **plane = (TYPE **) srealloc(array[0], nbytes, name); nbytes = ((bigint) sizeof(TYPE **)) * n1; - array = (TYPE ***) srealloc(array,nbytes,name); + array = (TYPE ***) srealloc(array, nbytes, name); - int i,j; + int i, j; bigint m; bigint n = 0; for (i = 0; i < n1; i++) { m = ((bigint) i) * n2; array[i] = &plane[m]; for (j = 0; j < n2; j++) { - plane[m+j] = &data[n]; + plane[m + j] = &data[n]; n += n3; } } @@ -297,14 +308,16 @@ class Memory : protected Pointers { template TYPE ****grow(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 3d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE ***&array) + template void destroy(TYPE ***&array) { if (array == nullptr) return; sfree(array[0][0]); @@ -313,32 +326,33 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 3d array with 1st index from n1lo to n1hi inclusive cannot grow it ------------------------------------------------------------------------- */ template - TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, - int n2, int n3, const char *name) + TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, int n2, int n3, const char *name) { int n1 = n1hi - n1lo + 1; - create(array,n1,n2,n3,name); + create(array, n1, n2, n3, name); array -= n1lo; return array; } template - TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, - int /*n2*/, int /*n3*/, const char *name) - {fail(name); return nullptr;} + TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2*/, int /*n3*/, + const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- free a 3d array with 1st index offset ------------------------------------------------------------------------- */ - template - void destroy3d_offset(TYPE ***&array, int offset) + template void destroy3d_offset(TYPE ***&array, int offset) { if (array == nullptr) return; sfree(&array[offset][0][0]); @@ -347,7 +361,7 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 3d array with 1st index from n1lo to n1hi inclusive, 2nd index from n2lo to n2hi inclusive, @@ -356,14 +370,13 @@ class Memory : protected Pointers { ------------------------------------------------------------------------- */ template - TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, - int n2lo, int n2hi, int n3lo, int n3hi, - const char *name) + TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, int n2lo, int n2hi, int n3lo, + int n3hi, const char *name) { int n1 = n1hi - n1lo + 1; int n2 = n2hi - n2lo + 1; int n3 = n3hi - n3lo + 1; - create(array,n1,n2,n3,name); + create(array, n1, n2, n3, name); bigint m = ((bigint) n1) * n2; for (bigint i = 0; i < m; i++) array[0][i] -= n3lo; @@ -373,18 +386,19 @@ class Memory : protected Pointers { } template - TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, - int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, - const char *name) - {fail(name); return nullptr;} + TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2lo*/, + int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- free a 3d array with all 3 indices offset ------------------------------------------------------------------------- */ template - void destroy3d_offset(TYPE ***&array, - int n1_offset, int n2_offset, int n3_offset) + void destroy3d_offset(TYPE ***&array, int n1_offset, int n2_offset, int n3_offset) { if (array == nullptr) return; sfree(&array[n1_offset][n2_offset][n3_offset]); @@ -393,35 +407,34 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 4d array ------------------------------------------------------------------------- */ template - TYPE ****create(TYPE ****&array, int n1, int n2, int n3, int n4, - const char *name) + TYPE ****create(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; - TYPE *data = (TYPE *) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2*n3; - TYPE **cube = (TYPE **) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE **)) * n1*n2; - TYPE ***plane = (TYPE ***) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4; + TYPE *data = (TYPE *) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3; + TYPE **cube = (TYPE **) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE **)) * n1 * n2; + TYPE ***plane = (TYPE ***) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE ***)) * n1; - array = (TYPE ****) smalloc(nbytes,name); + array = (TYPE ****) smalloc(nbytes, name); - bigint i,j,k; - bigint m1,m2; + bigint i, j, k; + bigint m1, m2; bigint n = 0; for (i = 0; i < n1; i++) { m2 = i * n2; array[i] = &plane[m2]; for (j = 0; j < n2; j++) { m1 = i * n2 + j; - m2 = i * n2*n3 + j*n3; + m2 = i * n2 * n3 + j * n3; plane[m1] = &cube[m2]; for (k = 0; k < n3; k++) { - m1 = i * n2*n3 + j*n3 + k; + m1 = i * n2 * n3 + j * n3 + k; cube[m1] = &data[n]; n += n4; } @@ -433,61 +446,63 @@ class Memory : protected Pointers { template TYPE *****create(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 4d array last 3 dims must stay the same ------------------------------------------------------------------------- */ template - TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, - const char *name) + TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name) { - if (array == nullptr) return create(array, n1, n2, n3, n4, name); + if (array == nullptr) return create(array, n1, n2, n3, n4, name); - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; - TYPE *data = (TYPE *)srealloc(array[0][0][0], nbytes, name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2*n3; - TYPE **cube = (TYPE **)srealloc(array[0][0], nbytes, name); - nbytes = ((bigint) sizeof(TYPE **)) * n1*n2; - TYPE ***plane = (TYPE ***)srealloc(array[0], nbytes, name); - nbytes = ((bigint) sizeof(TYPE ***)) * n1; - array = (TYPE ****)srealloc(array, nbytes, name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4; + TYPE *data = (TYPE *) srealloc(array[0][0][0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3; + TYPE **cube = (TYPE **) srealloc(array[0][0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE **)) * n1 * n2; + TYPE ***plane = (TYPE ***) srealloc(array[0], nbytes, name); + nbytes = ((bigint) sizeof(TYPE ***)) * n1; + array = (TYPE ****) srealloc(array, nbytes, name); - int i, j, k; - bigint m1, m2; - bigint n = 0; - for (i = 0; i < n1; i++) { - m2 = ((bigint)i) * n2; - array[i] = &plane[m2]; - for (j = 0; j < n2; j++) { - m1 = ((bigint)i) * n2 + j; - m2 = ((bigint)i) * n2*n3 + j*n3; - plane[m1] = &cube[m2]; - for (k = 0; k < n3; k++) { - m1 = ((bigint)i) * n2*n3 + j*n3 + k; - cube[m1] = &data[n]; - n += n4; - } - } - } - return array; + int i, j, k; + bigint m1, m2; + bigint n = 0; + for (i = 0; i < n1; i++) { + m2 = ((bigint) i) * n2; + array[i] = &plane[m2]; + for (j = 0; j < n2; j++) { + m1 = ((bigint) i) * n2 + j; + m2 = ((bigint) i) * n2 * n3 + j * n3; + plane[m1] = &cube[m2]; + for (k = 0; k < n3; k++) { + m1 = ((bigint) i) * n2 * n3 + j * n3 + k; + cube[m1] = &data[n]; + n += n4; + } + } + } + return array; } template TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, - const char *name) + const char *name) { - fail(name); return nullptr; + fail(name); + return nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 4d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE ****&array) + template void destroy(TYPE ****&array) { if (array == nullptr) return; sfree(array[0][0][0]); @@ -497,7 +512,7 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 4d array with indices 2nd index from n2lo to n2hi inclusive 3rd index from n3lo to n3hi inclusive @@ -506,36 +521,36 @@ class Memory : protected Pointers { ------------------------------------------------------------------------- */ template - TYPE ****create4d_offset(TYPE ****&array, int n1, int n2lo, int n2hi, - int n3lo, int n3hi, int n4lo, int n4hi, - const char *name) + TYPE ****create4d_offset(TYPE ****&array, int n1, int n2lo, int n2hi, int n3lo, int n3hi, + int n4lo, int n4hi, const char *name) { int n2 = n2hi - n2lo + 1; int n3 = n3hi - n3lo + 1; int n4 = n4hi - n4lo + 1; - create(array,n1,n2,n3,n4,name); + create(array, n1, n2, n3, n4, name); bigint m = ((bigint) n1) * n2 * n3; for (bigint i = 0; i < m; i++) array[0][0][i] -= n4lo; m = ((bigint) n1) * n2; - for (bigint i = 0; i < m; i++) array [0][i] -= n3lo; + for (bigint i = 0; i < m; i++) array[0][i] -= n3lo; for (int i = 0; i < n1; i++) array[i] -= n2lo; return array; } template TYPE ****create4d_offset(TYPE *****& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, - int /*n3lo*/, int /*n3hi*/, int /*n4lo*/, int /*n4hi*/, - const char *name) - {fail(name); return nullptr;} + int /*n3lo*/, int /*n3hi*/, int /*n4lo*/, int /*n4hi*/, const char *name) + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- free a 4d array with indices 2,3, and 4 offset ------------------------------------------------------------------------- */ template - void destroy4d_offset(TYPE ****&array, - int n2_offset, int n3_offset, int n4_offset) + void destroy4d_offset(TYPE ****&array, int n2_offset, int n3_offset, int n4_offset) { if (array == nullptr) return; sfree(&array[0][n2_offset][n3_offset][n4_offset]); @@ -545,43 +560,40 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- create a 5d array ------------------------------------------------------------------------- */ template - TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4, - int n5, const char *name) + TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4, int n5, const char *name) { - bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4*n5; - TYPE *data = (TYPE *) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE *)) * n1*n2*n3*n4; - TYPE **level4 = (TYPE **) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE **)) * n1*n2*n3; - TYPE ***level3 = (TYPE ***) smalloc(nbytes,name); - nbytes = ((bigint) sizeof(TYPE ***)) * n1*n2; - TYPE ****level2 = (TYPE ****) smalloc(nbytes,name); + bigint nbytes = ((bigint) sizeof(TYPE)) * n1 * n2 * n3 * n4 * n5; + TYPE *data = (TYPE *) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE *)) * n1 * n2 * n3 * n4; + TYPE **level4 = (TYPE **) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE **)) * n1 * n2 * n3; + TYPE ***level3 = (TYPE ***) smalloc(nbytes, name); + nbytes = ((bigint) sizeof(TYPE ***)) * n1 * n2; + TYPE ****level2 = (TYPE ****) smalloc(nbytes, name); nbytes = ((bigint) sizeof(TYPE ****)) * n1; - array = (TYPE *****) smalloc(nbytes,name); + array = (TYPE *****) smalloc(nbytes, name); - int i,j,k,l; - bigint m1,m2; + int i, j, k, l; + bigint m1, m2; bigint n = 0; for (i = 0; i < n1; i++) { m2 = ((bigint) i) * n2; array[i] = &level2[m2]; for (j = 0; j < n2; j++) { m1 = ((bigint) i) * n2 + j; - m2 = ((bigint) i) * n2*n3 + ((bigint) j) * n3; + m2 = ((bigint) i) * n2 * n3 + ((bigint) j) * n3; level2[m1] = &level3[m2]; for (k = 0; k < n3; k++) { - m1 = ((bigint) i) * n2*n3 + ((bigint) j) * n3 + k; - m2 = ((bigint) i) * n2*n3*n4 + - ((bigint) j) * n3*n4 + ((bigint) k) * n4; + m1 = ((bigint) i) * n2 * n3 + ((bigint) j) * n3 + k; + m2 = ((bigint) i) * n2 * n3 * n4 + ((bigint) j) * n3 * n4 + ((bigint) k) * n4; level3[m1] = &level4[m2]; for (l = 0; l < n4; l++) { - m1 = ((bigint) i) * n2*n3*n4 + - ((bigint) j) * n3*n4 + ((bigint) k) * n4 + l; + m1 = ((bigint) i) * n2 * n3 * n4 + ((bigint) j) * n3 * n4 + ((bigint) k) * n4 + l; level4[m1] = &data[n]; n += n5; } @@ -594,14 +606,16 @@ class Memory : protected Pointers { template TYPE ******create(TYPE ******& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, int /*n5*/, const char *name) - {fail(name); return nullptr;} + { + fail(name); + return nullptr; + } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- destroy a 5d array ------------------------------------------------------------------------- */ - template - void destroy(TYPE *****&array) + template void destroy(TYPE *****&array) { if (array == nullptr) return; sfree(array[0][0][0][0]); @@ -612,50 +626,46 @@ class Memory : protected Pointers { array = nullptr; } -/* ---------------------------------------------------------------------- + /* ---------------------------------------------------------------------- memory usage of arrays, including pointers ------------------------------------------------------------------------- */ - template - double usage(TYPE *array, int n) + template double usage(TYPE *array, int n) { (void) array; double bytes = ((double) sizeof(TYPE)) * n; return bytes; } - template - double usage(TYPE **array, int n1, int n2) + template double usage(TYPE **array, int n1, int n2) { (void) array; - double bytes = ((double) sizeof(TYPE)) * n1*n2; + double bytes = ((double) sizeof(TYPE)) * n1 * n2; bytes += ((double) sizeof(TYPE *)) * n1; return bytes; } - template - double usage(TYPE ***array, int n1, int n2, int n3) + template double usage(TYPE ***array, int n1, int n2, int n3) { (void) array; - double bytes = ((double) sizeof(TYPE)) * n1*n2*n3; - bytes += ((double) sizeof(TYPE *)) * n1*n2; + double bytes = ((double) sizeof(TYPE)) * n1 * n2 * n3; + bytes += ((double) sizeof(TYPE *)) * n1 * n2; bytes += ((double) sizeof(TYPE **)) * n1; return bytes; } - template - double usage(TYPE ****array, int n1, int n2, int n3, int n4) + template double usage(TYPE ****array, int n1, int n2, int n3, int n4) { (void) array; - double bytes = ((double) sizeof(TYPE)) * n1*n2*n3*n4; - bytes += ((double) sizeof(TYPE *)) * n1*n2*n3; - bytes += ((double) sizeof(TYPE **)) * n1*n2; + double bytes = ((double) sizeof(TYPE)) * n1 * n2 * n3 * n4; + bytes += ((double) sizeof(TYPE *)) * n1 * n2 * n3; + bytes += ((double) sizeof(TYPE **)) * n1 * n2; bytes += ((double) sizeof(TYPE ***)) * n1; return bytes; } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/min.h b/src/min.h index 5d94519e5a..96f6316f35 100644 --- a/src/min.h +++ b/src/min.h @@ -14,36 +14,36 @@ #ifndef LMP_MIN_H #define LMP_MIN_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Min : protected Pointers { public: - double einitial,efinal,eprevious; - double fnorm2_init,fnorminf_init,fnorm2_final,fnorminf_final; + double einitial, efinal, eprevious; + double fnorm2_init, fnorminf_init, fnorm2_final, fnorminf_final; double alpha_final; - int niter,neval; + int niter, neval; int stop_condition; char *stopstr; - int searchflag; // 0 if damped dynamics, 1 if sub-cycles on local search + int searchflag; // 0 if damped dynamics, 1 if sub-cycles on local search Min(class LAMMPS *); virtual ~Min(); virtual void init(); - virtual void setup(int flag=1); + virtual void setup(int flag = 1); virtual void setup_minimal(int); virtual void run(int); void cleanup(); int request(class Pair *, int, double); - virtual double memory_usage() {return 0;} + virtual double memory_usage() { return 0; } void modify_params(int, char **); - virtual int modify_param(int, char **) {return 0;} + virtual int modify_param(int, char **) { return 0; } virtual double fnorm_sqr(); virtual double fnorm_inf(); virtual double fnorm_max(); - enum{TWO,MAX,INF}; + enum { TWO, MAX, INF }; // methods for spin minimizers double total_torque(); @@ -56,74 +56,86 @@ class Min : protected Pointers { virtual int iterate(int) = 0; // possible return values of iterate() method - enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE, - ZEROQUAD,TRSMALL,INTERROR,TIMEOUT,MAXVDOTF}; + enum { + MAXITER, + MAXEVAL, + ETOL, + FTOL, + DOWNHILL, + ZEROALPHA, + ZEROFORCE, + ZEROQUAD, + TRSMALL, + INTERROR, + TIMEOUT, + MAXVDOTF + }; protected: - int eflag,vflag; // flags for energy/virial computation - int virial_style; // compute virial explicitly or implicitly - int external_force_clear; // clear forces locally or externally + int eflag, vflag; // flags for energy/virial computation + int virial_style; // compute virial explicitly or implicitly + int external_force_clear; // clear forces locally or externally - double dmax; // max dist to move any atom in one step - int linestyle; // 0 = backtrack, 1 = quadratic, 2 = forcezero - // 3 = spin_cubic, 4 = spin_none + double dmax; // max dist to move any atom in one step + int linestyle; // 0 = backtrack, 1 = quadratic, 2 = forcezero + // 3 = spin_cubic, 4 = spin_none - int normstyle; // TWO, MAX or INF flag for force norm evaluation + int normstyle; // TWO, MAX or INF flag for force norm evaluation - double dtinit; // store the default timestep + double dtinit; // store the default timestep // only for minimize style fire2 - int delaystep; // minium steps of dynamics - double dtgrow,dtshrink; // timestep increase, decrease - double alpha0,alphashrink; // mixing velocities+forces coefficient - double tmax,tmin; // timestep multiplicators max, min - int integrator; // Newton integration: euler, leapfrog, verlet... - int halfstepback_flag; // half step backward when v.f <= 0.0 - int delaystep_start_flag; // delay the initial dt_shrink - int max_vdotf_negatif; // maximum iteration with v.f > 0.0 + int delaystep; // minium steps of dynamics + double dtgrow, dtshrink; // timestep increase, decrease + double alpha0, alphashrink; // mixing velocities+forces coefficient + double tmax, tmin; // timestep multiplicators max, min + int integrator; // Newton integration: euler, leapfrog, verlet... + int halfstepback_flag; // half step backward when v.f <= 0.0 + int delaystep_start_flag; // delay the initial dt_shrink + int max_vdotf_negatif; // maximum iteration with v.f > 0.0 - int nelist_global,nelist_atom; // # of PE,virial computes to check - int nvlist_global,nvlist_atom,ncvlist_atom; - class Compute **elist_global; // lists of PE,virial Computes + int nelist_global, nelist_atom; // # of PE,virial computes to check + int nvlist_global, nvlist_atom, ncvlist_atom; + class Compute **elist_global; // lists of PE,virial Computes class Compute **elist_atom; class Compute **vlist_global; class Compute **vlist_atom; class Compute **cvlist_atom; - int triclinic; // 0 if domain is orthog, 1 if triclinic + int triclinic; // 0 if domain is orthog, 1 if triclinic int pairflag; - int torqueflag,extraflag; + int torqueflag, extraflag; - int pair_compute_flag; // 0 if pair->compute is skipped - int kspace_compute_flag; // 0 if kspace->compute is skipped + int pair_compute_flag; // 0 if pair->compute is skipped + int kspace_compute_flag; // 0 if kspace->compute is skipped - int narray; // # of arrays stored by fix_minimize - class FixMinimize *fix_minimize; // fix that stores auxiliary data + int narray; // # of arrays stored by fix_minimize + class FixMinimize *fix_minimize; // fix that stores auxiliary data - class Compute *pe_compute; // compute for potential energy - double ecurrent; // current potential energy + class Compute *pe_compute; // compute for potential energy + double ecurrent; // current potential energy - bigint ndoftotal; // total dof for entire problem + bigint ndoftotal; // total dof for entire problem - int nvec; // local atomic dof = length of xvec - double *xvec; // variables for atomic dof, as 1d vector - double *fvec; // force vector for atomic dof, as 1d vector + int nvec; // local atomic dof = length of xvec + double *xvec; // variables for atomic dof, as 1d vector + double *fvec; // force vector for atomic dof, as 1d vector - int nextra_global; // # of extra global dof due to fixes - double *fextra; // force vector for extra global dof - // xextra is stored by fix + int nextra_global; // # of extra global dof due to fixes + double *fextra; // force vector for extra global dof + // xextra is stored by fix - int nextra_atom; // # of extra per-atom variables - double **xextra_atom; // ptr to the variable - double **fextra_atom; // ptr to the force on the variable - int *extra_peratom; // # of values in variable, e.g. 3 in x - int *extra_nlen; // total local length of variable, e.g 3*nlocal - double *extra_max; // max allowed change per iter for atom's var - class Pair **requestor; // Pair that stores/manipulates the variable + int nextra_atom; // # of extra per-atom variables + double **xextra_atom; // ptr to the variable + double **fextra_atom; // ptr to the force on the variable + int *extra_peratom; // # of values in variable, e.g. 3 in x + int *extra_nlen; // total local length of variable, e.g 3*nlocal + double *extra_max; // max allowed change per iter for atom's var + class Pair **requestor; // Pair that stores/manipulates the variable - int kokkosable; // 1 if this min style supports Kokkos + int kokkosable; // 1 if this min style supports Kokkos - int neigh_every,neigh_delay,neigh_dist_check; // neighboring params + int neigh_every, neigh_delay, neigh_dist_check; // neighboring params virtual double energy_force(int); virtual void force_clear(); @@ -134,7 +146,7 @@ class Min : protected Pointers { char *stopstrings(int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/min_cg.h b/src/min_cg.h index cc00047911..2685a4224b 100644 --- a/src/min_cg.h +++ b/src/min_cg.h @@ -30,7 +30,7 @@ class MinCG : public MinLineSearch { int iterate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_fire.h b/src/min_fire.h index f5061a1b13..507dace2a0 100644 --- a/src/min_fire.h +++ b/src/min_fire.h @@ -34,13 +34,13 @@ class MinFire : public Min { int iterate(int); private: - double dt,dtmax,dtmin; + double dt, dtmax, dtmin; double alpha; - bigint last_negative,ntimestep_start; - int vdotf_negatif,flagv0; + bigint last_negative, ntimestep_start; + int vdotf_negatif, flagv0; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_fire_old.h b/src/min_fire_old.h index 55246bba7a..28396a67fa 100644 --- a/src/min_fire_old.h +++ b/src/min_fire_old.h @@ -34,12 +34,12 @@ class MinFireOld : public Min { int iterate(int); private: - double dt,dtmax; + double dt, dtmax; double alpha; bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_hftn.h b/src/min_hftn.h index 83c43e395f..fe789dd346 100644 --- a/src/min_hftn.h +++ b/src/min_hftn.h @@ -22,106 +22,72 @@ MinimizeStyle(hftn,MinHFTN); #include "min.h" -namespace LAMMPS_NS -{ +namespace LAMMPS_NS { -class MinHFTN : public Min -{ - public: - - MinHFTN (LAMMPS *); - ~MinHFTN (void); +class MinHFTN : public Min { + public: + MinHFTN(LAMMPS *); + ~MinHFTN(void); void init(); void setup_style(); void reset_vectors(); - int iterate (int); - - private: + int iterate(int); + private: //---- THE ALGORITHM NEEDS TO STORE THIS MANY ATOM-BASED VECTORS, //---- IN ADDITION TO ATOM POSITIONS AND THE FORCE VECTOR. enum { - VEC_XK=0, //-- ATOM POSITIONS AT SUBITER START - VEC_CG_P, //-- STEP p IN CG SUBITER - VEC_CG_D, //-- DIRECTION d IN CG SUBITER - VEC_CG_HD, //-- HESSIAN-VECTOR PRODUCT Hd - VEC_CG_R, //-- RESIDUAL r IN CG SUBITER - VEC_DIF1, //-- FOR FINITE DIFFERENCING - VEC_DIF2, //-- FOR FINITE DIFFERENCING + VEC_XK = 0, //-- ATOM POSITIONS AT SUBITER START + VEC_CG_P, //-- STEP p IN CG SUBITER + VEC_CG_D, //-- DIRECTION d IN CG SUBITER + VEC_CG_HD, //-- HESSIAN-VECTOR PRODUCT Hd + VEC_CG_R, //-- RESIDUAL r IN CG SUBITER + VEC_DIF1, //-- FOR FINITE DIFFERENCING + VEC_DIF2, //-- FOR FINITE DIFFERENCING NUM_HFTN_ATOM_BASED_VECTORS }; //---- ATOM-BASED STORAGE VECTORS. - double * _daAVectors[NUM_HFTN_ATOM_BASED_VECTORS]; - double ** _daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS]; + double *_daAVectors[NUM_HFTN_ATOM_BASED_VECTORS]; + double **_daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS]; //---- GLOBAL DOF STORAGE. ELEMENT [0] IS X0 (XK), NOT USED IN THIS ARRAY. - double * _daExtraGlobal[NUM_HFTN_ATOM_BASED_VECTORS]; + double *_daExtraGlobal[NUM_HFTN_ATOM_BASED_VECTORS]; - int _nNumUnknowns; - FILE * _fpPrint; + int _nNumUnknowns; + FILE *_fpPrint; - int execute_hftn_ (const bool bPrintProgress, - const double dInitialEnergy, - const double dInitialForce2, - double & dFinalEnergy, - double & dFinalForce2); - bool compute_inner_cg_step_ (const double dTrustRadius, - const double dForceTol, - const int nMaxEvals, - const bool bHaveEvalAtXin, - const double dEnergyAtXin, - const double dForce2AtXin, - double & dEnergyAtXout, - double & dForce2AtXout, - int & nStepType, - double & dStepLength2, - double & dStepLengthInf); - double calc_xinf_using_mpi_ (void) const; - double calc_dot_prod_using_mpi_ (const int nIx1, - const int nIx2) const; - double calc_grad_dot_v_using_mpi_ (const int nIx) const; - void calc_dhd_dd_using_mpi_ (double & dDHD, - double & dDD) const; - void calc_ppnew_pdold_using_mpi_ (double & dPnewDotPnew, - double & dPoldDotD) const; - void calc_plengths_using_mpi_ (double & dStepLength2, - double & dStepLengthInf) const; - bool step_exceeds_TR_ (const double dTrustRadius, - const double dPP, - const double dPD, - const double dDD, - double & dTau) const; - bool step_exceeds_DMAX_ (void) const; - void adjust_step_to_tau_ (const double tau); - double compute_to_tr_ (const double dPP, - const double dPD, - const double dDD, - const double dTrustRadius, - const bool bConsiderBothRoots, - const double dDHD, - const double dPdotHD, - const double dGradDotD) const; - void evaluate_dir_der_ (const bool bUseForwardDiffs, - const int nIxDir, - const int nIxResult, - const bool bEvaluateAtX, - double & dNewEnergy); - void open_hftn_print_file_ (void); - void hftn_print_line_ (const bool bIsStepAccepted, - const int nIteration, - const int nTotalEvals, - const double dEnergy, - const double dForce2, - const int nStepType, - const double dTrustRadius, - const double dStepLength2, - const double dActualRed, - const double dPredictedRed) const; - void close_hftn_print_file_ (void); + int execute_hftn_(const bool bPrintProgress, const double dInitialEnergy, + const double dInitialForce2, double &dFinalEnergy, double &dFinalForce2); + bool compute_inner_cg_step_(const double dTrustRadius, const double dForceTol, + const int nMaxEvals, const bool bHaveEvalAtXin, + const double dEnergyAtXin, const double dForce2AtXin, + double &dEnergyAtXout, double &dForce2AtXout, int &nStepType, + double &dStepLength2, double &dStepLengthInf); + double calc_xinf_using_mpi_(void) const; + double calc_dot_prod_using_mpi_(const int nIx1, const int nIx2) const; + double calc_grad_dot_v_using_mpi_(const int nIx) const; + void calc_dhd_dd_using_mpi_(double &dDHD, double &dDD) const; + void calc_ppnew_pdold_using_mpi_(double &dPnewDotPnew, double &dPoldDotD) const; + void calc_plengths_using_mpi_(double &dStepLength2, double &dStepLengthInf) const; + bool step_exceeds_TR_(const double dTrustRadius, const double dPP, const double dPD, + const double dDD, double &dTau) const; + bool step_exceeds_DMAX_(void) const; + void adjust_step_to_tau_(const double tau); + double compute_to_tr_(const double dPP, const double dPD, const double dDD, + const double dTrustRadius, const bool bConsiderBothRoots, const double dDHD, + const double dPdotHD, const double dGradDotD) const; + void evaluate_dir_der_(const bool bUseForwardDiffs, const int nIxDir, const int nIxResult, + const bool bEvaluateAtX, double &dNewEnergy); + void open_hftn_print_file_(void); + void hftn_print_line_(const bool bIsStepAccepted, const int nIteration, const int nTotalEvals, + const double dEnergy, const double dForce2, const int nStepType, + const double dTrustRadius, const double dStepLength2, + const double dActualRed, const double dPredictedRed) const; + void close_hftn_print_file_(void); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_linesearch.h b/src/min_linesearch.h index ded5eb9871..a54368ef32 100644 --- a/src/min_linesearch.h +++ b/src/min_linesearch.h @@ -31,14 +31,14 @@ class MinLineSearch : public Min { // allocated and stored by fix_minimize // x,f are stored by parent or Atom class or Pair class - double *x0; // coords at start of linesearch - double *g; // old gradient vector - double *h; // search direction vector + double *x0; // coords at start of linesearch + double *g; // old gradient vector + double *h; // search direction vector - double *gextra; // g,h for extra global dof, x0 is stored by fix + double *gextra; // g,h for extra global dof, x0 is stored by fix double *hextra; - double **x0extra_atom; // x0,g,h for extra per-atom dof + double **x0extra_atom; // x0,g,h for extra per-atom dof double **gextra_atom; double **hextra_atom; @@ -52,6 +52,6 @@ class MinLineSearch : public Min { double compute_dir_deriv(double &); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/min_quickmin.h b/src/min_quickmin.h index bc64315fb7..9669f63f16 100644 --- a/src/min_quickmin.h +++ b/src/min_quickmin.h @@ -38,7 +38,7 @@ class MinQuickMin : public Min { bigint last_negative; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/min_sd.h b/src/min_sd.h index 936f5e6cd9..5565daf142 100644 --- a/src/min_sd.h +++ b/src/min_sd.h @@ -30,7 +30,7 @@ class MinSD : public MinLineSearch { int iterate(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/minimize.h b/src/minimize.h index 547872ff70..78d21850db 100644 --- a/src/minimize.h +++ b/src/minimize.h @@ -30,7 +30,7 @@ class Minimize : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/modify.h b/src/modify.h index c756800b12..24f175f2e0 100644 --- a/src/modify.h +++ b/src/modify.h @@ -20,8 +20,8 @@ namespace LAMMPS_NS { - class Compute; - class Fix; +class Compute; +class Fix; class Modify : protected Pointers { friend class Info; @@ -30,26 +30,26 @@ class Modify : protected Pointers { friend class RespaOMP; public: - int n_initial_integrate,n_post_integrate,n_pre_exchange; - int n_pre_neighbor,n_post_neighbor; - int n_pre_force,n_pre_reverse,n_post_force; - int n_final_integrate,n_end_of_step; - int n_energy_couple,n_energy_global,n_energy_atom; - int n_initial_integrate_respa,n_post_integrate_respa; - int n_pre_force_respa,n_post_force_respa,n_final_integrate_respa; - int n_min_pre_exchange,n_min_pre_neighbor,n_min_post_neighbor; - int n_min_pre_force,n_min_pre_reverse,n_min_post_force,n_min_energy; + int n_initial_integrate, n_post_integrate, n_pre_exchange; + int n_pre_neighbor, n_post_neighbor; + int n_pre_force, n_pre_reverse, n_post_force; + int n_final_integrate, n_end_of_step; + int n_energy_couple, n_energy_global, n_energy_atom; + int n_initial_integrate_respa, n_post_integrate_respa; + int n_pre_force_respa, n_post_force_respa, n_final_integrate_respa; + int n_min_pre_exchange, n_min_pre_neighbor, n_min_post_neighbor; + int n_min_pre_force, n_min_pre_reverse, n_min_post_force, n_min_energy; - int restart_pbc_any; // 1 if any fix sets restart_pbc - int nfix_restart_global; // stored fix global info from restart file - int nfix_restart_peratom; // stored fix peratom info from restart file + int restart_pbc_any; // 1 if any fix sets restart_pbc + int nfix_restart_global; // stored fix global info from restart file + int nfix_restart_peratom; // stored fix peratom info from restart file - int nfix,maxfix; - Fix **fix; // list of fixes - int *fmask; // bit mask for when each fix is applied + int nfix, maxfix; + Fix **fix; // list of fixes + int *fmask; // bit mask for when each fix is applied - int ncompute,maxcompute; - Compute **compute; // list of computes + int ncompute, maxcompute; + Compute **compute; // list of computes Modify(class LAMMPS *); virtual ~Modify(); @@ -66,7 +66,7 @@ class Modify : protected Pointers { virtual void pre_neighbor(); virtual void post_neighbor(); virtual void pre_force(int); - virtual void pre_reverse(int,int); + virtual void pre_reverse(int, int); virtual void post_force(int); virtual void final_integrate(); virtual void end_of_step(); @@ -87,7 +87,7 @@ class Modify : protected Pointers { virtual void min_pre_neighbor(); virtual void min_post_neighbor(); virtual void min_pre_force(int); - virtual void min_pre_reverse(int,int); + virtual void min_pre_reverse(int, int); virtual void min_post_force(int); virtual double min_energy(double *); @@ -100,18 +100,18 @@ class Modify : protected Pointers { virtual int min_dof(); virtual int min_reset_ref(); - void add_fix(int, char **, int trysuffix=1); - void add_fix(const std::string &, int trysuffix=1); - void replace_fix(const char *, int, char **, int trysuffix=1); - void replace_fix(const std::string &, const std::string &, int trysuffix=1); + void add_fix(int, char **, int trysuffix = 1); + void add_fix(const std::string &, int trysuffix = 1); + void replace_fix(const char *, int, char **, int trysuffix = 1); + void replace_fix(const std::string &, const std::string &, int trysuffix = 1); void modify_fix(int, char **); void delete_fix(const std::string &); void delete_fix(int); int find_fix(const std::string &); int find_fix_by_style(const char *); - void add_compute(int, char **, int trysuffix=1); - void add_compute(const std::string &, int trysuffix=1); + void add_compute(int, char **, int trysuffix = 1); + void add_compute(const std::string &, int trysuffix = 1); void modify_compute(int, char **); void delete_compute(const std::string &); void delete_compute(int); @@ -134,37 +134,36 @@ class Modify : protected Pointers { double memory_usage(); protected: - // lists of fixes to apply at different stages of timestep - int *list_initial_integrate,*list_post_integrate; - int *list_pre_exchange,*list_pre_neighbor,*list_post_neighbor; - int *list_pre_force,*list_pre_reverse,*list_post_force; - int *list_final_integrate,*list_end_of_step; - int *list_energy_couple,*list_energy_global,*list_energy_atom; - int *list_initial_integrate_respa,*list_post_integrate_respa; - int *list_pre_force_respa,*list_post_force_respa; + int *list_initial_integrate, *list_post_integrate; + int *list_pre_exchange, *list_pre_neighbor, *list_post_neighbor; + int *list_pre_force, *list_pre_reverse, *list_post_force; + int *list_final_integrate, *list_end_of_step; + int *list_energy_couple, *list_energy_global, *list_energy_atom; + int *list_initial_integrate_respa, *list_post_integrate_respa; + int *list_pre_force_respa, *list_post_force_respa; int *list_final_integrate_respa; - int *list_min_pre_exchange,*list_min_pre_neighbor,*list_min_post_neighbor; - int *list_min_pre_force,*list_min_pre_reverse,*list_min_post_force; + int *list_min_pre_exchange, *list_min_pre_neighbor, *list_min_post_neighbor; + int *list_min_pre_force, *list_min_pre_reverse, *list_min_post_force; int *list_min_energy; int *end_of_step_every; - int n_timeflag; // list of computes that store time invocation + int n_timeflag; // list of computes that store time invocation int *list_timeflag; - char **id_restart_global; // stored fix global info - char **style_restart_global; // from read-in restart file + char **id_restart_global; // stored fix global info + char **style_restart_global; // from read-in restart file char **state_restart_global; int *used_restart_global; - char **id_restart_peratom; // stored fix peratom info - char **style_restart_peratom; // from read-in restart file + char **id_restart_peratom; // stored fix peratom info + char **style_restart_peratom; // from read-in restart file int *index_restart_peratom; int *used_restart_peratom; - int index_permanent; // fix/compute index returned to library call + int index_permanent; // fix/compute index returned to library call void list_init(int, int &, int *&); void list_init_end_of_step(int, int &, int *&); @@ -176,11 +175,11 @@ class Modify : protected Pointers { public: typedef Compute *(*ComputeCreator)(LAMMPS *, int, char **); - typedef std::map ComputeCreatorMap; + typedef std::map ComputeCreatorMap; ComputeCreatorMap *compute_map; typedef Fix *(*FixCreator)(LAMMPS *, int, char **); - typedef std::map FixCreatorMap; + typedef std::map FixCreatorMap; FixCreatorMap *fix_map; protected: @@ -189,7 +188,7 @@ class Modify : protected Pointers { template static Fix *fix_creator(LAMMPS *, int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/molecule.h b/src/molecule.h index 2beab65b4a..bfdda199c6 100644 --- a/src/molecule.h +++ b/src/molecule.h @@ -22,36 +22,36 @@ namespace LAMMPS_NS { class Molecule : protected Pointers { public: - char *id; // template id of this molecule, same for all molecules in set - int nset; // if first in set, # of molecules in this set - // else 0 if not first in set - int last; // 1 if last molecule in set, else 0 + char *id; // template id of this molecule, same for all molecules in set + int nset; // if first in set, # of molecules in this set + // else 0 if not first in set + int last; // 1 if last molecule in set, else 0 // number of atoms,bonds,etc in molecule // nibody,ndbody = # of integer/double fields in body int natoms; - int nbonds,nangles,ndihedrals,nimpropers; - int ntypes,nmolecules,nfragments; - int nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; - int nibody,ndbody; + int nbonds, nangles, ndihedrals, nimpropers; + int ntypes, nmolecules, nfragments; + int nbondtypes, nangletypes, ndihedraltypes, nimpropertypes; + int nibody, ndbody; // max bond,angle,etc per atom - int bond_per_atom,angle_per_atom,dihedral_per_atom,improper_per_atom; + int bond_per_atom, angle_per_atom, dihedral_per_atom, improper_per_atom; int maxspecial; // 1 if attribute defined in file, 0 if not - int xflag,typeflag,moleculeflag,fragmentflag,qflag,radiusflag,rmassflag; - int bondflag,angleflag,dihedralflag,improperflag; - int nspecialflag,specialflag; - int shakeflag,shakeflagflag,shakeatomflag,shaketypeflag; - int bodyflag,ibodyflag,dbodyflag; + int xflag, typeflag, moleculeflag, fragmentflag, qflag, radiusflag, rmassflag; + int bondflag, angleflag, dihedralflag, improperflag; + int nspecialflag, specialflag; + int shakeflag, shakeflagflag, shakeatomflag, shaketypeflag; + int bodyflag, ibodyflag, dbodyflag; // 1 if attribute defined or computed, 0 if not - int centerflag,massflag,comflag,inertiaflag; + int centerflag, massflag, comflag, inertiaflag; // 1 if molecule fields require atom IDs @@ -66,21 +66,21 @@ class Molecule : protected Pointers { double *radius; // radius of each atom double *rmass; // mass of each atom - int *num_bond; // bonds, angles, dihedrals, impropers for each atom + int *num_bond; // bonds, angles, dihedrals, impropers for each atom int **bond_type; tagint **bond_atom; int *num_angle; int **angle_type; - tagint **angle_atom1,**angle_atom2,**angle_atom3; + tagint **angle_atom1, **angle_atom2, **angle_atom3; int *num_dihedral; int **dihedral_type; - tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4; + tagint **dihedral_atom1, **dihedral_atom2, **dihedral_atom3, **dihedral_atom4; int *num_improper; int **improper_type; - tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4; + tagint **improper_atom1, **improper_atom2, **improper_atom3, **improper_atom4; int **nspecial; tagint **special; @@ -90,21 +90,21 @@ class Molecule : protected Pointers { int **shake_type; class AtomVecBody *avec_body; - int *ibodyparams; // integer and double body params + int *ibodyparams; // integer and double body params double *dbodyparams; // fragment info - int **fragmentmask; // nfragments by natoms + int **fragmentmask; // nfragments by natoms std::vector fragmentnames; - double center[3]; // geometric center of molecule - double masstotal; // total mass of molecule - double com[3]; // center of mass of molecule - double itensor[6]; // moments of inertia of molecule - double inertia[3]; // principal moments of inertia of molecule - double ex[3],ey[3],ez[3]; // principal axes of molecule in space coords - double quat[4]; // quaternion for orientation of molecule + double center[3]; // geometric center of molecule + double masstotal; // total mass of molecule + double com[3]; // center of mass of molecule + double itensor[6]; // moments of inertia of molecule + double inertia[3]; // principal moments of inertia of molecule + double ex[3], ey[3], ez[3]; // principal axes of molecule in space coords + double quat[4]; // quaternion for orientation of molecule double maxradius; // max radius of any atom in molecule double molradius; // radius of molecule from geometric center @@ -112,13 +112,13 @@ class Molecule : protected Pointers { int comatom; // index (1-Natom) of atom closest to COM double maxextent; // furthest any atom in molecule is from comatom - double **dx; // displacement of each atom relative to center - double **dxcom; // displacement of each atom relative to COM - double **dxbody; // displacement of each atom relative to COM - // in body frame (diagonalized interia tensor) + double **dx; // displacement of each atom relative to center + double **dxcom; // displacement of each atom relative to COM + double **dxbody; // displacement of each atom relative to COM + // in body frame (diagonalized interia tensor) - double *quat_external; // orientation imposed by external class - // e.g. FixPour or CreateAtoms + double *quat_external; // orientation imposed by external class + // e.g. FixPour or CreateAtoms Molecule(class LAMMPS *, int, char **, int &); ~Molecule(); @@ -133,7 +133,7 @@ class Molecule : protected Pointers { int me; FILE *fp; int *count; - int toffset,boffset,aoffset,doffset,ioffset; + int toffset, boffset, aoffset, doffset, ioffset; int autospecial; double sizescale; @@ -168,7 +168,7 @@ class Molecule : protected Pointers { // void print(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/mpiio.h b/src/mpiio.h index 839d748f9f..b31dac6c15 100644 --- a/src/mpiio.h +++ b/src/mpiio.h @@ -23,7 +23,7 @@ #error "The MPIIO package cannot be compiled in serial with MPI STUBS" #endif -#include "restart_mpiio.h" // IWYU pragma: export +#include "restart_mpiio.h" // IWYU pragma: export #else @@ -36,16 +36,16 @@ class RestartMPIIO { public: int mpiio_exists; - RestartMPIIO(class LAMMPS *) {mpiio_exists = 0;} + RestartMPIIO(class LAMMPS *) { mpiio_exists = 0; } ~RestartMPIIO() {} void openForRead(const char *) {} void openForWrite(const char *) {} - void write(MPI_Offset,int,double *) {} - void read(MPI_Offset,long,double *) {} + void write(MPI_Offset, int, double *) {} + void read(MPI_Offset, long, double *) {} void close() {} }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/my_page.h b/src/my_page.h index d9617d5213..b0c9b3011a 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -27,18 +27,16 @@ struct HyperOneCoeff { tagint tag; }; -template -class MyPage { +template class MyPage { public: - int ndatum; // total # of stored datums - int nchunk; // total # of stored chunks + int ndatum; // total # of stored datums + int nchunk; // total # of stored chunks MyPage(); virtual ~MyPage(); - int init(int user_maxchunk=1, int user_pagesize=1024, - int user_pagedelta=1); + int init(int user_maxchunk = 1, int user_pagesize = 1024, int user_pagedelta = 1); - T *get(int n=1); + T *get(int n = 1); /** Get pointer to location that can store *maxchunk* items. * @@ -48,8 +46,9 @@ class MyPage { * * \return pointer to chunk of memory or null pointer if run out of memory */ - T *vget() { - if (index+maxchunk <= pagesize) return &page[index]; + T *vget() + { + if (index + maxchunk <= pagesize) return &page[index]; ipage++; if (ipage == npage) { allocate(); @@ -69,7 +68,8 @@ class MyPage { * * \param n Number of items used in previously reserved chunk */ - void vgot(int n) { + void vgot(int n) + { if (n > maxchunk) errorflag = 1; ndatum += n; nchunk++; @@ -82,9 +82,7 @@ class MyPage { * * \return total storage used in bytes */ - double size() const { - return (double)npage*pagesize*sizeof(T); - } + double size() const { return (double) npage * pagesize * sizeof(T); } /** Return error status * @@ -93,23 +91,23 @@ class MyPage { int status() const { return errorflag; } private: - T **pages; // list of allocated pages - T *page; // ptr to current page - int npage; // # of allocated pages - int ipage; // index of current page - int index; // current index on current page + T **pages; // list of allocated pages + T *page; // ptr to current page + int npage; // # of allocated pages + int ipage; // index of current page + int index; // current index on current page - int maxchunk; // max # of datums in one requested chunk - int pagesize; // # of datums in one page, default = 1024 - int pagedelta; // # of pages to allocate at once, default = 1 + int maxchunk; // max # of datums in one requested chunk + int pagesize; // # of datums in one page, default = 1024 + int pagedelta; // # of pages to allocate at once, default = 1 - int errorflag; // flag > 0 if error has occurred - // 1 = chunk size exceeded maxchunk - // 2 = memory allocation error + int errorflag; // flag > 0 if error has occurred + // 1 = chunk size exceeded maxchunk + // 2 = memory allocation error void allocate(); void deallocate(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/my_pool_chunk.h b/src/my_pool_chunk.h index cfd4a9fa7b..c68be94bd0 100644 --- a/src/my_pool_chunk.h +++ b/src/my_pool_chunk.h @@ -16,11 +16,10 @@ namespace LAMMPS_NS { -template -class MyPoolChunk { +template class MyPoolChunk { public: - int ndatum; // total # of stored datums - int nchunk; // total # of stored chunks + int ndatum; // total # of stored datums + int nchunk; // total # of stored chunks MyPoolChunk(int user_minchunk = 1, int user_maxchunk = 1, int user_nbin = 1, int user_chunkperpage = 1024, int user_pagedelta = 1); @@ -53,25 +52,25 @@ class MyPoolChunk { int status() const { return errorflag; } private: - int minchunk; // min # of datums per chunk - int maxchunk; // max # of datums per chunk - int nbin; // # of bins to split min-to-max into - int chunkperpage; // # of chunks on every page, regardless of which bin - int pagedelta; // # of pages to allocate at once, default = 1 - int binsize; // delta in chunk sizes between adjacent bins - int errorflag; // flag > 0 if error has occurred - // 1 = invalid inputs - // 2 = memory allocation error - // 3 = chunk size exceeded maxchunk + int minchunk; // min # of datums per chunk + int maxchunk; // max # of datums per chunk + int nbin; // # of bins to split min-to-max into + int chunkperpage; // # of chunks on every page, regardless of which bin + int pagedelta; // # of pages to allocate at once, default = 1 + int binsize; // delta in chunk sizes between adjacent bins + int errorflag; // flag > 0 if error has occurred + // 1 = invalid inputs + // 2 = memory allocation error + // 3 = chunk size exceeded maxchunk - T **pages; // list of allocated pages - int *whichbin; // which bin each page belongs to - int npage; // # of allocated pages - int *freelist; // each chunk points to next unused chunk in same bin - int *freehead; // index of first unused chunk in each bin - int *chunksize; // size of chunks in each bin + T **pages; // list of allocated pages + int *whichbin; // which bin each page belongs to + int npage; // # of allocated pages + int *freelist; // each chunk points to next unused chunk in same bin + int *freehead; // index of first unused chunk in each bin + int *chunksize; // size of chunks in each bin void allocate(int ibin); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/nbin.h b/src/nbin.h index 06b5f189be..386b404e7a 100644 --- a/src/nbin.h +++ b/src/nbin.h @@ -20,23 +20,23 @@ namespace LAMMPS_NS { class NBin : protected Pointers { public: - int istyle; // 1-N index into binnames - bigint last_bin; // last timestep atoms were binned - double cutoff_custom; // cutoff set by requestor + int istyle; // 1-N index into binnames + bigint last_bin; // last timestep atoms were binned + double cutoff_custom; // cutoff set by requestor // Variables for NBinStandard - int nbinx,nbiny,nbinz; // # of global bins - int mbins; // # of local bins and offset on this proc - int mbinx,mbiny,mbinz; - int mbinxlo,mbinylo,mbinzlo; + int nbinx, nbiny, nbinz; // # of global bins + int mbins; // # of local bins and offset on this proc + int mbinx, mbiny, mbinz; + int mbinxlo, mbinylo, mbinzlo; - double binsizex,binsizey,binsizez; // bin sizes and inverse sizes - double bininvx,bininvy,bininvz; + double binsizex, binsizey, binsizez; // bin sizes and inverse sizes + double bininvx, bininvy, bininvz; - int *binhead; // index of first atom in each bin - int *bins; // index of next atom in same bin - int *atom2bin; // bin assignment for each atom (local+ghost) + int *binhead; // index of first atom in each bin + int *bins; // index of next atom in same bin + int *atom2bin; // bin assignment for each atom (local+ghost) // Analogues for NBinMultimulti @@ -57,14 +57,13 @@ class NBin : protected Pointers { virtual void bin_atoms_setup(int) = 0; virtual void setup_bins(int) = 0; virtual void bin_atoms() = 0; - virtual double memory_usage() {return 0.0;} + virtual double memory_usage() { return 0.0; } // Kokkos package - int kokkos; // 1 if class stores Kokkos data + int kokkos; // 1 if class stores Kokkos data protected: - // data from Neighbor class int includegroup; @@ -72,7 +71,7 @@ class NBin : protected Pointers { double cutneighmax; int binsizeflag; double binsize_user; - double *bboxlo,*bboxhi; + double *bboxlo, *bboxhi; int ncollections; double **cutcollectionsq; @@ -83,13 +82,13 @@ class NBin : protected Pointers { // data for standard NBin - int maxatom; // size of bins array - int maxbin; // size of binhead array + int maxatom; // size of bins array + int maxbin; // size of binhead array // data for multi NBin - int maxcollections; // size of multi arrays - int * maxbins_multi; // size of 2nd dimension of binhead_multi array + int maxcollections; // size of multi arrays + int *maxbins_multi; // size of 2nd dimension of binhead_multi array // methods @@ -97,7 +96,7 @@ class NBin : protected Pointers { int coord2bin_multi(double *, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/nbin_multi.h b/src/nbin_multi.h index ee1a27852b..3b94e21d24 100644 --- a/src/nbin_multi.h +++ b/src/nbin_multi.h @@ -28,7 +28,6 @@ namespace LAMMPS_NS { class NBinMulti : public NBin { public: - NBinMulti(class LAMMPS *); ~NBinMulti() {} void bin_atoms_setup(int); @@ -37,7 +36,7 @@ class NBinMulti : public NBin { double memory_usage(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nbin_standard.h b/src/nbin_standard.h index 0f6178c8a2..13c1c1c674 100644 --- a/src/nbin_standard.h +++ b/src/nbin_standard.h @@ -36,7 +36,7 @@ class NBinStandard : public NBin { double memory_usage(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/neigh_list.h b/src/neigh_list.h index 88d86aaffd..4eb18a5aa9 100644 --- a/src/neigh_list.h +++ b/src/neigh_list.h @@ -14,19 +14,19 @@ #ifndef LMP_NEIGH_LIST_H #define LMP_NEIGH_LIST_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class NeighList : protected Pointers { public: enum RequestorType { NONE, PAIR, FIX, COMPUTE }; - void * requestor; // object that made request - RequestorType requestor_type; // type of requestor + void *requestor; // object that made request + RequestorType requestor_type; // type of requestor - int index; // index of which neigh list this is - // also indexes the request it came from - // and the npair list of NPair classes + int index; // index of which neigh list this is + // also indexes the request it came from + // and the npair list of NPair classes int bin_method; // 0 if no binning, else 1-N index into binnames int stencil_method; // 0 if no stencil, else 1-N index into stencilnames @@ -34,83 +34,83 @@ class NeighList : protected Pointers { // settings from NeighRequest - int occasional; // 0 if build every reneighbor, 1 if not - int ghost; // 1 if list stores neighbors of ghosts - int ssa; // 1 if list stores Shardlow data - int history; // 1 if there is neigh history (FixNeighHist) - int respaouter; // 1 if list is a rRespa outer list - int respamiddle; // 1 if there is also a rRespa middle list - int respainner; // 1 if there is also a rRespa inner list - int copy; // 1 if this list is copied from another list - int kk2cpu; // 1 if this list is copied from Kokkos to CPU - int copymode; // 1 if this is a Kokkos on-device copy - int id; // copied from neighbor list request + int occasional; // 0 if build every reneighbor, 1 if not + int ghost; // 1 if list stores neighbors of ghosts + int ssa; // 1 if list stores Shardlow data + int history; // 1 if there is neigh history (FixNeighHist) + int respaouter; // 1 if list is a rRespa outer list + int respamiddle; // 1 if there is also a rRespa middle list + int respainner; // 1 if there is also a rRespa inner list + int copy; // 1 if this list is copied from another list + int kk2cpu; // 1 if this list is copied from Kokkos to CPU + int copymode; // 1 if this is a Kokkos on-device copy + int id; // copied from neighbor list request // data structs to store neighbor pairs I,J and associated values - int inum; // # of I atoms neighbors are stored for - int gnum; // # of ghost atoms neighbors are stored for - int *ilist; // local indices of I atoms - int *numneigh; // # of J neighbors for each I atom - int **firstneigh; // ptr to 1st J int value of each I atom - int maxatom; // size of allocated per-atom arrays + int inum; // # of I atoms neighbors are stored for + int gnum; // # of ghost atoms neighbors are stored for + int *ilist; // local indices of I atoms + int *numneigh; // # of J neighbors for each I atom + int **firstneigh; // ptr to 1st J int value of each I atom + int maxatom; // size of allocated per-atom arrays - int pgsize; // size of each page - int oneatom; // max size for one atom - MyPage *ipage; // pages of neighbor indices + int pgsize; // size of each page + int oneatom; // max size for one atom + MyPage *ipage; // pages of neighbor indices // data structs to store rRESPA neighbor pairs I,J and associated values - int inum_inner; // # of I atoms neighbors are stored for - int gnum_inner; // # of ghost atoms neighbors are stored for - int *ilist_inner; // local indices of I atoms - int *numneigh_inner; // # of J neighbors for each I atom - int **firstneigh_inner; // ptr to 1st J int value of each I atom + int inum_inner; // # of I atoms neighbors are stored for + int gnum_inner; // # of ghost atoms neighbors are stored for + int *ilist_inner; // local indices of I atoms + int *numneigh_inner; // # of J neighbors for each I atom + int **firstneigh_inner; // ptr to 1st J int value of each I atom - int inum_middle; // # of I atoms neighbors are stored for - int gnum_middle; // # of ghost atoms neighbors are stored for - int *ilist_middle; // local indices of I atoms - int *numneigh_middle; // # of J neighbors for each I atom - int **firstneigh_middle; // ptr to 1st J int value of each I atom + int inum_middle; // # of I atoms neighbors are stored for + int gnum_middle; // # of ghost atoms neighbors are stored for + int *ilist_middle; // local indices of I atoms + int *numneigh_middle; // # of J neighbors for each I atom + int **firstneigh_middle; // ptr to 1st J int value of each I atom - MyPage *ipage_inner; // pages of neighbor indices for inner - MyPage *ipage_middle; // pages of neighbor indices for middle + MyPage *ipage_inner; // pages of neighbor indices for inner + MyPage *ipage_middle; // pages of neighbor indices for middle // atom types to skip when building list // copied info from corresponding request into realloced vec/array - int *iskip; // iskip[i] = 1 if atoms of type I are not in list - int **ijskip; // ijskip[i][j] = 1 if pairs of type I,J are not in list + int *iskip; // iskip[i] = 1 if atoms of type I are not in list + int **ijskip; // ijskip[i][j] = 1 if pairs of type I,J are not in list // settings and pointers for related neighbor lists and fixes - NeighList *listcopy; // me = copy list, point to list I copy from - NeighList *listskip; // me = skip list, point to list I skip from - NeighList *listfull; // me = half list, point to full I derive from + NeighList *listcopy; // me = copy list, point to list I copy from + NeighList *listskip; // me = skip list, point to list I skip from + NeighList *listfull; // me = half list, point to full I derive from - class Fix *fix_bond; // fix that stores bond info + class Fix *fix_bond; // fix that stores bond info // Kokkos package - int kokkos; // 1 if list stores Kokkos data + int kokkos; // 1 if list stores Kokkos data ExecutionSpace execution_space; // USER-DPD package and Shardlow Splitting Algorithm (SSA) support - class NPair *np; // ptr to NPair instance I depend on + class NPair *np; // ptr to NPair instance I depend on // methods NeighList(class LAMMPS *); virtual ~NeighList(); void post_constructor(class NeighRequest *); - void setup_pages(int, int); // setup page data structures - void grow(int,int); // grow all data structs - void print_attributes(); // debug routine - int get_maxlocal() {return maxatom;} + void setup_pages(int, int); // setup page data structures + void grow(int, int); // grow all data structs + void print_attributes(); // debug routine + int get_maxlocal() { return maxatom; } double memory_usage(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/neigh_request.h b/src/neigh_request.h index c58c17b4c5..f1005319e8 100644 --- a/src/neigh_request.h +++ b/src/neigh_request.h @@ -20,11 +20,11 @@ namespace LAMMPS_NS { class NeighRequest : protected Pointers { public: - int index; // index of which neigh request this is - void *requestor; // class that made request - int requestor_instance; // instance of that class (only Fix, Compute, Pair) - int id; // ID of request as stored by requestor - // used to track multiple requests from one class + int index; // index of which neigh request this is + void *requestor; // class that made request + int requestor_instance; // instance of that class (only Fix, Compute, Pair) + int id; // ID of request as stored by requestor + // used to track multiple requests from one class // ----------------------------- // flags set by requesting class for attributes of neighor list they need @@ -34,7 +34,7 @@ class NeighRequest : protected Pointers { // which class style requests the list // one flag is 1, others are 0 - int pair; // pair is set by default + int pair; // pair is set by default int fix; int compute; int command; @@ -43,42 +43,42 @@ class NeighRequest : protected Pointers { // half/full setting, determines which neighbors appear in list // one flag is 1, other is 0 - int half; // half neigh list (set by default) - int full; // full neigh list + int half; // half neigh list (set by default) + int full; // full neigh list // attribute flags, all are 0 by default - int occasional; // how often list is built - // 0 if needed every reneighboring during run - // 1 if only occasionally needed by a fix, compute, etc + int occasional; // how often list is built + // 0 if needed every reneighboring during run + // 1 if only occasionally needed by a fix, compute, etc - int newton; // which owned/ghost pairs appear in list - // 0 if use force::newton_pair setting - // 1 if override with pair newton on - // 2 if override with pair newton off + int newton; // which owned/ghost pairs appear in list + // 0 if use force::newton_pair setting + // 1 if override with pair newton on + // 2 if override with pair newton off - int ghost; // 1 if includes ghost atom neighbors - int size; // 1 if pair cutoff set by particle radius - int history; // 1 if there is also neigh history info (FixNeighHist) - int granonesided; // 1 if one-sided granular list for - // sphere/surf interactions - int respainner; // 1 if need a rRESPA inner list - int respamiddle; // 1 if need a rRESPA middle list - int respaouter; // 1 if need a rRESPA outer list - int bond; // 1 if store bond neighbors instead of atom neighs - int omp; // set by USER-OMP package - int intel; // set by USER-INTEL package - int kokkos_host; // set by KOKKOS package + int ghost; // 1 if includes ghost atom neighbors + int size; // 1 if pair cutoff set by particle radius + int history; // 1 if there is also neigh history info (FixNeighHist) + int granonesided; // 1 if one-sided granular list for + // sphere/surf interactions + int respainner; // 1 if need a rRESPA inner list + int respamiddle; // 1 if need a rRESPA middle list + int respaouter; // 1 if need a rRESPA outer list + int bond; // 1 if store bond neighbors instead of atom neighs + int omp; // set by USER-OMP package + int intel; // set by USER-INTEL package + int kokkos_host; // set by KOKKOS package int kokkos_device; - int ssa; // set by USER-DPD package, for Shardlow lists - int cut; // 1 if use a non-standard cutoff length - double cutoff; // special cutoff distance for this list + int ssa; // set by USER-DPD package, for Shardlow lists + int cut; // 1 if use a non-standard cutoff length + double cutoff; // special cutoff distance for this list // flags set by pair hybrid - int skip; // 1 if this list skips atom types from another list - int *iskip; // iskip[i] if atoms of type I are not in list - int **ijskip; // ijskip[i][j] if pairs of type I,J are not in list + int skip; // 1 if this list skips atom types from another list + int *iskip; // iskip[i] if atoms of type I are not in list + int **ijskip; // ijskip[i][j] if pairs of type I,J are not in list // command_style only set if command = 1 // allows print_pair_info() to access command name @@ -89,25 +89,25 @@ class NeighRequest : protected Pointers { // flags set by Neighbor class to morph original requests // ----------------------------- - int skiplist; // index of list to skip from - int off2on; // 1 if this is newton on list, but skips from off list + int skiplist; // index of list to skip from + int off2on; // 1 if this is newton on list, but skips from off list - int copy; // 1 if this list copied from another list - int copylist; // index of list to copy from + int copy; // 1 if this list copied from another list + int copylist; // index of list to copy from - int halffull; // 1 if half list computed from another full list - int halffulllist; // index of full list to derive half from + int halffull; // 1 if half list computed from another full list + int halffulllist; // index of full list to derive half from - int unique; // 1 if this list requires its own - // NStencil, Nbin class - because of requestor cutoff + int unique; // 1 if this list requires its own + // NStencil, Nbin class - because of requestor cutoff // ----------------------------- // internal settings made by Neighbor class // ----------------------------- - int index_bin; // index of NBin class assigned to this request - int index_stencil; // index of NStencil class assigned to this request - int index_pair; // index of NPair class assigned to this request + int index_bin; // index of NBin class assigned to this request + int index_stencil; // index of NStencil class assigned to this request + int index_pair; // index of NPair class assigned to this request // methods @@ -119,6 +119,6 @@ class NeighRequest : protected Pointers { void copy_request(NeighRequest *, int); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/neighbor.h b/src/neighbor.h index 2aa1f203c4..4d43c92b4b 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -20,86 +20,86 @@ namespace LAMMPS_NS { class Neighbor : protected Pointers { public: - enum{NSQ,BIN,MULTI_OLD,MULTI}; - int style; // 0,1,2,3 = nsq, bin, multi/old, multi - int every; // build every this many steps - int delay; // delay build for this many steps - int dist_check; // 0 = always build, 1 = only if 1/2 dist - int ago; // how many steps ago neighboring occurred - int pgsize; // size of neighbor page - int oneatom; // max # of neighbors for one atom - int includegroup; // only build pairwise lists for this group - int build_once; // 1 if only build lists once per run + enum { NSQ, BIN, MULTI_OLD, MULTI }; + int style; // 0,1,2,3 = nsq, bin, multi/old, multi + int every; // build every this many steps + int delay; // delay build for this many steps + int dist_check; // 0 = always build, 1 = only if 1/2 dist + int ago; // how many steps ago neighboring occurred + int pgsize; // size of neighbor page + int oneatom; // max # of neighbors for one atom + int includegroup; // only build pairwise lists for this group + int build_once; // 1 if only build lists once per run - double skin; // skin distance - double cutneighmin; // min neighbor cutoff for all type pairs - double cutneighmax; // max neighbor cutoff for all type pairs - double cutneighmaxsq; // cutneighmax squared - double **cutneighsq; // neighbor cutneigh sq for each type pair - double **cutneighghostsq; // cutneigh sq for each ghost type pair - double *cuttype; // for each type, max neigh cut w/ others - double *cuttypesq; // cuttype squared - double cut_inner_sq; // outer cutoff for inner neighbor list - double cut_middle_sq; // outer cutoff for middle neighbor list - double cut_middle_inside_sq; // inner cutoff for middle neighbor list + double skin; // skin distance + double cutneighmin; // min neighbor cutoff for all type pairs + double cutneighmax; // max neighbor cutoff for all type pairs + double cutneighmaxsq; // cutneighmax squared + double **cutneighsq; // neighbor cutneigh sq for each type pair + double **cutneighghostsq; // cutneigh sq for each ghost type pair + double *cuttype; // for each type, max neigh cut w/ others + double *cuttypesq; // cuttype squared + double cut_inner_sq; // outer cutoff for inner neighbor list + double cut_middle_sq; // outer cutoff for middle neighbor list + double cut_middle_inside_sq; // inner cutoff for middle neighbor list - int binsizeflag; // user-chosen bin size - double binsize_user; // set externally by some accelerator pkgs + int binsizeflag; // user-chosen bin size + double binsize_user; // set externally by some accelerator pkgs - bigint ncalls; // # of times build has been called - bigint ndanger; // # of dangerous builds - bigint lastcall; // timestep of last neighbor::build() call + bigint ncalls; // # of times build has been called + bigint ndanger; // # of dangerous builds + bigint lastcall; // timestep of last neighbor::build() call // geometry and static info, used by other Neigh classes - double *bboxlo,*bboxhi; // ptrs to full domain bounding box - // different for orthog vs triclinic + double *bboxlo, *bboxhi; // ptrs to full domain bounding box + // different for orthog vs triclinic // exclusion info, used by NeighPair - int exclude; // 0 if no type/group exclusions, 1 if yes + int exclude; // 0 if no type/group exclusions, 1 if yes - int nex_type; // # of entries in type exclusion list - int *ex1_type,*ex2_type; // pairs of types to exclude - int **ex_type; // 2d array of excluded type pairs + int nex_type; // # of entries in type exclusion list + int *ex1_type, *ex2_type; // pairs of types to exclude + int **ex_type; // 2d array of excluded type pairs - int nex_group; // # of entries in group exclusion list - int *ex1_group,*ex2_group; // pairs of group #'s to exclude - int *ex1_bit,*ex2_bit; // pairs of group bits to exclude + int nex_group; // # of entries in group exclusion list + int *ex1_group, *ex2_group; // pairs of group #'s to exclude + int *ex1_bit, *ex2_bit; // pairs of group bits to exclude - int nex_mol; // # of entries in molecule exclusion list - int *ex_mol_group; // molecule group #'s to exclude - int *ex_mol_bit; // molecule group bits to exclude - int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) - // 1 = exclude if in same molecule (intra) + int nex_mol; // # of entries in molecule exclusion list + int *ex_mol_group; // molecule group #'s to exclude + int *ex_mol_bit; // molecule group bits to exclude + int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) + // 1 = exclude if in same molecule (intra) // special info, used by NeighPair - int special_flag[4]; // flags for 1-2, 1-3, 1-4 neighbors + int special_flag[4]; // flags for 1-2, 1-3, 1-4 neighbors // cluster setting, used by NeighTopo - int cluster_check; // 1 if check bond/angle/etc satisfies minimg + int cluster_check; // 1 if check bond/angle/etc satisfies minimg // pairwise neighbor lists and corresponding requests - int nlist; // # of pairwise neighbor lists - int nrequest; // # of requests, same as nlist - int old_nrequest; // # of requests for previous run + int nlist; // # of pairwise neighbor lists + int nrequest; // # of requests, same as nlist + int old_nrequest; // # of requests for previous run class NeighList **lists; - class NeighRequest **requests; // from Pair,Fix,Compute,Command classes - class NeighRequest **old_requests; // copy of requests to compare to + class NeighRequest **requests; // from Pair,Fix,Compute,Command classes + class NeighRequest **old_requests; // copy of requests to compare to // data from topology neighbor lists - int nbondlist; // list of bonds to compute + int nbondlist; // list of bonds to compute int **bondlist; - int nanglelist; // list of angles to compute + int nanglelist; // list of angles to compute int **anglelist; - int ndihedrallist; // list of dihedrals to compute + int ndihedrallist; // list of dihedrals to compute int **dihedrallist; - int nimproperlist; // list of impropers to compute + int nimproperlist; // list of impropers to compute int **improperlist; // optional type grouping for multi @@ -119,74 +119,74 @@ class Neighbor : protected Pointers { Neighbor(class LAMMPS *); virtual ~Neighbor(); virtual void init(); - int request(void *, int instance=0); + int request(void *, int instance = 0); int decide(); // decide whether to build or not virtual int check_distance(); // check max distance moved since last build void setup_bins(); // setup bins based on box and cutoff virtual void build(int); // build all perpetual neighbor lists virtual void build_topology(); // pairwise topology neighbor lists - void build_one(class NeighList *list, int preflag=0); - // create a one-time pairwise neigh list - void set(int, char **); // set neighbor style and skin distance - void reset_timestep(bigint); // reset of timestep counter - void modify_params(int, char**); // modify params that control builds - void modify_params(const std::string &); // convenience overload + void build_one(class NeighList *list, int preflag = 0); + // create a one-time pairwise neigh list + void set(int, char **); // set neighbor style and skin distance + void reset_timestep(bigint); // reset of timestep counter + void modify_params(int, char **); // modify params that control builds + void modify_params(const std::string &); // convenience overload - void exclusion_group_group_delete(int, int); // rm a group-group exclusion - int exclude_setting(); // return exclude value to accelerator pkg - class NeighRequest *find_request(void *); // find a neighbor request - int any_full(); // Check if any old requests had full neighbor lists - void build_collection(int); // build peratom collection array starting at the given index + void exclusion_group_group_delete(int, int); // rm a group-group exclusion + int exclude_setting(); // return exclude value to accelerator pkg + class NeighRequest *find_request(void *); // find a neighbor request + int any_full(); // Check if any old requests had full neighbor lists + void build_collection(int); // build peratom collection array starting at the given index double memory_usage(); - bigint last_setup_bins; // step of last neighbor::setup_bins() call + bigint last_setup_bins; // step of last neighbor::setup_bins() call protected: - int me,nprocs; - int firsttime; // flag for calling init_styles() only once + int me, nprocs; + int firsttime; // flag for calling init_styles() only once - int dimension; // 2/3 for 2d/3d - int triclinic; // 0 if domain is orthog, 1 if triclinic - int newton_pair; // 0 if newton off for pairwise, 1 if on + int dimension; // 2/3 for 2d/3d + int triclinic; // 0 if domain is orthog, 1 if triclinic + int newton_pair; // 0 if newton off for pairwise, 1 if on - int must_check; // 1 if must check other classes to reneigh - int restart_check; // 1 if restart enabled, 0 if no - int fix_check; // # of fixes that induce reneigh - int *fixchecklist; // which fixes to check + int must_check; // 1 if must check other classes to reneigh + int restart_check; // 1 if restart enabled, 0 if no + int fix_check; // # of fixes that induce reneigh + int *fixchecklist; // which fixes to check - double triggersq; // trigger = build when atom moves this dist + double triggersq; // trigger = build when atom moves this dist - double **xhold; // atom coords at last neighbor build - int maxhold; // size of xhold array + double **xhold; // atom coords at last neighbor build + int maxhold; // size of xhold array - int boxcheck; // 1 if need to store box size - double boxlo_hold[3],boxhi_hold[3]; // box size at last neighbor build - double corners_hold[8][3]; // box corners at last neighbor build - double (*corners)[3]; // ptr to 8 corners of triclinic box + int boxcheck; // 1 if need to store box size + double boxlo_hold[3], boxhi_hold[3]; // box size at last neighbor build + double corners_hold[8][3]; // box corners at last neighbor build + double (*corners)[3]; // ptr to 8 corners of triclinic box - double inner[2],middle[2]; // rRESPA cutoffs for extra lists + double inner[2], middle[2]; // rRESPA cutoffs for extra lists - int old_style,old_triclinic; // previous run info - int old_pgsize,old_oneatom; // used to avoid re-creating neigh lists + int old_style, old_triclinic; // previous run info + int old_pgsize, old_oneatom; // used to avoid re-creating neigh lists - int nstencil_perpetual; // # of perpetual NeighStencil classes - int npair_perpetual; // #x of perpetual NeighPair classes - int *slist; // indices of them in neigh_stencil - int *plist; // indices of them in neigh_pair + int nstencil_perpetual; // # of perpetual NeighStencil classes + int npair_perpetual; // #x of perpetual NeighPair classes + int *slist; // indices of them in neigh_stencil + int *plist; // indices of them in neigh_pair - int maxex_type; // max # in exclusion type list - int maxex_group; // max # in exclusion group list - int maxex_mol; // max # in exclusion molecule list + int maxex_type; // max # in exclusion type list + int maxex_group; // max # in exclusion group list + int maxex_mol; // max # in exclusion molecule list - int maxatom; // max size of atom-based NeighList arrays - int maxrequest; // max size of NeighRequest list + int maxatom; // max size of atom-based NeighList arrays + int maxrequest; // max size of NeighRequest list // info for other Neigh classes: NBin,NStencil,NPair,NTopo - int nbin,nstencil; - int nbclass,nsclass,npclass; - int bondwhich,anglewhich,dihedralwhich,improperwhich; + int nbin, nstencil; + int nbclass, nsclass, npclass; + int bondwhich, anglewhich, dihedralwhich, improperwhich; typedef class NBin *(*BinCreator)(class LAMMPS *); BinCreator *binclass; @@ -251,59 +251,59 @@ class Neighbor : protected Pointers { namespace NeighConst { enum { - NB_INTEL = 1<<0, - NB_KOKKOS_DEVICE = 1<<1, - NB_KOKKOS_HOST = 1<<2, - NB_SSA = 1<<3, - NB_STANDARD = 1<<4, - NB_MULTI = 1<<5 + NB_INTEL = 1 << 0, + NB_KOKKOS_DEVICE = 1 << 1, + NB_KOKKOS_HOST = 1 << 2, + NB_SSA = 1 << 3, + NB_STANDARD = 1 << 4, + NB_MULTI = 1 << 5 }; enum { - NS_BIN = 1<<0, - NS_MULTI = 1<<1, - NS_HALF = 1<<2, - NS_FULL = 1<<3, - NS_2D = 1<<4, - NS_3D = 1<<5, - NS_ORTHO = 1<<6, - NS_TRI = 1<<7, - NS_GHOST = 1<<8, - NS_SSA = 1<<9, - NS_MULTI_OLD = 1<<10 + NS_BIN = 1 << 0, + NS_MULTI = 1 << 1, + NS_HALF = 1 << 2, + NS_FULL = 1 << 3, + NS_2D = 1 << 4, + NS_3D = 1 << 5, + NS_ORTHO = 1 << 6, + NS_TRI = 1 << 7, + NS_GHOST = 1 << 8, + NS_SSA = 1 << 9, + NS_MULTI_OLD = 1 << 10 }; enum { - NP_NSQ = 1<<0, - NP_BIN = 1<<1, - NP_MULTI = 1<<2, - NP_HALF = 1<<3, - NP_FULL = 1<<4, - NP_ORTHO = 1<<5, - NP_TRI = 1<<6, - NP_ATOMONLY = 1<<7, - NP_MOLONLY = 1<<8, - NP_NEWTON = 1<<9, - NP_NEWTOFF = 1<<10, - NP_GHOST = 1<<11, - NP_SIZE = 1<<12, - NP_ONESIDE = 1<<13, - NP_RESPA = 1<<14, - NP_BOND = 1<<15, - NP_OMP = 1<<16, - NP_INTEL = 1<<17, - NP_KOKKOS_DEVICE = 1<<18, - NP_KOKKOS_HOST = 1<<19, - NP_SSA = 1<<20, - NP_COPY = 1<<21, - NP_SKIP = 1<<22, - NP_HALF_FULL = 1<<23, - NP_OFF2ON = 1<<24, - NP_MULTI_OLD = 1<<25 + NP_NSQ = 1 << 0, + NP_BIN = 1 << 1, + NP_MULTI = 1 << 2, + NP_HALF = 1 << 3, + NP_FULL = 1 << 4, + NP_ORTHO = 1 << 5, + NP_TRI = 1 << 6, + NP_ATOMONLY = 1 << 7, + NP_MOLONLY = 1 << 8, + NP_NEWTON = 1 << 9, + NP_NEWTOFF = 1 << 10, + NP_GHOST = 1 << 11, + NP_SIZE = 1 << 12, + NP_ONESIDE = 1 << 13, + NP_RESPA = 1 << 14, + NP_BOND = 1 << 15, + NP_OMP = 1 << 16, + NP_INTEL = 1 << 17, + NP_KOKKOS_DEVICE = 1 << 18, + NP_KOKKOS_HOST = 1 << 19, + NP_SSA = 1 << 20, + NP_COPY = 1 << 21, + NP_SKIP = 1 << 22, + NP_HALF_FULL = 1 << 23, + NP_OFF2ON = 1 << 24, + NP_MULTI_OLD = 1 << 25 }; -} +} // namespace NeighConst -} +} // namespace LAMMPS_NS #endif diff --git a/src/npair.h b/src/npair.h index 5324eea406..81731cc121 100644 --- a/src/npair.h +++ b/src/npair.h @@ -20,12 +20,12 @@ namespace LAMMPS_NS { class NPair : protected Pointers { public: - int istyle; // 1-N index into pairnames - class NBin *nb; // ptr to NBin instance I depend on - class NStencil *ns; // ptr to NStencil instance I depend on - bigint last_build; // last timestep build performed + int istyle; // 1-N index into pairnames + class NBin *nb; // ptr to NBin instance I depend on + class NStencil *ns; // ptr to NStencil instance I depend on + bigint last_build; // last timestep build performed - double cutoff_custom; // cutoff set by requestor + double cutoff_custom; // cutoff set by requestor NPair(class LAMMPS *); virtual ~NPair(); @@ -35,7 +35,7 @@ class NPair : protected Pointers { virtual void build(class NeighList *) = 0; protected: - double **mycutneighsq; // per-type cutoffs when user specified + double **mycutneighsq; // per-type cutoffs when user specified // data from Neighbor class @@ -47,25 +47,25 @@ class NPair : protected Pointers { double cut_inner_sq; double cut_middle_sq; double cut_middle_inside_sq; - double *bboxlo,*bboxhi; + double *bboxlo, *bboxhi; int ncollections; double **cutcollectionsq; // exclusion data from Neighbor class - int nex_type; // # of entries in type exclusion list - int *ex1_type,*ex2_type; // pairs of types to exclude - int **ex_type; // 2d array of excluded type pairs + int nex_type; // # of entries in type exclusion list + int *ex1_type, *ex2_type; // pairs of types to exclude + int **ex_type; // 2d array of excluded type pairs - int nex_group; // # of entries in group exclusion list - int *ex1_group,*ex2_group; // pairs of group #'s to exclude - int *ex1_bit,*ex2_bit; // pairs of group bits to exclude + int nex_group; // # of entries in group exclusion list + int *ex1_group, *ex2_group; // pairs of group #'s to exclude + int *ex1_bit, *ex2_bit; // pairs of group bits to exclude - int nex_mol; // # of entries in molecule exclusion list - int *ex_mol_bit; // molecule group bits to exclude - int *ex_mol_group; // molecule group #'s to exclude - int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) - // 1 = exclude if in same molecule (intra) + int nex_mol; // # of entries in molecule exclusion list + int *ex_mol_bit; // molecule group bits to exclude + int *ex_mol_group; // molecule group #'s to exclude + int *ex_mol_intra; // 0 = exclude if in 2 molecules (inter) + // 1 = exclude if in same molecule (intra) // special data from Neighbor class @@ -73,12 +73,12 @@ class NPair : protected Pointers { // data from NBin class - int nbinx,nbiny,nbinz; + int nbinx, nbiny, nbinz; int mbins; - int mbinx,mbiny,mbinz; - int mbinxlo,mbinylo,mbinzlo; - double bininvx,bininvy,bininvz; - int *atom2bin,*bins; + int mbinx, mbiny, mbinz; + int mbinxlo, mbinylo, mbinzlo; + double bininvx, bininvy, bininvz; + int *atom2bin, *bins; int *binhead; int *nbinx_multi, *nbiny_multi, *nbinz_multi; @@ -97,8 +97,8 @@ class NPair : protected Pointers { int **stencil_multi_old; double **distsq_multi_old; - int ** nstencil_multi; - int *** stencil_multi; + int **nstencil_multi; + int ***stencil_multi; // data common to all NPair variants @@ -109,13 +109,11 @@ class NPair : protected Pointers { virtual void copy_bin_info(); virtual void copy_stencil_info(); - int exclusion(int, int, int, - int, int *, tagint *) const; // test for pair exclusion - int coord2bin(double *); // mapping atom coord to a bin - int coord2bin(double *, int &, int &, int&); // ditto - - int coord2bin(double *, int); // mapping atom coord to group bin + int exclusion(int, int, int, int, int *, tagint *) const; // test for pair exclusion + int coord2bin(double *); // mapping atom coord to a bin + int coord2bin(double *, int &, int &, int &); // ditto + int coord2bin(double *, int); // mapping atom coord to group bin // find_special: determine if atom j is in special list of atom i // if it is not, return 0 @@ -124,8 +122,8 @@ class NPair : protected Pointers { // if it is and special flag is 2 (otherwise), return 1,2,3 // for which level of neighbor it is (and which coeff it maps to) - inline int find_special(const tagint *list, const int *nspecial, - const tagint tag) const { + inline int find_special(const tagint *list, const int *nspecial, const tagint tag) const + { const int n1 = nspecial[0]; const int n2 = nspecial[1]; const int n3 = nspecial[2]; @@ -133,17 +131,26 @@ class NPair : protected Pointers { for (int i = 0; i < n3; i++) { if (list[i] == tag) { if (i < n1) { - if (special_flag[1] == 0) return -1; - else if (special_flag[1] == 1) return 0; - else return 1; + if (special_flag[1] == 0) + return -1; + else if (special_flag[1] == 1) + return 0; + else + return 1; } else if (i < n2) { - if (special_flag[2] == 0) return -1; - else if (special_flag[2] == 1) return 0; - else return 2; + if (special_flag[2] == 0) + return -1; + else if (special_flag[2] == 1) + return 0; + else + return 2; } else { - if (special_flag[3] == 0) return -1; - else if (special_flag[3] == 1) return 0; - else return 3; + if (special_flag[3] == 0) + return -1; + else if (special_flag[3] == 1) + return 0; + else + return 3; } } } @@ -154,7 +161,7 @@ class NPair : protected Pointers { ExecutionSpace execution_space; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/npair_copy.h b/src/npair_copy.h index c08a784188..b48a2ea8cb 100644 --- a/src/npair_copy.h +++ b/src/npair_copy.h @@ -33,7 +33,7 @@ class NPairCopy : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_bin.h b/src/npair_full_bin.h index 7f2760d155..8046175566 100644 --- a/src/npair_full_bin.h +++ b/src/npair_full_bin.h @@ -34,7 +34,7 @@ class NPairFullBin : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_bin_atomonly.h b/src/npair_full_bin_atomonly.h index 6aeb974327..ec7f9955b9 100644 --- a/src/npair_full_bin_atomonly.h +++ b/src/npair_full_bin_atomonly.h @@ -34,7 +34,7 @@ class NPairFullBinAtomonly : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_bin_ghost.h b/src/npair_full_bin_ghost.h index 2192d66dec..5393991628 100644 --- a/src/npair_full_bin_ghost.h +++ b/src/npair_full_bin_ghost.h @@ -34,7 +34,7 @@ class NPairFullBinGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_multi.h b/src/npair_full_multi.h index 3ebf8ef2a0..2556003bf3 100644 --- a/src/npair_full_multi.h +++ b/src/npair_full_multi.h @@ -33,7 +33,7 @@ class NPairFullMulti : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_multi_old.h b/src/npair_full_multi_old.h index 0964d5c0e6..8fecc5b79d 100644 --- a/src/npair_full_multi_old.h +++ b/src/npair_full_multi_old.h @@ -33,7 +33,7 @@ class NPairFullMultiOld : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_nsq.h b/src/npair_full_nsq.h index 4c50a2f852..9d7cb20b14 100644 --- a/src/npair_full_nsq.h +++ b/src/npair_full_nsq.h @@ -33,7 +33,7 @@ class NPairFullNsq : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_full_nsq_ghost.h b/src/npair_full_nsq_ghost.h index 4e42ad8826..7175f825ad 100644 --- a/src/npair_full_nsq_ghost.h +++ b/src/npair_full_nsq_ghost.h @@ -34,7 +34,7 @@ class NPairFullNsqGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_atomonly_newton.h b/src/npair_half_bin_atomonly_newton.h index d903e92540..a8f4be652e 100644 --- a/src/npair_half_bin_atomonly_newton.h +++ b/src/npair_half_bin_atomonly_newton.h @@ -33,7 +33,7 @@ class NPairHalfBinAtomonlyNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newtoff.h b/src/npair_half_bin_newtoff.h index 9a26c10770..c443bdc9ec 100644 --- a/src/npair_half_bin_newtoff.h +++ b/src/npair_half_bin_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfBinNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newtoff_ghost.h b/src/npair_half_bin_newtoff_ghost.h index 1923bf0db7..f7bf627879 100644 --- a/src/npair_half_bin_newtoff_ghost.h +++ b/src/npair_half_bin_newtoff_ghost.h @@ -33,7 +33,7 @@ class NPairHalfBinNewtoffGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newton.h b/src/npair_half_bin_newton.h index 87ea216b32..275dad91c3 100644 --- a/src/npair_half_bin_newton.h +++ b/src/npair_half_bin_newton.h @@ -33,7 +33,7 @@ class NPairHalfBinNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_bin_newton_tri.h b/src/npair_half_bin_newton_tri.h index daf202fd20..c02b9abddc 100644 --- a/src/npair_half_bin_newton_tri.h +++ b/src/npair_half_bin_newton_tri.h @@ -33,7 +33,7 @@ class NPairHalfBinNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_newtoff.h b/src/npair_half_multi_newtoff.h index 96065ed3f4..4711de4bcb 100644 --- a/src/npair_half_multi_newtoff.h +++ b/src/npair_half_multi_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfMultiNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_newton.h b/src/npair_half_multi_newton.h index 6bbf3fe0fa..b090c07675 100644 --- a/src/npair_half_multi_newton.h +++ b/src/npair_half_multi_newton.h @@ -33,7 +33,7 @@ class NPairHalfMultiNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_newton_tri.h b/src/npair_half_multi_newton_tri.h index a33f9ee0c1..ba2c9e1853 100644 --- a/src/npair_half_multi_newton_tri.h +++ b/src/npair_half_multi_newton_tri.h @@ -33,7 +33,7 @@ class NPairHalfMultiNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_old_newtoff.h b/src/npair_half_multi_old_newtoff.h index 5bb7f98dff..b9032329c2 100644 --- a/src/npair_half_multi_old_newtoff.h +++ b/src/npair_half_multi_old_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_old_newton.h b/src/npair_half_multi_old_newton.h index 45425586f2..b8fa7b5372 100644 --- a/src/npair_half_multi_old_newton.h +++ b/src/npair_half_multi_old_newton.h @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_multi_old_newton_tri.h b/src/npair_half_multi_old_newton_tri.h index 9efdb5a843..28ba65f50a 100644 --- a/src/npair_half_multi_old_newton_tri.h +++ b/src/npair_half_multi_old_newton_tri.h @@ -33,7 +33,7 @@ class NPairHalfMultiOldNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_nsq_newtoff.h b/src/npair_half_nsq_newtoff.h index 4c5d3e4151..209a2d239c 100644 --- a/src/npair_half_nsq_newtoff.h +++ b/src/npair_half_nsq_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfNsqNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_nsq_newtoff_ghost.h b/src/npair_half_nsq_newtoff_ghost.h index 9d49bd6a5a..2e765c57b2 100644 --- a/src/npair_half_nsq_newtoff_ghost.h +++ b/src/npair_half_nsq_newtoff_ghost.h @@ -33,7 +33,7 @@ class NPairHalfNsqNewtoffGhost : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_nsq_newton.h b/src/npair_half_nsq_newton.h index bf832c4fda..726ad16d18 100644 --- a/src/npair_half_nsq_newton.h +++ b/src/npair_half_nsq_newton.h @@ -33,7 +33,7 @@ class NPairHalfNsqNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_bin_newtoff.h b/src/npair_half_respa_bin_newtoff.h index cbc4b454df..c10f4d914a 100644 --- a/src/npair_half_respa_bin_newtoff.h +++ b/src/npair_half_respa_bin_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_bin_newton.h b/src/npair_half_respa_bin_newton.h index e6b5915b93..2b48ee1fc7 100644 --- a/src/npair_half_respa_bin_newton.h +++ b/src/npair_half_respa_bin_newton.h @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_bin_newton_tri.h b/src/npair_half_respa_bin_newton_tri.h index 5c403e75ab..2462b7dd07 100644 --- a/src/npair_half_respa_bin_newton_tri.h +++ b/src/npair_half_respa_bin_newton_tri.h @@ -33,7 +33,7 @@ class NPairHalfRespaBinNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_nsq_newtoff.h b/src/npair_half_respa_nsq_newtoff.h index 3edced1280..4e67c271e8 100644 --- a/src/npair_half_respa_nsq_newtoff.h +++ b/src/npair_half_respa_nsq_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfRespaNsqNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_respa_nsq_newton.h b/src/npair_half_respa_nsq_newton.h index 1f554808fc..4cc9831d1b 100644 --- a/src/npair_half_respa_nsq_newton.h +++ b/src/npair_half_respa_nsq_newton.h @@ -33,7 +33,7 @@ class NPairHalfRespaNsqNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_bin_newtoff.h b/src/npair_half_size_bin_newtoff.h index 0ed9ab2e28..f508c20ed1 100644 --- a/src/npair_half_size_bin_newtoff.h +++ b/src/npair_half_size_bin_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_bin_newton.h b/src/npair_half_size_bin_newton.h index 010ee26bac..fd1342bedc 100644 --- a/src/npair_half_size_bin_newton.h +++ b/src/npair_half_size_bin_newton.h @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_bin_newton_tri.h b/src/npair_half_size_bin_newton_tri.h index 648f2be1b1..068cdec02a 100644 --- a/src/npair_half_size_bin_newton_tri.h +++ b/src/npair_half_size_bin_newton_tri.h @@ -33,7 +33,7 @@ class NPairHalfSizeBinNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_newtoff.h b/src/npair_half_size_multi_newtoff.h index ca3331c4d2..b2111c9c92 100644 --- a/src/npair_half_size_multi_newtoff.h +++ b/src/npair_half_size_multi_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_newton.h b/src/npair_half_size_multi_newton.h index 0cc7af9a11..b1228ce79d 100644 --- a/src/npair_half_size_multi_newton.h +++ b/src/npair_half_size_multi_newton.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_newton_tri.h b/src/npair_half_size_multi_newton_tri.h index 5831b5cc03..4930f57aa4 100644 --- a/src/npair_half_size_multi_newton_tri.h +++ b/src/npair_half_size_multi_newton_tri.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_old_newtoff.h b/src/npair_half_size_multi_old_newtoff.h index 68d9ba00b4..d50e9306da 100644 --- a/src/npair_half_size_multi_old_newtoff.h +++ b/src/npair_half_size_multi_old_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_old_newton.h b/src/npair_half_size_multi_old_newton.h index 2f4893b2e7..f947920513 100644 --- a/src/npair_half_size_multi_old_newton.h +++ b/src/npair_half_size_multi_old_newton.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_multi_old_newton_tri.h b/src/npair_half_size_multi_old_newton_tri.h index 84958eb531..0fcea4ff0e 100644 --- a/src/npair_half_size_multi_old_newton_tri.h +++ b/src/npair_half_size_multi_old_newton_tri.h @@ -33,7 +33,7 @@ class NPairHalfSizeMultiOldNewtonTri : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_nsq_newtoff.h b/src/npair_half_size_nsq_newtoff.h index 3f064e848f..49dc75b26a 100644 --- a/src/npair_half_size_nsq_newtoff.h +++ b/src/npair_half_size_nsq_newtoff.h @@ -33,7 +33,7 @@ class NPairHalfSizeNsqNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_half_size_nsq_newton.h b/src/npair_half_size_nsq_newton.h index cfa9d8bae3..133a8ff0ae 100644 --- a/src/npair_half_size_nsq_newton.h +++ b/src/npair_half_size_nsq_newton.h @@ -33,7 +33,7 @@ class NPairHalfSizeNsqNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_halffull_newtoff.h b/src/npair_halffull_newtoff.h index 88e05ccdf5..56bd692b02 100644 --- a/src/npair_halffull_newtoff.h +++ b/src/npair_halffull_newtoff.h @@ -49,7 +49,7 @@ class NPairHalffullNewtoff : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_halffull_newton.h b/src/npair_halffull_newton.h index 8cf32ea6e8..916cebf74e 100644 --- a/src/npair_halffull_newton.h +++ b/src/npair_halffull_newton.h @@ -39,7 +39,7 @@ class NPairHalffullNewton : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip.h b/src/npair_skip.h index 043d0c7ac1..9d9aca52ba 100644 --- a/src/npair_skip.h +++ b/src/npair_skip.h @@ -41,7 +41,7 @@ class NPairSkip : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_respa.h b/src/npair_skip_respa.h index 9917194256..b3bc1bf0f0 100644 --- a/src/npair_skip_respa.h +++ b/src/npair_skip_respa.h @@ -35,7 +35,7 @@ class NPairSkipRespa : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_size.h b/src/npair_skip_size.h index f8af7ded9c..f9fcf68f1b 100644 --- a/src/npair_skip_size.h +++ b/src/npair_skip_size.h @@ -34,7 +34,7 @@ class NPairSkipSize : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_size_off2on.h b/src/npair_skip_size_off2on.h index cd5abec115..8ce8463de3 100644 --- a/src/npair_skip_size_off2on.h +++ b/src/npair_skip_size_off2on.h @@ -35,7 +35,7 @@ class NPairSkipSizeOff2on : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/npair_skip_size_off2on_oneside.h b/src/npair_skip_size_off2on_oneside.h index f79e1e31c6..f2060a0d35 100644 --- a/src/npair_skip_size_off2on_oneside.h +++ b/src/npair_skip_size_off2on_oneside.h @@ -35,7 +35,7 @@ class NPairSkipSizeOff2onOneside : public NPair { void build(class NeighList *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil.h b/src/nstencil.h index 821f9a7e55..137e2bd86b 100644 --- a/src/nstencil.h +++ b/src/nstencil.h @@ -20,32 +20,32 @@ namespace LAMMPS_NS { class NStencil : protected Pointers { public: - int istyle; // 1-N index into binnames - class NBin *nb; // ptr to NBin instance I depend on - bigint last_stencil; // last timestep stencil was created + int istyle; // 1-N index into binnames + class NBin *nb; // ptr to NBin instance I depend on + bigint last_stencil; // last timestep stencil was created - int nstencil; // # of bins in stencil - int *stencil; // list of bin offsets - int **stencilxyz; // bin offsets in xyz dims - int *nstencil_multi_old; // # bins in each type-based old multi stencil - int **stencil_multi_old; // list of bin offsets in each stencil - double **distsq_multi_old; // sq distances to bins in each stencil - int ** nstencil_multi; // # bins bins in each igroup-jgroup multi stencil - int *** stencil_multi; // list of bin offsets in each multi stencil - int ** maxstencil_multi; // max stencil size for each multi stencil - int maxcollections; // size of multi arrays + int nstencil; // # of bins in stencil + int *stencil; // list of bin offsets + int **stencilxyz; // bin offsets in xyz dims + int *nstencil_multi_old; // # bins in each type-based old multi stencil + int **stencil_multi_old; // list of bin offsets in each stencil + double **distsq_multi_old; // sq distances to bins in each stencil + int **nstencil_multi; // # bins bins in each igroup-jgroup multi stencil + int ***stencil_multi; // list of bin offsets in each multi stencil + int **maxstencil_multi; // max stencil size for each multi stencil + int maxcollections; // size of multi arrays - int sx,sy,sz; // extent of stencil in each dim - int **stencil_sx_multi; // analogs for each multi stencil + int sx, sy, sz; // extent of stencil in each dim + int **stencil_sx_multi; // analogs for each multi stencil int **stencil_sy_multi; int **stencil_sz_multi; - double cutoff_custom; // cutoff set by requestor + double cutoff_custom; // cutoff set by requestor // Arrays to store options for multi itype-jtype stencils - bool **flag_half_multi; // flag creation of a half stencil for icollection-jcollection - bool **flag_skip_multi; // skip creation of icollection-jcollection stencils (for newton on) - int **bin_collection_multi; // what collection to use for bin information + bool **flag_half_multi; // flag creation of a half stencil for icollection-jcollection + bool **flag_skip_multi; // skip creation of icollection-jcollection stencils (for newton on) + int **bin_collection_multi; // what collection to use for bin information NStencil(class LAMMPS *); virtual ~NStencil(); @@ -56,10 +56,9 @@ class NStencil : protected Pointers { virtual void create() = 0; - inline int get_maxstencil() {return maxstencil;} + inline int get_maxstencil() { return maxstencil; } protected: - // data from Neighbor class int neighstyle; @@ -73,9 +72,9 @@ class NStencil : protected Pointers { // data from NBin class - int mbinx,mbiny,mbinz; - double binsizex,binsizey,binsizez; - double bininvx,bininvy,bininvz; + int mbinx, mbiny, mbinz; + double binsizex, binsizey, binsizez; + double bininvx, bininvy, bininvz; // data from NBin class for multi @@ -100,25 +99,26 @@ class NStencil : protected Pointers { // data common to all NStencil variants - int xyzflag; // 1 if stencilxyz is allocated - int maxstencil; // max size of stencil - int maxstencil_multi_old; // max sizes of stencils + int xyzflag; // 1 if stencilxyz is allocated + int maxstencil; // max size of stencil + int maxstencil_multi_old; // max sizes of stencils int dimension; // methods for standard NStencil variants - void copy_bin_info(); // copy info from NBin class - double bin_distance(int, int, int); // distance between bin corners + void copy_bin_info(); // copy info from NBin class + double bin_distance(int, int, int); // distance between bin corners // methods for multi NStencil - double bin_distance_multi(int, int, int, int); // distance between bin corners for different collections - void copy_bin_info_multi(); // copy multi info from NBin class - virtual void set_stencil_properties(){} // determine which stencils to build and how + double bin_distance_multi(int, int, int, + int); // distance between bin corners for different collections + void copy_bin_info_multi(); // copy multi info from NBin class + virtual void set_stencil_properties() {} // determine which stencils to build and how }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/nstencil_full_bin_2d.h b/src/nstencil_full_bin_2d.h index 82f11b79db..528e4be820 100644 --- a/src/nstencil_full_bin_2d.h +++ b/src/nstencil_full_bin_2d.h @@ -33,7 +33,7 @@ class NStencilFullBin2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_bin_3d.h b/src/nstencil_full_bin_3d.h index 7622bba126..6b6288b4b5 100644 --- a/src/nstencil_full_bin_3d.h +++ b/src/nstencil_full_bin_3d.h @@ -33,7 +33,7 @@ class NStencilFullBin3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_ghost_bin_2d.h b/src/nstencil_full_ghost_bin_2d.h index b9ab2b5837..658503fbfa 100644 --- a/src/nstencil_full_ghost_bin_2d.h +++ b/src/nstencil_full_ghost_bin_2d.h @@ -33,7 +33,7 @@ class NStencilFullGhostBin2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_ghost_bin_3d.h b/src/nstencil_full_ghost_bin_3d.h index e64a7464c9..1c1147fc1c 100644 --- a/src/nstencil_full_ghost_bin_3d.h +++ b/src/nstencil_full_ghost_bin_3d.h @@ -33,7 +33,7 @@ class NStencilFullGhostBin3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_2d.h b/src/nstencil_full_multi_2d.h index 6fea1af6c3..b9c8e90497 100644 --- a/src/nstencil_full_multi_2d.h +++ b/src/nstencil_full_multi_2d.h @@ -33,10 +33,9 @@ class NStencilFullMulti2d : public NStencil { protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_3d.h b/src/nstencil_full_multi_3d.h index 8b9b7dba8e..57412c11cf 100644 --- a/src/nstencil_full_multi_3d.h +++ b/src/nstencil_full_multi_3d.h @@ -28,15 +28,14 @@ namespace LAMMPS_NS { class NStencilFullMulti3d : public NStencil { public: NStencilFullMulti3d(class LAMMPS *); - ~NStencilFullMulti3d(){} + ~NStencilFullMulti3d() {} void create(); protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_old_2d.h b/src/nstencil_full_multi_old_2d.h index 47e2b80c69..16eee3ce28 100644 --- a/src/nstencil_full_multi_old_2d.h +++ b/src/nstencil_full_multi_old_2d.h @@ -33,7 +33,7 @@ class NStencilFullMultiOld2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_full_multi_old_3d.h b/src/nstencil_full_multi_old_3d.h index 630580dc4b..f62c9d1cf9 100644 --- a/src/nstencil_full_multi_old_3d.h +++ b/src/nstencil_full_multi_old_3d.h @@ -33,7 +33,7 @@ class NStencilFullMultiOld3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_2d.h b/src/nstencil_half_bin_2d.h index 1de488b5cc..d5cc757833 100644 --- a/src/nstencil_half_bin_2d.h +++ b/src/nstencil_half_bin_2d.h @@ -33,7 +33,7 @@ class NStencilHalfBin2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_2d_tri.h b/src/nstencil_half_bin_2d_tri.h index 53fa9afbd6..4b7fca1006 100644 --- a/src/nstencil_half_bin_2d_tri.h +++ b/src/nstencil_half_bin_2d_tri.h @@ -33,7 +33,7 @@ class NStencilHalfBin2dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_3d.h b/src/nstencil_half_bin_3d.h index e880c06929..306ef61aa9 100644 --- a/src/nstencil_half_bin_3d.h +++ b/src/nstencil_half_bin_3d.h @@ -33,7 +33,7 @@ class NStencilHalfBin3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_bin_3d_tri.h b/src/nstencil_half_bin_3d_tri.h index 1e1c28afdf..2de1099935 100644 --- a/src/nstencil_half_bin_3d_tri.h +++ b/src/nstencil_half_bin_3d_tri.h @@ -33,7 +33,7 @@ class NStencilHalfBin3dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_2d.h b/src/nstencil_half_multi_2d.h index 456083c223..022b3c7476 100644 --- a/src/nstencil_half_multi_2d.h +++ b/src/nstencil_half_multi_2d.h @@ -33,10 +33,9 @@ class NStencilHalfMulti2d : public NStencil { protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_2d_tri.h b/src/nstencil_half_multi_2d_tri.h index e12b96fc6f..bb4aeca86c 100644 --- a/src/nstencil_half_multi_2d_tri.h +++ b/src/nstencil_half_multi_2d_tri.h @@ -35,7 +35,7 @@ class NStencilHalfMulti2dTri : public NStencil { void set_stencil_properties(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_3d.h b/src/nstencil_half_multi_3d.h index 7ab25482a6..fadf3b0cf8 100644 --- a/src/nstencil_half_multi_3d.h +++ b/src/nstencil_half_multi_3d.h @@ -33,10 +33,9 @@ class NStencilHalfMulti3d : public NStencil { protected: void set_stencil_properties(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_3d_tri.h b/src/nstencil_half_multi_3d_tri.h index 5b673ee3db..4ab137fb71 100644 --- a/src/nstencil_half_multi_3d_tri.h +++ b/src/nstencil_half_multi_3d_tri.h @@ -35,7 +35,7 @@ class NStencilHalfMulti3dTri : public NStencil { void set_stencil_properties(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_2d.h b/src/nstencil_half_multi_old_2d.h index b75590bf52..0d6ee9361e 100644 --- a/src/nstencil_half_multi_old_2d.h +++ b/src/nstencil_half_multi_old_2d.h @@ -32,7 +32,7 @@ class NStencilHalfMultiOld2d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_2d_tri.h b/src/nstencil_half_multi_old_2d_tri.h index 253aec6d49..9adda3d3f6 100644 --- a/src/nstencil_half_multi_old_2d_tri.h +++ b/src/nstencil_half_multi_old_2d_tri.h @@ -32,7 +32,7 @@ class NStencilHalfMultiOld2dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_3d.h b/src/nstencil_half_multi_old_3d.h index da5288f910..6b6a6e2d00 100644 --- a/src/nstencil_half_multi_old_3d.h +++ b/src/nstencil_half_multi_old_3d.h @@ -32,7 +32,7 @@ class NStencilHalfMultiOld3d : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/nstencil_half_multi_old_3d_tri.h b/src/nstencil_half_multi_old_3d_tri.h index 7bd289a4de..bfe9ac8f09 100644 --- a/src/nstencil_half_multi_old_3d_tri.h +++ b/src/nstencil_half_multi_old_3d_tri.h @@ -32,7 +32,7 @@ class NStencilHalfMultiOld3dTri : public NStencil { void create(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo.h b/src/ntopo.h index 8a1899d810..3de8cfe73a 100644 --- a/src/ntopo.h +++ b/src/ntopo.h @@ -20,8 +20,8 @@ namespace LAMMPS_NS { class NTopo : protected Pointers { public: - int nbondlist,nanglelist,ndihedrallist,nimproperlist; - int **bondlist,**anglelist,**dihedrallist,**improperlist; + int nbondlist, nanglelist, ndihedrallist, nimproperlist; + int **bondlist, **anglelist, **dihedrallist, **improperlist; NTopo(class LAMMPS *); virtual ~NTopo(); @@ -31,9 +31,9 @@ class NTopo : protected Pointers { double memory_usage(); protected: - int me,nprocs; - int maxbond,maxangle,maxdihedral,maximproper; - int cluster_check; // copy from Neighbor + int me, nprocs; + int maxbond, maxangle, maxdihedral, maximproper; + int cluster_check; // copy from Neighbor void allocate_bond(); void allocate_angle(); @@ -45,7 +45,7 @@ class NTopo : protected Pointers { void dihedral_check(int, int **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/ntopo_angle_all.h b/src/ntopo_angle_all.h index b7aa87ae1a..4f1e120f6c 100644 --- a/src/ntopo_angle_all.h +++ b/src/ntopo_angle_all.h @@ -31,7 +31,7 @@ class NTopoAngleAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_angle_partial.h b/src/ntopo_angle_partial.h index bbd9adfd30..ae9008bb72 100644 --- a/src/ntopo_angle_partial.h +++ b/src/ntopo_angle_partial.h @@ -31,7 +31,7 @@ class NTopoAnglePartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_angle_template.h b/src/ntopo_angle_template.h index 951a28546f..0ba576be92 100644 --- a/src/ntopo_angle_template.h +++ b/src/ntopo_angle_template.h @@ -31,7 +31,7 @@ class NTopoAngleTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_bond_all.h b/src/ntopo_bond_all.h index ffe48f6c5b..9cec5bfab3 100644 --- a/src/ntopo_bond_all.h +++ b/src/ntopo_bond_all.h @@ -31,7 +31,7 @@ class NTopoBondAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_bond_partial.h b/src/ntopo_bond_partial.h index 924d6c05a3..50eb84cae5 100644 --- a/src/ntopo_bond_partial.h +++ b/src/ntopo_bond_partial.h @@ -31,7 +31,7 @@ class NTopoBondPartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_bond_template.h b/src/ntopo_bond_template.h index f04bda7d88..a7b275fe5d 100644 --- a/src/ntopo_bond_template.h +++ b/src/ntopo_bond_template.h @@ -31,7 +31,7 @@ class NTopoBondTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_dihedral_all.h b/src/ntopo_dihedral_all.h index d152e46937..a41fccb4cd 100644 --- a/src/ntopo_dihedral_all.h +++ b/src/ntopo_dihedral_all.h @@ -31,7 +31,7 @@ class NTopoDihedralAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_dihedral_partial.h b/src/ntopo_dihedral_partial.h index 2cebe7c93f..e25aa76088 100644 --- a/src/ntopo_dihedral_partial.h +++ b/src/ntopo_dihedral_partial.h @@ -31,7 +31,7 @@ class NTopoDihedralPartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_dihedral_template.h b/src/ntopo_dihedral_template.h index e671005f8b..57e1414b54 100644 --- a/src/ntopo_dihedral_template.h +++ b/src/ntopo_dihedral_template.h @@ -31,7 +31,7 @@ class NTopoDihedralTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_improper_all.h b/src/ntopo_improper_all.h index 46a91ac73f..c339f25bf8 100644 --- a/src/ntopo_improper_all.h +++ b/src/ntopo_improper_all.h @@ -31,7 +31,7 @@ class NTopoImproperAll : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_improper_partial.h b/src/ntopo_improper_partial.h index fc59a573b0..b644269027 100644 --- a/src/ntopo_improper_partial.h +++ b/src/ntopo_improper_partial.h @@ -31,7 +31,7 @@ class NTopoImproperPartial : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/ntopo_improper_template.h b/src/ntopo_improper_template.h index 5e7c7b0d37..bd7ca4fa11 100644 --- a/src/ntopo_improper_template.h +++ b/src/ntopo_improper_template.h @@ -31,7 +31,7 @@ class NTopoImproperTemplate : public NTopo { void build(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/omp_compat.h b/src/omp_compat.h index 5cb40a7c71..a4fb3f93ba 100644 --- a/src/omp_compat.h +++ b/src/omp_compat.h @@ -1,3 +1,4 @@ +// clang-format off /* -*- c++ -*- ---------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://lammps.sandia.gov/, Sandia National Laboratories diff --git a/src/output.h b/src/output.h index 2f00ff72f0..03e0abe215 100644 --- a/src/output.h +++ b/src/output.h @@ -24,73 +24,72 @@ class Dump; class Output : protected Pointers { public: - bigint next; // next timestep for any kind of output + bigint next; // next timestep for any kind of output - bigint next_thermo; // next timestep for thermo output - int thermo_every; // output freq for thermo, 0 if first/last only - bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, null pointer if every - int ivar_thermo; // variable index for thermo frequency - class Thermo *thermo; // Thermodynamic computations + bigint next_thermo; // next timestep for thermo output + int thermo_every; // output freq for thermo, 0 if first/last only + bigint last_thermo; // last timestep thermo was output + char *var_thermo; // variable name for thermo freq, null pointer if every + int ivar_thermo; // variable index for thermo frequency + class Thermo *thermo; // Thermodynamic computations - int ndump; // # of Dumps defined - int max_dump; // max size of Dump list - bigint next_dump_any; // next timestep for any Dump - int *every_dump; // write freq for each Dump, 0 if var - bigint *next_dump; // next timestep to do each Dump - bigint *last_dump; // last timestep each snapshot was output - char **var_dump; // variable name for dump frequency - int *ivar_dump; // variable index for dump frequency - Dump **dump; // list of defined Dumps + int ndump; // # of Dumps defined + int max_dump; // max size of Dump list + bigint next_dump_any; // next timestep for any Dump + int *every_dump; // write freq for each Dump, 0 if var + bigint *next_dump; // next timestep to do each Dump + bigint *last_dump; // last timestep each snapshot was output + char **var_dump; // variable name for dump frequency + int *ivar_dump; // variable index for dump frequency + Dump **dump; // list of defined Dumps - int restart_flag; // 1 if any restart files are written - int restart_flag_single; // 1 if single restart files are written - int restart_flag_double; // 1 if double restart files are written - bigint next_restart; // next timestep to write any restart file - bigint next_restart_single; // next timestep to write a single restart file - bigint next_restart_double; // next timestep to write a double restart file - int restart_every_single; // single restart file write freq, 0 if var - int restart_every_double; // double restart file write freq, 0 if var - bigint last_restart; // last timestep any restart file was output - int restart_toggle; // 0 if use restart2a as prefix, 1 if restart2b - char *var_restart_single; // variable name for single restart freq - char *var_restart_double; // variable name for double restart freq - int ivar_restart_single; // index of var_restart_single - int ivar_restart_double; // index of var_restart_double - char *restart1; // name single restart file - char *restart2a,*restart2b; // names of double restart files - class WriteRestart *restart; // class for writing restart files + int restart_flag; // 1 if any restart files are written + int restart_flag_single; // 1 if single restart files are written + int restart_flag_double; // 1 if double restart files are written + bigint next_restart; // next timestep to write any restart file + bigint next_restart_single; // next timestep to write a single restart file + bigint next_restart_double; // next timestep to write a double restart file + int restart_every_single; // single restart file write freq, 0 if var + int restart_every_double; // double restart file write freq, 0 if var + bigint last_restart; // last timestep any restart file was output + int restart_toggle; // 0 if use restart2a as prefix, 1 if restart2b + char *var_restart_single; // variable name for single restart freq + char *var_restart_double; // variable name for double restart freq + int ivar_restart_single; // index of var_restart_single + int ivar_restart_double; // index of var_restart_double + char *restart1; // name single restart file + char *restart2a, *restart2b; // names of double restart files + class WriteRestart *restart; // class for writing restart files - - typedef Dump *(*DumpCreator)(LAMMPS *,int,char**); - typedef std::map DumpCreatorMap; + typedef Dump *(*DumpCreator)(LAMMPS *, int, char **); + typedef std::map DumpCreatorMap; DumpCreatorMap *dump_map; Output(class LAMMPS *); ~Output(); void init(); - void setup(int memflag = 1); // initial output before run/min - void write(bigint); // output for current timestep - void write_dump(bigint); // force output of dump snapshots - void write_restart(bigint); // force output of a restart file - void reset_timestep(bigint); // reset next timestep for all output + void setup(int memflag = 1); // initial output before run/min + void write(bigint); // output for current timestep + void write_dump(bigint); // force output of dump snapshots + void write_restart(bigint); // force output of a restart file + void reset_timestep(bigint); // reset next timestep for all output void add_dump(int, char **); // add a Dump to Dump list void modify_dump(int, char **); // modify a Dump void delete_dump(char *); // delete a Dump from Dump list int find_dump(const char *); // find a Dump ID - void set_thermo(int, char **); // set thermo output freqquency - void create_thermo(int, char **); // create a thermo style - void create_restart(int, char **); // create Restart and restart files + void set_thermo(int, char **); // set thermo output freqquency + void create_thermo(int, char **); // create a thermo style + void create_restart(int, char **); // create Restart and restart files - void memory_usage(); // print out memory usage + void memory_usage(); // print out memory usage private: template static Dump *dump_creator(LAMMPS *, int, char **); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/pack.h b/src/pack.h index d17a8dfa7c..c540a0a6e0 100644 --- a/src/pack.h +++ b/src/pack.h @@ -14,12 +14,12 @@ // loop counters for doing a pack/unpack struct pack_plan_3d { - int nfast; // # of elements in fast index - int nmid; // # of elements in mid index - int nslow; // # of elements in slow index - int nstride_line; // stride between successive mid indices - int nstride_plane; // stride between successive slow indices - int nqty; // # of values/element + int nfast; // # of elements in fast index + int nmid; // # of elements in mid index + int nslow; // # of elements in slow index + int nstride_line; // stride between successive mid indices + int nstride_plane; // stride between successive slow indices + int nqty; // # of values/element }; #if !defined(FFT_PACK_POINTER) && !defined(FFT_PACK_MEMCPY) @@ -54,8 +54,8 @@ struct pack_plan_3d { static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -65,11 +65,10 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) in = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - out = plane + mid*nstride_line; - for (fast = 0; fast < nfast; fast++) - buf[in++] = data[out++]; + out = plane + mid * nstride_line; + for (fast = 0; fast < nfast; fast++) buf[in++] = data[out++]; } } } @@ -80,8 +79,8 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -91,11 +90,10 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - in = plane + mid*nstride_line; - for (fast = 0; fast < nfast; fast++) - data[in++] = buf[out++]; + in = plane + mid * nstride_line; + for (fast = 0; fast < nfast; fast++) data[in++] = buf[out++]; } } } @@ -106,8 +104,8 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -117,11 +115,10 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { in = plane + mid; - for (fast = 0; fast < nfast; fast++, in += nstride_plane) - data[in] = buf[out++]; + for (fast = 0; fast < nfast; fast++, in += nstride_plane) data[in] = buf[out++]; } } } @@ -132,8 +129,8 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -143,12 +140,12 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - in = plane + 2*mid; + in = plane + 2 * mid; for (fast = 0; fast < nfast; fast++, in += nstride_plane) { data[in] = buf[out++]; - data[in+1] = buf[out++]; + data[in + 1] = buf[out++]; } } } @@ -161,8 +158,8 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,iqty,instart,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,nqty; + int in, out, iqty, instart, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -173,9 +170,9 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - instart = plane + nqty*mid; + instart = plane + nqty * mid; for (fast = 0; fast < nfast; fast++, instart += nstride_plane) { in = instart; for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++]; @@ -191,8 +188,8 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -203,9 +200,8 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - in = slow + mid*nstride_plane; - for (fast = 0; fast < nfast; fast++, in += nstride_line) - data[in] = buf[out++]; + in = slow + mid * nstride_plane; + for (fast = 0; fast < nfast; fast++, in += nstride_line) data[in] = buf[out++]; } } } @@ -217,8 +213,8 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + int in, out, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -229,10 +225,10 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - in = 2*slow + mid*nstride_plane; + in = 2 * slow + mid * nstride_plane; for (fast = 0; fast < nfast; fast++, in += nstride_line) { data[in] = buf[out++]; - data[in+1] = buf[out++]; + data[in + 1] = buf[out++]; } } } @@ -245,8 +241,8 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - int in,out,iqty,instart,fast,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,nqty; + int in, out, iqty, instart, fast, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -258,7 +254,7 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = 0; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - instart = nqty*slow + mid*nstride_plane; + instart = nqty * slow + mid * nstride_plane; for (fast = 0; fast < nfast; fast++, instart += nstride_line) { in = instart; for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++]; @@ -282,9 +278,9 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -294,12 +290,11 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) in = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid*nstride_line]); + begin = &(data[plane + mid * nstride_line]); end = begin + nfast; - for (out = begin; out < end; out++) - *(in++) = *out; + for (out = begin; out < end; out++) *(in++) = *out; } } } @@ -311,9 +306,9 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -323,12 +318,11 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; + plane = slow * nstride_plane; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid*nstride_line]); + begin = &(data[plane + mid * nstride_line]); end = begin + nfast; - for (in = begin; in < end; in++) - *in = *(out++); + for (in = begin; in < end; in++) *in = *(out++); } } } @@ -340,9 +334,9 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -352,12 +346,11 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid]); - end = begin + nfast*nstride_plane; - for (in = begin; in < end; in += nstride_plane) - *in = *(out++); + begin = &(data[plane + mid]); + end = begin + nfast * nstride_plane; + for (in = begin; in < end; in += nstride_plane) *in = *(out++); } } } @@ -369,9 +362,9 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -381,13 +374,13 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+2*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + 2 * mid]); + end = begin + nfast * nstride_plane; for (in = begin; in < end; in += nstride_plane) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -400,9 +393,9 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -413,10 +406,10 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+nqty*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + nqty * mid]); + end = begin + nfast * nstride_plane; for (instart = begin; instart < end; instart += nstride_plane) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); @@ -432,9 +425,9 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -445,10 +438,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; - for (in = begin; in < end; in += nstride_line) - *in = *(out++); + begin = &(data[slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; + for (in = begin; in < end; in += nstride_line) *in = *(out++); } } } @@ -460,9 +452,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -473,11 +465,11 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[2*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[2 * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (in = begin; in < end; in += nstride_line) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -490,9 +482,9 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -504,8 +496,8 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[nqty*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[nqty * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (instart = begin; instart < end; instart += nstride_line) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); @@ -531,9 +523,9 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) { - PACK_DATA *in,*out; - int mid,slow,size; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,upto; + PACK_DATA *in, *out; + int mid, slow, size; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, upto; nfast = plan->nfast; nmid = plan->nmid; @@ -541,14 +533,14 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) nstride_line = plan->nstride_line; nstride_plane = plan->nstride_plane; - size = nfast*sizeof(PACK_DATA); + size = nfast * sizeof(PACK_DATA); for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; - upto = slow*nmid*nfast; + plane = slow * nstride_plane; + upto = slow * nmid * nfast; for (mid = 0; mid < nmid; mid++) { - in = &(buf[upto+mid*nfast]); - out = &(data[plane+mid*nstride_line]); - memcpy(in,out,size); + in = &(buf[upto + mid * nfast]); + out = &(data[plane + mid * nstride_line]); + memcpy(in, out, size); } } } @@ -560,9 +552,9 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan) static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out; - int mid,slow,size; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,upto; + PACK_DATA *in, *out; + int mid, slow, size; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, upto; nfast = plan->nfast; nmid = plan->nmid; @@ -570,14 +562,14 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan nstride_line = plan->nstride_line; nstride_plane = plan->nstride_plane; - size = nfast*sizeof(PACK_DATA); + size = nfast * sizeof(PACK_DATA); for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_plane; - upto = slow*nmid*nfast; + plane = slow * nstride_plane; + upto = slow * nmid * nfast; for (mid = 0; mid < nmid; mid++) { - in = &(data[plane+mid*nstride_line]); - out = &(buf[upto+mid*nfast]); - memcpy(in,out,size); + in = &(data[plane + mid * nstride_line]); + out = &(buf[upto + mid * nfast]); + memcpy(in, out, size); } } } @@ -589,9 +581,9 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -601,12 +593,11 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+mid]); - end = begin + nfast*nstride_plane; - for (in = begin; in < end; in += nstride_plane) - *in = *(out++); + begin = &(data[plane + mid]); + end = begin + nfast * nstride_plane; + for (in = begin; in < end; in += nstride_plane) *in = *(out++); } } } @@ -618,9 +609,9 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane; nfast = plan->nfast; nmid = plan->nmid; @@ -630,13 +621,13 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+2*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + 2 * mid]); + end = begin + nfast * nstride_plane; for (in = begin; in < end; in += nstride_plane) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -649,9 +640,9 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -662,10 +653,10 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { - plane = slow*nstride_line; + plane = slow * nstride_line; for (mid = 0; mid < nmid; mid++) { - begin = &(data[plane+nqty*mid]); - end = begin + nfast*nstride_plane; + begin = &(data[plane + nqty * mid]); + end = begin + nfast * nstride_plane; for (instart = begin; instart < end; instart += nstride_plane) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); @@ -681,9 +672,9 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -694,10 +685,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; - for (in = begin; in < end; in += nstride_line) - *in = *(out++); + begin = &(data[slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; + for (in = begin; in < end; in += nstride_line) *in = *(out++); } } } @@ -709,9 +699,9 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*begin,*end; - int mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane; + PACK_DATA *in, *out, *begin, *end; + int mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane; nfast = plan->nfast; nmid = plan->nmid; @@ -722,11 +712,11 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[2*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[2 * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (in = begin; in < end; in += nstride_line) { *in = *(out++); - *(in+1) = *(out++); + *(in + 1) = *(out++); } } } @@ -739,9 +729,9 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan) { - PACK_DATA *in,*out,*instart,*begin,*end; - int iqty,mid,slow; - int nfast,nmid,nslow,nstride_line,nstride_plane,nqty; + PACK_DATA *in, *out, *instart, *begin, *end; + int iqty, mid, slow; + int nfast, nmid, nslow, nstride_line, nstride_plane, nqty; nfast = plan->nfast; nmid = plan->nmid; @@ -753,8 +743,8 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl out = buf; for (slow = 0; slow < nslow; slow++) { for (mid = 0; mid < nmid; mid++) { - begin = &(data[nqty*slow+mid*nstride_plane]); - end = begin + nfast*nstride_line; + begin = &(data[nqty * slow + mid * nstride_plane]); + end = begin + nfast * nstride_line; for (instart = begin; instart < end; instart += nstride_line) { in = instart; for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++); diff --git a/src/pair.h b/src/pair.h index ac0e5e7390..bce353d690 100644 --- a/src/pair.h +++ b/src/pair.h @@ -14,7 +14,7 @@ #ifndef LMP_PAIR_H #define LMP_PAIR_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -32,91 +32,91 @@ class Pair : protected Pointers { friend class Info; public: - static int instance_total; // # of Pair classes ever instantiated + static int instance_total; // # of Pair classes ever instantiated - double eng_vdwl,eng_coul; // accumulated energies - double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz - double *eatom,**vatom; // accumulated per-atom energy/virial - double **cvatom; // accumulated per-atom centroid virial + double eng_vdwl, eng_coul; // accumulated energies + double virial[6]; // accumulated virial: xx,yy,zz,xy,xz,yz + double *eatom, **vatom; // accumulated per-atom energy/virial + double **cvatom; // accumulated per-atom centroid virial - double cutforce; // max cutoff for all atom pairs - double **cutsq; // cutoff sq for each atom pair - int **setflag; // 0/1 = whether each i,j has been set + double cutforce; // max cutoff for all atom pairs + double **cutsq; // cutoff sq for each atom pair + int **setflag; // 0/1 = whether each i,j has been set - int comm_forward; // size of forward communication (0 if none) - int comm_reverse; // size of reverse communication (0 if none) - int comm_reverse_off; // size of reverse comm even if newton off + int comm_forward; // size of forward communication (0 if none) + int comm_reverse; // size of reverse communication (0 if none) + int comm_reverse_off; // size of reverse comm even if newton off - int single_enable; // 1 if single() routine exists - int single_hessian_enable; // 1 if single_hessian() routine exists - int restartinfo; // 1 if pair style writes restart info - int respa_enable; // 1 if inner/middle/outer rRESPA routines - int one_coeff; // 1 if allows only one coeff * * call - int manybody_flag; // 1 if a manybody potential - int unit_convert_flag; // value != 0 indicates support for unit conversion. - int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute() - int writedata; // 1 if writes coeffs to data file - int finitecutflag; // 1 if cut depends on finite atom size - int ghostneigh; // 1 if pair style needs neighbors of ghosts - double **cutghost; // cutoff for each ghost pair + int single_enable; // 1 if single() routine exists + int single_hessian_enable; // 1 if single_hessian() routine exists + int restartinfo; // 1 if pair style writes restart info + int respa_enable; // 1 if inner/middle/outer rRESPA routines + int one_coeff; // 1 if allows only one coeff * * call + int manybody_flag; // 1 if a manybody potential + int unit_convert_flag; // value != 0 indicates support for unit conversion. + int no_virial_fdotr_compute; // 1 if does not invoke virial_fdotr_compute() + int writedata; // 1 if writes coeffs to data file + int finitecutflag; // 1 if cut depends on finite atom size + int ghostneigh; // 1 if pair style needs neighbors of ghosts + double **cutghost; // cutoff for each ghost pair - int ewaldflag; // 1 if compatible with Ewald solver - int pppmflag; // 1 if compatible with PPPM solver - int msmflag; // 1 if compatible with MSM solver - int dispersionflag; // 1 if compatible with LJ/dispersion solver - int tip4pflag; // 1 if compatible with TIP4P solver - int dipoleflag; // 1 if compatible with dipole solver - int spinflag; // 1 if compatible with spin solver - int reinitflag; // 1 if compatible with fix adapt and alike + int ewaldflag; // 1 if compatible with Ewald solver + int pppmflag; // 1 if compatible with PPPM solver + int msmflag; // 1 if compatible with MSM solver + int dispersionflag; // 1 if compatible with LJ/dispersion solver + int tip4pflag; // 1 if compatible with TIP4P solver + int dipoleflag; // 1 if compatible with dipole solver + int spinflag; // 1 if compatible with spin solver + int reinitflag; // 1 if compatible with fix adapt and alike - int centroidstressflag; // centroid stress compared to two-body stress - // CENTROID_SAME = same as two-body stress - // CENTROID_AVAIL = different and implemented - // CENTROID_NOTAVAIL = different, not yet implemented + int centroidstressflag; // centroid stress compared to two-body stress + // CENTROID_SAME = same as two-body stress + // CENTROID_AVAIL = different and implemented + // CENTROID_NOTAVAIL = different, not yet implemented - int tail_flag; // pair_modify flag for LJ tail correction - double etail,ptail; // energy/pressure tail corrections - double etail_ij,ptail_ij; + int tail_flag; // pair_modify flag for LJ tail correction + double etail, ptail; // energy/pressure tail corrections + double etail_ij, ptail_ij; - int evflag; // energy,virial settings - int eflag_either,eflag_global,eflag_atom; - int vflag_either,vflag_global,vflag_atom,cvflag_atom; + int evflag; // energy,virial settings + int eflag_either, eflag_global, eflag_atom; + int vflag_either, vflag_global, vflag_atom, cvflag_atom; - int ncoultablebits; // size of Coulomb table, accessed by KSpace - int ndisptablebits; // size of dispersion table + int ncoultablebits; // size of Coulomb table, accessed by KSpace + int ndisptablebits; // size of dispersion table double tabinnersq; double tabinnerdispsq; - double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable; - double *etable,*detable,*ptable,*dptable,*vtable,*dvtable; + double *rtable, *drtable, *ftable, *dftable, *ctable, *dctable; + double *etable, *detable, *ptable, *dptable, *vtable, *dvtable; double *rdisptable, *drdisptable, *fdisptable, *dfdisptable; double *edisptable, *dedisptable; - int ncoulshiftbits,ncoulmask; + int ncoulshiftbits, ncoulmask; int ndispshiftbits, ndispmask; - int nextra; // # of extra quantities pair style calculates - double *pvector; // vector of extra pair quantities + int nextra; // # of extra quantities pair style calculates + double *pvector; // vector of extra pair quantities - int single_extra; // number of extra single values calculated - double *svector; // vector of extra single quantities + int single_extra; // number of extra single values calculated + double *svector; // vector of extra single quantities - class NeighList *list; // standard neighbor list used by most pairs - class NeighList *listhalf; // half list used by some pairs - class NeighList *listfull; // full list used by some pairs + class NeighList *list; // standard neighbor list used by most pairs + class NeighList *listhalf; // half list used by some pairs + class NeighList *listfull; // full list used by some pairs - int allocated; // 0/1 = whether arrays are allocated - // public so external driver can check - int compute_flag; // 0 if skip compute() - int mixed_flag; // 1 if all itype != jtype coeffs are from mixing + int allocated; // 0/1 = whether arrays are allocated + // public so external driver can check + int compute_flag; // 0 if skip compute() + int mixed_flag; // 1 if all itype != jtype coeffs are from mixing - enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; // mixing options + enum { GEOMETRIC, ARITHMETIC, SIXTHPOWER }; // mixing options - int beyond_contact, nondefault_history_transfer; // for granular styles + int beyond_contact, nondefault_history_transfer; // for granular styles // KOKKOS host/device flag and data masks ExecutionSpace execution_space; - unsigned int datamask_read,datamask_modify; - int kokkosable; // 1 if Kokkos pair + unsigned int datamask_read, datamask_modify; + int kokkosable; // 1 if Kokkos pair Pair(class LAMMPS *); virtual ~Pair(); @@ -136,15 +136,12 @@ class Pair : protected Pointers { // need to be public, so can be called by pair_style reaxc void v_tally(int, double *, double *); - void ev_tally(int, int, int, int, double, double, double, - double, double, double); - void ev_tally3(int, int, int, double, double, - double *, double *, double *, double *); + void ev_tally(int, int, int, int, double, double, double, double, double, double); + void ev_tally3(int, int, int, double, double, double *, double *, double *, double *); void v_tally3(int, int, int, double *, double *, double *, double *); - void v_tally4(int, int, int, int, double *, double *, double *, - double *, double *, double *); - void ev_tally_xyz(int, int, int, int, double, double, - double, double, double, double, double, double); + void v_tally4(int, int, int, int, double *, double *, double *, double *, double *, double *); + void ev_tally_xyz(int, int, int, int, double, double, double, double, double, double, double, + double); // general child-class methods @@ -153,20 +150,19 @@ class Pair : protected Pointers { virtual void compute_middle() {} virtual void compute_outer(int, int) {} - virtual double single(int, int, int, int, - double, double, double, - double& fforce) { + virtual double single(int, int, int, int, double, double, double, double &fforce) + { fforce = 0.0; return 0.0; } void hessian_twobody(double fforce, double dfac, double delr[3], double phiTensor[6]); - virtual double single_hessian(int, int, int, int, - double, double[3], double, double, - double& fforce, double d2u[6]) { + virtual double single_hessian(int, int, int, int, double, double[3], double, double, + double &fforce, double d2u[6]) + { fforce = 0.0; - for (int i=0; i<6; i++) d2u[i] = 0; + for (int i = 0; i < 6; i++) d2u[i] = 0; return 0.0; } @@ -175,7 +171,7 @@ class Pair : protected Pointers { virtual void init_style(); virtual void init_list(int, class NeighList *); - virtual double init_one(int, int) {return 0.0;} + virtual double init_one(int, int) { return 0.0; } virtual void init_tables(double, double *); virtual void init_tables_disp(double); @@ -189,62 +185,66 @@ class Pair : protected Pointers { virtual void write_data(FILE *) {} virtual void write_data_all(FILE *) {} - virtual int pack_forward_comm(int, int *, double *, int, int *) {return 0;} + virtual int pack_forward_comm(int, int *, double *, int, int *) { return 0; } virtual void unpack_forward_comm(int, int, double *) {} - virtual int pack_reverse_comm(int, int, double *) {return 0;} + virtual int pack_reverse_comm(int, int, double *) { return 0; } virtual void unpack_reverse_comm(int, int *, double *) {} virtual double memory_usage(); - void set_copymode(int value) {copymode = value;} + void set_copymode(int value) { copymode = value; } // specific child-class methods for certain Pair styles - virtual void *extract(const char *, int &) {return nullptr;} + virtual void *extract(const char *, int &) { return nullptr; } virtual void swap_eam(double *, double **) {} virtual void reset_dt() {} virtual void min_xf_pointers(int, double **, double **) {} virtual void min_xf_get(int) {} virtual void min_x_set(int) {} - virtual void transfer_history(double *, double*) {} - virtual double atom2cut(int) {return 0.0;} - virtual double radii2cut(double,double) {return 0.0;} + virtual void transfer_history(double *, double *) {} + virtual double atom2cut(int) { return 0.0; } + virtual double radii2cut(double, double) { return 0.0; } // management of callbacks to be run from ev_tally() protected: int num_tally_compute; class Compute **list_tally_compute; + public: virtual void add_tally_callback(class Compute *); virtual void del_tally_callback(class Compute *); protected: - int instance_me; // which Pair class instantiation I am - int special_lj[4]; // copied from force->special_lj for Kokkos - int suffix_flag; // suffix compatibility flag + int instance_me; // which Pair class instantiation I am + int special_lj[4]; // copied from force->special_lj for Kokkos + int suffix_flag; // suffix compatibility flag - // pair_modify settings - int offset_flag,mix_flag; // flags for offset and mixing + // pair_modify settings + int offset_flag, mix_flag; // flags for offset and mixing double tabinner; // inner cutoff for Coulomb table double tabinner_disp; // inner cutoff for dispersion table protected: // for mapping of elements to atom types and parameters // mostly used for manybody potentials - int nelements; // # of unique elements - char **elements; // names of unique elements - int *elem1param; // mapping from elements to parameters - int **elem2param; // mapping from element pairs to parameters - int ***elem3param; // mapping from element triplets to parameters - int *map; // mapping from atom types to elements - int nparams; // # of stored parameter sets - int maxparam; // max # of parameter sets - void map_element2type(int, char**, bool update_setflag=true); + int nelements; // # of unique elements + char **elements; // names of unique elements + int *elem1param; // mapping from elements to parameters + int **elem2param; // mapping from element pairs to parameters + int ***elem3param; // mapping from element triplets to parameters + int *map; // mapping from atom types to elements + int nparams; // # of stored parameter sets + int maxparam; // max # of parameter sets + void map_element2type(int, char **, bool update_setflag = true); public: // custom data type for accessing Coulomb tables - typedef union {int i; float f;} union_int_float_t; + typedef union { + int i; + float f; + } union_int_float_t; // Accessor for the user-intel package to determine virial calc for hybrid @@ -252,34 +252,33 @@ class Pair : protected Pointers { protected: int vflag_fdotr; - int maxeatom,maxvatom,maxcvatom; + int maxeatom, maxvatom, maxcvatom; - int copymode; // if set, do not deallocate during destruction - // required when classes are used as functors by Kokkos + int copymode; // if set, do not deallocate during destruction + // required when classes are used as functors by Kokkos - void ev_init(int eflag, int vflag, int alloc = 1) { - if (eflag||vflag) ev_setup(eflag, vflag, alloc); - else ev_unset(); + void ev_init(int eflag, int vflag, int alloc = 1) + { + if (eflag || vflag) + ev_setup(eflag, vflag, alloc); + else + ev_unset(); } virtual void ev_setup(int, int, int alloc = 1); void ev_unset(); void ev_tally_full(int, double, double, double, double, double, double); - void ev_tally_xyz_full(int, double, double, - double, double, double, double, double, double); - void ev_tally4(int, int, int, int, double, - double *, double *, double *, double *, double *, double *); + void ev_tally_xyz_full(int, double, double, double, double, double, double, double, double); + void ev_tally4(int, int, int, int, double, double *, double *, double *, double *, double *, + double *); void ev_tally_tip4p(int, int *, double *, double, double); void v_tally2(int, int, double, double *); - void v_tally_tensor(int, int, int, int, - double, double, double, double, double, double); + void v_tally_tensor(int, int, int, int, double, double, double, double, double, double); void virial_fdotr_compute(); - inline int sbmask(int j) const { - return j >> SBBITS & 3; - } + inline int sbmask(int j) const { return j >> SBBITS & 3; } }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/pair_beck.h b/src/pair_beck.h index d86d48b7e9..15c59baa95 100644 --- a/src/pair_beck.h +++ b/src/pair_beck.h @@ -41,13 +41,13 @@ class PairBeck : public Pair { protected: double cut_global; double **cut; - double **AA,**BB; - double **aa,**alpha,**beta; + double **AA, **BB; + double **aa, **alpha, **beta; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_born.h b/src/pair_born.h index 074ea0cd1c..078b2a1cc1 100644 --- a/src/pair_born.h +++ b/src/pair_born.h @@ -45,13 +45,13 @@ class PairBorn : public Pair { protected: double cut_global; double **cut; - double **a,**rho,**sigma,**c, **d; - double **rhoinv,**born1,**born2,**born3,**offset; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_born_coul_dsf.h b/src/pair_born_coul_dsf.h index c5d60402f1..c4cd246c5d 100644 --- a/src/pair_born_coul_dsf.h +++ b/src/pair_born_coul_dsf.h @@ -42,17 +42,17 @@ class PairBornCoulDSF : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_lj_global,alpha; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**sigma,**c,**d; - double **rhoinv,**born1,**born2,**born3,**offset; - double f_shift,e_shift; + double cut_lj_global, alpha; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; + double f_shift, e_shift; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_born_coul_wolf.h b/src/pair_born_coul_wolf.h index 73bdbbc716..eec0743d34 100644 --- a/src/pair_born_coul_wolf.h +++ b/src/pair_born_coul_wolf.h @@ -42,16 +42,16 @@ class PairBornCoulWolf : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_lj_global,alf; - double **cut_lj,**cut_ljsq; - double cut_coul,cut_coulsq; - double **a,**rho,**sigma,**c,**d; - double **rhoinv,**born1,**born2,**born3,**offset; + double cut_lj_global, alf; + double **cut_lj, **cut_ljsq; + double cut_coul, cut_coulsq; + double **a, **rho, **sigma, **c, **d; + double **rhoinv, **born1, **born2, **born3, **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_buck.h b/src/pair_buck.h index d93dc89bda..e603d6f908 100644 --- a/src/pair_buck.h +++ b/src/pair_buck.h @@ -44,13 +44,13 @@ class PairBuck : public Pair { protected: double cut_global; double **cut; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_buck_coul_cut.h b/src/pair_buck_coul_cut.h index 3f57de3bcc..9bae32d740 100644 --- a/src/pair_buck_coul_cut.h +++ b/src/pair_buck_coul_cut.h @@ -43,16 +43,16 @@ class PairBuckCoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **a,**rho,**c; - double **rhoinv,**buck1,**buck2,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **a, **rho, **c; + double **rhoinv, **buck1, **buck2, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_cut.h b/src/pair_coul_cut.h index c91683c12b..c2dc927981 100644 --- a/src/pair_coul_cut.h +++ b/src/pair_coul_cut.h @@ -44,12 +44,12 @@ class PairCoulCut : public Pair { protected: double cut_global; - double **cut,**scale; + double **cut, **scale; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_cut_global.h b/src/pair_coul_cut_global.h index 2dfdcb6868..bca47d088d 100644 --- a/src/pair_coul_cut_global.h +++ b/src/pair_coul_cut_global.h @@ -31,7 +31,7 @@ class PairCoulCutGlobal : public PairCoulCut { void *extract(const char *, int &); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_debye.h b/src/pair_coul_debye.h index cb2758dd99..06dccf1b55 100644 --- a/src/pair_coul_debye.h +++ b/src/pair_coul_debye.h @@ -37,7 +37,7 @@ class PairCoulDebye : public PairCoulCut { double kappa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_dsf.h b/src/pair_coul_dsf.h index 91937c37ed..6406904106 100644 --- a/src/pair_coul_dsf.h +++ b/src/pair_coul_dsf.h @@ -41,14 +41,14 @@ class PairCoulDSF : public Pair { void *extract(const char *, int &); protected: - double cut_coul,cut_coulsq; + double cut_coul, cut_coulsq; double alpha; - double f_shift,e_shift; + double f_shift, e_shift; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_streitz.h b/src/pair_coul_streitz.h index 548e17f37e..04c567def5 100644 --- a/src/pair_coul_streitz.h +++ b/src/pair_coul_streitz.h @@ -46,7 +46,7 @@ class PairCoulStreitz : public Pair { int nmax; double precision; - Param *params; // parameter sets for elements + Param *params; // parameter sets for elements // Kspace parameters int kspacetype; @@ -66,18 +66,14 @@ class PairCoulStreitz : public Pair { virtual void read_file(char *); void setup_params(); double self(Param *, double); - void coulomb_integral_wolf(double, double, double, double &, double &, - double &, double &); - void wolf_sum(double, double, double, double, double, double, double, - double, double &, double &); - void coulomb_integral_ewald(double, double, double, double &, double &, - double &, double &); - void ewald_sum(double, double, double, double, double, double, double, - double, double &, double &, double); - + void coulomb_integral_wolf(double, double, double, double &, double &, double &, double &); + void wolf_sum(double, double, double, double, double, double, double, double, double &, double &); + void coulomb_integral_ewald(double, double, double, double &, double &, double &, double &); + void ewald_sum(double, double, double, double, double, double, double, double, double &, double &, + double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_coul_wolf.h b/src/pair_coul_wolf.h index 584af0cbe3..74940a4e6b 100644 --- a/src/pair_coul_wolf.h +++ b/src/pair_coul_wolf.h @@ -40,12 +40,12 @@ class PairCoulWolf : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_coul,cut_coulsq,alf; + double cut_coul, cut_coulsq, alf; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_deprecated.h b/src/pair_deprecated.h index 8bb623e895..02f7efcee3 100644 --- a/src/pair_deprecated.h +++ b/src/pair_deprecated.h @@ -33,10 +33,9 @@ class PairDeprecated : public Pair { virtual void compute(int, int) {} virtual void settings(int, char **); virtual void coeff(int, char **) {} - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_dpd.h b/src/pair_dpd.h index 2578ec3d63..abbcc1bad7 100644 --- a/src/pair_dpd.h +++ b/src/pair_dpd.h @@ -42,17 +42,17 @@ class PairDPD : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_global,temperature; + double cut_global, temperature; int seed; double **cut; - double **a0,**gamma; + double **a0, **gamma; double **sigma; class RanMars *random; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_dpd_tstat.h b/src/pair_dpd_tstat.h index 75f05f6128..291d160d4e 100644 --- a/src/pair_dpd_tstat.h +++ b/src/pair_dpd_tstat.h @@ -39,10 +39,10 @@ class PairDPDTstat : public PairDPD { void write_data_all(FILE *); protected: - double t_start,t_stop; + double t_start, t_stop; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_gauss.h b/src/pair_gauss.h index 00479b5049..a4c68e11b5 100644 --- a/src/pair_gauss.h +++ b/src/pair_gauss.h @@ -28,7 +28,7 @@ class PairGauss : public Pair { public: PairGauss(class LAMMPS *); virtual ~PairGauss(); - virtual void compute(int,int); + virtual void compute(int, int); void settings(int, char **); void coeff(int, char **); double init_one(int, int); @@ -44,13 +44,13 @@ class PairGauss : public Pair { protected: double cut_global; double **cut; - double **a,**b; + double **a, **b; double **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h index fd88ae72f6..5599fbdb6c 100644 --- a/src/pair_hybrid.h +++ b/src/pair_hybrid.h @@ -35,6 +35,7 @@ class PairHybrid : public Pair { friend class Neighbor; friend class Respa; friend class PairDeprecated; + public: PairHybrid(class LAMMPS *); virtual ~PairHybrid(); @@ -61,37 +62,37 @@ class PairHybrid : public Pair { virtual void add_tally_callback(class Compute *); virtual void del_tally_callback(class Compute *); double atom2cut(int); - double radii2cut(double,double); + double radii2cut(double, double); protected: - int nstyles; // # of sub-styles - Pair **styles; // list of Pair style classes - char **keywords; // style name of each Pair style - int *multiple; // 0 if style used once, else Mth instance + int nstyles; // # of sub-styles + Pair **styles; // list of Pair style classes + char **keywords; // style name of each Pair style + int *multiple; // 0 if style used once, else Mth instance - int outerflag; // toggle compute() when invoked by outer() - int respaflag; // 1 if different substyles are assigned to - // different r-RESPA levels + int outerflag; // toggle compute() when invoked by outer() + int respaflag; // 1 if different substyles are assigned to + // different r-RESPA levels - int **nmap; // # of sub-styles itype,jtype points to - int ***map; // list of sub-styles itype,jtype points to - double **special_lj; // list of per style LJ exclusion factors - double **special_coul; // list of per style Coulomb exclusion factors - int *compute_tally; // list of on/off flags for tally computes + int **nmap; // # of sub-styles itype,jtype points to + int ***map; // list of sub-styles itype,jtype points to + double **special_lj; // list of per style LJ exclusion factors + double **special_coul; // list of per style Coulomb exclusion factors + int *compute_tally; // list of on/off flags for tally computes void allocate(); void flags(); virtual void init_svector(); - virtual void copy_svector(int,int); + virtual void copy_svector(int, int); - void modify_special(int, int, char**); + void modify_special(int, int, char **); double *save_special(); void set_special(int); void restore_special(double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_hybrid_overlay.h b/src/pair_hybrid_overlay.h index 2342e9e060..837ae1be79 100644 --- a/src/pair_hybrid_overlay.h +++ b/src/pair_hybrid_overlay.h @@ -31,10 +31,10 @@ class PairHybridOverlay : public PairHybrid { void coeff(int, char **); void init_svector(); - void copy_svector(int,int); + void copy_svector(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_hybrid_scaled.h b/src/pair_hybrid_scaled.h index d8d0bdc6d1..777eba7120 100644 --- a/src/pair_hybrid_scaled.h +++ b/src/pair_hybrid_scaled.h @@ -32,7 +32,7 @@ class PairHybridScaled : public PairHybrid { PairHybridScaled(class LAMMPS *); virtual ~PairHybridScaled(); virtual void compute(int, int); - virtual void settings(int, char**); + virtual void settings(int, char **); virtual void coeff(int, char **); virtual void write_restart(FILE *); @@ -40,7 +40,7 @@ class PairHybridScaled : public PairHybrid { virtual double single(int, int, int, int, double, double, double, double &); void init_svector(); - void copy_svector(int,int); + void copy_svector(int, int); protected: double **fsum, **tsum; @@ -50,7 +50,7 @@ class PairHybridScaled : public PairHybrid { int nmaxfsum; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj96_cut.h b/src/pair_lj96_cut.h index 13e23c9679..9a1baaa581 100644 --- a/src/pair_lj96_cut.h +++ b/src/pair_lj96_cut.h @@ -49,14 +49,14 @@ class PairLJ96Cut : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cubic.h b/src/pair_lj_cubic.h index 0a9875574f..2ae40c9765 100644 --- a/src/pair_lj_cubic.h +++ b/src/pair_lj_cubic.h @@ -40,13 +40,13 @@ class PairLJCubic : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cubic_const.h b/src/pair_lj_cubic_const.h index 3bf59d122d..9932e3c0b1 100644 --- a/src/pair_lj_cubic_const.h +++ b/src/pair_lj_cubic_const.h @@ -19,14 +19,14 @@ namespace PairLJCubicConstants { // LJ quantities scaled by epsilon and rmin = sigma*2^1/6 - static constexpr double RT6TWO = 1.1224620483093730; // 2^1/6 - static constexpr double SS = 1.1086834179687215; // inflection point (13/7)^1/6 - static constexpr double PHIS = -0.7869822485207097; // energy at s - static constexpr double DPHIDS = 2.6899008972047196; // gradient at s - static constexpr double A3 = 27.9335700460986445; // cubic coefficient - static constexpr double SM = 1.5475372709146737; // cubic cutoff = s*67/48} -} -} + static constexpr double RT6TWO = 1.1224620483093730; // 2^1/6 + static constexpr double SS = 1.1086834179687215; // inflection point (13/7)^1/6 + static constexpr double PHIS = -0.7869822485207097; // energy at s + static constexpr double DPHIDS = 2.6899008972047196; // gradient at s + static constexpr double A3 = 27.9335700460986445; // cubic coefficient + static constexpr double SM = 1.5475372709146737; // cubic cutoff = s*67/48} +} // namespace PairLJCubicConstants +} // namespace LAMMPS_NS #endif // python script to compute the constants diff --git a/src/pair_lj_cut.h b/src/pair_lj_cut.h index 422b37e6d4..d4cd87de11 100644 --- a/src/pair_lj_cut.h +++ b/src/pair_lj_cut.h @@ -49,14 +49,14 @@ class PairLJCut : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; double *cut_respa; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_cut.h b/src/pair_lj_cut_coul_cut.h index beb09a9495..ff73a4c3a5 100644 --- a/src/pair_lj_cut_coul_cut.h +++ b/src/pair_lj_cut_coul_cut.h @@ -43,16 +43,16 @@ class PairLJCutCoulCut : public Pair { void *extract(const char *, int &); protected: - double cut_lj_global,cut_coul_global; - double **cut_lj,**cut_ljsq; - double **cut_coul,**cut_coulsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double cut_lj_global, cut_coul_global; + double **cut_lj, **cut_ljsq; + double **cut_coul, **cut_coulsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_debye.h b/src/pair_lj_cut_coul_debye.h index fe2ccb3146..4f7f64c268 100644 --- a/src/pair_lj_cut_coul_debye.h +++ b/src/pair_lj_cut_coul_debye.h @@ -38,7 +38,7 @@ class PairLJCutCoulDebye : public PairLJCutCoulCut { double kappa; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_dsf.h b/src/pair_lj_cut_coul_dsf.h index c23fa31c87..dd0f942853 100644 --- a/src/pair_lj_cut_coul_dsf.h +++ b/src/pair_lj_cut_coul_dsf.h @@ -42,18 +42,18 @@ class PairLJCutCoulDSF : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **cut_lj, **cut_ljsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; - double cut_coul,cut_coulsq; + double cut_coul, cut_coulsq; double alpha; - double f_shift,e_shift; + double f_shift, e_shift; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_cut_coul_wolf.h b/src/pair_lj_cut_coul_wolf.h index f95ccf50a0..0aa22abfa2 100644 --- a/src/pair_lj_cut_coul_wolf.h +++ b/src/pair_lj_cut_coul_wolf.h @@ -42,15 +42,15 @@ class PairLJCutCoulWolf : public Pair { protected: double cut_lj_global; - double **cut_lj,**cut_ljsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4,**offset; - double cut_coul,cut_coulsq,alf; + double **cut_lj, **cut_ljsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4, **offset; + double cut_coul, cut_coulsq, alf; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_expand.h b/src/pair_lj_expand.h index 0c8eea35dc..a60bda2031 100644 --- a/src/pair_lj_expand.h +++ b/src/pair_lj_expand.h @@ -45,13 +45,13 @@ class PairLJExpand : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma,**shift; - double **lj1,**lj2,**lj3,**lj4,**offset; + double **epsilon, **sigma, **shift; + double **lj1, **lj2, **lj3, **lj4, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_gromacs.h b/src/pair_lj_gromacs.h index 8f5e4726eb..f71f5c67bd 100644 --- a/src/pair_lj_gromacs.h +++ b/src/pair_lj_gromacs.h @@ -41,16 +41,16 @@ class PairLJGromacs : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double cut_inner_global,cut_global; - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; - double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5; + double cut_inner_global, cut_global; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; + double **ljsw1, **ljsw2, **ljsw3, **ljsw4, **ljsw5; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_gromacs_coul_gromacs.h b/src/pair_lj_gromacs_coul_gromacs.h index f8610123b9..5c109947b2 100644 --- a/src/pair_lj_gromacs_coul_gromacs.h +++ b/src/pair_lj_gromacs_coul_gromacs.h @@ -42,17 +42,17 @@ class PairLJGromacsCoulGromacs : public Pair { virtual double single(int, int, int, int, double, double, double, double &); protected: - double cut_lj_inner,cut_lj,cut_coul_inner,cut_coul; - double cut_lj_innersq,cut_ljsq,cut_coul_innersq,cut_coulsq,cut_bothsq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; - double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5; - double coulsw1,coulsw2,coulsw3,coulsw4,coulsw5; + double cut_lj_inner, cut_lj, cut_coul_inner, cut_coul; + double cut_lj_innersq, cut_ljsq, cut_coul_innersq, cut_coulsq, cut_bothsq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; + double **ljsw1, **ljsw2, **ljsw3, **ljsw4, **ljsw5; + double coulsw1, coulsw2, coulsw3, coulsw4, coulsw5; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_relres.h b/src/pair_lj_relres.h index 7e04b6a265..4e53ebfd05 100644 --- a/src/pair_lj_relres.h +++ b/src/pair_lj_relres.h @@ -42,19 +42,19 @@ class PairLJRelRes : public Pair { protected: double cut_inner_global, cut_global, cutf_inner_global, cutf_global; - double **cut,**cut_inner,**cut_inner_sq,**cutf,**cutfsq,**cutf_inner,**cutf_inner_sq; - double **epsilon,**sigma; - double **epsilonf,**sigmaf; - double **lj1,**lj2,**lj3,**lj4; - double **ljf1,**ljf2,**ljf3,**ljf4; - double **ljsw0,**ljsw1,**ljsw2,**ljsw3,**ljsw4; - double **ljswf0,**ljswf1,**ljswf2,**ljswf3,**ljswf4; - double **offset,**offsetsp,**offsetsm; + double **cut, **cut_inner, **cut_inner_sq, **cutf, **cutfsq, **cutf_inner, **cutf_inner_sq; + double **epsilon, **sigma; + double **epsilonf, **sigmaf; + double **lj1, **lj2, **lj3, **lj4; + double **ljf1, **ljf2, **ljf3, **ljf4; + double **ljsw0, **ljsw1, **ljsw2, **ljsw3, **ljsw4; + double **ljswf0, **ljswf1, **ljswf2, **ljswf3, **ljswf4; + double **offset, **offsetsp, **offsetsm; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_smooth.h b/src/pair_lj_smooth.h index 2e1e3aa723..e234563588 100644 --- a/src/pair_lj_smooth.h +++ b/src/pair_lj_smooth.h @@ -41,17 +41,17 @@ class PairLJSmooth : public Pair { double single(int, int, int, int, double, double, double, double &); protected: - double cut_inner_global,cut_global; - double **cut,**cut_inner,**cut_inner_sq; - double **epsilon,**sigma; - double **lj1,**lj2,**lj3,**lj4; - double **ljsw0,**ljsw1,**ljsw2,**ljsw3,**ljsw4; + double cut_inner_global, cut_global; + double **cut, **cut_inner, **cut_inner_sq; + double **epsilon, **sigma; + double **lj1, **lj2, **lj3, **lj4; + double **ljsw0, **ljsw1, **ljsw2, **ljsw3, **ljsw4; double **offset; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_lj_smooth_linear.h b/src/pair_lj_smooth_linear.h index 7e737a91c2..9298f070ad 100644 --- a/src/pair_lj_smooth_linear.h +++ b/src/pair_lj_smooth_linear.h @@ -38,19 +38,19 @@ class PairLJSmoothLinear : public Pair { void write_restart_settings(FILE *); void read_restart_settings(FILE *); double single(int, int, int, int, double, double, double, double &); - double single_hessian(int, int, int, int, double, double[3], double, double, double&, double[6]); + double single_hessian(int, int, int, int, double, double[3], double, double, double &, double[6]); protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **ljcut,**dljcut; - double **lj1,**lj2,**lj3,**lj4; + double **epsilon, **sigma; + double **ljcut, **dljcut; + double **lj1, **lj2, **lj3, **lj4; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_mie_cut.h b/src/pair_mie_cut.h index 32368ac155..0072ae86eb 100644 --- a/src/pair_mie_cut.h +++ b/src/pair_mie_cut.h @@ -47,15 +47,15 @@ class PairMIECut : public Pair { protected: double cut_global; double **cut; - double **epsilon,**sigma; - double **gamR,**gamA,**Cmie; - double **mie1,**mie2,**mie3,**mie4,**offset; + double **epsilon, **sigma; + double **gamR, **gamA, **Cmie; + double **mie1, **mie2, **mie3, **mie4, **offset; double *cut_respa; void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_morse.h b/src/pair_morse.h index fde17d3ec8..870d83cdf8 100644 --- a/src/pair_morse.h +++ b/src/pair_morse.h @@ -45,14 +45,14 @@ class PairMorse : public Pair { protected: double cut_global; double **cut; - double **d0,**alpha,**r0; + double **d0, **alpha, **r0; double **morse1; double **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_soft.h b/src/pair_soft.h index 692f650e9e..7b96b8a05c 100644 --- a/src/pair_soft.h +++ b/src/pair_soft.h @@ -52,7 +52,7 @@ class PairSoft : public Pair { void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_table.h b/src/pair_table.h index d97dd8ac29..ae0d85746c 100644 --- a/src/pair_table.h +++ b/src/pair_table.h @@ -40,18 +40,18 @@ class PairTable : public Pair { virtual double single(int, int, int, int, double, double, double, double &); void *extract(const char *, int &); - enum{LOOKUP,LINEAR,SPLINE,BITMAP}; + enum { LOOKUP, LINEAR, SPLINE, BITMAP }; protected: - int tabstyle,tablength; + int tabstyle, tablength; struct Table { - int ninput,rflag,fpflag,match,ntablebits; - int nshiftbits,nmask; - double rlo,rhi,fplo,fphi,cut; - double *rfile,*efile,*ffile; - double *e2file,*f2file; - double innersq,delta,invdelta,deltasq6; - double *rsq,*drsq,*e,*de,*f,*df,*e2,*f2; + int ninput, rflag, fpflag, match, ntablebits; + int nshiftbits, nmask; + double rlo, rhi, fplo, fphi, cut; + double *rfile, *efile, *ffile; + double *e2file, *f2file; + double innersq, delta, invdelta, deltasq6; + double *rsq, *drsq, *e, *de, *f, *df, *e2, *f2; }; int ntables; Table *tables; @@ -70,7 +70,7 @@ class PairTable : public Pair { static double splint(double *, double *, double *, int, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_ufm.h b/src/pair_ufm.h index 6b25a2b87f..5c94d6043d 100644 --- a/src/pair_ufm.h +++ b/src/pair_ufm.h @@ -49,14 +49,14 @@ class PairUFM : public Pair { protected: double cut_global; - double **cut,**scale; - double **epsilon,**sigma; - double **uf1,**uf2,**uf3,**offset; + double **cut, **scale; + double **epsilon, **sigma; + double **uf1, **uf2, **uf3, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_yukawa.h b/src/pair_yukawa.h index be51827ad5..f8334f6805 100644 --- a/src/pair_yukawa.h +++ b/src/pair_yukawa.h @@ -44,12 +44,12 @@ class PairYukawa : public Pair { double cut_global; double kappa; double *rad; - double **cut,**a,**offset; + double **cut, **a, **offset; virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_zbl.h b/src/pair_zbl.h index 35205db234..cc91d93bc3 100644 --- a/src/pair_zbl.h +++ b/src/pair_zbl.h @@ -45,8 +45,8 @@ class PairZBL : public Pair { double cut_global, cut_inner; double cut_globalsq, cut_innersq; double *z; - double **d1a,**d2a,**d3a,**d4a,**zze; - double **sw1,**sw2,**sw3,**sw4,**sw5; + double **d1a, **d2a, **d3a, **d4a, **zze; + double **sw1, **sw2, **sw3, **sw4, **sw5; virtual void allocate(); double e_zbl(double, int, int); @@ -54,7 +54,7 @@ class PairZBL : public Pair { double d2zbldr2(double, int, int); void set_coeff(int, int, double, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pair_zbl_const.h b/src/pair_zbl_const.h index 31f05a2e12..884abbe157 100644 --- a/src/pair_zbl_const.h +++ b/src/pair_zbl_const.h @@ -29,6 +29,6 @@ namespace PairZBLConstants { static constexpr double d2 = 0.40290; static constexpr double d3 = 0.94229; static constexpr double d4 = 3.19980; -} -} +} // namespace PairZBLConstants +} // namespace LAMMPS_NS #endif diff --git a/src/pair_zero.h b/src/pair_zero.h index 805892d2da..559ddef547 100644 --- a/src/pair_zero.h +++ b/src/pair_zero.h @@ -59,7 +59,7 @@ class PairZero : public Pair { virtual void allocate(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/pointers.h b/src/pointers.h index 373d7a64a7..2c62e90e5f 100644 --- a/src/pointers.h +++ b/src/pointers.h @@ -10,6 +10,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +// clang-format off // Pointers class contains ptrs to master copy of // fundamental LAMMPS class ptrs stored in lammps.h @@ -41,7 +42,7 @@ namespace LAMMPS_NS { // enum used for KOKKOS host/device flags -enum ExecutionSpace{Host,Device}; +enum ExecutionSpace{ Host, Device }; // global forward declarations diff --git a/src/potential_file_reader.h b/src/potential_file_reader.h index ca403bb876..4b25865710 100644 --- a/src/potential_file_reader.h +++ b/src/potential_file_reader.h @@ -18,50 +18,48 @@ #ifndef LMP_POTENTIAL_FILE_READER_H #define LMP_POTENTIAL_FILE_READER_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export #include "tokenizer.h" -namespace LAMMPS_NS -{ - class TextFileReader; +namespace LAMMPS_NS { +class TextFileReader; - class PotentialFileReader : protected Pointers { - protected: - TextFileReader *reader; - std::string filename; - std::string filetype; - int unit_convert; +class PotentialFileReader : protected Pointers { + protected: + TextFileReader *reader; + std::string filename; + std::string filetype; + int unit_convert; - TextFileReader *open_potential(const std::string& path); + TextFileReader *open_potential(const std::string &path); - public: - PotentialFileReader(class LAMMPS *lmp, const std::string &filename, - const std::string &potential_name, - const int auto_convert = 0); - PotentialFileReader(class LAMMPS *lmp, const std::string &filename, - const std::string &potential_name, - const std::string &name_suffix, - const int auto_convert = 0); - virtual ~PotentialFileReader(); + public: + PotentialFileReader(class LAMMPS *lmp, const std::string &filename, + const std::string &potential_name, const int auto_convert = 0); + PotentialFileReader(class LAMMPS *lmp, const std::string &filename, + const std::string &potential_name, const std::string &name_suffix, + const int auto_convert = 0); + virtual ~PotentialFileReader(); - void ignore_comments(bool value); + void ignore_comments(bool value); - void skip_line(); - char *next_line(int nparams = 0); - void next_dvector(double *list, int n); - ValueTokenizer next_values(int nparams, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); + void skip_line(); + char *next_line(int nparams = 0); + void next_dvector(double *list, int n); + ValueTokenizer next_values(int nparams, + const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - // convenience functions - double next_double(); - int next_int(); - tagint next_tagint(); - bigint next_bigint(); - std::string next_string(); + // convenience functions + double next_double(); + int next_int(); + tagint next_tagint(); + bigint next_bigint(); + std::string next_string(); - // unit conversion info - int get_unit_convert() const { return unit_convert; } - }; + // unit conversion info + int get_unit_convert() const { return unit_convert; } +}; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif diff --git a/src/procmap.h b/src/procmap.h index f342b7d107..27ab7c066c 100644 --- a/src/procmap.h +++ b/src/procmap.h @@ -23,25 +23,24 @@ class ProcMap : protected Pointers { ProcMap(class LAMMPS *); ~ProcMap() {} void onelevel_grid(int, int *, int *, int, int, int *, int *); - void twolevel_grid(int, int *, int *, int, int *, int *, int, int, - int *, int *); + void twolevel_grid(int, int *, int *, int, int *, int *, int, int, int *, int *); void numa_grid(int, int *, int *, int *); void custom_grid(char *, int, int *, int *); - void cart_map(int, int *, int *, int [3][2], int ***); - void cart_map(int, int *, int, int *, int *, int [3][2], int ***); - void xyz_map(char *, int *, int *, int [3][2], int ***); - void xyz_map(char *, int *, int, int *, int *, int [3][2], int ***); - void numa_map(int, int *, int *, int [3][2], int ***); - void custom_map(int *, int *, int [3][2], int ***); + void cart_map(int, int *, int *, int[3][2], int ***); + void cart_map(int, int *, int, int *, int *, int[3][2], int ***); + void xyz_map(char *, int *, int *, int[3][2], int ***); + void xyz_map(char *, int *, int, int *, int *, int[3][2], int ***); + void numa_map(int, int *, int *, int[3][2], int ***); + void custom_map(int *, int *, int[3][2], int ***); void output(char *, int *, int ***); private: - int procs_per_node; // NUMA params + int procs_per_node; // NUMA params int procs_per_numa; - int node_id; // which node I am in - int nodegrid[3]; // 3d grid of nodes + int node_id; // which node I am in + int nodegrid[3]; // 3d grid of nodes - int **cmap; // info in custom grid file + int **cmap; // info in custom grid file int factor(int, int **); int combine_factors(int, int **, int, int **, int **); @@ -52,7 +51,7 @@ class ProcMap : protected Pointers { void grid_shift(int, int, int &, int &); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/random_mars.h b/src/random_mars.h index e7862d19e4..3a132af0e3 100644 --- a/src/random_mars.h +++ b/src/random_mars.h @@ -35,11 +35,11 @@ class RanMars : protected Pointers { int save; double second; double *u; - int i97,j97; - double c,cd,cm; + int i97, j97; + double c, cd, cm; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/random_park.h b/src/random_park.h index e469491b35..6484743787 100644 --- a/src/random_park.h +++ b/src/random_park.h @@ -28,11 +28,11 @@ class RanPark : protected Pointers { int state(); private: - int seed,save; + int seed, save; double second; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/rcb.h b/src/rcb.h index 0d7cf0eb4e..2395330498 100644 --- a/src/rcb.h +++ b/src/rcb.h @@ -22,21 +22,21 @@ class RCB : protected Pointers { public: // set by compute() - int noriginal; // # of dots I own before balancing - int nfinal; // # of dots I own after balancing - int nkeep; // how many dots of noriginal I still own - // will be first nkept of nfinal list - int *recvproc; // proc IDs of nfinal dots - int *recvindex; // index of nfinal dots on owning procs - // based on input list for compute() - double *lo,*hi; // final bounding box of my RCB sub-domain - double cut; // single cut (in Tree) owned by this proc - int cutdim; // dimension (0,1,2) of the cut + int noriginal; // # of dots I own before balancing + int nfinal; // # of dots I own after balancing + int nkeep; // how many dots of noriginal I still own + // will be first nkept of nfinal list + int *recvproc; // proc IDs of nfinal dots + int *recvindex; // index of nfinal dots on owning procs + // based on input list for compute() + double *lo, *hi; // final bounding box of my RCB sub-domain + double cut; // single cut (in Tree) owned by this proc + int cutdim; // dimension (0,1,2) of the cut // set by invert() - int *sendproc; // proc to send each of my noriginal dots to - int *sendindex; // index of dot in receiver's nfinal list + int *sendproc; // proc to send each of my noriginal dots to + int *sendindex; // index of dot in receiver's nfinal list RCB(class LAMMPS *); ~RCB(); @@ -52,47 +52,47 @@ class RCB : protected Pointers { // RCB cut info struct Median { - double totallo,totalhi; // weight in each half of active partition - double valuelo,valuehi; // position of dot(s) nearest to cut - double wtlo,wthi; // total weight of dot(s) at that position - int countlo,counthi; // # of dots at that position - int proclo,prochi; // unique proc who owns a nearest dot + double totallo, totalhi; // weight in each half of active partition + double valuelo, valuehi; // position of dot(s) nearest to cut + double wtlo, wthi; // total weight of dot(s) at that position + int countlo, counthi; // # of dots at that position + int proclo, prochi; // unique proc who owns a nearest dot }; struct BBox { - double lo[3],hi[3]; // corner points of a bounding box + double lo[3], hi[3]; // corner points of a bounding box }; private: - int me,nprocs; + int me, nprocs; // point to balance on struct Dot { - double x[3]; // coord of point - double wt; // weight of point - int proc; // owning proc - int index; // index on owning proc + double x[3]; // coord of point + double wt; // weight of point + int proc; // owning proc + int index; // index on owning proc }; // tree of RCB cuts struct Tree { - double cut; // position of cut - int dim; // dimension = 0/1/2 of cut + double cut; // position of cut + int dim; // dimension = 0/1/2 of cut }; // inversion message struct Invert { - int rindex; // index on receiving proc - int sproc; // sending proc - int sindex; // index on sending proc + int rindex; // index on receiving proc + int sproc; // sending proc + int sindex; // index on sending proc }; - Dot *dots; // dots on this proc - int ndot; // # of dots on this proc - int maxdot; // allocated size of dots + Dot *dots; // dots on this proc + int ndot; // # of dots on this proc + int maxdot; // allocated size of dots int ndotorig; int nlist; @@ -104,29 +104,29 @@ class RCB : protected Pointers { int maxbuf; Dot *buf; - int maxrecv,maxsend; + int maxrecv, maxsend; BBox bbox; class Irregular *irregular; - MPI_Op box_op,med_op; - MPI_Datatype box_type,med_type; + MPI_Op box_op, med_op; + MPI_Datatype box_type, med_type; - int reuse; // 1/0 to use/not use previous cuts - int dottop; // dots >= this index are new - double bboxlo[3]; // bounding box of final RCB sub-domain + int reuse; // 1/0 to use/not use previous cuts + int dottop; // dots >= this index are new + double bboxlo[3]; // bounding box of final RCB sub-domain double bboxhi[3]; - Tree *tree; // tree of RCB cuts, used by reuse() - int counters[7]; // diagnostic counts - // 0 = # of median iterations - // 1 = # of points sent - // 2 = # of points received - // 3 = most points this proc ever owns - // 4 = most point memory this proc ever allocs - // 5 = # of times a previous cut is re-used - // 6 = # of reallocs of point vector + Tree *tree; // tree of RCB cuts, used by reuse() + int counters[7]; // diagnostic counts + // 0 = # of median iterations + // 1 = # of points sent + // 2 = # of points received + // 3 = most points this proc ever owns + // 4 = most point memory this proc ever allocs + // 5 = # of times a previous cut is re-used + // 6 = # of reallocs of point vector }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/read_data.h b/src/read_data.h index 9fb6560725..011262b74e 100644 --- a/src/read_data.h +++ b/src/read_data.h @@ -31,20 +31,20 @@ class ReadData : public Command { void command(int, char **); private: - int me,compressed; - char *line,*keyword,*buffer,*style; + int me, compressed; + char *line, *keyword, *buffer, *style; FILE *fp; char **coeffarg; - int ncoeffarg,maxcoeffarg; - char argoffset1[8],argoffset2[8]; + int ncoeffarg, maxcoeffarg; + char argoffset1[8], argoffset2[8]; bigint id_offset, mol_offset; int nlocal_previous; bigint natoms; - bigint nbonds,nangles,ndihedrals,nimpropers; + bigint nbonds, nangles, ndihedrals, nimpropers; int ntypes; - int nbondtypes,nangletypes,ndihedraltypes,nimpropertypes; + int nbondtypes, nangletypes, ndihedraltypes, nimpropertypes; bigint nellipsoids; class AtomVecEllipsoid *avec_ellipsoid; @@ -57,18 +57,18 @@ class ReadData : public Command { // box info - double boxlo[3],boxhi[3]; - double xy,xz,yz; + double boxlo[3], boxhi[3]; + double xy, xz, yz; int triclinic; // optional args - int addflag,offsetflag,shiftflag,coeffflag; + int addflag, offsetflag, shiftflag, coeffflag; tagint addvalue; - int toffset,boffset,aoffset,doffset,ioffset; + int toffset, boffset, aoffset, doffset, ioffset; double shift[3]; - int extra_atom_types,extra_bond_types,extra_angle_types; - int extra_dihedral_types,extra_improper_types; + int extra_atom_types, extra_bond_types, extra_angle_types; + int extra_dihedral_types, extra_improper_types; int groupbit; int nfix; @@ -110,7 +110,7 @@ class ReadData : public Command { void fix(int, char *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/read_dump.h b/src/read_dump.h index 563cf8a9e5..6e5109a9c8 100644 --- a/src/read_dump.h +++ b/src/read_dump.h @@ -40,62 +40,62 @@ class ReadDump : public Command { void atoms(); int fields_and_keywords(int, char **); -private: - int me,nprocs; + private: + int me, nprocs; - char **files; // list of input dump files to process - int nfile; // # of dump files to process (each may be parallel) - int currentfile; // current open file (0 to nfile-1) + char **files; // list of input dump files to process + int nfile; // # of dump files to process (each may be parallel) + int currentfile; // current open file (0 to nfile-1) - MPI_Comm clustercomm; // comm for proc cluster that reads/shares a file - int me_cluster,nprocs_cluster; // proc ID and count for my read cluster + MPI_Comm clustercomm; // comm for proc cluster that reads/shares a file + int me_cluster, nprocs_cluster; // proc ID and count for my read cluster - int multiproc; // 0 = each dump file is a single file - // 1 = each dump file is parallel (multiple files) - int multiproc_nfile; // number of parallel files in one dump file + int multiproc; // 0 = each dump file is a single file + // 1 = each dump file is parallel (multiple files) + int multiproc_nfile; // number of parallel files in one dump file - int nreader; // # of parallel dump files read by my cluster - int firstfile; // index of 1st dump file my cluster reads - // (0 to multiproc_nfile-1) - int filereader; // 1 if this proc reads from a dump file(s) - int parallel; // 1 if parallel reading (e.g. via ADIOS2) + int nreader; // # of parallel dump files read by my cluster + int firstfile; // index of 1st dump file my cluster reads + // (0 to multiproc_nfile-1) + int filereader; // 1 if this proc reads from a dump file(s) + int parallel; // 1 if parallel reading (e.g. via ADIOS2) - int dimension; // same as in Domain + int dimension; // same as in Domain int triclinic; - int boxflag; // overwrite simulation with dump file box params - int replaceflag,addflag; // flags for processing dump snapshot atoms - int trimflag,purgeflag; - int scaleflag; // user 0/1 if dump file coords are unscaled/scaled - int wrapflag; // user 0/1 if dump file coords are unwrapped/wrapped - char *readerstyle; // style of dump files to read + int boxflag; // overwrite simulation with dump file box params + int replaceflag, addflag; // flags for processing dump snapshot atoms + int trimflag, purgeflag; + int scaleflag; // user 0/1 if dump file coords are unscaled/scaled + int wrapflag; // user 0/1 if dump file coords are unwrapped/wrapped + char *readerstyle; // style of dump files to read - int nnew; // # of dump file atoms this proc owns - int nfield; // # of fields to extract from dump file - int *fieldtype; // type of each field = X,VY,IZ,etc - char **fieldlabel; // user specified label for field - double **fields; // per-atom field values - int maxnew; // allocation size of fields array - double **buf; // read buffer + int nnew; // # of dump file atoms this proc owns + int nfield; // # of fields to extract from dump file + int *fieldtype; // type of each field = X,VY,IZ,etc + char **fieldlabel; // user specified label for field + double **fields; // per-atom field values + int maxnew; // allocation size of fields array + double **buf; // read buffer - int scaled; // 0/1 if dump file coords are unscaled/scaled - int wrapped; // 0/1 if dump file coords are unwrapped/wrapped + int scaled; // 0/1 if dump file coords are unscaled/scaled + int wrapped; // 0/1 if dump file coords are unwrapped/wrapped - double box[3][3]; // dump file box parameters - double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz; // dump snapshot box params - double xprd,yprd,zprd; + double box[3][3]; // dump file box parameters + double xlo, xhi, ylo, yhi, zlo, zhi, xy, xz, yz; // dump snapshot box params + double xprd, yprd, zprd; - bigint *nsnapatoms; // # of atoms in one snapshot from - // one (parallel) dump file - // nreader-length vector b/c a reader proc - // may read from multiple parallel dump files + bigint *nsnapatoms; // # of atoms in one snapshot from + // one (parallel) dump file + // nreader-length vector b/c a reader proc + // may read from multiple parallel dump files - int npurge,nreplace,ntrim,nadd; // stats on processed atoms - int yindex,zindex; // field index for Y,Z coords + int npurge, nreplace, ntrim, nadd; // stats on processed atoms + int yindex, zindex; // field index for Y,Z coords - class Reader **readers; // class that reads a dump file - // nreader-length list of readers if proc reads - // from multiple parallel dump files + class Reader **readers; // class that reads a dump file + // nreader-length list of readers if proc reads + // from multiple parallel dump files void read_atoms(); void process_atoms(); @@ -111,7 +111,7 @@ private: double zfield(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/read_restart.h b/src/read_restart.h index d0ff700b4a..75cb7c1125 100644 --- a/src/read_restart.h +++ b/src/read_restart.h @@ -30,21 +30,21 @@ class ReadRestart : public Command { void command(int, char **); private: - int me,nprocs; + int me, nprocs; FILE *fp; - int multiproc; // 0 = restart file is a single file - // 1 = restart file is parallel (multiple files) - int multiproc_file; // # of parallel files in restart - int nprocs_file; // total # of procs that wrote restart file - int revision; // revision number of the restart file format + int multiproc; // 0 = restart file is a single file + // 1 = restart file is parallel (multiple files) + int multiproc_file; // # of parallel files in restart + int nprocs_file; // total # of procs that wrote restart file + int revision; // revision number of the restart file format // MPI-IO values - int mpiioflag; // 1 for MPIIO output, else 0 - class RestartMPIIO *mpiio; // MPIIO for restart file input + int mpiioflag; // 1 for MPIIO output, else 0 + class RestartMPIIO *mpiio; // MPIIO for restart file input bigint assignedChunkSize; - MPI_Offset assignedChunkOffset,headerOffset; + MPI_Offset assignedChunkOffset, headerOffset; void file_search(char *, char *); void header(); @@ -65,7 +65,7 @@ class ReadRestart : public Command { void read_double_vec(int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reader.h b/src/reader.h index a31fc99531..ce91e5fea0 100644 --- a/src/reader.h +++ b/src/reader.h @@ -25,23 +25,23 @@ class Reader : protected Pointers { Reader(class LAMMPS *); virtual ~Reader() {} - virtual void settings(int, char**); + virtual void settings(int, char **); virtual int read_time(bigint &) = 0; virtual void skip() = 0; - virtual bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &) = 0; + virtual bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, + int &, int &, int &) = 0; virtual void read_atoms(int, int, double **) = 0; virtual void open_file(const char *); virtual void close_file(); protected: - FILE *fp; // pointer to opened file or pipe - int compressed; // flag for dump file compression + FILE *fp; // pointer to opened file or pipe + int compressed; // flag for dump file compression }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/reader_native.h b/src/reader_native.h index 0eeb2a25e5..144368b225 100644 --- a/src/reader_native.h +++ b/src/reader_native.h @@ -35,21 +35,21 @@ class ReaderNative : public Reader { int read_time(bigint &); void skip(); - bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &); + bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, int &, + int &, int &); void read_atoms(int, int, double **); -private: - char *line; // line read from dump file + private: + char *line; // line read from dump file - int nwords; // # of per-atom columns in dump file - int *fieldindex; // + int nwords; // # of per-atom columns in dump file + int *fieldindex; // - int find_label(const std::string &label, const std::map & labels); + int find_label(const std::string &label, const std::map &labels); void read_lines(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reader_xyz.h b/src/reader_xyz.h index 8b38656230..459b4af240 100644 --- a/src/reader_xyz.h +++ b/src/reader_xyz.h @@ -33,22 +33,22 @@ class ReaderXYZ : public Reader { int read_time(bigint &); void skip(); - bigint read_header(double [3][3], int &, int &, int, int, int *, char **, - int, int, int &, int &, int &, int &); + bigint read_header(double[3][3], int &, int &, int, int, int *, char **, int, int, int &, int &, + int &, int &); void read_atoms(int, int, double **); -private: - char *line; // line read from dump file - bigint nstep; // current (time) step number - bigint natoms; // current number of atoms - bigint nid; // current atom id. + private: + char *line; // line read from dump file + bigint nstep; // current (time) step number + bigint natoms; // current number of atoms + bigint nid; // current atom id. - int *fieldindex; // mapping of input fields to dump + int *fieldindex; // mapping of input fields to dump void read_lines(int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region.h b/src/region.h index 54112283a9..a196131aed 100644 --- a/src/region.h +++ b/src/region.h @@ -14,57 +14,57 @@ #ifndef LMP_REGION_H #define LMP_REGION_H -#include "pointers.h" // IWYU pragma: export +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { class Region : protected Pointers { public: - char *id,*style; + char *id, *style; int interior; // 1 for interior, 0 for exterior int scaleflag; // 1 for lattice, 0 for box - double xscale,yscale,zscale; // scale factors for box/lattice units - double extent_xlo,extent_xhi; // bounding box on region - double extent_ylo,extent_yhi; - double extent_zlo,extent_zhi; - int bboxflag; // 1 if bounding box is computable - int varshape; // 1 if region shape changes over time - int dynamic; // 1 if position/orient changes over time - int moveflag,rotateflag; // 1 if position/orientation changes - int openflag; // 1 if any face is open - int open_faces[6]; // flags for which faces are open + double xscale, yscale, zscale; // scale factors for box/lattice units + double extent_xlo, extent_xhi; // bounding box on region + double extent_ylo, extent_yhi; + double extent_zlo, extent_zhi; + int bboxflag; // 1 if bounding box is computable + int varshape; // 1 if region shape changes over time + int dynamic; // 1 if position/orient changes over time + int moveflag, rotateflag; // 1 if position/orientation changes + int openflag; // 1 if any face is open + int open_faces[6]; // flags for which faces are open - int copymode; // 1 if copy of original class + int copymode; // 1 if copy of original class // contact = particle near region surface (for soft interactions) // touch = particle touching region surface (for granular interactions) struct Contact { - double r; // distance between particle & surf, r > 0.0 - double delx,dely,delz; // vector from surface pt to particle - double radius; // curvature of region at contact point - int iwall; // unique id of wall for storing shear history - int varflag; // 1 if wall can be variable-controlled + double r; // distance between particle & surf, r > 0.0 + double delx, dely, delz; // vector from surface pt to particle + double radius; // curvature of region at contact point + int iwall; // unique id of wall for storing shear history + int varflag; // 1 if wall can be variable-controlled }; - Contact *contact; // list of contacts - int cmax; // max # of contacts possible with region - int tmax; // max # of touching contacts possible + Contact *contact; // list of contacts + int cmax; // max # of contacts possible with region + int tmax; // max # of touching contacts possible // motion attributes of region // public so can be accessed by other classes - double dx,dy,dz,theta; // current displacement and orientation - double v[3]; // translational velocity - double rpoint[3]; // current origin of rotation axis - double omega[3]; // angular velocity - double rprev; // speed of time-dependent radius, if applicable - double xcenter[3]; // translated/rotated center of cylinder/sphere (only used if varshape) - double prev[5]; // stores displacement (X3), angle and if - // necessary, region variable size (e.g. radius) - // at previous time step - int vel_timestep; // store timestep at which set_velocity was called - // prevents multiple fix/wall/gran/region calls - int nregion; // For union and intersect + double dx, dy, dz, theta; // current displacement and orientation + double v[3]; // translational velocity + double rpoint[3]; // current origin of rotation axis + double omega[3]; // angular velocity + double rprev; // speed of time-dependent radius, if applicable + double xcenter[3]; // translated/rotated center of cylinder/sphere (only used if varshape) + double prev[5]; // stores displacement (X3), angle and if + // necessary, region variable size (e.g. radius) + // at previous time step + int vel_timestep; // store timestep at which set_velocity was called + // prevents multiple fix/wall/gran/region calls + int nregion; // For union and intersect int size_restart; int *list; @@ -82,8 +82,8 @@ class Region : protected Pointers { virtual void set_velocity(); void velocity_contact(double *, double *, int); virtual void write_restart(FILE *); - virtual int restart(char *, int&); - virtual void length_restart_string(int&); + virtual int restart(char *, int &); + virtual void length_restart_string(int &); virtual void reset_vel(); // implemented by each region, not called by other classes @@ -94,25 +94,25 @@ class Region : protected Pointers { virtual void shape_update() {} virtual void pretransform(); virtual void set_velocity_shape() {} - virtual void velocity_contact_shape(double*, double*) {} + virtual void velocity_contact_shape(double *, double *) {} protected: void add_contact(int, double *, double, double, double); void options(int, char **); void point_on_line_segment(double *, double *, double *, double *); void forward_transform(double &, double &, double &); - double point[3],runit[3]; + double point[3], runit[3]; private: - char *xstr,*ystr,*zstr,*tstr; - int xvar,yvar,zvar,tvar; + char *xstr, *ystr, *zstr, *tstr; + int xvar, yvar, zvar, tvar; double axis[3]; void inverse_transform(double &, double &, double &); void rotate(double &, double &, double &, double); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/region_block.h b/src/region_block.h index 7d99d407e2..58ebfe5c3a 100644 --- a/src/region_block.h +++ b/src/region_block.h @@ -35,7 +35,7 @@ class RegBlock : public Region { int surface_exterior(double *, double); protected: - double xlo,xhi,ylo,yhi,zlo,zhi; + double xlo, xhi, ylo, yhi, zlo, zhi; double corners[6][4][3]; double face[6][3]; @@ -43,7 +43,7 @@ class RegBlock : public Region { int inside_face(double *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_cone.h b/src/region_cone.h index 2f3bf54a1e..5fbadf9f8b 100644 --- a/src/region_cone.h +++ b/src/region_cone.h @@ -34,15 +34,15 @@ class RegCone : public Region { private: char axis; - double c1,c2; - double radiuslo,radiushi; - double lo,hi; + double c1, c2; + double radiuslo, radiushi; + double lo, hi; double maxradius; double closest(double *, double *, double *, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_cylinder.h b/src/region_cylinder.h index 5a90b85504..2f71ba989a 100644 --- a/src/region_cylinder.h +++ b/src/region_cylinder.h @@ -40,19 +40,18 @@ class RegCylinder : public Region { private: char axis; - double c1,c2; + double c1, c2; double radius; - double lo,hi; - int c1style,c1var; - int c2style,c2var; - int rstyle,rvar; - char *c1str,*c2str,*rstr; + double lo, hi; + int c1style, c1var; + int c2style, c2var; + int rstyle, rvar; + char *c1str, *c2str, *rstr; void variable_check(); - }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_deprecated.h b/src/region_deprecated.h index 53027bcd70..6eeead8af3 100644 --- a/src/region_deprecated.h +++ b/src/region_deprecated.h @@ -33,9 +33,9 @@ class RegionDeprecated : public Region { virtual int inside(double, double, double) { return 0; } virtual int surface_interior(double *, double) { return 0; } virtual int surface_exterior(double *, double) { return 0; } - }; +}; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_intersect.h b/src/region_intersect.h index 0e99d85fbd..79b76563eb 100644 --- a/src/region_intersect.h +++ b/src/region_intersect.h @@ -35,16 +35,16 @@ class RegIntersect : public Region { void shape_update(); void pretransform(); void set_velocity(); - void length_restart_string(int&); + void length_restart_string(int &); void write_restart(FILE *); - int restart(char *, int&); + int restart(char *, int &); void reset_vel(); private: char **idsub; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_plane.h b/src/region_plane.h index 8d1d7d68ed..b28cebf9f7 100644 --- a/src/region_plane.h +++ b/src/region_plane.h @@ -33,11 +33,11 @@ class RegPlane : public Region { int surface_exterior(double *, double); private: - double xp,yp,zp; + double xp, yp, zp; double normal[3]; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_prism.h b/src/region_prism.h index f259929738..64ef977f43 100644 --- a/src/region_prism.h +++ b/src/region_prism.h @@ -35,22 +35,22 @@ class RegPrism : public Region { int surface_exterior(double *, double); private: - double xlo,xhi,ylo,yhi,zlo,zhi; - double xy,xz,yz; - double h[3][3],hinv[3][3]; + double xlo, xhi, ylo, yhi, zlo, zhi; + double xy, xz, yz; + double h[3][3], hinv[3][3]; int dimension; - double a[3],b[3],c[3]; // edge vectors of region - double clo[3],chi[3]; // opposite corners of prism - double face[6][3]; // unit normals of 6 prism faces - double corners[8][3]; // 8 corner pts of prism - int tri[12][3]; // 3 corner pts of 12 triangles (2 per face) + double a[3], b[3], c[3]; // edge vectors of region + double clo[3], chi[3]; // opposite corners of prism + double face[6][3]; // unit normals of 6 prism faces + double corners[8][3]; // 8 corner pts of prism + int tri[12][3]; // 3 corner pts of 12 triangles (2 per face) void find_nearest(double *, double &, double &, double &); int inside_tri(double *, double *, double *, double *, double *); double closest(double *, double *, double *, double); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_sphere.h b/src/region_sphere.h index 14dd09b977..69782100e2 100644 --- a/src/region_sphere.h +++ b/src/region_sphere.h @@ -36,20 +36,19 @@ class RegSphere : public Region { void set_velocity_shape(); void velocity_contact_shape(double *, double *); - private: - double xc,yc,zc; + double xc, yc, zc; double radius; - int xstyle,xvar; - int ystyle,yvar; - int zstyle,zvar; - int rstyle,rvar; - char *xstr,*ystr,*zstr,*rstr; + int xstyle, xvar; + int ystyle, yvar; + int zstyle, zvar; + int rstyle, rvar; + char *xstr, *ystr, *zstr, *rstr; void variable_check(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/region_union.h b/src/region_union.h index dbf5034d50..d633e3deb5 100644 --- a/src/region_union.h +++ b/src/region_union.h @@ -35,15 +35,16 @@ class RegUnion : public Region { void shape_update(); void pretransform(); void set_velocity(); - void length_restart_string(int&); + void length_restart_string(int &); void write_restart(FILE *); - int restart(char *, int&); + int restart(char *, int &); void reset_vel(); + private: char **idsub; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/replicate.h b/src/replicate.h index af508d44bf..e9995b120c 100644 --- a/src/replicate.h +++ b/src/replicate.h @@ -30,7 +30,7 @@ class Replicate : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/rerun.h b/src/rerun.h index d39201badc..17e00c6d62 100644 --- a/src/rerun.h +++ b/src/rerun.h @@ -30,7 +30,7 @@ class Rerun : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reset_atom_ids.h b/src/reset_atom_ids.h index e59c1df4ea..a5506a1153 100644 --- a/src/reset_atom_ids.h +++ b/src/reset_atom_ids.h @@ -28,7 +28,7 @@ class ResetIDs : public Command { public: struct AtomRvous { bigint ibin; - int proc,ilocal; + int proc, ilocal; double x[3]; }; @@ -46,7 +46,7 @@ class ResetIDs : public Command { void command(int, char **); private: - bigint binlo,binhi; + bigint binlo, binhi; // callback functions for rendezvous communication @@ -55,7 +55,7 @@ class ResetIDs : public Command { void sort(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/reset_mol_ids.h b/src/reset_mol_ids.h index b9d2752a5a..8e5f89099b 100644 --- a/src/reset_mol_ids.h +++ b/src/reset_mol_ids.h @@ -32,19 +32,19 @@ class ResetMolIDs : public Command { void create_computes(char *, char *); void reset(); -private: + private: std::string idfrag, idchunk; int nchunk; int groupbit; - int compressflag; // 1 = contiguous values for new IDs - int singleflag; // 0 = mol IDs of single atoms set to 0 - tagint offset; // offset for contiguous mol ID values + int compressflag; // 1 = contiguous values for new IDs + int singleflag; // 0 = mol IDs of single atoms set to 0 + tagint offset; // offset for contiguous mol ID values class ComputeFragmentAtom *cfa; class ComputeChunkAtom *cca; }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/respa.h b/src/respa.h index 127a1cae26..d0b989308a 100644 --- a/src/respa.h +++ b/src/respa.h @@ -26,18 +26,18 @@ namespace LAMMPS_NS { class Respa : public Integrate { public: - // public so Fixes, Pairs, Neighbor can see them - int nlevels; // number of rRESPA levels - // 0 = innermost level, nlevels-1 = outermost level - double *step; // timestep at each level - int *loop; // sub-cycling factor at each level - double cutoff[4]; // cutoff[0] and cutoff[1] = between inner and middle - // cutoff[2] and cutoff[3] = between middle and outer - // if no middle then 0,1 = 2,3 + // public so Fixes, Pairs, Neighbor can see them + int nlevels; // number of rRESPA levels + // 0 = innermost level, nlevels-1 = outermost level + double *step; // timestep at each level + int *loop; // sub-cycling factor at each level + double cutoff[4]; // cutoff[0] and cutoff[1] = between inner and middle + // cutoff[2] and cutoff[3] = between middle and outer + // if no middle then 0,1 = 2,3 - int level_bond,level_angle,level_dihedral; // level to compute forces at - int level_improper,level_pair,level_kspace; - int level_inner,level_middle,level_outer; + int level_bond, level_angle, level_dihedral; // level to compute forces at + int level_improper, level_pair, level_kspace; + int level_inner, level_middle, level_outer; int nhybrid_styles; // number of hybrid pair styles int *hybrid_level; // level to compute pair hybrid sub-style at @@ -58,11 +58,11 @@ class Respa : public Integrate { void copy_flevel_f(int); protected: - int triclinic; // 0 if domain is orthog, 1 if triclinic - int torqueflag,extraflag; + int triclinic; // 0 if domain is orthog, 1 if triclinic + int torqueflag, extraflag; - int *newton; // newton flag at each level - class FixRespa *fix_respa; // Fix to store the force level array + int *newton; // newton flag at each level + class FixRespa *fix_respa; // Fix to store the force level array virtual void recurse(int); void force_clear(int); @@ -70,7 +70,7 @@ class Respa : public Integrate { void set_compute_flags(int ilevel); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/run.h b/src/run.h index 4c5ed2facc..b4784b212c 100644 --- a/src/run.h +++ b/src/run.h @@ -30,7 +30,7 @@ class Run : public Command { void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/set.h b/src/set.h index e1bbbffb99..0ef1d95339 100644 --- a/src/set.h +++ b/src/set.h @@ -26,21 +26,21 @@ namespace LAMMPS_NS { class Set : public Command { public: - Set(class LAMMPS *lmp) : Command(lmp) {}; + Set(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); private: char *id; int *select; - int style,ivalue,newtype,count,index_custom; - int ximage,yimage,zimage,ximageflag,yimageflag,zimageflag; + int style, ivalue, newtype, count, index_custom; + int ximage, yimage, zimage, ximageflag, yimageflag, zimageflag; int cc_index; bigint nsubset; - double dvalue,xvalue,yvalue,zvalue,wvalue,fraction; + double dvalue, xvalue, yvalue, zvalue, wvalue, fraction; - int varflag,varflag1,varflag2,varflag3,varflag4; - int ivar1,ivar2,ivar3,ivar4; - double *vec1,*vec2,*vec3,*vec4; + int varflag, varflag1, varflag2, varflag3, varflag4; + int ivar1, ivar2, ivar3, ivar4; + double *vec1, *vec2, *vec3, *vec4; int discflag; @@ -51,7 +51,7 @@ class Set : public Command { void varparse(const char *, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/special.h b/src/special.h index b98beace90..8c47ce5617 100644 --- a/src/special.h +++ b/src/special.h @@ -25,9 +25,9 @@ class Special : protected Pointers { void build(); private: - int me,nprocs; + int me, nprocs; int maxall; - tagint **onetwo,**onethree,**onefour; + tagint **onetwo, **onethree, **onefour; // data used by rendezvous callback methods @@ -41,7 +41,7 @@ class Special : protected Pointers { }; struct PairRvous { - tagint atomID,partnerID; + tagint atomID, partnerID; }; // private methods @@ -65,7 +65,7 @@ class Special : protected Pointers { static int rendezvous_pairs(int, char *, int &, int *&, char *&, void *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/suffix.h b/src/suffix.h index 32b2a3ce40..a69128949f 100644 --- a/src/suffix.h +++ b/src/suffix.h @@ -17,15 +17,8 @@ namespace LAMMPS_NS { namespace Suffix { - enum { - NONE = 0, - OPT = 1<<0, - GPU = 1<<1, - OMP = 1<<2, - INTEL = 1<<3, - KOKKOS = 1<<4 - }; -} + enum { NONE = 0, OPT = 1 << 0, GPU = 1 << 1, OMP = 1 << 2, INTEL = 1 << 3, KOKKOS = 1 << 4 }; } +} // namespace LAMMPS_NS #endif diff --git a/src/table_file_reader.h b/src/table_file_reader.h index b6db23e6f8..db6cfc6d7b 100644 --- a/src/table_file_reader.h +++ b/src/table_file_reader.h @@ -20,17 +20,16 @@ #include "potential_file_reader.h" -namespace LAMMPS_NS -{ - class TableFileReader : public PotentialFileReader { - public: - TableFileReader(class LAMMPS *lmp, const std::string &filename, - const std::string &type, const int auto_convert = 0); - virtual ~TableFileReader(); +namespace LAMMPS_NS { +class TableFileReader : public PotentialFileReader { + public: + TableFileReader(class LAMMPS *lmp, const std::string &filename, const std::string &type, + const int auto_convert = 0); + virtual ~TableFileReader(); - char *find_section_start(const std::string &keyword); - }; + char *find_section_start(const std::string &keyword); +}; -} // namespace LAMMPS_NS +} // namespace LAMMPS_NS #endif diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 327d57c059..724730810e 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -22,50 +22,46 @@ #include -namespace LAMMPS_NS -{ - class TextFileReader { - std::string filetype; - bool closefp; - static constexpr int MAXLINE = 1024; - char line[MAXLINE]; - FILE *fp; +namespace LAMMPS_NS { +class TextFileReader { + std::string filetype; + bool closefp; + static constexpr int MAXLINE = 1024; + char line[MAXLINE]; + FILE *fp; - public: - bool ignore_comments; //!< Controls whether comments are ignored + public: + 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(const std::string &filename, const std::string &filetype); + TextFileReader(FILE *fp, const std::string &filetype); - ~TextFileReader(); + ~TextFileReader(); - void skip_line(); - char * next_line(int nparams = 0); + void skip_line(); + char *next_line(int nparams = 0); - void next_dvector(double * list, int n); - ValueTokenizer next_values(int nparams, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - }; + void next_dvector(double *list, int n); + ValueTokenizer next_values(int nparams, + const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); +}; - class FileReaderException : public std::exception { - std::string message; - public: - FileReaderException(const std::string &msg) : message(msg) { - } +class FileReaderException : public std::exception { + std::string message; - ~FileReaderException() throw() { - } + public: + FileReaderException(const std::string &msg) : message(msg) {} - virtual const char * what() const throw() { - return message.c_str(); - } - }; + ~FileReaderException() throw() {} - class EOFException : public FileReaderException { - public: - EOFException(const std::string &msg) : FileReaderException(msg) { - } - }; + virtual const char *what() const throw() { return message.c_str(); } +}; -} // namespace LAMMPS_NS +class EOFException : public FileReaderException { + public: + EOFException(const std::string &msg) : FileReaderException(msg) {} +}; + +} // namespace LAMMPS_NS #endif diff --git a/src/thermo.h b/src/thermo.h index a7e849ca51..b95b6d4eec 100644 --- a/src/thermo.h +++ b/src/thermo.h @@ -19,18 +19,18 @@ namespace LAMMPS_NS { class Thermo : protected Pointers { - friend class MinCG; // accesses compute_pe - friend class DumpNetCDF; // accesses thermo properties - friend class DumpNetCDFMPIIO; // accesses thermo properties + friend class MinCG; // accesses compute_pe + friend class DumpNetCDF; // accesses thermo properties + friend class DumpNetCDFMPIIO; // accesses thermo properties public: char *style; - int normflag; // 0 if do not normalize by atoms, 1 if normalize - int modified; // 1 if thermo_modify has been used, else 0 - int lostflag; // IGNORE,WARN,ERROR - int lostbond; // ditto for atoms in bonds + int normflag; // 0 if do not normalize by atoms, 1 if normalize + int modified; // 1 if thermo_modify has been used, else 0 + int lostflag; // IGNORE,WARN,ERROR + int lostbond; // ditto for atoms in bonds - enum {IGNORE,WARN,ERROR}; + enum { IGNORE, WARN, ERROR }; Thermo(class LAMMPS *, int, char **); ~Thermo(); @@ -46,62 +46,62 @@ class Thermo : protected Pointers { char **keyword; int *vtype; - int nfield,nfield_initial; + int nfield, nfield_initial; int me; char **format; char *format_line_user; - char *format_float_user,*format_int_user,*format_bigint_user; + char *format_float_user, *format_int_user, *format_bigint_user; char **format_column_user; - char *format_float_one_def,*format_float_multi_def; - char *format_int_one_def,*format_int_multi_def; + char *format_float_one_def, *format_float_multi_def; + char *format_int_one_def, *format_int_multi_def; char format_multi[128]; - char format_bigint_one_def[8],format_bigint_multi_def[8]; + char format_bigint_one_def[8], format_bigint_multi_def[8]; - int normvalue; // use this for normflag unless natoms = 0 - int normuserflag; // 0 if user has not set, 1 if has + int normvalue; // use this for normflag unless natoms = 0 + int normuserflag; // 0 if user has not set, 1 if has int normuser; int firststep; int lostbefore, warnbefore; - int flushflag,lineflag; + int flushflag, lineflag; - double last_tpcpu,last_spcpu; + double last_tpcpu, last_spcpu; double last_time; bigint last_step; bigint natoms; - // data used by routines that compute single values - int ivalue; // integer value to print - double dvalue; // double value to print - bigint bivalue; // big integer value to print - int ifield; // which field in thermo output is being computed - int *field2index; // which compute,fix,variable calcs this field - int *argindex1; // indices into compute,fix scalar,vector + // data used by routines that compute single values + int ivalue; // integer value to print + double dvalue; // double value to print + bigint bivalue; // big integer value to print + int ifield; // which field in thermo output is being computed + int *field2index; // which compute,fix,variable calcs this field + int *argindex1; // indices into compute,fix scalar,vector int *argindex2; - // data for keyword-specific Compute objects - // index = where they are in computes list - // id = ID of Compute objects - // Compute * = ptrs to the Compute objects - int index_temp,index_press_scalar,index_press_vector,index_pe; - char *id_temp,*id_press,*id_pe; - class Compute *temperature,*pressure,*pe; + // data for keyword-specific Compute objects + // index = where they are in computes list + // id = ID of Compute objects + // Compute * = ptrs to the Compute objects + int index_temp, index_press_scalar, index_press_vector, index_pe; + char *id_temp, *id_press, *id_pe; + class Compute *temperature, *pressure, *pe; int ncompute; // # of Compute objects called by thermo char **id_compute; // their IDs int *compute_which; // 0/1/2 if should call scalar,vector,array class Compute **computes; // list of ptrs to the Compute objects - int nfix; // # of Fix objects called by thermo - char **id_fix; // their IDs - class Fix **fixes; // list of ptrs to the Fix objects + int nfix; // # of Fix objects called by thermo + char **id_fix; // their IDs + class Fix **fixes; // list of ptrs to the Fix objects - int nvariable; // # of variables evaluated by thermo - char **id_variable; // list of variable names - int *variables; // list of Variable indices + int nvariable; // # of variables evaluated by thermo + char **id_variable; // list of variable names + int *variables; // list of Variable indices // private methods @@ -115,11 +115,11 @@ class Thermo : protected Pointers { typedef void (Thermo::*FnPtr)(); void addfield(const char *, FnPtr, int); - FnPtr *vfunc; // list of ptrs to functions + FnPtr *vfunc; // list of ptrs to functions void call_vfunc(int ifield); - void compute_compute(); // functions that compute a single value - void compute_fix(); // via calls to Compute,Fix,Variable classes + void compute_compute(); // functions that compute a single value + void compute_fix(); // via calls to Compute,Fix,Variable classes void compute_variable(); // functions that compute a single value @@ -206,7 +206,7 @@ class Thermo : protected Pointers { void compute_cellgamma(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/timer.h b/src/timer.h index 278ac1c65c..8a9c4d617c 100644 --- a/src/timer.h +++ b/src/timer.h @@ -16,24 +16,41 @@ #include "pointers.h" - namespace LAMMPS_NS { class Timer : protected Pointers { public: - - enum ttype {RESET=-2,START=-1,TOTAL=0,PAIR,BOND,KSPACE,NEIGH,COMM, - MODIFY,OUTPUT,SYNC,ALL,DEPHASE,DYNAMICS,QUENCH,NEB,REPCOMM, - REPOUT,NUM_TIMER}; - enum tlevel {OFF=0,LOOP,NORMAL,FULL}; + enum ttype { + RESET = -2, + START = -1, + TOTAL = 0, + PAIR, + BOND, + KSPACE, + NEIGH, + COMM, + MODIFY, + OUTPUT, + SYNC, + ALL, + DEPHASE, + DYNAMICS, + QUENCH, + NEB, + REPCOMM, + REPOUT, + NUM_TIMER + }; + enum tlevel { OFF = 0, LOOP, NORMAL, FULL }; Timer(class LAMMPS *); - ~Timer() {}; + ~Timer(){}; void init(); // inline function to reduce overhead if we want no detailed timings - void stamp(enum ttype which=START) { + void stamp(enum ttype which = START) + { if (_level > LOOP) _stamp(which); } @@ -42,10 +59,10 @@ class Timer : protected Pointers { // accessor methods for supported level of detail - bool has_loop() const { return (_level >= LOOP); } + bool has_loop() const { return (_level >= LOOP); } bool has_normal() const { return (_level >= NORMAL); } - bool has_full() const { return (_level >= FULL); } - bool has_sync() const { return (_sync != OFF); } + bool has_full() const { return (_level >= FULL); } + bool has_sync() const { return (_sync != OFF); } // flag if wallclock time is expired bool is_timeout() const { return (_timeout == 0.0); } @@ -53,10 +70,8 @@ class Timer : protected Pointers { double elapsed(enum ttype); double cpu(enum ttype); - double get_cpu(enum ttype which) const { - return cpu_array[which]; }; - double get_wall(enum ttype which) const { - return wall_array[which]; }; + double get_cpu(enum ttype which) const { return cpu_array[which]; }; + double get_wall(enum ttype which) const { return wall_array[which]; }; void set_wall(enum ttype, double); @@ -77,10 +92,13 @@ class Timer : protected Pointers { // check for timeout. inline wrapper around internal // function to reduce overhead in case there is no check. - bool check_timeout(int step) { + bool check_timeout(int step) + { if (_timeout == 0.0) return true; - if (_nextcheck != step) return false; - else return _check_timeout(); + if (_nextcheck != step) + return false; + else + return _check_timeout(); } void modify_params(int, char **); @@ -91,12 +109,12 @@ class Timer : protected Pointers { double previous_cpu; double previous_wall; double timeout_start; - int _level; // level of detail: off=0,loop=1,normal=2,full=3 - int _sync; // if nonzero, synchronize tasks before setting the timer - int _timeout; // max allowed wall time in seconds. infinity if negative - int _s_timeout; // copy of timeout for restoring after a forced timeout - int _checkfreq; // frequency of timeout checking - int _nextcheck; // loop number of next timeout check + int _level; // level of detail: off=0,loop=1,normal=2,full=3 + int _sync; // if nonzero, synchronize tasks before setting the timer + int _timeout; // max allowed wall time in seconds. infinity if negative + int _s_timeout; // copy of timeout for restoring after a forced timeout + int _checkfreq; // frequency of timeout checking + int _nextcheck; // loop number of next timeout check // update one specific timer array void _stamp(enum ttype); @@ -105,7 +123,7 @@ class Timer : protected Pointers { bool _check_timeout(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/tokenizer.h b/src/tokenizer.h index 8cc6d2d42b..af99310b26 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -20,98 +20,102 @@ #include "lmptype.h" -#include // IWYU pragma: export -#include // IWYU pragma: export -#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export namespace LAMMPS_NS { #define TOKENIZER_DEFAULT_SEPARATORS " \t\r\n\f" class Tokenizer { - std::string text; - std::string separators; - size_t start; - size_t ntokens; -public: - Tokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - Tokenizer(Tokenizer &&); - Tokenizer(const Tokenizer &); - Tokenizer& operator=(const Tokenizer&); - Tokenizer& operator=(Tokenizer&&); - void swap(Tokenizer &); + std::string text; + std::string separators; + size_t start; + size_t ntokens; - void reset(); - void skip(int n=1); - bool has_next() const; - bool contains(const std::string &str) const; - std::string next(); + public: + Tokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); + Tokenizer(Tokenizer &&); + Tokenizer(const Tokenizer &); + Tokenizer &operator=(const Tokenizer &); + Tokenizer &operator=(Tokenizer &&); + void swap(Tokenizer &); - size_t count(); - std::vector as_vector(); + void reset(); + void skip(int n = 1); + bool has_next() const; + bool contains(const std::string &str) const; + std::string next(); + + size_t count(); + std::vector as_vector(); }; class TokenizerException : public std::exception { std::string message; -public: + + public: /** Thrown during retrieving or skipping tokens * * \param msg String with error message * \param token String of the token/word that caused the error */ TokenizerException(const std::string &msg, const std::string &token); - ~TokenizerException() throw() { - } + ~TokenizerException() throw() {} /** Retrieve message describing the thrown exception * \return string with error message */ - virtual const char * what() const throw() { - return message.c_str(); - } + virtual const char *what() const throw() { return message.c_str(); } }; class InvalidIntegerException : public TokenizerException { -public: + public: /** Thrown during converting string to integer number * * \param token String of the token/word that caused the error */ - InvalidIntegerException(const std::string &token) - : TokenizerException("Not a valid integer number", token) {} + InvalidIntegerException(const std::string &token) : + TokenizerException("Not a valid integer number", token) + { + } }; class InvalidFloatException : public TokenizerException { -public: + public: /** Thrown during converting string to floating point number * * \param token String of the token/word that caused the error */ - InvalidFloatException(const std::string &token) - : TokenizerException("Not a valid floating-point number", token) {} + InvalidFloatException(const std::string &token) : + TokenizerException("Not a valid floating-point number", token) + { + } }; class ValueTokenizer { - Tokenizer tokens; -public: - ValueTokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); - ValueTokenizer(const ValueTokenizer &); - ValueTokenizer(ValueTokenizer &&); - ValueTokenizer& operator=(const ValueTokenizer&); - ValueTokenizer& operator=(ValueTokenizer&&); - void swap(ValueTokenizer &); + Tokenizer tokens; - std::string next_string(); - tagint next_tagint(); - bigint next_bigint(); - int next_int(); - double next_double(); + public: + ValueTokenizer(const std::string &str, + const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); + ValueTokenizer(const ValueTokenizer &); + ValueTokenizer(ValueTokenizer &&); + ValueTokenizer &operator=(const ValueTokenizer &); + ValueTokenizer &operator=(ValueTokenizer &&); + void swap(ValueTokenizer &); - bool has_next() const; - bool contains(const std::string &value) const; - void skip(int ntokens=1); + std::string next_string(); + tagint next_tagint(); + bigint next_bigint(); + int next_int(); + double next_double(); - size_t count(); + bool has_next() const; + bool contains(const std::string &value) const; + void skip(int ntokens = 1); + + size_t count(); }; - -} +} // namespace LAMMPS_NS #endif diff --git a/src/universe.h b/src/universe.h index aca644ea4c..2abf2e36bc 100644 --- a/src/universe.h +++ b/src/universe.h @@ -20,21 +20,21 @@ namespace LAMMPS_NS { class Universe : protected Pointers { public: - MPI_Comm uworld; // communicator for entire universe - int me,nprocs; // my place in universe + MPI_Comm uworld; // communicator for entire universe + int me, nprocs; // my place in universe - FILE *uscreen; // universe screen output - FILE *ulogfile; // universe logfile + FILE *uscreen; // universe screen output + FILE *ulogfile; // universe logfile - int existflag; // 1 if universe exists due to -partition flag - int nworlds; // # of worlds in universe - int iworld; // which world I am in - int *procs_per_world; // # of procs in each world - int *root_proc; // root proc in each world + int existflag; // 1 if universe exists due to -partition flag + int nworlds; // # of worlds in universe + int iworld; // which world I am in + int *procs_per_world; // # of procs in each world + int *root_proc; // root proc in each world - MPI_Comm uorig; // original communicator passed to LAMMPS instance - int *uni2orig; // proc I in universe uworld is - // proc uni2orig[I] in original communicator + MPI_Comm uorig; // original communicator passed to LAMMPS instance + int *uni2orig; // proc I in universe uworld is + // proc uni2orig[I] in original communicator Universe(class LAMMPS *, MPI_Comm); ~Universe(); @@ -43,7 +43,7 @@ class Universe : protected Pointers { int consistent(); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/update.h b/src/update.h index 86a9268536..972a0cbae5 100644 --- a/src/update.h +++ b/src/update.h @@ -22,25 +22,25 @@ namespace LAMMPS_NS { class Update : protected Pointers { public: - double dt; // timestep - double etol,ftol; // minimizer tolerances on energy/force - bigint ntimestep; // current step (dynamics or min iterations) - int nsteps; // # of steps to run (dynamics or min iter) - int whichflag; // 0 for unset, 1 for dynamics, 2 for min - double atime; // simulation time at atime_step - bigint atimestep; // last timestep atime was updated - bigint firststep,laststep; // 1st & last step of this run - bigint beginstep,endstep; // 1st and last step of multiple runs - int first_update; // 0 before initial update, 1 after - int max_eval; // max force evaluations for minimizer - int restrict_output; // 1 if output should not write dump/restart - int setupflag; // set when setup() is computing forces - int post_integrate; // 1 if now at post_integrate() in timestep - int multireplica; // 1 if min across replicas, else 0 - int dt_default; // 1 if dt is at default value, else 0 + double dt; // timestep + double etol, ftol; // minimizer tolerances on energy/force + bigint ntimestep; // current step (dynamics or min iterations) + int nsteps; // # of steps to run (dynamics or min iter) + int whichflag; // 0 for unset, 1 for dynamics, 2 for min + double atime; // simulation time at atime_step + bigint atimestep; // last timestep atime was updated + bigint firststep, laststep; // 1st & last step of this run + bigint beginstep, endstep; // 1st and last step of multiple runs + int first_update; // 0 before initial update, 1 after + int max_eval; // max force evaluations for minimizer + int restrict_output; // 1 if output should not write dump/restart + int setupflag; // set when setup() is computing forces + int post_integrate; // 1 if now at post_integrate() in timestep + int multireplica; // 1 if min across replicas, else 0 + int dt_default; // 1 if dt is at default value, else 0 - bigint eflag_global,eflag_atom; // timestep global/peratom eng is tallied on - bigint vflag_global,vflag_atom; // ditto for virial + bigint eflag_global, eflag_atom; // timestep global/peratom eng is tallied on + bigint vflag_global, vflag_atom; // ditto for virial char *unit_style; @@ -50,11 +50,11 @@ class Update : protected Pointers { class Min *minimize; char *minimize_style; - typedef Integrate *(*IntegrateCreator)(LAMMPS *,int,char**); + typedef Integrate *(*IntegrateCreator)(LAMMPS *, int, char **); typedef Min *(*MinimizeCreator)(LAMMPS *); - typedef std::map IntegrateCreatorMap; - typedef std::map MinimizeCreatorMap; + typedef std::map IntegrateCreatorMap; + typedef std::map MinimizeCreatorMap; IntegrateCreatorMap *integrate_map; MinimizeCreatorMap *minimize_map; @@ -78,7 +78,7 @@ class Update : protected Pointers { template static Min *minimize_creator(LAMMPS *); }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/utils.h b/src/utils.h index 355d98fd3a..e8df2f9115 100644 --- a/src/utils.h +++ b/src/utils.h @@ -16,8 +16,8 @@ /*! \file utils.h */ -#include "lmptype.h" #include "fmt/format.h" +#include "lmptype.h" #include @@ -27,34 +27,33 @@ namespace LAMMPS_NS { - // forward declarations - class Error; - class LAMMPS; +// forward declarations +class Error; +class LAMMPS; - namespace utils { +namespace utils { - /** Match text against a simplified regex pattern + /** Match text against a simplified regex pattern * * \param text the text to be matched against the pattern * \param pattern the search pattern, which may contain regexp markers * \return true if the pattern matches, false if not */ - bool strmatch(const std::string &text, const std::string &pattern); + bool strmatch(const std::string &text, const std::string &pattern); - /** Find sub-string that matches a simplified regex pattern + /** Find sub-string that matches a simplified regex pattern * * \param text the text to be matched against the pattern * \param pattern the search pattern, which may contain regexp markers * \return the string that matches the patters or an empty one */ - std::string strfind(const std::string &text, const std::string &pattern); + std::string strfind(const std::string &text, const std::string &pattern); - /* Internal function handling the argument list for logmesg(). */ + /* Internal function handling the argument list for logmesg(). */ - void fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, - fmt::format_args args); + void fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, fmt::format_args args); - /** Send formatted message to screen and logfile, if available + /** Send formatted message to screen and logfile, if available * * This function simplifies the repetitive task of outputting some * message to both the screen and/or the log file. The template @@ -65,28 +64,27 @@ namespace LAMMPS_NS { * \param format format string of message to be printed * \param args arguments to format string */ - template - void logmesg(LAMMPS *lmp, const S &format, Args&&... args) { - fmtargs_logmesg(lmp, format, - fmt::make_args_checked(format, args...)); - } + template void logmesg(LAMMPS *lmp, const S &format, Args &&...args) + { + fmtargs_logmesg(lmp, format, fmt::make_args_checked(format, args...)); + } - /** \overload + /** \overload * * \param lmp pointer to LAMMPS class instance * \param mesg string with message to be printed */ - void logmesg(LAMMPS *lmp, const std::string &mesg); + void logmesg(LAMMPS *lmp, const std::string &mesg); - /** Return a string representing the current system error status + /** Return a string representing the current system error status * * This is a wrapper around calling strerror(errno). * * \return error string */ - std::string getsyserror(); + std::string getsyserror(); - /** Wrapper around fgets() which reads whole lines but truncates the + /** Wrapper around fgets() which reads whole lines but truncates the * data to the buffer size and ensures a newline char at the end. * * This function is useful for reading line based text files with @@ -98,9 +96,9 @@ namespace LAMMPS_NS { * \param size size of buffer s (max number of bytes returned) * \param fp file pointer used by fgets() */ - char *fgets_trunc(char *s, int size, FILE *fp); + char *fgets_trunc(char *s, int size, FILE *fp); - /** Safe wrapper around fgets() which aborts on errors + /** Safe wrapper around fgets() which aborts on errors * or EOF and prints a suitable error message to help debugging. * * Use nullptr as the error parameter to avoid the abort on EOF or error. @@ -113,10 +111,10 @@ namespace LAMMPS_NS { * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) or nullptr */ - void sfgets(const char *srcname, int srcline, char *s, int size, - FILE *fp, const char *filename, Error *error); + void sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, const char *filename, + Error *error); - /** Safe wrapper around fread() which aborts on errors + /** Safe wrapper around fread() which aborts on errors * or EOF and prints a suitable error message to help debugging. * * Use nullptr as the error parameter to avoid the abort on EOF or error. @@ -130,10 +128,10 @@ namespace LAMMPS_NS { * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) * \param error pointer to Error class instance (for abort) or nullptr */ - void sfread(const char *srcname, int srcline, void *s, size_t size, - size_t num, FILE *fp, const char *filename, Error *error); + void sfread(const char *srcname, int srcline, void *s, size_t size, size_t num, FILE *fp, + const char *filename, Error *error); - /** Read N lines of text from file into buffer and broadcast them + /** Read N lines of text from file into buffer and broadcast them * * This function uses repeated calls to fread() to fill a buffer with * newline terminated text. If a line does not end in a newline (e.g. @@ -150,20 +148,19 @@ namespace LAMMPS_NS { * \param comm MPI communicator for broadcast * \return 1 if the read was short, 0 if read was successful */ - int read_lines_from_file(FILE *fp, int nlines, int nmax, - char *buffer, int me, MPI_Comm comm); + int read_lines_from_file(FILE *fp, int nlines, int nmax, char *buffer, int me, MPI_Comm comm); - /** Report if a requested style is in a package or may have a typo + /** Report if a requested style is in a package or may have a typo * * \param style type of style that is to be checked for * \param name name of style that was not found * \param lmp pointer to top-level LAMMPS class instance * \return string usable for error messages */ - std::string check_packages_for_style(const std::string &style, - const std::string &name, LAMMPS *lmp); + std::string check_packages_for_style(const std::string &style, const std::string &name, + LAMMPS *lmp); - /** Convert a string to a floating point number while checking + /** Convert a string to a floating point number while checking * if it is a valid floating point or integer number * * \param file name of source file for error message @@ -173,10 +170,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return double precision floating point number */ - double numeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + double numeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Convert a string to an integer number while checking + /** Convert a string to an integer number while checking * if it is a valid integer number (regular int) * * \param file name of source file for error message @@ -186,10 +182,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return integer number (regular int) */ - int inumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + int inumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Convert a string to an integer number while checking + /** Convert a string to an integer number while checking * if it is a valid integer number (bigint) * * \param file name of source file for error message @@ -199,10 +194,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return integer number (bigint) */ - bigint bnumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + bigint bnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Convert a string to an integer number while checking + /** Convert a string to an integer number while checking * if it is a valid integer number (tagint) * * \param file name of source file for error message @@ -212,10 +206,9 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return integer number (tagint) */ - tagint tnumeric(const char *file, int line, const char *str, - bool do_abort, LAMMPS *lmp); + tagint tnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** Compute index bounds derived from a string with a possible wildcard + /** Compute index bounds derived from a string with a possible wildcard * * This functions processes the string in *str* and set the values of *nlo* * and *nhi* according to the following five cases: @@ -235,11 +228,11 @@ namespace LAMMPS_NS { * \param nhi upper bound * \param error pointer to Error class for out-of-bounds messages */ - template - void bounds(const char *file, int line, const std::string &str, - bigint nmin, bigint nmax, TYPE &nlo, TYPE &nhi, Error *error); + template + void bounds(const char *file, int line, const std::string &str, bigint nmin, bigint nmax, + TYPE &nlo, TYPE &nhi, Error *error); - /** Expand list of arguments when containing fix/compute wildcards + /** Expand list of arguments when containing fix/compute wildcards * * This function searches the list of arguments in *arg* for strings * of the kind c_ID[*] or f_ID[*] referring to computes or fixes. @@ -264,10 +257,10 @@ namespace LAMMPS_NS { * \param lmp pointer to top-level LAMMPS class instance * \return number of arguments in expanded list */ - int expand_args(const char *file, int line, int narg, char **arg, - int mode, char **&earg, LAMMPS *lmp); + int expand_args(const char *file, int line, int narg, char **arg, int mode, char **&earg, + LAMMPS *lmp); - /** Make C-style copy of string in new storage + /** Make C-style copy of string in new storage * * This allocates a storage buffer and copies the C-style or * C++ style string into it. The buffer is allocated with "new" @@ -276,23 +269,23 @@ namespace LAMMPS_NS { * \param text string that should be copied * \return new buffer with copy of string */ - char *strdup(const std::string &text); + char *strdup(const std::string &text); - /** Trim leading and trailing whitespace. Like TRIM() in Fortran. + /** Trim leading and trailing whitespace. Like TRIM() in Fortran. * * \param line string that should be trimmed * \return new string without whitespace (string) */ - std::string trim(const std::string &line); + std::string trim(const std::string &line); - /** Return string with anything from '#' onward removed + /** Return string with anything from '#' onward removed * * \param line string that should be trimmed * \return new string without comment (string) */ - std::string trim_comment(const std::string &line); + std::string trim_comment(const std::string &line); - /** Check if a string will likely have UTF-8 encoded characters + /** Check if a string will likely have UTF-8 encoded characters * * UTF-8 uses the 7-bit standard ASCII table for the first 127 characters and * all other characters are encoded as multiple bytes. For the multi-byte @@ -316,13 +309,14 @@ namespace LAMMPS_NS { * \param line string that should be checked * \return true if string contains UTF-8 encoded characters (bool) */ - inline bool has_utf8(const std::string &line) - { - for (auto c : line) if (c & 0x80U) return true; - return false; - } + inline bool has_utf8(const std::string &line) + { + for (auto c : line) + if (c & 0x80U) return true; + return false; + } - /** Replace known UTF-8 characters with ASCII equivalents + /** Replace known UTF-8 characters with ASCII equivalents * \verbatim embed:rst @@ -333,39 +327,39 @@ namespace LAMMPS_NS { * \param line string that should be converted * \return new string with ascii replacements (string) */ - std::string utf8_subst(const std::string &line); + std::string utf8_subst(const std::string &line); - /** Count words in string with custom choice of separating characters + /** Count words in string with custom choice of separating characters * * \param text string that should be searched * \param separators string containing characters that will be treated as whitespace * \return number of words found */ - size_t count_words(const std::string &text, const std::string &separators); + size_t count_words(const std::string &text, const std::string &separators); - /** Count words in string, ignore any whitespace matching " \t\r\n\f" + /** Count words in string, ignore any whitespace matching " \t\r\n\f" * * \param text string that should be searched * \return number of words found */ - size_t count_words(const std::string &text); + size_t count_words(const std::string &text); - /** Count words in C-string, ignore any whitespace matching " \t\r\n\f" + /** Count words in C-string, ignore any whitespace matching " \t\r\n\f" * * \param text string that should be searched * \return number of words found */ - size_t count_words(const char *text); + size_t count_words(const char *text); - /** Count words in a single line, trim anything from '#' onward + /** Count words in a single line, trim anything from '#' onward * * \param text string that should be trimmed and searched * \param separators string containing characters that will be treated as whitespace * \return number of words found */ - size_t trim_and_count_words(const std::string &text, const std::string &separators = " \t\r\n\f"); + size_t trim_and_count_words(const std::string &text, const std::string &separators = " \t\r\n\f"); - /** Take text and split into non-whitespace words. + /** Take text and split into non-whitespace words. * * This can handle strings with single and double quotes, escaped quotes, * and escaped codes within quotes, but due to using an STL container and @@ -382,37 +376,37 @@ namespace LAMMPS_NS { * \param text string that should be split * \return STL vector with the words */ - std::vector split_words(const std::string &text); + std::vector split_words(const std::string &text); - /** Take multi-line text and split into lines + /** Take multi-line text and split into lines * * \param text string that should be split * \return STL vector with the lines */ - std::vector split_lines(const std::string &text); + std::vector split_lines(const std::string &text); - /** Check if string can be converted to valid integer + /** Check if string can be converted to valid integer * * \param str string that should be checked * \return true, if string contains valid a integer, false otherwise */ - bool is_integer(const std::string &str); + bool is_integer(const std::string &str); - /** Check if string can be converted to valid floating-point number + /** Check if string can be converted to valid floating-point number * * \param str string that should be checked * \return true, if string contains valid number, false otherwise */ - bool is_double(const std::string &str); + bool is_double(const std::string &str); - /** Check if string is a valid ID + /** Check if string is a valid ID * ID strings may contain only letters, numbers, and underscores. * * \param str string that should be checked * \return true, if string contains valid id, false otherwise */ - bool is_id(const std::string &str); + bool is_id(const std::string &str); - /** Try to detect pathname from FILE pointer. + /** Try to detect pathname from FILE pointer. * * Currently only supported on Linux, otherwise will report "(unknown)". * @@ -421,23 +415,23 @@ namespace LAMMPS_NS { * \param fp FILE pointer struct from STDIO library for which we want to detect the name * \return pointer to the storage buffer, i.e. buf */ - const char *guesspath(char *buf, int len, FILE *fp); + const char *guesspath(char *buf, int len, FILE *fp); - /** Strip off leading part of path, return just the filename + /** Strip off leading part of path, return just the filename * * \param path file path * \return file name */ - std::string path_basename(const std::string &path); + std::string path_basename(const std::string &path); - /** Return the directory part of a path. Return "." if empty + /** Return the directory part of a path. Return "." if empty * * \param path file path * \return directory name */ - std::string path_dirname(const std::string &path); + std::string path_dirname(const std::string &path); - /** Join two pathname segments + /** Join two pathname segments * * This uses the forward slash '/' character unless LAMMPS is compiled * for Windows where it used the equivalent backward slash '\\'. @@ -446,59 +440,57 @@ namespace LAMMPS_NS { * \param b second path * \return combined path */ - std::string path_join(const std::string &a, const std::string &b); + std::string path_join(const std::string &a, const std::string &b); - /** Check if file exists and is readable + /** Check if file exists and is readable * * \param path file path * \return true if file exists and is readable */ - bool file_is_readable(const std::string &path); + bool file_is_readable(const std::string &path); - /** Determine full path of potential file. If file is not found in current directory, + /** Determine full path of potential file. If file is not found in current directory, * search directories listed in LAMMPS_POTENTIALS environment variable * * \param path file path * \return full path to potential file */ - std::string get_potential_file_path(const std::string &path); + std::string get_potential_file_path(const std::string &path); - /** Read potential file and return DATE field if it is present + /** Read potential file and return DATE field if it is present * * \param path file path * \param potential_name name of potential that is being read * \return DATE field if present */ - std::string get_potential_date(const std::string &path, - const std::string &potential_name); + std::string get_potential_date(const std::string &path, const std::string &potential_name); - /** Read potential file and return UNITS field if it is present + /** Read potential file and return UNITS field if it is present * * \param path file path * \param potential_name name of potential that is being read * \return UNITS field if present */ - std::string get_potential_units(const std::string &path, - const std::string &potential_name); + std::string get_potential_units(const std::string &path, const std::string &potential_name); - enum { NOCONVERT = 0, METAL2REAL = 1, REAL2METAL = 1<<1 }; - enum { UNKNOWN = 0, ENERGY }; + enum { NOCONVERT = 0, METAL2REAL = 1, REAL2METAL = 1 << 1 }; + enum { UNKNOWN = 0, ENERGY }; - /** Return bitmask of available conversion factors for a given property + /** Return bitmask of available conversion factors for a given property * * \param property property to be converted * \return bitmask indicating available conversions */ - int get_supported_conversions(const int property); + int get_supported_conversions(const int property); - /** Return unit conversion factor for given property and selected from/to units + /** Return unit conversion factor for given property and selected from/to units * * \param property property to be converted * \param conversion constant indicating the conversion * \return conversion factor */ - double get_conversion_factor(const int property, const int conversion); + double get_conversion_factor(const int property, const int conversion); - /** Open a potential file as specified by *name* + /** Open a potential file as specified by *name* * * If opening the file directly fails, the function will search for * it in the list of folder pointed to by the environment variable @@ -519,18 +511,18 @@ namespace LAMMPS_NS { * \param auto_convert pointer to unit conversion bitmask or ``nullptr`` * \return FILE pointer of the opened potential file or ``nullptr`` */ - FILE *open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert); + FILE *open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert); - /** Convert a time string to seconds + /** Convert a time string to seconds * * The strings "off" and "unlimited" result in -1 * * \param timespec a string in the following format: ([[HH:]MM:]SS) * \return total in seconds */ - double timespec2seconds(const std::string ×pec); + double timespec2seconds(const std::string ×pec); - /** Convert a LAMMPS version date to a number + /** Convert a LAMMPS version date to a number * * This will generate a number YYYYMMDD from a date string * (with or without blanks) that is suitable for numerical @@ -545,9 +537,9 @@ namespace LAMMPS_NS { * * \param date string in the format (Day Month Year) * \return date code */ - int date2num(const std::string &date); + int date2num(const std::string &date); - /** Custom merge sort implementation + /** Custom merge sort implementation * * This function provides a custom upward hybrid merge sort * implementation with support to pass an opaque pointer to @@ -562,10 +554,9 @@ namespace LAMMPS_NS { * \param ptr Pointer to opaque object passed to comparison function * \param comp Pointer to comparison function */ - void merge_sort(int *index, int num, void *ptr, - int (*comp)(int, int, void *)); - } -} + void merge_sort(int *index, int num, void *ptr, int (*comp)(int, int, void *)); +} // namespace utils +} // namespace LAMMPS_NS #endif diff --git a/src/variable.h b/src/variable.h index 2c63790ea9..d87e4ae637 100644 --- a/src/variable.h +++ b/src/variable.h @@ -19,7 +19,8 @@ namespace LAMMPS_NS { class Variable : protected Pointers { - friend class Info; + friend class Info; + public: Variable(class LAMMPS *); ~Variable(); @@ -50,58 +51,74 @@ class Variable : protected Pointers { double evaluate_boolean(char *); public: - int nvar; // # of defined variables - char **names; // name of each variable + int nvar; // # of defined variables + char **names; // name of each variable // must match "varstyles" array in info.cpp - enum{INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,GETENV, - SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,VECTOR,PYTHON,INTERNAL}; + enum { + INDEX, + LOOP, + WORLD, + UNIVERSE, + ULOOP, + STRING, + GETENV, + SCALARFILE, + ATOMFILE, + FORMAT, + EQUAL, + ATOM, + VECTOR, + PYTHON, + INTERNAL + }; private: int me; - int maxvar; // max # of variables following lists can hold - int *style; // style of each variable - int *num; // # of values for each variable - int *which; // next available value for each variable - int *pad; // 1 = pad loop/uloop variables with 0s, 0 = no pad - class VarReader **reader; // variable that reads from file - char ***data; // str value of each variable's values - double *dvalue; // single numeric value for internal variables + int maxvar; // max # of variables following lists can hold + int *style; // style of each variable + int *num; // # of values for each variable + int *which; // next available value for each variable + int *pad; // 1 = pad loop/uloop variables with 0s, 0 = no pad + class VarReader **reader; // variable that reads from file + char ***data; // str value of each variable's values + double *dvalue; // single numeric value for internal variables struct VecVar { - int n,nmax; + int n, nmax; bigint currentstep; double *values; }; VecVar *vecs; - int *eval_in_progress; // flag if evaluation of variable is in progress - int treetype; // ATOM or VECTOR flag for formula evaluation + int *eval_in_progress; // flag if evaluation of variable is in progress + int treetype; // ATOM or VECTOR flag for formula evaluation - class RanMars *randomequal; // random number generator for equal-style vars - class RanMars *randomatom; // random number generator for atom-style vars + class RanMars *randomequal; // random number generator for equal-style vars + class RanMars *randomatom; // random number generator for atom-style vars - int precedence[18]; // precedence level of math operators - // set length to include up to XOR in enum + int precedence[18]; // precedence level of math operators + // set length to include up to XOR in enum - struct Tree { // parse tree for atom-style or vector-style vars - double value; // single scalar - double *array; // per-atom or per-type list of doubles - int *iarray; // per-atom list of ints - bigint *barray; // per-atom list of bigints - int type; // operation, see enum{} in variable.cpp - int nvector; // length of array for vector-style variable - int nstride; // stride between atoms if array is a 2d array - int selfalloc; // 1 if array is allocated here, else 0 - int ivalue1,ivalue2; // extra values needed for gmask,rmask,grmask - int nextra; // # of additional args beyond first 2 - Tree *first,*second; // ptrs further down tree for first 2 args - Tree **extra; // ptrs further down tree for nextra args + struct Tree { // parse tree for atom-style or vector-style vars + double value; // single scalar + double *array; // per-atom or per-type list of doubles + int *iarray; // per-atom list of ints + bigint *barray; // per-atom list of bigints + int type; // operation, see enum{} in variable.cpp + int nvector; // length of array for vector-style variable + int nstride; // stride between atoms if array is a 2d array + int selfalloc; // 1 if array is allocated here, else 0 + int ivalue1, ivalue2; // extra values needed for gmask,rmask,grmask + int nextra; // # of additional args beyond first 2 + Tree *first, *second; // ptrs further down tree for first 2 args + Tree **extra; // ptrs further down tree for nextra args Tree() : - array(nullptr), iarray(nullptr), barray(nullptr), - selfalloc(0), ivalue1(0), ivalue2(0), nextra(0), - first(nullptr), second(nullptr), extra(nullptr) {} + array(nullptr), iarray(nullptr), barray(nullptr), selfalloc(0), ivalue1(0), ivalue2(0), + nextra(0), first(nullptr), second(nullptr), extra(nullptr) + { + } }; int compute_python(int); @@ -115,21 +132,16 @@ class Variable : protected Pointers { int compare_tree_vector(int, int); void free_tree(Tree *); int find_matching_paren(char *, int, char *&, int); - int math_function(char *, char *, Tree **, Tree **, - int &, double *, int &, int); - int group_function(char *, char *, Tree **, Tree **, - int &, double *, int &, int); + int math_function(char *, char *, Tree **, Tree **, int &, double *, int &, int); + int group_function(char *, char *, Tree **, Tree **, int &, double *, int &, int); int region_function(char *, int); - int special_function(char *, char *, Tree **, Tree **, - int &, double *, int &, int); - void peratom2global(int, char *, double *, int, tagint, - Tree **, Tree **, int &, double *, int &); + int special_function(char *, char *, Tree **, Tree **, int &, double *, int &, int); + void peratom2global(int, char *, double *, int, tagint, Tree **, Tree **, int &, double *, int &); int is_atom_vector(char *); void atom_vector(char *, Tree **, Tree **, int &); int parse_args(char *, char **); char *find_next_comma(char *); - void print_var_error(const std::string &, int, const std::string &, - int, int global=1); + void print_var_error(const std::string &, int, const std::string &, int, int global = 1); void print_tree(Tree *, int); }; @@ -144,12 +156,12 @@ class VarReader : protected Pointers { int read_peratom(); private: - int me,style; + int me, style; FILE *fp; char *buffer; }; -} +} // namespace LAMMPS_NS #endif diff --git a/src/velocity.h b/src/velocity.h index bc3ba9b705..8f91262e86 100644 --- a/src/velocity.h +++ b/src/velocity.h @@ -33,11 +33,11 @@ class Velocity : public Command { void create(double, int); private: - int igroup,groupbit; + int igroup, groupbit; int style; - int dist_flag,sum_flag,momentum_flag,rotation_flag; - int bias_flag,loop_flag,scale_flag,rfix; - double xscale,yscale,zscale; + int dist_flag, sum_flag, momentum_flag, rotation_flag; + int bias_flag, loop_flag, scale_flag, rfix; + double xscale, yscale, zscale; class Compute *temperature; void set(int, char **); @@ -50,7 +50,7 @@ class Velocity : public Command { void zero_rotation(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/verlet.h b/src/verlet.h index acd30edc44..d51e9e9201 100644 --- a/src/verlet.h +++ b/src/verlet.h @@ -35,13 +35,13 @@ class Verlet : public Integrate { void cleanup(); protected: - int triclinic; // 0 if domain is orthog, 1 if triclinic - int torqueflag,extraflag; + int triclinic; // 0 if domain is orthog, 1 if triclinic + int torqueflag, extraflag; virtual void force_clear(); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/write_coeff.h b/src/write_coeff.h index c5b1e6fadd..d90e3fd97b 100644 --- a/src/write_coeff.h +++ b/src/write_coeff.h @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class WriteCoeff : public Command { public: - WriteCoeff(class LAMMPS *lmp) : Command(lmp) {}; + WriteCoeff(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/write_data.h b/src/write_data.h index 06ce316d74..262282d2e3 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -31,15 +31,15 @@ class WriteData : public Command { void write(const std::string &); private: - int me,nprocs; + int me, nprocs; int pairflag; int coeffflag; int fixflag; FILE *fp; - bigint nbonds_local,nbonds; - bigint nangles_local,nangles; - bigint ndihedrals_local,ndihedrals; - bigint nimpropers_local,nimpropers; + bigint nbonds_local, nbonds; + bigint nangles_local, nangles; + bigint ndihedrals_local, ndihedrals; + bigint nimpropers_local, nimpropers; void header(); void type_arrays(); @@ -54,7 +54,7 @@ class WriteData : public Command { void fix(int, int); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/write_dump.h b/src/write_dump.h index 8a5b662ce1..b3ab4d4d41 100644 --- a/src/write_dump.h +++ b/src/write_dump.h @@ -26,11 +26,11 @@ namespace LAMMPS_NS { class WriteDump : public Command { public: - WriteDump(class LAMMPS *lmp) : Command(lmp) {}; + WriteDump(class LAMMPS *lmp) : Command(lmp){}; void command(int, char **); }; -} +} // namespace LAMMPS_NS #endif #endif diff --git a/src/write_restart.h b/src/write_restart.h index 3fa457adb8..b9c64376a2 100644 --- a/src/write_restart.h +++ b/src/write_restart.h @@ -32,22 +32,22 @@ class WriteRestart : public Command { void write(std::string); private: - int me,nprocs; + int me, nprocs; FILE *fp; - bigint natoms; // natoms (sum of nlocal) to write into file + bigint natoms; // natoms (sum of nlocal) to write into file int noinit; - int multiproc; // 0 = proc 0 writes for all - // else # of procs writing files - int nclusterprocs; // # of procs in my cluster that write to one file - int filewriter; // 1 if this proc writes a file, else 0 - int fileproc; // ID of proc in my cluster who writes to file - int icluster; // which cluster I am in + int multiproc; // 0 = proc 0 writes for all + // else # of procs writing files + int nclusterprocs; // # of procs in my cluster that write to one file + int filewriter; // 1 if this proc writes a file, else 0 + int fileproc; // ID of proc in my cluster who writes to file + int icluster; // which cluster I am in // MPI-IO values - int mpiioflag; // 1 for MPIIO output, else 0 - class RestartMPIIO *mpiio; // MPIIO for restart file output + int mpiioflag; // 1 for MPIIO output, else 0 + class RestartMPIIO *mpiio; // MPIIO for restart file output MPI_Offset headerOffset; void header(); @@ -67,7 +67,7 @@ class WriteRestart : public Command { void write_double_vec(int, int, double *); }; -} +} // namespace LAMMPS_NS #endif #endif