even more constant cleanup

This commit is contained in:
Axel Kohlmeyer
2024-02-06 00:57:46 -05:00
parent 2760480630
commit eb9412f507
16 changed files with 42 additions and 111 deletions

View File

@ -22,22 +22,22 @@
#include "error.h"
#include "force.h"
#include "gpu_extra.h"
#include "math_const.h"
#include "neigh_list.h"
#include "neighbor.h"
#include "suffix.h"
#include <cmath>
#define MY_PIS 1.77245385090551602729
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace LAMMPS_NS;
using MathConst::MY_PIS;
static constexpr double EWALD_P = 0.3275911;
static constexpr double A1 = 0.254829592;
static constexpr double A2 = -0.284496736;
static constexpr double A3 = 1.421413741;
static constexpr double A4 = -1.453152027;
static constexpr double A5 = 1.061405429;
// External functions from cuda library for atom decomposition

View File

@ -20,6 +20,7 @@
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "gpu_extra.h"
#include "kspace.h"
@ -29,15 +30,8 @@
#include <cmath>
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace LAMMPS_NS;
using namespace EwaldConst;
// External functions from cuda library for atom decomposition

View File

@ -20,6 +20,7 @@
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "gpu_extra.h"
#include "kspace.h"
@ -29,15 +30,8 @@
#include <cmath>
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace LAMMPS_NS;
using namespace EwaldConst;
// External functions from cuda library for atom decomposition

View File

