forked from lijiext/lammps
Merge pull request #1492 from akohlmey/collected-small-changes
Collected small changes for the next patch
This commit is contained in:
commit
b9e10d55e2
|
@ -28,8 +28,12 @@ OPT.
|
|||
|
||||
"none"_bond_none.html,
|
||||
"zero"_bond_zero.html,
|
||||
"hybrid"_bond_hybrid.html :tb(c=3,ea=c)
|
||||
|
||||
"hybrid"_bond_hybrid.html,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
"class2 (ko)"_bond_class2.html,
|
||||
"fene (iko)"_bond_fene.html,
|
||||
"fene/expand (o)"_bond_fene_expand.html,
|
||||
|
@ -56,8 +60,12 @@ OPT.
|
|||
|
||||
"none"_angle_none.html,
|
||||
"zero"_angle_zero.html,
|
||||
"hybrid"_angle_hybrid.html :tb(c=3,ea=c)
|
||||
|
||||
"hybrid"_angle_hybrid.html,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
"charmm (iko)"_angle_charmm.html,
|
||||
"class2 (ko)"_angle_class2.html,
|
||||
"class2/p6"_angle_class2.html,
|
||||
|
@ -89,8 +97,12 @@ OPT.
|
|||
|
||||
"none"_dihedral_none.html,
|
||||
"zero"_dihedral_zero.html,
|
||||
"hybrid"_dihedral_hybrid.html :tb(c=3,ea=c)
|
||||
|
||||
"hybrid"_dihedral_hybrid.html,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
"charmm (iko)"_dihedral_charmm.html,
|
||||
"charmmfsw"_dihedral_charmm.html,
|
||||
"class2 (ko)"_dihedral_class2.html,
|
||||
|
@ -117,8 +129,12 @@ OPT.
|
|||
|
||||
"none"_improper_none.html,
|
||||
"zero"_improper_zero.html,
|
||||
"hybrid"_improper_hybrid.html :tb(c=3,ea=c)
|
||||
|
||||
"hybrid"_improper_hybrid.html,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
"class2 (ko)"_improper_class2.html,
|
||||
"cossq (o)"_improper_cossq.html,
|
||||
"cvff (io)"_improper_cvff.html,
|
||||
|
|
|
@ -27,8 +27,11 @@ OPT.
|
|||
"none"_pair_none.html,
|
||||
"zero"_pair_zero.html,
|
||||
"hybrid (k)"_pair_hybrid.html,
|
||||
"hybrid/overlay (k)"_pair_hybrid.html :tb(c=4,ea=c)
|
||||
|
||||
"hybrid/overlay (k)"_pair_hybrid.html,
|
||||
,
|
||||
,
|
||||
,
|
||||
,
|
||||
"adp (o)"_pair_adp.html,
|
||||
"agni (o)"_pair_agni.html,
|
||||
"airebo (io)"_pair_airebo.html,
|
||||
|
|
|
@ -7097,6 +7097,18 @@ Self-explanatory. :dd
|
|||
|
||||
One or more GPUs must be used when Kokkos is compiled for CUDA. :dd
|
||||
|
||||
{Kspace_modify mesh parameter must be all zero or all positive} :dt
|
||||
|
||||
Valid kspace mesh parameters are >0. The code will try to auto-detect
|
||||
suitable values when all three mesh sizes are set to zero (the default). :dd
|
||||
|
||||
{Kspace_modify mesh/disp parameter must be all zero or all positive} :dt
|
||||
|
||||
Valid kspace mesh/disp parameters are >0. The code will try to auto-detect
|
||||
suitable values when all three mesh sizes are set to zero [and]
|
||||
the required accuracy via {force/disp/real} as well as
|
||||
{force/disp/kspace} is set. :dd
|
||||
|
||||
{Kspace style does not support compute group/group} :dt
|
||||
|
||||
Self-explanatory. :dd
|
||||
|
|
|
@ -154,7 +154,6 @@ help:
|
|||
|
||||
|
||||
lmpinstalledpkgs.h: $(SRC) $(INC)
|
||||
@echo 'Gathering installed package information (may take a little while)'
|
||||
@echo '#ifndef LMP_INSTALLED_PKGS_H' > ${TMPNAME}.lmpinstalled
|
||||
@echo '#define LMP_INSTALLED_PKGS_H' >> ${TMPNAME}.lmpinstalled
|
||||
@echo 'const char * LAMMPS_NS::LAMMPS::installed_packages[] = {' >> ${TMPNAME}.lmpinstalled
|
||||
|
@ -204,6 +203,7 @@ gitversion:
|
|||
@test -f MAKE/Makefile.$@ -o -f MAKE/OPTIONS/Makefile.$@ -o \
|
||||
-f MAKE/MACHINES/Makefile.$@ -o -f MAKE/MINE/Makefile.$@
|
||||
@if [ ! -d $(objdir) ]; then mkdir $(objdir); fi
|
||||
@echo 'Gathering installed package information (may take a little while)'
|
||||
@$(SHELL) Make.sh style
|
||||
@$(SHELL) Make.sh packages
|
||||
@$(MAKE) $(MFLAGS) lmpinstalledpkgs.h gitversion
|
||||
|
|
|
@ -74,7 +74,6 @@ void PairLJClass2CoulLongSoft::compute(int eflag, int vflag)
|
|||
{
|
||||
int i,j,ii,jj,inum,jnum,itype,jtype;
|
||||
double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
|
||||
double fraction;
|
||||
double rsq,r,forcecoul,forcelj;
|
||||
double grij,expm2,prefactor,t,erfc;
|
||||
double factor_coul,factor_lj;
|
||||
|
@ -490,7 +489,7 @@ double PairLJClass2CoulLongSoft::single(int i, int j, int itype, int jtype,
|
|||
double &fforce)
|
||||
{
|
||||
double denc,r,denlj,r4sig6,grij,expm2,t,erfc,prefactor;
|
||||
double fraction,forcecoul,forcelj,phicoul,philj;
|
||||
double forcecoul,forcelj,phicoul,philj;
|
||||
|
||||
if (rsq < cut_coulsq) {
|
||||
r = sqrt(rsq);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "compute.h"
|
||||
#include "modify.h"
|
||||
#include "pair.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "plumed/wrapper/Plumed.h"
|
||||
|
||||
|
@ -250,15 +251,15 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
|
|||
// Avoid conflict with fixes that define internal pressure computes.
|
||||
// See comment in the setup method
|
||||
|
||||
if ((strncmp(check_style,"nph",3) == 0) ||
|
||||
(strncmp(check_style,"npt",3) == 0) ||
|
||||
(strncmp(check_style,"rigid/nph",9) == 0) ||
|
||||
(strncmp(check_style,"rigid/npt",9) == 0) ||
|
||||
(strncmp(check_style,"msst",4) == 0) ||
|
||||
(strncmp(check_style,"nphug",5) == 0) ||
|
||||
(strncmp(check_style,"ipi",3) == 0) ||
|
||||
(strncmp(check_style,"press/berendsen",15) == 0) ||
|
||||
(strncmp(check_style,"qbmsst",6) == 0))
|
||||
if (utils::strmatch(check_style,"^nph") ||
|
||||
utils::strmatch(check_style,"^npt") ||
|
||||
utils::strmatch(check_style,"^rigid/nph") ||
|
||||
utils::strmatch(check_style,"^rigid/npt") ||
|
||||
utils::strmatch(check_style,"^msst") ||
|
||||
utils::strmatch(check_style,"^nphug") ||
|
||||
utils::strmatch(check_style,"^ipi") ||
|
||||
utils::strmatch(check_style,"^press/berendsen") ||
|
||||
utils::strmatch(check_style,"^qbmsst"))
|
||||
error->all(FLERR,"Fix plumed must be defined before any other fixes, "
|
||||
"that compute pressure internally");
|
||||
}
|
||||
|
@ -289,7 +290,7 @@ int FixPlumed::setmask()
|
|||
|
||||
void FixPlumed::init()
|
||||
{
|
||||
if (strcmp(update->integrate_style,"respa") == 0)
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
nlevels_respa = ((Respa *) update->integrate)->nlevels;
|
||||
|
||||
// This avoids nan pressure if compute_pressure is called
|
||||
|
@ -309,12 +310,12 @@ void FixPlumed::setup(int vflag)
|
|||
// has to be executed first. This creates a race condition with the
|
||||
// setup method of fix_nh. This is why in the constructor I check if
|
||||
// nh fixes have already been called.
|
||||
if (strcmp(update->integrate_style,"verlet") == 0)
|
||||
post_force(vflag);
|
||||
else {
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
|
||||
post_force_respa(vflag,nlevels_respa-1,0);
|
||||
((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1);
|
||||
} else {
|
||||
post_force(vflag);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "group.h"
|
||||
#include "kspace.h"
|
||||
#include "thermo.h"
|
||||
#include "utils.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
|
@ -410,14 +411,14 @@ void FixQBMSST::init()
|
|||
// rfix[] = indices to each fix rigid
|
||||
nrigid = 0;
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"rigid") == 0 ||
|
||||
strcmp(modify->fix[i]->style,"poems") == 0) nrigid++;
|
||||
if (nrigid) {
|
||||
if (utils::strmatch(modify->fix[i]->style,"^rigid") ||
|
||||
(strcmp(modify->fix[i]->style,"poems") == 0)) nrigid++;
|
||||
if (nrigid > 0) {
|
||||
rfix = new int[nrigid];
|
||||
nrigid = 0;
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if (strcmp(modify->fix[i]->style,"rigid") == 0 ||
|
||||
strcmp(modify->fix[i]->style,"poems") == 0) rfix[nrigid++] = i;
|
||||
if (utils::strmatch(modify->fix[i]->style,"^rigid") ||
|
||||
(strcmp(modify->fix[i]->style,"poems") == 0)) rfix[nrigid++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "math_const.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "utils.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
|
@ -375,8 +376,7 @@ void FixAdapt::init()
|
|||
|
||||
// if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style
|
||||
|
||||
if (strcmp(force->pair_style,"hybrid") == 0 ||
|
||||
strcmp(force->pair_style,"hybrid/overlay") == 0) {
|
||||
if (utils::strmatch(force->pair_style,"^hybrid")) {
|
||||
PairHybrid *pair = (PairHybrid *) force->pair;
|
||||
for (i = ad->ilo; i <= ad->ihi; i++)
|
||||
for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
|
||||
|
@ -416,8 +416,7 @@ void FixAdapt::init()
|
|||
|
||||
if (ad->bdim == 1) ad->vector = (double *) ptr;
|
||||
|
||||
if (strcmp(force->bond_style,"hybrid") == 0 ||
|
||||
strcmp(force->bond_style,"hybrid_overlay") == 0)
|
||||
if (utils::strmatch(force->bond_style,"^hybrid"))
|
||||
error->all(FLERR,"Fix adapt does not support bond_style hybrid");
|
||||
|
||||
delete [] bstyle;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "modify.h"
|
||||
#include "comm.h"
|
||||
#include "error.h"
|
||||
#include "utils.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
|
@ -72,8 +73,8 @@ void FixNVELimit::init()
|
|||
// warn if using fix shake, which will lead to invalid constraint forces
|
||||
|
||||
for (int i = 0; i < modify->nfix; i++)
|
||||
if ((strcmp(modify->fix[i]->style,"shake") == 0)
|
||||
|| (strcmp(modify->fix[i]->style,"rattle") == 0)) {
|
||||
if (utils::strmatch(modify->fix[i]->style,"^shake")
|
||||
|| utils::strmatch(modify->fix[i]->style,"^rattle")) {
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Should not use fix nve/limit with fix shake or fix rattle");
|
||||
}
|
||||
|
|
|
@ -80,7 +80,11 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp)
|
|||
strcpy(kspace_style,str);
|
||||
|
||||
pair_restart = NULL;
|
||||
create_factories();
|
||||
}
|
||||
|
||||
void _noopt Force::create_factories()
|
||||
{
|
||||
// fill pair map with pair styles listed in style_pair.h
|
||||
|
||||
pair_map = new PairCreatorMap();
|
||||
|
|
|
@ -143,6 +143,7 @@ class Force : protected Pointers {
|
|||
bigint memory_usage();
|
||||
|
||||
private:
|
||||
void create_factories();
|
||||
template <typename T> static Pair *pair_creator(LAMMPS *);
|
||||
template <typename T> static Bond *bond_creator(LAMMPS *);
|
||||
template <typename T> static Angle *angle_creator(LAMMPS *);
|
||||
|
|
|
@ -443,7 +443,11 @@ void KSpace::modify_params(int narg, char **arg)
|
|||
nx_pppm = nx_msm_max = force->inumeric(FLERR,arg[iarg+1]);
|
||||
ny_pppm = ny_msm_max = force->inumeric(FLERR,arg[iarg+2]);
|
||||
nz_pppm = nz_msm_max = force->inumeric(FLERR,arg[iarg+3]);
|
||||
if (nx_pppm == 0 && ny_pppm == 0 && nz_pppm == 0) gridflag = 0;
|
||||
if (nx_pppm == 0 && ny_pppm == 0 && nz_pppm == 0)
|
||||
gridflag = 0;
|
||||
else if (nx_pppm <= 0 || ny_pppm <= 0 || nz_pppm <= 0)
|
||||
error->all(FLERR,"Kspace_modify mesh parameters must be all "
|
||||
"zero or all positive");
|
||||
else gridflag = 1;
|
||||
iarg += 4;
|
||||
} else if (strcmp(arg[iarg],"mesh/disp") == 0) {
|
||||
|
@ -451,7 +455,11 @@ void KSpace::modify_params(int narg, char **arg)
|
|||
nx_pppm_6 = force->inumeric(FLERR,arg[iarg+1]);
|
||||
ny_pppm_6 = force->inumeric(FLERR,arg[iarg+2]);
|
||||
nz_pppm_6 = force->inumeric(FLERR,arg[iarg+3]);
|
||||
if (nx_pppm_6 == 0 || ny_pppm_6 == 0 || nz_pppm_6 == 0) gridflag_6 = 0;
|
||||
if (nx_pppm_6 == 0 && ny_pppm_6 == 0 && nz_pppm_6 == 0)
|
||||
gridflag_6 = 0;
|
||||
else if (nx_pppm_6 <= 0 || ny_pppm_6 <= 0 || nz_pppm_6 == 0)
|
||||
error->all(FLERR,"Kspace_modify mesh/disp parameters must be all "
|
||||
"zero or all positive");
|
||||
else gridflag_6 = 1;
|
||||
iarg += 4;
|
||||
} else if (strcmp(arg[iarg],"order") == 0) {
|
||||
|
|
12
src/kspace.h
12
src/kspace.h
|
@ -251,6 +251,18 @@ E: Bad kspace_modify slab parameter
|
|||
|
||||
Kspace_modify value for the slab/volume keyword must be >= 2.0.
|
||||
|
||||
E: Kspace_modify mesh parameter must be all zero or all positive
|
||||
|
||||
Valid kspace mesh parameters are >0. The code will try to auto-detect
|
||||
suitable values when all three mesh sizes are set to zero (the default).
|
||||
|
||||
E: Kspace_modify mesh/disp parameter must be all zero or all positive
|
||||
|
||||
Valid kspace mesh/disp parameters are >0. The code will try to auto-detect
|
||||
suitable values when all three mesh sizes are set to zero [and]
|
||||
the required accuracy via {force/disp/real} as well as
|
||||
{force/disp/kspace} is set.
|
||||
|
||||
W: Kspace_modify slab param < 2.0 may cause unphysical behavior
|
||||
|
||||
The kspace_modify slab parameter should be larger to insure periodic
|
||||
|
|
|
@ -896,7 +896,7 @@ void LAMMPS::destroy()
|
|||
initialize lists of styles in packages
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void LAMMPS::init_pkg_lists()
|
||||
void _noopt LAMMPS::init_pkg_lists()
|
||||
{
|
||||
pkg_lists = new package_styles_lists;
|
||||
#define PACKAGE "UNKNOWN"
|
||||
|
@ -1039,7 +1039,7 @@ const char *LAMMPS::match_style(const char *style, const char *name)
|
|||
help message for command line options and styles present in executable
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void LAMMPS::help()
|
||||
void _noopt LAMMPS::help()
|
||||
{
|
||||
FILE *fp = screen;
|
||||
const char *pager = NULL;
|
||||
|
|
|
@ -179,6 +179,9 @@ typedef int bigint;
|
|||
#ifdef _noalias
|
||||
#undef _noalias
|
||||
#endif
|
||||
#ifdef _noopt
|
||||
#undef _noopt
|
||||
#endif
|
||||
|
||||
// define stack variable alignment
|
||||
|
||||
|
@ -200,6 +203,23 @@ typedef int bigint;
|
|||
#define _noalias
|
||||
#endif
|
||||
|
||||
// declaration to turn off optimization for specific functions
|
||||
// and avoid compiler warnings about variable tracking
|
||||
|
||||
#if defined(__clang__)
|
||||
# define _noopt __attribute__((optnone))
|
||||
#elif defined(__INTEL_COMPILER)
|
||||
# define _noopt
|
||||
#elif defined(__GNUC__)
|
||||
# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))
|
||||
# define _noopt __attribute__((optimize("O0","no-var-tracking-assignments")))
|
||||
# else
|
||||
# define _noopt __attribute__((optimize("O0")))
|
||||
# endif
|
||||
#else
|
||||
# define _noopt
|
||||
#endif
|
||||
|
||||
// settings to enable LAMMPS to build under Windows
|
||||
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -81,6 +81,11 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp)
|
|||
ncompute = maxcompute = 0;
|
||||
compute = NULL;
|
||||
|
||||
create_factories();
|
||||
}
|
||||
|
||||
void _noopt Modify::create_factories()
|
||||
{
|
||||
// fill map with fixes listed in style_fix.h
|
||||
|
||||
fix_map = new FixCreatorMap();
|
||||
|
|
|
@ -172,6 +172,7 @@ class Modify : protected Pointers {
|
|||
FixCreatorMap *fix_map;
|
||||
|
||||
protected:
|
||||
void create_factories();
|
||||
template <typename T> static Compute *compute_creator(LAMMPS *, int, char **);
|
||||
template <typename T> static Fix *fix_creator(LAMMPS *, int, char **);
|
||||
};
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
#include "citeme.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@ -1282,8 +1283,8 @@ void Neighbor::init_topology()
|
|||
int bond_off = 0;
|
||||
int angle_off = 0;
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
if ((strcmp(modify->fix[i]->style,"shake") == 0)
|
||||
|| (strcmp(modify->fix[i]->style,"rattle") == 0))
|
||||
if (utils::strmatch(modify->fix[i]->style,"^shake")
|
||||
|| utils::strmatch(modify->fix[i]->style,"^rattle"))
|
||||
bond_off = angle_off = 1;
|
||||
if (force->bond && force->bond_match("quartic")) bond_off = 1;
|
||||
|
||||
|
|
|
@ -219,12 +219,6 @@ void PairCoulStreitz::init_style()
|
|||
error->all(FLERR,"Pair style requires a KSpace style");
|
||||
g_ewald = force->kspace->g_ewald;
|
||||
}
|
||||
|
||||
// ptr to QEQ fix
|
||||
//for (i = 0; i < modify->nfix; i++)
|
||||
// if (strcmp(modify->fix[i]->style,"qeq") == 0) break;
|
||||
//if (i < modify->nfix) fixqeq = (FixQEQ *) modify->fix[i];
|
||||
//else fixqeq = NULL;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
|
|
@ -112,7 +112,7 @@ void Velocity::command(int narg, char **arg)
|
|||
|
||||
int initcomm = 0;
|
||||
if (style == ZERO && rfix >= 0 &&
|
||||
strcmp(modify->fix[rfix]->style,"rigid/small") == 0) initcomm = 1;
|
||||
utils::strmatch(modify->fix[rfix]->style,"^rigid/small")) initcomm = 1;
|
||||
if ((style == CREATE || style == SET) && temperature &&
|
||||
strcmp(temperature->style,"temp/cs") == 0) initcomm = 1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue