forked from lijiext/lammps
Merge branch 'master' into USER-DPD_kokkos_testing
This commit is contained in:
commit
9695aa6092
|
@ -734,8 +734,8 @@ package"_Section_start.html#start_3.
|
|||
"smd/wall/surface"_fix_smd_wall_surface.html,
|
||||
"temp/rescale/eff"_fix_temp_rescale_eff.html,
|
||||
"ti/spring"_fix_ti_spring.html,
|
||||
"ttm/mod"_fix_ttm.html
|
||||
"wall/ees"_fix_wall_ees.html
|
||||
"ttm/mod"_fix_ttm.html,
|
||||
"wall/ees"_fix_wall_ees.html,
|
||||
"wall/region/ees"_fix_wall_ees.html :tb(c=6,ea=c)
|
||||
|
||||
:line
|
||||
|
|
|
@ -492,14 +492,38 @@ Minnesota).
|
|||
|
||||
[Install or un-install:]
|
||||
|
||||
Using this package requires the KIM library and its models
|
||||
(interatomic potentials) to be downloaded and installed on your
|
||||
system. The library can be downloaded and built in lib/kim or
|
||||
elsewhere on your system. Details of the download, build, and install
|
||||
process for KIM are given in the lib/kim/README file.
|
||||
Before building LAMMPS with this package, you must first download and
|
||||
build the KIM library and include the KIM models that you want to
|
||||
use. You can do this manually if you prefer; follow the instructions
|
||||
in lib/kim/README. You can also do it in one step from the lammps/src
|
||||
dir, using a command like these, which simply invoke the
|
||||
lib/kim/Install.py script with the specified args.
|
||||
|
||||
Once that process is complete, you can then install/un-install the
|
||||
package and build LAMMPS in the usual manner:
|
||||
make lib-kim # print help message
|
||||
make lib-kim args="-b . none" # install KIM API lib with only example models
|
||||
make lib-kim args="-b . Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model
|
||||
make lib-kim args="-b . OpenKIM" # install KIM API lib with all models
|
||||
make lib-kim args="-a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver :pre
|
||||
|
||||
Note that in LAMMPS lingo, a KIM model driver is a pair style
|
||||
(e.g. EAM or Tersoff). A KIM model is a pair style for a particular
|
||||
element or alloy and set of parameters, e.g. EAM for Cu with a
|
||||
specific EAM potential file. Also note that installing the KIM API
|
||||
library with all its models, may take around 30 min to build. Of
|
||||
course you only need to do that once.
|
||||
|
||||
See the list of KIM model drivers here:
|
||||
https://openkim.org/kim-items/model-drivers/alphabetical
|
||||
|
||||
See the list of all KIM models here:
|
||||
https://openkim.org/kim-items/models/by-model-drivers
|
||||
|
||||
See the list of example KIM models included by default here:
|
||||
https://openkim.org/kim-api in the "What is in the KIM API source
|
||||
package?" section
|
||||
|
||||
You can then install/un-install the package and build LAMMPS in the
|
||||
usual manner:
|
||||
|
||||
make yes-kim
|
||||
make machine :pre
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do a generic build of a library
|
||||
# soft linked to by many of the lib/Install.py files
|
||||
# used to automate the steps described in the corresponding lib/README
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
extraflag = 0
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-e":
|
||||
if iarg+2 > nargs: error()
|
||||
extraflag = 1
|
||||
suffix = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# create Makefile.auto as copy of Makefile.machine
|
||||
# reset EXTRAMAKE if requested
|
||||
|
||||
if not os.path.exists("Makefile.%s" % machine):
|
||||
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
|
||||
|
||||
lines = open("Makefile.%s" % machine,'r').readlines()
|
||||
fp = open("Makefile.auto",'w')
|
||||
|
||||
for line in lines:
|
||||
words = line.split()
|
||||
if len(words) == 3 and extraflag and \
|
||||
words[0] == "EXTRAMAKE" and words[1] == '=':
|
||||
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
|
||||
print >>fp,line,
|
||||
|
||||
fp.close()
|
||||
|
||||
# make the library via Makefile.auto
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
if not os.path.exists("Makefile.lammps"):
|
||||
print "lib/%s/Makefile.lammps was NOT created" % lib
|
|
@ -0,0 +1 @@
|
|||
Install.py
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do a generic build of a library
|
||||
# soft linked to by many of the lib/Install.py files
|
||||
# used to automate the steps described in the corresponding lib/README
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
extraflag = 0
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-e":
|
||||
if iarg+2 > nargs: error()
|
||||
extraflag = 1
|
||||
suffix = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# create Makefile.auto as copy of Makefile.machine
|
||||
# reset EXTRAMAKE if requested
|
||||
|
||||
if not os.path.exists("Makefile.%s" % machine):
|
||||
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
|
||||
|
||||
lines = open("Makefile.%s" % machine,'r').readlines()
|
||||
fp = open("Makefile.auto",'w')
|
||||
|
||||
for line in lines:
|
||||
words = line.split()
|
||||
if len(words) == 3 and extraflag and \
|
||||
words[0] == "EXTRAMAKE" and words[1] == '=':
|
||||
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
|
||||
print >>fp,line,
|
||||
|
||||
fp.close()
|
||||
|
||||
# make the library via Makefile.auto
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
if not os.path.exists("Makefile.lammps"):
|
||||
print "lib/%s/Makefile.lammps was NOT created" % lib
|
|
@ -0,0 +1 @@
|
|||
Install.py
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do a generic build of a library
|
||||
# soft linked to by many of the lib/Install.py files
|
||||
# used to automate the steps described in the corresponding lib/README
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
extraflag = 0
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-e":
|
||||
if iarg+2 > nargs: error()
|
||||
extraflag = 1
|
||||
suffix = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# create Makefile.auto as copy of Makefile.machine
|
||||
# reset EXTRAMAKE if requested
|
||||
|
||||
if not os.path.exists("Makefile.%s" % machine):
|
||||
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
|
||||
|
||||
lines = open("Makefile.%s" % machine,'r').readlines()
|
||||
fp = open("Makefile.auto",'w')
|
||||
|
||||
for line in lines:
|
||||
words = line.split()
|
||||
if len(words) == 3 and extraflag and \
|
||||
words[0] == "EXTRAMAKE" and words[1] == '=':
|
||||
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
|
||||
print >>fp,line,
|
||||
|
||||
fp.close()
|
||||
|
||||
# make the library via Makefile.auto
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
if not os.path.exists("Makefile.lammps"):
|
||||
print "lib/%s/Makefile.lammps was NOT created" % lib
|
|
@ -0,0 +1 @@
|
|||
Install.py
|
|
@ -9,13 +9,13 @@
|
|||
#ifndef CH5MD_H
|
||||
#define CH5MD_H
|
||||
|
||||
#include "hdf5.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "hdf5.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#define CH5MD_RANK_ERROR -10
|
||||
|
||||
typedef struct h5md_element_struct {
|
||||
|
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do a generic build of a library
|
||||
# soft linked to by many of the lib/Install.py files
|
||||
# used to automate the steps described in the corresponding lib/README
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
extraflag = 0
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-e":
|
||||
if iarg+2 > nargs: error()
|
||||
extraflag = 1
|
||||
suffix = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# create Makefile.auto as copy of Makefile.machine
|
||||
# reset EXTRAMAKE if requested
|
||||
|
||||
if not os.path.exists("Makefile.%s" % machine):
|
||||
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
|
||||
|
||||
lines = open("Makefile.%s" % machine,'r').readlines()
|
||||
fp = open("Makefile.auto",'w')
|
||||
|
||||
for line in lines:
|
||||
words = line.split()
|
||||
if len(words) == 3 and extraflag and \
|
||||
words[0] == "EXTRAMAKE" and words[1] == '=':
|
||||
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
|
||||
print >>fp,line,
|
||||
|
||||
fp.close()
|
||||
|
||||
# make the library via Makefile.auto
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
if not os.path.exists("Makefile.lammps"):
|
||||
print "lib/%s/Makefile.lammps was NOT created" % lib
|
|
@ -0,0 +1 @@
|
|||
Install.py
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do a generic build of a library
|
||||
# soft linked to by many of the lib/Install.py files
|
||||
# used to automate the steps described in the corresponding lib/README
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
extraflag = 0
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-e":
|
||||
if iarg+2 > nargs: error()
|
||||
extraflag = 1
|
||||
suffix = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# create Makefile.auto as copy of Makefile.machine
|
||||
# reset EXTRAMAKE if requested
|
||||
|
||||
if not os.path.exists("Makefile.%s" % machine):
|
||||
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
|
||||
|
||||
lines = open("Makefile.%s" % machine,'r').readlines()
|
||||
fp = open("Makefile.auto",'w')
|
||||
|
||||
for line in lines:
|
||||
words = line.split()
|
||||
if len(words) == 3 and extraflag and \
|
||||
words[0] == "EXTRAMAKE" and words[1] == '=':
|
||||
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
|
||||
print >>fp,line,
|
||||
|
||||
fp.close()
|
||||
|
||||
# make the library via Makefile.auto
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
if not os.path.exists("Makefile.lammps"):
|
||||
print "lib/%s/Makefile.lammps was NOT created" % lib
|
|
@ -0,0 +1 @@
|
|||
Install.py
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do a generic build of a library
|
||||
# soft linked to by many of the lib/Install.py files
|
||||
# used to automate the steps described in the corresponding lib/README
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
extraflag = 0
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-e":
|
||||
if iarg+2 > nargs: error()
|
||||
extraflag = 1
|
||||
suffix = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# create Makefile.auto as copy of Makefile.machine
|
||||
# reset EXTRAMAKE if requested
|
||||
|
||||
if not os.path.exists("Makefile.%s" % machine):
|
||||
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
|
||||
|
||||
lines = open("Makefile.%s" % machine,'r').readlines()
|
||||
fp = open("Makefile.auto",'w')
|
||||
|
||||
for line in lines:
|
||||
words = line.split()
|
||||
if len(words) == 3 and extraflag and \
|
||||
words[0] == "EXTRAMAKE" and words[1] == '=':
|
||||
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
|
||||
print >>fp,line,
|
||||
|
||||
fp.close()
|
||||
|
||||
# make the library via Makefile.auto
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
if not os.path.exists("Makefile.lammps"):
|
||||
print "lib/%s/Makefile.lammps was NOT created" % lib
|
|
@ -0,0 +1 @@
|
|||
Install.py
|
|
@ -1,82 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# install.py tool to do a generic build of a library
|
||||
# soft linked to by many of the lib/Install.py files
|
||||
# used to automate the steps described in the corresponding lib/README
|
||||
|
||||
import sys,commands,os
|
||||
|
||||
# help message
|
||||
|
||||
help = """
|
||||
Syntax: python Install.py -m machine -e suffix
|
||||
specify -m and optionally -e, order does not matter
|
||||
-m = peform a clean followed by "make -f Makefile.machine"
|
||||
machine = suffix of a lib/Makefile.* file
|
||||
-e = set EXTRAMAKE variable in Makefile.machine to Makefile.lammps.suffix
|
||||
does not alter existing Makefile.machine
|
||||
"""
|
||||
|
||||
# print error message or help
|
||||
|
||||
def error(str=None):
|
||||
if not str: print help
|
||||
else: print "ERROR",str
|
||||
sys.exit()
|
||||
|
||||
# parse args
|
||||
|
||||
args = sys.argv[1:]
|
||||
nargs = len(args)
|
||||
if nargs == 0: error()
|
||||
|
||||
machine = None
|
||||
extraflag = 0
|
||||
|
||||
iarg = 0
|
||||
while iarg < nargs:
|
||||
if args[iarg] == "-m":
|
||||
if iarg+2 > nargs: error()
|
||||
machine = args[iarg+1]
|
||||
iarg += 2
|
||||
elif args[iarg] == "-e":
|
||||
if iarg+2 > nargs: error()
|
||||
extraflag = 1
|
||||
suffix = args[iarg+1]
|
||||
iarg += 2
|
||||
else: error()
|
||||
|
||||
# set lib from working dir
|
||||
|
||||
cwd = os.getcwd()
|
||||
lib = os.path.basename(cwd)
|
||||
|
||||
# create Makefile.auto as copy of Makefile.machine
|
||||
# reset EXTRAMAKE if requested
|
||||
|
||||
if not os.path.exists("Makefile.%s" % machine):
|
||||
error("lib/%s/Makefile.%s does not exist" % (lib,machine))
|
||||
|
||||
lines = open("Makefile.%s" % machine,'r').readlines()
|
||||
fp = open("Makefile.auto",'w')
|
||||
|
||||
for line in lines:
|
||||
words = line.split()
|
||||
if len(words) == 3 and extraflag and \
|
||||
words[0] == "EXTRAMAKE" and words[1] == '=':
|
||||
line = line.replace(words[2],"Makefile.lammps.%s" % suffix)
|
||||
print >>fp,line,
|
||||
|
||||
fp.close()
|
||||
|
||||
# make the library via Makefile.auto
|
||||
|
||||
print "Building lib%s.a ..." % lib
|
||||
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
|
||||
txt = commands.getoutput(cmd)
|
||||
print txt
|
||||
|
||||
if os.path.exists("lib%s.a" % lib): print "Build was successful"
|
||||
else: error("Build of lib/%s/lib%s.a was NOT successful" % (lib,lib))
|
||||
if not os.path.exists("Makefile.lammps"):
|
||||
print "lib/%s/Makefile.lammps was NOT created" % lib
|
|
@ -0,0 +1 @@
|
|||
Install.py
|
|
@ -446,7 +446,7 @@ void FixMSST::initial_integrate(int vflag)
|
|||
{
|
||||
int i,k;
|
||||
double p_msst; // MSST driving pressure
|
||||
double vol,TS,TS_term,escale_term;
|
||||
double vol;
|
||||
|
||||
int nlocal = atom->nlocal;
|
||||
int *mask = atom->mask;
|
||||
|
@ -469,12 +469,16 @@ void FixMSST::initial_integrate(int vflag)
|
|||
// must convert energy to mv^2 units
|
||||
|
||||
if (dftb) {
|
||||
double TS_dftb = fix_external->compute_vector(0);
|
||||
TS = force->ftm2v*TS_dftb;
|
||||
const double TS_dftb = fix_external->compute_vector(0);
|
||||
const double TS = force->ftm2v*TS_dftb;
|
||||
// update S_elec terms and compute TS_dot via finite differences
|
||||
S_elec_2 = S_elec_1;
|
||||
S_elec_1 = S_elec;
|
||||
const double Temp = temperature->compute_scalar();
|
||||
S_elec = TS/Temp;
|
||||
TS_dot = Temp*(3.0*S_elec-4.0*S_elec_1+S_elec_2)/(2.0*update->dt);
|
||||
TS_int += (update->dt*TS_dot);
|
||||
if (update->ntimestep == 1) T0S0 = TS;
|
||||
} else {
|
||||
TS = 0.0;
|
||||
T0S0 = 0.0;
|
||||
}
|
||||
|
||||
// compute new pressure and volume
|
||||
|
@ -484,16 +488,6 @@ void FixMSST::initial_integrate(int vflag)
|
|||
couple();
|
||||
vol = compute_vol();
|
||||
|
||||
// update S_elec terms and compute TS_dot via finite differences
|
||||
|
||||
S_elec_2 = S_elec_1;
|
||||
S_elec_1 = S_elec;
|
||||
double Temp = temperature->compute_scalar();
|
||||
S_elec = TS/Temp;
|
||||
TS_dot = Temp*(3.0*S_elec-4.0*S_elec_1+S_elec_2)/(2.0*update->dt);
|
||||
TS_int += (update->dt*TS_dot);
|
||||
//TS_int += (update->dt*TS_dot)/total_mass;
|
||||
|
||||
// compute etot + extra terms for conserved quantity
|
||||
|
||||
double e_scale = compute_etotal() + compute_scalar();
|
||||
|
@ -530,9 +524,9 @@ void FixMSST::initial_integrate(int vflag)
|
|||
for (i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
for ( k = 0; k < 3; k++ ) {
|
||||
double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
TS_term = TS_dot/(mass[type[i]]*velocity_sum);
|
||||
escale_term = force->ftm2v*beta*(e0-e_scale) /
|
||||
const double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
const double TS_term = TS_dot/(mass[type[i]]*velocity_sum);
|
||||
const double escale_term = force->ftm2v*beta*(e0-e_scale) /
|
||||
(mass[type[i]]*velocity_sum);
|
||||
double D = mu * omega[sd] * omega[sd] /
|
||||
(velocity_sum * mass[type[i]] * vol );
|
||||
|
@ -540,7 +534,7 @@ void FixMSST::initial_integrate(int vflag)
|
|||
old_velocity[i][k] = v[i][k];
|
||||
if ( k == direction ) D -= 2.0 * omega[sd] / vol;
|
||||
if ( fabs(dthalf * D) > 1.0e-06 ) {
|
||||
double expd = exp(D * dthalf);
|
||||
const double expd = exp(D * dthalf);
|
||||
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
|
||||
} else {
|
||||
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
|
||||
|
@ -553,15 +547,15 @@ void FixMSST::initial_integrate(int vflag)
|
|||
for (i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
for ( k = 0; k < 3; k++ ) {
|
||||
double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
const double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
double D = mu * omega[sd] * omega[sd] /
|
||||
(velocity_sum * mass[type[i]] * vol );
|
||||
old_velocity[i][k] = v[i][k];
|
||||
if ( k == direction ) {
|
||||
D = D - 2.0 * omega[sd] / vol;
|
||||
D -= 2.0 * omega[sd] / vol;
|
||||
}
|
||||
if ( fabs(dthalf * D) > 1.0e-06 ) {
|
||||
double expd = exp(D * dthalf);
|
||||
const double expd = exp(D * dthalf);
|
||||
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
|
||||
} else {
|
||||
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
|
||||
|
@ -590,16 +584,16 @@ void FixMSST::initial_integrate(int vflag)
|
|||
for (i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
for ( k = 0; k < 3; k++ ) {
|
||||
double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
TS_term = TS_dot/(mass[type[i]]*velocity_sum);
|
||||
escale_term = force->ftm2v*beta*(e0-e_scale) /
|
||||
const double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
const double TS_term = TS_dot/(mass[type[i]]*velocity_sum);
|
||||
const double escale_term = force->ftm2v*beta*(e0-e_scale) /
|
||||
(mass[type[i]]*velocity_sum);
|
||||
double D = mu * omega[sd] * omega[sd] /
|
||||
(velocity_sum * mass[type[i]] * vol );
|
||||
D += escale_term - TS_term;
|
||||
if ( k == direction ) D -= 2.0 * omega[sd] / vol;
|
||||
if ( fabs(dthalf * D) > 1.0e-06 ) {
|
||||
double expd = exp(D * dthalf);
|
||||
const double expd = exp(D * dthalf);
|
||||
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
|
||||
} else {
|
||||
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
|
||||
|
@ -612,14 +606,14 @@ void FixMSST::initial_integrate(int vflag)
|
|||
for (i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
for ( k = 0; k < 3; k++ ) {
|
||||
double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
const double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
double D = mu * omega[sd] * omega[sd] /
|
||||
(velocity_sum * mass[type[i]] * vol );
|
||||
if ( k == direction ) {
|
||||
D = D - 2.0 * omega[sd] / vol;
|
||||
D -= 2.0 * omega[sd] / vol;
|
||||
}
|
||||
if ( fabs(dthalf * D) > 1.0e-06 ) {
|
||||
double expd = exp(D * dthalf);
|
||||
const double expd = exp(D * dthalf);
|
||||
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
|
||||
} else {
|
||||
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
|
||||
|
@ -669,7 +663,6 @@ void FixMSST::final_integrate()
|
|||
{
|
||||
int i;
|
||||
double p_msst; // MSST driving pressure
|
||||
double TS_term,escale_term;
|
||||
|
||||
// v update only for atoms in MSST group
|
||||
|
||||
|
@ -687,22 +680,38 @@ void FixMSST::final_integrate()
|
|||
|
||||
double e_scale = compute_etotal() + compute_scalar();
|
||||
|
||||
// for DFTB, extract TS_dftb from fix external
|
||||
// must convert energy to mv^2 units
|
||||
|
||||
if (dftb) {
|
||||
const double TS_dftb = fix_external->compute_vector(0);
|
||||
const double TS = force->ftm2v*TS_dftb;
|
||||
S_elec_2 = S_elec_1;
|
||||
S_elec_1 = S_elec;
|
||||
const double Temp = temperature->compute_scalar();
|
||||
// update S_elec terms and compute TS_dot via finite differences
|
||||
S_elec = TS/Temp;
|
||||
TS_dot = Temp*(3.0*S_elec-4.0*S_elec_1+S_elec_2)/(2.0*update->dt);
|
||||
TS_int += (update->dt*TS_dot);
|
||||
if (update->ntimestep == 1) T0S0 = TS;
|
||||
}
|
||||
|
||||
// propagate particle velocities 1/2 step
|
||||
|
||||
if (dftb) {
|
||||
for (i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
for ( int k = 0; k < 3; k++ ) {
|
||||
double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
TS_term = TS_dot/(mass[type[i]]*velocity_sum);
|
||||
escale_term = force->ftm2v*beta*(e0-e_scale) /
|
||||
const double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
const double TS_term = TS_dot/(mass[type[i]]*velocity_sum);
|
||||
const double escale_term = force->ftm2v*beta*(e0-e_scale) /
|
||||
(mass[type[i]]*velocity_sum);
|
||||
double D = mu * omega[sd] * omega[sd] /
|
||||
(velocity_sum * mass[type[i]] * vol );
|
||||
D += escale_term - TS_term;
|
||||
if ( k == direction ) D -= 2.0 * omega[sd] / vol;
|
||||
if ( fabs(dthalf * D) > 1.0e-06 ) {
|
||||
double expd = exp(D * dthalf);
|
||||
const double expd = exp(D * dthalf);
|
||||
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
|
||||
} else {
|
||||
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
|
||||
|
@ -715,14 +724,14 @@ void FixMSST::final_integrate()
|
|||
for (i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
for ( int k = 0; k < 3; k++ ) {
|
||||
double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
const double C = f[i][k] * force->ftm2v / mass[type[i]];
|
||||
double D = mu * omega[sd] * omega[sd] /
|
||||
(velocity_sum * mass[type[i]] * vol );
|
||||
if ( k == direction ) {
|
||||
D = D - 2.0 * omega[sd] / vol;
|
||||
D -= 2.0 * omega[sd] / vol;
|
||||
}
|
||||
if ( fabs(dthalf * D) > 1.0e-06 ) {
|
||||
double expd = exp(D * dthalf);
|
||||
const double expd = exp(D * dthalf);
|
||||
v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
|
||||
} else {
|
||||
v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
|
||||
|
@ -748,7 +757,7 @@ void FixMSST::final_integrate()
|
|||
( v0 - vol )/( v0 * v0 );
|
||||
double A = total_mass * ( p_current[sd] - p0 - p_msst ) /
|
||||
( qmass * nktv2p * mvv2e );
|
||||
double B = total_mass * mu / ( qmass * vol );
|
||||
const double B = total_mass * mu / ( qmass * vol );
|
||||
|
||||
// prevent blow-up of the volume
|
||||
|
||||
|
@ -930,7 +939,7 @@ int FixMSST::modify_param(int narg, char **arg)
|
|||
|
||||
double FixMSST::compute_scalar()
|
||||
{
|
||||
// compute new pressure and volume.
|
||||
// compute new pressure and volume
|
||||
|
||||
temperature->compute_vector();
|
||||
pressure->compute_vector();
|
||||
|
@ -949,8 +958,9 @@ double FixMSST::compute_scalar()
|
|||
energy -= p0 * ( v0 - volume ) / nktv2p;
|
||||
|
||||
// subtract off precomputed TS_int integral value
|
||||
// TS_int = 0 for non DFTB calculations
|
||||
|
||||
energy -= TS_int;
|
||||
if (dftb) energy -= TS_int;
|
||||
|
||||
return energy;
|
||||
}
|
||||
|
@ -976,7 +986,7 @@ double FixMSST::compute_vector(int n)
|
|||
|
||||
/* ----------------------------------------------------------------------
|
||||
Computes the deviation of the current point
|
||||
from the Hugoniot in Kelvin for the MSST.
|
||||
from the Hugoniot in Kelvin for the MSST
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixMSST::compute_hugoniot()
|
||||
|
@ -1001,7 +1011,7 @@ double FixMSST::compute_hugoniot()
|
|||
|
||||
/* ----------------------------------------------------------------------
|
||||
Computes the deviation of the current point from the Rayleigh
|
||||
in pressure units for the MSST.
|
||||
in pressure units for the MSST
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double FixMSST::compute_rayleigh()
|
||||
|
@ -1097,4 +1107,3 @@ double FixMSST::memory_usage()
|
|||
double bytes = 3*atom->nmax * sizeof(double);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,56 +41,56 @@ class FixMSST : public Fix {
|
|||
double memory_usage();
|
||||
|
||||
private:
|
||||
double dtv,dtf,dthalf; // Full and half step sizes
|
||||
double dtv,dtf,dthalf; // full and half step sizes
|
||||
double boltz,nktv2p, mvv2e; // Boltzmann factor and unit conversions
|
||||
double total_mass; // Mass of the computational cell
|
||||
double total_mass; // mass of the computational cell
|
||||
|
||||
double omega[3]; // Time derivative of the volume
|
||||
double omega[3]; // time derivative of the volume
|
||||
double p_current[3],dilation[3];
|
||||
double qmass; // Effective cell mass
|
||||
double mu; // Effective cell viscosity
|
||||
double tscale; // Converts thermal energy to compressive
|
||||
double qmass; // effective cell mass
|
||||
double mu; // effective cell viscosity
|
||||
double tscale; // converts thermal energy to compressive
|
||||
// strain ke at simulation start
|
||||
int dftb; // flag for use with DFTB+
|
||||
|
||||
double velocity_sum; // Sum of the velocities squared
|
||||
double damping; // Damping function for TS force term at
|
||||
double velocity_sum; // sum of the velocities squared
|
||||
double damping; // damping function for TS force term at
|
||||
// small volume difference (v0 - vol)
|
||||
double T0S0; // Initial TS term for DFTB+ simulations
|
||||
double T0S0; // initial TS term for DFTB+ simulations
|
||||
double S_elec,S_elec_1,S_elec_2; // time history of electron entropy
|
||||
// for DFTB+ simulaitons
|
||||
double TS_dot; // time derivative of TS term for
|
||||
// DFTB+ simulations
|
||||
|
||||
double **old_velocity; // Saved velocities
|
||||
double **old_velocity; // saved velocities
|
||||
|
||||
int kspace_flag; // 1 if KSpace invoked, 0 if not
|
||||
int nrigid; // number of rigid fixes
|
||||
int *rfix; // indices of rigid fixes
|
||||
|
||||
char *id_temp,*id_press; // Strings with identifiers of
|
||||
char *id_temp,*id_press; // strings with identifiers of
|
||||
char *id_pe; // created computes
|
||||
|
||||
class Compute *temperature; // Computes created to evaluate
|
||||
class Compute *temperature; // computes created to evaluate
|
||||
class Compute *pressure; // thermodynamic quantities
|
||||
class Compute *pe;
|
||||
int tflag,pflag,vsflag,peflag; // Flags to keep track of computes that
|
||||
int tflag,pflag,vsflag,peflag; // flags to keep track of computes that
|
||||
// were created
|
||||
|
||||
// shock initial conditions
|
||||
|
||||
double e0; // Initial energy
|
||||
double v0; // Initial volume
|
||||
double p0; // Initial pressure
|
||||
double velocity; // Velocity of the shock
|
||||
double e0; // initial energy
|
||||
double v0; // initial volume
|
||||
double p0; // initial pressure
|
||||
double velocity; // velocity of the shock
|
||||
double lagrangian_position; // Lagrangian location of computational cell
|
||||
int direction; // Direction of shock
|
||||
int p0_set; // Is pressure set
|
||||
int v0_set; // Is volume set
|
||||
int e0_set; // Is energy set
|
||||
double TS_int; // Needed for conserved quantity
|
||||
int direction; // direction of shock
|
||||
int p0_set; // is pressure set
|
||||
int v0_set; // is volume set
|
||||
int e0_set; // is energy set
|
||||
double TS_int; // needed for conserved quantity
|
||||
// with thermal electronic excitations
|
||||
double beta; // Energy conservation scaling factor
|
||||
double beta; // energy conservation scaling factor
|
||||
|
||||
int maxold; // allocated size of old_velocity
|
||||
class FixExternal *fix_external; // ptr to fix external
|
||||
|
|
|
@ -936,7 +936,7 @@ int Balance::shift()
|
|||
// stop at this point in bstr if imbalance factor < threshold
|
||||
// this is a true 3d test of particle count per processor
|
||||
|
||||
double imbfactor = imbalance_splits(max);
|
||||
double imbfactor = imbalance_splits();
|
||||
if (imbfactor <= stopthresh) break;
|
||||
}
|
||||
|
||||
|
@ -1047,11 +1047,10 @@ int Balance::adjust(int n, double *split)
|
|||
calculate imbalance based on processor splits in 3 dims
|
||||
atoms must be in lamda coords (0-1) before called
|
||||
map particles to 3d grid of procs
|
||||
return maxcost = max load per proc
|
||||
return imbalance factor = max load per proc / ave load per proc
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double Balance::imbalance_splits(int &maxcost)
|
||||
double Balance::imbalance_splits()
|
||||
{
|
||||
double *xsplit = comm->xsplit;
|
||||
double *ysplit = comm->ysplit;
|
||||
|
@ -1088,7 +1087,7 @@ double Balance::imbalance_splits(int &maxcost)
|
|||
|
||||
MPI_Allreduce(proccost,allproccost,nprocs,MPI_DOUBLE,MPI_SUM,world);
|
||||
|
||||
maxcost = 0.0;
|
||||
double maxcost = 0.0;
|
||||
double totalcost = 0.0;
|
||||
for (int i = 0; i < nprocs; i++) {
|
||||
maxcost = MAX(maxcost,allproccost[i]);
|
||||
|
|
|
@ -81,7 +81,7 @@ class Balance : protected Pointers {
|
|||
FILE *fp; // balance output file
|
||||
int firststep;
|
||||
|
||||
double imbalance_splits(int &);
|
||||
double imbalance_splits();
|
||||
void shift_setup_static(char *);
|
||||
void tally(int, int, double *);
|
||||
int adjust(int, double *);
|
||||
|
|
18
src/rcb.cpp
18
src/rcb.cpp
|
@ -288,7 +288,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
|||
// use old value on 1st iteration if old cut dimension is the same
|
||||
// on 2nd option: could push valuehalf towards geometric center
|
||||
// with "1.0-factor" to force overshoot
|
||||
|
||||
|
||||
if (first_iteration && reuse && dim == tree[procmid].dim) {
|
||||
counters[5]++;
|
||||
valuehalf = tree[procmid].cut;
|
||||
|
@ -310,7 +310,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
|||
medme.wtlo = medme.wthi = 0.0;
|
||||
medme.countlo = medme.counthi = 0;
|
||||
medme.proclo = medme.prochi = me;
|
||||
|
||||
|
||||
// mark all active dots on one side or other of bisector
|
||||
// also set all fields in median data struct
|
||||
// save indices of closest dots on either side
|
||||
|
@ -391,11 +391,11 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
|||
|
||||
wtlo += med.wthi;
|
||||
if (targetlo-wtlo <= tolerance) break; // close enough
|
||||
|
||||
|
||||
valuemin = med.valuehi; // iterate again
|
||||
markactive = 1;
|
||||
}
|
||||
|
||||
|
||||
else if (wthi + med.totalhi < targethi) { // upper half TOO SMALL
|
||||
|
||||
wthi += med.totalhi;
|
||||
|
@ -431,7 +431,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
|||
}
|
||||
if (breakflag) break; // done if moved enough
|
||||
}
|
||||
|
||||
|
||||
wthi += med.wtlo;
|
||||
if (targethi-wthi <= tolerance) break; // close enough
|
||||
|
||||
|
@ -455,13 +455,13 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
|||
// cut produces 2 sub-boxes with reduced size in dim
|
||||
// compare smaller of the 2 sizes to previous dims
|
||||
// keep dim that has the largest smaller
|
||||
|
||||
|
||||
smaller = MIN(valuehalf-lo[dim],hi[dim]-valuehalf);
|
||||
if (smaller > largest) {
|
||||
largest = smaller;
|
||||
dim_select = dim;
|
||||
valuehalf_select = valuehalf;
|
||||
memcpy(dotmark_select,dotmark,ndot*sizeof(int));
|
||||
if (ndot > 0) memcpy(dotmark_select,dotmark,ndot*sizeof(int));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -469,11 +469,11 @@ void RCB::compute(int dimension, int n, double **x, double *wt,
|
|||
|
||||
dim = dim_select;
|
||||
valuehalf = valuehalf_select;
|
||||
memcpy(dotmark,dotmark_select,ndot*sizeof(int));
|
||||
if (ndot > 0) memcpy(dotmark,dotmark_select,ndot*sizeof(int));
|
||||
|
||||
// found median
|
||||
// store cut info only if I am procmid
|
||||
|
||||
|
||||
if (me == procmid) {
|
||||
cut = valuehalf;
|
||||
cutdim = dim;
|
||||
|
|
Loading…
Reference in New Issue