Merge pull request #2456 from akohlmey/final-changes-for-stable
Final changes for stable release
This commit is contained in:
@ -57,20 +57,14 @@ if(BUILD_DOC)
|
|||||||
|
|
||||||
# download mathjax distribution and unpack to folder "mathjax"
|
# download mathjax distribution and unpack to folder "mathjax"
|
||||||
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5)
|
||||||
file(DOWNLOAD "https://github.com/mathjax/MathJax/archive/3.0.5.tar.gz"
|
file(DOWNLOAD "https://github.com/mathjax/MathJax/archive/3.1.2.tar.gz"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
"${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz"
|
||||||
EXPECTED_MD5 5d9d3799cce77a1a95eee6be04eb68e7)
|
EXPECTED_MD5 a4a6a093a89bc2ccab1452d766b98e53)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*)
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# for increased browser compatibility
|
|
||||||
if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/polyfill.js)
|
|
||||||
file(DOWNLOAD "https://polyfill.io/v3/polyfill.min.js?features=es6"
|
|
||||||
"${DOC_BUILD_STATIC_DIR}/polyfill.js")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# set up doxygen and add targets to run it
|
# set up doxygen and add targets to run it
|
||||||
file(MAKE_DIRECTORY ${DOXYGEN_BUILD_DIR})
|
file(MAKE_DIRECTORY ${DOXYGEN_BUILD_DIR})
|
||||||
file(COPY ${LAMMPS_DOC_DIR}/doxygen/lammps-logo.png DESTINATION ${DOXYGEN_BUILD_DIR}/lammps-logo.png)
|
file(COPY ${LAMMPS_DOC_DIR}/doxygen/lammps-logo.png DESTINATION ${DOXYGEN_BUILD_DIR}/lammps-logo.png)
|
||||||
|
|||||||
12
doc/Makefile
12
doc/Makefile
@ -14,7 +14,6 @@ TXT2RST = $(VENV)/bin/txt2rst
|
|||||||
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
|
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
|
||||||
SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config
|
SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config
|
||||||
MATHJAX = $(SPHINXCONFIG)/_static/mathjax
|
MATHJAX = $(SPHINXCONFIG)/_static/mathjax
|
||||||
POLYFILL = $(SPHINXCONFIG)/_static/polyfill.js
|
|
||||||
|
|
||||||
PYTHON = $(shell which python3)
|
PYTHON = $(shell which python3)
|
||||||
DOXYGEN = $(shell which doxygen)
|
DOXYGEN = $(shell which doxygen)
|
||||||
@ -81,7 +80,7 @@ help:
|
|||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
clean-all: clean
|
clean-all: clean
|
||||||
rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(POLYFILL) $(BUILDDIR)/LAMMPS.mobi $(BUILDDIR)/LAMMPS.epub $(BUILDDIR)/Manual.pdf
|
rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(BUILDDIR)/LAMMPS.mobi $(BUILDDIR)/LAMMPS.epub $(BUILDDIR)/Manual.pdf
|
||||||
|
|
||||||
clean: clean-spelling
|
clean: clean-spelling
|
||||||
rm -rf $(BUILDDIR)/html $(BUILDDIR)/epub $(BUILDDIR)/latex $(BUILDDIR)/doctrees $(BUILDDIR)/doxygen/xml $(BUILDDIR)/doxygen-warn.log $(BUILDDIR)/doxygen/Doxyfile $(SPHINXCONFIG)/conf.py
|
rm -rf $(BUILDDIR)/html $(BUILDDIR)/epub $(BUILDDIR)/latex $(BUILDDIR)/doctrees $(BUILDDIR)/doxygen/xml $(BUILDDIR)/doxygen-warn.log $(BUILDDIR)/doxygen/Doxyfile $(SPHINXCONFIG)/conf.py
|
||||||
@ -95,7 +94,7 @@ $(SPHINXCONFIG)/conf.py: $(SPHINXCONFIG)/conf.py.in
|
|||||||
-e 's,@LAMMPS_PYTHON_DIR@,$(BUILDDIR)/../python,g' \
|
-e 's,@LAMMPS_PYTHON_DIR@,$(BUILDDIR)/../python,g' \
|
||||||
-e 's,@LAMMPS_DOC_DIR@,$(BUILDDIR),g' $< > $@
|
-e 's,@LAMMPS_DOC_DIR@,$(BUILDDIR),g' $< > $@
|
||||||
|
|
||||||
html: xmlgen $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) $(POLYFILL)
|
html: xmlgen $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
||||||
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
@if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi
|
||||||
@$(MAKE) $(MFLAGS) -C graphviz all
|
@$(MAKE) $(MFLAGS) -C graphviz all
|
||||||
@(\
|
@(\
|
||||||
@ -237,13 +236,6 @@ $(VENV):
|
|||||||
$(MATHJAX):
|
$(MATHJAX):
|
||||||
@git clone --depth 1 https://github.com/mathjax/MathJax.git $@
|
@git clone --depth 1 https://github.com/mathjax/MathJax.git $@
|
||||||
|
|
||||||
# fall back to using wget and/or unencrypted download, if curl fails
|
|
||||||
$(POLYFILL): $(MATHJAX)
|
|
||||||
@curl -s -o $@ "https://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1 || \
|
|
||||||
curl -s -o $@ "http://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1 || \
|
|
||||||
wget -O $@ "https://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1 || \
|
|
||||||
wget -O $@ "http://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1
|
|
||||||
|
|
||||||
$(TXT2RST) $(ANCHORCHECK): $(VENV)
|
$(TXT2RST) $(ANCHORCHECK): $(VENV)
|
||||||
@( \
|
@( \
|
||||||
. $(VENV)/bin/activate; \
|
. $(VENV)/bin/activate; \
|
||||||
|
|||||||
@ -73,8 +73,8 @@ after the documentation folder is returned to a pristine state with
|
|||||||
For the documentation build a python virtual environment is set up in
|
For the documentation build a python virtual environment is set up in
|
||||||
the folder ``doc/docenv`` and various python packages are installed into
|
the folder ``doc/docenv`` and various python packages are installed into
|
||||||
that virtual environment via the ``pip`` tool. For rendering embedded
|
that virtual environment via the ``pip`` tool. For rendering embedded
|
||||||
LaTeX code also the `MathJax <https://www.mathjax.org/>`_ and the
|
LaTeX code also the `MathJax <https://www.mathjax.org/>`_ JavaScript
|
||||||
`Polyfill <https://polyfill.io/>`_ JavaScript engines need to be downloaded.
|
engine needs to be downloaded.
|
||||||
|
|
||||||
The actual translation is then done via ``make`` commands in the doc
|
The actual translation is then done via ``make`` commands in the doc
|
||||||
folder. The following ``make`` commands are available:
|
folder. The following ``make`` commands are available:
|
||||||
|
|||||||
@ -21,10 +21,16 @@ where all LAMMPS development is coordinated.
|
|||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
The content for this manual is part of the LAMMPS distribution. You can
|
The content for this manual is part of the LAMMPS distribution. The
|
||||||
build a local copy of the Manual as HTML pages or a PDF file, by
|
online version always corresponds to the latest development version.
|
||||||
following the steps on the :doc:`Build_manual` page. The manual is
|
If needed, you can download or build a local copy of the manual as
|
||||||
organized in two parts:
|
HTML pages or a PDF file by following the steps on the
|
||||||
|
:doc:`Build_manual` page. If you have difficulties viewing the pages
|
||||||
|
please :ref:`see this note <webbrowser>`.
|
||||||
|
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The manual is organized in two parts:
|
||||||
1) the :ref:`User Guide <user_documentation>` for how to install
|
1) the :ref:`User Guide <user_documentation>` for how to install
|
||||||
and use LAMMPS and 2) the :ref:`Programmer Guide <programmer_documentation>`
|
and use LAMMPS and 2) the :ref:`Programmer Guide <programmer_documentation>`
|
||||||
for how to write programs using the LAMMPS library from different
|
for how to write programs using the LAMMPS library from different
|
||||||
@ -107,3 +113,15 @@ Indices and tables
|
|||||||
|
|
||||||
* :ref:`genindex`
|
* :ref:`genindex`
|
||||||
* :ref:`search`
|
* :ref:`search`
|
||||||
|
|
||||||
|
.. _webbrowser:
|
||||||
|
.. admonition:: Web Browser Compatibility
|
||||||
|
|
||||||
|
The HTML version of the manual makes use of advanced features present
|
||||||
|
int "modern" web browsers. This can lead to incompatibilities with older
|
||||||
|
web browsers (released more than 4 years ago) and specific vendor browsers
|
||||||
|
(e.g. Internet Explorer on Windows; Microsoft Edge works well though)
|
||||||
|
where parts of the pages are not rendered as expected (e.g. the layout is
|
||||||
|
broken or mathematical expressions not typeset). In that case we
|
||||||
|
recommend to install/use a different/newer web browser or use
|
||||||
|
the `PDF version of the manual <https://lammps.sandia.gov/doc/Manual.pdf>`_.
|
||||||
|
|||||||
@ -52,11 +52,6 @@
|
|||||||
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
|
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
|
||||||
<script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
|
<script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
|
||||||
|
|
||||||
{# for improved browser compatibility #}
|
|
||||||
<!--[if lte IE 11]>
|
|
||||||
<script src="{{ pathto('_static/polyfill.js', 1) }}"></script>
|
|
||||||
<![endif]-->
|
|
||||||
|
|
||||||
{%- if not embedded %}
|
{%- if not embedded %}
|
||||||
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
|
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
|
||||||
{% if sphinx_version >= "1.8.0" %}
|
{% if sphinx_version >= "1.8.0" %}
|
||||||
|
|||||||
@ -1098,12 +1098,12 @@ void FixRigid::compute_forces_and_torques()
|
|||||||
// include Langevin thermostat forces
|
// include Langevin thermostat forces
|
||||||
|
|
||||||
for (ibody = 0; ibody < nbody; ibody++) {
|
for (ibody = 0; ibody < nbody; ibody++) {
|
||||||
fcm[ibody][0] = all[ibody][0] + langextra[ibody][0];
|
fcm[ibody][0] = all[ibody][0] + fflag[ibody][0]*langextra[ibody][0];
|
||||||
fcm[ibody][1] = all[ibody][1] + langextra[ibody][1];
|
fcm[ibody][1] = all[ibody][1] + fflag[ibody][1]*langextra[ibody][1];
|
||||||
fcm[ibody][2] = all[ibody][2] + langextra[ibody][2];
|
fcm[ibody][2] = all[ibody][2] + fflag[ibody][2]*langextra[ibody][2];
|
||||||
torque[ibody][0] = all[ibody][3] + langextra[ibody][3];
|
torque[ibody][0] = all[ibody][3] + tflag[ibody][0]*langextra[ibody][3];
|
||||||
torque[ibody][1] = all[ibody][4] + langextra[ibody][4];
|
torque[ibody][1] = all[ibody][4] + tflag[ibody][1]*langextra[ibody][4];
|
||||||
torque[ibody][2] = all[ibody][5] + langextra[ibody][5];
|
torque[ibody][2] = all[ibody][5] + tflag[ibody][2]*langextra[ibody][5];
|
||||||
}
|
}
|
||||||
|
|
||||||
// add gravity force to COM of each body
|
// add gravity force to COM of each body
|
||||||
|
|||||||
@ -875,6 +875,11 @@ void FixRigidSmall::apply_langevin_thermostat()
|
|||||||
// convert langevin torques from body frame back to space frame
|
// convert langevin torques from body frame back to space frame
|
||||||
|
|
||||||
MathExtra::matvec(ex_space,ey_space,ez_space,tbody,&langextra[ibody][3]);
|
MathExtra::matvec(ex_space,ey_space,ez_space,tbody,&langextra[ibody][3]);
|
||||||
|
|
||||||
|
// enforce 2d motion
|
||||||
|
|
||||||
|
if (domain->dimension == 2)
|
||||||
|
langextra[ibody][2] = langextra[ibody][3] = langextra[ibody][4] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -557,6 +557,7 @@ void DeleteAtoms::recount_topology()
|
|||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
imol = molindex[i];
|
imol = molindex[i];
|
||||||
iatom = molatom[i];
|
iatom = molatom[i];
|
||||||
|
if (imol < 0) continue;
|
||||||
nbonds += onemols[imol]->num_bond[iatom];
|
nbonds += onemols[imol]->num_bond[iatom];
|
||||||
nangles += onemols[imol]->num_angle[iatom];
|
nangles += onemols[imol]->num_angle[iatom];
|
||||||
ndihedrals += onemols[imol]->num_dihedral[iatom];
|
ndihedrals += onemols[imol]->num_dihedral[iatom];
|
||||||
|
|||||||
@ -43,6 +43,9 @@ void Replicate::command(int narg, char **arg)
|
|||||||
error->all(FLERR,"Replicate command before simulation box is defined");
|
error->all(FLERR,"Replicate command before simulation box is defined");
|
||||||
if (narg < 3 || narg > 4) error->all(FLERR,"Illegal replicate command");
|
if (narg < 3 || narg > 4) error->all(FLERR,"Illegal replicate command");
|
||||||
|
|
||||||
|
if (atom->molecular == Atom::TEMPLATE)
|
||||||
|
error->all(FLERR,"Cannot use replicate command with atom style template");
|
||||||
|
|
||||||
int me = comm->me;
|
int me = comm->me;
|
||||||
int nprocs = comm->nprocs;
|
int nprocs = comm->nprocs;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -22,68 +22,97 @@ class LammpsShell(unittest.TestCase):
|
|||||||
def InputRunner(self,text):
|
def InputRunner(self,text):
|
||||||
"""Test tab expansions"""
|
"""Test tab expansions"""
|
||||||
try:
|
try:
|
||||||
[outs,errs] = self.proc.communicate(input=text, timeout=1)
|
[outs,errs] = self.proc.communicate(input=text, timeout=10)
|
||||||
except TimeoutExpired:
|
self.timeout = 0
|
||||||
proc.kill()
|
except subprocess.TimeoutExpired:
|
||||||
[outs,errs] = proc.communicate()
|
self.proc.kill()
|
||||||
|
[outs,errs] = self.proc.communicate()
|
||||||
|
self.timeout = 1
|
||||||
|
|
||||||
return outs.decode('UTF-8')
|
return outs.decode('UTF-8')
|
||||||
|
|
||||||
def testExpandClearHistory(self):
|
def testExpandClearHistory(self):
|
||||||
"""Test expansion of a shell specific command"""
|
"""Test expansion of a shell specific command"""
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'clear_his\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'clear_his\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"clear_history")
|
if self.timeout:
|
||||||
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"clear_history")
|
||||||
|
|
||||||
def testExpandDimension(self):
|
def testExpandDimension(self):
|
||||||
"""Test expansion of a LAMMPS command"""
|
"""Test expansion of a LAMMPS command"""
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'dimens\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'dimens\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"dimension")
|
if self.timeout:
|
||||||
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"dimension")
|
||||||
|
|
||||||
def testExpandPairStyle(self):
|
def testExpandPairStyle(self):
|
||||||
"""Test expansion of a pair style"""
|
"""Test expansion of a pair style"""
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'pair_st\t zer\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'pair_st\t zer\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"pair_style")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],"zero")
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"pair_style")
|
||||||
|
self.assertEqual(matches[0][2],"zero")
|
||||||
|
|
||||||
def testExpandBondStyle(self):
|
def testExpandBondStyle(self):
|
||||||
"""Test expansion of a bond style"""
|
"""Test expansion of a bond style"""
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'bond_st\t zer\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'bond_st\t zer\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"bond_style")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],"zero")
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"bond_style")
|
||||||
|
self.assertEqual(matches[0][2],"zero")
|
||||||
|
|
||||||
def testExpandAngleStyle(self):
|
def testExpandAngleStyle(self):
|
||||||
"""Test expansion of a angle style"""
|
"""Test expansion of a angle style"""
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'angle_st\t zer\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'angle_st\t zer\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"angle_style")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],"zero")
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"angle_style")
|
||||||
|
self.assertEqual(matches[0][2],"zero")
|
||||||
|
|
||||||
def testExpandDihedralStyle(self):
|
def testExpandDihedralStyle(self):
|
||||||
"""Test expansion of a dihedral style"""
|
"""Test expansion of a dihedral style"""
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'dihedral_st\t zer\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'dihedral_st\t zer\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"dihedral_style")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],"zero")
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"dihedral_style")
|
||||||
|
self.assertEqual(matches[0][2],"zero")
|
||||||
|
|
||||||
def testExpandImproperStyle(self):
|
def testExpandImproperStyle(self):
|
||||||
"""Test expansion of a improper style"""
|
"""Test expansion of a improper style"""
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'improper_st\t zer\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'improper_st\t zer\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"improper_style")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],"zero")
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"improper_style")
|
||||||
|
self.assertEqual(matches[0][2],"zero")
|
||||||
|
|
||||||
def testExpandComputeGroup(self):
|
def testExpandComputeGroup(self):
|
||||||
"""Test expansion of a group-ID and a compute command"""
|
"""Test expansion of a group-ID and a compute command"""
|
||||||
matches = re.findall(cmd_group_re, self.InputRunner(b'compute test al\tcentro/at\t\n'), re.MULTILINE)
|
matches = re.findall(cmd_group_re, self.InputRunner(b'compute test al\tcentro/at\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"compute")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],"test")
|
self.fail("Timeout")
|
||||||
self.assertEqual(matches[0][3],"all")
|
else:
|
||||||
self.assertEqual(matches[0][4],"centro/atom")
|
self.assertEqual(matches[0][1],"compute")
|
||||||
|
self.assertEqual(matches[0][2],"test")
|
||||||
|
self.assertEqual(matches[0][3],"all")
|
||||||
|
self.assertEqual(matches[0][4],"centro/atom")
|
||||||
|
|
||||||
def testExpandFixGroup(self):
|
def testExpandFixGroup(self):
|
||||||
"""Test expansion of a group-ID and a fix command"""
|
"""Test expansion of a group-ID and a fix command"""
|
||||||
matches = re.findall(cmd_group_re, self.InputRunner(b'fix test al\tcontroll\t\n'), re.MULTILINE)
|
matches = re.findall(cmd_group_re, self.InputRunner(b'fix test al\tcontroll\t\n'), re.MULTILINE)
|
||||||
self.assertEqual(matches[0][1],"fix")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],"test")
|
self.fail("Timeout")
|
||||||
self.assertEqual(matches[0][3],"all")
|
else:
|
||||||
self.assertEqual(matches[0][4],"controller")
|
self.assertEqual(matches[0][1],"fix")
|
||||||
|
self.assertEqual(matches[0][2],"test")
|
||||||
|
self.assertEqual(matches[0][3],"all")
|
||||||
|
self.assertEqual(matches[0][4],"controller")
|
||||||
|
|
||||||
def testExpandSource(self):
|
def testExpandSource(self):
|
||||||
"""Test expansion of a shell command and a file name"""
|
"""Test expansion of a shell command and a file name"""
|
||||||
@ -92,24 +121,30 @@ class LammpsShell(unittest.TestCase):
|
|||||||
out.close()
|
out.close()
|
||||||
matches = re.findall(shell_prompt_re, self.InputRunner(b'sour\t.tmp.in.sou\t\n'), re.MULTILINE)
|
matches = re.findall(shell_prompt_re, self.InputRunner(b'sour\t.tmp.in.sou\t\n'), re.MULTILINE)
|
||||||
os.remove('.tmp.in.source')
|
os.remove('.tmp.in.source')
|
||||||
self.assertEqual(matches[0][1],"source")
|
if self.timeout:
|
||||||
self.assertEqual(matches[0][2],".tmp.in.source")
|
self.fail("Timeout")
|
||||||
|
else:
|
||||||
|
self.assertEqual(matches[0][1],"source")
|
||||||
|
self.assertEqual(matches[0][2],".tmp.in.source")
|
||||||
|
|
||||||
def testHistory(self):
|
def testHistory(self):
|
||||||
"""Test history expansion"""
|
"""Test history expansion"""
|
||||||
out = self.InputRunner(b'clear_history\nunits real\ndimension 2\n!!:p\n!-3:p\n!dim:p\n!uni:p\nprint !!:$\nprint !dim:1\n')
|
out = self.InputRunner(b'clear_history\nunits real\ndimension 2\n!!:p\n!-3:p\n!dim:p\n!uni:p\nprint !!:$\nprint !dim:1\n')
|
||||||
idx = 0
|
idx = 0
|
||||||
lines = out.splitlines()
|
if self.timeout:
|
||||||
for line in lines:
|
self.fail("Timeout")
|
||||||
if line.startswith('LAMMPS Shell>'): break
|
else:
|
||||||
idx += 1
|
lines = out.splitlines()
|
||||||
|
for line in lines:
|
||||||
self.assertEqual(lines[idx+4],"dimension 2")
|
if line.startswith('LAMMPS Shell>'): break
|
||||||
self.assertEqual(lines[idx+6],"units real")
|
idx += 1
|
||||||
self.assertEqual(lines[idx+8],"dimension 2")
|
|
||||||
self.assertEqual(lines[idx+10],"units real")
|
self.assertEqual(lines[idx+4],"dimension 2")
|
||||||
self.assertEqual(lines[idx+12],"real")
|
self.assertEqual(lines[idx+6],"units real")
|
||||||
self.assertEqual(lines[idx+14],"2")
|
self.assertEqual(lines[idx+8],"dimension 2")
|
||||||
|
self.assertEqual(lines[idx+10],"units real")
|
||||||
|
self.assertEqual(lines[idx+12],"real")
|
||||||
|
self.assertEqual(lines[idx+14],"2")
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user