Merge branch 'develop' into compute-grid-new

This commit is contained in:
Axel Kohlmeyer
2022-06-17 12:51:02 -04:00
83 changed files with 910 additions and 401 deletions

8
src/.gitignore vendored
View File

@ -1001,8 +1001,8 @@
/neb.h
/netcdf_units.cpp
/netcdf_units.h
/pair_3b_table.cpp
/pair_3b_table.h
/pair_threebody_table.cpp
/pair_threebody_table.h
/pair_adp.cpp
/pair_adp.h
/pair_agni.cpp
@ -1297,8 +1297,8 @@
/pair_sph_taitwater_morris.h
/pair_sw.cpp
/pair_sw.h
/pair_sw_3b_table.cpp
/pair_sw_3b_table.h
/pair_sw_angle_table.cpp
/pair_sw_angle_table.h
/pair_sw_mod.cpp
/pair_sw_mod.h
/pair_tersoff.cpp

View File

@ -284,7 +284,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
int me = ATC::LammpsInterface::instance()->comm_rank();
string groupName(arg[1]);
int igroup = group->find(groupName.c_str());
int igroup = group->find(groupName);
int atomCount = group->count(igroup);
try {

View File

@ -78,9 +78,9 @@ AtomVecDielectric::AtomVecDielectric(LAMMPS *_lmp) : AtomVec(_lmp)
"mu", "area", "ed", "em", "epsilon", "curvature", "q_unscaled"};
fields_create = {"q", "molecule", "num_bond", "num_angle", "num_dihedral", "num_improper",
"nspecial", "mu", "area", "ed", "em", "epsilon", "curvature", "q_unscaled"};
fields_data_atom = { "id", "molecule", "type", "q", "x", "mu3", "area", "ed", "em", "epsilon",
fields_data_atom = {"id", "molecule", "type", "q", "x", "mu3", "area", "ed", "em", "epsilon",
"curvature"};
fields_data_vel = {"id v"};
fields_data_vel = {"id", "v"};
// clang-format on
setup_fields();

View File

@ -17,8 +17,8 @@
modified velocity-Verlet (MVV) algorithm.
Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm.
Contributing author: Zhen Li (Brown University)
Email: zhen_li@brown.edu
Contributing author: Zhen Li (Clemson University)
Email: zli7@clemson.edu
------------------------------------------------------------------------- */
#include "fix_mvv_dpd.h"

View File

@ -17,8 +17,8 @@
v and edpd_T) using the modified velocity-Verlet (MVV) algorithm.
Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm.
Contributing author: Zhen Li (Brown University)
Email: zhen_li@brown.edu
Contributing author: Zhen Li (Clemson University)
Email: zli7@clemson.edu
Please cite the related publication:
Z. Li, Y.-H. Tang, H. Lei, B. Caswell and G.E. Karniadakis. "Energy-

View File

@ -17,8 +17,8 @@
v and cc) using the modified velocity-Verlet (MVV) algorithm.
Setting verlet = 0.5 recovers the standard velocity-Verlet algorithm.
Contributing author: Zhen Li (Brown University)
Email: zhen_li@brown.edu
Contributing author: Zhen Li (Clemson University)
Email: zli7@clemson.edu
Please cite the related publication:
Z. Li, A. Yazdani, A. Tartakovsky and G.E. Karniadakis. "Transport

View File

@ -13,8 +13,8 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Zhen Li (Brown University)
Email: zhen_li@brown.edu
Contributing author: Zhen Li (Clemson University)
Email: zli7@clemson.edu
------------------------------------------------------------------------- */
#include "pair_edpd.h"

View File

@ -13,8 +13,8 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Zhen Li (Brown University)
Email: zhen_li@brown.edu
Contributing author: Zhen Li (Clemson University)
Email: zli7@clemson.edu
------------------------------------------------------------------------- */
#include "pair_mdpd.h"

View File

@ -17,7 +17,7 @@
before the force calculation.
The code uses 3D Lucy kernel, it can be modified for other kernels.
Contributing author: Zhen Li (Brown University)
Contributing author: Zhen Li (Clemson University)
------------------------------------------------------------------------- */
#include "pair_mdpd_rhosum.h"

View File

@ -13,8 +13,8 @@
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Zhen Li (Brown University)
Email: zhen_li@brown.edu
Contributing author: Zhen Li (Clemson University)
Email: zli7@clemson.edu
------------------------------------------------------------------------- */
#include "pair_tdpd.h"