@ -20,6 +20,7 @@
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "gpu_extra.h"
#include "kspace.h"
@ -32,16 +33,9 @@
#include <cmath>
#include <cstring>
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace LAMMPS_NS;
using namespace MathConst;
using namespace EwaldConst;
// External functions from cuda library for atom decomposition
@ -207,7 +201,7 @@ void PairLJCutDipoleLongGPU::cpu_compute(int start, int inum, int eflag, int vfl
double pdotp, pidotr, pjdotr, pre1, pre2, pre3;
double grij, expm2, t, erfc;
double g0, g1, g2, b0, b1, b2, b3, d0, d1, d2, d3;
double zdix, zdiy, zdiz, zdjx, zdjy, zdjz, zaix, zaiy, zaiz, zajx, zajy, zajz;
double zdix, zdiy, zdiz, zaix, zaiy, zaiz;
double g0b1_g1b2_g2b3, g0d1_g1d2_g2d3;
double forcelj, factor_coul, factor_lj, facm1;
double evdwl, ecoul;
@ -290,9 +284,6 @@ void PairLJCutDipoleLongGPU::cpu_compute(int start, int inum, int eflag, int vfl
zdix = delx * (q[j] * b1 + b2 * pjdotr) - b1 * mu[j][0];
zdiy = dely * (q[j] * b1 + b2 * pjdotr) - b1 * mu[j][1];
zdiz = delz * (q[j] * b1 + b2 * pjdotr) - b1 * mu[j][2];
zdjx = delx * (-qtmp * b1 + b2 * pidotr) - b1 * mu[i][0];
zdjy = dely * (-qtmp * b1 + b2 * pidotr) - b1 * mu[i][1];
zdjz = delz * (-qtmp * b1 + b2 * pidotr) - b1 * mu[i][2];
if (factor_coul < 1.0) {
fdx *= factor_coul;
@ -301,14 +292,10 @@ void PairLJCutDipoleLongGPU::cpu_compute(int start, int inum, int eflag, int vfl
zdix *= factor_coul;
zdiy *= factor_coul;
zdiz *= factor_coul;
zdjx *= factor_coul;
zdjy *= factor_coul;
zdjz *= factor_coul;
}
} else {
fdx = fdy = fdz = 0.0;
zdix = zdiy = zdiz = 0.0;
zdjx = zdjy = zdjz = 0.0;
}
if (factor_coul < 1.0) {
@ -328,9 +315,6 @@ void PairLJCutDipoleLongGPU::cpu_compute(int start, int inum, int eflag, int vfl
zaix = delx * (q[j] * d1 + d2 * pjdotr) - d1 * mu[j][0];
zaiy = dely * (q[j] * d1 + d2 * pjdotr) - d1 * mu[j][1];
zaiz = delz * (q[j] * d1 + d2 * pjdotr) - d1 * mu[j][2];
zajx = delx * (-qtmp * d1 + d2 * pidotr) - d1 * mu[i][0];
zajy = dely * (-qtmp * d1 + d2 * pidotr) - d1 * mu[i][1];
zajz = delz * (-qtmp * d1 + d2 * pidotr) - d1 * mu[i][2];
if (factor_coul > 0.0) {
facm1 = 1.0 - factor_coul;
@ -340,14 +324,10 @@ void PairLJCutDipoleLongGPU::cpu_compute(int start, int inum, int eflag, int vfl
zaix *= facm1;
zaiy *= facm1;
zaiz *= facm1;
zajx *= facm1;
zajy *= facm1;
zajz *= facm1;
}
} else {
fax = fay = faz = 0.0;
zaix = zaiy = zaiz = 0.0;
zajx = zajy = zajz = 0.0;
}
forcecoulx = fdx + fax;

View File

@ -23,6 +23,7 @@
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "gpu_extra.h"
#include "kspace.h"
@ -33,15 +34,8 @@
#include <cmath>
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace LAMMPS_NS;
using namespace EwaldConst;
// External functions from cuda library for atom decomposition

View File

@ -20,6 +20,7 @@
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "gpu_extra.h"
#include "kspace.h"
@ -29,15 +30,8 @@
#include <cmath>
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace LAMMPS_NS;
using namespace EwaldConst;
// External functions from cuda library for atom decomposition

View File

@ -20,6 +20,7 @@
#include "atom.h"
#include "domain.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "gpu_extra.h"
#include "kspace.h"
@ -29,15 +30,8 @@
#include <cmath>
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace LAMMPS_NS;
using namespace EwaldConst;
// External functions from cuda library for atom decomposition

View File

@ -58,7 +58,7 @@ using namespace FixConst;
using namespace random_external_state;
static constexpr double EPSILON = 1.0e-10;
#define EPSILON_SQUARED ((EPSILON) * (EPSILON))
static constexpr double EPSILON_SQUARED = EPSILON * EPSILON;
/* ---------------------------------------------------------------------- */

View File

@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
// EPS_ENERGY = minimum normalization for energy tolerance
#define EPS_ENERGY 1.0e-8
static constexpr double EPS_ENERGY = 1.0e-8;
/* ---------------------------------------------------------------------- */

View File

@ -38,13 +38,12 @@ using namespace LAMMPS_NS;
// EMACH = machine accuracy limit of energy changes (1.0e-8)
// EPS_QUAD = tolerance for quadratic projection
#define ALPHA_MAX 1.0
#define ALPHA_REDUCE 0.5
#define BACKTRACK_SLOPE 0.4
#define QUADRATIC_TOL 0.1
//#define EMACH 1.0e-8
static constexpr double ALPHA_MAX = 1.0;
static constexpr double ALPHA_REDUCE = 0.5;
static constexpr double BACKTRACK_SLOPE = 0.4;
static constexpr double QUADRATIC_TOL = 0.1;
static constexpr double EMACH = 1.0e-8;
#define EPS_QUAD 1.0e-28
static constexpr double EPS_QUAD = 1.0e-28;
/* ---------------------------------------------------------------------- */

View File

@ -21,6 +21,7 @@
#include "atom_kokkos.h"
#include "atom_masks.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "kokkos.h"
#include "memory_kokkos.h"
@ -34,15 +35,7 @@
#include <cstring>
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace EwaldConst;
/* ---------------------------------------------------------------------- */

View File

@ -34,13 +34,12 @@
using namespace LAMMPS_NS;
using namespace MathConst;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
static constexpr double EWALD_P = 0.3275911;
static constexpr double A1 = 0.254829592;
static constexpr double A2 = -0.284496736;
static constexpr double A3 = 1.421413741;
static constexpr double A4 = -1.453152027;
static constexpr double A5 = 1.061405429;
/* ---------------------------------------------------------------------- */

View File

@ -21,6 +21,7 @@
#include "atom_kokkos.h"
#include "atom_masks.h"
#include "error.h"
#include "ewald_const.h"
#include "force.h"
#include "kokkos.h"
#include "memory_kokkos.h"
@ -34,15 +35,7 @@
#include <cstring>
using namespace LAMMPS_NS;
#define EWALD_F 1.12837917
#define EWALD_P 0.3275911
#define A1 0.254829592
#define A2 -0.284496736
#define A3 1.421413741
#define A4 -1.453152027
#define A5 1.061405429
using namespace EwaldConst;
/* ---------------------------------------------------------------------- */

View File

@ -36,8 +36,7 @@ using namespace MathConst;
// EPS_ENERGY = minimum normalization for energy tolerance
#define EPS_ENERGY 1.0e-8
static constexpr double EPS_ENERGY = 1.0e-8;
static constexpr int DELAYSTEP = 5;
/* ---------------------------------------------------------------------- */

View File

@ -54,8 +54,7 @@ static const char cite_minstyle_spin_cg[] =
// EPS_ENERGY = minimum normalization for energy tolerance
#define EPS_ENERGY 1.0e-8
static constexpr double EPS_ENERGY = 1.0e-8;
static constexpr int DELAYSTEP = 5;
/* ---------------------------------------------------------------------- */

View File

@ -54,8 +54,7 @@ static const char cite_minstyle_spin_lbfgs[] =
// EPS_ENERGY = minimum normalization for energy tolerance
#define EPS_ENERGY 1.0e-8
static constexpr double EPS_ENERGY = 1.0e-8;
static constexpr int DELAYSTEP = 5;
/* ---------------------------------------------------------------------- */