From 050244f229dffe41485031f21047afc11ab1d11e Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 2 Jul 2015 14:26:05 +0000 Subject: [PATCH 1/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13510 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/domain.cpp | 4 ++++ src/read_restart.cpp | 10 +++++++++- src/update.cpp | 4 ++-- src/write_restart.cpp | 10 +++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/domain.cpp b/src/domain.cpp index 3c0273926b..c84e619cbd 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -72,6 +72,10 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) boundary[1][0] = boundary[1][1] = 0; boundary[2][0] = boundary[2][1] = 0; + minxlo = minxhi = 0.0; + minylo = minyhi = 0.0; + minzlo = minzhi = 0.0; + triclinic = 0; tiltsmall = 1; diff --git a/src/read_restart.cpp b/src/read_restart.cpp index e2e2a264fb..1b4caacbd2 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -60,7 +60,7 @@ enum{VERSION,SMALLINT,TAGINT,BIGINT, SPECIAL_LJ,SPECIAL_COUL, MASS,PAIR,BOND,ANGLE,DIHEDRAL,IMPROPER, MULTIPROC,MPIIO,PROCSPERFILE,PERPROC, - IMAGEINT}; + IMAGEINT,BOUNDMIN}; #define LB_FACTOR 1.1 @@ -794,6 +794,14 @@ void ReadRestart::header(int incompatible) domain->nonperiodic = 2; } + } else if (flag == BOUNDMIN) { + double minbound[6]; + read_int(); + read_double_vec(6,minbound); + domain->minxlo = minbound[0]; domain->minxhi = minbound[1]; + domain->minylo = minbound[2]; domain->minyhi = minbound[3]; + domain->minzlo = minbound[4]; domain->minzhi = minbound[5]; + // create new AtomVec class using any stored args } else if (flag == ATOM_STYLE) { diff --git a/src/update.cpp b/src/update.cpp index 4300a3c92e..e012449b9c 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -141,7 +141,7 @@ void Update::set_units(const char *style) force->hplanck = 95.306976368; force->mvv2e = 48.88821291 * 48.88821291; force->ftm2v = 1.0 / 48.88821291 / 48.88821291; - force->mv2d = 1.0 / 0.602214179; + force->mv2d = 1.0 / 0.602214129; force->nktv2p = 68568.415; force->qqr2e = 332.06371; force->qe2f = 23.060549; @@ -162,7 +162,7 @@ void Update::set_units(const char *style) force->hplanck = 4.135667403e-3; force->mvv2e = 1.0364269e-4; force->ftm2v = 1.0 / 1.0364269e-4; - force->mv2d = 1.0 / 0.602214179; + force->mv2d = 1.0 / 0.602214129; force->nktv2p = 1.6021765e6; force->qqr2e = 14.399645; force->qe2f = 1.0; diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 83edc522fe..e74479e357 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -59,7 +59,7 @@ enum{VERSION,SMALLINT,TAGINT,BIGINT, SPECIAL_LJ,SPECIAL_COUL, MASS,PAIR,BOND,ANGLE,DIHEDRAL,IMPROPER, MULTIPROC,MPIIO,PROCSPERFILE,PERPROC, - IMAGEINT}; + IMAGEINT,BOUNDMIN}; enum{IGNORE,WARN,ERROR}; // same as thermo.cpp @@ -454,6 +454,14 @@ void WriteRestart::header() write_int(ZPERIODIC,domain->zperiodic); write_int_vec(BOUNDARY,6,&domain->boundary[0][0]); + // added field for shrink-wrap boundaries with minimum - 2 Jul 2015 + + double minbound[6]; + minbound[0] = domain->minxlo; minbound[1] = domain->minxhi; + minbound[2] = domain->minylo; minbound[3] = domain->minyhi; + minbound[4] = domain->minzlo; minbound[5] = domain->minzhi; + write_double_vec(BOUNDMIN,6,minbound); + // write atom_style and its args write_string(ATOM_STYLE,atom->atom_style); From 79e142b2ca431ec0d5cec99182038aed5498ce05 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 2 Jul 2015 19:09:11 +0000 Subject: [PATCH 2/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13511 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- python/install.py | 37 +++++++++---------------------------- python/lammps.py | 9 +++++++-- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/python/install.py b/python/install.py index 6128310c0a..d589ebca33 100644 --- a/python/install.py +++ b/python/install.py @@ -3,42 +3,20 @@ # copy LAMMPS src/liblammps.so and lammps.py to system dirs instructions = """ -Syntax: python install.py [-h] [libdir] [pydir] - libdir = target dir for src/liblammps.so, default = /usr/local/lib - pydir = target dir for lammps.py, default = Python site-packages dir +Syntax: python install.py [-h] [pydir] + pydir = target dir for lammps.py and liblammps.so + default = Python site-packages dir """ import sys,os,commands -if (len(sys.argv) > 1 and sys.argv[1] == "-h") or len(sys.argv) > 3: +if (len(sys.argv) > 1 and sys.argv[1] == "-h") or len(sys.argv) > 2: print instructions sys.exit() -if len(sys.argv) >= 2: libdir = sys.argv[1] -else: libdir = "/usr/local/lib" - -if len(sys.argv) == 3: pydir = sys.argv[2] +if len(sys.argv) == 2: pydir = sys.argv[1] else: pydir = "" -# copy C lib to libdir if it exists -# warn if not in LD_LIBRARY_PATH or LD_LIBRARY_PATH is undefined - -if not os.path.isdir(libdir): - print "ERROR: libdir %s does not exist" % libdir - sys.exit() - -if "LD_LIBRARY_PATH" not in os.environ: - print "WARNING: LD_LIBRARY_PATH undefined, cannot check libdir %s" % libdir -else: - libpaths = os.environ['LD_LIBRARY_PATH'].split(':') - if libdir not in libpaths: - print "WARNING: libdir %s not in LD_LIBRARY_PATH" % libdir - -str = "cp ../src/liblammps.so %s" % libdir -print str -outstr = commands.getoutput(str) -if len(outstr.strip()): print outstr - # copy lammps.py to pydir if it exists # if pydir not specified, install in site-packages via distutils setup() @@ -50,6 +28,9 @@ if pydir: print str outstr = commands.getoutput(str) if len(outstr.strip()): print outstr + str = "cp ../src/liblammps.so %s" % pydir + print str + outstr = commands.getoutput(str) sys.exit() print "installing lammps.py in Python site-packages dir" @@ -59,7 +40,7 @@ os.chdir('../python') # in case invoked via make in src dir from distutils.core import setup sys.argv = ["setup.py","install"] # as if had run "python setup.py install" setup(name = "lammps", - version = "15Aug12", + version = "15May15", author = "Steve Plimpton", author_email = "sjplimp@sandia.gov", url = "http://lammps.sandia.gov", diff --git a/python/lammps.py b/python/lammps.py index be55bcd979..a3a979cd3f 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -15,16 +15,21 @@ import sys,traceback,types from ctypes import * +from os.path import dirname,abspath,join +from inspect import getsourcefile class lammps: def __init__(self,name="",cmdargs=None,ptr=None): + # determine module location + modpath = dirname(abspath(getsourcefile(lambda:0))) + # load liblammps.so by default # if name = "g++", load liblammps_g++.so try: - if not name: self.lib = CDLL("liblammps.so",RTLD_GLOBAL) - else: self.lib = CDLL("liblammps_%s.so" % name,RTLD_GLOBAL) + if not name: self.lib = CDLL(join(modpath,"liblammps.so"),RTLD_GLOBAL) + else: self.lib = CDLL(join(modpath,"/liblammps_%s.so" % name),RTLD_GLOBAL) except: type,value,tb = sys.exc_info() traceback.print_exception(type,value,tb) From ccfea31ae52b81fc45f3a2f0342c2d0d51b57c55 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 2 Jul 2015 23:10:34 +0000 Subject: [PATCH 3/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13512 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/version.h b/src/version.h index 1cdeba3d22..0adc31e88e 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "1 Jul 2015" +#define LAMMPS_VERSION "2 Jul 2015" From 8db4d807260a0eb1d30a58289596c11eeaf74462 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Thu, 2 Jul 2015 23:10:37 +0000 Subject: [PATCH 4/4] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13513 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/Manual.html | 4 ++-- doc/Manual.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/Manual.html b/doc/Manual.html index 6c1d7a803e..43ff294a76 100644 --- a/doc/Manual.html +++ b/doc/Manual.html @@ -1,7 +1,7 @@ LAMMPS Users Manual - + @@ -22,7 +22,7 @@

LAMMPS Documentation

-

1 Jul 2015 version +

2 Jul 2015 version

Version info:

diff --git a/doc/Manual.txt b/doc/Manual.txt index 885b2aa63c..8e9edcbc55 100644 --- a/doc/Manual.txt +++ b/doc/Manual.txt @@ -1,6 +1,6 @@ LAMMPS Users Manual - + @@ -18,7 +18,7 @@

LAMMPS Documentation :c,h3 -1 Jul 2015 version :c,h4 +2 Jul 2015 version :c,h4 Version info: :h4