fix gcmc updates from Aidan, trimming of output for replica commands
This commit is contained in:
@ -455,8 +455,7 @@ and related PPPM operations are somewhat insensitive to floating point
|
|||||||
truncation errors and thus do not always need to be performed in
|
truncation errors and thus do not always need to be performed in
|
||||||
double precision. Using the -DFFT_SINGLE setting trades off a little
|
double precision. Using the -DFFT_SINGLE setting trades off a little
|
||||||
accuracy for reduced memory use and parallel communication costs for
|
accuracy for reduced memory use and parallel communication costs for
|
||||||
transposing 3d FFT data. Note that single precision FFTs have only
|
transposing 3d FFT data.
|
||||||
been tested with the FFTW3, FFTW2, MKL, and KISS FFT options.
|
|
||||||
|
|
||||||
Step 7 :h6
|
Step 7 :h6
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,7 @@ Lennard-Jones 12/6) given by
|
|||||||
:c,image(Eqs/pair_buck.jpg)
|
:c,image(Eqs/pair_buck.jpg)
|
||||||
|
|
||||||
where rho is an ionic-pair dependent length parameter, and Rc is the
|
where rho is an ionic-pair dependent length parameter, and Rc is the
|
||||||
cutoff on both terms.
|
cutoff on both terms.
|
||||||
|
|
||||||
The styles with {coul/cut} or {coul/long} or {coul/msm} add a
|
The styles with {coul/cut} or {coul/long} or {coul/msm} add a
|
||||||
Coulombic term as described for the "lj/cut"_pair_lj.html pair styles.
|
Coulombic term as described for the "lj/cut"_pair_lj.html pair styles.
|
||||||
@ -120,6 +120,9 @@ cutoff (distance units)
|
|||||||
cutoff2 (distance units) :ul
|
cutoff2 (distance units) :ul
|
||||||
|
|
||||||
The second coefficient, rho, must be greater than zero.
|
The second coefficient, rho, must be greater than zero.
|
||||||
|
The coefficients A, rho, and C can be written as analytical expressions
|
||||||
|
of epsilon and sigma, in analogy to the Lennard-Jones potential
|
||||||
|
"(Khrapak)"_#Khrapak.
|
||||||
|
|
||||||
The latter 2 coefficients are optional. If not specified, the global
|
The latter 2 coefficients are optional. If not specified, the global
|
||||||
A,C and Coulombic cutoffs are used. If only one cutoff is specified,
|
A,C and Coulombic cutoffs are used. If only one cutoff is specified,
|
||||||
@ -127,7 +130,6 @@ it is used as the cutoff for both A,C and Coulombic interactions for
|
|||||||
this type pair. If both coefficients are specified, they are used as
|
this type pair. If both coefficients are specified, they are used as
|
||||||
the A,C and Coulombic cutoffs for this type pair. You cannot specify
|
the A,C and Coulombic cutoffs for this type pair. You cannot specify
|
||||||
2 cutoffs for style {buck}, since it has no Coulombic terms.
|
2 cutoffs for style {buck}, since it has no Coulombic terms.
|
||||||
|
|
||||||
For {buck/coul/long} only the LJ cutoff can be specified since a
|
For {buck/coul/long} only the LJ cutoff can be specified since a
|
||||||
Coulombic cutoff cannot be specified for an individual I,J type pair.
|
Coulombic cutoff cannot be specified for an individual I,J type pair.
|
||||||
All type pairs use the same global Coulombic cutoff specified in the
|
All type pairs use the same global Coulombic cutoff specified in the
|
||||||
@ -194,3 +196,6 @@ only enabled if LAMMPS was built with that package. See the
|
|||||||
"pair_coeff"_pair_coeff.html, "pair_style born"_pair_born.html
|
"pair_coeff"_pair_coeff.html, "pair_style born"_pair_born.html
|
||||||
|
|
||||||
[Default:] none
|
[Default:] none
|
||||||
|
|
||||||
|
:link(Khrapak)
|
||||||
|
[(Khrapak)] Khrapak, Chaudhuri, and Morfill, J Chem Phys, 134, 054120 (2011).
|
||||||
|
|||||||
116
lib/voronoi/Install.py
Normal file
116
lib/voronoi/Install.py
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
# install.py tool to download, unpack, build, and link to the Voro++ library
|
||||||
|
# used to automate the steps described in the README file in this dir
|
||||||
|
|
||||||
|
import sys,os,re,urllib,commands
|
||||||
|
|
||||||
|
# help message
|
||||||
|
|
||||||
|
help = """
|
||||||
|
Syntax: install.py -v version -g gdir [gname] -b bdir -l ldir
|
||||||
|
specify one or more options, order does not matter
|
||||||
|
gdir,bdir,ldir can be paths relative to lib/latte, full paths, or contain ~
|
||||||
|
-v = version of Voro++ to download and build
|
||||||
|
default = voro++-0.4.6 (current as of Jan 2015)
|
||||||
|
-g = grab (download) from math.lbl.gov/voro++ website
|
||||||
|
unpack tarfile in gdir to produce version dir (e.g. voro++-0.4.6)
|
||||||
|
if optional gname specified, rename version dir to gname within gdir
|
||||||
|
-b = build Voro++, bdir = Voro++ home directory
|
||||||
|
note that bdir must include the version suffix unless renamed
|
||||||
|
-l = create 2 softlinks (includelink,liblink)
|
||||||
|
in lib/voronoi to src dir of ldir = Voro++ home directory
|
||||||
|
note that ldir must include the version suffix unless renamed
|
||||||
|
"""
|
||||||
|
|
||||||
|
# settings
|
||||||
|
|
||||||
|
version = "voro++-0.4.6"
|
||||||
|
url = "http://math.lbl.gov/voro++/download/dir/%s.tar.gz" % version
|
||||||
|
|
||||||
|
# print error message or help
|
||||||
|
|
||||||
|
def error(str=None):
|
||||||
|
if not str: print help
|
||||||
|
else: print "ERROR",str
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
# expand to full path name
|
||||||
|
# process leading '~' or relative path
|
||||||
|
|
||||||
|
def fullpath(path):
|
||||||
|
return os.path.abspath(os.path.expanduser(path))
|
||||||
|
|
||||||
|
# parse args
|
||||||
|
|
||||||
|
args = sys.argv[1:]
|
||||||
|
nargs = len(args)
|
||||||
|
if nargs == 0: error()
|
||||||
|
|
||||||
|
grabflag = 0
|
||||||
|
buildflag = 0
|
||||||
|
linkflag = 0
|
||||||
|
|
||||||
|
iarg = 0
|
||||||
|
while iarg < nargs:
|
||||||
|
if args[iarg] == "-v":
|
||||||
|
if iarg+2 > nargs: error()
|
||||||
|
version = args[iarg+1]
|
||||||
|
iarg += 2
|
||||||
|
elif args[iarg] == "-g":
|
||||||
|
if iarg+2 > nargs: error()
|
||||||
|
grabflag = 1
|
||||||
|
grabdir = args[iarg+1]
|
||||||
|
grabname = None
|
||||||
|
if iarg+2 < nargs and args[iarg+2][0] != '-':
|
||||||
|
grabname = args[iarg+2]
|
||||||
|
iarg += 1
|
||||||
|
iarg += 2
|
||||||
|
elif args[iarg] == "-b":
|
||||||
|
if iarg+2 > nargs: error()
|
||||||
|
buildflag = 1
|
||||||
|
builddir = args[iarg+1]
|
||||||
|
iarg += 2
|
||||||
|
elif args[iarg] == "-l":
|
||||||
|
if iarg+2 > nargs: error()
|
||||||
|
linkflag = 1
|
||||||
|
linkdir = args[iarg+1]
|
||||||
|
iarg += 2
|
||||||
|
else: error()
|
||||||
|
|
||||||
|
# download and unpack Voro++ tarball
|
||||||
|
|
||||||
|
if grabflag:
|
||||||
|
print "Downloading Voro++ ..."
|
||||||
|
grabdir = fullpath(grabdir)
|
||||||
|
if not os.path.isdir(grabdir): error("Grab directory does not exist")
|
||||||
|
urllib.urlretrieve(url,"%s/%s.tar.gz" % (grabdir,version))
|
||||||
|
|
||||||
|
print "Unpacking Voro++ tarball ..."
|
||||||
|
tardir = "%s/%s" % (grabdir,version)
|
||||||
|
if os.path.exists(tardir): commands.getoutput("rm -rf %s" % tardir)
|
||||||
|
cmd = "cd %s; tar zxvf %s.tar.gz" % (grabdir,version)
|
||||||
|
txt = commands.getoutput(cmd)
|
||||||
|
print tardir,grabdir,grabname
|
||||||
|
if grabname: os.rename(tardir,"%s/%s" % (grabdir,grabname))
|
||||||
|
|
||||||
|
# build Voro++
|
||||||
|
|
||||||
|
if buildflag:
|
||||||
|
print "Building Voro++ ..."
|
||||||
|
cmd = "cd %s; make" % builddir
|
||||||
|
txt = commands.getoutput(cmd)
|
||||||
|
print txt
|
||||||
|
|
||||||
|
# create 2 links in lib/voronoi to Voro++ src dir
|
||||||
|
|
||||||
|
if linkflag:
|
||||||
|
print "Creating links to Voro++ include and lib files"
|
||||||
|
if os.path.isfile("includelink") or os.path.islink("includelink"):
|
||||||
|
os.remove("includelink")
|
||||||
|
if os.path.isfile("liblink") or os.path.islink("liblink"):
|
||||||
|
os.remove("liblink")
|
||||||
|
cmd = "ln -s %s/src includelink" % linkdir
|
||||||
|
commands.getoutput(cmd)
|
||||||
|
cmd = "ln -s %s/src liblink" % linkdir
|
||||||
|
commands.getoutput(cmd)
|
||||||
@ -9,8 +9,8 @@ Laboratory.
|
|||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
You must perform the following steps yourself, or you can use the
|
You must perform the following steps yourself, or you can use the
|
||||||
install.py Python script to automate any or all steps of the process.
|
Install.py Python script to automate any or all steps of the process.
|
||||||
Type "python install.py" for instructions.
|
Type "python Install.py" for instructions.
|
||||||
|
|
||||||
1. Download Voro++ at http://math.lbl.gov/voro++/download
|
1. Download Voro++ at http://math.lbl.gov/voro++/download
|
||||||
either as a tarball or via SVN, and unpack the
|
either as a tarball or via SVN, and unpack the
|
||||||
|
|||||||
@ -1,163 +0,0 @@
|
|||||||
#!usr/local/python
|
|
||||||
|
|
||||||
# install.py tool to download, unpack, build, and link to the Voro++ library
|
|
||||||
# used to automate the steps described in the README file in this dir
|
|
||||||
|
|
||||||
import sys,os,re,urllib,commands
|
|
||||||
|
|
||||||
help = """
|
|
||||||
Syntax: install.py -d dir -v version -g -b -i installdir -l incdir libdir
|
|
||||||
specify one or more options, order does not matter
|
|
||||||
-d = dir to download tarball to, unpack tarball in, perform build in
|
|
||||||
dir will be created if it doesn't exist (only last level)
|
|
||||||
default = this dir
|
|
||||||
-v = version of Voro++ to download and work with
|
|
||||||
default = voro++-0.4.6 (current as of Jan 2015)
|
|
||||||
-g = download (grab) tarball from
|
|
||||||
http://math.lbl.gov/voro++/download/dir/version
|
|
||||||
-b = build Voro++ by invoking "make" in its home dir
|
|
||||||
no default
|
|
||||||
-i = install Voro++ by invoking "make install" in its home dir
|
|
||||||
installdir arg is optional:
|
|
||||||
if not specified, installs at PREFIX defined in config.mk file
|
|
||||||
if specified, will overwrite PREFIX and install there
|
|
||||||
if PREFIX starts with /usr, will invoke "sudo make install"
|
|
||||||
-l = create two links to incdir and libdir
|
|
||||||
incdir and libdir are optional (specify neither or both):
|
|
||||||
if specified, includelink and liblink are to those two dirs
|
|
||||||
these are dirs where Voro++ include files and lib file are
|
|
||||||
if not specified and no install, links are to Voro++ src dir
|
|
||||||
if not specified and install performed,
|
|
||||||
links are to include and lib dirs under PREFIX
|
|
||||||
"""
|
|
||||||
|
|
||||||
def error():
|
|
||||||
print help
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
# parse args
|
|
||||||
|
|
||||||
args = sys.argv
|
|
||||||
|
|
||||||
if len(args) == 1: error()
|
|
||||||
|
|
||||||
dir = "."
|
|
||||||
version = "voro++-0.4.6"
|
|
||||||
grabflag = 0
|
|
||||||
buildflag = 0
|
|
||||||
installflag = 0
|
|
||||||
linkflag = 0
|
|
||||||
|
|
||||||
iarg = 1
|
|
||||||
while iarg < len(args):
|
|
||||||
if args[iarg] == "-d":
|
|
||||||
if iarg+2 > len(args): error()
|
|
||||||
dir = args[iarg+1]
|
|
||||||
iarg += 2
|
|
||||||
elif args[iarg] == "-v":
|
|
||||||
if iarg+2 > len(args): error()
|
|
||||||
version = args[iarg+1]
|
|
||||||
iarg += 2
|
|
||||||
elif args[iarg] == "-g":
|
|
||||||
grabflag = 1
|
|
||||||
iarg += 1
|
|
||||||
elif args[iarg] == "-b":
|
|
||||||
buildflag = 1
|
|
||||||
iarg += 1
|
|
||||||
elif args[iarg] == "-i":
|
|
||||||
installflag = 1
|
|
||||||
if iarg+1 == len(args) or args[iarg+1][0] == '-':
|
|
||||||
installdir = ""
|
|
||||||
iarg += 1
|
|
||||||
else:
|
|
||||||
if iarg+2 > len(args): error()
|
|
||||||
installdir = args[iarg+1]
|
|
||||||
iarg += 2
|
|
||||||
elif args[iarg] == "-l":
|
|
||||||
linkflag = 1
|
|
||||||
if iarg+1 == len(args) or args[iarg+1][0] == '-' or \
|
|
||||||
iarg+2 == len(args) or args[iarg+2][0] == '-':
|
|
||||||
includedir = libdir = ""
|
|
||||||
iarg += 1
|
|
||||||
else:
|
|
||||||
if iarg+3 > len(args): error()
|
|
||||||
includedir = args[iarg+1]
|
|
||||||
libdir = args[iarg+2]
|
|
||||||
iarg += 3
|
|
||||||
else: error()
|
|
||||||
|
|
||||||
dir = os.path.abspath(dir)
|
|
||||||
url = "http://math.lbl.gov/voro++/download/dir/%s.tar.gz" % version
|
|
||||||
|
|
||||||
# create dir if does not exist
|
|
||||||
|
|
||||||
if not os.path.isdir(dir):
|
|
||||||
if os.path.isfile(dir):
|
|
||||||
print "ERROR: Dir already exists as file"
|
|
||||||
sys.exit()
|
|
||||||
os.mkdir(dir)
|
|
||||||
if not os.path.isdir(dir):
|
|
||||||
print "ERROR: Unable to create dir"
|
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
# download and unpack tarball
|
|
||||||
|
|
||||||
if grabflag:
|
|
||||||
print "Downloading Voro++ tarball ..."
|
|
||||||
urllib.urlretrieve(url,"%s/%s.tar.gz" % (dir,version))
|
|
||||||
print "Unpacking Voro++ tarball ..."
|
|
||||||
cmd = "cd %s; tar zxvf %s.tar.gz" % (dir,version)
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
|
|
||||||
# build Voro++ in its dir
|
|
||||||
|
|
||||||
if buildflag:
|
|
||||||
print "Building Voro++ ..."
|
|
||||||
cmd = "cd %s/%s; make" % (dir,version)
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
print txt
|
|
||||||
|
|
||||||
# install Voro++
|
|
||||||
# if installdir set, overwrite PREFIX var in its config.mk file
|
|
||||||
# if PREFIX var starts with /usr, invoke sudo make install, else make install
|
|
||||||
|
|
||||||
if installflag:
|
|
||||||
print "Installing Voro++ ..."
|
|
||||||
if installdir:
|
|
||||||
txt = open("%s/%s/config.mk" % (dir,version),'r').read()
|
|
||||||
txt = re.sub("PREFIX=.*?\n","PREFIX=%s\n" % installdir,txt)
|
|
||||||
open("%s/%s/config.mk" % (dir,version),'w').write(txt)
|
|
||||||
print "TXT:",txt
|
|
||||||
txt = open("%s/%s/config.mk" % (dir,version),'r').read()
|
|
||||||
var = re.findall("PREFIX=.*?\n",txt)
|
|
||||||
prefix = var[0].split('=')[1].strip()
|
|
||||||
if prefix.startswith("/usr"):
|
|
||||||
cmd = "cd %s/%s; sudo make install" % (dir,version)
|
|
||||||
else:
|
|
||||||
cmd = "cd %s/%s; make install" % (dir,version)
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
print txt
|
|
||||||
|
|
||||||
# create links in this dir to Voro++ include and lib files
|
|
||||||
|
|
||||||
if linkflag:
|
|
||||||
print "Creating links to Voro++ include and lib files"
|
|
||||||
if os.path.isfile("includelink") or os.path.islink("includelink"):
|
|
||||||
os.remove("includelink")
|
|
||||||
if os.path.isfile("liblink") or os.path.islink("liblink"):
|
|
||||||
os.remove("liblink")
|
|
||||||
if includedir:
|
|
||||||
cmd = "ln -s %s includelink" % includedir
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
cmd = "ln -s %s liblink" % linkdir
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
elif not installflag:
|
|
||||||
cmd = "ln -s %s/%s/src includelink" % (dir,version)
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
cmd = "ln -s %s/%s/src liblink" % (dir,version)
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
else:
|
|
||||||
cmd = "ln -s %s/include includelink" % prefix
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
cmd = "ln -s %s/lib liblink" % prefix
|
|
||||||
txt = commands.getoutput(cmd)
|
|
||||||
@ -60,7 +60,7 @@ using namespace MathConst;
|
|||||||
// this must be lower than MAXENERGYSIGNAL
|
// this must be lower than MAXENERGYSIGNAL
|
||||||
// by a large amount, so that it is still
|
// by a large amount, so that it is still
|
||||||
// less than total energy when negative
|
// less than total energy when negative
|
||||||
// energy changes are added to MAXENERGYSIGNAL
|
// energy contributions are added to MAXENERGYSIGNAL
|
||||||
|
|
||||||
#define MAXENERGYTEST 1.0e50
|
#define MAXENERGYTEST 1.0e50
|
||||||
|
|
||||||
@ -701,6 +701,9 @@ void FixGCMC::pre_exchange()
|
|||||||
|
|
||||||
if (full_flag) {
|
if (full_flag) {
|
||||||
energy_stored = energy_full();
|
energy_stored = energy_full();
|
||||||
|
if (overlap_flag && energy_stored > MAXENERGYTEST)
|
||||||
|
error->warning(FLERR,"Energy of old configuration in "
|
||||||
|
"fix gcmc is > MAXENERGYTEST.");
|
||||||
|
|
||||||
if (mode == MOLECULE) {
|
if (mode == MOLECULE) {
|
||||||
for (int i = 0; i < ncycles; i++) {
|
for (int i = 0; i < ncycles; i++) {
|
||||||
@ -778,6 +781,9 @@ void FixGCMC::attempt_atomic_translation()
|
|||||||
if (i >= 0) {
|
if (i >= 0) {
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double energy_before = energy(i,ngcmc_type,-1,x[i]);
|
double energy_before = energy(i,ngcmc_type,-1,x[i]);
|
||||||
|
if (overlap_flag && energy_before > MAXENERGYTEST)
|
||||||
|
error->warning(FLERR,"Energy of old configuration in "
|
||||||
|
"fix gcmc is > MAXENERGYTEST.");
|
||||||
double rsq = 1.1;
|
double rsq = 1.1;
|
||||||
double rx,ry,rz;
|
double rx,ry,rz;
|
||||||
rx = ry = rz = 0.0;
|
rx = ry = rz = 0.0;
|
||||||
@ -998,6 +1004,9 @@ void FixGCMC::attempt_molecule_translation()
|
|||||||
if (translation_molecule == -1) return;
|
if (translation_molecule == -1) return;
|
||||||
|
|
||||||
double energy_before_sum = molecule_energy(translation_molecule);
|
double energy_before_sum = molecule_energy(translation_molecule);
|
||||||
|
if (overlap_flag && energy_before_sum > MAXENERGYTEST)
|
||||||
|
error->warning(FLERR,"Energy of old configuration in "
|
||||||
|
"fix gcmc is > MAXENERGYTEST.");
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
double rx,ry,rz;
|
double rx,ry,rz;
|
||||||
@ -1095,6 +1104,9 @@ void FixGCMC::attempt_molecule_rotation()
|
|||||||
if (rotation_molecule == -1) return;
|
if (rotation_molecule == -1) return;
|
||||||
|
|
||||||
double energy_before_sum = molecule_energy(rotation_molecule);
|
double energy_before_sum = molecule_energy(rotation_molecule);
|
||||||
|
if (overlap_flag && energy_before_sum > MAXENERGYTEST)
|
||||||
|
error->warning(FLERR,"Energy of old configuration in "
|
||||||
|
"fix gcmc is > MAXENERGYTEST.");
|
||||||
|
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
int *mask = atom->mask;
|
int *mask = atom->mask;
|
||||||
@ -2170,6 +2182,8 @@ double FixGCMC::molecule_energy(tagint gas_molecule_id)
|
|||||||
|
|
||||||
double FixGCMC::energy_full()
|
double FixGCMC::energy_full()
|
||||||
{
|
{
|
||||||
|
int imolecule;
|
||||||
|
|
||||||
if (triclinic) domain->x2lamda(atom->nlocal);
|
if (triclinic) domain->x2lamda(atom->nlocal);
|
||||||
domain->pbc();
|
domain->pbc();
|
||||||
comm->exchange();
|
comm->exchange();
|
||||||
@ -2185,14 +2199,15 @@ double FixGCMC::energy_full()
|
|||||||
// return signal value for energy
|
// return signal value for energy
|
||||||
|
|
||||||
if (overlap_flag) {
|
if (overlap_flag) {
|
||||||
|
int overlaptestall;
|
||||||
|
int overlaptest = 0;
|
||||||
double delx,dely,delz,rsq;
|
double delx,dely,delz,rsq;
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
tagint *molecule = atom->molecule;
|
tagint *molecule = atom->molecule;
|
||||||
int nall = atom->nlocal + atom->nghost;
|
int nall = atom->nlocal + atom->nghost;
|
||||||
for (int i = 0; i < atom->nlocal; i++) {
|
for (int i = 0; i < atom->nlocal; i++) {
|
||||||
int imolecule = molecule[i];
|
if (mode == MOLECULE) imolecule = molecule[i];
|
||||||
for (int j = i+1; j < nall; j++) {
|
for (int j = i+1; j < nall; j++) {
|
||||||
|
|
||||||
if (mode == MOLECULE)
|
if (mode == MOLECULE)
|
||||||
if (imolecule == molecule[j]) continue;
|
if (imolecule == molecule[j]) continue;
|
||||||
|
|
||||||
@ -2201,11 +2216,18 @@ double FixGCMC::energy_full()
|
|||||||
delz = x[i][2] - x[j][2];
|
delz = x[i][2] - x[j][2];
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
|
|
||||||
if (rsq < overlap_cutoff) return MAXENERGYSIGNAL;
|
if (rsq < overlap_cutoff) {
|
||||||
|
overlaptest = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (overlaptest) break;
|
||||||
}
|
}
|
||||||
|
MPI_Allreduce(&overlaptest, &overlaptestall, 1,
|
||||||
|
MPI_INT, MPI_MAX, world);
|
||||||
|
if (overlaptestall) return MAXENERGYSIGNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear forces so they don't accumulate over multiple
|
// clear forces so they don't accumulate over multiple
|
||||||
// calls within fix gcmc timestep, e.g. for fix shake
|
// calls within fix gcmc timestep, e.g. for fix shake
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class FixGCMC : public Fix {
|
|||||||
double xlo,xhi,ylo,yhi,zlo,zhi;
|
double xlo,xhi,ylo,yhi,zlo,zhi;
|
||||||
double region_xlo,region_xhi,region_ylo,region_yhi,region_zlo,region_zhi;
|
double region_xlo,region_xhi,region_ylo,region_yhi,region_zlo,region_zhi;
|
||||||
double region_volume;
|
double region_volume;
|
||||||
double energy_stored;
|
double energy_stored; // full energy of old/current configuration
|
||||||
double *sublo,*subhi;
|
double *sublo,*subhi;
|
||||||
int *local_gas_list;
|
int *local_gas_list;
|
||||||
double **cutsq;
|
double **cutsq;
|
||||||
@ -214,9 +214,14 @@ W: Fix gcmc using full_energy option
|
|||||||
|
|
||||||
Fix gcmc has automatically turned on the full_energy option since it
|
Fix gcmc has automatically turned on the full_energy option since it
|
||||||
is required for systems like the one specified by the user. User input
|
is required for systems like the one specified by the user. User input
|
||||||
included one or more of the following: kspace, triclinic, a hybrid
|
included one or more of the following: kspace, a hybrid
|
||||||
pair style, an eam pair style, or no "single" function for the pair
|
pair style, an eam pair style, tail correction,
|
||||||
style.
|
or no "single" function for the pair style.
|
||||||
|
|
||||||
|
W: Energy of old configuration in fix gcmc is > MAXENERGYTEST.
|
||||||
|
|
||||||
|
This probably means that a pair of atoms are closer than the
|
||||||
|
overlap cutoff distance for keyword overlap_cutoff.
|
||||||
|
|
||||||
E: Invalid atom type in fix gcmc command
|
E: Invalid atom type in fix gcmc command
|
||||||
|
|
||||||
|
|||||||
71
src/Makefile
71
src/Makefile
@ -43,6 +43,15 @@ endif
|
|||||||
|
|
||||||
# Package variables
|
# Package variables
|
||||||
|
|
||||||
|
# PACKAGE = standard packages
|
||||||
|
# PACKUSER = user packagse
|
||||||
|
# PACKLIB = all packages that require an additional lib
|
||||||
|
# PACKSYS = subset that reqiure a common system library
|
||||||
|
# PACKINT = subset that require an internal (provided) library
|
||||||
|
# PACKEXT = subset that require an external (downloaded) library
|
||||||
|
# PACKLIB = PACKSYS + PACKING + PACKEXT
|
||||||
|
# PACKSCRIPT = libs under lammps/lib that have an Install.py script
|
||||||
|
|
||||||
PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \
|
PACKAGE = asphere body class2 colloid compress coreshell dipole gpu \
|
||||||
granular kim kokkos kspace manybody mc meam misc molecule \
|
granular kim kokkos kspace manybody mc meam misc molecule \
|
||||||
mpiio mscg opt peri poems \
|
mpiio mscg opt peri poems \
|
||||||
@ -55,10 +64,21 @@ PACKUSER = user-atc user-awpmd user-cg-cmm user-cgdna user-colvars \
|
|||||||
user-quip user-reaxc user-smd user-smtbq user-sph user-tally \
|
user-quip user-reaxc user-smd user-smtbq user-sph user-tally \
|
||||||
user-vtk
|
user-vtk
|
||||||
|
|
||||||
PACKLIB = compress gpu kim kokkos meam mpiio mscg poems python reax voronoi \
|
PACKLIB = compress gpu kim kokkos meam mpiio mscg poems \
|
||||||
user-atc user-awpmd user-colvars user-h5md user-lb user-molfile \
|
python reax voronoi \
|
||||||
|
user-atc user-awpmd user-colvars user-h5md user-molfile \
|
||||||
user-nc-dump user-qmmm user-quip user-smd user-vtk
|
user-nc-dump user-qmmm user-quip user-smd user-vtk
|
||||||
|
|
||||||
|
PACKSYS = compress mpiio python
|
||||||
|
|
||||||
|
PACKINT = gpu kokkos meam poems reax user-atc user-awpmd user-colvars
|
||||||
|
|
||||||
|
PACKEXT = kim mscg voronoi \
|
||||||
|
user-h5md user-molfile user-nc-dump user-qmmm user-quip \
|
||||||
|
user-smd user-vtk
|
||||||
|
|
||||||
|
PACKSCRIPT = voronoi
|
||||||
|
|
||||||
PACKALL = $(PACKAGE) $(PACKUSER)
|
PACKALL = $(PACKAGE) $(PACKUSER)
|
||||||
|
|
||||||
PACKAGEUC = $(shell echo $(PACKAGE) | tr a-z A-Z)
|
PACKAGEUC = $(shell echo $(PACKAGE) | tr a-z A-Z)
|
||||||
@ -66,6 +86,7 @@ PACKUSERUC = $(shell echo $(PACKUSER) | tr a-z A-Z)
|
|||||||
|
|
||||||
YESDIR = $(shell echo $(@:yes-%=%) | tr a-z A-Z)
|
YESDIR = $(shell echo $(@:yes-%=%) | tr a-z A-Z)
|
||||||
NODIR = $(shell echo $(@:no-%=%) | tr a-z A-Z)
|
NODIR = $(shell echo $(@:no-%=%) | tr a-z A-Z)
|
||||||
|
LIBDIR = $(shell echo $(@:lib-%=%))
|
||||||
|
|
||||||
# List of all targets
|
# List of all targets
|
||||||
|
|
||||||
@ -75,9 +96,9 @@ help:
|
|||||||
@echo 'make clean-machine delete object files for one machine'
|
@echo 'make clean-machine delete object files for one machine'
|
||||||
@echo 'make mpi-stubs build dummy MPI library in STUBS'
|
@echo 'make mpi-stubs build dummy MPI library in STUBS'
|
||||||
@echo 'make install-python install LAMMPS wrapper in Python'
|
@echo 'make install-python install LAMMPS wrapper in Python'
|
||||||
@echo 'make tar create lmp_src.tar.gz of src dir and packages'
|
@echo 'make tar create lmp_src.tar.gz for src dir and packages'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'make package list available packages'
|
@echo 'make package list available packages and their dependencies'
|
||||||
@echo 'make package-status (ps) status of all packages'
|
@echo 'make package-status (ps) status of all packages'
|
||||||
@echo 'make yes-package install a single pgk in src dir'
|
@echo 'make yes-package install a single pgk in src dir'
|
||||||
@echo 'make no-package remove a single pkg from src dir'
|
@echo 'make no-package remove a single pkg from src dir'
|
||||||
@ -87,11 +108,16 @@ help:
|
|||||||
@echo 'make no-standard (no-std) remove all standard pkgs'
|
@echo 'make no-standard (no-std) remove all standard pkgs'
|
||||||
@echo 'make yes-user install all user pkgs'
|
@echo 'make yes-user install all user pkgs'
|
||||||
@echo 'make no-user remove all user pkgs'
|
@echo 'make no-user remove all user pkgs'
|
||||||
@echo 'make no-lib remove all pkgs with external libs'
|
@echo 'make yes-lib install all pkgs with libs (incldued or ext)'
|
||||||
|
@echo 'make no-lib remove all pkgs with libs (included or ext)'
|
||||||
|
@echo 'make yes-ext install all pkgs with external libs'
|
||||||
|
@echo 'make no-ext remove all pkgs with external libs'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'make package-update (pu) replace src files with updated package files'
|
@echo 'make package-update (pu) replace src files with updated package files'
|
||||||
@echo 'make package-overwrite replace package files with src files'
|
@echo 'make package-overwrite replace package files with src files'
|
||||||
@echo 'make package-diff (pd) diff src files against package files'
|
@echo 'make package-diff (pd) diff src files against package files'
|
||||||
|
@echo ''
|
||||||
|
@echo 'make lib-package download/build/install a package library'
|
||||||
@echo 'make purge purge obsolete copies of source files'
|
@echo 'make purge purge obsolete copies of source files'
|
||||||
@echo ''
|
@echo ''
|
||||||
@echo 'make machine build LAMMPS for machine'
|
@echo 'make machine build LAMMPS for machine'
|
||||||
@ -221,6 +247,13 @@ package:
|
|||||||
@echo ''
|
@echo ''
|
||||||
@echo 'User-contributed packages:' $(PACKUSER)
|
@echo 'User-contributed packages:' $(PACKUSER)
|
||||||
@echo ''
|
@echo ''
|
||||||
|
@echo 'Packages that need system libraries:' $(PACKSYS)
|
||||||
|
@echo ''
|
||||||
|
@echo 'Packages that need provided libraries:' $(PACKINT)
|
||||||
|
@echo ''
|
||||||
|
@echo 'Packages that need external libraries:' $(PACKEXT)
|
||||||
|
@echo ''
|
||||||
|
@echo 'make package list available packages'
|
||||||
@echo 'make package list available packages'
|
@echo 'make package list available packages'
|
||||||
@echo 'make package-status (ps) status of all packages'
|
@echo 'make package-status (ps) status of all packages'
|
||||||
@echo 'make yes-package install a single pgk in src dir'
|
@echo 'make yes-package install a single pgk in src dir'
|
||||||
@ -229,13 +262,18 @@ package:
|
|||||||
@echo 'make no-all remove all pkgs from src dir'
|
@echo 'make no-all remove all pkgs from src dir'
|
||||||
@echo 'make yes-standard (yes-std) install all standard pkgs'
|
@echo 'make yes-standard (yes-std) install all standard pkgs'
|
||||||
@echo 'make no-standard (no-srd) remove all standard pkgs'
|
@echo 'make no-standard (no-srd) remove all standard pkgs'
|
||||||
@echo ''
|
|
||||||
@echo 'make yes-user install all user pkgs'
|
@echo 'make yes-user install all user pkgs'
|
||||||
@echo 'make no-user remove all user pkgs'
|
@echo 'make no-user remove all user pkgs'
|
||||||
@echo 'make no-lib remove all pkgs with external libs'
|
@echo 'make yes-lib install all pkgs with libs (included or ext)'
|
||||||
|
@echo 'make no-lib remove all pkgs with libs (included or ext)'
|
||||||
|
@echo 'make yes-ext install all pkgs with external libs'
|
||||||
|
@echo 'make no-ext remove all pkgs with external libs'
|
||||||
|
@echo ''
|
||||||
@echo 'make package-update (pu) replace src files with package files'
|
@echo 'make package-update (pu) replace src files with package files'
|
||||||
@echo 'make package-overwrite replace package files with src files'
|
@echo 'make package-overwrite replace package files with src files'
|
||||||
@echo 'make package-diff (pd) diff src files against package file'
|
@echo 'make package-diff (pd) diff src files against package file'
|
||||||
|
@echo ''
|
||||||
|
@echo 'make lib-package download/build/install a package library'
|
||||||
|
|
||||||
yes-all:
|
yes-all:
|
||||||
@for p in $(PACKALL); do $(MAKE) yes-$$p; done
|
@for p in $(PACKALL); do $(MAKE) yes-$$p; done
|
||||||
@ -255,9 +293,18 @@ yes-user:
|
|||||||
no-user:
|
no-user:
|
||||||
@for p in $(PACKUSER); do $(MAKE) no-$$p; done
|
@for p in $(PACKUSER); do $(MAKE) no-$$p; done
|
||||||
|
|
||||||
|
yes-lib:
|
||||||
|
@for p in $(PACKLIB); do $(MAKE) yes-$$p; done
|
||||||
|
|
||||||
no-lib:
|
no-lib:
|
||||||
@for p in $(PACKLIB); do $(MAKE) no-$$p; done
|
@for p in $(PACKLIB); do $(MAKE) no-$$p; done
|
||||||
|
|
||||||
|
yes-ext:
|
||||||
|
@for p in $(PACKEXT); do $(MAKE) yes-$$p; done
|
||||||
|
|
||||||
|
no-ext:
|
||||||
|
@for p in $(PACKEXT); do $(MAKE) no-$$p; done
|
||||||
|
|
||||||
yes-%:
|
yes-%:
|
||||||
@if [ ! -e Makefile.package ]; \
|
@if [ ! -e Makefile.package ]; \
|
||||||
then cp Makefile.package.empty Makefile.package; fi
|
then cp Makefile.package.empty Makefile.package; fi
|
||||||
@ -288,6 +335,16 @@ no-%:
|
|||||||
$(SHELL) Depend.sh $(NODIR) 0; \
|
$(SHELL) Depend.sh $(NODIR) 0; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
# download/build/install a package library
|
||||||
|
|
||||||
|
lib-%:
|
||||||
|
@if [ ! -e ../lib/$(LIBDIR)/Install.py ]; then \
|
||||||
|
echo "Install script for lib $(@:lib-%=%) does not exist"; \
|
||||||
|
else \
|
||||||
|
echo "Installing lib for package $(@:lib-%=%)"; \
|
||||||
|
cd ../lib/$(LIBDIR); python Install.py $(args); \
|
||||||
|
fi;
|
||||||
|
|
||||||
# status = list src files that differ from package files
|
# status = list src files that differ from package files
|
||||||
# update = replace src files with newer package files
|
# update = replace src files with newer package files
|
||||||
# overwrite = overwrite package files with newer src files
|
# overwrite = overwrite package files with newer src files
|
||||||
|
|||||||
@ -84,7 +84,7 @@ void ComputeEventDisplace::init()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
return non-zero if an atom has moved > displace_dist since last event
|
return non-zero if any atom has moved > displace_dist since last event
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
double ComputeEventDisplace::compute_scalar()
|
double ComputeEventDisplace::compute_scalar()
|
||||||
@ -145,6 +145,62 @@ double ComputeEventDisplace::compute_scalar()
|
|||||||
return scalar;
|
return scalar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
return count of atoms that have moved > displace_dist since last event
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int ComputeEventDisplace::all_events()
|
||||||
|
{
|
||||||
|
invoked_scalar = update->ntimestep;
|
||||||
|
|
||||||
|
if (id_event == NULL) return 0.0;
|
||||||
|
|
||||||
|
int event = 0;
|
||||||
|
double **xevent = fix_event->array_atom;
|
||||||
|
|
||||||
|
double **x = atom->x;
|
||||||
|
int *mask = atom->mask;
|
||||||
|
imageint *image = atom->image;
|
||||||
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
|
double *h = domain->h;
|
||||||
|
double xprd = domain->xprd;
|
||||||
|
double yprd = domain->yprd;
|
||||||
|
double zprd = domain->zprd;
|
||||||
|
int xbox,ybox,zbox;
|
||||||
|
double dx,dy,dz,rsq;
|
||||||
|
|
||||||
|
if (triclinic == 0) {
|
||||||
|
for (int i = 0; i < nlocal; i++)
|
||||||
|
if (mask[i] & groupbit) {
|
||||||
|
xbox = (image[i] & IMGMASK) - IMGMAX;
|
||||||
|
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
|
||||||
|
zbox = (image[i] >> IMG2BITS) - IMGMAX;
|
||||||
|
dx = x[i][0] + xbox*xprd - xevent[i][0];
|
||||||
|
dy = x[i][1] + ybox*yprd - xevent[i][1];
|
||||||
|
dz = x[i][2] + zbox*zprd - xevent[i][2];
|
||||||
|
rsq = dx*dx + dy*dy + dz*dz;
|
||||||
|
if (rsq >= displace_distsq) event++;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < nlocal; i++)
|
||||||
|
if (mask[i] & groupbit) {
|
||||||
|
xbox = (image[i] & IMGMASK) - IMGMAX;
|
||||||
|
ybox = (image[i] >> IMGBITS & IMGMASK) - IMGMAX;
|
||||||
|
zbox = (image[i] >> IMG2BITS) - IMGMAX;
|
||||||
|
dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xevent[i][0];
|
||||||
|
dy = x[i][1] + h[1]*ybox + h[3]*zbox - xevent[i][1];
|
||||||
|
dz = x[i][2] + h[2]*zbox - xevent[i][2];
|
||||||
|
rsq = dx*dx + dy*dy + dz*dz;
|
||||||
|
if (rsq >= displace_distsq) event++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int allevents;
|
||||||
|
MPI_Allreduce(&event,&allevents,1,MPI_INT,MPI_SUM,world);
|
||||||
|
|
||||||
|
return allevents;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@ -30,8 +30,11 @@ class ComputeEventDisplace : public Compute {
|
|||||||
~ComputeEventDisplace();
|
~ComputeEventDisplace();
|
||||||
void init();
|
void init();
|
||||||
double compute_scalar();
|
double compute_scalar();
|
||||||
|
|
||||||
|
int all_events();
|
||||||
void reset_extra_compute_fix(const char *);
|
void reset_extra_compute_fix(const char *);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int triclinic;
|
int triclinic;
|
||||||
double displace_distsq;
|
double displace_distsq;
|
||||||
|
|||||||
@ -130,7 +130,7 @@ void Finish::end(int flag)
|
|||||||
atom->natoms);
|
atom->natoms);
|
||||||
if (logfile) fprintf(logfile,fmt1,time_loop,ntasks,update->nsteps,
|
if (logfile) fprintf(logfile,fmt1,time_loop,ntasks,update->nsteps,
|
||||||
atom->natoms);
|
atom->natoms);
|
||||||
|
|
||||||
// Gromacs/NAMD-style performance metric for suitable unit settings
|
// Gromacs/NAMD-style performance metric for suitable unit settings
|
||||||
|
|
||||||
if ( timeflag && !minflag && !prdflag && !tadflag &&
|
if ( timeflag && !minflag && !prdflag && !tadflag &&
|
||||||
@ -144,7 +144,7 @@ void Finish::end(int flag)
|
|||||||
double one_fs = force->femtosecond;
|
double one_fs = force->femtosecond;
|
||||||
double t_step = ((double) time_loop) / ((double) update->nsteps);
|
double t_step = ((double) time_loop) / ((double) update->nsteps);
|
||||||
double step_t = 1.0/t_step;
|
double step_t = 1.0/t_step;
|
||||||
|
|
||||||
if (strcmp(update->unit_style,"lj") == 0) {
|
if (strcmp(update->unit_style,"lj") == 0) {
|
||||||
double tau_day = 24.0*3600.0 / t_step * update->dt / one_fs;
|
double tau_day = 24.0*3600.0 / t_step * update->dt / one_fs;
|
||||||
const char perf[] = "Performance: %.3f tau/day, %.3f timesteps/s\n";
|
const char perf[] = "Performance: %.3f tau/day, %.3f timesteps/s\n";
|
||||||
@ -161,26 +161,28 @@ void Finish::end(int flag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CPU use on MPI tasks and OpenMP threads
|
// CPU use on MPI tasks and OpenMP threads
|
||||||
|
|
||||||
if (lmp->kokkos) {
|
if (timeflag) {
|
||||||
const char fmt2[] =
|
if (lmp->kokkos) {
|
||||||
"%.1f%% CPU use with %d MPI tasks x %d OpenMP threads\n";
|
const char fmt2[] =
|
||||||
if (screen) fprintf(screen,fmt2,cpu_loop,nprocs,
|
"%.1f%% CPU use with %d MPI tasks x %d OpenMP threads\n";
|
||||||
lmp->kokkos->num_threads);
|
if (screen) fprintf(screen,fmt2,cpu_loop,nprocs,
|
||||||
if (logfile) fprintf(logfile,fmt2,cpu_loop,nprocs,
|
lmp->kokkos->num_threads);
|
||||||
lmp->kokkos->num_threads);
|
if (logfile) fprintf(logfile,fmt2,cpu_loop,nprocs,
|
||||||
} else {
|
lmp->kokkos->num_threads);
|
||||||
|
} else {
|
||||||
#if defined(_OPENMP)
|
#if defined(_OPENMP)
|
||||||
const char fmt2[] =
|
const char fmt2[] =
|
||||||
"%.1f%% CPU use with %d MPI tasks x %d OpenMP threads\n";
|
"%.1f%% CPU use with %d MPI tasks x %d OpenMP threads\n";
|
||||||
if (screen) fprintf(screen,fmt2,cpu_loop,nprocs,nthreads);
|
if (screen) fprintf(screen,fmt2,cpu_loop,nprocs,nthreads);
|
||||||
if (logfile) fprintf(logfile,fmt2,cpu_loop,nprocs,nthreads);
|
if (logfile) fprintf(logfile,fmt2,cpu_loop,nprocs,nthreads);
|
||||||
#else
|
#else
|
||||||
const char fmt2[] =
|
const char fmt2[] =
|
||||||
"%.1f%% CPU use with %d MPI tasks x no OpenMP threads\n";
|
"%.1f%% CPU use with %d MPI tasks x no OpenMP threads\n";
|
||||||
if (screen) fprintf(screen,fmt2,cpu_loop,nprocs);
|
if (screen) fprintf(screen,fmt2,cpu_loop,nprocs);
|
||||||
if (logfile) fprintf(logfile,fmt2,cpu_loop,nprocs);
|
if (logfile) fprintf(logfile,fmt2,cpu_loop,nprocs);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class Integrate : protected Pointers {
|
|||||||
Integrate(class LAMMPS *, int, char **);
|
Integrate(class LAMMPS *, int, char **);
|
||||||
virtual ~Integrate();
|
virtual ~Integrate();
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void setup() = 0;
|
virtual void setup(int flag=1) = 0;
|
||||||
virtual void setup_minimal(int) = 0;
|
virtual void setup_minimal(int) = 0;
|
||||||
virtual void run(int) = 0;
|
virtual void run(int) = 0;
|
||||||
virtual void cleanup() {}
|
virtual void cleanup() {}
|
||||||
|
|||||||
10
src/min.cpp
10
src/min.cpp
@ -180,13 +180,15 @@ void Min::init()
|
|||||||
setup before run
|
setup before run
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Min::setup()
|
void Min::setup(int flag)
|
||||||
{
|
{
|
||||||
if (comm->me == 0 && screen) {
|
if (comm->me == 0 && screen) {
|
||||||
fprintf(screen,"Setting up %s style minimization ...\n",
|
fprintf(screen,"Setting up %s style minimization ...\n",
|
||||||
update->minimize_style);
|
update->minimize_style);
|
||||||
fprintf(screen," Unit style : %s\n", update->unit_style);
|
if (flag) {
|
||||||
timer->print_timeout(screen);
|
fprintf(screen," Unit style : %s\n", update->unit_style);
|
||||||
|
timer->print_timeout(screen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
update->setupflag = 1;
|
update->setupflag = 1;
|
||||||
|
|
||||||
@ -294,7 +296,7 @@ void Min::setup()
|
|||||||
requestor[m]->min_xf_get(m);
|
requestor[m]->min_xf_get(m);
|
||||||
|
|
||||||
modify->setup(vflag);
|
modify->setup(vflag);
|
||||||
output->setup();
|
output->setup(flag);
|
||||||
update->setupflag = 0;
|
update->setupflag = 0;
|
||||||
|
|
||||||
// stats for initial thermo output
|
// stats for initial thermo output
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class Min : protected Pointers {
|
|||||||
Min(class LAMMPS *);
|
Min(class LAMMPS *);
|
||||||
virtual ~Min();
|
virtual ~Min();
|
||||||
virtual void init();
|
virtual void init();
|
||||||
void setup();
|
void setup(int flag=1);
|
||||||
void setup_minimal(int);
|
void setup_minimal(int);
|
||||||
void run(int);
|
void run(int);
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|||||||
@ -652,6 +652,21 @@ void Output::delete_dump(char *id)
|
|||||||
ndump--;
|
ndump--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
find a dump by ID
|
||||||
|
return index of dump or -1 if not found
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int Output::find_dump(const char *id)
|
||||||
|
{
|
||||||
|
if (id == NULL) return -1;
|
||||||
|
int idump;
|
||||||
|
for (idump = 0; idump < ndump; idump++)
|
||||||
|
if (strcmp(id,dump[idump]->id) == 0) break;
|
||||||
|
if (idump == ndump) return -1;
|
||||||
|
return idump;
|
||||||
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
set thermo output frequency from input script
|
set thermo output frequency from input script
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|||||||
@ -76,6 +76,7 @@ class Output : protected Pointers {
|
|||||||
void add_dump(int, char **); // add a Dump to Dump list
|
void add_dump(int, char **); // add a Dump to Dump list
|
||||||
void modify_dump(int, char **); // modify a Dump
|
void modify_dump(int, char **); // modify a Dump
|
||||||
void delete_dump(char *); // delete a Dump from Dump list
|
void delete_dump(char *); // delete a Dump from Dump list
|
||||||
|
int find_dump(const char *); // find a Dump ID
|
||||||
|
|
||||||
void set_thermo(int, char **); // set thermo output freqquency
|
void set_thermo(int, char **); // set thermo output freqquency
|
||||||
void create_thermo(int, char **); // create a thermo style
|
void create_thermo(int, char **); // create a thermo style
|
||||||
|
|||||||
@ -398,24 +398,27 @@ void Respa::init()
|
|||||||
setup before run
|
setup before run
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Respa::setup()
|
void Respa::setup(int flag)
|
||||||
{
|
{
|
||||||
if (comm->me == 0 && screen) {
|
if (comm->me == 0 && screen) {
|
||||||
fprintf(screen,"Setting up r-RESPA run ...\n");
|
fprintf(screen,"Setting up r-RESPA run ...\n");
|
||||||
fprintf(screen," Unit style : %s\n", update->unit_style);
|
if (flag) {
|
||||||
fprintf(screen," Current step : " BIGINT_FORMAT "\n", update->ntimestep);
|
fprintf(screen," Unit style : %s\n", update->unit_style);
|
||||||
fprintf(screen," Time steps :");
|
fprintf(screen," Current step : " BIGINT_FORMAT "\n",
|
||||||
for (int ilevel=0; ilevel < nlevels; ++ilevel)
|
update->ntimestep);
|
||||||
fprintf(screen," %d:%g",ilevel+1, step[ilevel]);
|
fprintf(screen," Time steps :");
|
||||||
fprintf(screen,"\n r-RESPA fixes :");
|
for (int ilevel=0; ilevel < nlevels; ++ilevel)
|
||||||
for (int l=0; l < modify->n_post_force_respa; ++l) {
|
fprintf(screen," %d:%g",ilevel+1, step[ilevel]);
|
||||||
Fix *f = modify->fix[modify->list_post_force_respa[l]];
|
fprintf(screen,"\n r-RESPA fixes :");
|
||||||
if (f->respa_level >= 0)
|
for (int l=0; l < modify->n_post_force_respa; ++l) {
|
||||||
fprintf(screen," %d:%s[%s]",
|
Fix *f = modify->fix[modify->list_post_force_respa[l]];
|
||||||
MIN(f->respa_level+1,nlevels),f->style,f->id);
|
if (f->respa_level >= 0)
|
||||||
|
fprintf(screen," %d:%s[%s]",
|
||||||
|
MIN(f->respa_level+1,nlevels),f->style,f->id);
|
||||||
|
}
|
||||||
|
fprintf(screen,"\n");
|
||||||
|
timer->print_timeout(screen);
|
||||||
}
|
}
|
||||||
fprintf(screen,"\n");
|
|
||||||
timer->print_timeout(screen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update->setupflag = 1;
|
update->setupflag = 1;
|
||||||
@ -482,7 +485,7 @@ void Respa::setup()
|
|||||||
|
|
||||||
sum_flevel_f();
|
sum_flevel_f();
|
||||||
modify->setup(vflag);
|
modify->setup(vflag);
|
||||||
output->setup();
|
output->setup(flag);
|
||||||
update->setupflag = 0;
|
update->setupflag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class Respa : public Integrate {
|
|||||||
Respa(class LAMMPS *, int, char **);
|
Respa(class LAMMPS *, int, char **);
|
||||||
virtual ~Respa();
|
virtual ~Respa();
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void setup();
|
virtual void setup(int flag=1);
|
||||||
virtual void setup_minimal(int);
|
virtual void setup_minimal(int);
|
||||||
virtual void run(int);
|
virtual void run(int);
|
||||||
virtual void cleanup();
|
virtual void cleanup();
|
||||||
|
|||||||
@ -85,14 +85,17 @@ void Verlet::init()
|
|||||||
setup before run
|
setup before run
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Verlet::setup()
|
void Verlet::setup(int flag)
|
||||||
{
|
{
|
||||||
if (comm->me == 0 && screen) {
|
if (comm->me == 0 && screen) {
|
||||||
fprintf(screen,"Setting up Verlet run ...\n");
|
fprintf(screen,"Setting up Verlet run ...\n");
|
||||||
fprintf(screen," Unit style : %s\n", update->unit_style);
|
if (flag) {
|
||||||
fprintf(screen," Current step : " BIGINT_FORMAT "\n", update->ntimestep);
|
fprintf(screen," Unit style : %s\n", update->unit_style);
|
||||||
fprintf(screen," Time step : %g\n", update->dt);
|
fprintf(screen," Current step : " BIGINT_FORMAT "\n",
|
||||||
timer->print_timeout(screen);
|
update->ntimestep);
|
||||||
|
fprintf(screen," Time step : %g\n", update->dt);
|
||||||
|
timer->print_timeout(screen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lmp->kokkos)
|
if (lmp->kokkos)
|
||||||
@ -148,7 +151,7 @@ void Verlet::setup()
|
|||||||
if (force->newton) comm->reverse_comm();
|
if (force->newton) comm->reverse_comm();
|
||||||
|
|
||||||
modify->setup(vflag);
|
modify->setup(vflag);
|
||||||
output->setup();
|
output->setup(flag);
|
||||||
update->setupflag = 0;
|
update->setupflag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class Verlet : public Integrate {
|
|||||||
Verlet(class LAMMPS *, int, char **);
|
Verlet(class LAMMPS *, int, char **);
|
||||||
virtual ~Verlet() {}
|
virtual ~Verlet() {}
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void setup();
|
virtual void setup(int flag=1);
|
||||||
virtual void setup_minimal(int);
|
virtual void setup_minimal(int);
|
||||||
virtual void run(int);
|
virtual void run(int);
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|||||||
@ -297,6 +297,9 @@ void WriteRestart::write(char *file)
|
|||||||
|
|
||||||
// communication buffer for my atom info
|
// communication buffer for my atom info
|
||||||
// max_size = largest buffer needed by any proc
|
// max_size = largest buffer needed by any proc
|
||||||
|
// NOTE: are assuming size_restart() returns 32-bit int
|
||||||
|
// for a huge one-proc problem, nlocal could be 32-bit
|
||||||
|
// but nlocal * doubles-peratom could oveflow
|
||||||
|
|
||||||
int max_size;
|
int max_size;
|
||||||
int send_size = atom->avec->size_restart();
|
int send_size = atom->avec->size_restart();
|
||||||
|
|||||||
Reference in New Issue
Block a user