Merge branch 'master' into refactor-reaxff-parser

# Conflicts:
#	doc/src/fix_qeq_reax.rst
#	src/OPENMP/reaxc_bond_orders_omp.h
#	src/OPENMP/reaxc_bonds_omp.h
#	src/OPENMP/reaxc_forces_omp.h
#	src/OPENMP/reaxc_hydrogen_bonds_omp.h
#	src/OPENMP/reaxc_init_md_omp.cpp
#	src/OPENMP/reaxc_init_md_omp.h
#	src/OPENMP/reaxc_multi_body_omp.h
#	src/OPENMP/reaxc_nonbonded_omp.h
#	src/OPENMP/reaxc_torsion_angles_omp.h
#	src/OPENMP/reaxc_valence_angles_omp.h
#	src/OPENMP/reaxff_omp.h
#	src/Purge.list
#	src/QEQ/fix_qeq.cpp
#	src/QEQ/fix_qeq.h
#	src/QEQ/fix_qeq_dynamic.cpp
#	src/QEQ/fix_qeq_fire.cpp
#	src/REAXFF/fix_qeq_reax.cpp
#	src/REAXFF/reaxc_allocate.h
#	src/REAXFF/reaxc_bond_orders.h
#	src/REAXFF/reaxc_bonds.h
#	src/REAXFF/reaxc_control.h
#	src/REAXFF/reaxc_defs.h
#	src/REAXFF/reaxc_ffield.h
#	src/REAXFF/reaxc_forces.h
#	src/REAXFF/reaxc_hydrogen_bonds.h
#	src/REAXFF/reaxc_init_md.cpp
#	src/REAXFF/reaxc_init_md.h
#	src/REAXFF/reaxc_io_tools.cpp
#	src/REAXFF/reaxc_io_tools.h
#	src/REAXFF/reaxc_list.h
#	src/REAXFF/reaxc_lookup.h
#	src/REAXFF/reaxc_multi_body.h
#	src/REAXFF/reaxc_nonbonded.h
#	src/REAXFF/reaxc_reset_tools.h
#	src/REAXFF/reaxc_system_props.cpp
#	src/REAXFF/reaxc_system_props.h
#	src/REAXFF/reaxc_tool_box.h
#	src/REAXFF/reaxc_torsion_angles.h
#	src/REAXFF/reaxc_traj.cpp
#	src/REAXFF/reaxc_traj.h
#	src/REAXFF/reaxc_types.h
#	src/REAXFF/reaxc_valence_angles.h
#	src/REAXFF/reaxc_vector.cpp
#	src/REAXFF/reaxc_vector.h
#	src/REAXFF/reaxff_api.h
#	src/REAXFF/reaxff_defs.h
#	src/REAXFF/reaxff_inline.h
#	src/REAXFF/reaxff_types.h
#	src/text_file_reader.cpp
#	src/text_file_reader.h
#	unittest/force-styles/tests/atomic-pair-reax_c.yaml
#	unittest/force-styles/tests/atomic-pair-reax_c_lgvdw.yaml
#	unittest/force-styles/tests/atomic-pair-yukawa_colloid.yaml
This commit is contained in:
Axel Kohlmeyer
2021-07-12 13:58:09 -04:00
6013 changed files with 162244 additions and 78636 deletions

View File

