forked from lijiext/lammps
Merge pull request #2381 from akohlmey/collected-small-changes
Collected small changes
This commit is contained in:
commit
28812b1ea7
38
README
38
README
|
@ -22,28 +22,32 @@ more information about the code and its uses.
|
|||
|
||||
The LAMMPS distribution includes the following files and directories:
|
||||
|
||||
README this file
|
||||
LICENSE the GNU General Public License (GPL)
|
||||
bench benchmark problems
|
||||
cmake CMake build system
|
||||
doc documentation
|
||||
examples simple test problems
|
||||
lib libraries LAMMPS can be linked with
|
||||
potentials interatomic potential files
|
||||
python Python wrapper on LAMMPS as a library
|
||||
src source files
|
||||
tools pre- and post-processing tools
|
||||
README this file
|
||||
LICENSE the GNU General Public License (GPL)
|
||||
bench benchmark problems
|
||||
cmake CMake build files
|
||||
doc documentation
|
||||
examples simple test problems
|
||||
fortran Fortran wrapper for LAMMPS
|
||||
lib additional provided or external libraries
|
||||
potentials interatomic potential files
|
||||
python Python wrappers for LAMMPS
|
||||
src source files
|
||||
tools pre- and post-processing tools
|
||||
|
||||
Point your browser at any of these files to get started:
|
||||
|
||||
http://lammps.sandia.gov/doc/Manual.html the LAMMPS manual
|
||||
http://lammps.sandia.gov/doc/Intro.html hi-level introduction
|
||||
http://lammps.sandia.gov/doc/Build.html how to build LAMMPS
|
||||
http://lammps.sandia.gov/doc/Run_head.html how to run LAMMPS
|
||||
http://lammps.sandia.gov/doc/Developer.pdf LAMMPS developer guide
|
||||
https://lammps.sandia.gov/doc/Manual.html LAMMPS user manual
|
||||
https://lammps.sandia.gov/doc/Intro.html hi-level introduction
|
||||
https://lammps.sandia.gov/doc/Build.html how to build LAMMPS
|
||||
https://lammps.sandia.gov/doc/Run_head.html how to run LAMMPS
|
||||
https://lammps.sandia.gov/doc/Commands_all.html Table of available commands
|
||||
https://lammps.sandia.gov/doc/pg_library.html LAMMPS programmer guide
|
||||
https://lammps.sandia.gov/doc/Modify.html how to modify and extend LAMMPS
|
||||
https://lammps.sandia.gov/doc/pg_developer.html LAMMPS developer guide
|
||||
|
||||
You can also create these doc pages locally:
|
||||
|
||||
% cd doc
|
||||
% make html # creates HTML pages in doc/html
|
||||
% make pdf # creates Manual.pdf and Developer.pdf
|
||||
% make pdf # creates Manual.pdf
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
# utility script to call GenerateBinaryHeader function
|
||||
include(${SOURCE_DIR}/Modules/LAMMPSUtils.cmake)
|
||||
GenerateBinaryHeader(${VARNAME} ${HEADER_FILE} ${SOURCE_FILES})
|
||||
GenerateBinaryHeader(${VARNAME} ${HEADER_FILE} ${SOURCE_FILE})
|
||||
|
|
|
@ -71,19 +71,15 @@ macro(pkg_depends PKG1 PKG2)
|
|||
endmacro()
|
||||
|
||||
# CMake-only replacement for bin2c and xxd
|
||||
function(GenerateBinaryHeader varname outfile files)
|
||||
function(GenerateBinaryHeader varname outfile infile)
|
||||
message("Creating ${outfile}...")
|
||||
file(WRITE ${outfile} "// CMake generated file\n")
|
||||
math(EXPR ARG_END "${ARGC}-1")
|
||||
|
||||
foreach(IDX RANGE 2 ${ARG_END})
|
||||
list(GET ARGV ${IDX} filename)
|
||||
file(READ ${filename} content HEX)
|
||||
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," content "${content}")
|
||||
string(REGEX REPLACE ",$" "" content "${content}")
|
||||
file(APPEND ${outfile} "const unsigned char ${varname}[] = { ${content} };\n")
|
||||
file(APPEND ${outfile} "const unsigned int ${varname}_size = sizeof(${varname});\n")
|
||||
endforeach()
|
||||
file(READ ${infile} content HEX)
|
||||
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," content "${content}")
|
||||
string(REGEX REPLACE ",$" "" content "${content}")
|
||||
file(APPEND ${outfile} "const unsigned char ${varname}[] = { ${content} };\n")
|
||||
file(APPEND ${outfile} "const unsigned int ${varname}_size = sizeof(${varname});\n")
|
||||
endfunction(GenerateBinaryHeader)
|
||||
|
||||
# fetch missing potential files
|
||||
|
|
|
@ -309,7 +309,7 @@ elseif(GPU_API STREQUAL "HIP")
|
|||
endif()
|
||||
|
||||
add_custom_command(OUTPUT ${CUBIN_H_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILES=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake
|
||||
COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILE=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake
|
||||
DEPENDS ${CUBIN_FILE}
|
||||
COMMENT "Generating ${CU_NAME}_cubin.h")
|
||||
|
||||
|
|
18
doc/Makefile
18
doc/Makefile
|
@ -43,8 +43,10 @@ HAS_VIRTUALENV = YES
|
|||
endif
|
||||
|
||||
ifeq ($(shell which pdflatex >/dev/null 2>&1; echo $$?), 0)
|
||||
ifeq ($(shell which latexmk >/dev/null 2>&1; echo $$?), 0)
|
||||
HAS_PDFLATEX = YES
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
#SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E")
|
||||
|
@ -79,7 +81,7 @@ help:
|
|||
# ------------------------------------------
|
||||
|
||||
clean-all: clean
|
||||
rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(BUILDDIR)/LAMMPS.mobi $(BUILDDIR)/LAMMPS.epub $(BUILDDIR)/Manual.pdf
|
||||
rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(POLYFILL) $(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
|
||||
|
@ -152,7 +154,7 @@ mobi: epub
|
|||
pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
@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
|
||||
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX was not found! Please check README.md for further instructions" 1>&2; exit 1; fi
|
||||
@if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi
|
||||
@(\
|
||||
. $(VENV)/bin/activate ; env PYTHONWARNINGS= \
|
||||
sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\
|
||||
|
@ -166,14 +168,12 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
|||
deactivate ;\
|
||||
)
|
||||
@cd latex && \
|
||||
sed 's/latexmk -pdf -dvi- -ps-/pdflatex/g' Makefile > temp && \
|
||||
mv temp Makefile && \
|
||||
sed 's/\\begin{equation}//g' LAMMPS.tex > tmp.tex && \
|
||||
mv tmp.tex LAMMPS.tex && \
|
||||
sed 's/\\end{equation}//g' LAMMPS.tex > tmp.tex && \
|
||||
mv tmp.tex LAMMPS.tex && \
|
||||
$(MAKE) $(MFLAGS) && \
|
||||
$(MAKE) $(MFLAGS) && \
|
||||
sed 's/\\contentsname}{.*}}/\\contentsname}{LAMMPS Documentation}}/g' LAMMPS.tex > tmp.tex && \
|
||||
mv tmp.tex LAMMPS.tex && \
|
||||
$(MAKE) $(MFLAGS) && \
|
||||
mv LAMMPS.pdf ../Manual.pdf && \
|
||||
cd ../;
|
||||
|
@ -237,8 +237,12 @@ $(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"
|
||||
@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)
|
||||
@( \
|
||||
|
|
11
doc/README
11
doc/README
|
@ -9,12 +9,10 @@ src content files for LAMMPS documentation
|
|||
html HTML version of the LAMMPS manual (see html/Manual.html)
|
||||
utils utilities and settings for building the documentation
|
||||
Manual.pdf PDF version of entire manual
|
||||
Developer.pdf PDF with info about how LAMMPS is structured
|
||||
LAMMPS.epub Manual in ePUB format
|
||||
LAMMPS.mobi Manual in MOBI (Kindle) format
|
||||
lammps.1 man page for the lammps command
|
||||
msi2lmp.1 man page for the msi2lmp command
|
||||
mathjax code and fonts for rendering math in html
|
||||
doctree temporary data
|
||||
docenv python virtual environment for generating the manual
|
||||
doxygen Doxygen configuration and output
|
||||
|
@ -32,9 +30,9 @@ folder and the PDF manual should be included. If you downloaded LAMMPS
|
|||
from GitHub then you either need to download them or build them.
|
||||
|
||||
(a) You can "fetch" the current HTML and PDF files from the LAMMPS web
|
||||
site. Just type "make fetch". This should create a html_www dir and
|
||||
Manual_www.pdf/Developer_www.pdf files. These files will always
|
||||
represent the latest published patch/development version of LAMMPS.
|
||||
site. Just type "make fetch". This should create a html_www directory
|
||||
and Manual_www.pdf file. These will always represent the latest published
|
||||
patch/development version of LAMMPS.
|
||||
|
||||
(b) You can build the HTML and PDF files yourself, by typing "make html"
|
||||
or by "make pdf", respectively. This requires various tools and files.
|
||||
|
@ -68,6 +66,9 @@ installed. This includes:
|
|||
- tabulary
|
||||
- upquote
|
||||
- wrapfig
|
||||
Also the latexmk script is required to run PDFLaTeX and related tools.
|
||||
the required number of times to have self-consistent output and include
|
||||
updated bibliography and indices.
|
||||
|
||||
Building the EPUB format requires LaTeX installation with the same packages
|
||||
as for the PDF format plus the 'dvipng' command to convert the embedded math
|
||||
|
|
|
@ -416,6 +416,7 @@ INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \
|
|||
@LAMMPS_SOURCE_DIR@/library.h \
|
||||
@LAMMPS_SOURCE_DIR@/lammps.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/lammps.h \
|
||||
@LAMMPS_SOURCE_DIR@/pointers.h \
|
||||
@LAMMPS_SOURCE_DIR@/lmptype.h \
|
||||
@LAMMPS_SOURCE_DIR@/atom.cpp \
|
||||
@LAMMPS_SOURCE_DIR@/atom.h \
|
||||
|
|
|
@ -487,3 +487,41 @@ e.g. to Python. Of course, the calling code has to be set up to
|
|||
cleanly recover from an exception since not all parallel ranks may
|
||||
throw an exception and thus other MPI ranks may get stuck waiting for
|
||||
messages from the ones with errors.
|
||||
|
||||
----------
|
||||
|
||||
.. _trap_fpe:
|
||||
|
||||
Trigger selected floating-point exceptions
|
||||
------------------------------------------
|
||||
|
||||
Many kinds of CPUs have the capability to detect when a calculation
|
||||
results in an invalid math operation like a division by zero or calling
|
||||
the square root with a negative argument. The default behavior on
|
||||
most operating systems is to continue and have values for ``NaN`` (= not
|
||||
a number) or ``Inf`` (= infinity). This allows software to detect and
|
||||
recover from such conditions. This behavior can be changed, however,
|
||||
often through use of compiler flags. On Linux systems (or more general
|
||||
on systems using the GNU C library), these so-called floating-point traps
|
||||
can also be selectively enabled through library calls. LAMMPS supports
|
||||
that by setting the ``-DLAMMPS_TRAP_FPE`` pre-processor define. As it is
|
||||
done in the ``main()`` function, this applies only to the standalone
|
||||
executable, not the library.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
-D CMAKE_TUNE_FLAGS=-DLAMMPS_TRAP_FPE
|
||||
|
||||
.. tab:: Traditional make
|
||||
|
||||
.. code-block:: make
|
||||
|
||||
LMP_INC = -DLAMMPS_TRAP_FPE
|
||||
|
||||
After compilation with this flag set, the LAMMPS executable will stop
|
||||
and produce a core dump when a division by zero, overflow, illegal math
|
||||
function argument or other invalid floating point operation is encountered.
|
||||
|
|
|
@ -23,7 +23,7 @@ need the source code.
|
|||
These are the files and sub-directories in the LAMMPS distribution:
|
||||
|
||||
+------------+-------------------------------------------+
|
||||
| README | text file |
|
||||
| README | Short description of the LAMMPS package |
|
||||
+------------+-------------------------------------------+
|
||||
| LICENSE | GNU General Public License (GPL) |
|
||||
+------------+-------------------------------------------+
|
||||
|
@ -35,16 +35,20 @@ These are the files and sub-directories in the LAMMPS distribution:
|
|||
+------------+-------------------------------------------+
|
||||
| examples | simple test problems |
|
||||
+------------+-------------------------------------------+
|
||||
| fortran | Fortran wrapper for LAMMPS |
|
||||
+------------+-------------------------------------------+
|
||||
| lib | additional provided or external libraries |
|
||||
+------------+-------------------------------------------+
|
||||
| potentials | interatomic potential files |
|
||||
+------------+-------------------------------------------+
|
||||
| python | Python wrapper on LAMMPS |
|
||||
| python | Python wrappers for LAMMPS |
|
||||
+------------+-------------------------------------------+
|
||||
| src | source files |
|
||||
+------------+-------------------------------------------+
|
||||
| tools | pre- and post-processing tools |
|
||||
+------------+-------------------------------------------+
|
||||
| unittest | sources and inputs for testing LAMMPS |
|
||||
+------------+-------------------------------------------+
|
||||
|
||||
You will have all of these if you download source. You will only have
|
||||
some of them if you download executables, as explained on the pages
|
||||
|
|
|
@ -12,4 +12,5 @@ These pages provide a brief introduction to LAMMPS.
|
|||
Intro_nonfeatures
|
||||
Intro_opensource
|
||||
Intro_authors
|
||||
Intro_citing
|
||||
Intro_website
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
Citing LAMMPS
|
||||
=============
|
||||
|
||||
Core Algorithms
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Since LAMMPS is a community project, there is not a single one
|
||||
publication or reference that describes **all** of LAMMPS.
|
||||
The canonical publication that describes the foundation, that is
|
||||
the basic spatial decomposition approach, the neighbor finding,
|
||||
and basic communications algorithms used in LAMMPS is:
|
||||
|
||||
`S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). <http://www.sandia.gov/~sjplimp/papers/jcompphys95.pdf>`_
|
||||
|
||||
So any project using LAMMPS (or a derivative application using LAMMPS as
|
||||
a simulation engine) should cite this paper. A new publication
|
||||
describing the developments and improvements of LAMMPS in the 25 years
|
||||
since then is currently in preparation.
|
||||
|
||||
|
||||
DOI for the LAMMPS code
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS developers use the `Zenodo service at CERN
|
||||
<https://zenodo.org/>`_ to create digital object identifies (DOI) for
|
||||
stable releases of the LAMMPS code. There are two types of DOIs for the
|
||||
LAMMPS source code: 1) the canonical DOI for **all** versions of LAMMPS,
|
||||
which will always point to the latest stable release version is:
|
||||
|
||||
`DOI: 10.5281/zenodo.3726416 <https://dx.doi/org/10.5281/zenodo.3726416>`_
|
||||
|
||||
In addition there are DOIs for individual stable releases starting with
|
||||
the `3 March 2020 version, DOI:10.5281/zenodo.3726417 <https://dx.doi/org/10.5281/zenodo.3726416>`_
|
||||
|
||||
|
||||
Home page
|
||||
^^^^^^^^^
|
||||
|
||||
The LAMMPS website at `https://lammps.sandia.gov/ <https://lammps.sandia.gov>`_ is the canonical
|
||||
location for information about LAMMPS and more detailed lists of publications
|
||||
using LAMMPS and contributing features.
|
||||
|
||||
Citing contributions
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
LAMMPS has many features and uses previously published methods and
|
||||
algorithms or novel features. It also includes potential parameter
|
||||
filed for specific models. You can look up relevant publications either
|
||||
in the LAMMPS output to the screen, the ``log.cite`` file (which is
|
||||
populated with references to relevant papers through embedding them into
|
||||
the source code) and in the documentation of the :doc:`corresponding commands
|
||||
<Commands_all>` or in the :doc:`Howto tutorials <Howto>`.
|
|
@ -23,25 +23,28 @@ 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:`Manual build <Manual_build>` doc page.
|
||||
The manual is organized in two parts:
|
||||
1) A :ref:`User documentation <user_documentation>` for how to install
|
||||
and use LAMMPS and 2) a :ref:`Programmer documentation <programmer_documentation>`
|
||||
for how to write programs using the LAMMPS library or how to modify LAMMPS.
|
||||
1) the :ref:`User documentation <user_documentation>` for how to install
|
||||
and use LAMMPS and 2) the :ref:`Programmer documentation <programmer_documentation>`
|
||||
for how to write programs using the LAMMPS library from different
|
||||
programming languages and how to modify and extend LAMMPS.
|
||||
|
||||
----------
|
||||
.. only:: html
|
||||
|
||||
Once you are familiar with LAMMPS, you may want to bookmark :doc:`this page <Commands_all>` since it gives quick access to a doc page for
|
||||
every LAMMPS command.
|
||||
Once you are familiar with LAMMPS, you may want to bookmark :doc:`this page <Commands_all>` since it gives quick access to a doc page for
|
||||
every LAMMPS command.
|
||||
|
||||
.. _lws: https://lammps.sandia.gov
|
||||
|
||||
----------
|
||||
|
||||
User Documentation
|
||||
******************
|
||||
|
||||
.. :caption: User Documentation
|
||||
.. _user_documentation:
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:numbered: 3
|
||||
:caption: User Documentation
|
||||
:name: userdoc
|
||||
:includehidden:
|
||||
|
||||
|
@ -61,11 +64,12 @@ User Documentation
|
|||
|
||||
Programmer Documentation
|
||||
************************
|
||||
.. :caption: Programmer Documentation
|
||||
|
||||
.. _programmer_documentation:
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:numbered: 3
|
||||
:caption: Programmer Documentation
|
||||
:name: progdoc
|
||||
:includehidden:
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ files. Here is a list with descriptions:
|
|||
LAMMPS.mobi # Manual in MOBI e-book format
|
||||
docenv # virtualenv folder for processing the manual sources
|
||||
doctrees # temporary data from processing the manual
|
||||
mathjax # code and fonts for rendering math in html
|
||||
doxygen # doxygen configuration and output
|
||||
.gitignore # list of files and folders to be ignored by git
|
||||
doxygen-warn.log # logfile with warnings from running doxygen
|
||||
|
@ -34,11 +33,10 @@ of two ways:
|
|||
|
||||
a. You can "fetch" the current HTML and PDF files from the LAMMPS web
|
||||
site. Just type ``make fetch``. This should download a html_www
|
||||
directory and a Manual_www.pdf file. Note that if
|
||||
new LAMMPS features have been added more recently than the date of
|
||||
your LAMMPS version, the fetched documentation will include those
|
||||
changes (but your source code will not, unless you update your local
|
||||
repository).
|
||||
directory and a Manual_www.pdf file. Note that if new LAMMPS features
|
||||
have been added more recently than the date of your LAMMPS version, the
|
||||
fetched documentation will include those changes (but your source code
|
||||
will not, unless you update your local repository).
|
||||
|
||||
b. You can build the HTML or PDF files yourself, by typing ``make html``
|
||||
or ``make pdf``. This requires various tools and files. Some of them
|
||||
|
@ -134,7 +132,7 @@ Installing prerequisites for PDF build
|
|||
In addition to the tools needed for building the HTML format manual,
|
||||
a working LaTeX installation with support for PDFLaTeX and a selection
|
||||
of LaTeX styles/packages are required. To run the PDFLaTeX translation
|
||||
the tools ``latexmk`` and ``xindy`` need to be installed as well.
|
||||
the ``latexmk`` script needs to be installed as well.
|
||||
|
||||
Installing prerequisites for e-book reader builds
|
||||
=================================================
|
||||
|
|
|
@ -44,8 +44,9 @@ is called only on a single MPI rank, as that will then trigger the
|
|||
a call to ``Error::one()`` for errors instead of ``Error::all()``
|
||||
and avoids a "hanging" calculation when run in parallel.
|
||||
|
||||
Please also see :cpp:func:`is_integer` and :cpp:func:`is_double` for
|
||||
testing strings for compliance without conversion.
|
||||
Please also see :cpp:func:`is_integer() <LAMMPS_NS::utils::is_integer>`
|
||||
and :cpp:func:`is_double() <LAMMPS_NS::utils::is_double>` for testing
|
||||
strings for compliance without conversion.
|
||||
|
||||
----------
|
||||
|
||||
|
|
|
@ -14,9 +14,20 @@ C-library interface, or the :py:class:`lammps.lammps` class constructor
|
|||
of the Python module, or the :f:func:`lammps` constructor of the Fortran
|
||||
module.
|
||||
|
||||
In order to avoid clashes of function names, all of the core code in
|
||||
LAMMPS is placed into the ``LAMMPS_NS`` namespace. Functions or variables
|
||||
outside of that namespace must be "static", i.e. visible only to the
|
||||
scope of the file/object they are defined in. Code in packages or the
|
||||
libraries in the ``lib`` folder may not adhere to this as some of them
|
||||
are adapted from legacy code or consist of external libraries with their
|
||||
own requirements and policies.
|
||||
|
||||
--------------------
|
||||
|
||||
.. doxygenclass:: LAMMPS_NS::LAMMPS
|
||||
:project: progguide
|
||||
:members:
|
||||
|
||||
.. doxygenclass:: LAMMPS_NS::Pointers
|
||||
:project: progguide
|
||||
|
||||
|
|
|
@ -27,6 +27,14 @@ hr {
|
|||
margin-bottom: 12px !important;
|
||||
}
|
||||
|
||||
#user-documentation.section h2 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#programmer-documentation.section h2 {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ui.tabular.menu .item {
|
||||
padding-right: 1em;
|
||||
padding-left: 1em;
|
||||
|
|
|
@ -14,5 +14,5 @@ titles_only =
|
|||
logo_only =
|
||||
display_version = True
|
||||
prev_next_buttons_location = both
|
||||
style_external_links = False
|
||||
style_external_links = True
|
||||
style_nav_header_background =
|
||||
|
|
|
@ -2,3 +2,7 @@
|
|||
*.d
|
||||
*.a
|
||||
*~
|
||||
liblammps.mod
|
||||
simpleC
|
||||
simpleCC
|
||||
simpleF
|
||||
|
|
|
@ -8,16 +8,14 @@ code to perform a coupled calculation.
|
|||
simple.cpp is the C++ driver
|
||||
simple.c is the C driver
|
||||
simple.f90 is the Fortran driver
|
||||
libfwrapper.c is the Fortran-to-C wrapper
|
||||
|
||||
The 3 codes do the same thing, so you can compare them to see how to
|
||||
drive LAMMPS from each language. See lammps/python/example/simple.py
|
||||
to do something similar from Python. The Fortran driver requires an
|
||||
additional wrapper library that interfaces the C interface of the
|
||||
LAMMPS library to Fortran and also translates the MPI communicator
|
||||
from Fortran to C.
|
||||
drive LAMMPS from each language. See python/example/simple.py
|
||||
to do something similar from Python. The Fortran driver requires a
|
||||
Fortran module that uses the Fortran 03 ISO_C_BINDING module to
|
||||
interface the LAMMPS C library functions to Fortran.
|
||||
|
||||
First build LAMMPS as a library (see examples/COUPLE/README), e.g.
|
||||
First build LAMMPS as a library (see examples/COUPLE/README), e.g.
|
||||
|
||||
make mode=shlib mpi
|
||||
|
||||
|
@ -26,27 +24,23 @@ these, which include paths to the LAMMPS library interface, and
|
|||
linking with FFTW (only needed if you built LAMMPS as a library with
|
||||
its PPPM solver).
|
||||
|
||||
This builds the C++ driver with the LAMMPS library using the mpiCC
|
||||
This builds the C++ driver with the LAMMPS library using the mpicxx
|
||||
(C++) compiler:
|
||||
|
||||
mpiCC -I/home/sjplimp/lammps/src -c simple.cpp
|
||||
mpiCC -L/home/sjplimp/lammps/src simple.o -llammps -lfftw -o simpleCC
|
||||
mpicxx -I/home/sjplimp/lammps/src -c simple.cpp
|
||||
mpicxx -L/home/sjplimp/lammps/src simple.o -llammps -o simpleCC
|
||||
|
||||
This builds the C driver with the LAMMPS library using the mpicc (C)
|
||||
compiler:
|
||||
|
||||
mpicc -I/home/sjplimp/lammps/src -c simple.c
|
||||
mpicc -L/home/sjplimp/lammps/src simple.o -llammps -lfftw -o simpleC
|
||||
mpicc -L/home/sjplimp/lammps/src simple.o -llammps -o simpleC
|
||||
|
||||
This builds the Fortran wrapper and driver with the LAMMPS library
|
||||
using the mpicc (C) and mpifort (Fortran) compilers, using the wrapper
|
||||
in the fortran directory:
|
||||
This builds the Fortran module and driver with the LAMMPS library
|
||||
using the mpifort (Fortran) compilers, using the Fortran module from
|
||||
the fortran directory:
|
||||
|
||||
cp ../fortran/libfwrapper.c .
|
||||
mpicc -I/home/sjplimp/lammps/src -c libfwrapper.c
|
||||
mpifort -c simple.f90
|
||||
mpifort -L/home/sjplimp/lammps/src simple.o libfwrapper.o \
|
||||
-llammps -lfftw -o simpleF
|
||||
mpifort -L/home/sjplimp/lammps/src ../../../fortran/lammps.f90 simple.f90 -llammps -o simpleF
|
||||
|
||||
You then run simpleCC, simpleC, or simpleF on a parallel machine
|
||||
on some number of processors Q with 2 arguments:
|
||||
|
@ -69,10 +63,9 @@ The C driver is calling C-style routines in the src/library.cpp file
|
|||
of LAMMPS. You could add any functions you wish to this file to
|
||||
manipulate LAMMPS data however you wish.
|
||||
|
||||
The Fortran driver is using the same C-style routines, but requires an
|
||||
additional wrapper to make them Fortran callable. Only a subset of the
|
||||
library functions are currently wrapped, but it should be clear how to
|
||||
extend the wrapper if desired.
|
||||
The Fortran driver is using the Fortran 03 module which uses a derived
|
||||
type with type bound subroutines. Only a small subset of the C library
|
||||
functions are currently accessible through the Fortran module.
|
||||
|
||||
The C++ driver does the same thing, except that it instantiates LAMMPS
|
||||
as an object first. Some of the functions in src/library.cpp can be
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
in.lammps = LAMMPS input script
|
||||
See README for compilation instructions */
|
||||
|
||||
#include "stdio.h"
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
#include "mpi.h"
|
||||
#include "lammps/library.h" /* this is a LAMMPS include file */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <mpi.h>
|
||||
#include "library.h" /* this is a LAMMPS include file */
|
||||
|
||||
int main(int narg, char **arg)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ int main(int narg, char **arg)
|
|||
all LAMMPS procs call lammps_command() on the line */
|
||||
|
||||
void *lmp = NULL;
|
||||
if (lammps == 1) lammps_open(0,NULL,comm_lammps,&lmp);
|
||||
if (lammps == 1) lmp = lammps_open(0,NULL,comm_lammps,NULL);
|
||||
|
||||
int n;
|
||||
char line[1024];
|
||||
|
@ -124,10 +124,10 @@ int main(int narg, char **arg)
|
|||
|
||||
/* use commands_string() and commands_list() to invoke more commands */
|
||||
|
||||
char *strtwo = "run 10\nrun 20";
|
||||
const char *strtwo = "run 10\nrun 20";
|
||||
if (lammps == 1) lammps_commands_string(lmp,strtwo);
|
||||
|
||||
char *cmds[2];
|
||||
const char *cmds[2];
|
||||
cmds[0] = "run 10";
|
||||
cmds[1] = "run 20";
|
||||
if (lammps == 1) lammps_commands_list(lmp,2,cmds);
|
||||
|
|
|
@ -25,10 +25,10 @@
|
|||
#include <mpi.h>
|
||||
|
||||
// these are LAMMPS include files
|
||||
#include <lammps/lammps.h>
|
||||
#include <lammps/input.h>
|
||||
#include <lammps/atom.h>
|
||||
#include <lammps/library.h>
|
||||
#include "lammps.h"
|
||||
#include "input.h"
|
||||
#include "atom.h"
|
||||
#include "library.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
|
@ -135,10 +135,10 @@ int main(int narg, char **arg)
|
|||
|
||||
// use commands_string() and commands_list() to invoke more commands
|
||||
|
||||
char *strtwo = (char *) "run 10\nrun 20";
|
||||
const char *strtwo = (char *) "run 10\nrun 20";
|
||||
if (lammps == 1) lammps_commands_string(lmp,strtwo);
|
||||
|
||||
char *cmds[2];
|
||||
const char *cmds[2];
|
||||
cmds[0] = (char *) "run 10";
|
||||
cmds[1] = (char *) "run 20";
|
||||
if (lammps == 1) lammps_commands_list(lmp,2,cmds);
|
||||
|
|
|
@ -18,13 +18,14 @@
|
|||
! See README for compilation instructions
|
||||
|
||||
PROGRAM f_driver
|
||||
USE mpi
|
||||
USE liblammps
|
||||
IMPLICIT NONE
|
||||
INCLUDE 'mpif.h'
|
||||
|
||||
INTEGER, PARAMETER :: fp=20
|
||||
INTEGER :: n, narg, ierr, me, nprocs, natoms
|
||||
INTEGER :: lammps, nprocs_lammps, comm_lammps
|
||||
INTEGER (kind=8) :: ptr
|
||||
INTEGER :: color, nprocs_lammps, comm_lammps
|
||||
TYPE(LAMMPS) :: lmp
|
||||
|
||||
REAL (kind=8), ALLOCATABLE :: x(:)
|
||||
REAL (kind=8), PARAMETER :: epsilon=0.1
|
||||
|
@ -58,14 +59,14 @@ PROGRAM f_driver
|
|||
END IF
|
||||
END IF
|
||||
|
||||
lammps = 0
|
||||
color = 0
|
||||
IF (me < nprocs_lammps) THEN
|
||||
lammps = 1
|
||||
color = 1
|
||||
ELSE
|
||||
lammps = MPI_UNDEFINED
|
||||
color = MPI_UNDEFINED
|
||||
END IF
|
||||
|
||||
CALL mpi_comm_split(MPI_COMM_WORLD,lammps,0,comm_lammps,ierr)
|
||||
CALL mpi_comm_split(MPI_COMM_WORLD,color,0,comm_lammps,ierr)
|
||||
|
||||
! open LAMMPS input script on rank zero
|
||||
|
||||
|
@ -81,7 +82,7 @@ PROGRAM f_driver
|
|||
! (could just send it to proc 0 of comm_lammps and let it Bcast)
|
||||
! all LAMMPS procs call lammps_command() on the line */
|
||||
|
||||
IF (lammps == 1) CALL lammps_open(comm_lammps,ptr)
|
||||
IF (color == 1) lmp=lammps(comm=comm_lammps)
|
||||
|
||||
n = 0
|
||||
DO
|
||||
|
@ -99,7 +100,7 @@ PROGRAM f_driver
|
|||
CALL mpi_bcast(n,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr)
|
||||
IF (n == 0) EXIT
|
||||
CALL mpi_bcast(line,n,MPI_CHARACTER,0,MPI_COMM_WORLD,ierr)
|
||||
IF (lammps == 1) CALL lammps_command(ptr,line,n)
|
||||
IF (color == 1) CALL lmp%command(line(1:n))
|
||||
END DO
|
||||
CLOSE(UNIT=fp)
|
||||
|
||||
|
@ -109,27 +110,27 @@ PROGRAM f_driver
|
|||
! put coords back into LAMMPS
|
||||
! run a single step with changed coords */
|
||||
|
||||
IF (lammps == 1) THEN
|
||||
CALL lammps_command(ptr,'run 10',6)
|
||||
IF (color == 1) THEN
|
||||
CALL lmp%command('run 10')
|
||||
|
||||
CALL lammps_get_natoms(ptr,natoms)
|
||||
natoms = NINT(lmp%get_natoms())
|
||||
ALLOCATE(x(3*natoms))
|
||||
|
||||
! these calls are commented out, b/c libfwrapper.c
|
||||
! needs to be updated to use gather_atoms and scatter_atoms
|
||||
|
||||
!CALL lammps_gather_atoms(ptr,'x',1,3,x);
|
||||
!CALL lammps_gather_atoms(ptr,'x',1,3,x)
|
||||
!x(1) = x(1) + epsilon
|
||||
!CALL lammps_scatter_atoms(ptr,'x',1,3,x);
|
||||
!CALL lammps_scatter_atoms(ptr,'x',1,3,x)
|
||||
|
||||
DEALLOCATE(x)
|
||||
|
||||
CALL lammps_command(ptr,'run 1',5);
|
||||
CALL lmp%command('run 1')
|
||||
END IF
|
||||
|
||||
! free LAMMPS object
|
||||
|
||||
IF (lammps == 1) CALL lammps_close(ptr);
|
||||
IF (color == 1) CALL lmp%close()
|
||||
|
||||
! close down MPI
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
|||
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC
|
||||
|
||||
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC
|
||||
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11
|
||||
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
|
||||
|
||||
BIN_DIR = ./
|
||||
|
|
|
@ -57,8 +57,8 @@ CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
|||
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC
|
||||
|
||||
CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK
|
||||
CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias
|
||||
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11
|
||||
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
|
||||
|
||||
BIN_DIR = ./
|
||||
OBJ_DIR = ./
|
||||
|
|
|
@ -58,8 +58,8 @@ CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
|||
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC
|
||||
|
||||
CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK
|
||||
CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias
|
||||
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11
|
||||
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
|
||||
|
||||
BIN_DIR = ./
|
||||
OBJ_DIR = ./
|
||||
|
|
|
@ -57,8 +57,8 @@ CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
|||
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC
|
||||
|
||||
CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK
|
||||
CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias
|
||||
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11
|
||||
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
|
||||
|
||||
BIN_DIR = ./
|
||||
OBJ_DIR = ./
|
||||
|
|
|
@ -51,9 +51,9 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE
|
|||
|
||||
CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
||||
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler "-fPIC -std=c++98"
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC
|
||||
|
||||
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC
|
||||
CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11
|
||||
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
|
||||
|
||||
BIN_DIR = ./
|
||||
|
|
|
@ -17,8 +17,8 @@ OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device
|
|||
LMP_INC = -DLAMMPS_SMALLBIG
|
||||
|
||||
OCL_INC = -I/usr/local/cuda/include # Path to CL directory
|
||||
OCL_CPP = mpic++ $(DEFAULT_DEVICE) -O3 -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC)
|
||||
OCL_LINK = -lOpenCL
|
||||
OCL_CPP = mpic++ $(DEFAULT_DEVICE) -O3 -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) -std=c++11
|
||||
OCL_LINK = -L/usr/local/cuda/lib64 -lOpenCL
|
||||
OCL_PREC = -D_SINGLE_DOUBLE
|
||||
|
||||
BIN_DIR = ./
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
# /* ----------------------------------------------------------------------
|
||||
# Generic Mac Makefile for CUDA
|
||||
# - 32-bit (requires adding -m32 to LAMMPS Makefile)
|
||||
# - Change CUDA_ARCH for your GPU
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
# which file will be copied to Makefile.lammps
|
||||
|
||||
EXTRAMAKE = Makefile.lammps.standard
|
||||
|
||||
CUDA_HOME = /usr/local/cuda
|
||||
NVCC = nvcc -m64
|
||||
|
||||
CUDA_ARCH = -arch=sm_11
|
||||
CUDA_PRECISION = -D_SINGLE_SINGLE
|
||||
CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
||||
CUDA_LIB = -L$(CUDA_HOME)/lib -L$(CUDA_HOME)/lib/stubs
|
||||
CUDA_OPTS = -DUNIX -DUCL_NO_EXIT -O3 --use_fast_math
|
||||
|
||||
CUDR_CPP = mpic++ -m64
|
||||
CUDR_OPTS = -O2 -g
|
||||
|
||||
BIN_DIR = ./
|
||||
OBJ_DIR = ./
|
||||
LIB_DIR = ./
|
||||
AR = ar
|
||||
BSH = /bin/sh
|
||||
|
||||
CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini
|
||||
|
||||
include Nvidia.makefile
|
||||
|
|
@ -57,7 +57,7 @@ CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
|||
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -L../../src/STUBS -lmpi_stubs
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC
|
||||
|
||||
CUDR_CPP = g++ -DMPI_GERYON -DUCL_NO_EXIT -fPIC -I../../src/STUBS
|
||||
CUDR_CPP = g++ -DMPI_GERYON -DUCL_NO_EXIT -fPIC -I../../src/STUBS -std=c++11
|
||||
CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias
|
||||
|
||||
BIN_DIR = ./
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
# /* ----------------------------------------------------------------------
|
||||
# Generic Linux Makefile for CUDA
|
||||
# - Change CUDA_ARCH for your GPU
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
# which file will be copied to Makefile.lammps
|
||||
|
||||
EXTRAMAKE = Makefile.lammps.standard
|
||||
|
||||
CUDA_HOME = ${CUDA_ROOT}
|
||||
NVCC = nvcc
|
||||
|
||||
# Kepler CUDA
|
||||
CUDA_ARCH = -arch=sm_35
|
||||
# Tesla CUDA
|
||||
#CUDA_ARCH = -arch=sm_21
|
||||
# newer CUDA
|
||||
#CUDA_ARCH = -arch=sm_13
|
||||
# older CUDA
|
||||
#CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE
|
||||
|
||||
# this setting should match LAMMPS Makefile
|
||||
# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL
|
||||
|
||||
LMP_INC = -DLAMMPS_SMALLBIG
|
||||
|
||||
# precision for GPU calculations
|
||||
# -D_SINGLE_SINGLE # Single precision for all calculations
|
||||
# -D_DOUBLE_DOUBLE # Double precision for all calculations
|
||||
# -D_SINGLE_DOUBLE # Accumulation of forces, etc. in double
|
||||
|
||||
CUDA_PRECISION = -D_DOUBLE_DOUBLE
|
||||
|
||||
CUDA_INCLUDE = -I$(CUDA_HOME)/include
|
||||
CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs
|
||||
CUDA_OPTS = -DUNIX -O3 --use_fast_math
|
||||
|
||||
CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK
|
||||
CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias
|
||||
|
||||
BIN_DIR = ./
|
||||
OBJ_DIR = ./
|
||||
LIB_DIR = ./
|
||||
AR = ar
|
||||
BSH = /bin/sh
|
||||
|
||||
CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini
|
||||
|
||||
include Nvidia.makefile
|
||||
|
|
@ -60,11 +60,9 @@ __kernel void k_gauss(const __global numtyp4 *restrict x_,
|
|||
numtyp4 ix; fetch4(ix,i,pos_tex); //x_[i];
|
||||
int itype=ix.w;
|
||||
|
||||
numtyp factor_lj;
|
||||
for ( ; nbor<nbor_end; nbor+=n_stride) {
|
||||
|
||||
int j=dev_packed[nbor];
|
||||
factor_lj = sp_lj[sbmask(j)];
|
||||
j &= NEIGHMASK;
|
||||
|
||||
numtyp4 jx; fetch4(jx,j,pos_tex); //x_[j];
|
||||
|
@ -148,11 +146,9 @@ __kernel void k_gauss_fast(const __global numtyp4 *restrict x_,
|
|||
int iw=ix.w;
|
||||
int itype=fast_mul((int)MAX_SHARED_TYPES,iw);
|
||||
|
||||
numtyp factor_lj;
|
||||
for ( ; nbor<nbor_end; nbor+=n_stride) {
|
||||
|
||||
int j=dev_packed[nbor];
|
||||
factor_lj = sp_lj[sbmask(j)];
|
||||
j &= NEIGHMASK;
|
||||
|
||||
numtyp4 jx; fetch4(jx,j,pos_tex); //x_[j];
|
||||
|
|
|
@ -668,7 +668,7 @@ class lammps(object):
|
|||
def version(self):
|
||||
"""Return a numerical representation of the LAMMPS version in use.
|
||||
|
||||
This is a wrapper around the :cpp:func:`lammps_close` function of the C-library interface.
|
||||
This is a wrapper around the :cpp:func:`lammps_version` function of the C-library interface.
|
||||
|
||||
:return: version number
|
||||
:rtype: int
|
||||
|
|
|
@ -98,7 +98,7 @@ void DumpAtomZstd::openfile()
|
|||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ int DumpAtomZstd::modify_param(int narg, char **arg)
|
|||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ void DumpCFGZstd::openfile()
|
|||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ int DumpCFGZstd::modify_param(int narg, char **arg)
|
|||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ void DumpCustomZstd::openfile()
|
|||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ int DumpCustomZstd::modify_param(int narg, char **arg)
|
|||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ void DumpLocalZstd::openfile()
|
|||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ int DumpLocalZstd::modify_param(int narg, char **arg)
|
|||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ void DumpXYZZstd::openfile()
|
|||
|
||||
try {
|
||||
writer.open(filecurrent);
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ int DumpXYZZstd::modify_param(int narg, char **arg)
|
|||
writer.setCompressionLevel(compression_level);
|
||||
return 2;
|
||||
}
|
||||
} catch (FileWriterException & e) {
|
||||
} catch (FileWriterException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ ZstdFileWriter::~ZstdFileWriter()
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ZstdFileWriter::open(const std::string & path)
|
||||
void ZstdFileWriter::open(const std::string &path)
|
||||
{
|
||||
if(isopen()) return;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ class ZstdFileWriter : public FileWriter {
|
|||
public:
|
||||
ZstdFileWriter();
|
||||
virtual ~ZstdFileWriter();
|
||||
virtual void open(const std::string & path) override;
|
||||
virtual void open(const std::string &path) override;
|
||||
virtual void close() override;
|
||||
virtual void flush() override;
|
||||
virtual size_t write(const void * buffer, size_t length) override;
|
||||
|
|
|
@ -438,7 +438,7 @@ void PairEAMAlloyGPU::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -441,7 +441,7 @@ void PairEAMFSGPU::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -338,8 +338,8 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg,
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void KimQuery::echo_var_assign(const std::string & name,
|
||||
const std::string & value) const
|
||||
void KimQuery::echo_var_assign(const std::string &name,
|
||||
const std::string &value) const
|
||||
{
|
||||
input->write_echo(fmt::format("variable {} string {}\n",name,value));
|
||||
}
|
||||
|
|
|
@ -1052,7 +1052,7 @@ void PairEAMAlloyKokkos<DeviceType>::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1055,7 +1055,7 @@ void PairEAMFSKokkos<DeviceType>::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -610,7 +610,7 @@ void PairADP::read_file(char *filename)
|
|||
reader.next_dvector(&file->w2r[i][j][1], file->nr);
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3634,12 +3634,12 @@ void PairAIREBO::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
std::string msg = fmt::format("ERROR reading {} section in {} file\n"
|
||||
"REASON: {}\n",
|
||||
current_section, potential_name, e.what());
|
||||
error->one(FLERR, msg);
|
||||
} catch (FileReaderException & fre) {
|
||||
} catch (FileReaderException &fre) {
|
||||
error->one(FLERR, fre.what());
|
||||
std::string msg = fmt::format("ERROR reading {} section in {} file\n"
|
||||
"REASON: {}\n",
|
||||
|
|
|
@ -5223,9 +5223,9 @@ void _noopt PairBOP::read_table(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
} catch (FileReaderException & fre) {
|
||||
} catch (FileReaderException &fre) {
|
||||
error->one(FLERR, fre.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -679,7 +679,7 @@ void PairComb::read_file(char *file)
|
|||
params[nparams].cml2 = values.next_double();
|
||||
params[nparams].coulcut = values.next_double();
|
||||
params[nparams].hfocor = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -450,9 +450,9 @@ void PairComb3::read_lib()
|
|||
}
|
||||
}
|
||||
|
||||
} catch (FileReaderException & fre) {
|
||||
} catch (FileReaderException &fre) {
|
||||
error->one(FLERR, fre.what());
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -640,7 +640,7 @@ void PairComb3::read_file(char *file)
|
|||
params[nparams].addrep = values.next_double();
|
||||
params[nparams].pcross = values.next_double();
|
||||
params[nparams].powermint = int(params[nparams].powerm);
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -506,7 +506,7 @@ void PairEAM::read_file(char *filename)
|
|||
for (int j = 1; j <= file->nr; ++j)
|
||||
file->zr[j] *= sqrt_conv;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ void PairEAMAlloy::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ void PairEAMFS::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1071,7 +1071,7 @@ EIMPotentialFileReader::EIMPotentialFileReader(LAMMPS *lmp,
|
|||
fclose(fp);
|
||||
}
|
||||
|
||||
std::pair<std::string, std::string> EIMPotentialFileReader::get_pair(const std::string & a, const std::string & b) {
|
||||
std::pair<std::string, std::string> EIMPotentialFileReader::get_pair(const std::string &a, const std::string &b) {
|
||||
if (a < b) {
|
||||
return std::make_pair(a, b);
|
||||
}
|
||||
|
|
|
@ -443,7 +443,7 @@ void PairGW::read_file(char *file)
|
|||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ void PairGWZBL::read_file(char *file)
|
|||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -344,7 +344,7 @@ void PairNb3bHarmonic::read_file(char *file)
|
|||
params[nparams].cutoff = values.next_double();
|
||||
|
||||
if (unit_convert) params[nparams].k_theta *= conversion_factor;
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -612,7 +612,7 @@ void PairPolymorphic::read_file(char *file)
|
|||
|
||||
if ((ng == 0) || (nr == 0) || (nx == 0))
|
||||
error->one(FLERR,"Error reading potential file header");
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR,"Potential file incompatible with this pair style version");
|
||||
}
|
||||
|
||||
|
@ -631,7 +631,7 @@ void PairPolymorphic::read_file(char *file)
|
|||
p.cutsq = p.cut*p.cut;
|
||||
p.xi = values.next_double();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -414,7 +414,7 @@ void PairSW::read_file(char *file)
|
|||
params[nparams].powerp = values.next_double();
|
||||
params[nparams].powerq = values.next_double();
|
||||
params[nparams].tol = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -466,7 +466,7 @@ void PairTersoff::read_file(char *file)
|
|||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,7 @@ void PairTersoffMOD::read_file(char *file)
|
|||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ void PairTersoffMODC::read_file(char *file)
|
|||
params[nparams].bigb *= conversion_factor;
|
||||
params[nparams].c0 *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ void PairTersoffZBL::read_file(char *file)
|
|||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -432,7 +432,7 @@ void PairVashishta::read_file(char *file)
|
|||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -411,7 +411,7 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword)
|
|||
tb->afile[i] = values.next_double();
|
||||
tb->efile[i] = values.next_double();
|
||||
tb->ffile[i] = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
++cerror;
|
||||
}
|
||||
}
|
||||
|
@ -526,7 +526,7 @@ void AngleTable::param_extract(Table *tb, char *line)
|
|||
error->one(FLERR,"Invalid keyword in angle table parameters");
|
||||
}
|
||||
}
|
||||
} catch(TokenizerException & e) {
|
||||
} catch(TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -341,7 +341,7 @@ void BondTable::read_table(Table *tb, char *file, char *keyword)
|
|||
tb->rfile[i] = values.next_double();
|
||||
tb->efile[i] = values.next_double();
|
||||
tb->ffile[i] = values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
++cerror;
|
||||
}
|
||||
|
||||
|
@ -491,7 +491,7 @@ void BondTable::param_extract(Table *tb, char *line)
|
|||
error->one(FLERR,"Invalid keyword in bond table parameters");
|
||||
}
|
||||
}
|
||||
} catch(TokenizerException & e) {
|
||||
} catch(TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -364,7 +364,7 @@ yes-%:
|
|||
@if [ ! -e Makefile.package.settings ]; \
|
||||
then cp Makefile.package.settings.empty Makefile.package.settings; fi
|
||||
@if [ ! -e $(YESDIR) ]; then \
|
||||
echo "Package $(@:yes-%=%) does not exist"; \
|
||||
echo "Package $(YESDIR) does not exist"; exit 1; \
|
||||
elif [ -e $(YESDIR)/Install.sh ]; then \
|
||||
echo "Installing package $(@:yes-%=%)"; \
|
||||
cd $(YESDIR); $(SHELL) Install.sh 1; cd ..; \
|
||||
|
@ -378,7 +378,7 @@ yes-%:
|
|||
|
||||
no-%:
|
||||
@if [ ! -e $(NODIR) ]; then \
|
||||
echo "Package $(@:no-%=%) does not exist"; \
|
||||
echo "Package $(NODIR) does not exist"; exit 1; \
|
||||
elif [ -e $(NODIR)/Install.sh ]; then \
|
||||
echo "Uninstalling package $(@:no-%=%)"; \
|
||||
cd $(NODIR); $(SHELL) Install.sh 0; cd ..; \
|
||||
|
|
|
@ -235,12 +235,14 @@ void PythonImpl::command(int narg, char **arg)
|
|||
|
||||
if (!pFunc) {
|
||||
PyGILState_Release(gstate);
|
||||
error->all(FLERR,"Could not find Python function");
|
||||
error->all(FLERR,fmt::format("Could not find Python function {}",
|
||||
pfuncs[ifunc].name));
|
||||
}
|
||||
|
||||
if (!PyCallable_Check(pFunc)) {
|
||||
PyGILState_Release(gstate);
|
||||
error->all(FLERR,"Python function is not callable");
|
||||
error->all(FLERR,fmt::format("Python function {} is not callable",
|
||||
pfuncs[ifunc].name));
|
||||
}
|
||||
|
||||
pfuncs[ifunc].pFunc = (void *) pFunc;
|
||||
|
|
|
@ -183,7 +183,7 @@ void PairEAMAlloyIntel::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ void PairEAMFSIntel::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1091,7 +1091,7 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword)
|
|||
tb->efile[i] = values.next_double();
|
||||
tb->ffile[i] = values.next_double();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
} //for (int i = 0; (i < tb->ninput) && fp; i++) {
|
||||
|
@ -1316,7 +1316,7 @@ void DihedralTable::param_extract(Table *tb, char *line)
|
|||
else error->one(FLERR,fmt::format("Invalid keyword in dihedral angle "
|
||||
"table parameters ({})", word));
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -923,7 +923,7 @@ void PairTersoffTable::read_file(char *file)
|
|||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ void PairEAMAlloyOMP::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ void PairEAMFSOMP::read_file(char *filename)
|
|||
}
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ void PairTersoffZBLOMP::read_file(char *file)
|
|||
params[nparams].biga *= conversion_factor;
|
||||
params[nparams].bigb *= conversion_factor;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@ void ComputePTMAtom::compute_peratom() {
|
|||
|
||||
// zero output
|
||||
|
||||
memset(output,0,nmax*NUM_COLUMNS*sizeof(double));
|
||||
memset(&output[0][0],0,nmax*NUM_COLUMNS*sizeof(double));
|
||||
|
||||
for (int ii = 0; ii < inum; ii++) {
|
||||
|
||||
|
@ -304,21 +304,17 @@ void ComputePTMAtom::compute_peratom() {
|
|||
double scale, rmsd, interatomic_distance;
|
||||
double q[4];
|
||||
bool standard_orientations = false;
|
||||
|
||||
rmsd = INFINITY;
|
||||
interatomic_distance = q[0] = q[1] = q[2] = q[3] = 0.0;
|
||||
|
||||
ptm_index(local_handle, i, get_neighbours, (void*)&nbrlist,
|
||||
input_flags, standard_orientations,
|
||||
&type, &alloy_type, &scale, &rmsd, q,
|
||||
nullptr, nullptr, nullptr, nullptr, &interatomic_distance, nullptr, nullptr);
|
||||
|
||||
if (rmsd > rmsd_threshold) {
|
||||
type = PTM_MATCH_NONE;
|
||||
}
|
||||
|
||||
// printf("%d type=%d rmsd=%f\n", i, type, rmsd);
|
||||
|
||||
if (type == PTM_MATCH_NONE) {
|
||||
type = PTM_LAMMPS_OTHER;
|
||||
rmsd = INFINITY;
|
||||
}
|
||||
if (rmsd > rmsd_threshold) type = PTM_MATCH_NONE;
|
||||
if (type == PTM_MATCH_NONE) type = PTM_LAMMPS_OTHER;
|
||||
|
||||
output[i][0] = type;
|
||||
output[i][1] = rmsd;
|
||||
|
@ -329,7 +325,6 @@ void ComputePTMAtom::compute_peratom() {
|
|||
output[i][6] = q[3];
|
||||
}
|
||||
|
||||
// printf("finished ptm analysis\n");
|
||||
ptm_uninitialize_local(local_handle);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class FileWriter {
|
|||
public:
|
||||
FileWriter() = default;
|
||||
virtual ~FileWriter() = default;
|
||||
virtual void open(const std::string & path) = 0;
|
||||
virtual void open(const std::string &path) = 0;
|
||||
virtual void close() = 0;
|
||||
virtual void flush() = 0;
|
||||
virtual size_t write(const void * buffer, size_t length) = 0;
|
||||
|
@ -37,7 +37,7 @@ public:
|
|||
class FileWriterException : public std::exception {
|
||||
std::string message;
|
||||
public:
|
||||
FileWriterException(const std::string & msg) : message(msg) {
|
||||
FileWriterException(const std::string &msg) : message(msg) {
|
||||
}
|
||||
|
||||
~FileWriterException() throw() {
|
||||
|
|
|
@ -35,8 +35,8 @@ class Info : protected Pointers {
|
|||
bool is_defined(const char *, const char *);
|
||||
bool is_available(const char *, const char *);
|
||||
|
||||
bool has_style(const std::string & category, const std::string & name);
|
||||
std::vector<std::string> get_available_styles(const std::string & category);
|
||||
bool has_style(const std::string &category, const std::string &name);
|
||||
std::vector<std::string> get_available_styles(const std::string &category);
|
||||
|
||||
static bool has_gzip_support();
|
||||
static bool has_png_support();
|
||||
|
|
|
@ -84,7 +84,7 @@ static void ptr_argument_warning()
|
|||
try
|
||||
|
||||
#define END_CAPTURE \
|
||||
catch(LAMMPSAbortException & ae) { \
|
||||
catch(LAMMPSAbortException &ae) { \
|
||||
int nprocs = 0; \
|
||||
MPI_Comm_size(ae.universe, &nprocs ); \
|
||||
\
|
||||
|
@ -93,7 +93,7 @@ static void ptr_argument_warning()
|
|||
} else { \
|
||||
error->set_last_error(ae.message, ERROR_NORMAL); \
|
||||
} \
|
||||
} catch(LAMMPSException & e) { \
|
||||
} catch(LAMMPSException &e) { \
|
||||
error->set_last_error(e.message, ERROR_NORMAL); \
|
||||
}
|
||||
#else
|
||||
|
@ -166,7 +166,7 @@ void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr)
|
|||
lmp = new LAMMPS(argc, argv, comm);
|
||||
if (ptr) *ptr = (void *) lmp;
|
||||
}
|
||||
catch(LAMMPSException & e) {
|
||||
catch(LAMMPSException &e) {
|
||||
fmt::print(stderr, "LAMMPS Exception: {}", e.message);
|
||||
*ptr = nullptr;
|
||||
}
|
||||
|
|
|
@ -492,7 +492,7 @@ void Molecule::read(int flag)
|
|||
|
||||
if (nmatch != nwant)
|
||||
error->one(FLERR,"Invalid header in molecule file");
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid header in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -692,7 +692,7 @@ void Molecule::coords(char *line)
|
|||
x[i][1] *= sizescale;
|
||||
x[i][2] *= sizescale;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Coords section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -722,7 +722,7 @@ void Molecule::types(char *line)
|
|||
type[i] = values.next_int();
|
||||
type[i] += toffset;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Types section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -752,7 +752,7 @@ void Molecule::molecules(char *line)
|
|||
molecule[i] = values.next_int();
|
||||
// molecule[i] += moffset; // placeholder for possible molecule offset
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Molecules section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ void Molecule::fragments(char *line)
|
|||
fragmentmask[i][atomID-1] = 1;
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid atom ID in Fragments section of molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -811,7 +811,7 @@ void Molecule::charges(char *line)
|
|||
values.next_int();
|
||||
q[i] = values.next_double();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Charges section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -837,7 +837,7 @@ void Molecule::diameters(char *line)
|
|||
radius[i] *= 0.5;
|
||||
maxradius = MAX(maxradius,radius[i]);
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Diameters section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -864,7 +864,7 @@ void Molecule::masses(char *line)
|
|||
rmass[i] = values.next_double();
|
||||
rmass[i] *= sizescale*sizescale*sizescale;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Masses section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -902,7 +902,7 @@ void Molecule::bonds(int flag, char *line)
|
|||
itype = values.next_int();
|
||||
atom1 = values.next_tagint();
|
||||
atom2 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Bonds section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -971,7 +971,7 @@ void Molecule::angles(int flag, char *line)
|
|||
atom1 = values.next_tagint();
|
||||
atom2 = values.next_tagint();
|
||||
atom3 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Angles section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1056,7 +1056,7 @@ void Molecule::dihedrals(int flag, char *line)
|
|||
atom2 = values.next_tagint();
|
||||
atom3 = values.next_tagint();
|
||||
atom4 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Dihedrals section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ void Molecule::impropers(int flag, char *line)
|
|||
atom2 = values.next_tagint();
|
||||
atom3 = values.next_tagint();
|
||||
atom4 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Impropers section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1248,7 +1248,7 @@ void Molecule::nspecial_read(int flag, char *line)
|
|||
c1 = values.next_tagint();
|
||||
c2 = values.next_tagint();
|
||||
c3 = values.next_tagint();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Special Bond Counts section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1287,7 +1287,7 @@ void Molecule::special_read(char *line)
|
|||
error->one(FLERR,"Invalid special atom index in molecule file");
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Molecule file special list\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1419,7 +1419,7 @@ void Molecule::shakeflag_read(char *line)
|
|||
values.next_int();
|
||||
shake_flag[i] = values.next_int();
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid Shake Flags section in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1484,7 +1484,7 @@ void Molecule::shakeatom_read(char *line)
|
|||
error->one(FLERR,"Invalid shake atom in molecule file");
|
||||
}
|
||||
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR,fmt::format("Invalid shake atom in molecule file\n"
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1549,7 +1549,7 @@ void Molecule::shaketype_read(char *line)
|
|||
if (nmatch != nwant)
|
||||
error->one(FLERR,"Invalid shake type data in molecule file");
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid shake type data in molecule file\n",
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
@ -1602,7 +1602,7 @@ void Molecule::body(int flag, int pflag, char *line)
|
|||
}
|
||||
} else nword += ncount;
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, fmt::format("Invalid body params in molecule file\n",
|
||||
"{}", e.what()));
|
||||
}
|
||||
|
|
|
@ -280,7 +280,7 @@ void PairCoulStreitz::read_file(char *file)
|
|||
params[nparams].zeta = values.next_double();
|
||||
params[nparams].zcore = values.next_double();
|
||||
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -402,7 +402,7 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
|
|||
rfile = values.next_double();
|
||||
tb->efile[i] = conversion_factor * values.next_double();
|
||||
tb->ffile[i] = conversion_factor * values.next_double();
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
++cerror;
|
||||
}
|
||||
|
||||
|
@ -571,7 +571,7 @@ void PairTable::param_extract(Table *tb, char *line)
|
|||
error->one(FLERR,fmt::format("Invalid keyword {} in pair table parameters", word).c_str());
|
||||
}
|
||||
}
|
||||
} catch (TokenizerException & e) {
|
||||
} catch (TokenizerException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,20 @@ enum ExecutionSpace{Host,Device};
|
|||
template <class T> class MyPoolChunk;
|
||||
template <class T> class MyPage;
|
||||
|
||||
/** \class LAMMPS_NS::Pointers
|
||||
* \brief Base class for LAMMPS features
|
||||
*
|
||||
* The Pointers class contains references to many of the pointers
|
||||
* and members of the LAMMPS_NS::LAMMPS class. Derived classes thus
|
||||
* gain access to the constituent class instances in the LAMMPS
|
||||
* composite class and thus to the core functionality of LAMMPS.
|
||||
*
|
||||
* This kind of construct is needed, since the LAMMPS constructor
|
||||
* should only be run once per LAMMPS instance and thus classes
|
||||
* cannot be derived from LAMMPS itself. The Pointers class
|
||||
* constructor instead only initializes C++ references to component
|
||||
* pointer in the LAMMPS class. */
|
||||
|
||||
class Pointers {
|
||||
public:
|
||||
Pointers(LAMMPS *ptr) :
|
||||
|
|
|
@ -61,7 +61,7 @@ PotentialFileReader::PotentialFileReader(LAMMPS *lmp,
|
|||
if(!reader) {
|
||||
error->one(FLERR, fmt::format("cannot open {} potential file {}", potential_name, filename));
|
||||
}
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ void PotentialFileReader::ignore_comments(bool value) {
|
|||
void PotentialFileReader::skip_line() {
|
||||
try {
|
||||
reader->skip_line();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ void PotentialFileReader::skip_line() {
|
|||
char *PotentialFileReader::next_line(int nparams) {
|
||||
try {
|
||||
return reader->next_line(nparams);
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -121,7 +121,7 @@ char *PotentialFileReader::next_line(int nparams) {
|
|||
void PotentialFileReader::next_dvector(double * list, int n) {
|
||||
try {
|
||||
return reader->next_dvector(list, n);
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
}
|
||||
|
@ -136,10 +136,10 @@ void PotentialFileReader::next_dvector(double * list, int n) {
|
|||
* \param separators String with list of separators.
|
||||
* \return ValueTokenizer object for read in text */
|
||||
|
||||
ValueTokenizer PotentialFileReader::next_values(int nparams, const std::string & separators) {
|
||||
ValueTokenizer PotentialFileReader::next_values(int nparams, const std::string &separators) {
|
||||
try {
|
||||
return reader->next_values(nparams, separators);
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return ValueTokenizer("");
|
||||
|
@ -153,7 +153,7 @@ double PotentialFileReader::next_double() {
|
|||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_double();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0.0;
|
||||
|
@ -167,7 +167,7 @@ int PotentialFileReader::next_int() {
|
|||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_int();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0;
|
||||
|
@ -181,7 +181,7 @@ tagint PotentialFileReader::next_tagint() {
|
|||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_tagint();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0;
|
||||
|
@ -195,7 +195,7 @@ bigint PotentialFileReader::next_bigint() {
|
|||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_bigint();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return 0;
|
||||
|
@ -209,7 +209,7 @@ std::string PotentialFileReader::next_string() {
|
|||
try {
|
||||
char * line = reader->next_line(1);
|
||||
return ValueTokenizer(line).next_string();
|
||||
} catch (FileReaderException & e) {
|
||||
} catch (FileReaderException &e) {
|
||||
error->one(FLERR, e.what());
|
||||
}
|
||||
return "";
|
||||
|
|
|
@ -334,7 +334,7 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields)
|
|||
return index of match or -1 if no match
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int ReaderNative::find_label(const std::string & label, const std::map<std::string, int> & labels)
|
||||
int ReaderNative::find_label(const std::string &label, const std::map<std::string, int> & labels)
|
||||
{
|
||||
auto it = labels.find(label);
|
||||
if (it != labels.end()) {
|
||||
|
|
|
@ -45,7 +45,7 @@ private:
|
|||
int nwords; // # of per-atom columns in dump file
|
||||
int *fieldindex; //
|
||||
|
||||
int find_label(const std::string & label, const std::map<std::string, int> & labels);
|
||||
int find_label(const std::string &label, const std::map<std::string, int> & labels);
|
||||
void read_lines(int);
|
||||
};
|
||||
|
||||
|
|
11
src/set.cpp
11
src/set.cpp
|
@ -1351,17 +1351,10 @@ void Set::topology(int keyword)
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Set::varparse(char *name, int m)
|
||||
void Set::varparse(const char *name, int m)
|
||||
{
|
||||
varflag = 1;
|
||||
|
||||
name = &name[2];
|
||||
int n = strlen(name) + 1;
|
||||
char *str = new char[n];
|
||||
strcpy(str,name);
|
||||
|
||||
int ivar = input->variable->find(str);
|
||||
delete [] str;
|
||||
int ivar = input->variable->find(name+2);
|
||||
|
||||
if (ivar < 0)
|
||||
error->all(FLERR,"Variable name for set command does not exist");
|
||||
|
|
|
@ -48,7 +48,7 @@ class Set : protected Pointers {
|
|||
void set(int);
|
||||
void setrandom(int);
|
||||
void topology(int);
|
||||
void varparse(char *, int);
|
||||
void varparse(const char *, int);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ TableFileReader::TableFileReader(LAMMPS *lmp,
|
|||
TableFileReader::~TableFileReader() {
|
||||
}
|
||||
|
||||
char *TableFileReader::find_section_start(const std::string & keyword) {
|
||||
char *TableFileReader::find_section_start(const std::string &keyword) {
|
||||
char *line = nullptr;
|
||||
while ((line = reader->next_line())) {
|
||||
ValueTokenizer values(line);
|
||||
|
|
|
@ -164,6 +164,6 @@ void TextFileReader::next_dvector(double * list, int n) {
|
|||
* \param separators String with list of separators.
|
||||
* \return ValueTokenizer object for read in text */
|
||||
|
||||
ValueTokenizer TextFileReader::next_values(int nparams, const std::string & separators) {
|
||||
ValueTokenizer TextFileReader::next_values(int nparams, const std::string &separators) {
|
||||
return ValueTokenizer(next_line(nparams), separators);
|
||||
}
|
||||
|
|
|
@ -41,13 +41,13 @@ namespace LAMMPS_NS
|
|||
char * next_line(int nparams = 0);
|
||||
|
||||
void next_dvector(double * list, int n);
|
||||
ValueTokenizer next_values(int nparams, const std::string & separators = TOKENIZER_DEFAULT_SEPARATORS);
|
||||
ValueTokenizer next_values(int nparams, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS);
|
||||
};
|
||||
|
||||
class FileReaderException : public std::exception {
|
||||
std::string message;
|
||||
public:
|
||||
FileReaderException(const std::string & msg) : message(msg) {
|
||||
FileReaderException(const std::string &msg) : message(msg) {
|
||||
}
|
||||
|
||||
~FileReaderException() throw() {
|
||||
|
@ -60,7 +60,7 @@ namespace LAMMPS_NS
|
|||
|
||||
class EOFException : public FileReaderException {
|
||||
public:
|
||||
EOFException(const std::string & msg) : FileReaderException(msg) {
|
||||
EOFException(const std::string &msg) : FileReaderException(msg) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
TokenizerException::TokenizerException(const std::string & msg, const std::string & token){
|
||||
TokenizerException::TokenizerException(const std::string &msg, const std::string &token){
|
||||
if(token.empty()) {
|
||||
message = msg;
|
||||
} else {
|
||||
|
@ -47,13 +47,13 @@ TokenizerException::TokenizerException(const std::string & msg, const std::strin
|
|||
* \param str string to be processed
|
||||
* \param separators string with separator characters (default: " \t\r\n\f") */
|
||||
|
||||
Tokenizer::Tokenizer(const std::string & str, const std::string & separators) :
|
||||
Tokenizer::Tokenizer(const std::string &str, const std::string &separators) :
|
||||
text(str), separators(separators), start(0), ntokens(std::string::npos)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
Tokenizer::Tokenizer(const Tokenizer & rhs) :
|
||||
Tokenizer::Tokenizer(const Tokenizer &rhs) :
|
||||
text(rhs.text), separators(rhs.separators), ntokens(rhs.ntokens)
|
||||
{
|
||||
reset();
|
||||
|
@ -75,7 +75,7 @@ void Tokenizer::reset() {
|
|||
*
|
||||
* \param str string to be searched for
|
||||
* \return true if string was found, false if not */
|
||||
bool Tokenizer::contains(const std::string & str) const {
|
||||
bool Tokenizer::contains(const std::string &str) const {
|
||||
return text.find(str) != std::string::npos;
|
||||
}
|
||||
|
||||
|
@ -169,13 +169,13 @@ std::vector<std::string> Tokenizer::as_vector() {
|
|||
*
|
||||
* \see Tokenizer InvalidIntegerException InvalidFloatException */
|
||||
|
||||
ValueTokenizer::ValueTokenizer(const std::string & str, const std::string & separators) : tokens(str, separators) {
|
||||
ValueTokenizer::ValueTokenizer(const std::string &str, const std::string &separators) : tokens(str, separators) {
|
||||
}
|
||||
|
||||
ValueTokenizer::ValueTokenizer(const ValueTokenizer & rhs) : tokens(rhs.tokens) {
|
||||
ValueTokenizer::ValueTokenizer(const ValueTokenizer &rhs) : tokens(rhs.tokens) {
|
||||
}
|
||||
|
||||
ValueTokenizer::ValueTokenizer(ValueTokenizer && rhs) : tokens(std::move(rhs.tokens)) {
|
||||
ValueTokenizer::ValueTokenizer(ValueTokenizer &&rhs) : tokens(std::move(rhs.tokens)) {
|
||||
}
|
||||
|
||||
/*! Indicate whether more tokens are available
|
||||
|
@ -189,7 +189,7 @@ bool ValueTokenizer::has_next() const {
|
|||
*
|
||||
* \param value string with value to be searched for
|
||||
* \return true if string was found, false if not */
|
||||
bool ValueTokenizer::contains(const std::string & value) const {
|
||||
bool ValueTokenizer::contains(const std::string &value) const {
|
||||
return tokens.contains(value);
|
||||
}
|
||||
|
||||
|
|
|
@ -885,7 +885,7 @@ char *Variable::retrieve(const char *name)
|
|||
if (which[ivar] >= num[ivar]) return nullptr;
|
||||
|
||||
if (eval_in_progress[ivar])
|
||||
print_var_error(FLERR,"Variable has a circular dependency",ivar);
|
||||
print_var_error(FLERR,"has a circular dependency",ivar);
|
||||
|
||||
eval_in_progress[ivar] = 1;
|
||||
|
||||
|
@ -931,8 +931,8 @@ char *Variable::retrieve(const char *name)
|
|||
} else if (style[ivar] == PYTHON) {
|
||||
int ifunc = python->variable_match(data[ivar][0],name,0);
|
||||
if (ifunc < 0)
|
||||
error->all(FLERR,fmt::format("Python variable '{}' does not match "
|
||||
"Python function", name));
|
||||
error->all(FLERR,fmt::format("Python variable {} does not match "
|
||||
"Python function {}", name, data[ivar][0]));
|
||||
python->invoke_function(ifunc,data[ivar][1]);
|
||||
str = data[ivar][1];
|
||||
// if Python func returns a string longer than VALUELENGTH
|
||||
|
@ -960,7 +960,7 @@ char *Variable::retrieve(const char *name)
|
|||
double Variable::compute_equal(int ivar)
|
||||
{
|
||||
if (eval_in_progress[ivar])
|
||||
print_var_error(FLERR,"Variable has a circular dependency",ivar);
|
||||
print_var_error(FLERR,"has a circular dependency",ivar);
|
||||
|
||||
eval_in_progress[ivar] = 1;
|
||||
|
||||
|
@ -970,7 +970,8 @@ double Variable::compute_equal(int ivar)
|
|||
else if (style[ivar] == PYTHON) {
|
||||
int ifunc = python->find(data[ivar][0]);
|
||||
if (ifunc < 0)
|
||||
print_var_error(FLERR,"Python variable has no function",ivar);
|
||||
print_var_error(FLERR,fmt::format("cannot find python function {}",
|
||||
data[ivar][0]),ivar);
|
||||
python->invoke_function(ifunc,data[ivar][1]);
|
||||
value = atof(data[ivar][1]);
|
||||
}
|
||||
|
@ -1004,7 +1005,7 @@ void Variable::compute_atom(int ivar, int igroup,
|
|||
double *vstore;
|
||||
|
||||
if (eval_in_progress[ivar])
|
||||
print_var_error(FLERR,"Variable has a circular dependency",ivar);
|
||||
print_var_error(FLERR,"has a circular dependency",ivar);
|
||||
|
||||
eval_in_progress[ivar] = 1;
|
||||
|
||||
|
@ -1080,7 +1081,7 @@ int Variable::compute_vector(int ivar, double **result)
|
|||
}
|
||||
|
||||
if (eval_in_progress[ivar])
|
||||
print_var_error(FLERR,"Variable has a circular dependency",ivar);
|
||||
print_var_error(FLERR,"has a circular dependency",ivar);
|
||||
|
||||
eval_in_progress[ivar] = 1;
|
||||
|
||||
|
@ -1899,10 +1900,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
|||
|
||||
int ivar = find(word+2);
|
||||
if (ivar < 0)
|
||||
print_var_error(FLERR,"Invalid variable reference "
|
||||
"in variable formula",ivar);
|
||||
print_var_error(FLERR,fmt::format("Invalid variable reference "
|
||||
"{} in variable formula",word),ivar);
|
||||
if (eval_in_progress[ivar])
|
||||
print_var_error(FLERR,"Variable has circular dependency",ivar);
|
||||
print_var_error(FLERR,"has a circular dependency",ivar);
|
||||
|
||||
// parse zero or one trailing brackets
|
||||
// point i beyond last bracket
|
||||
|
@ -4217,7 +4218,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
|
|||
print_var_error(FLERR,"Mis-matched special function variable "
|
||||
"in variable formula",ivar);
|
||||
if (eval_in_progress[ivar])
|
||||
print_var_error(FLERR,"Variable has circular dependency",ivar);
|
||||
print_var_error(FLERR,"has a circular dependency",ivar);
|
||||
|
||||
double *vec;
|
||||
nvec = compute_vector(ivar,&vec);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
CC=gcc
|
||||
OBJS = lmp2arc.o ReadCarFile.o ProcessPosFile01.o ProcessPosFile05.o unwrap_molecules.o WriteArcFrame.o
|
||||
|
||||
lmp2arc.exe: $(OBJS)
|
||||
gcc -o lmp2arc.exe $(OBJS)
|
||||
$(CC) -o lmp2arc.exe $(OBJS)
|
||||
|
||||
lmp2arc.o: lmp2arc.c lmp2.h
|
||||
ReadCarFile.o: ReadCarFile.c lmp2.h
|
||||
|
@ -12,7 +12,7 @@ WriteArcFrame.o: WriteArcFrame.c lmp2.h
|
|||
unwrap_molecules.o: unwrap_molecules.c lmp2.h
|
||||
|
||||
.c.o:
|
||||
gcc -O2 -c $<
|
||||
$(CC) -O2 -c $<
|
||||
|
||||
clean:
|
||||
rm lmp2arc.exe *.o
|
||||
|
|
|
@ -149,7 +149,7 @@ void ProcessPosFile01(int num_posfiles,char *posnames[],struct Sys *sysinfo,FILE
|
|||
|
||||
} /* end while over LINES*/
|
||||
|
||||
close(PosFile);
|
||||
fclose(PosFile);
|
||||
|
||||
} /* end for loop over POS FILES */
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ fprintf(stderr,"HERE 1\n");
|
|||
|
||||
} /* end while over LINES*/
|
||||
|
||||
close(PosFile);
|
||||
fclose(PosFile);
|
||||
|
||||
} /* end for loop over POS FILES */
|
||||
|
||||
|
|
|
@ -52,8 +52,12 @@ make
|
|||
| ubuntu16.04.def | Ubuntu 16.04LTS with MPI == OpenMPI, no LaTeX |
|
||||
| ubuntu18.04.def | Ubuntu 18.04LTS with MPI == OpenMPI |
|
||||
| ubuntu18.04_amd_rocm.def | Ubuntu 18.04LTS with AMD ROCm toolkit |
|
||||
| ubuntu18.04_gpu.def | Ubuntu 18.04LTS with -"- plus Nvidia CUDA 10.2 |
|
||||
| ubuntu18.04_nvidia.def | Ubuntu 18.04LTS with Nvidia CUDA 10.2 toolkit |
|
||||
| ubuntu18.04_gpu.def | Ubuntu 18.04LTS with -"- plus Nvidia CUDA 11.0 |
|
||||
| ubuntu18.04_nvidia.def | Ubuntu 18.04LTS with Nvidia CUDA 11.0 toolkit |
|
||||
| ubuntu18.04_intel_opencl.def | Ubuntu 18.04LTS with Intel OpenCL runtime |
|
||||
| ubuntu20.04.def | Ubuntu 20.04LTS with MPI == OpenMPI |
|
||||
| ubuntu20.04_amd_rocm.def | Ubuntu 20.04LTS with AMD ROCm toolkit |
|
||||
| ubuntu20.04_gpu.def | Ubuntu 20.04LTS with -"- plus Nvidia CUDA 11.0 |
|
||||
| ubuntu20.04_nvidia.def | Ubuntu 20.04LTS with Nvidia CUDA 11.0 toolkit |
|
||||
| ubuntu20.04_intel_opencl.def | Ubuntu 20.04LTS with Intel OpenCL runtime |
|
||||
| ------------------------------ | ---------------------------------------------- |
|
||||
|
|
|
@ -6,11 +6,11 @@ From: centos:8
|
|||
dnf config-manager --set-enabled PowerTools
|
||||
dnf -y update
|
||||
dnf -y install vim-enhanced git file make cmake patch which file ninja-build \
|
||||
ccache gcc-c++ gcc-gfortran clang gdb valgrind libubsan libasan libtsan \
|
||||
ccache gcc-c++ gcc-gfortran clang libomp-devel gdb valgrind libubsan libasan libtsan \
|
||||
eigen3-devel openblas-devel libpng-devel libjpeg-devel platform-python-devel \
|
||||
openmpi-devel mpich-devel fftw-devel voro++-devel gsl-devel hdf5-devel \
|
||||
netcdf-devel netcdf-cxx-devel netcdf-mpich-devel netcdf-openmpi-devel \
|
||||
enchant python3-virtualenv doxygen diffutils \
|
||||
enchant python3-virtualenv doxygen diffutils latexmk \
|
||||
texlive-latex-fonts texlive-pslatex texlive-collection-latexrecommended \
|
||||
texlive-latex texlive-latexconfig doxygen-latex texlive-collection-latex \
|
||||
texlive-latex-bin texlive-lualatex-math texlive-fncychap texlive-tabulary \
|
||||
|
|
|
@ -30,12 +30,12 @@ From: fedora:32
|
|||
mingw32-expat mingw64-expat \
|
||||
mingw64-expat-static mingw32-expat-static \
|
||||
mingw32-sqlite-static mingw64-sqlite-static \
|
||||
enchant python3-virtualenv doxygen \
|
||||
enchant python3-virtualenv doxygen latexmk \
|
||||
texlive-latex-fonts texlive-pslatex texlive-collection-latexrecommended \
|
||||
texlive-latex texlive-latexconfig doxygen-latex texlive-collection-latex \
|
||||
texlive-latex-bin texlive-lualatex-math texlive-fncychap texlive-tabulary \
|
||||
texlive-framed texlive-wrapfig texlive-upquote texlive-capt-of \
|
||||
texlive-needspace texlive-titlesec texlive-anysize texlive-dvipng \
|
||||
texlive-needspace texlive-titlesec texlive-anysize texlive-dvipng texlive-xindy \
|
||||
blas-devel lapack-devel libyaml-devel openkim-models kim-api-devel \
|
||||
zstd libzstd-devel
|
||||
dnf clean all
|
||||
|
|
|
@ -64,6 +64,8 @@ From: ubuntu:18.04
|
|||
texlive-publishers \
|
||||
texlive-science \
|
||||
dvipng \
|
||||
latexmk \
|
||||
xindy \
|
||||
vim-nox \
|
||||
virtualenv \
|
||||
voro++-dev \
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue