Merge pull request #2456 from akohlmey/final-changes-for-stable

Final changes for stable release
This commit is contained in:
Axel Kohlmeyer
2020-10-28 18:46:51 -04:00
committed by GitHub
11 changed files with 1173 additions and 73 deletions

View File

@ -57,20 +57,14 @@ if(BUILD_DOC)
# download mathjax distribution and unpack to folder "mathjax"
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"
EXPECTED_MD5 5d9d3799cce77a1a95eee6be04eb68e7)
EXPECTED_MD5 a4a6a093a89bc2ccab1452d766b98e53)
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-*)
execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax)
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
file(MAKE_DIRECTORY ${DOXYGEN_BUILD_DIR})
file(COPY ${LAMMPS_DOC_DIR}/doxygen/lammps-logo.png DESTINATION ${DOXYGEN_BUILD_DIR}/lammps-logo.png)

View File

@ -14,7 +14,6 @@ TXT2RST = $(VENV)/bin/txt2rst
ANCHORCHECK = $(VENV)/bin/rst_anchor_check
SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config
MATHJAX = $(SPHINXCONFIG)/_static/mathjax
POLYFILL = $(SPHINXCONFIG)/_static/polyfill.js
PYTHON = $(shell which python3)
DOXYGEN = $(shell which doxygen)
@ -81,7 +80,7 @@ help:
# ------------------------------------------
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
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_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
@$(MAKE) $(MFLAGS) -C graphviz all
@(\
@ -237,13 +236,6 @@ $(VENV):
$(MATHJAX):
@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)
@( \
. $(VENV)/bin/activate; \

View File

@ -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
the folder ``doc/docenv`` and various python packages are installed into
that virtual environment via the ``pip`` tool. For rendering embedded
LaTeX code also the `MathJax <https://www.mathjax.org/>`_ and the
`Polyfill <https://polyfill.io/>`_ JavaScript engines need to be downloaded.
LaTeX code also the `MathJax <https://www.mathjax.org/>`_ JavaScript
engine needs to be downloaded.
The actual translation is then done via ``make`` commands in the doc
folder. The following ``make`` commands are available:

View File

@ -21,10 +21,16 @@ where all LAMMPS development is coordinated.
----------
The content for this manual is part of the LAMMPS distribution. You can
build a local copy of the Manual as HTML pages or a PDF file, by
following the steps on the :doc:`Build_manual` page. The manual is
organized in two parts:
The content for this manual is part of the LAMMPS distribution. The
online version always corresponds to the latest development version.
If needed, you can download or build a local copy of the manual as
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
and use LAMMPS and 2) the :ref:`Programmer Guide <programmer_documentation>`
for how to write programs using the LAMMPS library from different
@ -107,3 +113,15 @@ Indices and tables
* :ref:`genindex`
* :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>`_.

View File

@ -52,11 +52,6 @@
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
<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 %}
{# 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" %}

View File

@ -1098,12 +1098,12 @@ void FixRigid::compute_forces_and_torques()
// include Langevin thermostat forces
for (ibody = 0; ibody < nbody; ibody++) {
fcm[ibody][0] = all[ibody][0] + langextra[ibody][0];
fcm[ibody][1] = all[ibody][1] + langextra[ibody][1];
fcm[ibody][2] = all[ibody][2] + langextra[ibody][2];
torque[ibody][0] = all[ibody][3] + langextra[ibody][3];
torque[ibody][1] = all[ibody][4] + langextra[ibody][4];
torque[ibody][2] = all[ibody][5] + langextra[ibody][5];
fcm[ibody][0] = all[ibody][0] + fflag[ibody][0]*langextra[ibody][0];
fcm[ibody][1] = all[ibody][1] + fflag[ibody][1]*langextra[ibody][1];
fcm[ibody][2] = all[ibody][2] + fflag[ibody][2]*langextra[ibody][2];
torque[ibody][0] = all[ibody][3] + tflag[ibody][0]*langextra[ibody][3];
torque[ibody][1] = all[ibody][4] + tflag[ibody][1]*langextra[ibody][4];
torque[ibody][2] = all[ibody][5] + tflag[ibody][2]*langextra[ibody][5];
}
// add gravity force to COM of each body

View File

@ -875,6 +875,11 @@ void FixRigidSmall::apply_langevin_thermostat()
// convert langevin torques from body frame back to space frame
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;
}
}

View File

@ -557,6 +557,7 @@ void DeleteAtoms::recount_topology()
for (int i = 0; i < nlocal; i++) {
imol = molindex[i];
iatom = molatom[i];
if (imol < 0) continue;
nbonds += onemols[imol]->num_bond[iatom];
nangles += onemols[imol]->num_angle[iatom];
ndihedrals += onemols[imol]->num_dihedral[iatom];

View File

@ -43,6 +43,9 @@ void Replicate::command(int narg, char **arg)
error->all(FLERR,"Replicate command before simulation box is defined");
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 nprocs = comm->nprocs;

File diff suppressed because it is too large Load Diff

View File

@ -22,68 +22,97 @@ class LammpsShell(unittest.TestCase):
def InputRunner(self,text):
"""Test tab expansions"""
try:
[outs,errs] = self.proc.communicate(input=text, timeout=1)
except TimeoutExpired:
proc.kill()
[outs,errs] = proc.communicate()
[outs,errs] = self.proc.communicate(input=text, timeout=10)
self.timeout = 0
except subprocess.TimeoutExpired:
self.proc.kill()
[outs,errs] = self.proc.communicate()
self.timeout = 1
return outs.decode('UTF-8')
def testExpandClearHistory(self):
"""Test expansion of a shell specific command"""
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):
"""Test expansion of a LAMMPS command"""
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):
"""Test expansion of a pair style"""
matches = re.findall(shell_prompt_re, self.InputRunner(b'pair_st\t zer\t\n'), re.MULTILINE)
self.assertEqual(matches[0][1],"pair_style")
self.assertEqual(matches[0][2],"zero")
if self.timeout:
self.fail("Timeout")
else:
self.assertEqual(matches[0][1],"pair_style")
self.assertEqual(matches[0][2],"zero")
def testExpandBondStyle(self):
"""Test expansion of a bond style"""
matches = re.findall(shell_prompt_re, self.InputRunner(b'bond_st\t zer\t\n'), re.MULTILINE)
self.assertEqual(matches[0][1],"bond_style")
self.assertEqual(matches[0][2],"zero")
if self.timeout:
self.fail("Timeout")
else:
self.assertEqual(matches[0][1],"bond_style")
self.assertEqual(matches[0][2],"zero")
def testExpandAngleStyle(self):
"""Test expansion of a angle style"""
matches = re.findall(shell_prompt_re, self.InputRunner(b'angle_st\t zer\t\n'), re.MULTILINE)
self.assertEqual(matches[0][1],"angle_style")
self.assertEqual(matches[0][2],"zero")
if self.timeout:
self.fail("Timeout")
else:
self.assertEqual(matches[0][1],"angle_style")
self.assertEqual(matches[0][2],"zero")
def testExpandDihedralStyle(self):
"""Test expansion of a dihedral style"""
matches = re.findall(shell_prompt_re, self.InputRunner(b'dihedral_st\t zer\t\n'), re.MULTILINE)
self.assertEqual(matches[0][1],"dihedral_style")
self.assertEqual(matches[0][2],"zero")
if self.timeout:
self.fail("Timeout")
else:
self.assertEqual(matches[0][1],"dihedral_style")
self.assertEqual(matches[0][2],"zero")
def testExpandImproperStyle(self):
"""Test expansion of a improper style"""
matches = re.findall(shell_prompt_re, self.InputRunner(b'improper_st\t zer\t\n'), re.MULTILINE)
self.assertEqual(matches[0][1],"improper_style")
self.assertEqual(matches[0][2],"zero")
if self.timeout:
self.fail("Timeout")
else:
self.assertEqual(matches[0][1],"improper_style")
self.assertEqual(matches[0][2],"zero")
def testExpandComputeGroup(self):
"""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)
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")
if self.timeout:
self.fail("Timeout")
else:
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):
"""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)
self.assertEqual(matches[0][1],"fix")
self.assertEqual(matches[0][2],"test")
self.assertEqual(matches[0][3],"all")
self.assertEqual(matches[0][4],"controller")
if self.timeout:
self.fail("Timeout")
else:
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):
"""Test expansion of a shell command and a file name"""
@ -92,24 +121,30 @@ class LammpsShell(unittest.TestCase):
out.close()
matches = re.findall(shell_prompt_re, self.InputRunner(b'sour\t.tmp.in.sou\t\n'), re.MULTILINE)
os.remove('.tmp.in.source')
self.assertEqual(matches[0][1],"source")
self.assertEqual(matches[0][2],".tmp.in.source")
if self.timeout:
self.fail("Timeout")
else:
self.assertEqual(matches[0][1],"source")
self.assertEqual(matches[0][2],".tmp.in.source")
def testHistory(self):
"""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')
idx = 0
lines = out.splitlines()
for line in lines:
if line.startswith('LAMMPS Shell>'): break
idx += 1
self.assertEqual(lines[idx+4],"dimension 2")
self.assertEqual(lines[idx+6],"units real")
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 self.timeout:
self.fail("Timeout")
else:
lines = out.splitlines()
for line in lines:
if line.startswith('LAMMPS Shell>'): break
idx += 1
self.assertEqual(lines[idx+4],"dimension 2")
self.assertEqual(lines[idx+6],"units real")
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__":