Merge branch 'collected-small-changes' into add_set_time
This commit is contained in:
@ -670,7 +670,7 @@ void PPPMElectrode::compute_matrix(bigint *imat, double **matrix, bool timer_fla
|
||||
compute(1, 0);
|
||||
|
||||
// fft green's function k -> r
|
||||
std::vector<double> greens_real(nz_pppm * ny_pppm * nx_pppm, 0.);
|
||||
std::vector<double> greens_real((std::size_t) nz_pppm * ny_pppm * nx_pppm, 0.0);
|
||||
for (int i = 0, n = 0; i < nfft; i++) {
|
||||
work2[n++] = greensfn[i];
|
||||
work2[n++] = ZEROF;
|
||||
|
||||
@ -106,6 +106,7 @@ FixElectronStopping::FixElectronStopping(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
FixElectronStopping::~FixElectronStopping()
|
||||
{
|
||||
delete[] idregion;
|
||||
memory->destroy(elstop_ranges);
|
||||
}
|
||||
|
||||
|
||||
@ -188,7 +188,7 @@ void PairGranular::compute(int eflag, int vflag)
|
||||
double *history,*allhistory,**firsthistory;
|
||||
|
||||
bool touchflag = false;
|
||||
const bool historyupdate = update->setupflag != 0;
|
||||
const bool historyupdate = update->setupflag == 0;
|
||||
|
||||
ev_init(eflag,vflag);
|
||||
|
||||
|
||||
@ -825,8 +825,6 @@ void PPPMDispIntel::make_rho_c(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
// (dx,dy,dz) = distance to "lower left" grid pt
|
||||
// (mx,my,mz) = global coords of moving stencil pt
|
||||
|
||||
//double *q = atom->q;
|
||||
//double **x = atom->x;
|
||||
int nlocal = atom->nlocal;
|
||||
int nthr = comm->nthreads;
|
||||
|
||||
@ -847,7 +845,6 @@ void PPPMDispIntel::make_rho_c(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
const flt_t xi = delxinv;
|
||||
const flt_t yi = delyinv;
|
||||
const flt_t zi = delzinv;
|
||||
const flt_t fshift = shift;
|
||||
const flt_t fshiftone = shiftone;
|
||||
const flt_t fdelvolinv = delvolinv;
|
||||
|
||||
@ -1011,7 +1008,6 @@ void PPPMDispIntel::make_rho_g(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
const flt_t xi = delxinv_6;
|
||||
const flt_t yi = delyinv_6;
|
||||
const flt_t zi = delzinv_6;
|
||||
const flt_t fshift = shift_6;
|
||||
const flt_t fshiftone = shiftone_6;
|
||||
const flt_t fdelvolinv = delvolinv_6;
|
||||
|
||||
@ -1150,20 +1146,13 @@ void PPPMDispIntel::make_rho_a(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
{
|
||||
// clear 3d density array
|
||||
|
||||
memset(&(density_brick_a0[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,
|
||||
ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a1[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,
|
||||
ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a2[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,
|
||||
ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a3[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,
|
||||
ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a4[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,
|
||||
ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a5[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,
|
||||
ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a6[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,
|
||||
ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a0[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a1[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a2[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a3[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a4[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a5[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,ngrid_6*sizeof(FFT_SCALAR));
|
||||
memset(&(density_brick_a6[nzlo_out_6][nylo_out_6][nxlo_out_6]),0,ngrid_6*sizeof(FFT_SCALAR));
|
||||
|
||||
// loop over my charges, add their contribution to nearby grid points
|
||||
// (nx,ny,nz) = global coords of grid pt to "lower left" of charge
|
||||
@ -1171,117 +1160,112 @@ void PPPMDispIntel::make_rho_a(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
// (mx,my,mz) = global coords of moving stencil pt
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
double **x = atom->x;
|
||||
|
||||
double **x = atom->x;
|
||||
const flt_t lo0 = boxlo[0];
|
||||
const flt_t lo1 = boxlo[1];
|
||||
const flt_t lo2 = boxlo[2];
|
||||
const flt_t xi = delxinv_6;
|
||||
const flt_t yi = delyinv_6;
|
||||
const flt_t zi = delzinv_6;
|
||||
const flt_t fshiftone = shiftone_6;
|
||||
const flt_t fdelvolinv = delvolinv_6;
|
||||
|
||||
const int nix = nxhi_out_6 - nxlo_out_6 + 1;
|
||||
const int niy = nyhi_out_6 - nylo_out_6 + 1;
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
|
||||
const flt_t lo0 = boxlo[0];
|
||||
const flt_t lo1 = boxlo[1];
|
||||
const flt_t lo2 = boxlo[2];
|
||||
const flt_t xi = delxinv_6;
|
||||
const flt_t yi = delyinv_6;
|
||||
const flt_t zi = delzinv_6;
|
||||
const flt_t fshift = shift_6;
|
||||
const flt_t fshiftone = shiftone_6;
|
||||
const flt_t fdelvolinv = delvolinv_6;
|
||||
int nx = part2grid_6[i][0];
|
||||
int ny = part2grid_6[i][1];
|
||||
int nz = part2grid_6[i][2];
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
int nxsum = nx + nlower_6;
|
||||
int nysum = ny + nlower_6;
|
||||
int nzsum = nz + nlower_6;
|
||||
|
||||
int nx = part2grid_6[i][0];
|
||||
int ny = part2grid_6[i][1];
|
||||
int nz = part2grid_6[i][2];
|
||||
FFT_SCALAR dx = nx+fshiftone - (x[i][0]-lo0)*xi;
|
||||
FFT_SCALAR dy = ny+fshiftone - (x[i][1]-lo1)*yi;
|
||||
FFT_SCALAR dz = nz+fshiftone - (x[i][2]-lo2)*zi;
|
||||
|
||||
int nxsum = nx + nlower_6;
|
||||
int nysum = ny + nlower_6;
|
||||
int nzsum = nz + nlower_6;
|
||||
_alignvar(flt_t rho[3][INTEL_P3M_ALIGNED_MAXORDER], 64) = {0};
|
||||
|
||||
FFT_SCALAR dx = nx+fshiftone - (x[i][0]-lo0)*xi;
|
||||
FFT_SCALAR dy = ny+fshiftone - (x[i][1]-lo1)*yi;
|
||||
FFT_SCALAR dz = nz+fshiftone - (x[i][2]-lo2)*zi;
|
||||
|
||||
_alignvar(flt_t rho[3][INTEL_P3M_ALIGNED_MAXORDER], 64) = {0};
|
||||
|
||||
if (use_table) {
|
||||
dx = dx*half_rho_scale + half_rho_scale_plus;
|
||||
int idx = dx;
|
||||
dy = dy*half_rho_scale + half_rho_scale_plus;
|
||||
int idy = dy;
|
||||
dz = dz*half_rho_scale + half_rho_scale_plus;
|
||||
int idz = dz;
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
if (use_table) {
|
||||
dx = dx*half_rho_scale + half_rho_scale_plus;
|
||||
int idx = dx;
|
||||
dy = dy*half_rho_scale + half_rho_scale_plus;
|
||||
int idy = dy;
|
||||
dz = dz*half_rho_scale + half_rho_scale_plus;
|
||||
int idz = dz;
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#if defined(USE_OMP_SIMD)
|
||||
#pragma omp simd
|
||||
#pragma omp simd
|
||||
#else
|
||||
#pragma simd
|
||||
#pragma simd
|
||||
#endif
|
||||
#endif
|
||||
for (int k = 0; k < INTEL_P3M_ALIGNED_MAXORDER; k++) {
|
||||
rho[0][k] = rho6_lookup[idx][k];
|
||||
rho[1][k] = rho6_lookup[idy][k];
|
||||
rho[2][k] = rho6_lookup[idz][k];
|
||||
}
|
||||
} else {
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#if defined(USE_OMP_SIMD)
|
||||
#pragma omp simd
|
||||
#else
|
||||
#pragma simd
|
||||
#endif
|
||||
#endif
|
||||
for (int k = nlower_6; k <= nupper_6; k++) {
|
||||
FFT_SCALAR r1,r2,r3;
|
||||
r1 = r2 = r3 = ZEROF;
|
||||
|
||||
for (int l = order_6-1; l >= 0; l--) {
|
||||
r1 = rho_coeff_6[l][k] + r1*dx;
|
||||
r2 = rho_coeff_6[l][k] + r2*dy;
|
||||
r3 = rho_coeff_6[l][k] + r3*dz;
|
||||
}
|
||||
rho[0][k-nlower_6] = r1;
|
||||
rho[1][k-nlower_6] = r2;
|
||||
rho[2][k-nlower_6] = r3;
|
||||
}
|
||||
for (int k = 0; k < INTEL_P3M_ALIGNED_MAXORDER; k++) {
|
||||
rho[0][k] = rho6_lookup[idx][k];
|
||||
rho[1][k] = rho6_lookup[idy][k];
|
||||
rho[2][k] = rho6_lookup[idz][k];
|
||||
}
|
||||
|
||||
const int type = atom->type[i];
|
||||
FFT_SCALAR z0 = fdelvolinv;
|
||||
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#pragma loop_count min(2), max(INTEL_P3M_ALIGNED_MAXORDER), avg(7)
|
||||
#endif
|
||||
for (int n = 0; n < order_6; n++) {
|
||||
int mz = n + nzsum;
|
||||
FFT_SCALAR y0 = z0*rho[2][n];
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#pragma loop_count min(2), max(INTEL_P3M_ALIGNED_MAXORDER), avg(7)
|
||||
#endif
|
||||
for (int m = 0; m < order_6; m++) {
|
||||
int my = m + nysum;
|
||||
FFT_SCALAR x0 = y0*rho[1][m];
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
} else {
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#if defined(USE_OMP_SIMD)
|
||||
#pragma omp simd
|
||||
#pragma omp simd
|
||||
#else
|
||||
#pragma simd
|
||||
#pragma simd
|
||||
#endif
|
||||
#pragma loop_count min(2), max(INTEL_P3M_ALIGNED_MAXORDER), avg(7)
|
||||
#endif
|
||||
for (int l = 0; l < order; l++) {
|
||||
int mx = l + nxsum;
|
||||
FFT_SCALAR w = x0*rho[0][l];
|
||||
density_brick_a0[mz][my][mx] += w*B[7*type];
|
||||
density_brick_a1[mz][my][mx] += w*B[7*type+1];
|
||||
density_brick_a2[mz][my][mx] += w*B[7*type+2];
|
||||
density_brick_a3[mz][my][mx] += w*B[7*type+3];
|
||||
density_brick_a4[mz][my][mx] += w*B[7*type+4];
|
||||
density_brick_a5[mz][my][mx] += w*B[7*type+5];
|
||||
density_brick_a6[mz][my][mx] += w*B[7*type+6];
|
||||
}
|
||||
#endif
|
||||
for (int k = nlower_6; k <= nupper_6; k++) {
|
||||
FFT_SCALAR r1,r2,r3;
|
||||
r1 = r2 = r3 = ZEROF;
|
||||
|
||||
for (int l = order_6-1; l >= 0; l--) {
|
||||
r1 = rho_coeff_6[l][k] + r1*dx;
|
||||
r2 = rho_coeff_6[l][k] + r2*dy;
|
||||
r3 = rho_coeff_6[l][k] + r3*dz;
|
||||
}
|
||||
rho[0][k-nlower_6] = r1;
|
||||
rho[1][k-nlower_6] = r2;
|
||||
rho[2][k-nlower_6] = r3;
|
||||
}
|
||||
}
|
||||
|
||||
const int type = atom->type[i];
|
||||
FFT_SCALAR z0 = fdelvolinv;
|
||||
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#pragma loop_count min(2), max(INTEL_P3M_ALIGNED_MAXORDER), avg(7)
|
||||
#endif
|
||||
for (int n = 0; n < order_6; n++) {
|
||||
int mz = n + nzsum;
|
||||
FFT_SCALAR y0 = z0*rho[2][n];
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#pragma loop_count min(2), max(INTEL_P3M_ALIGNED_MAXORDER), avg(7)
|
||||
#endif
|
||||
for (int m = 0; m < order_6; m++) {
|
||||
int my = m + nysum;
|
||||
FFT_SCALAR x0 = y0*rho[1][m];
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
#if defined(USE_OMP_SIMD)
|
||||
#pragma omp simd
|
||||
#else
|
||||
#pragma simd
|
||||
#endif
|
||||
#pragma loop_count min(2), max(INTEL_P3M_ALIGNED_MAXORDER), avg(7)
|
||||
#endif
|
||||
for (int l = 0; l < order; l++) {
|
||||
int mx = l + nxsum;
|
||||
FFT_SCALAR w = x0*rho[0][l];
|
||||
density_brick_a0[mz][my][mx] += w*B[7*type];
|
||||
density_brick_a1[mz][my][mx] += w*B[7*type+1];
|
||||
density_brick_a2[mz][my][mx] += w*B[7*type+2];
|
||||
density_brick_a3[mz][my][mx] += w*B[7*type+3];
|
||||
density_brick_a4[mz][my][mx] += w*B[7*type+4];
|
||||
density_brick_a5[mz][my][mx] += w*B[7*type+5];
|
||||
density_brick_a6[mz][my][mx] += w*B[7*type+6];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -1310,7 +1294,6 @@ void PPPMDispIntel::make_rho_none(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
shared(nthr, nlocal, global_density) if (!_use_lrt)
|
||||
#endif
|
||||
{
|
||||
int type;
|
||||
double **x = atom->x;
|
||||
|
||||
const int nix = nxhi_out_6 - nxlo_out_6 + 1;
|
||||
@ -1322,7 +1305,6 @@ void PPPMDispIntel::make_rho_none(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
const flt_t xi = delxinv_6;
|
||||
const flt_t yi = delyinv_6;
|
||||
const flt_t zi = delzinv_6;
|
||||
const flt_t fshift = shift_6;
|
||||
const flt_t fshiftone = shiftone_6;
|
||||
const flt_t fdelvolinv = delvolinv_6;
|
||||
|
||||
@ -1391,7 +1373,6 @@ void PPPMDispIntel::make_rho_none(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
}
|
||||
}
|
||||
|
||||
type = atom->type[i];
|
||||
FFT_SCALAR z0 = fdelvolinv;
|
||||
|
||||
#if defined(LMP_SIMD_COMPILER)
|
||||
@ -1416,7 +1397,6 @@ void PPPMDispIntel::make_rho_none(IntelBuffers<flt_t,acc_t> * /*buffers*/)
|
||||
#endif
|
||||
for (int l = 0; l < order; l++) {
|
||||
int mzyx = l + mzy;
|
||||
FFT_SCALAR w0 = x0*rho[0][l];
|
||||
for (int k = 0; k < nsplit; k++)
|
||||
my_density[mzyx + k*ngrid_6] += x0*rho[0][l];
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ class VerletKokkos : public Verlet {
|
||||
void setup(int) override;
|
||||
void setup_minimal(int) override;
|
||||
void run(int) override;
|
||||
void force_clear() override;
|
||||
|
||||
KOKKOS_INLINE_FUNCTION
|
||||
void operator() (const int& i) const {
|
||||
@ -43,13 +44,9 @@ class VerletKokkos : public Verlet {
|
||||
f(i,2) += f_merge_copy(i,2);
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
DAT::t_f_array f_merge_copy,f;
|
||||
|
||||
void force_clear() override;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -38,8 +38,8 @@ enum{EDGE,CONSTANT,VARIABLE};
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLubricatePolyOMP::PairLubricatePolyOMP(LAMMPS *lmp) :
|
||||
PairLubricatePoly(lmp), ThrOMP(lmp, THR_PAIR)
|
||||
PairLubricatePolyOMP::PairLubricatePolyOMP(LAMMPS *_lmp) :
|
||||
PairLubricatePoly(_lmp), ThrOMP(_lmp, THR_PAIR)
|
||||
{
|
||||
suffix_flag |= Suffix::OMP;
|
||||
respa_enable = 0;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
// clang-format off
|
||||
PairStyle(lubricate/poly/omp,PairLubricateOMP);
|
||||
PairStyle(lubricate/poly/omp,PairLubricatePolyOMP);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ void RespaOMP::setup(int flag)
|
||||
ev_set(update->ntimestep);
|
||||
|
||||
for (int ilevel = 0; ilevel < nlevels; ilevel++) {
|
||||
force_clear(newton[ilevel]);
|
||||
force_clear();
|
||||
modify->setup_pre_force_respa(vflag,ilevel);
|
||||
|
||||
if (nhybrid_styles > 0) {
|
||||
@ -211,7 +211,7 @@ void RespaOMP::setup_minimal(int flag)
|
||||
ev_set(update->ntimestep);
|
||||
|
||||
for (int ilevel = 0; ilevel < nlevels; ilevel++) {
|
||||
force_clear(newton[ilevel]);
|
||||
force_clear();
|
||||
modify->setup_pre_force_respa(vflag,ilevel);
|
||||
|
||||
if (nhybrid_styles > 0) {
|
||||
@ -343,7 +343,7 @@ void RespaOMP::recurse(int ilevel)
|
||||
// so that any order dependencies are the same
|
||||
// when potentials are invoked at same level
|
||||
|
||||
force_clear(newton[ilevel]);
|
||||
force_clear();
|
||||
if (modify->n_pre_force_respa) {
|
||||
timer->stamp();
|
||||
modify->pre_force_respa(vflag,ilevel,iloop);
|
||||
|
||||
@ -64,7 +64,7 @@ static bool check_vdw(tagint itag, tagint jtag, double *xi, double *xj);
|
||||
|
||||
PairILPGrapheneHBNOpt::PairILPGrapheneHBNOpt(LAMMPS *lmp) :
|
||||
PairILPGrapheneHBN(lmp), layered_neigh(nullptr), first_layered_neigh(nullptr),
|
||||
num_intra(nullptr), num_inter(nullptr), num_vdw(nullptr), special_type(nullptr)
|
||||
special_type(nullptr), num_intra(nullptr), num_inter(nullptr), num_vdw(nullptr)
|
||||
{
|
||||
if (lmp->citeme) lmp->citeme->add(cite_ilp_cur);
|
||||
|
||||
|
||||
@ -404,7 +404,7 @@ double PairSMATB::init_one(int i, int j)
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int PairSMATB::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||
int PairSMATB::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
|
||||
{
|
||||
int i, j, m;
|
||||
|
||||
@ -465,11 +465,10 @@ void PairSMATB::write_restart_settings(FILE *fp)
|
||||
void PairSMATB::read_restart_settings(FILE *fp)
|
||||
{
|
||||
int me = comm->me;
|
||||
size_t result;
|
||||
if (me == 0) {
|
||||
result = fread(&offset_flag, sizeof(int), 1, fp);
|
||||
result = fread(&mix_flag, sizeof(int), 1, fp);
|
||||
result = fread(&tail_flag, sizeof(int), 1, fp);
|
||||
utils::sfread(FLERR, &offset_flag, sizeof(int), 1, fp, nullptr, error);
|
||||
utils::sfread(FLERR, &mix_flag, sizeof(int), 1, fp, nullptr, error);
|
||||
utils::sfread(FLERR, &tail_flag, sizeof(int), 1, fp, nullptr, error);
|
||||
}
|
||||
MPI_Bcast(&offset_flag, 1, MPI_INT, 0, world);
|
||||
MPI_Bcast(&mix_flag, 1, MPI_INT, 0, world);
|
||||
@ -504,15 +503,13 @@ void PairSMATB::write_restart(FILE *fp)
|
||||
void PairSMATB::read_restart(FILE *fp)
|
||||
{
|
||||
read_restart_settings(fp);
|
||||
|
||||
allocate();
|
||||
size_t result;
|
||||
|
||||
int i, j;
|
||||
int me = comm->me;
|
||||
for (i = 1; i <= atom->ntypes; i++)
|
||||
for (j = i; j <= atom->ntypes; j++) {
|
||||
if (me == 0) { result = fread(&setflag[i][j], sizeof(int), 1, fp); }
|
||||
if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error);
|
||||
MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world);
|
||||
if (setflag[i][j]) {
|
||||
if (me == 0) {
|
||||
|
||||
@ -87,7 +87,6 @@ void PairSMATBSingle::compute(int eflag, int vflag)
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
int *type = atom->type;
|
||||
int nlocal = atom->nlocal;
|
||||
int nall = nlocal + atom->nghost;
|
||||
|
||||
@ -237,16 +236,14 @@ void PairSMATBSingle::settings(int narg, char **)
|
||||
|
||||
void PairSMATBSingle::allocate()
|
||||
{
|
||||
int n = atom->ntypes;
|
||||
int natoms = atom->natoms;
|
||||
int np1 = atom->ntypes + 1;
|
||||
|
||||
memory->create(setflag, n + 1, n + 1, "pair_smatb:setflag");
|
||||
for (int i = 1; i <= n; i++) {
|
||||
for (int j = i; j <= n; j++) { setflag[i][j] = 0; }
|
||||
memory->create(setflag, np1, np1, "pair_smatb:setflag");
|
||||
for (int i = 1; i < np1; i++) {
|
||||
for (int j = i; j < np1; j++) { setflag[i][j] = 0; }
|
||||
}
|
||||
|
||||
memory->create(cutsq, n + 1, n + 1, "pair_smatb:cutsq");
|
||||
|
||||
memory->create(cutsq, np1, np1, "pair_smatb:cutsq");
|
||||
allocated = 1;
|
||||
}
|
||||
|
||||
@ -299,58 +296,40 @@ void PairSMATBSingle::init_style()
|
||||
double PairSMATBSingle::init_one(int i, int j)
|
||||
{
|
||||
if (setflag[i][j] == 0) error->all(FLERR, "All pair coeffs are not set");
|
||||
|
||||
//calculating the polynomial linking to zero
|
||||
double es = cutOffEnd - cutOffStart;
|
||||
double es2 = es * es;
|
||||
double es3 = es2 * es;
|
||||
|
||||
//variables for poly for p and A
|
||||
double expp = A * exp(p * (1. - cutOffStart / r0));
|
||||
double ap = -1. / es3;
|
||||
double expp = A * exp(p * (1.0 - cutOffStart / r0));
|
||||
double ap = -1.0 / es3;
|
||||
double bp = p / (r0 * es2);
|
||||
double cp = -(p * p) / (es * r0 * r0);
|
||||
|
||||
a5 = expp * (12. * ap + 6. * bp + cp) / (2. * es2);
|
||||
a4 = expp * (15. * ap + 7. * bp + cp) / es;
|
||||
a3 = expp * (20. * ap + 8. * bp + cp) / 2.;
|
||||
a5 = expp * (12.0 * ap + 6.0 * bp + cp) / (2.0 * es2);
|
||||
a4 = expp * (15.0 * ap + 7.0 * bp + cp) / es;
|
||||
a3 = expp * (20.0 * ap + 8.0 * bp + cp) / 2.0;
|
||||
|
||||
//variables for poly for q and qsi
|
||||
double expq = QSI * exp(q * (1. - cutOffStart / r0));
|
||||
double expq = QSI * exp(q * (1.0 - cutOffStart / r0));
|
||||
double aq = -1 / es3;
|
||||
double bq = q / (es2 * r0);
|
||||
double cq = -(q * q) / (es * r0 * r0);
|
||||
|
||||
x5 = expq * (12. * aq + 6. * bq + cq) / (2. * es2);
|
||||
x4 = expq * (15. * aq + 7. * bq + cq) / es;
|
||||
x3 = expq * (20. * aq + 8. * bq + cq) / 2.;
|
||||
x5 = expq * (12.0 * aq + 6.0 * bq + cq) / (2.0 * es2);
|
||||
x4 = expq * (15.0 * aq + 7.0 * bq + cq) / es;
|
||||
x3 = expq * (20.0 * aq + 8.0 * bq + cq) / 2.0;
|
||||
|
||||
cutOffEnd2 = cutOffEnd * cutOffEnd;
|
||||
if (i != j) {
|
||||
setflag[j][i] = 1;
|
||||
cutOffEnd2 = cutOffEnd2;
|
||||
|
||||
r0 = r0;
|
||||
p = p;
|
||||
q = q;
|
||||
A = A;
|
||||
QSI = QSI;
|
||||
cutOffStart = cutOffStart;
|
||||
cutOffEnd = cutOffEnd;
|
||||
|
||||
a3 = a3;
|
||||
a4 = a4;
|
||||
a5 = a5;
|
||||
x3 = x3;
|
||||
x4 = x4;
|
||||
x5 = x5;
|
||||
}
|
||||
|
||||
return cutOffEnd;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int PairSMATBSingle::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
|
||||
int PairSMATBSingle::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/,
|
||||
int * /*pbc*/)
|
||||
{
|
||||
int i, j, m;
|
||||
|
||||
@ -412,11 +391,10 @@ void PairSMATBSingle::write_restart_settings(FILE *fp)
|
||||
void PairSMATBSingle::read_restart_settings(FILE *fp)
|
||||
{
|
||||
int me = comm->me;
|
||||
size_t result;
|
||||
if (me == 0) {
|
||||
result = fread(&offset_flag, sizeof(int), 1, fp);
|
||||
result = fread(&mix_flag, sizeof(int), 1, fp);
|
||||
result = fread(&tail_flag, sizeof(int), 1, fp);
|
||||
utils::sfread(FLERR, &offset_flag, sizeof(int), 1, fp, nullptr, error);
|
||||
utils::sfread(FLERR, &mix_flag, sizeof(int), 1, fp, nullptr, error);
|
||||
utils::sfread(FLERR, &tail_flag, sizeof(int), 1, fp, nullptr, error);
|
||||
}
|
||||
MPI_Bcast(&offset_flag, 1, MPI_INT, 0, world);
|
||||
MPI_Bcast(&mix_flag, 1, MPI_INT, 0, world);
|
||||
@ -451,15 +429,13 @@ void PairSMATBSingle::write_restart(FILE *fp)
|
||||
void PairSMATBSingle::read_restart(FILE *fp)
|
||||
{
|
||||
read_restart_settings(fp);
|
||||
|
||||
allocate();
|
||||
size_t result;
|
||||
|
||||
int i, j;
|
||||
int me = comm->me;
|
||||
for (i = 1; i <= atom->ntypes; i++)
|
||||
for (j = i; j <= atom->ntypes; j++) {
|
||||
if (me == 0) { result = fread(&setflag[i][j], sizeof(int), 1, fp); }
|
||||
if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error);
|
||||
MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world);
|
||||
if (setflag[i][j]) {
|
||||
if (me == 0) {
|
||||
|
||||
@ -39,7 +39,6 @@ ComputeForceTally::ComputeForceTally(LAMMPS *lmp, int narg, char **arg) : Comput
|
||||
vector_flag = 0;
|
||||
peratom_flag = 1;
|
||||
timeflag = 1;
|
||||
dynamic_group_allow = 0;
|
||||
|
||||
comm_reverse = size_peratom_cols = 3;
|
||||
extscalar = 1;
|
||||
|
||||
@ -37,7 +37,6 @@ ComputeHeatFluxTally::ComputeHeatFluxTally(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
vector_flag = 1;
|
||||
timeflag = 1;
|
||||
dynamic_group_allow = 0;
|
||||
|
||||
comm_reverse = 7;
|
||||
extvector = 1;
|
||||
|
||||
@ -40,7 +40,6 @@ ComputeHeatFluxVirialTally::ComputeHeatFluxVirialTally(LAMMPS *lmp, int narg, ch
|
||||
vector_flag = 0;
|
||||
peratom_flag = 1;
|
||||
timeflag = 1;
|
||||
dynamic_group_allow = 0;
|
||||
|
||||
comm_reverse = size_peratom_cols = 3;
|
||||
extscalar = 1;
|
||||
|
||||
@ -36,7 +36,6 @@ ComputePEMolTally::ComputePEMolTally(LAMMPS *lmp, int narg, char **arg) : Comput
|
||||
vector_flag = 1;
|
||||
size_vector = 4;
|
||||
timeflag = 1;
|
||||
dynamic_group_allow = 0;
|
||||
|
||||
extvector = 1;
|
||||
peflag = 1; // we need Pair::ev_tally() to be run
|
||||
|
||||
@ -38,7 +38,6 @@ ComputePETally::ComputePETally(LAMMPS *lmp, int narg, char **arg) : Compute(lmp,
|
||||
vector_flag = 0;
|
||||
peratom_flag = 1;
|
||||
timeflag = 1;
|
||||
dynamic_group_allow = 0;
|
||||
|
||||
comm_reverse = size_peratom_cols = 2;
|
||||
extscalar = 1;
|
||||
|
||||
@ -39,7 +39,6 @@ ComputeStressTally::ComputeStressTally(LAMMPS *lmp, int narg, char **arg) : Comp
|
||||
vector_flag = 0;
|
||||
peratom_flag = 1;
|
||||
timeflag = 1;
|
||||
dynamic_group_allow = 0;
|
||||
|
||||
comm_reverse = size_peratom_cols = 6;
|
||||
extscalar = 0;
|
||||
|
||||
@ -26,6 +26,7 @@ class Integrate : protected Pointers {
|
||||
virtual void setup(int flag) = 0;
|
||||
virtual void setup_minimal(int) = 0;
|
||||
virtual void run(int) = 0;
|
||||
virtual void force_clear() = 0;
|
||||
virtual void cleanup() {}
|
||||
virtual void reset_dt() {}
|
||||
virtual double memory_usage() { return 0; }
|
||||
|
||||
@ -34,6 +34,7 @@ class Min : protected Pointers {
|
||||
virtual void setup(int flag = 1);
|
||||
virtual void setup_minimal(int);
|
||||
virtual void run(int);
|
||||
virtual void force_clear();
|
||||
void cleanup();
|
||||
int request(class Pair *, int, double);
|
||||
virtual double memory_usage() { return 0; }
|
||||
@ -138,7 +139,6 @@ class Min : protected Pointers {
|
||||
int neigh_every, neigh_delay, neigh_dist_check; // neighboring params
|
||||
|
||||
virtual double energy_force(int);
|
||||
virtual void force_clear();
|
||||
|
||||
void ev_setup();
|
||||
void ev_set(bigint);
|
||||
|
||||
@ -117,7 +117,7 @@ void RegIntersect::init()
|
||||
{
|
||||
Region::init();
|
||||
|
||||
// re-build list of sub-regions in case other regions were deleted
|
||||
// re-build list of sub-regions in case regions were changed
|
||||
// error if a sub-region was deleted
|
||||
|
||||
for (int ilist = 0; ilist < nregion; ilist++) {
|
||||
|
||||
@ -413,7 +413,7 @@ void Respa::setup(int flag)
|
||||
ev_set(update->ntimestep);
|
||||
|
||||
for (int ilevel = 0; ilevel < nlevels; ilevel++) {
|
||||
force_clear(newton[ilevel]);
|
||||
force_clear();
|
||||
modify->setup_pre_force_respa(vflag, ilevel);
|
||||
|
||||
if (nhybrid_styles > 0) {
|
||||
@ -481,7 +481,7 @@ void Respa::setup_minimal(int flag)
|
||||
ev_set(update->ntimestep);
|
||||
|
||||
for (int ilevel = 0; ilevel < nlevels; ilevel++) {
|
||||
force_clear(newton[ilevel]);
|
||||
force_clear();
|
||||
modify->setup_pre_force_respa(vflag, ilevel);
|
||||
|
||||
if (nhybrid_styles > 0) {
|
||||
@ -644,7 +644,7 @@ void Respa::recurse(int ilevel)
|
||||
// so that any order dependencies are the same
|
||||
// when potentials are invoked at same level
|
||||
|
||||
force_clear(newton[ilevel]);
|
||||
force_clear();
|
||||
if (modify->n_pre_force_respa) {
|
||||
timer->stamp();
|
||||
modify->pre_force_respa(vflag, ilevel, iloop);
|
||||
@ -717,7 +717,7 @@ void Respa::recurse(int ilevel)
|
||||
clear other arrays as needed
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Respa::force_clear(int /*newtonflag*/)
|
||||
void Respa::force_clear()
|
||||
{
|
||||
if (external_force_clear) return;
|
||||
|
||||
|
||||
@ -51,6 +51,7 @@ class Respa : public Integrate {
|
||||
void setup(int) override;
|
||||
void setup_minimal(int) override;
|
||||
void run(int) override;
|
||||
void force_clear() override;
|
||||
void cleanup() override;
|
||||
void reset_dt() override;
|
||||
|
||||
@ -65,7 +66,6 @@ class Respa : public Integrate {
|
||||
class FixRespa *fix_respa; // Fix to store the force level array
|
||||
|
||||
virtual void recurse(int);
|
||||
void force_clear(int);
|
||||
void sum_flevel_f();
|
||||
void set_compute_flags(int ilevel);
|
||||
};
|
||||
|
||||
@ -27,18 +27,16 @@ namespace LAMMPS_NS {
|
||||
class Verlet : public Integrate {
|
||||
public:
|
||||
Verlet(class LAMMPS *, int, char **);
|
||||
|
||||
void init() override;
|
||||
void setup(int flag) override;
|
||||
void setup_minimal(int) override;
|
||||
void run(int) override;
|
||||
void force_clear() override;
|
||||
void cleanup() override;
|
||||
|
||||
protected:
|
||||
int triclinic; // 0 if domain is orthog, 1 if triclinic
|
||||
int torqueflag, extraflag;
|
||||
|
||||
virtual void force_clear();
|
||||
};
|
||||
|
||||
} // namespace LAMMPS_NS
|
||||
|
||||
Reference in New Issue
Block a user