View File

@ -44,7 +44,7 @@ static const double sqrt_2_inv = std::sqrt(0.5);
/* ---------------------------------------------------------------------- */
PairSDPDTaitwaterIsothermal::PairSDPDTaitwaterIsothermal (LAMMPS *lmp)
: Pair (lmp) {
: Pair (lmp), random(nullptr) {
restartinfo = 0;
single_enable =0;
}
@ -61,6 +61,7 @@ PairSDPDTaitwaterIsothermal::~PairSDPDTaitwaterIsothermal () {
memory->destroy (soundspeed);
memory->destroy (B);
}
delete random;
}
/* ---------------------------------------------------------------------- */

View File

@ -11,10 +11,15 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Stan Moore (SNL)
------------------------------------------------------------------------- */
#include "compute_ave_sphere_atom.h"
#include "atom.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "math_const.h"
@ -98,7 +103,10 @@ void ComputeAveSphereAtom::init()
}
cutsq = cutoff * cutoff;
sphere_vol = 4.0 / 3.0 * MY_PI * cutsq * cutoff;
if (domain->dimension == 3)
volume = 4.0 / 3.0 * MY_PI * cutsq * cutoff;
else
volume = MY_PI * cutsq;
// need an occasional full neighbor list
@ -121,7 +129,7 @@ void ComputeAveSphereAtom::compute_peratom()
double xtmp, ytmp, ztmp, delx, dely, delz, rsq;
int *ilist, *jlist, *numneigh, **firstneigh;
int count;
double vsum[3], vavg[3], vnet[3];
double p[3], vcom[3], vnet[3];
invoked_peratom = update->ntimestep;
@ -152,12 +160,26 @@ void ComputeAveSphereAtom::compute_peratom()
double **x = atom->x;
double **v = atom->v;
double *mass = atom->mass;
double *rmass = atom->rmass;
int *type = atom->type;
int *mask = atom->mask;
double massone_i, massone_j, totalmass;
double adof = domain->dimension;
double mvv2e = force->mvv2e;
double mv2d = force->mv2d;
double boltz = force->boltz;
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
if (mask[i] & groupbit) {
if (rmass)
massone_i = rmass[i];
else
massone_i = mass[type[i]];
xtmp = x[i][0];
ytmp = x[i][1];
ztmp = x[i][2];
@ -167,13 +189,18 @@ void ComputeAveSphereAtom::compute_peratom()
// i atom contribution
count = 1;
vsum[0] = v[i][0];
vsum[1] = v[i][1];
vsum[2] = v[i][2];
totalmass = massone_i;
p[0] = v[i][0] * massone_i;
p[1] = v[i][1] * massone_i;
p[2] = v[i][2] * massone_i;
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
if (rmass)
massone_j = rmass[j];
else
massone_j = mass[type[j]];
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
@ -181,42 +208,45 @@ void ComputeAveSphereAtom::compute_peratom()
rsq = delx * delx + dely * dely + delz * delz;
if (rsq < cutsq) {
count++;
vsum[0] += v[j][0];
vsum[1] += v[j][1];
vsum[2] += v[j][2];
totalmass += massone_j;
p[0] += v[j][0] * massone_j;
p[1] += v[j][1] * massone_j;
p[2] += v[j][2] * massone_j;
}
}
vavg[0] = vsum[0] / count;
vavg[1] = vsum[1] / count;
vavg[2] = vsum[2] / count;
vcom[0] = p[0] / totalmass;
vcom[1] = p[1] / totalmass;
vcom[2] = p[2] / totalmass;
// i atom contribution
count = 1;
vnet[0] = v[i][0] - vavg[0];
vnet[1] = v[i][1] - vavg[1];
vnet[2] = v[i][2] - vavg[2];
double ke_sum = vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2];
vnet[0] = v[i][0] - vcom[0];
vnet[1] = v[i][1] - vcom[1];
vnet[2] = v[i][2] - vcom[2];
double ke_sum = massone_i * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]);
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
j &= NEIGHMASK;
if (rmass)
massone_j = rmass[j];
else
massone_j = mass[type[j]];
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx * delx + dely * dely + delz * delz;
if (rsq < cutsq) {
count++;
vnet[0] = v[j][0] - vavg[0];
vnet[1] = v[j][1] - vavg[1];
vnet[2] = v[j][2] - vavg[2];
ke_sum += vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2];
vnet[0] = v[j][0] - vcom[0];
vnet[1] = v[j][1] - vcom[1];
vnet[2] = v[j][2] - vcom[2];
ke_sum += massone_j * (vnet[0] * vnet[0] + vnet[1] * vnet[1] + vnet[2] * vnet[2]);
}
}
double density = count / sphere_vol;
double temp = ke_sum / 3.0 / count;
double density = mv2d * totalmass / volume;
double temp = mvv2e * ke_sum / (adof * count * boltz);
result[i][0] = density;
result[i][1] = temp;
}