@ -1,7 +1,8 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://lammps.sandia.gov/, Sandia National Laboratories
https://www.lammps.org/, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
@ -265,8 +266,8 @@ void PairHybrid::settings(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal pair_style command");
if (lmp->kokkos && !utils::strmatch(force->pair_style,"^hybrid.*/kk$"))
error->all(FLERR,fmt::format("Must use pair_style {}/kk with Kokkos",
force->pair_style));
error->all(FLERR,"Must use pair_style {}/kk with Kokkos",
force->pair_style);
// delete old lists, since cannot just change settings
@ -340,6 +341,8 @@ void PairHybrid::settings(int narg, char **arg)
// multiple[i] = 1 to M if sub-style used multiple times, else 0
int num_tip4p = 0, num_coul = 0; // count sub-styles with tip4p and coulomb
for (int i = 0; i < nstyles; i++) {
int count = 0;
for (int j = 0; j < nstyles; j++) {
@ -347,8 +350,22 @@ void PairHybrid::settings(int narg, char **arg)
if (j == i) multiple[i] = count;
}
if (count == 1) multiple[i] = 0;
if (utils::strmatch(keywords[i],"/tip4p/")) ++num_tip4p;
if (utils::strmatch(keywords[i],"/coul/")
|| utils::strmatch(keywords[i],"^comb")
|| utils::strmatch(keywords[i],"^reax/c")) ++num_coul;
}
if ((num_tip4p > 1) && (comm->me == 0))
error->warning(FLERR,"Using multiple tip4p sub-styles can result in "
"inconsistent calculation of coulomb interactions");
if ((num_tip4p > 0) && (num_coul > 0) && (comm->me == 0))
error->warning(FLERR,"Using a tip4p sub-style with other sub-styles "
"that include coulomb interactions can result in "
"inconsistent calculation of the coulomb interactions");
// set pair flags from sub-style flags
flags();
@ -400,6 +417,7 @@ void PairHybrid::flags()
if (styles[m]->dispersionflag) dispersionflag = 1;
if (styles[m]->tip4pflag) tip4pflag = 1;
if (styles[m]->compute_flag) compute_flag = 1;
if (styles[m]->finitecutflag) finitecutflag = 1;
}
single_enable = (single_enable == nstyles) ? 1 : 0;
respa_enable = (respa_enable == nstyles) ? 1 : 0;
@ -476,7 +494,7 @@ void PairHybrid::coeff(int narg, char **arg)
int none = 0;
if (m == nstyles) {
if (strcmp(arg[2],"none") == 0) none = 1;
else error->all(FLERR,"Pair coeff for hybrid has invalid style");
else error->all(FLERR,"Pair coeff for hybrid has invalid style: {}",arg[2]);
}
// move 1st/2nd args to 2nd/3rd args
@ -878,7 +896,7 @@ void PairHybrid::modify_params(int narg, char **arg)
int m;
for (m = 0; m < nstyles; m++)
if (strcmp(arg[1],keywords[m]) == 0) break;
if (m == nstyles) error->all(FLERR,"Unknown pair_modify hybrid sub-style");
if (m == nstyles) error->all(FLERR,"Unknown pair_modify hybrid sub-style: {}",arg[1]);
int iarg = 2;
if (multiple[m]) {
@ -887,7 +905,7 @@ void PairHybrid::modify_params(int narg, char **arg)
for (m = 0; m < nstyles; m++)
if (strcmp(arg[1],keywords[m]) == 0 && multiflag == multiple[m]) break;
if (m == nstyles)
error->all(FLERR,"Unknown pair_modify hybrid sub-style");
error->all(FLERR,"Unknown pair_modify hybrid sub-style: {}",arg[1]);
iarg = 3;
}
@ -905,7 +923,7 @@ again:
}
// if 2nd keyword (after pair) is compute/tally:
// set flag to register USER-TALLY computes accordingly
// set flag to register TALLY computes accordingly
if (iarg < narg && strcmp(arg[iarg],"compute/tally") == 0) {
if (narg < iarg+2)
@ -1075,6 +1093,42 @@ int PairHybrid::check_ijtype(int itype, int jtype, char *substyle)
return 0;
}
/* ----------------------------------------------------------------------
check if substyles calculate self-interaction range of particle
------------------------------------------------------------------------- */
double PairHybrid::atom2cut(int i)
{
double temp, cut;
cut = 0.0;
for (int m = 0; m < nstyles; m++) {
if (styles[m]->finitecutflag) {
temp = styles[m]->atom2cut(i);
if (temp > cut) cut = temp;
}
}
return cut;
}
/* ----------------------------------------------------------------------
check if substyles calculate maximum interaction range for two finite particles
------------------------------------------------------------------------- */
double PairHybrid::radii2cut(double r1, double r2)
{
double temp, cut;
cut = 0.0;
for (int m = 0; m < nstyles; m++) {
if (styles[m]->finitecutflag) {
temp = styles[m]->radii2cut(r1,r2);
if (temp > cut) cut = temp;
}
}
return cut;
}
/* ----------------------------------------------------------------------
memory usage of each sub-style
------------------------------------------------------------------------- */