View File

@ -37,7 +37,7 @@ class ComputeAveSphereAtom : public Compute {
protected:
int nmax;
double cutoff, cutsq, sphere_vol;
double cutoff, cutsq, volume;
class NeighList *list;
double **result;

View File

@ -318,7 +318,7 @@ void ComputeStressCartesian::compute_array()
// Check if inside cut-off
if (rsq >= cutsq[itype][jtype]) continue;
pair->single(i, j, itype, jtype, rsq, factor_coul, factor_lj, fpair);
compute_pressure(fpair, xi1, xi2, xj1, xj2, delx, dely, delz);
compute_pressure(fpair, xi1, xi2, delx, dely, delz);
}
}
@ -356,8 +356,8 @@ void ComputeStressCartesian::compute_array()
}
}
void ComputeStressCartesian::compute_pressure(double fpair, double xi, double yi, double xj,
double yj, double delx, double dely, double delz)
void ComputeStressCartesian::compute_pressure(double fpair, double xi, double yi, double delx,
double dely, double delz)
{
int bin1, bin2, next_bin1, next_bin2;
double la = 0.0, lb = 0.0, l_sum = 0.0;

View File

@ -41,7 +41,7 @@ class ComputeStressCartesian : public Compute {
double *dens, *pkxx, *pkyy, *pkzz, *pcxx, *pcyy, *pczz;
double *tdens, *tpkxx, *tpkyy, *tpkzz, *tpcxx, *tpcyy, *tpczz;
class NeighList *list;
void compute_pressure(double, double, double, double, double, double, double, double);
void compute_pressure(double, double, double, double, double, double);
};
} // namespace LAMMPS_NS

View File

@ -433,10 +433,10 @@ int xdropen(XDR *xdrs, const char *filename, const char *type)
return 0;
}
if (*type == 'w' || *type == 'W') {
type = (char *) "w+";
type = (char *) "wb+";
lmode = XDR_ENCODE;
} else {
type = (char *) "r";
type = (char *) "rb";
lmode = XDR_DECODE;
}
xdrfiles[xdrid] = fopen(filename, type);

View File

@ -483,7 +483,7 @@ void PairILPTMD::calc_normal()
}
}
//############################ For the edge atoms of TMD ################################
else if (cont > 1 && cont < Nnei) {
else if (cont < Nnei) {
if (strcmp(elements[itype], "Mo") == 0 || strcmp(elements[itype], "W") == 0 ||
strcmp(elements[itype], "S") == 0 || strcmp(elements[itype], "Se") == 0) {
// derivatives of Ni[l] respect to the cont neighbors

View File

@ -11,11 +11,16 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Stan Moore (SNL)
------------------------------------------------------------------------- */
#include "compute_ave_sphere_atom_kokkos.h"
#include "atom_kokkos.h"
#include "atom_masks.h"
#include "comm.h"
#include "domain.h"
#include "error.h"
#include "force.h"
#include "memory_kokkos.h"
@ -105,11 +110,19 @@ void ComputeAveSphereAtomKokkos<DeviceType>::compute_peratom()
// compute properties for each atom in group
// use full neighbor list to count atoms less than cutoff
atomKK->sync(execution_space,X_MASK|V_MASK|TYPE_MASK|MASK_MASK);
atomKK->sync(execution_space,X_MASK|V_MASK|RMASS_MASK|TYPE_MASK|MASK_MASK);
x = atomKK->k_x.view<DeviceType>();
v = atomKK->k_v.view<DeviceType>();
rmass = atomKK->k_rmass.view<DeviceType>();
mass = atomKK->k_mass.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
adof = domain->dimension;
mvv2e = force->mvv2e;
mv2d = force->mv2d;
boltz = force->boltz;
Kokkos::deep_copy(d_result,0.0);
copymode = 1;
@ -125,8 +138,13 @@ template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void ComputeAveSphereAtomKokkos<DeviceType>::operator()(TagComputeAveSphereAtom, const int &ii) const
{
double massone_i,massone_j;
const int i = d_ilist[ii];
if (mask[i] & groupbit) {
if (rmass.data()) massone_i = rmass[i];
else massone_i = mass[type[i]];
const X_FLOAT xtmp = x(i,0);
const X_FLOAT ytmp = x(i,1);
const X_FLOAT ztmp = x(i,2);
@ -135,14 +153,17 @@ void ComputeAveSphereAtomKokkos<DeviceType>::operator()(TagComputeAveSphereAtom,
// i atom contribution
int count = 1;
double vsum[3];
vsum[0] = v(i,0);
vsum[1] = v(i,1);
vsum[2] = v(i,2);
double totalmass = massone_i;
double p[3];
p[0] = v(i,0)*massone_i;
p[1] = v(i,1)*massone_i;
p[2] = v(i,2)*massone_i;
for (int jj = 0; jj < jnum; jj++) {
int j = d_neighbors(i,jj);
j &= NEIGHMASK;
if (rmass.data()) massone_j = rmass[j];
else massone_j = mass[type[j]];
const F_FLOAT delx = x(j,0) - xtmp;
const F_FLOAT dely = x(j,1) - ytmp;
@ -150,44 +171,45 @@ void ComputeAveSphereAtomKokkos<DeviceType>::operator()(TagComputeAveSphereAtom,
const F_FLOAT rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cutsq) {
count++;
vsum[0] += v(j,0);
vsum[1] += v(j,1);
vsum[2] += v(j,2);
totalmass += massone_j;
p[0] += v(j,0)*massone_j;
p[1] += v(j,1)*massone_j;
p[2] += v(j,2)*massone_j;
}
}
double vavg[3];
vavg[0] = vsum[0]/count;
vavg[1] = vsum[1]/count;
vavg[2] = vsum[2]/count;
double vcom[3];
vcom[0] = p[0]/totalmass;
vcom[1] = p[1]/totalmass;
vcom[2] = p[2]/totalmass;
// i atom contribution
count = 1;
double vnet[3];
vnet[0] = v(i,0) - vavg[0];
vnet[1] = v(i,1) - vavg[1];
vnet[2] = v(i,2) - vavg[2];
double ke_sum = vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2];
vnet[0] = v(i,0) - vcom[0];
vnet[1] = v(i,1) - vcom[1];
vnet[2] = v(i,2) - vcom[2];
double ke_sum = massone_i * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]);
for (int jj = 0; jj < jnum; jj++) {
int j = d_neighbors(i,jj);
j &= NEIGHMASK;
if (rmass.data()) massone_j = rmass[j];
else massone_j = mass[type[j]];
const F_FLOAT delx = x(j,0) - xtmp;
const F_FLOAT dely = x(j,1) - ytmp;
const F_FLOAT delz = x(j,2) - ztmp;
const F_FLOAT rsq = delx*delx + dely*dely + delz*delz;
if (rsq < cutsq) {
count++;
vnet[0] = v(j,0) - vavg[0];
vnet[1] = v(j,1) - vavg[1];
vnet[2] = v(j,2) - vavg[2];
ke_sum += vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2];
vnet[0] = v(j,0) - vcom[0];
vnet[1] = v(j,1) - vcom[1];
vnet[2] = v(j,2) - vcom[2];
ke_sum += massone_j * (vnet[0]*vnet[0] + vnet[1]*vnet[1] + vnet[2]*vnet[2]);
}
}
double density = count/sphere_vol;
double temp = ke_sum/3.0/count;
double density = mv2d*totalmass/volume;
double temp = mvv2e*ke_sum/(adof*count*boltz);
d_result(i,0) = density;
d_result(i,1) = temp;
}

View File

@ -46,13 +46,18 @@ template <class DeviceType> class ComputeAveSphereAtomKokkos : public ComputeAve
void operator()(TagComputeAveSphereAtom, const int &) const;
private:
typename AT::t_x_array_randomread x;
typename AT::t_v_array_randomread v;
double adof,mvv2e,mv2d,boltz;
typename AT::t_x_array x;
typename AT::t_v_array v;
typename ArrayTypes<DeviceType>::t_float_1d rmass;
typename ArrayTypes<DeviceType>::t_float_1d mass;
typename ArrayTypes<DeviceType>::t_int_1d type;
typename ArrayTypes<DeviceType>::t_int_1d mask;
typename AT::t_neighbors_2d d_neighbors;
typename AT::t_int_1d_randomread d_ilist;
typename AT::t_int_1d_randomread d_numneigh;
typename AT::t_int_1d d_ilist;
typename AT::t_int_1d d_numneigh;
DAT::tdual_float_2d k_result;
typename AT::t_float_2d d_result;

View File

@ -534,8 +534,7 @@ void PairPACEKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
}
copymode = 1;
int newton_pair = force->newton_pair;
if (newton_pair == false)
if (!force->newton_pair)
error->all(FLERR,"PairPACEKokkos requires 'newton on'");
if (recursive)

View File

@ -2628,7 +2628,7 @@ int PairReaxFFKokkos<DeviceType>::preprocess_angular(int i, int itype, int j_sta
template<class DeviceType>
template<bool POPULATE>
KOKKOS_INLINE_FUNCTION
int PairReaxFFKokkos<DeviceType>::preprocess_torsion(int i, int /*itype*/, int itag,
int PairReaxFFKokkos<DeviceType>::preprocess_torsion(int i, int /*itype*/, tagint itag,
F_FLOAT xtmp, F_FLOAT ytmp, F_FLOAT ztmp, int j_start, int j_end, int location_torsion) const {
// in reaxff_torsion_angles: j = i, k = j, i = k;

View File

@ -257,7 +257,7 @@ class PairReaxFFKokkos : public PairReaxFF {
// Abstraction for counting and populating torsion intermediated
template<bool POPULATE>
KOKKOS_INLINE_FUNCTION
int preprocess_torsion(int, int, int, F_FLOAT, F_FLOAT, F_FLOAT, int, int, int) const;
int preprocess_torsion(int, int, tagint, F_FLOAT, F_FLOAT, F_FLOAT, int, int, int) const;
template<int NEIGHFLAG, int EVFLAG>
KOKKOS_INLINE_FUNCTION

View File

@ -450,7 +450,7 @@ void PairThreebodyTable::read_table(Table *tb, char *file, char *keyword, bool s
param_extract(tb, line);
// if it is a symmetric threebody interaction, less table entries are required
if (symmetric == true) {
if (symmetric) {
memory->create(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r12file");
memory->create(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r13file");
memory->create(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:thetafile");
@ -481,7 +481,7 @@ void PairThreebodyTable::read_table(Table *tb, char *file, char *keyword, bool s
int cerror = 0;
reader.skip_line();
// if it is a symmetric threebody interaction, less table entries are required
if (symmetric == true) {
if (symmetric) {
for (int i = 0; i < tb->ninput * tb->ninput * (tb->ninput + 1); i++) {
line = reader.next_line(11);
try {
@ -583,7 +583,7 @@ void PairThreebodyTable::bcast_table(Table *tb, bool symmetric)
MPI_Comm_rank(world, &me);
if (me > 0) {
// if it is a symmetric threebody interaction, less table entries are required
if (symmetric == true) {
if (symmetric) {
memory->create(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r12file");
memory->create(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), "mltable:r13file");
memory->create(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1),
@ -612,7 +612,7 @@ void PairThreebodyTable::bcast_table(Table *tb, bool symmetric)
}
// if it is a symmetric threebody interaction, less table entries are required
if (symmetric == true) {
if (symmetric) {
MPI_Bcast(tb->r12file, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world);
MPI_Bcast(tb->r13file, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world);
MPI_Bcast(tb->thetafile, tb->ninput * tb->ninput * (tb->ninput + 1), MPI_DOUBLE, 0, world);
@ -697,7 +697,7 @@ void PairThreebodyTable::uf_lookup(Param *pm, double r12, double r13, double the
//lookup scheme
// if it is a symmetric threebody interaction, less table entries are required
if (pm->symmetric == true) {
if (pm->symmetric) {
nr12 = (r12 - pm->mltable->rmin + 0.5 * dr - 0.00000001) / dr;
if (r12 == (pm->mltable->rmin - 0.5 * dr)) { nr12 = 0; }
nr13 = (r13 - pm->mltable->rmin + 0.5 * dr - 0.00000001) / dr;
@ -778,7 +778,7 @@ void PairThreebodyTable::threebody(Param *paramijk, double rsq1, double rsq2, do
}
// if the indices have been swapped, swap them back
if (swapped == true) {
if (swapped) {
temp = r12;
r12 = r13;
r13 = temp;

View File

@ -273,7 +273,7 @@ void FixWidom::init()
triclinic = domain->triclinic;
ave_widom_chemical_potential = 0;
ave_widom_chemical_potential = 0.0;
if (region) volume = region_volume;
else volume = domain->xprd * domain->yprd * domain->zprd;

View File

@ -461,7 +461,7 @@ mpi-stubs:
sinclude ../lib/python/Makefile.lammps
install-python:
@rm -rf ../python/build
@$(PYTHON) ../python/install.py -p ../python/lammps -l ../src/liblammps.so
@$(PYTHON) ../python/install.py -p ../python/lammps -l ../src/liblammps.so -w $(PWD)
# Create a tarball of src dir and packages

View File

@ -94,8 +94,8 @@ FixACKS2ReaxFF::~FixACKS2ReaxFF()
memory->destroy(s_hist_X);
memory->destroy(s_hist_last);
deallocate_storage();
deallocate_matrix();
FixACKS2ReaxFF::deallocate_storage();
FixACKS2ReaxFF::deallocate_matrix();
}
/* ---------------------------------------------------------------------- */

View File

@ -163,7 +163,7 @@ FixQEqReaxFF::~FixQEqReaxFF()
memory->destroy(t_hist);
FixQEqReaxFF::deallocate_storage();
deallocate_matrix();
FixQEqReaxFF::deallocate_matrix();
memory->destroy(shld);
@ -640,7 +640,7 @@ void FixQEqReaxFF::compute_H()
int jnum;
int i, j, ii, jj, flag;
double dx, dy, dz, r_sqr;
const double SMALL = 0.0001;
constexpr double EPSILON = 0.0001;
int *type = atom->type;
tagint *tag = atom->tag;
@ -671,10 +671,10 @@ void FixQEqReaxFF::compute_H()
if (j < atom->nlocal) flag = 1;
else if (tag[i] < tag[j]) flag = 1;
else if (tag[i] == tag[j]) {
if (dz > SMALL) flag = 1;
else if (fabs(dz) < SMALL) {
if (dy > SMALL) flag = 1;
else if (fabs(dy) < SMALL && dx > SMALL)
if (dz > EPSILON) flag = 1;
else if (fabs(dz) < EPSILON) {
if (dy > EPSILON) flag = 1;
else if (fabs(dy) < EPSILON && dx > EPSILON)
flag = 1;
}
}

View File

@ -73,7 +73,6 @@ void CreateBonds::command(int narg, char **arg)
iarg = 6;
} else if (strcmp(arg[0], "single/bond") == 0) {
style = SBOND;
if (narg < 4) error->all(FLERR, "Illegal create_bonds command");
btype = utils::inumeric(FLERR, arg[1], false, lmp);
batom1 = utils::tnumeric(FLERR, arg[2], false, lmp);
batom2 = utils::tnumeric(FLERR, arg[3], false, lmp);

View File

@ -315,7 +315,9 @@
// Enable minimal optimizations for more compact code in debug mode.
FMT_GCC_PRAGMA("GCC push_options")
#ifndef __OPTIMIZE__
// LAMMPS CUSTOMIZATION: suppress warning about pragma with KOKKOS
#if !defined(__OPTIMIZE__) && !defined(LMP_KOKKOS)
// END LAMMPS CUSTOMIZATION
FMT_GCC_PRAGMA("GCC optimize(\"Og\")")
#endif

View File

@ -28,6 +28,12 @@ Reader::Reader(LAMMPS *lmp) : Pointers(lmp)
compressed = false;
}
// avoid resource leak
Reader::~Reader()
{
if (fp != nullptr) close_file();
}
/* ----------------------------------------------------------------------
try to open given file
generic version for ASCII files with optional compression or for native binary dumps

View File

@ -23,6 +23,7 @@ namespace LAMMPS_NS {
class Reader : protected Pointers {
public:
Reader(class LAMMPS *);
~Reader() override;
virtual void settings(int, char **);