Compare commits
90 Commits
patch_2Aug
...
patch_2Aug
| Author | SHA1 | Date | |
|---|---|---|---|
| 0cb72423b8 | |||
| 8fc48ad374 | |||
| 6fbb96140f | |||
| c00326debc | |||
| 112f311591 | |||
| f3be84a22b | |||
| 307a5b9592 | |||
| 14d9e2b722 | |||
| 78fe9585a4 | |||
| f0f8b49afb | |||
| d0cfe2d00f | |||
| b1654f11c1 | |||
| 6573a8d882 | |||
| aa68d6aacd | |||
| bdc08a99fe | |||
| fc6fe9e740 | |||
| e2fede9076 | |||
| 48cde7c566 | |||
| 14583e5fb6 | |||
| ab2558db15 | |||
| 5fa0c4951a | |||
| f8a0e1524e | |||
| 592bd770a8 | |||
| 13c56473a2 | |||
| 3d7088a9d9 | |||
| 2f6567ad76 | |||
| 910bb4e111 | |||
| 6e7e2b7aee | |||
| bdbb391364 | |||
| ea67e3104d | |||
| 6c94fb5eea | |||
| 84bfbe7936 | |||
| 891e97ecf5 | |||
| 1fa18a45a8 | |||
| 9a60dbbf31 | |||
| 92d07ceba4 | |||
| fe90838843 | |||
| 2d0aa2daf5 | |||
| 696c2d15da | |||
| b570782d5e | |||
| 88cd314dc9 | |||
| 7e51d1e049 | |||
| d8c4115b86 | |||
| baa3c8e98c | |||
| 1a258d4349 | |||
| 87bbd70fd2 | |||
| 850e4d14cd | |||
| 0717019b2d | |||
| 0c7720843b | |||
| 4c18b2fe99 | |||
| 1d7b0b730f | |||
| 2946087b45 | |||
| 94b2cd7fc5 | |||
| dea53be1a5 | |||
| c3c72a3bff | |||
| 82b86031ef | |||
| 3dda8d752c | |||
| e5809d8be1 | |||
| 9861c93225 | |||
| 65b21b8772 | |||
| 8d8f6c3efd | |||
| 7d2238d7be | |||
| 638f6e9551 | |||
| a6979e5489 | |||
| 411574a39c | |||
| 874f5577d4 | |||
| 456449d4ff | |||
| 22cfd97f46 | |||
| 453469d6fe | |||
| e699ced7bd | |||
| 6baa2f432c | |||
| c114938867 | |||
| e8294aa207 | |||
| 6e32b0cada | |||
| 6243735af4 | |||
| 5816c0875a | |||
| a31617ef7b | |||
| d5c7da1b0e | |||
| 0b1453f7ea | |||
| ba204b3989 | |||
| fd86bbd982 | |||
| 020a4f6ee7 | |||
| 36b9d93b52 | |||
| cbe2266e40 | |||
| fb10881636 | |||
| dcbb09f321 | |||
| b00cb7e6bd | |||
| edfe752b2a | |||
| 6d28d53d60 | |||
| 9976d58b34 |
4
.github/workflows/unittest-macos.yml
vendored
4
.github/workflows/unittest-macos.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
build:
|
||||
name: MacOS Unit Test
|
||||
if: ${{ github.repository == 'lammps/lammps' }}
|
||||
runs-on: macos-latest
|
||||
runs-on: macos-13
|
||||
env:
|
||||
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||
|
||||
@ -43,6 +43,8 @@ jobs:
|
||||
working-directory: build
|
||||
run: |
|
||||
ccache -z
|
||||
python3 -m venv macosenv
|
||||
source macosenv/bin/activate
|
||||
python3 -m pip install numpy
|
||||
python3 -m pip install pyyaml
|
||||
cmake -C ../cmake/presets/clang.cmake \
|
||||
|
||||
@ -12,6 +12,11 @@ endif()
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW)
|
||||
endif()
|
||||
# set policy to silence warnings about requiring execute permission for find_program
|
||||
# we use OLD because the python-config script for the Fedora MinGW cross-compiler requires it currently
|
||||
if(POLICY CMP0109)
|
||||
cmake_policy(SET CMP0109 OLD)
|
||||
endif()
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
@ -29,6 +34,7 @@ project(lammps CXX)
|
||||
set(SOVERSION 0)
|
||||
get_property(BUILD_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
get_filename_component(LAMMPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. ABSOLUTE)
|
||||
get_filename_component(LAMMPS_LIB_BINARY_DIR ${CMAKE_BINARY_DIR}/lib ABSOLUTE)
|
||||
# collect all executables and shared libs in the top level build folder
|
||||
@ -169,6 +175,22 @@ if(MSVC)
|
||||
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# warn about potentially problematic GCC compiler versions
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
if (CMAKE_CXX_STANDARD GREATER_EQUAL 17)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0)
|
||||
message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} "
|
||||
"with C++17 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 9.x or later")
|
||||
endif()
|
||||
endif()
|
||||
if (CMAKE_CXX_STANDARD GREATER_EQUAL 11)
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
|
||||
message(WARNING "Using ${CMAKE_CXX_COMPILER_ID} compiler version ${CMAKE_CXX_COMPILER_VERSION} "
|
||||
"with C++11 is not recommended. Please use ${CMAKE_CXX_COMPILER_ID} compiler version 5.x or later")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# export all symbols when building a .dll file on windows
|
||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND BUILD_SHARED_LIBS)
|
||||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
@ -211,7 +233,6 @@ else()
|
||||
unset(CMAKE_CXX_CLANG_TIDY CACHE)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
file(GLOB ALL_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/[^.]*.cpp)
|
||||
file(GLOB MAIN_SOURCES ${CONFIGURE_DEPENDS} ${LAMMPS_SOURCE_DIR}/main.cpp)
|
||||
list(REMOVE_ITEM ALL_SOURCES ${MAIN_SOURCES})
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.10.04.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
# PACE library support for ML-PACE package
|
||||
|
||||
set(PACELIB_MD5 "70ff79f4e59af175e55d24f3243ad1ff" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
endif()
|
||||
|
||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||
set(PACELIB_MD5 "b45de9a633f42ed65422567e3ce56f9f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||
mark_as_advanced(PACELIB_URL)
|
||||
mark_as_advanced(PACELIB_MD5)
|
||||
GetFallbackURL(PACELIB_URL PACELIB_FALLBACK)
|
||||
|
||||
@ -25,7 +25,7 @@ if(DOWNLOAD_QUIP)
|
||||
else()
|
||||
message(FATAL_ERROR "The ${CMAKE_Fortran_COMPILER_ID} Fortran compiler is not (yet) supported for building QUIP")
|
||||
endif()
|
||||
set(temp "${temp}CFLAGS += -fPIC \nCPLUSPLUSFLAGS += -fPIC\nAR_ADD=src\n")
|
||||
set(temp "${temp}CFLAGS += -fPIC -Wno-return-mismatch \nCPLUSPLUSFLAGS += -fPIC -Wno-return-mismatch\nAR_ADD=src\n")
|
||||
set(temp "${temp}MATH_LINKOPTS=")
|
||||
foreach(flag ${BLAS_LIBRARIES})
|
||||
set(temp "${temp} ${flag}")
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
# Plumed2 support for PLUMED package
|
||||
|
||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||
if(POLICY CMP0135)
|
||||
cmake_policy(SET CMP0135 OLD)
|
||||
endif()
|
||||
|
||||
if(BUILD_MPI)
|
||||
set(PLUMED_CONFIG_MPI "--enable-mpi")
|
||||
set(PLUMED_CONFIG_CC ${CMAKE_MPI_C_COMPILER})
|
||||
@ -21,9 +26,11 @@ else()
|
||||
set(PLUMED_CONFIG_OMP "--disable-openmp")
|
||||
endif()
|
||||
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.8.2/plumed-src-2.8.2.tgz"
|
||||
# Note: must also adjust check for supported API versions in
|
||||
# fix_plumed.cpp when version changes from v2.n.x to v2.n+1.y
|
||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.9.1/plumed-src-2.9.1.tgz"
|
||||
CACHE STRING "URL for PLUMED tarball")
|
||||
set(PLUMED_MD5 "599092b6a0aa6fff992612537ad98994" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
set(PLUMED_MD5 "c3b2d31479c1e9ce211719d40e9efbd7" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||
|
||||
mark_as_advanced(PLUMED_URL)
|
||||
mark_as_advanced(PLUMED_MD5)
|
||||
@ -75,6 +82,9 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
|
||||
DEPENDS plumed_build
|
||||
COMMENT "Copying Plumed files"
|
||||
)
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps INTERFACE LAMMPS::PLUMED)
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
@ -149,6 +159,9 @@ else()
|
||||
endif()
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
||||
endif()
|
||||
else()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(PLUMED REQUIRED plumed)
|
||||
@ -163,7 +176,9 @@ else()
|
||||
endif()
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PLUMED_INCLUDE_DIRS}")
|
||||
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||
target_link_libraries(lammps PUBLIC LAMMPS::PLUMED)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
||||
|
||||
@ -32,7 +32,6 @@ set(WIN_PACKAGES
|
||||
FEP
|
||||
GPU
|
||||
GRANULAR
|
||||
INTEL
|
||||
INTERLAYER
|
||||
KSPACE
|
||||
LEPTON
|
||||
|
||||
@ -1450,6 +1450,11 @@ in lib/pace or somewhere else, which must be done before building
|
||||
LAMMPS with this package. The code for the library can be found
|
||||
at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps-user-pace/>`_
|
||||
|
||||
Instead of including the ML-PACE package directly into LAMMPS, it
|
||||
is also possible to skip this step and build the ML-PACE package as
|
||||
a plugin using the CMake script files in the ``examples/PACKAGE/pace/plugin``
|
||||
folder and then load this plugin at runtime with the :doc:`plugin command <plugin>`.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
@ -1614,6 +1619,11 @@ try a different one, switch to a different build system, consider a
|
||||
global PLUMED installation or consider downloading PLUMED during the
|
||||
LAMMPS build.
|
||||
|
||||
Instead of including the PLUMED package directly into LAMMPS, it
|
||||
is also possible to skip this step and build the PLUMED package as
|
||||
a plugin using the CMake script files in the ``examples/PACKAGE/plumed/plugin``
|
||||
folder and then load this plugin at runtime with the :doc:`plugin command <plugin>`.
|
||||
|
||||
.. tabs::
|
||||
|
||||
.. tab:: CMake build
|
||||
|
||||
@ -283,7 +283,7 @@ in the ``examples/kim/plugin`` folder. No changes to the sources of the
|
||||
KIM package themselves are needed; only the plugin interface and loader
|
||||
code needs to be added. This example only supports building with CMake,
|
||||
but is probably a more typical example. To compile you need to run CMake
|
||||
with -DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>. Other
|
||||
with ``-DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>``. Other
|
||||
configuration setting are identical to those for compiling LAMMPS.
|
||||
|
||||
A second example for a plugin from a package is in the
|
||||
|
||||
@ -144,26 +144,28 @@ Indices and tables
|
||||
* :ref:`genindex`
|
||||
* :ref:`search`
|
||||
|
||||
.. _webbrowser:
|
||||
.. admonition:: Web Browser Compatibility
|
||||
:class: note
|
||||
.. only:: html
|
||||
|
||||
The HTML version of the manual makes use of advanced features present
|
||||
in "modern" web browsers. This leads to incompatibilities with older
|
||||
web browsers and specific vendor browsers (e.g. Internet Explorer on Windows)
|
||||
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://docs.lammps.org/Manual.pdf>`_.
|
||||
.. _webbrowser:
|
||||
.. admonition:: Web Browser Compatibility
|
||||
:class: note
|
||||
|
||||
The following web browser versions have been verified to work as
|
||||
expected on Linux, macOS, and Windows where available:
|
||||
The HTML version of the manual makes use of advanced features present
|
||||
in "modern" web browsers. This leads to incompatibilities with older
|
||||
web browsers and specific vendor browsers (e.g. Internet Explorer on Windows)
|
||||
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://docs.lammps.org/Manual.pdf>`_.
|
||||
|
||||
- Safari version 11.1 and later
|
||||
- Firefox version 54 and later
|
||||
- Chrome version 54 and later
|
||||
- Opera version 41 and later
|
||||
- Edge version 80 and later
|
||||
The following web browser versions have been verified to work as
|
||||
expected on Linux, macOS, and Windows where available:
|
||||
|
||||
Also Android version 7.1 and later and iOS version 11 and later have
|
||||
been verified to render this website as expected.
|
||||
- Safari version 11.1 and later
|
||||
- Firefox version 54 and later
|
||||
- Chrome version 54 and later
|
||||
- Opera version 41 and later
|
||||
- Edge version 80 and later
|
||||
|
||||
Also Android version 7.1 and later and iOS version 11 and later have
|
||||
been verified to render this website as expected.
|
||||
|
||||
@ -1797,7 +1797,8 @@ Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1.
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <ml-pace>` on the
|
||||
:doc:`Build extras <Build_extras>` page.
|
||||
:doc:`Build extras <Build_extras>` page. This package may also be compiled
|
||||
as a plugin to avoid licensing conflicts when distributing binaries.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
@ -2357,7 +2358,9 @@ and Gareth Tribello.
|
||||
|
||||
**Install:**
|
||||
|
||||
This package has :ref:`specific installation instructions <plumed>` on the :doc:`Build extras <Build_extras>` page.
|
||||
This package has :ref:`specific installation instructions <plumed>` on the
|
||||
:doc:`Build extras <Build_extras>` page. This package may also be compiled
|
||||
as a plugin to avoid licensing conflicts when distributing binaries.
|
||||
|
||||
**Supporting info:**
|
||||
|
||||
|
||||
@ -802,7 +802,7 @@ and LAMMPS GUI can be launched from anywhere from the command line.
|
||||
|
||||
The standard CMake build procedure can be applied and the
|
||||
``mingw-cross.cmake`` preset used. By using ``mingw64-cmake`` the CMake
|
||||
command will automatically include a suitable CMake toolset file (the
|
||||
command will automatically include a suitable CMake toolchain file (the
|
||||
regular cmake command can be used after that). After building the
|
||||
libraries and executables, you can build the target 'zip'
|
||||
(i.e. ``cmake --build <build dir> --target zip`` or ``make zip``
|
||||
|
||||
@ -31,15 +31,6 @@ Commands
|
||||
dihedral_write
|
||||
dimension
|
||||
displace_atoms
|
||||
dump
|
||||
dump_adios
|
||||
dump_cfg_uef
|
||||
dump_h5md
|
||||
dump_image
|
||||
dump_modify
|
||||
dump_molfile
|
||||
dump_netcdf
|
||||
dump_vtk
|
||||
dynamical_matrix
|
||||
echo
|
||||
fix
|
||||
|
||||
@ -45,7 +45,8 @@ Restrictions
|
||||
""""""""""""
|
||||
|
||||
This compute is part of the MACHDYN package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -24,7 +24,7 @@ Description
|
||||
"""""""""""
|
||||
|
||||
Define a computation that provides the per-particle volume and the sum
|
||||
of the per-particle volumes of the group for which the fix is defined.
|
||||
of the per-particle volumes of the group for which the compute is defined.
|
||||
|
||||
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
|
||||
Mach Dynamics in LAMMPS.
|
||||
@ -41,13 +41,14 @@ The per-particle vector values will be given in :doc:`units <units>` of
|
||||
volume.
|
||||
|
||||
Additionally, the compute returns a scalar, which is the sum of the
|
||||
per-particle volumes of the group for which the fix is defined.
|
||||
per-particle volumes of the group for which the compute is defined.
|
||||
|
||||
Restrictions
|
||||
""""""""""""
|
||||
|
||||
This compute is part of the MACHDYN package. It is only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
Dump Styles
|
||||
###############
|
||||
###########
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
:glob:
|
||||
|
||||
dump*
|
||||
dump
|
||||
dump_*
|
||||
|
||||
@ -65,7 +65,6 @@ Examples
|
||||
fix 1 all ave/correlate 1 50 10000 &
|
||||
c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] &
|
||||
type upper ave running title1 "My correlation data"
|
||||
|
||||
fix 1 all ave/correlate 1 50 10000 c_thermo_press[*]
|
||||
|
||||
Description
|
||||
|
||||
@ -20,11 +20,11 @@ Syntax
|
||||
.. parsed-literal::
|
||||
|
||||
c_ID = global scalar calculated by a compute with ID
|
||||
c_ID[I] = Ith component of global vector calculated by a compute with ID
|
||||
c_ID[I] = Ith component of global vector calculated by a compute with ID, I can include wildcard (see below)
|
||||
f_ID = global scalar calculated by a fix with ID
|
||||
f_ID[I] = Ith component of global vector calculated by a fix with ID
|
||||
f_ID[I] = Ith component of global vector calculated by a fix with ID, I can include wildcard (see below)
|
||||
v_name = global value calculated by an equal-style variable with name
|
||||
v_name[I] = Ith component of global vector calculated by a vector-style variable with name
|
||||
v_name[I] = Ith component of a vector-style variable with name, I can include wildcard (see below)
|
||||
|
||||
* zero or more keyword/arg pairs may be appended
|
||||
* keyword = *type* or *start* or *file* or *overwrite* or *title1* or *title2* or *ncorr* or *nlen* or *ncount*
|
||||
@ -63,6 +63,7 @@ Examples
|
||||
fix 1 all ave/correlate/long 1 10000 &
|
||||
c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] &
|
||||
type upper title1 "My correlation data" nlen 15 ncount 3
|
||||
fix 1 all ave/correlate/long 1 10000 c_thermo_press[*]
|
||||
|
||||
Description
|
||||
"""""""""""
|
||||
@ -80,8 +81,10 @@ specified values may represent calculations performed by computes and
|
||||
fixes which store their own "group" definitions.
|
||||
|
||||
Each listed value can be the result of a compute or fix or the
|
||||
evaluation of an equal-style variable. See the
|
||||
:doc:`fix ave/correlate <fix_ave_correlate>` page for details.
|
||||
evaluation of an equal-style or vector-style variable. For
|
||||
vector-style variables, the specified indices can include a wildcard
|
||||
character. See the :doc:`fix ave/correlate <fix_ave_correlate>` page
|
||||
for details.
|
||||
|
||||
The *Nevery* and *Nfreq* arguments specify on what time steps the input
|
||||
values will be used to calculate correlation data and the frequency
|
||||
|
||||
@ -267,6 +267,8 @@ The value of the *page* setting must be at least 10x larger than the
|
||||
*one* setting. This ensures neighbor pages are not mostly empty
|
||||
space.
|
||||
|
||||
The *exclude group* setting is currently not compatible with dynamic groups.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
|
||||
@ -427,7 +427,7 @@ package. They are only enabled if LAMMPS was built with that package.
|
||||
See the :doc:`Build package <Build_package>` page for more info.
|
||||
|
||||
The maximum number of elements, that can be read from the MEAM library
|
||||
file, is determined at compile time. The default is 5. If you need
|
||||
file, is determined at compile time. The default is 8. If you need
|
||||
support for more elements, you have to change the the constant 'maxelt'
|
||||
at the beginning of the file ``src/MEAM/meam.h`` and update/recompile
|
||||
LAMMPS. There is no limit on the number of atoms types.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
Sphinx >= 5.3.0, <7.2.0
|
||||
Sphinx >= 5.3.0, <7.5
|
||||
sphinxcontrib-spelling
|
||||
sphinxcontrib-jquery
|
||||
git+https://github.com/akohlmey/sphinx-fortran@parallel-read
|
||||
|
||||
@ -68,7 +68,7 @@ images_config = {
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
source_suffix = {'.rst': 'restructuredtext'}
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
@ -296,6 +296,7 @@ latex_elements = {
|
||||
\setcounter{tocdepth}{2}
|
||||
\renewcommand{\sfdefault}{ptm} % Use Times New Roman font for \textrm
|
||||
\renewcommand{\sfdefault}{phv} % Use Helvetica font for \textsf
|
||||
\usepackage[columns=1]{idxlayout} % create index with only one column
|
||||
% Set up math fonts to match text fonts
|
||||
\DeclareSymbolFont{operators} {OT1}{ptm}{m}{n}
|
||||
\DeclareSymbolFont{bold} {OT1}{ptm}{bx}{n}
|
||||
@ -340,6 +341,11 @@ latex_elements = {
|
||||
'''
|
||||
}
|
||||
|
||||
# copy custom style file for tweaking index layout
|
||||
latex_additional_files = [
|
||||
'latex/idxlayout.sty', 'latex/ellipse.sty',
|
||||
'latex/pict2e.sty', 'latex/p2e-pdftex.def',
|
||||
]
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
@ -382,6 +388,12 @@ man_pages = [
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# strip off LAMMPS_NS:: from index entries
|
||||
cpp_index_common_prefix = [
|
||||
'LAMMPS_NS::',
|
||||
'_LMP_STYLE_CONST::', '_LMP_TYPE_CONST::', '_LMP_VAR_CONST::',
|
||||
]
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
|
||||
@ -790,6 +790,7 @@ dispersionflag
|
||||
dissipative
|
||||
Dissipative
|
||||
distharm
|
||||
distutils
|
||||
dl
|
||||
dlabel
|
||||
dlambda
|
||||
|
||||
318
doc/utils/sphinx-config/latex/ellipse.sty
Normal file
318
doc/utils/sphinx-config/latex/ellipse.sty
Normal file
@ -0,0 +1,318 @@
|
||||
%%
|
||||
%% This is file `ellipse.sty',
|
||||
%% generated with the docstrip utility.
|
||||
%%
|
||||
%% The original source files were:
|
||||
%%
|
||||
%% ellipse.dtx (with options: `package')
|
||||
%%
|
||||
%% Copyright (C) 2015
|
||||
%% Daan Leijen
|
||||
%%
|
||||
%% This work may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either version 1.3
|
||||
%% of this license or (at your option) any later version.
|
||||
%% The latest version of this license is in
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.3 or later is part of all distributions of LaTeX
|
||||
%% version 2003/12/01 or later.
|
||||
%%
|
||||
%% This work has the LPPL maintenance status "author-maintained".
|
||||
%%
|
||||
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
|
||||
\ProvidesPackage{ellipse}
|
||||
[2004/11/05 v1.0 .dtx ellipse file]
|
||||
\RequirePackage{pict2e}
|
||||
|
||||
\providecommand*\pIIe@csedef[1]{\expandafter\edef\csname #1\endcsname}
|
||||
\newcommand*\pIIe@ellip@csqrt[3]{%
|
||||
\@ovxx=#1\relax
|
||||
\ifdim\@ovxx<\z@\@ovxx-\@ovxx\fi
|
||||
\@ovyy=#2\relax
|
||||
\ifdim\@ovyy<\z@\@ovyy-\@ovyy\fi
|
||||
\edef\pIIe@csname{@csqrt(\number\@ovxx,\number\@ovyy)}%
|
||||
\expandafter\ifx\csname\pIIe@csname\endcsname\relax
|
||||
\pIIe@ellip@csqrt@%
|
||||
\pIIe@csedef{\pIIe@csname}{\the\dimen@}%
|
||||
#3\dimen@
|
||||
\else
|
||||
#3\dimexpr\csname\pIIe@csname\endcsname\relax
|
||||
\fi
|
||||
}
|
||||
\newcommand*\pIIe@ellip@csqrt@{%
|
||||
\@ovdx\@ovxx
|
||||
\advance\@ovdx by \@ovyy
|
||||
\dimen@0.7071067\@ovdx
|
||||
\ifdim\dimen@<\@ovyy\dimen@\@ovyy\fi
|
||||
\ifdim\dimen@<\@ovxx\dimen@\@ovxx\fi
|
||||
\ifdim\@ovdx<128\p@
|
||||
\edef\@tempa{\strip@pt\@ovxx}%
|
||||
\@ovxx\@tempa\@ovxx
|
||||
\edef\@tempa{\strip@pt\@ovyy}%
|
||||
\@ovyy\@tempa\@ovyy
|
||||
\advance\@ovxx by \@ovyy
|
||||
\advance\dimen@ by \dimexpr1pt * \@ovxx/\dimen@\relax
|
||||
\divide\dimen@ by 2%
|
||||
\advance\dimen@ by \dimexpr1pt * \@ovxx/\dimen@\relax
|
||||
\divide\dimen@ by 2%
|
||||
\fi
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@atan@{%
|
||||
\@tempdima\dimen@
|
||||
\@tempdimb\@tempdima
|
||||
\ifdim\@tempdimb<\z@\@tempdimb-\@tempdimb\fi
|
||||
\dimen@0.0663\@tempdimb
|
||||
\advance\dimen@ 0.2447pt\relax
|
||||
\advance\@tempdimb -1pt\relax
|
||||
\edef\@tempa{\strip@pt\@tempdimb}%
|
||||
\dimen@\@tempa\dimen@
|
||||
\edef\@tempa{\strip@pt\@tempdima}%
|
||||
\dimen@\@tempa\dimen@
|
||||
\dimen@-\dimen@
|
||||
\advance\dimen@ 0.7853\@tempdima
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@atantwo[3]{%
|
||||
\edef\pIIe@csname{@atan2(\number\dimexpr#1\relax,\number\dimexpr#2\relax)}%
|
||||
\expandafter\ifx\csname\pIIe@csname\endcsname\relax
|
||||
\pIIe@atantwo@{#1}{#2}{#3}%
|
||||
\pIIe@csedef{\pIIe@csname}{\the\dimexpr#3\relax}%
|
||||
\else
|
||||
#3\dimexpr\csname\pIIe@csname\endcsname\relax
|
||||
\fi
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@atantwo@[3]{%
|
||||
\@tempdima\dimexpr#2\relax
|
||||
\@tempdimb\dimexpr#1\relax
|
||||
\ifdim\@tempdima=\z@\relax
|
||||
\ifdim\@tempdimb>\z@\relax\dimen@90\p@
|
||||
\else\ifdim\@tempdimb<\z@\relax\dimen@-90\p@
|
||||
\else\dimen@0\p@
|
||||
\fi\fi
|
||||
\else
|
||||
\@tempdimd\z@
|
||||
\ifdim\@tempdima<\z@\relax
|
||||
\ifdim\@tempdimb<\z@\relax\@tempdimd-180\p@
|
||||
\else\@tempdimd180\p@
|
||||
\fi
|
||||
\fi
|
||||
\dimen@\dimexpr1pt * \@tempdimb/\@tempdima\relax
|
||||
\@tempdimc\dimen@
|
||||
\ifdim\@tempdimc<\z@\relax\@tempdimc-\@tempdimc\fi
|
||||
\ifdim\@tempdimc>\p@\relax
|
||||
\dimen@\dimexpr1pt * \@tempdima/\@tempdimb\relax
|
||||
\ifdim\dimen@<\z@\relax\def\@tempsign{-}\else\def\@tempsign{}\fi
|
||||
\pIIe@atan@
|
||||
\dimen@-\dimen@
|
||||
\advance\dimen@ by \@tempsign1.5707pt\relax
|
||||
\else
|
||||
\pIIe@atan@
|
||||
\fi
|
||||
\dimen@57.29578\dimen@
|
||||
\advance\dimen@ by \@tempdimd
|
||||
\fi
|
||||
#3\dimen@%
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@noneto[2]{}
|
||||
\newcommand*\pIIe@ellip@sincost@[2]{%
|
||||
\CalculateSin{#1}%
|
||||
\CalculateCos{#1}%
|
||||
\@tempdima\UseSin{#1}\p@
|
||||
\@tempdimb\UseCos{#1}\p@
|
||||
\ifdim\@tempdima=\p@\relax
|
||||
\pIIe@csedef{@ellipsin#2}{1}%
|
||||
\pIIe@csedef{@ellipcos#2}{0}%
|
||||
\else\ifdim\@tempdima=-\p@\relax
|
||||
\pIIe@csedef{@ellipsin#2}{-1}%
|
||||
\pIIe@csedef{@ellipcos#2}{0}%
|
||||
\else
|
||||
\@tempdimc\@ellipratio\dimexpr1pt * \@tempdima/\@tempdimb\relax
|
||||
%\typeout{ i#2=\the\@tempdimc, sin(#1)=\the\@tempdima}%
|
||||
\pIIe@ellip@csqrt{\p@}{\@tempdimc}\@tempdimd
|
||||
\ifdim\@tempdimb<\z@\relax\@tempdimd-\@tempdimd\fi
|
||||
\pIIe@csedef{@ellipsin#2}{\strip@pt\dimexpr1pt * \@tempdimc/\@tempdimd\relax}%
|
||||
\pIIe@csedef{@ellipcos#2}{\strip@pt\dimexpr1pt * \p@/\@tempdimd\relax}%
|
||||
\fi\fi
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@ellip@sincost[2]{%
|
||||
%\typeout{ calc sin cos: angles (#1,#2), radii: (\the\@ovro,\the\@ovri)}%
|
||||
\edef\@ellipratio{\strip@pt\dimexpr1pt * \@ovro/\@ovri\relax}%
|
||||
\pIIe@ellip@sincost@{#1}{one}%
|
||||
\pIIe@ellip@sincost@{#2}{two}%
|
||||
%\typeout{ sincos(a=#1)=(\@ellipsinone,\@ellipcosone), sincos(a=#2)=(\@ellipsintwo,\@ellipcostwo), }%
|
||||
}
|
||||
\newcommand*\pIIe@omega[3]{%
|
||||
\@tempdima\csname @ellipcos#3\endcsname\@ovro
|
||||
\advance\@tempdima by #1\relax
|
||||
\@tempdimb\csname @ellipsin#3\endcsname\@ovri
|
||||
\advance\@tempdimb by #2\relax
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@omegai[1]{%
|
||||
\@tempdimc\csname @ellipsin#1\endcsname\@ovro
|
||||
\@tempdimc-\@tempdimc
|
||||
\@tempdimd\csname @ellipcos#1\endcsname\@ovri
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@ellip@kappa{%
|
||||
\@ovyy\@ellipsinone\p@
|
||||
\@ovxx\@ellipcosone\p@
|
||||
\@tempdima\@ellipcostwo\@ovyy
|
||||
\@tempdima-\@tempdima
|
||||
\advance\@tempdima by \@ellipsintwo\@ovxx
|
||||
\@tempdimb\@ellipcostwo\@ovxx
|
||||
\advance\@tempdimb by \@ellipsintwo\@ovyy
|
||||
\ifdim\@tempdima=\z@\relax
|
||||
\edef\@ellipkappa{0}%
|
||||
\else
|
||||
\dimen@\dimexpr1pt - \@tempdimb\relax
|
||||
\dimen@\dimexpr1pt * \dimen@/\@tempdima\relax
|
||||
\pIIe@ellip@csqrt{2\p@}{1.73205\dimen@}{\dimen@}%
|
||||
\advance\dimen@ by -\p@
|
||||
\divide\dimen@ by 3%
|
||||
\edef\@tempa{\strip@pt\@tempdima}%
|
||||
\dimen@\@tempa\dimen@
|
||||
\edef\@ellipkappa{\strip@pt\dimen@}%
|
||||
\fi
|
||||
%\typeout{ calculated kappa: \@ellipkappa}%
|
||||
}
|
||||
|
||||
\newcommand*\pIIe@elliparc@[5]{%
|
||||
%\typeout{elliparc: #1, center: (#2, #3), radius (\the\@ovro, \the\@ovri),angle (#4, #5)}%
|
||||
\ifcase #1\relax
|
||||
\let\@ellip@startto\pIIe@lineto
|
||||
\or \let\@ellip@startto\pIIe@moveto
|
||||
\or \let\@ellip@startto\pIIe@noneto%
|
||||
\else\PackageWarning{ellipse}{Illegal initial action in \protect\elliparc: %
|
||||
must be one of 0 (lineto), 1 (moveto) or 2 (do nothing) but I got: #1}%
|
||||
\fi
|
||||
\ifdim\@ovro=\z@\relax\@ovri\z@\fi
|
||||
\ifdim\@ovri=\z@\relax
|
||||
\@ellip@startto{#2}{#3}%
|
||||
\else
|
||||
\pIIe@ellip@sincost{#4}{#5}%
|
||||
\pIIe@elliparc@draw{#2}{#3}%
|
||||
\fi
|
||||
}
|
||||
\newcommand*\pIIe@elliparc@t[5]{%
|
||||
\ifcase #1\relax
|
||||
\let\@ellip@startto\pIIe@lineto
|
||||
\or \let\@ellip@startto\pIIe@moveto
|
||||
\or \let\@ellip@startto\pIIe@noneto%
|
||||
\else\PackageWarning{ellipse}{Illegal initial action in \protect\elliparc: %
|
||||
must be one of 0 (lineto), 1 (moveto) or 2 (do nothing) but I got: #1}%
|
||||
\fi
|
||||
\ifdim\@ovro=\z@\relax\@ovri\z@\fi
|
||||
\ifdim\@ovri=\z@\relax
|
||||
\@ellip@startto{#2}{#3}%
|
||||
\else
|
||||
\CalculateSin{#4}\CalculateCos{#4}%
|
||||
\edef\@ellipsinone{\UseSin{#4}}%
|
||||
\edef\@ellipcosone{\UseCos{#4}}%
|
||||
\CalculateSin{#5}\CalculateCos{#5}%
|
||||
\edef\@ellipsintwo{\UseSin{#5}}%
|
||||
\edef\@ellipcostwo{\UseCos{#5}}%
|
||||
\pIIe@elliparc@draw{#2}{#3}%
|
||||
\fi
|
||||
}
|
||||
\newcommand*\pIIe@elliparc@draw[2]{%
|
||||
\pIIe@ellip@kappa%
|
||||
\pIIe@omega{#1}{#2}{one}%
|
||||
%\typeout{ point one: (\the\@tempdima,\the\@tempdimb)}%
|
||||
\@ellip@startto\@tempdima\@tempdimb
|
||||
\pIIe@omegai{one}%
|
||||
\advance\@tempdima by \@ellipkappa\@tempdimc
|
||||
\advance\@tempdimb by \@ellipkappa\@tempdimd
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
%\typeout{ control one: (\the\@tempdima,\the\@tempdimb)}%
|
||||
\pIIe@omega{#1}{#2}{two}%
|
||||
\pIIe@omegai{two}%
|
||||
\@tempdimc\@ellipkappa\@tempdimc
|
||||
\@tempdimd\@ellipkappa\@tempdimd
|
||||
\@tempdimc-\@tempdimc
|
||||
\@tempdimd-\@tempdimd
|
||||
\advance\@tempdimc by \@tempdima
|
||||
\advance\@tempdimd by \@tempdimb
|
||||
\pIIe@add@nums\@tempdimc\@tempdimd
|
||||
%\typeout{ control two: (\the\@tempdimc,\the\@tempdimd)}%
|
||||
\pIIe@add@CP\@tempdima\@tempdimb
|
||||
%\typeout{ point two: (\the\@tempdima,\the\@tempdimb)}%
|
||||
\pIIe@addtoGraph\pIIe@curveto@op
|
||||
}
|
||||
\newcommand*\pIIe@elliparc[7][0]{%
|
||||
\@ovro #4\relax
|
||||
\@ovri #5\relax
|
||||
\iffalse%dim\@ovro=\@ovri
|
||||
\pIIe@arc[#1]{#2}{#3}{#4}{#6}{#7}
|
||||
\else
|
||||
\ifdim \@ovro<\z@ \pIIe@badcircarg\else
|
||||
\ifdim \@ovri<\z@ \pIIe@badcircarg\else
|
||||
\@arclen #7\p@ \advance\@arclen -#6\p@
|
||||
\ifdim \@arclen<\z@ \def\@tempsign{-}\else\def\@tempsign{}\fi
|
||||
\ifdim \@tempsign\@arclen>720\p@
|
||||
\PackageWarning {ellipse}{The arc angle is reduced to -720..720}%
|
||||
\@whiledim \@tempsign\@arclen>720\p@ \do {\advance\@arclen-\@tempsign360\p@}%
|
||||
\@tempdima #6\p@ \advance\@tempdima \@arclen
|
||||
\edef\@angleend{\strip@pt\@tempdima}%
|
||||
\pIIe@@elliparc{#1}{#2}{#3}{#6}{\@angleend}%
|
||||
\else
|
||||
\pIIe@@elliparc{#1}{#2}{#3}{#6}{#7}%
|
||||
\fi
|
||||
\fi
|
||||
\fi
|
||||
\fi
|
||||
}
|
||||
\newcommand*\pIIe@@elliparc[5]{%
|
||||
\begingroup
|
||||
\ifdim \@tempsign\@arclen>90\p@
|
||||
\divide\@arclen 2%
|
||||
\@tempdima #4\p@\advance\@tempdima by \@arclen
|
||||
\edef\@anglemid{\strip@pt\@tempdima}%
|
||||
\def\@tempa{\pIIe@@elliparc{#1}{#2}{#3}{#4}}%
|
||||
\expandafter\@tempa\expandafter{\@anglemid}%
|
||||
\def\@tempa{\pIIe@@elliparc{2}{#2}{#3}}%
|
||||
\expandafter\@tempa\expandafter{\@anglemid}{#5}%
|
||||
\else
|
||||
\pIIe@elliparc@{#1}{#2}{#3}{#4}{#5}%
|
||||
\fi
|
||||
\endgroup
|
||||
}%
|
||||
|
||||
\newcommand*\pIIeelliparc[7][0]{%
|
||||
\@killglue
|
||||
\pIIe@elliparc[#1]{#2\unitlength}{#3\unitlength}{#4\unitlength}{#5\unitlength}{#6}{#7}%
|
||||
\ignorespaces%
|
||||
}
|
||||
\ifx\undefined\elliparc\else
|
||||
\PackageWarning{ellipse}{\protect\elliparc\space is redefined}%
|
||||
\fi
|
||||
\let\elliparc\pIIeelliparc
|
||||
|
||||
\newcommand*\pIIeearc
|
||||
{\@ifstar{\@tempswatrue\pIIe@earc@}{\@tempswafalse\pIIe@earc@}}
|
||||
\newcommand*\pIIe@earc@[3][0,360]{\pIIe@earc@@(#1){#2}{#3}}
|
||||
\def\pIIe@earc@@(#1,#2)#3#4{%
|
||||
\if@tempswa
|
||||
\pIIe@moveto\z@\z@
|
||||
\pIIe@elliparc{\z@}{\z@}{#3\unitlength}{#4\unitlength}{#1}{#2}%
|
||||
\pIIe@closepath\pIIe@fillGraph
|
||||
\else
|
||||
\pIIe@elliparc[1]{\z@}{\z@}{#3\unitlength}{#4\unitlength}{#1}{#2}%
|
||||
\pIIe@strokeGraph
|
||||
\fi}
|
||||
\ifx\undefined\earc\else
|
||||
\PackageWarning{ellipse}{\protect\earc\space is redefined}%
|
||||
\fi
|
||||
\let\earc\pIIeearc
|
||||
|
||||
\newcommand*\pIIeellipse
|
||||
{\@ifstar{\@tempswatrue\pIIe@earc@}{\@tempswafalse\pIIe@earc@}}
|
||||
\let\ellipse\pIIeellipse
|
||||
|
||||
\endinput
|
||||
%%
|
||||
%% End of file `ellipse.sty'.
|
||||
279
doc/utils/sphinx-config/latex/idxlayout.sty
Normal file
279
doc/utils/sphinx-config/latex/idxlayout.sty
Normal file
@ -0,0 +1,279 @@
|
||||
%%
|
||||
%% This is file `idxlayout.sty',
|
||||
%% generated with the docstrip utility.
|
||||
%%
|
||||
%% The original source files were:
|
||||
%%
|
||||
%% idxlayout.dtx (with options: `package')
|
||||
%%
|
||||
%% Copyright (C) 2010--2012 by Thomas Titz <thomas.titz@chello.at>
|
||||
%%
|
||||
%% Permission is granted to distribute and/or modify this work under the
|
||||
%% terms of the LaTeX Project Public License (LPPL), version 1.3c or
|
||||
%% later.
|
||||
%%
|
||||
%% The LPPL maintenance status of this work is "maintained".
|
||||
%%
|
||||
%% This work consists of the files idxlayout.dtx, idxlayout.ins and
|
||||
%% README and the derived files idxlayout.pdf and idxlayout.sty.
|
||||
%%
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{idxlayout}[2012/03/30 v0.4d Configurable index layout]
|
||||
\RequirePackage{etoolbox,kvoptions,multicol}
|
||||
\SetupKeyvalOptions{family=ila,prefix=ila@}
|
||||
\newcommand*{\ila@defradiokey}[3][]{%
|
||||
\define@key{ila}{#2}[#1]{%
|
||||
\ifcsname ila@#3@##1\endcsname
|
||||
\csname ila@#3@##1\expandafter\endcsname
|
||||
\else
|
||||
\PackageError{idxlayout}{Unknown value ##1 for option #2}%
|
||||
\fi
|
||||
}%
|
||||
}
|
||||
\newcounter{idxcols}
|
||||
\define@key{ila}{columns}{\setcounter{idxcols}{#1}}
|
||||
\setkeys{ila}{columns=2}
|
||||
\@ifclassloaded{memoir}{%
|
||||
\ifbool{onecolindex}{%
|
||||
\setkeys{ila}{columns=1}%
|
||||
}{%
|
||||
}%
|
||||
\appto{\onecolindex}{\setkeys{ila}{columns=1}}%
|
||||
\appto{\twocolindex}{\setkeys{ila}{columns=2}}%
|
||||
}{%
|
||||
\newlength{\indexcolsep}%
|
||||
\setlength{\indexcolsep}{35\p@}%
|
||||
\newlength{\indexrule}%
|
||||
\setlength{\indexrule}{\z@}%
|
||||
}
|
||||
\define@key{ila}{columnsep}{\setlength{\indexcolsep}{#1}}
|
||||
\define@key{ila}{rule}{\setlength{\indexrule}{#1}}
|
||||
\DeclareBoolOption{unbalanced}
|
||||
\newlength{\ila@indentunit}
|
||||
\define@key{ila}{indentunit}{\setlength{\ila@indentunit}{#1}}
|
||||
\setkeys{ila}{indentunit=20\p@}
|
||||
\DeclareStringOption{hangindent}
|
||||
\DeclareStringOption{subindent}
|
||||
\DeclareStringOption{subsubindent}
|
||||
\renewcommand{\@idxitem}{\par\setlength{\hangindent}{\ila@hangindent}}
|
||||
\def\ila@it@abshang{%
|
||||
\renewcommand*{\ila@hangindent}{2\ila@indentunit}%
|
||||
\renewcommand*{\ila@subindent}{\ila@indentunit}%
|
||||
\renewcommand*{\ila@subsubindent}{1.5\ila@indentunit}%
|
||||
\renewcommand{\subitem}{\@idxitem\hspace*{\ila@subindent}}%
|
||||
\renewcommand{\subsubitem}{\@idxitem\hspace*{\ila@subsubindent}}%
|
||||
}
|
||||
\def\ila@it@relhang{%
|
||||
\renewcommand*{\ila@hangindent}{1.5\ila@indentunit}%
|
||||
\renewcommand*{\ila@subindent}{\ila@indentunit}%
|
||||
\renewcommand*{\ila@subsubindent}{2\ila@indentunit}%
|
||||
\renewcommand{\subitem}{%
|
||||
\par
|
||||
\deflength{\hangindent}{\ila@hangindent + \ila@subindent}%
|
||||
\hspace*{\ila@subindent}%
|
||||
}%
|
||||
\renewcommand{\subsubitem}{%
|
||||
\par
|
||||
\deflength{\hangindent}{\ila@hangindent + \ila@subsubindent}%
|
||||
\hspace*{\ila@subsubindent}%
|
||||
}%
|
||||
}
|
||||
\newcommand*{\indexsubsdelim}{; }
|
||||
\def\ila@it@singlepar{%
|
||||
\renewcommand*{\ila@hangindent}{\ila@indentunit}%
|
||||
\renewcommand{\subitem}{\unskip\indexsubsdelim}%
|
||||
\renewcommand{\subsubitem}{\unskip\indexsubsdelim}%
|
||||
}
|
||||
\ila@defradiokey{itemlayout}{it}
|
||||
\setkeys{ila}{itemlayout=abshang}
|
||||
\newlength{\ila@initsep}
|
||||
\define@key{ila}{initsep}{\setlength{\ila@initsep}{#1}}
|
||||
\setkeys{ila}{initsep=10\p@ \@plus 5\p@ \@minus 3\p@}
|
||||
\DeclareStringOption[\ila@initsep]{notesep}
|
||||
\DeclareStringOption[80\p@]{minspace}
|
||||
\renewcommand{\indexspace}{\par\vspace{\ila@initsep}}
|
||||
\DeclareBoolOption{columnnote}
|
||||
\newcommand*{\indexfont}{}
|
||||
\def\ila@fo@current{\renewcommand*{\indexfont}{}}
|
||||
\def\ila@fo@normalsize{\renewcommand*{\indexfont}{\normalsize}}
|
||||
\def\ila@fo@small{\renewcommand*{\indexfont}{\small}}
|
||||
\def\ila@fo@footnotesize{\renewcommand*{\indexfont}{\footnotesize}}
|
||||
\ila@defradiokey{font}{fo}
|
||||
\setkeys{ila}{font=current}
|
||||
\newcommand*{\indexjustific}{}
|
||||
\def\ila@ju@standard{%
|
||||
\renewcommand*{\indexjustific}{%
|
||||
\setlength{\parindent}{\z@}%
|
||||
\setlength{\parfillskip}{\z@ \@plus 1fil}%
|
||||
}%
|
||||
}
|
||||
\def\ila@ju@raggedright{\renewcommand*{\indexjustific}{\raggedright}}
|
||||
\newcommand*{\ila@RaggedRight}{}
|
||||
\def\ila@ju@RaggedRight{%
|
||||
\renewcommand*{\indexjustific}{\ila@RaggedRight}%
|
||||
}
|
||||
\AtEndPreamble{%
|
||||
\IfFileExists{ragged2e.sty}{%
|
||||
\RequirePackage{ragged2e}%
|
||||
\renewcommand*{\ila@RaggedRight}{\RaggedRight}%
|
||||
}{%
|
||||
\PackageWarning{idxlayout}{%
|
||||
Package ragged2e not available, therefore\MessageBreak
|
||||
substituting command raggedright for RaggedRight\MessageBreak
|
||||
}%
|
||||
\renewcommand*{\ila@RaggedRight}{\raggedright}%
|
||||
}%
|
||||
}
|
||||
\ila@defradiokey{justific}{ju}
|
||||
\setkeys{ila}{justific=standard}
|
||||
\newcommand{\ila@prenote}{}
|
||||
\newcommand{\setindexprenote}[1]{%
|
||||
\def\ila@prenote{%
|
||||
\begingroup#1\par\nobreak\endgroup
|
||||
\vspace{\ila@notesep}%
|
||||
}%
|
||||
}
|
||||
\newcommand*{\noindexprenote}{\let\ila@prenote\relax}
|
||||
\noindexprenote
|
||||
\newcommand*{\indexstheadcase}{\MakeUppercase}
|
||||
\newcommand*{\ila@classtype}{0}
|
||||
\@ifclassloaded{memoir}{%
|
||||
\def\ila@classtype{2}%
|
||||
}{%
|
||||
\ifundef{\KOMAClassName}{%
|
||||
}{%
|
||||
\def\ila@classtype{1}%
|
||||
}%
|
||||
}
|
||||
\ifcase\ila@classtype\relax
|
||||
\DeclareBoolOption{totoc}%
|
||||
\def\ila@prologue{%
|
||||
\ifundef{\chapter}{%
|
||||
\section*{\indexname}%
|
||||
\ifbool{ila@totoc}{%
|
||||
\addcontentsline{toc}{section}{\indexname}%
|
||||
}{%
|
||||
}%
|
||||
}{%
|
||||
\chapter*{\indexname}%
|
||||
\ifbool{ila@totoc}{%
|
||||
\addcontentsline{toc}{chapter}{\indexname}%
|
||||
}{%
|
||||
}%
|
||||
}%
|
||||
\@mkboth{\indexstheadcase\indexname}{\indexstheadcase\indexname}%
|
||||
}
|
||||
\or
|
||||
\def\ila@tc@true{\KOMAoptions{index=totoc}}%
|
||||
\def\ila@tc@false{\KOMAoptions{index=nottotoc}}%
|
||||
\ila@defradiokey[true]{totoc}{tc}%
|
||||
\providecommand{\MakeMarkcase}[1]{#1}%
|
||||
\def\ila@prologue{%
|
||||
\ifundef{\chapter}{%
|
||||
}{%
|
||||
\ifundef{\index@preamble}{%
|
||||
}{%
|
||||
\setchapterpreamble{\index@preamble}%
|
||||
}%
|
||||
}%
|
||||
\idx@@heading{\indexname}%
|
||||
\@mkboth{\MakeMarkcase{\indexname}}{\MakeMarkcase{\indexname}}%
|
||||
\ifundef{\chapter}{%
|
||||
}{%
|
||||
\thispagestyle{\indexpagestyle}%
|
||||
}%
|
||||
}
|
||||
\or
|
||||
\def\ila@tc@true{\boolfalse{noindexintoc}}%
|
||||
\def\ila@tc@false{\booltrue{noindexintoc}}%
|
||||
\ila@defradiokey[true]{totoc}{tc}%
|
||||
\def\ila@prologue{%
|
||||
\chapter*{\indexname}%
|
||||
\ifbool{noindexintoc}{%
|
||||
}{%
|
||||
\addcontentsline{toc}{chapter}{\indexname}%
|
||||
}%
|
||||
\ifbool{artopt}{%
|
||||
}{%
|
||||
\thispagestyle{indextitlepagestyle}%
|
||||
}%
|
||||
\indexmark
|
||||
\preindexhook
|
||||
}
|
||||
\fi
|
||||
\@ifpackageloaded{index}{%
|
||||
\@ifpackagelater{index}{2004/01/21}{%
|
||||
\let\ila@packindadjust\relax
|
||||
}{%
|
||||
\def\ila@packindadjust{%
|
||||
\edef\indexname{\the\@nameuse{idxtitle@\@indextype}}%
|
||||
\ifdefempty{\index@prologue}{%
|
||||
}{%
|
||||
\setindexprenote{\index@prologue}%
|
||||
}%
|
||||
}%
|
||||
}%
|
||||
}{%
|
||||
\let\ila@packindadjust\relax
|
||||
}
|
||||
\ProcessKeyvalOptions*
|
||||
\newcommand*{\idxlayout}[1]{\setkeys{ila}{#1}}
|
||||
\renewenvironment{theindex}{%
|
||||
\ifbool{@twocolumn}{%
|
||||
\boolfalse{@restonecol}%
|
||||
\onecolumn
|
||||
}{%
|
||||
\booltrue{@restonecol}%
|
||||
}%
|
||||
\setlength{\multicolsep}{\z@}%
|
||||
\setlength{\columnsep}{\indexcolsep}%
|
||||
\setlength{\columnseprule}{\indexrule}%
|
||||
\ila@packindadjust
|
||||
\def\ila@prologueplus{%
|
||||
\ila@prologue
|
||||
\indexfont
|
||||
\ifbool{ila@columnnote}{%
|
||||
}{%
|
||||
\ila@prenote
|
||||
}%
|
||||
}%
|
||||
\ifnumcomp{\theidxcols}{<}{\tw@}{%
|
||||
\ila@prologueplus
|
||||
}{%
|
||||
\ifbool{ila@unbalanced}{%
|
||||
\begin{multicols*}{\theidxcols}[\ila@prologueplus][\ila@minspace]%
|
||||
}{%
|
||||
\begin{multicols}{\theidxcols}[\ila@prologueplus][\ila@minspace]%
|
||||
}%
|
||||
}%
|
||||
\setlength{\parskip}{\z@ \@plus 0.3\p@}%
|
||||
\indexjustific
|
||||
\ifundef{\chapter}{%
|
||||
\ifundef{\index@preamble}{%
|
||||
}{%
|
||||
\index@preamble\par\nobreak
|
||||
}%
|
||||
}{%
|
||||
}%
|
||||
\ifbool{ila@columnnote}{%
|
||||
\ila@prenote
|
||||
}{%
|
||||
}%
|
||||
\let\item\@idxitem
|
||||
}{%
|
||||
\ifnumcomp{\theidxcols}{<}{\tw@}{%
|
||||
}{%
|
||||
\ifbool{ila@unbalanced}{%
|
||||
\end{multicols*}%
|
||||
}{%
|
||||
\end{multicols}%
|
||||
}%
|
||||
}%
|
||||
\ifbool{@restonecol}{%
|
||||
}{%
|
||||
\twocolumn
|
||||
}%
|
||||
}
|
||||
\endinput
|
||||
%%
|
||||
%% End of file `idxlayout.sty'.
|
||||
41
doc/utils/sphinx-config/latex/p2e-pdftex.def
Normal file
41
doc/utils/sphinx-config/latex/p2e-pdftex.def
Normal file
@ -0,0 +1,41 @@
|
||||
%%
|
||||
%% This is file `p2e-pdftex.def',
|
||||
%% generated with the docstrip utility.
|
||||
%%
|
||||
%% The original source files were:
|
||||
%%
|
||||
%% p2e-drivers.dtx (with options: `pdftex')
|
||||
%%
|
||||
%% Copyright (C) 2003-2016
|
||||
%% Rolf Niepraschk, Rolf.Niepraschk@gmx.de
|
||||
%% Hubert Gaesslein,
|
||||
%% Josef Tkadlec, j.tkadlec@email.cz
|
||||
%%
|
||||
%% This work may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either version 1.3
|
||||
%% of this license or (at your option) any later version.
|
||||
%% The latest version of this license is in
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.3 or later is part of all distributions of LaTeX
|
||||
%% version 2003/12/01 or later.
|
||||
%%
|
||||
%% This work has the LPPL maintenance status "author-maintained".
|
||||
%%
|
||||
%% This work consists of all files listed in `manifest.txt'.
|
||||
%%
|
||||
\ProvidesFile{p2e-pdftex.def}
|
||||
[2016/02/05 v0.1u
|
||||
Driver-dependant file (RN,HjG,JT)]
|
||||
\begingroup
|
||||
\@ifundefined{pdfoutput}{}{%
|
||||
\ifnum\pdfoutput>0\relax
|
||||
\gdef\pIIe@mode{2}
|
||||
\fi
|
||||
}
|
||||
\endgroup
|
||||
\ifcase\pIIe@mode\relax \or\or
|
||||
\def\pIIe@code#1{\pdfliteral{ q #1 Q }}
|
||||
\fi
|
||||
\endinput
|
||||
%%
|
||||
%% End of file `p2e-pdftex.def'.
|
||||
820
doc/utils/sphinx-config/latex/pict2e.sty
Normal file
820
doc/utils/sphinx-config/latex/pict2e.sty
Normal file
@ -0,0 +1,820 @@
|
||||
%%
|
||||
%% This is file `pict2e.sty',
|
||||
%% generated with the docstrip utility.
|
||||
%%
|
||||
%% The original source files were:
|
||||
%%
|
||||
%% pict2e.dtx (with options: `package')
|
||||
%%
|
||||
%% Copyright (C) 2003-2016
|
||||
%% Rolf Niepraschk, Rolf.Niepraschk@gmx.de
|
||||
%% Hubert Gaesslein,
|
||||
%% Josef Tkadlec, j.tkadlec@email.cz
|
||||
%%
|
||||
%% This work may be distributed and/or modified under the
|
||||
%% conditions of the LaTeX Project Public License, either version 1.3
|
||||
%% of this license or (at your option) any later version.
|
||||
%% The latest version of this license is in
|
||||
%% http://www.latex-project.org/lppl.txt
|
||||
%% and version 1.3 or later is part of all distributions of LaTeX
|
||||
%% version 2003/12/01 or later.
|
||||
%%
|
||||
%% This work has the LPPL maintenance status "author-maintained".
|
||||
%%
|
||||
%% This work consists of all files listed in `manifest.txt'.
|
||||
%%
|
||||
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
|
||||
\ProvidesPackage{pict2e}[2020/09/30 v0.4b Improved picture commands (HjG,RN,JT)]
|
||||
\edef\Gin@codes{%
|
||||
\catcode`\noexpand\^^A\the\catcode`\^^A\relax
|
||||
\catcode`\noexpand\"\the\catcode`\"\relax
|
||||
\catcode`\noexpand\!\the\catcode`\!\relax
|
||||
\catcode`\noexpand\:\the\catcode`\:\relax}
|
||||
\catcode`\^^A=\catcode`\%
|
||||
\@makeother\"%
|
||||
\@makeother\!%
|
||||
\@makeother\:%
|
||||
\def\@defaultunitsset#1#2#3{%
|
||||
\@defaultunits#1\dimexpr#2#3\relax\relax\@nnil}
|
||||
\newcommand*\pIIe@mode{-1}
|
||||
\newcommand*\pIIe@code[1]{}
|
||||
\providecommand*\Gin@driver{}
|
||||
\newcommand*\pIIe@tempa{}
|
||||
\newcommand*\pIIe@tempb{}
|
||||
\newcommand*\pIIe@tempc{}
|
||||
\DeclareOption{dvips}{\def\Gin@driver{dvips.def}}
|
||||
\DeclareOption{xdvi}{\ExecuteOptions{dvips}}
|
||||
\DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
|
||||
\DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfm.def}}
|
||||
\DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
|
||||
\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
|
||||
\DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
|
||||
\DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
|
||||
\DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
|
||||
\DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
|
||||
\DeclareOption{oztex}{\ExecuteOptions{dvips}}
|
||||
\DeclareOption{textures}{\def\Gin@driver{textures.def}}
|
||||
\DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
|
||||
\DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
|
||||
\DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
|
||||
\DeclareOption{original}{\def\pIIe@mode{0}}
|
||||
\newif\ifpIIe@pdfliteral@ok
|
||||
\pIIe@pdfliteral@oktrue
|
||||
\ifx\pIIe@pdfliteral\@undefined
|
||||
\ifx\pdfliteral\@undefined
|
||||
\pIIe@pdfliteral@okfalse
|
||||
\def\pIIe@pdfliteral#1{%
|
||||
\PackageWarning{pict2e}{pdfliteral not supported}%
|
||||
}%
|
||||
\else
|
||||
\let\pIIe@pdfliteral\pdfliteral
|
||||
\fi
|
||||
\fi
|
||||
\def\pIIe@buttcap{%
|
||||
\ifpIIe@pdfliteral@ok
|
||||
\buttcap
|
||||
\fi
|
||||
}
|
||||
\newcommand*\pIIe@FAL{1.52}%
|
||||
\newcommand*\pIIe@FAW{3.2}%
|
||||
\newcommand*\pIIe@CAW{1.5pt}%
|
||||
\newcommand*\pIIe@FAI{0.25}%
|
||||
\newcommand*\ltxarrows{%
|
||||
\let\pIIe@vector=\pIIe@vector@ltx
|
||||
}
|
||||
\newcommand*\pstarrows{%
|
||||
\let\pIIe@vector=\pIIe@vector@pst
|
||||
}
|
||||
\DeclareOption{ltxarrows}{\AtEndOfPackage{\ltxarrows}}
|
||||
\DeclareOption{pstarrows}{\AtEndOfPackage{\pstarrows}}
|
||||
\newcommand*\pIIe@debug@comment{}
|
||||
\DeclareOption{debug}{%
|
||||
\def\pIIe@debug@comment{^^J^^J\@percentchar\space >>> pict2e <<<^^J}%
|
||||
\begingroup
|
||||
\@ifundefined{pdfcompresslevel}{}{\global\pdfcompresslevel\z@}%
|
||||
\endgroup}
|
||||
\DeclareOption{hide}{\AtEndOfPackage{%
|
||||
\let\pIIe@code\@gobble
|
||||
}}
|
||||
\DeclareOption*{\ExecuteOptions{original}}
|
||||
\ExecuteOptions{ltxarrows}
|
||||
\InputIfFileExists{pict2e.cfg}{}{}
|
||||
\ProcessOptions\relax
|
||||
\ifnum\pIIe@mode=\z@
|
||||
\PackageInfo{pict2e}{Package option `original' requested}
|
||||
\else
|
||||
\if!\Gin@driver!
|
||||
\PackageError{pict2e}
|
||||
{No driver specified at all}
|
||||
{You should make a default driver option in a file\MessageBreak
|
||||
pict2e.cfg\MessageBreak eg: \protect\ExecuteOptions{dvips}}%
|
||||
\else
|
||||
\PackageInfo{pict2e}{Driver file: \Gin@driver}
|
||||
\@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
|
||||
\PackageInfo{pict2e}{Driver file for pict2e: p2e-\Gin@driver}
|
||||
\InputIfFileExists{p2e-\Gin@driver}{}{%
|
||||
\PackageError{pict2e}%
|
||||
{Driver file ``p2e-\Gin@driver'' not found}%
|
||||
{Q: Is the file properly installed? A: No!}}
|
||||
\fi
|
||||
\fi
|
||||
\ifnum\pIIe@mode>\z@
|
||||
\ifnum\pIIe@mode<\thr@@
|
||||
\RequirePackage{trig}
|
||||
\let\pIIe@oldline\line
|
||||
\let\pIIe@old@sline\@sline
|
||||
\let\pIIe@oldvector\vector
|
||||
\let\pIIe@old@circle\@circle
|
||||
\let\pIIe@old@dot\@dot
|
||||
\let\pIIe@old@bezier\@bezier
|
||||
\AtBeginDocument{%
|
||||
\@ifundefined{@cbezier}{%
|
||||
\def\pIIe@old@cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){}%
|
||||
}{\let\pIIe@old@cbezier\@cbezier}}
|
||||
\let\pIIe@oldoval\oval
|
||||
\let\pIIe@old@oval\@oval
|
||||
\newcommand*\OriginalPictureCmds{%
|
||||
\let\@sline\pIIe@old@sline
|
||||
\let\line\pIIe@oldline
|
||||
\let\vector\pIIe@oldvector
|
||||
\let\@circle\pIIe@old@circle
|
||||
\let\@dot\pIIe@old@dot
|
||||
\let\@bezier\pIIe@old@bezier
|
||||
\let\@cbezier\pIIe@old@cbezier
|
||||
\renewcommand*\oval[1][]{\pIIe@oldoval}%
|
||||
\let\@oval\pIIe@old@oval
|
||||
}
|
||||
\else
|
||||
\PackageError{pict2e}
|
||||
{Unsupported mode (\pIIe@mode) specified}
|
||||
{The driver you specified requested a mode\MessageBreak
|
||||
not supported by this version of this package}
|
||||
\fi
|
||||
\else
|
||||
\ifnum\pIIe@mode<\z@
|
||||
\PackageError{pict2e}
|
||||
{No suitable driver specified}
|
||||
{You should make a default driver option in a file\MessageBreak
|
||||
pict2e.cfg\MessageBreak eg: \protect\ExecuteOptions{dvips}}
|
||||
\fi
|
||||
\fi
|
||||
\ifnum\pIIe@mode>\z@
|
||||
\ifcase\pIIe@mode\relax
|
||||
\or
|
||||
\newcommand*\pIIe@moveto@op{moveto}
|
||||
\newcommand*\pIIe@lineto@op{lineto}
|
||||
\newcommand*\pIIe@setlinewidth@op{setlinewidth}
|
||||
\newcommand*\pIIe@stroke@op{stroke}
|
||||
\newcommand*\pIIe@fill@op{fill}
|
||||
\newcommand*\pIIe@curveto@op{curveto}
|
||||
\newcommand*\pIIe@concat@op{concat}
|
||||
\newcommand*\pIIe@closepath@op{closepath}
|
||||
\or
|
||||
\newcommand*\pIIe@moveto@op{m}
|
||||
\newcommand*\pIIe@lineto@op{l}
|
||||
\newcommand*\pIIe@setlinewidth@op{w}
|
||||
\newcommand*\pIIe@stroke@op{S}
|
||||
\newcommand*\pIIe@fill@op{f}
|
||||
\newcommand*\pIIe@curveto@op{c}
|
||||
\newcommand*\pIIe@concat@op{cm}
|
||||
\newcommand*\pIIe@closepath@op{h}
|
||||
\fi
|
||||
\@ifdefinable\pIIe@GRAPH{\newtoks\pIIe@GRAPH}
|
||||
\newcommand*\pIIe@addtoGraph[1]{%
|
||||
\begingroup
|
||||
\edef\x{\the\pIIe@GRAPH\space#1}%
|
||||
\global\pIIe@GRAPH\expandafter{\x}%
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@fillGraph{\begingroup \@tempswatrue\pIIe@drawGraph}
|
||||
\newcommand*\pIIe@strokeGraph{\begingroup \@tempswafalse\pIIe@drawGraph}
|
||||
\newcommand*\pIIe@drawGraph{%
|
||||
\edef\x{\pIIe@debug@comment\space
|
||||
\pIIe@scale@PTtoBP}%
|
||||
\if@tempswa
|
||||
\edef\y{\pIIe@fill@op}%
|
||||
\else
|
||||
\edef\x{\x\space
|
||||
\strip@pt\@wholewidth\space\pIIe@setlinewidth@op
|
||||
\pIIe@linecap\pIIe@linejoin\space}%
|
||||
\edef\y{\pIIe@stroke@op}%
|
||||
\fi
|
||||
\expandafter\pIIe@code\expandafter{%
|
||||
\expandafter\x\the\pIIe@GRAPH\space\y}%
|
||||
\global\pIIe@GRAPH{}\xdef\pIIe@CPx{}\xdef\pIIe@CPy{}%
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@CPx{} \newcommand*\pIIe@CPy{}
|
||||
\newcommand*\pIIe@add@CP[2]{%
|
||||
\begingroup
|
||||
\@tempdima#1\xdef\pIIe@CPx{\the\@tempdima}%
|
||||
\@tempdimb#2\xdef\pIIe@CPy{\the\@tempdimb}%
|
||||
\pIIe@addtoGraph{\strip@pt\@tempdima\space\strip@pt\@tempdimb}%
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@add@nums[2]{%
|
||||
\begingroup
|
||||
\@tempdima#1\relax
|
||||
\@tempdimb#2\relax
|
||||
\pIIe@addtoGraph{\strip@pt\@tempdima\space\strip@pt\@tempdimb}%
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@add@num[1]{%
|
||||
\begingroup
|
||||
\@tempdima#1\relax
|
||||
\pIIe@addtoGraph{\strip@pt\@tempdima}%
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@PTtoBP{0.99626401 }
|
||||
\ifcase\pIIe@mode\relax
|
||||
\or
|
||||
\newcommand*\pIIe@concat[6]{%
|
||||
\begingroup
|
||||
\pIIe@addtoGraph{[}%
|
||||
\@tempdima#1\relax \@tempdimb#2\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#3\relax \@tempdimb#4\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#5\relax \@tempdimb#6\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\pIIe@addtoGraph{] \pIIe@concat@op}%
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@translate[2]{\pIIe@add@nums{#1}{#2}\pIIe@addtoGraph{translate}}
|
||||
\newcommand*\pIIe@rotate[1]{\pIIe@add@num{#1}\pIIe@addtoGraph{rotate}}
|
||||
\newcommand*\pIIe@scale[2]{\pIIe@add@nums{#1}{#2}\pIIe@addtoGraph{scale}}
|
||||
\newcommand*\pIIe@scale@PTtoBP{\pIIe@PTtoBP \pIIe@PTtoBP scale}
|
||||
\or
|
||||
\newcommand*\pIIe@concat[6]{%
|
||||
\begingroup
|
||||
\@tempdima#1\relax \@tempdimb#2\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#3\relax \@tempdimb#4\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#5\relax \@tempdimb#6\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\pIIe@addtoGraph\pIIe@concat@op
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@translate[2]{\pIIe@concat\p@\z@\z@\p@{#1}{#2}}
|
||||
\newcommand*\pIIe@rotate[1]{%
|
||||
\begingroup
|
||||
\@tempdima#1\relax
|
||||
\edef\pIIe@tempa{\strip@pt\@tempdima}%
|
||||
\CalculateSin\pIIe@tempa
|
||||
\CalculateCos\pIIe@tempa
|
||||
\edef\pIIe@tempb{\UseSin\pIIe@tempa}%
|
||||
\edef\pIIe@tempc{\UseCos\pIIe@tempa}%
|
||||
\pIIe@concat{\pIIe@tempc\p@}{\pIIe@tempb\p@}%
|
||||
{-\pIIe@tempb\p@}{\pIIe@tempc\p@}\z@\z@
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@scale[2]{\pIIe@concat{#1}\z@\z@{#2}\z@\z@}
|
||||
\newcommand*\pIIe@scale@PTtoBP{\pIIe@PTtoBP 0 0 \pIIe@PTtoBP 0 0 \pIIe@concat@op}
|
||||
\fi
|
||||
\newcommand*\pIIe@moveto[2]{%
|
||||
\pIIe@add@CP{#1}{#2}\pIIe@addtoGraph\pIIe@moveto@op}
|
||||
\newcommand*\pIIe@lineto[2]{%
|
||||
\pIIe@add@CP{#1}{#2}\pIIe@addtoGraph\pIIe@lineto@op}
|
||||
\ifcase\pIIe@mode\relax
|
||||
\or
|
||||
\newcommand*\pIIe@rcurveto[6]{%
|
||||
\begingroup
|
||||
\@tempdima#1\relax \@tempdimb#2\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#3\relax \@tempdimb#4\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#5\relax \@tempdimb#6\relax
|
||||
\pIIe@add@CP\@tempdima\@tempdimb
|
||||
\pIIe@addtoGraph{rcurveto}%
|
||||
\endgroup}
|
||||
\or
|
||||
\newcommand*\pIIe@rcurveto[6]{%
|
||||
\begingroup
|
||||
\@tempdima#1\advance\@tempdima\pIIe@CPx\relax
|
||||
\@tempdimb#2\advance\@tempdimb\pIIe@CPy\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#3\advance\@tempdima\pIIe@CPx\relax
|
||||
\@tempdimb#4\advance\@tempdimb\pIIe@CPy\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#5\advance\@tempdima\pIIe@CPx\relax
|
||||
\@tempdimb#6\advance\@tempdimb\pIIe@CPy\relax
|
||||
\pIIe@add@CP\@tempdima\@tempdimb
|
||||
\pIIe@addtoGraph\pIIe@curveto@op
|
||||
\endgroup}
|
||||
\fi
|
||||
\newcommand*\pIIe@curveto[6]{%
|
||||
\begingroup
|
||||
\@tempdima#1\relax \@tempdimb#2\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#3\relax \@tempdimb#4\relax
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\@tempdima#5\relax \@tempdimb#6\relax
|
||||
\pIIe@add@CP\@tempdima\@tempdimb
|
||||
\pIIe@addtoGraph\pIIe@curveto@op
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@closepath{\pIIe@addtoGraph\pIIe@closepath@op}
|
||||
\newcommand*\pIIe@pyth[3]{%
|
||||
\begingroup
|
||||
\@tempdima=#1\relax
|
||||
\ifnum\@tempdima<\z@\@tempdima=-\@tempdima\fi
|
||||
\@tempdimb=#2\relax
|
||||
\ifnum\@tempdimb<\z@\@tempdimb=-\@tempdimb\fi
|
||||
\advance\@tempdimb\@tempdima
|
||||
\ifnum\@tempdimb=\z@
|
||||
\@tempdimc=\z@
|
||||
\else
|
||||
\multiply\@tempdima 8\relax
|
||||
\pIIe@divide\@tempdima\@tempdimb\@tempdimc
|
||||
\advance\@tempdimc -4pt
|
||||
\multiply\@tempdimc 2
|
||||
\edef\pIIe@tempa{\strip@pt\@tempdimc}%
|
||||
\@tempdima=\pIIe@tempa\@tempdimc
|
||||
\advance\@tempdima 64pt
|
||||
\divide\@tempdima 2\relax
|
||||
\@dashdim=7pt
|
||||
\pIIe@@pyth\pIIe@@pyth\pIIe@@pyth
|
||||
\edef\pIIe@tempa{\strip@pt\@dashdim}%
|
||||
\@tempdimc=\pIIe@tempa\@tempdimb
|
||||
\global\divide\@tempdimc 8
|
||||
\fi
|
||||
\edef\x{\endgroup#3=\the\@tempdimc}%
|
||||
\x}
|
||||
\newcommand*\pIIe@@pyth{%
|
||||
\pIIe@divide\@tempdima\@dashdim\@tempdimc
|
||||
\advance\@dashdim\@tempdimc
|
||||
\divide\@dashdim\tw@}
|
||||
\newcommand*\pIIe@divide[3]{%
|
||||
\begingroup
|
||||
\dimendef\Numer=254\relax \dimendef\Denom=252\relax
|
||||
\countdef\Num=254\relax \countdef\Den=252\relax
|
||||
\countdef\I=250\relax \countdef\Numb=248\relax
|
||||
\Numer #1\relax \Denom #2\relax
|
||||
\ifdim\Denom<\z@ \Denom -\Denom \Numer=-\Numer \fi
|
||||
\ifdim\Numer<\z@ \def\sign{-}\Numer=-\Numer \else \def\sign{}\fi
|
||||
\ifdim\Denom=\z@
|
||||
\edef\Q{\strip@pt\maxdimen}%
|
||||
\PackageWarning{pict2e}%
|
||||
{Division by 0, \sign\strip@pt\maxdimen\space used}{}%
|
||||
\else
|
||||
\Num=\Numer \Den=\Denom
|
||||
\Numb=\Num \divide\Numb\Den
|
||||
\ifnum\Numb>16383
|
||||
\edef\Q{\strip@pt\maxdimen}%
|
||||
\PackageWarning{pict2e}%
|
||||
{Division overflow, \sign\strip@pt\maxdimen\space used}{}%
|
||||
\else
|
||||
\edef\Q{\number\Numb.}%
|
||||
\multiply \Numb\Den \advance\Num -\Numb
|
||||
\I=6\relax
|
||||
\@whilenum \I>\z@ \do{\pIIe@@divide\advance\I\m@ne}%
|
||||
\fi
|
||||
\fi
|
||||
\edef\tempend{\noexpand\endgroup\noexpand#3=\sign\Q\p@}%
|
||||
\tempend}
|
||||
\def\pIIe@@divide{%
|
||||
\@whilenum \Num>214748364 \do{\divide\Num\tw@ \divide\Den\tw@}%
|
||||
\multiply \Num 10
|
||||
\Numb=\Num \divide\Numb\Den
|
||||
\edef\Q{\Q\number\Numb}%
|
||||
\multiply \Numb\Den \advance \Num -\Numb
|
||||
\ifnum\Num>\z@\else\I=0\fi}
|
||||
\newcommand*\pIIe@checkslopeargsline[2]{%
|
||||
\pIIe@checkslopeargs{#1}{#2}{16383}}
|
||||
\newcommand*\pIIe@checkslopeargsvector[2]{%
|
||||
\pIIe@checkslopeargs{#1}{#2}{1000}}
|
||||
\newcommand*\pIIe@checkslopeargs[3]{%
|
||||
\edef\@tempa{#1}\expandafter\pIIe@checkslopearg\@tempa.:{#3}%
|
||||
\edef\@tempa{#2}\expandafter\pIIe@checkslopearg\@tempa.:{#3}%
|
||||
\ifdim #1\p@=\z@ \ifdim #2\p@=\z@ \@badlinearg \fi\fi}
|
||||
\def\pIIe@checkslopearg #1.#2:#3{%
|
||||
\def\@tempa{#1}%
|
||||
\ifx\@tempa\empty\def\@tempa{0}\fi
|
||||
\ifx\@tempa\space\def\@tempa{0}\fi
|
||||
\ifnum\ifnum\@tempa<\z@-\fi\@tempa>#3 \@badlinearg \fi}
|
||||
\def\@badlinearg{\PackageError
|
||||
{pict2e}{Bad \protect\line\space or \protect\vector\space argument}{}}
|
||||
\def\line(#1,#2)#3{%
|
||||
\begingroup
|
||||
\pIIe@checkslopeargsline{#1}{#2}%
|
||||
\@tempdima=#1pt\relax \@tempdimb=#2pt\relax
|
||||
\@defaultunitsset\@linelen{#3}\unitlength
|
||||
\ifdim\@linelen<\z@ \@badlinearg \else
|
||||
\pIIe@sline
|
||||
\pIIe@moveto\z@\z@
|
||||
\pIIe@lineto\@xdim\@ydim
|
||||
\pIIe@strokeGraph
|
||||
\box\@tempboxa
|
||||
\fi
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@sline{%
|
||||
\ifdim\@tempdima=\z@
|
||||
\ifdim\@tempdimb<\z@\@linelen-\@linelen\fi
|
||||
\@ydim=\@linelen
|
||||
\@xdim=\z@
|
||||
\else
|
||||
\ifdim\@tempdima<\z@\@linelen-\@linelen\fi
|
||||
\ifdim\@tempdimb=\z@
|
||||
\@xdim=\@linelen
|
||||
\@ydim=\z@
|
||||
\else
|
||||
\pIIe@divide\@tempdimb\@tempdima\dimen@
|
||||
\@ydim=\strip@pt\dimen@\@linelen
|
||||
\@xdim=\@linelen
|
||||
\fi
|
||||
\fi
|
||||
\@ovxx=\ifnum\@xdim=\z@ \z@\else\@linelen\fi
|
||||
\@ovyy=\ifnum\@ydim<\z@ \z@\else\@ydim\fi
|
||||
\@ovdy=\ifnum\@ydim<\z@ -\@ydim\else\z@\fi
|
||||
\setbox\@tempboxa\hbox{%
|
||||
\vrule\@height \@ovyy \@depth \@ovdy \@width \z@
|
||||
\vrule\@height \z@ \@depth \z@ \@width \@ovxx}}
|
||||
\def\vector(#1,#2)#3{%
|
||||
\begingroup
|
||||
\pIIe@checkslopeargsvector{#1}{#2}%
|
||||
\@tempdima=#1pt\relax \@tempdimb=#2pt\relax
|
||||
\@defaultunitsset\@linelen{#3}\unitlength
|
||||
\ifdim\@linelen<\z@ \@badlinearg \else
|
||||
\pIIe@sline
|
||||
\@defaultunitsset\@linelen{#3}\unitlength
|
||||
\pIIe@pyth{\@tempdima}{\@tempdimb}\dimen@
|
||||
\ifdim\@tempdima=\z@ \else
|
||||
\ifdim\@tempdimb=\z@ \else
|
||||
\pIIe@divide\dimen@{\@tempdima}\@xdim
|
||||
\@linelen\strip@pt\@xdim\@linelen
|
||||
\ifdim\@linelen<\z@\@linelen-\@linelen\fi
|
||||
\fi
|
||||
\fi
|
||||
\pIIe@divide{\@tempdimb}\dimen@\@ydim
|
||||
\pIIe@divide{\@tempdima}\dimen@\@xdim
|
||||
\pIIe@concat\@xdim\@ydim{-\@ydim}\@xdim\z@\z@
|
||||
\pIIe@vector
|
||||
\pIIe@fillGraph
|
||||
\box\@tempboxa
|
||||
\fi
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@vector{}
|
||||
\newcommand*\pIIe@vector@ltx{%
|
||||
\@ydim\pIIe@FAW\@wholewidth \advance\@ydim\pIIe@CAW\relax
|
||||
\@ovxx\pIIe@FAL\@ydim
|
||||
\@xdim\@linelen \advance\@xdim-\@ovxx
|
||||
\divide\@ydim\tw@
|
||||
\divide\@ovxx\tw@ \advance\@ovxx\@xdim
|
||||
\@ovyy\@ydim
|
||||
\divide\@ovyy\tw@ \advance\@ovyy-\pIIe@FAI\@ydim
|
||||
\pIIe@bezier@QtoC\@linelen\@ovxx\@ovro
|
||||
\pIIe@bezier@QtoC\z@\@ovyy\@ovri
|
||||
\pIIe@bezier@QtoC\@xdim\@ovxx\@clnwd
|
||||
\pIIe@bezier@QtoC\@ydim\@ovyy\@clnht
|
||||
\pIIe@moveto\@linelen\z@
|
||||
\pIIe@curveto\@ovro{-\@ovri}\@clnwd{-\@clnht}\@xdim{-\@ydim}%
|
||||
\ifdim\@xdim>\z@
|
||||
\pIIe@lineto\@xdim{-\@halfwidth}%
|
||||
\pIIe@lineto\z@{-\@halfwidth}%
|
||||
\pIIe@lineto\z@{\@halfwidth}%
|
||||
\pIIe@lineto\@xdim{\@halfwidth}%
|
||||
\fi
|
||||
\pIIe@lineto\@xdim\@ydim
|
||||
\pIIe@curveto\@clnwd\@clnht\@ovro\@ovri\@linelen\z@}
|
||||
\newcommand*\pIIe@vector@pst{%
|
||||
\@ydim\pIIe@FAW\@wholewidth \advance\@ydim\pIIe@CAW\relax
|
||||
\@ovxx\pIIe@FAL\@ydim
|
||||
\@xdim\@linelen \advance\@xdim-\@ovxx
|
||||
\divide\@ydim\tw@
|
||||
\@ovyy\@ydim \advance\@ovyy-\@halfwidth
|
||||
\@ovdx\pIIe@FAI\@ovxx
|
||||
\pIIe@divide\@ovdx\@ydim\@tempdimc
|
||||
\@ovxx\strip@pt\@ovyy\@tempdimc
|
||||
\advance\@ovxx\@xdim
|
||||
\advance\@ovdx\@xdim
|
||||
\pIIe@moveto\@linelen\z@
|
||||
\pIIe@lineto\@xdim{-\@ydim}%
|
||||
\ifdim\@xdim>\z@
|
||||
\pIIe@lineto\@ovxx{-\@halfwidth}%
|
||||
\pIIe@lineto\z@{-\@halfwidth}%
|
||||
\pIIe@lineto\z@{\@halfwidth}%
|
||||
\pIIe@lineto\@ovxx{\@halfwidth}%
|
||||
\else
|
||||
\pIIe@lineto\@ovdx\z@
|
||||
\fi
|
||||
\pIIe@lineto\@xdim\@ydim
|
||||
\pIIe@lineto\@linelen\z@}
|
||||
\def\@circle#1{\begingroup \@tempswafalse\pIIe@circ{#1}}
|
||||
\def\@dot#1{\begingroup \@tempswatrue\pIIe@circ{#1}}
|
||||
\newcommand*\pIIe@circ[1]{%
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\ifdim\pIIe@tempdima<\z@ \pIIe@badcircarg \fi
|
||||
\divide\pIIe@tempdima\tw@
|
||||
\pIIe@circle\pIIe@tempdima
|
||||
\if@tempswa \pIIe@fillGraph \else \buttcap \pIIe@strokeGraph \fi
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@circle[1]{%
|
||||
\pIIe@qcircle[1]\z@{#1}\pIIe@qcircle \@ne{#1}%
|
||||
\pIIe@qcircle \tw@{#1}\pIIe@qcircle\thr@@{#1}\pIIe@closepath}
|
||||
\newcommand*\pIIe@qcircle[3][0]{%
|
||||
\begingroup
|
||||
\@ovro#3\relax \@ovri0.55228474983\@ovro
|
||||
\@tempdimc\@ovri \advance\@tempdimc-\@ovro
|
||||
\ifnum#1>\z@ \@tempswatrue \else \@tempswafalse \fi
|
||||
\ifcase#2\relax
|
||||
\pIIe@@qcircle\@ovro\z@\z@\@ovri\@tempdimc\@ovro{-\@ovro}\@ovro
|
||||
\or
|
||||
\pIIe@@qcircle\z@\@ovro{-\@ovri}\z@{-\@ovro}\@tempdimc{-\@ovro}{-\@ovro}%
|
||||
\or
|
||||
\pIIe@@qcircle{-\@ovro}\z@\z@{-\@ovri}{-\@tempdimc}{-\@ovro}\@ovro{-\@ovro}%
|
||||
\or
|
||||
\pIIe@@qcircle\z@{-\@ovro}\@ovri\z@\@ovro{-\@tempdimc}\@ovro\@ovro
|
||||
\fi
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@@qcircle[8]{%
|
||||
\if@tempswa\pIIe@moveto{#1}{#2}\fi \pIIe@rcurveto{#3}{#4}{#5}{#6}{#7}{#8}}
|
||||
\newcommand*\pIIe@badcircarg{%
|
||||
\PackageError{pict2e}%
|
||||
{Illegal argument in \protect\circle(*), \protect\oval, \protect\arc(*) or
|
||||
\protect\circlearc.}%
|
||||
{The radius of a circle, dot, arc or oval corner must be greater than zero.}}%
|
||||
\newcommand*\maxovalrad{20pt}
|
||||
\newcommand*\pIIe@defaultUL[2]{%
|
||||
\@defaultunitsset\pIIe@tempdima{#2}\unitlength
|
||||
\edef#1{\the\pIIe@tempdima}}
|
||||
\newcommand*\pIIe@def@UL{}
|
||||
\def\pIIe@def@UL#1\relax#2#3{%
|
||||
\edef#2{\the\dimen@}}
|
||||
\newcommand*\pIIe@maxovalrad{}
|
||||
\newcommand*\pIIe@oval{}
|
||||
\def\pIIe@oval#1(#2,#3){\@ifnextchar[{\@oval(#2,#3)}{\@oval(#2,#3)[]}}
|
||||
\renewcommand*\oval[1][\maxovalrad]{%
|
||||
\begingroup \pIIe@defaultUL\pIIe@maxovalrad{#1}%
|
||||
\ifdim\pIIe@maxovalrad<\z@ \pIIe@badcircarg \fi
|
||||
\pIIe@oval}
|
||||
\def\@oval(#1,#2)[#3]{%
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength \divide\pIIe@tempdima\tw@
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength \divide\pIIe@tempdimb\tw@
|
||||
\pIIe@tempdimc \ifdim\pIIe@tempdimb>\pIIe@tempdima \pIIe@tempdima \else \pIIe@tempdimb \fi
|
||||
\ifdim\pIIe@maxovalrad<\pIIe@tempdimc \pIIe@tempdimc\pIIe@maxovalrad\relax \fi
|
||||
\pIIe@tempdimd\pIIe@tempdima \advance\pIIe@tempdimd-\pIIe@tempdimc
|
||||
\pIIe@tempdime\pIIe@tempdimb \advance\pIIe@tempdime-\pIIe@tempdimc
|
||||
\pIIe@get@quadrants{#3}%
|
||||
\ifnum15=\@tempcnta \pIIe@buttcap \fi
|
||||
\@tempswatrue
|
||||
\ifnum9=\@tempcnta
|
||||
\pIIe@qoval\z@{-\pIIe@tempdimb}{\pIIe@tempdimd}{-\pIIe@tempdimb}%
|
||||
\thr@@\pIIe@tempdimc\pIIe@tempdima\z@
|
||||
\@tempcnta\@ne
|
||||
\fi
|
||||
\pIIe@qoval\pIIe@tempdima\z@\pIIe@tempdima\pIIe@tempdime%
|
||||
\z@\pIIe@tempdimc\z@\pIIe@tempdimb
|
||||
\pIIe@qoval\z@\pIIe@tempdimb{-\pIIe@tempdimd}\pIIe@tempdimb%
|
||||
\@ne\pIIe@tempdimc{-\pIIe@tempdima}\z@
|
||||
\pIIe@qoval{-\pIIe@tempdima}\z@{-\pIIe@tempdima}{-\pIIe@tempdime}%
|
||||
\tw@\pIIe@tempdimc\z@{-\pIIe@tempdimb}%
|
||||
\pIIe@qoval\z@{-\pIIe@tempdimb}{\pIIe@tempdimd}{-\pIIe@tempdimb}%
|
||||
\thr@@\pIIe@tempdimc\pIIe@tempdima\z@
|
||||
\pIIe@strokeGraph
|
||||
\endgroup}
|
||||
\newcommand*\pIIe@qoval[8]{%
|
||||
\ifodd\@tempcnta
|
||||
\if@tempswa\pIIe@moveto{#1}{#2}\fi
|
||||
\pIIe@lineto{#3}{#4}\pIIe@qcircle{#5}{#6}\pIIe@lineto{#7}{#8}%
|
||||
\@tempswafalse
|
||||
\else
|
||||
\@tempswatrue
|
||||
\fi
|
||||
\divide\@tempcnta\tw@}
|
||||
\newcommand*\pIIe@get@quadrants[1]{%
|
||||
\@ovttrue \@ovbtrue \@ovltrue \@ovrtrue \@tempcnta\z@
|
||||
\@tfor\reserved@a:=#1\do{\csname @ov\reserved@a false\endcsname}%
|
||||
\if@ovr \if@ovb\@setfpsbit2\fi \if@ovt\@setfpsbit4\fi \fi
|
||||
\if@ovl \if@ovb\@setfpsbit1\fi \if@ovt\@setfpsbit8\fi \fi}
|
||||
\def\@bezier#1(#2,#3)(#4,#5)(#6,#7){%
|
||||
\ifnum #1=\z@
|
||||
\@killglue
|
||||
\begingroup
|
||||
\@defaultunitsset\pIIe@tempdima{#2}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#3}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimc{#4}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimd{#5}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdime{#6}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimf{#7}\unitlength
|
||||
\pIIe@bezier@QtoC\pIIe@tempdima\pIIe@tempdimc\@ovro
|
||||
\pIIe@bezier@QtoC\pIIe@tempdimb\pIIe@tempdimd\@ovri
|
||||
\pIIe@bezier@QtoC\pIIe@tempdime\pIIe@tempdimc\@clnwd
|
||||
\pIIe@bezier@QtoC\pIIe@tempdimf\pIIe@tempdimd\@clnht
|
||||
\pIIe@moveto\pIIe@tempdima\pIIe@tempdimb
|
||||
\pIIe@curveto\@ovro\@ovri\@clnwd\@clnht\pIIe@tempdime\pIIe@tempdimf
|
||||
\pIIe@strokeGraph
|
||||
\endgroup
|
||||
\ignorespaces
|
||||
\else
|
||||
\pIIe@old@bezier{#1}(#2,#3)(#4,#5)(#6,#7)
|
||||
\fi}
|
||||
\newcommand*\pIIe@bezier@QtoC[3]{%
|
||||
\@tempdimc#1\relax \advance\@tempdimc-#2\relax
|
||||
\divide\@tempdimc\thr@@ \advance\@tempdimc #2\relax
|
||||
#3\@tempdimc}
|
||||
\ifx\undefined\@arclen \newdimen\@arclen \fi
|
||||
\ifx\undefined\@arcrad \newdimen\@arcrad \fi
|
||||
\ifx\undefined\pIIe@tempdima \newdimen\pIIe@tempdima \fi
|
||||
\ifx\undefined\pIIe@tempdimb \newdimen\pIIe@tempdimb \fi
|
||||
\ifx\undefined\pIIe@tempdimc \newdimen\pIIe@tempdimc \fi
|
||||
\ifx\undefined\pIIe@tempdimd \newdimen\pIIe@tempdimd \fi
|
||||
\ifx\undefined\pIIe@tempdime \newdimen\pIIe@tempdime \fi
|
||||
\ifx\undefined\pIIe@tempdimf \newdimen\pIIe@tempdimf \fi
|
||||
\newcommand*\pIIe@arc[6][0]{%
|
||||
\@arcrad #4\relax
|
||||
\ifdim \@arcrad<\z@ \pIIe@badcircarg \else
|
||||
\@arclen #6\p@ \advance\@arclen -#5\p@
|
||||
\ifdim \@arclen<\z@ \def\sign{-}\else\def\sign{}\fi
|
||||
\ifdim \sign\@arclen>720\p@
|
||||
\PackageWarning {pict2e}{The arc angle is reduced to -720..720}%
|
||||
\@whiledim \sign\@arclen>720\p@ \do {\advance\@arclen-\sign360\p@}%
|
||||
\@tempdima #5\p@ \advance\@tempdima \@arclen
|
||||
\edef\@angleend{\strip@pt\@tempdima}%
|
||||
\pIIe@@arc{#1}{#2}{#3}{#4}{#5}{\@angleend}%
|
||||
\else
|
||||
\pIIe@@arc{#1}{#2}{#3}{#4}{#5}{#6}%
|
||||
\fi
|
||||
\fi}
|
||||
\newcommand*\pIIe@@arc[6]{%
|
||||
\begingroup
|
||||
\ifdim \sign\@arclen>90\p@
|
||||
\divide\@arclen 2
|
||||
\@tempdima #5\p@ \advance\@tempdima \@arclen
|
||||
\edef\@anglemid{\strip@pt\@tempdima}%
|
||||
\def\@temp{\pIIe@@arc{#1}{#2}{#3}{#4}{#5}}%
|
||||
\expandafter\@temp\expandafter{\@anglemid}%
|
||||
\def\@temp{\pIIe@@arc{2}{#2}{#3}{#4}}%
|
||||
\expandafter\@temp\expandafter{\@anglemid}{#6}%
|
||||
\else
|
||||
\CalculateSin{#5}\CalculateCos{#5}%
|
||||
\@tempdima\UseCos{#5}\@arcrad \advance\@tempdima #2\relax
|
||||
\@tempdimb\UseSin{#5}\@arcrad \advance\@tempdimb #3\relax
|
||||
\ifcase #1\relax
|
||||
\pIIe@lineto\@tempdima\@tempdimb
|
||||
\or \pIIe@moveto\@tempdima\@tempdimb
|
||||
\or
|
||||
\else \PackageWarning {pict2e}%
|
||||
{Illegal obligatory argument in \protect\circlearc.}%
|
||||
\fi
|
||||
\@tempdimc\@arclen \divide\@tempdimc\@iv
|
||||
\edef\@angle{\strip@pt\@tempdimc}\CalculateTan{\@angle}%
|
||||
\@linelen\UseTan{\@angle}\@arcrad \@linelen4\@linelen \divide\@linelen\thr@@
|
||||
\advance\@tempdima-\UseSin{#5}\@linelen
|
||||
\advance\@tempdimb \UseCos{#5}\@linelen
|
||||
\pIIe@add@nums\@tempdima\@tempdimb
|
||||
\CalculateSin{#6}\CalculateCos{#6}%
|
||||
\@tempdima \UseCos{#6}\@arcrad \advance\@tempdima #2\relax
|
||||
\@tempdimb \UseSin{#6}\@arcrad \advance\@tempdimb #3\relax
|
||||
\@tempdimc \UseSin{#6}\@linelen \advance\@tempdimc \@tempdima
|
||||
\pIIe@tempdimd-\UseCos{#6}\@linelen \advance\pIIe@tempdimd \@tempdimb
|
||||
\pIIe@add@nums\@tempdimc\pIIe@tempdimd
|
||||
\pIIe@add@CP\@tempdima\@tempdimb
|
||||
\pIIe@addtoGraph\pIIe@curveto@op
|
||||
\fi
|
||||
\endgroup}
|
||||
\newcommand*\pIIearc
|
||||
{\@ifstar{\@tempswatrue\pIIe@arc@}{\@tempswafalse\pIIe@arc@}}
|
||||
\newcommand*\pIIe@arc@[2][0,360]{\pIIe@arc@@(#1){#2}}
|
||||
\def\pIIe@arc@@(#1,#2)#3{%
|
||||
\@defaultunitsset\pIIe@tempdima{#3}\unitlength
|
||||
\if@tempswa
|
||||
\pIIe@moveto\z@\z@
|
||||
\pIIe@arc{\z@}{\z@}{\pIIe@tempdima}{#1}{#2}%
|
||||
\pIIe@closepath\pIIe@fillGraph
|
||||
\else
|
||||
\pIIe@arc[1]{\z@}{\z@}{\pIIe@tempdima}{#1}{#2}%
|
||||
\pIIe@strokeGraph
|
||||
\fi}
|
||||
\ifx\undefined\arc
|
||||
\else
|
||||
\PackageWarning{pict2e}{\protect\arc\space redefined}%
|
||||
\fi
|
||||
\let\arc\pIIearc
|
||||
\let\lp@r( \let\rp@r)
|
||||
\def\Line(#1,#2)(#3,#4){\polyline(#1,#2)(#3,#4)}
|
||||
\def\polyline(#1,#2){%
|
||||
\@killglue
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\pIIe@moveto{\pIIe@tempdima}{\pIIe@tempdimb}%
|
||||
\@ifnextchar\lp@r{\@polyline}{\PackageWarning{pict2e}%
|
||||
{Polygonal lines require at least two vertices!}%
|
||||
\ignorespaces}}
|
||||
\def\@polyline(#1,#2){%
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\pIIe@lineto{\pIIe@tempdima}{\pIIe@tempdimb}%
|
||||
\@ifnextchar\lp@r{\@polyline}{\pIIe@strokeGraph\ignorespaces}}
|
||||
\def\Vector(#1,#2)(#3,#4){\polyvector(#1,#2)(#3,#4)}
|
||||
\def\polyvector(#1,#2){%
|
||||
\@killglue
|
||||
\@ifnextchar\lp@r{\begingroup\@polyvector(#1,#2)}{%
|
||||
\PackageWarning{pict2e}%
|
||||
{Polygonal vectors require at least two vertices!}\ignorespaces}}
|
||||
\def\@polyvector(#1,#2)(#3,#4){%
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimc{#3}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimd{#4}\unitlength
|
||||
\advance\pIIe@tempdimc-\pIIe@tempdima \advance\pIIe@tempdimd-\pIIe@tempdimb
|
||||
\ifdim\pIIe@tempdimc=\z@ \@linelen\pIIe@tempdimd \else
|
||||
\ifdim\pIIe@tempdimd=\z@ \@linelen\pIIe@tempdimc \else
|
||||
\pIIe@pyth\pIIe@tempdimc\pIIe@tempdimd\@linelen
|
||||
\fi
|
||||
\fi
|
||||
\ifdim\@linelen<\z@ \@linelen-\@linelen\fi
|
||||
\pIIe@divide{\pIIe@tempdimc}\@linelen\pIIe@tempdime
|
||||
\pIIe@divide{\pIIe@tempdimd}\@linelen\pIIe@tempdimf
|
||||
\pIIe@concat\pIIe@tempdime\pIIe@tempdimf{-\pIIe@tempdimf}\pIIe@tempdime\pIIe@tempdima\pIIe@tempdimb
|
||||
\pIIe@vector \pIIe@fillGraph
|
||||
\@ifnextchar\lp@r{\@polyvector(#3,#4)}{\endgroup\ignorespaces}}
|
||||
\def\polygon{%
|
||||
\@killglue
|
||||
\@ifstar{\begingroup\@tempswatrue\@polygon}%
|
||||
{\begingroup\@tempswafalse\@polygon}}
|
||||
\def\@polygon(#1,#2){%
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\pIIe@moveto{\pIIe@tempdima}{\pIIe@tempdimb}%
|
||||
\@ifnextchar\lp@r{\@@polygon}{\PackageWarning{pict2e}%
|
||||
{Polygons require at least two vertices!}%
|
||||
\ignorespaces}}
|
||||
\def\@@polygon(#1,#2){%
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\pIIe@lineto{\pIIe@tempdima}{\pIIe@tempdimb}%
|
||||
\@ifnextchar\lp@r{\@@polygon}{\pIIe@closepath
|
||||
\if@tempswa\pIIe@fillGraph\else\pIIe@strokeGraph\fi
|
||||
\endgroup
|
||||
\ignorespaces}}
|
||||
\def\moveto(#1,#2){%
|
||||
\@killglue
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\pIIe@moveto{\pIIe@tempdima}{\pIIe@tempdimb}%
|
||||
\ignorespaces}
|
||||
\def\lineto(#1,#2){%
|
||||
\@killglue
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\pIIe@lineto{\pIIe@tempdima}{\pIIe@tempdimb}%
|
||||
\ignorespaces}
|
||||
\def\curveto(#1,#2)(#3,#4)(#5,#6){%
|
||||
\@killglue
|
||||
\@defaultunitsset\pIIe@tempdima{#1}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#2}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimc{#3}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimd{#4}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdime{#5}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimf{#6}\unitlength
|
||||
\pIIe@curveto{\pIIe@tempdima}{\pIIe@tempdimb}{\pIIe@tempdimc}%
|
||||
{\pIIe@tempdimd}{\pIIe@tempdime}{\pIIe@tempdimf}%
|
||||
\ignorespaces}
|
||||
\newcommand*\circlearc[6][0]{%
|
||||
\@killglue
|
||||
\@defaultunitsset\pIIe@tempdima{#2}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#3}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimc{#4}\unitlength
|
||||
\pIIe@arc[#1]{\pIIe@tempdima}{\pIIe@tempdimb}{\pIIe@tempdimc}{#5}{#6}%
|
||||
\ignorespaces}
|
||||
\def\closepath{\pIIe@closepath}
|
||||
\def\strokepath{\pIIe@strokeGraph}
|
||||
\def\fillpath{\pIIe@fillGraph}
|
||||
\ifcase\pIIe@mode\relax
|
||||
\or
|
||||
\newcommand*\pIIe@linecap@op{setlinecap}
|
||||
\newcommand*\pIIe@linejoin@op{setlinejoin}
|
||||
\or
|
||||
\newcommand*\pIIe@linecap@op{J}
|
||||
\newcommand*\pIIe@linejoin@op{j}
|
||||
\fi
|
||||
\def\pIIe@linecap{}
|
||||
\def\pIIe@linejoin{}
|
||||
\def\buttcap{\edef\pIIe@linecap{ 0 \pIIe@linecap@op}}
|
||||
\def\roundcap{\edef\pIIe@linecap{ 1 \pIIe@linecap@op}}
|
||||
\def\squarecap{\edef\pIIe@linecap{ 2 \pIIe@linecap@op}}
|
||||
\def\miterjoin{\edef\pIIe@linejoin{ 0 \pIIe@linejoin@op}}
|
||||
\def\roundjoin{\edef\pIIe@linejoin{ 1 \pIIe@linejoin@op}}
|
||||
\def\beveljoin{\edef\pIIe@linejoin{ 2 \pIIe@linejoin@op}}
|
||||
\AtBeginDocument{\@ifundefined{cbezier}{\newcommand}{\renewcommand}*%
|
||||
\cbezier[2][0]{\pIIe@@cbezier[#1]#2}%
|
||||
\@ifdefinable\pIIe@@cbezier{}%
|
||||
\def\pIIe@@cbezier#1)#2(#3)#4(#5)#6({\@cbezier#1)(#3)(#5)(}%
|
||||
\def\@cbezier[#1](#2,#3)(#4,#5)(#6,#7)(#8,#9){%
|
||||
\@killglue
|
||||
\@defaultunitsset\pIIe@tempdima{#2}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#3}\unitlength
|
||||
\pIIe@moveto{\pIIe@tempdima}{\pIIe@tempdimb}%
|
||||
\@defaultunitsset\pIIe@tempdima{#4}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimb{#5}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimc{#6}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimd{#7}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdime{#8}\unitlength
|
||||
\@defaultunitsset\pIIe@tempdimf{#9}\unitlength
|
||||
\pIIe@curveto{\pIIe@tempdima}{\pIIe@tempdimb}{\pIIe@tempdimc}%
|
||||
{\pIIe@tempdimd}{\pIIe@tempdime}{\pIIe@tempdimf}%
|
||||
\pIIe@strokeGraph
|
||||
\ignorespaces}%
|
||||
}
|
||||
\else
|
||||
\renewcommand*\oval[1][]{\pIIe@oldoval}
|
||||
\newcommand*\maxovalrad{20pt}
|
||||
\newcommand*\OriginalPictureCmds{}
|
||||
\fi
|
||||
\Gin@codes
|
||||
\let\Gin@codes\relax
|
||||
\endinput
|
||||
%%
|
||||
%% End of file `pict2e.sty'.
|
||||
@ -457,9 +457,9 @@ mass *4 ${wheel_mass}
|
||||
variable dx equal 1.0
|
||||
variable density equal 0.001184
|
||||
|
||||
neighbor 0.5 bin
|
||||
neighbor 0.5 bin
|
||||
neigh_modify delay 0 every 1 check yes
|
||||
comm_modify cutoff 3.0
|
||||
comm_modify cutoff 3.0
|
||||
|
||||
pair_style lj/cut 1.2
|
||||
pair_coeff * * 0.0 0.0
|
||||
@ -474,7 +474,7 @@ reset_timestep 0
|
||||
#variable node_force equal "v_total_force / 178"
|
||||
#fix drag all addforce 0.0 0.0 0.0
|
||||
|
||||
velocity all set 0.0 -7.5.0 0.0 units box
|
||||
velocity all set 0.0 -7.5 0.0 units box
|
||||
|
||||
# viscosity of air is 0.0001847
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ InstallDir "$LOCALAPPDATA\${PACEPLUGIN}"
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUninstDetails show
|
||||
SetCompressor lzma
|
||||
SetCompressor zlib
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
|
||||
|
||||
59
examples/PACKAGES/plumed/plugin/CMakeLists.txt
Normal file
59
examples/PACKAGES/plumed/plugin/CMakeLists.txt
Normal file
@ -0,0 +1,59 @@
|
||||
# -*- CMake -*- build system for plugin examples.
|
||||
# The is meant to be used as a template for plugins that are
|
||||
# distributed independent from the LAMMPS package.
|
||||
##########################################
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(plumedplugin VERSION 1.0 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include(CheckIncludeFileCXX)
|
||||
include(LAMMPSInterfacePlugin)
|
||||
include(PLUMED)
|
||||
|
||||
##########################
|
||||
# building the plugins
|
||||
|
||||
add_library(plumedplugin MODULE plumedplugin.cpp ${LAMMPS_SOURCE_DIR}/PLUMED/fix_plumed.cpp)
|
||||
target_link_libraries(plumedplugin PRIVATE LAMMPS::PLUMED)
|
||||
target_link_libraries(plumedplugin PRIVATE lammps)
|
||||
target_include_directories(plumedplugin PRIVATE ${LAMMPS_SOURCE_DIR}/PLUMED)
|
||||
set_target_properties(plumedplugin PROPERTIES PREFIX "" SUFFIX ".so")
|
||||
|
||||
# MacOS seems to need this
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup")
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
# tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers
|
||||
set_target_properties(plumedplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
|
||||
endif()
|
||||
|
||||
get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
|
||||
find_program(MAKENSIS_PATH makensis)
|
||||
if(MAKENSIS_PATH)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/lammps.ico
|
||||
${CMAKE_SOURCE_DIR}/lammps-text-logo-wide.bmp ${CMAKE_SOURCE_DIR}/plumedplugin.nsis
|
||||
${CMAKE_BINARY_DIR})
|
||||
if(BUILD_MPI)
|
||||
if(USE_MSMPI)
|
||||
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MSMPI plumedplugin.nsis
|
||||
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}-MSMPI.exe)
|
||||
else()
|
||||
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MPI plumedplugin.nsis
|
||||
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}-MPI.exe)
|
||||
endif()
|
||||
else()
|
||||
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION} plumedplugin.nsis
|
||||
COMMAND ${CMAKE_COMMAND} -E echo ${PWD}
|
||||
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}.exe)
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-rdynamic")
|
||||
endif()
|
||||
1
examples/PACKAGES/plumed/plugin/LAMMPSInterfacePlugin.cmake
Symbolic link
1
examples/PACKAGES/plumed/plugin/LAMMPSInterfacePlugin.cmake
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../cmake/Modules/LAMMPSInterfacePlugin.cmake
|
||||
1
examples/PACKAGES/plumed/plugin/PLUMED.cmake
Symbolic link
1
examples/PACKAGES/plumed/plugin/PLUMED.cmake
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../cmake/Modules/Packages/PLUMED.cmake
|
||||
2
examples/PACKAGES/plumed/plugin/README.txt
Normal file
2
examples/PACKAGES/plumed/plugin/README.txt
Normal file
@ -0,0 +1,2 @@
|
||||
This folder contains a loader and support files to build the PLUMED package as plugin.
|
||||
For more information please see: https://docs.lammps.org/Developer_plugins.html
|
||||
BIN
examples/PACKAGES/plumed/plugin/lammps-text-logo-wide.bmp
Normal file
BIN
examples/PACKAGES/plumed/plugin/lammps-text-logo-wide.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
BIN
examples/PACKAGES/plumed/plugin/lammps.ico
Normal file
BIN
examples/PACKAGES/plumed/plugin/lammps.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 204 KiB |
28
examples/PACKAGES/plumed/plugin/plumedplugin.cpp
Normal file
28
examples/PACKAGES/plumed/plugin/plumedplugin.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
#include "lammpsplugin.h"
|
||||
#include "version.h"
|
||||
|
||||
#include "fix_plumed.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
static Fix *fix_plumed_creator(LAMMPS *lmp, int argc, char **argv)
|
||||
{
|
||||
return new FixPlumed(lmp, argc, argv);
|
||||
}
|
||||
|
||||
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||
{
|
||||
lammpsplugin_t plugin;
|
||||
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||
|
||||
// register plumed fix style
|
||||
plugin.version = LAMMPS_VERSION;
|
||||
plugin.style = "fix";
|
||||
plugin.name = "plumed";
|
||||
plugin.info = "Plumed2 plugin fix style v1.0";
|
||||
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||
plugin.creator.v1 = (lammpsplugin_factory1 *) &fix_plumed_creator;
|
||||
plugin.handle = handle;
|
||||
(*register_plugin)(&plugin, lmp);
|
||||
}
|
||||
172
examples/PACKAGES/plumed/plugin/plumedplugin.nsis
Normal file
172
examples/PACKAGES/plumed/plugin/plumedplugin.nsis
Normal file
@ -0,0 +1,172 @@
|
||||
#!Nsis Installer Command Script
|
||||
#
|
||||
# The following external defines are recognized:
|
||||
# ${VERSION} = YYYYMMDD
|
||||
|
||||
!include "MUI2.nsh"
|
||||
!include "FileFunc.nsh"
|
||||
|
||||
!define MUI_ICON "lammps.ico"
|
||||
!define MUI_UNICON "lammps.ico"
|
||||
!define MUI_HEADERIMAGE
|
||||
!define MUI_HEADERIMAGE_BITMAP "lammps-text-logo-wide.bmp"
|
||||
!define MUI_HEADERIMAGE_RIGHT
|
||||
|
||||
Unicode true
|
||||
XPStyle on
|
||||
|
||||
!include "LogicLib.nsh"
|
||||
!addplugindir "envvar/Plugins/x86-unicode"
|
||||
!include "x64.nsh"
|
||||
|
||||
RequestExecutionLevel user
|
||||
|
||||
!macro VerifyUserIsAdmin
|
||||
UserInfo::GetAccountType
|
||||
pop $0
|
||||
${If} $0 != "admin"
|
||||
messageBox mb_iconstop "Administrator rights required!"
|
||||
setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
|
||||
quit
|
||||
${EndIf}
|
||||
!macroend
|
||||
|
||||
!define PLUMEDPLUGIN "LAMMPS PLUMED Plugin ${VERSION}"
|
||||
OutFile "LAMMPS-PLUMED-plugin-${VERSION}.exe"
|
||||
|
||||
Name "${PLUMEDPLUGIN}"
|
||||
InstallDir "$LOCALAPPDATA\${PLUMEDPLUGIN}"
|
||||
|
||||
ShowInstDetails show
|
||||
ShowUninstDetails show
|
||||
SetCompressor zlib
|
||||
|
||||
!define MUI_ABORTWARNING
|
||||
|
||||
!insertmacro MUI_PAGE_DIRECTORY
|
||||
!insertmacro MUI_PAGE_INSTFILES
|
||||
|
||||
!insertmacro MUI_UNPAGE_CONFIRM
|
||||
!insertmacro MUI_UNPAGE_INSTFILES
|
||||
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
function .onInit
|
||||
# Determine if LAMMPS was already installed and check whether it was in 32-bit
|
||||
# or 64-bit. Then look up path to uninstaller and offer to uninstall or quit
|
||||
SetRegView 32
|
||||
ReadRegDWORD $0 HKCU "Software\LAMMPS-PLUMED" "Bits"
|
||||
SetRegView LastUsed
|
||||
${If} $0 == "32"
|
||||
SetRegView 32
|
||||
${ElseIf} $0 == "64"
|
||||
SetRegView 64
|
||||
${Else}
|
||||
SetRegView 64
|
||||
${EndIf}
|
||||
ClearErrors
|
||||
ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" "UninstallString"
|
||||
SetRegView LastUsed
|
||||
${If} ${Errors}
|
||||
DetailPrint "LAMMPS PLUMED plugin not (yet) installed"
|
||||
${Else}
|
||||
MessageBox MB_YESNO "LAMMPS PLUMED plugin ($0 bit) is already installed. Uninstall existing version?" /SD IDYES IDNO Quit
|
||||
Pop $R1
|
||||
StrCmp $R1 2 Quit +1
|
||||
Exec $R0
|
||||
Quit:
|
||||
Quit
|
||||
${EndIf}
|
||||
setShellVarContext all
|
||||
functionEnd
|
||||
|
||||
Section "${PLUMEDPLUGIN}" SecPlumedplugin
|
||||
SectionIn RO
|
||||
# Write LAMMPS installation bitness marker. Always use 32-bit registry view
|
||||
SetRegView 32
|
||||
IntFmt $0 "0x%08X" 64
|
||||
WriteRegDWORD HKCU "Software\LAMMPS-PLUMED" "Bits" $0
|
||||
|
||||
# Switch to "native" registry view
|
||||
SetRegView 64
|
||||
SetShellVarContext current
|
||||
|
||||
SetOutPath "$INSTDIR"
|
||||
CreateDirectory "$INSTDIR\patches"
|
||||
CreateDirectory "$INSTDIR\bin"
|
||||
File lammps.ico
|
||||
File plumedplugin.so
|
||||
|
||||
SetOutPath "$INSTDIR\bin"
|
||||
File plumed.exe
|
||||
|
||||
# Register Application and its uninstaller
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"DisplayName" "${PLUMEDPLUGIN}"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"Publisher" "The LAMMPS and PLUMED Developers"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"URLInfoAbout" "lammps.org"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"DisplayIcon" "$INSTDIR\lammps.ico"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"DisplayVersion" "${VERSION}"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"InstallLocation" "$INSTDIR"
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
||||
|
||||
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
||||
IntFmt $0 "0x%08X" $0
|
||||
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||
"EstimatedSize" "$0"
|
||||
|
||||
# update path variables
|
||||
EnVar::SetHKCU
|
||||
# add plumed executable path
|
||||
EnVar::AddValue "PATH" "$INSTDIR\bin"
|
||||
# add to LAMMPS plugin search path
|
||||
EnVar::AddValue "LAMMPS_PLUGIN_PATH" "$INSTDIR"
|
||||
# add plumed2 patch files
|
||||
EnVar::AddValue "PLUMED_ROOT" "$INSTDIR"
|
||||
|
||||
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||
SectionEnd
|
||||
|
||||
function un.onInit
|
||||
SetShellVarContext current
|
||||
functionEnd
|
||||
|
||||
Section "Uninstall"
|
||||
# remove LAMMPS bitness/installation indicator always in 32-bit registry view
|
||||
SetRegView 32
|
||||
DeleteRegKey HKCU "Software\LAMMPS-PLUMED"
|
||||
|
||||
# unregister extension, and uninstall info
|
||||
SetRegView 64
|
||||
SetShellVarContext current
|
||||
# unregister installation
|
||||
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED"
|
||||
|
||||
# update path variables
|
||||
EnVar::SetHKCU
|
||||
# remove plumed executable path
|
||||
EnVar::DeleteValue "PATH" "$INSTDIR\bin"
|
||||
# remove entry from LAMMPS plugin search path
|
||||
EnVar::DeleteValue "LAMMPS_PLUGIN_PATH" "$INSTDIR"
|
||||
# remove plumed patch environment
|
||||
EnVar::Delete "PLUMED_ROOT"
|
||||
|
||||
RMDir /r /REBOOTOK "$INSTDIR\patches"
|
||||
RMDir /r /REBOOTOK "$INSTDIR\bin"
|
||||
Delete /REBOOTOK "$INSTDIR\plumedplugin.so"
|
||||
Delete /REBOOTOK "$INSTDIR\Uninstall.exe"
|
||||
Delete /REBOOTOK "$INSTDIR\lammps.ico"
|
||||
RMDir /REBOOTOK "$INSTDIR"
|
||||
SectionEnd
|
||||
|
||||
# Local Variables:
|
||||
# mode: sh
|
||||
# End:
|
||||
1
examples/meam/msmeam/library.msmeam
Symbolic link
1
examples/meam/msmeam/library.msmeam
Symbolic link
@ -0,0 +1 @@
|
||||
../../../potentials/library.msmeam
|
||||
@ -3633,7 +3633,7 @@ CONTAINS
|
||||
|
||||
n = LEN_TRIM(f_string)
|
||||
ptr = lammps_malloc(n+1)
|
||||
CALL C_F_POINTER(ptr, c_string, [1])
|
||||
CALL C_F_POINTER(ptr, c_string, [n+1])
|
||||
DO i=1, n
|
||||
c_string(i) = f_string(i:i)
|
||||
END DO
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
|
||||
//#define ASYNC_DEVICE_COPY
|
||||
|
||||
#if 0
|
||||
#if !defined(USE_OPENCL) && !defined(USE_HIP)
|
||||
// temporary workaround for int2 also defined in cufft
|
||||
#ifdef int2
|
||||
@ -40,6 +41,7 @@
|
||||
#endif
|
||||
#include "cufft.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace LAMMPS_AL {
|
||||
|
||||
@ -313,10 +315,11 @@ class BaseAmoeba {
|
||||
virtual int fphi_mpole();
|
||||
virtual int polar_real(const int eflag, const int vflag) = 0;
|
||||
|
||||
|
||||
#if 0
|
||||
#if !defined(USE_OPENCL) && !defined(USE_HIP)
|
||||
cufftHandle plan;
|
||||
#endif
|
||||
#endif
|
||||
bool fft_plan_created;
|
||||
};
|
||||
|
||||
|
||||
@ -19,141 +19,13 @@ typedef long int logical;
|
||||
typedef short int shortlogical;
|
||||
typedef char logical1;
|
||||
typedef char integer1;
|
||||
#ifdef INTEGER_STAR_8 /* Adjust for integer*8. */
|
||||
typedef long long longint; /* system-dependent */
|
||||
typedef unsigned long long ulongint; /* system-dependent */
|
||||
#define qbit_clear(a,b) ((a) & ~((ulongint)1 << (b)))
|
||||
#define qbit_set(a,b) ((a) | ((ulongint)1 << (b)))
|
||||
#endif
|
||||
|
||||
#define TRUE_ (1)
|
||||
#define FALSE_ (0)
|
||||
|
||||
/* Extern is for use with -E */
|
||||
#ifndef Extern
|
||||
#define Extern extern
|
||||
#endif
|
||||
|
||||
/* I/O stuff */
|
||||
|
||||
#ifdef f2c_i2
|
||||
/* for -i2 */
|
||||
typedef short flag;
|
||||
typedef short ftnlen;
|
||||
typedef short ftnint;
|
||||
#else
|
||||
typedef long int flag;
|
||||
typedef long int ftnlen;
|
||||
typedef long int ftnint;
|
||||
#endif
|
||||
|
||||
/*external read, write*/
|
||||
typedef struct
|
||||
{ flag cierr;
|
||||
ftnint ciunit;
|
||||
flag ciend;
|
||||
char *cifmt;
|
||||
ftnint cirec;
|
||||
} cilist;
|
||||
|
||||
/*internal read, write*/
|
||||
typedef struct
|
||||
{ flag icierr;
|
||||
char *iciunit;
|
||||
flag iciend;
|
||||
char *icifmt;
|
||||
ftnint icirlen;
|
||||
ftnint icirnum;
|
||||
} icilist;
|
||||
|
||||
/*open*/
|
||||
typedef struct
|
||||
{ flag oerr;
|
||||
ftnint ounit;
|
||||
char *ofnm;
|
||||
ftnlen ofnmlen;
|
||||
char *osta;
|
||||
char *oacc;
|
||||
char *ofm;
|
||||
ftnint orl;
|
||||
char *oblnk;
|
||||
} olist;
|
||||
|
||||
/*close*/
|
||||
typedef struct
|
||||
{ flag cerr;
|
||||
ftnint cunit;
|
||||
char *csta;
|
||||
} cllist;
|
||||
|
||||
/*rewind, backspace, endfile*/
|
||||
typedef struct
|
||||
{ flag aerr;
|
||||
ftnint aunit;
|
||||
} alist;
|
||||
|
||||
/* inquire */
|
||||
typedef struct
|
||||
{ flag inerr;
|
||||
ftnint inunit;
|
||||
char *infile;
|
||||
ftnlen infilen;
|
||||
ftnint *inex; /*parameters in standard's order*/
|
||||
ftnint *inopen;
|
||||
ftnint *innum;
|
||||
ftnint *innamed;
|
||||
char *inname;
|
||||
ftnlen innamlen;
|
||||
char *inacc;
|
||||
ftnlen inacclen;
|
||||
char *inseq;
|
||||
ftnlen inseqlen;
|
||||
char *indir;
|
||||
ftnlen indirlen;
|
||||
char *infmt;
|
||||
ftnlen infmtlen;
|
||||
char *inform;
|
||||
ftnint informlen;
|
||||
char *inunf;
|
||||
ftnlen inunflen;
|
||||
ftnint *inrecl;
|
||||
ftnint *innrec;
|
||||
char *inblank;
|
||||
ftnlen inblanklen;
|
||||
} inlist;
|
||||
|
||||
#define VOID void
|
||||
|
||||
union Multitype { /* for multiple entry points */
|
||||
integer1 g;
|
||||
shortint h;
|
||||
integer i;
|
||||
/* longint j; */
|
||||
real r;
|
||||
doublereal d;
|
||||
complex c;
|
||||
doublecomplex z;
|
||||
};
|
||||
|
||||
typedef union Multitype Multitype;
|
||||
|
||||
/*typedef long int Long;*/ /* No longer used; formerly in Namelist */
|
||||
|
||||
struct Vardesc { /* for Namelist */
|
||||
char *name;
|
||||
char *addr;
|
||||
ftnlen *dims;
|
||||
int type;
|
||||
};
|
||||
typedef struct Vardesc Vardesc;
|
||||
|
||||
struct Namelist {
|
||||
char *name;
|
||||
Vardesc **vars;
|
||||
int nvars;
|
||||
};
|
||||
typedef struct Namelist Namelist;
|
||||
|
||||
#define abs(x) ((x) >= 0 ? (x) : -(x))
|
||||
#define dabs(x) (doublereal)abs(x)
|
||||
#define min(a,b) ((a) <= (b) ? (a) : (b))
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
// concatenate two strings
|
||||
|
||||
extern "C" {
|
||||
void s_lmp_cat(char *lp, char *rpp[], ftnint rnp[], ftnint *np, ftnlen ll)
|
||||
void s_lmp_cat(char *lp, char **rpp, integer *rnp, integer *np, ftnlen ll)
|
||||
{
|
||||
ftnlen i, nc;
|
||||
char *rp;
|
||||
|
||||
@ -16,8 +16,10 @@ parser = ArgumentParser(prog='Install.py',
|
||||
description="LAMMPS library build wrapper script")
|
||||
|
||||
# settings
|
||||
# Note: must also adjust check for supported API versions in
|
||||
# fix_plumed.cpp when version changes from v2.n.x to v2.n+1.y
|
||||
|
||||
version = "2.8.2"
|
||||
version = "2.9.1"
|
||||
mode = "static"
|
||||
|
||||
# help message
|
||||
@ -45,6 +47,10 @@ checksums = { \
|
||||
'2.7.6' : 'fb8c0ec10f97a9353eb123a5c4c35aa6', \
|
||||
'2.8.1' : '6bfe72ebdae63dc38a9ca27d9b0e08f8', \
|
||||
'2.8.2' : '599092b6a0aa6fff992612537ad98994', \
|
||||
'2.8.3' : '76d23cd394eba9e6530316ed1184e219', \
|
||||
'2.8.4' : '9f59c4f9bda86fe5bef19543c295a981', \
|
||||
'2.9.0' : '661eabeebee05cf84bbf9dc23d7d5f46', \
|
||||
'2.9.1' : 'c3b2d31479c1e9ce211719d40e9efbd7', \
|
||||
}
|
||||
|
||||
# parse and process arguments
|
||||
|
||||
@ -334,8 +334,8 @@ class lammps(object):
|
||||
if self.has_mpi_support:
|
||||
try:
|
||||
from mpi4py import __version__ as mpi4py_version
|
||||
# tested to work with mpi4py versions 2 and 3
|
||||
self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3']
|
||||
# tested to work with mpi4py versions 2, 3, and 4
|
||||
self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3','4']
|
||||
except ImportError:
|
||||
# ignore failing import
|
||||
pass
|
||||
@ -361,7 +361,7 @@ class lammps(object):
|
||||
if not self.has_mpi_support:
|
||||
raise Exception('LAMMPS not compiled with real MPI library')
|
||||
if not self.has_mpi4py:
|
||||
raise Exception('Python mpi4py version is not 2 or 3')
|
||||
raise Exception('Python mpi4py version is not 2, 3, or 4')
|
||||
if self.MPI._sizeof(self.MPI.Comm) == sizeof(c_int):
|
||||
MPI_Comm = c_int
|
||||
else:
|
||||
@ -374,12 +374,16 @@ class lammps(object):
|
||||
narg = 0
|
||||
cargs = None
|
||||
if cmdargs is not None:
|
||||
cmdargs.insert(0,"lammps")
|
||||
narg = len(cmdargs)
|
||||
for i in range(narg):
|
||||
if type(cmdargs[i]) is str:
|
||||
cmdargs[i] = cmdargs[i].encode()
|
||||
cargs = (c_char_p*(narg+1))(*cmdargs)
|
||||
myargs = ["lammps".encode()]
|
||||
narg = len(cmdargs) + 1
|
||||
for arg in cmdargs:
|
||||
if type(arg) is str:
|
||||
myargs.append(arg.encode())
|
||||
elif type(arg) is bytes:
|
||||
myargs.append(arg)
|
||||
else:
|
||||
raise TypeError('Unsupported cmdargs type ', type(arg))
|
||||
cargs = (c_char_p*(narg+1))(*myargs)
|
||||
cargs[narg] = None
|
||||
self.lib.lammps_open.argtypes = [c_int, c_char_p*(narg+1), MPI_Comm, c_void_p]
|
||||
else:
|
||||
@ -395,12 +399,16 @@ class lammps(object):
|
||||
self.comm = self.MPI.COMM_WORLD
|
||||
self.opened = 1
|
||||
if cmdargs is not None:
|
||||
cmdargs.insert(0,"lammps")
|
||||
narg = len(cmdargs)
|
||||
for i in range(narg):
|
||||
if type(cmdargs[i]) is str:
|
||||
cmdargs[i] = cmdargs[i].encode()
|
||||
cargs = (c_char_p*(narg+1))(*cmdargs)
|
||||
myargs = ["lammps".encode()]
|
||||
narg = len(cmdargs) + 1
|
||||
for arg in cmdargs:
|
||||
if type(arg) is str:
|
||||
myargs.append(arg.encode())
|
||||
elif type(arg) is bytes:
|
||||
myargs.append(arg)
|
||||
else:
|
||||
raise TypeError('Unsupported cmdargs type ', type(arg))
|
||||
cargs = (c_char_p*(narg+1))(*myargs)
|
||||
cargs[narg] = None
|
||||
self.lib.lammps_open_no_mpi.argtypes = [c_int, c_char_p*(narg+1), c_void_p]
|
||||
self.lmp = c_void_p(self.lib.lammps_open_no_mpi(narg,cargs,None))
|
||||
|
||||
@ -192,11 +192,23 @@ class Atom(object):
|
||||
@property
|
||||
def mass(self):
|
||||
"""
|
||||
Return the atom mass
|
||||
Return the atom mass as a per-atom property.
|
||||
This returns either the per-type mass or the per-atom
|
||||
mass (AKA 'rmass') depending on what is available with
|
||||
preference for the per-atom mass.
|
||||
|
||||
.. versionchanged:: 2Aug2023_update_4
|
||||
|
||||
Support both per-type and per-atom masses. With
|
||||
per-type return "mass[type[i]]" else return "rmass[i]".
|
||||
Per-atom mass is preferred if available.
|
||||
|
||||
:type: float
|
||||
"""
|
||||
return self.get("mass", self.index)
|
||||
if self._pylmp.lmp.extract_setting('rmass_flag'):
|
||||
return self.get("rmass", self.index)
|
||||
else:
|
||||
return self.get("mass", self.type)
|
||||
|
||||
@property
|
||||
def radius(self):
|
||||
|
||||
@ -300,6 +300,7 @@ double PairYLZ::init_one(int i, int j)
|
||||
zeta[j][i] = zeta[i][j];
|
||||
mu[j][i] = mu[i][j];
|
||||
beta[j][i] = beta[i][j];
|
||||
cut[j][i] = cut[i][j];
|
||||
|
||||
return cut[i][j];
|
||||
}
|
||||
@ -409,7 +410,7 @@ void PairYLZ::write_data_all(FILE *fp)
|
||||
{
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
for (int j = i; j <= atom->ntypes; j++)
|
||||
fprintf(fp, "%d %d %g %g %g %g %g %g\n", i, j, epsilon[i][i], sigma[i][i], cut[i][j],
|
||||
fprintf(fp, "%d %d %g %g %g %g %g %g\n", i, j, epsilon[i][j], sigma[i][j], cut[i][j],
|
||||
zeta[i][j], mu[i][j], beta[i][j]);
|
||||
}
|
||||
|
||||
|
||||
@ -99,10 +99,9 @@ int BodyRoundedPolyhedron::nedges(AtomVecBody::Bonus *bonus)
|
||||
{
|
||||
int nvertices = bonus->ivalue[0];
|
||||
int nedges = bonus->ivalue[1];
|
||||
//int nfaces = bonus->ivalue[2];
|
||||
if (nvertices == 1) return 0;
|
||||
else if (nvertices == 2) return 1;
|
||||
return nedges; //(nvertices+nfaces-2); // Euler formula: V-E+F=2
|
||||
return nedges;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -116,6 +115,9 @@ double *BodyRoundedPolyhedron::edges(AtomVecBody::Bonus *bonus)
|
||||
|
||||
int BodyRoundedPolyhedron::nfaces(AtomVecBody::Bonus *bonus)
|
||||
{
|
||||
int nvertices = bonus->ivalue[0];
|
||||
if (nvertices < 3) return 0;
|
||||
|
||||
return bonus->ivalue[2];
|
||||
}
|
||||
|
||||
|
||||
@ -480,15 +480,18 @@ void PairBrownian::init_style()
|
||||
// are re-calculated at every step.
|
||||
|
||||
flagdeform = flagwall = 0;
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style, "deform") == 0)
|
||||
flagdeform = 1;
|
||||
else if (strstr(modify->fix[i]->style, "wall") != nullptr) {
|
||||
if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
wallfix = nullptr;
|
||||
|
||||
if (modify->get_fix_by_style("^deform").size() > 0) flagdeform = 1;
|
||||
auto fixes = modify->get_fix_by_style("^wall");
|
||||
if (fixes.size() > 1)
|
||||
error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian");
|
||||
else if (fixes.size() == 1) {
|
||||
wallfix = dynamic_cast<FixWall *>(fixes[0]);
|
||||
if (!wallfix)
|
||||
error->all(FLERR, "Fix {} is not compatible with pair brownian", fixes[0]->style);
|
||||
flagwall = 1;
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
// set the isotropic constants depending on the volume fraction
|
||||
|
||||
@ -349,17 +349,18 @@ void PairBrownianPoly::init_style()
|
||||
// are re-calculated at every step.
|
||||
|
||||
flagdeform = flagwall = 0;
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0)
|
||||
flagdeform = 1;
|
||||
else if (strstr(modify->fix[i]->style,"wall") != nullptr) {
|
||||
if (flagwall)
|
||||
error->all(FLERR,
|
||||
"Cannot use multiple fix wall commands with pair brownian");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
wallfix = nullptr;
|
||||
|
||||
if (modify->get_fix_by_style("^deform").size() > 0) flagdeform = 1;
|
||||
auto fixes = modify->get_fix_by_style("^wall");
|
||||
if (fixes.size() > 1)
|
||||
error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian/poly");
|
||||
else if (fixes.size() == 1) {
|
||||
wallfix = dynamic_cast<FixWall *>(fixes[0]);
|
||||
if (!wallfix)
|
||||
error->all(FLERR, "Fix {} is not compatible with pair brownian/poly", fixes[0]->style);
|
||||
flagwall = 1;
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
// set the isotropic constants that depend on the volume fraction
|
||||
|
||||
@ -560,21 +560,23 @@ void PairLubricate::init_style()
|
||||
// are re-calculated at every step.
|
||||
|
||||
shearing = flagdeform = flagwall = 0;
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
shearing = flagdeform = 1;
|
||||
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
error->all(FLERR,"Using pair lubricate with inconsistent "
|
||||
"fix deform remap option");
|
||||
}
|
||||
if (strstr(modify->fix[i]->style,"wall") != nullptr) {
|
||||
if (flagwall)
|
||||
error->all(FLERR,
|
||||
"Cannot use multiple fix wall commands with pair lubricate");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
auto fixes = modify->get_fix_by_style("^deform");
|
||||
if (fixes.size() > 0) {
|
||||
shearing = flagdeform = 1;
|
||||
auto *myfix = dynamic_cast<FixDeform *>(fixes[0]);
|
||||
if (myfix && (myfix->remapflag != Domain::V_REMAP))
|
||||
error->all(FLERR,"Using pair lubricate with inconsistent fix deform remap option");
|
||||
}
|
||||
fixes = modify->get_fix_by_style("^wall");
|
||||
if (fixes.size() > 1)
|
||||
error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricate");
|
||||
else if (fixes.size() == 1) {
|
||||
wallfix = dynamic_cast<FixWall *>(fixes[0]);
|
||||
if (!wallfix)
|
||||
error->all(FLERR, "Fix {} is not compatible with pair lubricate", fixes[0]->style);
|
||||
flagwall = 1;
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
// set the isotropic constants that depend on the volume fraction
|
||||
|
||||
@ -1792,18 +1792,18 @@ void PairLubricateU::init_style()
|
||||
// are re-calculated at every step.
|
||||
|
||||
flagdeform = flagwall = 0;
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0)
|
||||
flagdeform = 1;
|
||||
else if (strstr(modify->fix[i]->style,"wall") != nullptr) {
|
||||
if (flagwall)
|
||||
error->all(FLERR,
|
||||
"Cannot use multiple fix wall commands with "
|
||||
"pair lubricateU");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
wallfix = nullptr;
|
||||
|
||||
if (modify->get_fix_by_style("^deform").size() > 0) flagdeform = 1;
|
||||
auto fixes = modify->get_fix_by_style("^wall");
|
||||
if (fixes.size() > 1)
|
||||
error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricateU");
|
||||
else if (fixes.size() == 1) {
|
||||
wallfix = dynamic_cast<FixWall *>(fixes[0]);
|
||||
if (!wallfix)
|
||||
error->all(FLERR, "Fix {} is not compatible with pair lubricateU", fixes[0]->style);
|
||||
flagwall = 1;
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
// set the isotropic constants depending on the volume fraction
|
||||
|
||||
@ -1156,18 +1156,18 @@ void PairLubricateUPoly::init_style()
|
||||
// are re-calculated at every step.
|
||||
|
||||
flagdeform = flagwall = 0;
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0)
|
||||
flagdeform = 1;
|
||||
else if (strstr(modify->fix[i]->style,"wall") != nullptr) {
|
||||
if (flagwall)
|
||||
error->all(FLERR,
|
||||
"Cannot use multiple fix wall commands with "
|
||||
"pair lubricateU");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
wallfix = nullptr;
|
||||
|
||||
if (modify->get_fix_by_style("^deform").size() > 0) flagdeform = 1;
|
||||
auto fixes = modify->get_fix_by_style("^wall");
|
||||
if (fixes.size() > 1)
|
||||
error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricateU/poly");
|
||||
else if (fixes.size() == 1) {
|
||||
wallfix = dynamic_cast<FixWall *>(fixes[0]);
|
||||
if (!wallfix)
|
||||
error->all(FLERR, "Fix {} is not compatible with pair lubricateU/poly", fixes[0]->style);
|
||||
flagwall = 1;
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
// set the isotropic constants depending on the volume fraction
|
||||
|
||||
@ -460,30 +460,23 @@ void PairLubricatePoly::init_style()
|
||||
// are re-calculated at every step.
|
||||
|
||||
shearing = flagdeform = flagwall = 0;
|
||||
for (int i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"deform") == 0) {
|
||||
shearing = flagdeform = 1;
|
||||
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag != Domain::V_REMAP)
|
||||
error->all(FLERR,"Using pair lubricate with inconsistent "
|
||||
"fix deform remap option");
|
||||
}
|
||||
if (strstr(modify->fix[i]->style,"wall") != nullptr) {
|
||||
if (flagwall)
|
||||
error->all(FLERR,
|
||||
"Cannot use multiple fix wall commands with "
|
||||
"pair lubricate/poly");
|
||||
flagwall = 1; // Walls exist
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
if (strstr(modify->fix[i]->style,"wall") != nullptr) {
|
||||
flagwall = 1; // Walls exist
|
||||
if ((dynamic_cast<FixWall *>(modify->fix[i]))->xflag) {
|
||||
flagwall = 2; // Moving walls exist
|
||||
wallfix = dynamic_cast<FixWall *>(modify->fix[i]);
|
||||
}
|
||||
}
|
||||
auto fixes = modify->get_fix_by_style("^deform");
|
||||
if (fixes.size() > 0) {
|
||||
shearing = flagdeform = 1;
|
||||
auto *myfix = dynamic_cast<FixDeform *>(fixes[0]);
|
||||
if (myfix && (myfix->remapflag != Domain::V_REMAP))
|
||||
error->all(FLERR,"Using pair lubricate/poly with inconsistent fix deform remap option");
|
||||
}
|
||||
fixes = modify->get_fix_by_style("^wall");
|
||||
if (fixes.size() > 1)
|
||||
error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricate/poly");
|
||||
else if (fixes.size() == 1) {
|
||||
wallfix = dynamic_cast<FixWall *>(fixes[0]);
|
||||
if (!wallfix)
|
||||
error->all(FLERR, "Fix {} is not compatible with pair lubricate/poly", fixes[0]->style);
|
||||
flagwall = 1;
|
||||
if (wallfix->xflag) flagwall = 2; // Moving walls exist
|
||||
}
|
||||
|
||||
double vol_T;
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include "fix_mvv_dpd.h"
|
||||
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
@ -65,6 +66,11 @@ void FixMvvDPD::init()
|
||||
if (!atom->vest_flag)
|
||||
error->all(FLERR,"Fix mvv/dpd requires atom attribute vest e.g. from atom style mdpd");
|
||||
|
||||
// Cannot use vremap since its effects aren't propagated to vest
|
||||
// see RHEO or SPH packages for examples of patches
|
||||
if (domain->deform_vremap)
|
||||
error->all(FLERR, "Fix mvv/dpd cannot be used with velocity remapping");
|
||||
|
||||
if (!force->pair_match("^mdpd",0) && !force->pair_match("^dpd",0)) {
|
||||
if (force->pair_match("^hybrid",0)) {
|
||||
if (!(force->pair_match("^mdpd",0,1) || force->pair_match("^dpd",0),1)) {
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#include "fix_mvv_edpd.h"
|
||||
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
@ -73,6 +74,11 @@ void FixMvvEDPD::init()
|
||||
{
|
||||
if (!atom->edpd_flag) error->all(FLERR,"Fix mvv/edpd requires atom style edpd");
|
||||
|
||||
// Cannot use vremap since its effects aren't propagated to vest
|
||||
// see RHEO or SPH packages for examples of patches
|
||||
if (domain->deform_vremap)
|
||||
error->all(FLERR, "Fix mvv/edpd cannot be used with velocity remapping");
|
||||
|
||||
if (!force->pair_match("^edpd",0)) {
|
||||
if (force->pair_match("^hybrid",0)) {
|
||||
if (!force->pair_match("^edpd",0,1)) {
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "fix_mvv_tdpd.h"
|
||||
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
@ -71,6 +72,11 @@ void FixMvvTDPD::init()
|
||||
{
|
||||
if (!atom->tdpd_flag) error->all(FLERR,"Fix mvv/tdpd requires atom style tdpd");
|
||||
|
||||
// Cannot use vremap since its effects aren't propagated to vest
|
||||
// see RHEO or SPH packages for examples of patches
|
||||
if (domain->deform_vremap)
|
||||
error->all(FLERR, "Fix mvv/tdpd cannot be used with velocity remapping");
|
||||
|
||||
if (!force->pair_match("^tdpd",0)) {
|
||||
if (force->pair_match("^hybrid",0)) {
|
||||
if (!force->pair_match("^tdpd",0,1)) {
|
||||
|
||||
@ -350,7 +350,14 @@ void FixMesoMove::init () {
|
||||
}
|
||||
|
||||
void FixMesoMove::setup_pre_force (int /*vflag*/) {
|
||||
|
||||
// Cannot use vremap since its effects aren't propagated to vest
|
||||
// see RHEO or SPH packages for examples of patches
|
||||
if (domain->deform_vremap)
|
||||
error->all(FLERR, "Fix meso/move cannot be used with velocity remapping");
|
||||
|
||||
// set vest equal to v
|
||||
|
||||
double **v = atom->v;
|
||||
double **vest = atom->vest;
|
||||
int *mask = atom->mask;
|
||||
|
||||
@ -29,11 +29,12 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_rigid_meso.h"
|
||||
|
||||
#include "math_extra.h"
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "memory.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
@ -92,6 +93,11 @@ void FixRigidMeso::setup (int vflag) {
|
||||
conjqm[ibody][2] *= 2.0;
|
||||
conjqm[ibody][3] *= 2.0;
|
||||
}
|
||||
|
||||
// Cannot use vremap since its effects aren't propagated to vest
|
||||
// see RHEO or SPH packages for examples of patches
|
||||
if (domain->deform_vremap)
|
||||
error->all(FLERR, "Fix rigid/meso cannot be used with velocity remapping");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
Contributing author: Andres Jaramillo-Botero (Caltech)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
#include "fix_nh_eff.h"
|
||||
|
||||
#include "atom.h"
|
||||
@ -62,7 +61,7 @@ void FixNHEff::nve_v()
|
||||
if (mask[i] & groupbit) {
|
||||
if (abs(spin[i])==1) {
|
||||
dtfm = dtf / mass[type[i]];
|
||||
ervel[i] = dtfm * erforce[i] / mefactor;
|
||||
ervel[i] += dtfm * erforce[i] / mefactor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -79,15 +78,26 @@ void FixNHEff::nve_x()
|
||||
FixNH::nve_x();
|
||||
|
||||
double *eradius = atom->eradius;
|
||||
double *erforce = atom->erforce;
|
||||
double *ervel = atom->ervel;
|
||||
double *mass = atom->mass;
|
||||
int *type = atom->type;
|
||||
int *spin = atom->spin;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
|
||||
|
||||
double mefactor = domain->dimension/4.0;
|
||||
double dtfm;
|
||||
|
||||
for (int i = 0; i < nlocal; i++)
|
||||
if (mask[i] & groupbit)
|
||||
if (abs(spin[i])==1) eradius[i] += dtv * ervel[i];
|
||||
if (mask[i] & groupbit) {
|
||||
dtfm = dtf / mass[type[i]];
|
||||
if (abs(spin[i])==1) {
|
||||
ervel[i] += dtfm * erforce[i] / mefactor;
|
||||
eradius[i] += dtv * ervel[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -494,7 +494,7 @@ void FixElectrodeConp::setup_post_neighbor()
|
||||
if (read_mat)
|
||||
read_from_file(input_file_mat, elastance, "elastance");
|
||||
else if (!read_inv) {
|
||||
if (etypes_neighlists) neighbor->build_one(mat_neighlist, 0);
|
||||
if (etypes_neighlists) neighbor->build_one(mat_neighlist);
|
||||
auto array_compute = std::unique_ptr<ElectrodeMatrix>(new ElectrodeMatrix(lmp, igroup, eta));
|
||||
array_compute->setup(tag_to_iele, pair, mat_neighlist);
|
||||
if (tfflag) { array_compute->setup_tf(tf_types); }
|
||||
|
||||
@ -147,10 +147,8 @@ void ComputeHexOrderAtom::compute_peratom()
|
||||
}
|
||||
|
||||
// invoke full neighbor list (will copy or build if necessary)
|
||||
// on the first step of a run, set preflag to one in neighbor->build_one(...)
|
||||
|
||||
if (update->firststep == update->ntimestep) neighbor->build_one(list,1);
|
||||
else neighbor->build_one(list);
|
||||
neighbor->build_one(list);
|
||||
|
||||
inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
|
||||
@ -291,8 +291,7 @@ void ComputeHMA::compute_vector()
|
||||
double *special_coul = force->special_coul;
|
||||
int newton_pair = force->newton_pair;
|
||||
|
||||
if (update->firststep == update->ntimestep) neighbor->build_one(list,1);
|
||||
else neighbor->build_one(list);
|
||||
neighbor->build_one(list);
|
||||
int inum = list->inum;
|
||||
int *ilist = list->ilist;
|
||||
int *numneigh = list->numneigh;
|
||||
|
||||
@ -386,7 +386,7 @@ void ComputeStressCartesian::compute_array()
|
||||
if (tag[i] > tag[j]) {
|
||||
if ((tag[i] + tag[j]) % 2 == 0) continue;
|
||||
} else if (tag[i] < tag[j]) {
|
||||
if ((tag[i] < tag[j]) % 2 == 1) continue;
|
||||
if ((tag[i] + tag[j]) % 2 == 1) continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing authors: Naveen Michaud-Agrawal (Johns Hopkins U)
|
||||
open-source XDR routines from
|
||||
Open Source XDR based I/O routines from
|
||||
Frans van Hoesel (https://www.rug.nl/staff/f.h.j.van.hoesel/)
|
||||
are included in this file
|
||||
Axel Kohlmeyer (Temple U)
|
||||
@ -35,27 +35,29 @@
|
||||
#include "output.h"
|
||||
#include "update.h"
|
||||
|
||||
#include "xdr_compat.h"
|
||||
|
||||
#include <climits>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EPS 1e-5
|
||||
#define XTC_MAGIC 1995
|
||||
static constexpr double EPS = 1.0e-5;
|
||||
static constexpr int XTC_MAGIC = 1995;
|
||||
|
||||
#define MYMIN(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define MYMAX(a,b) ((a) > (b) ? (a) : (b))
|
||||
|
||||
int xdropen(XDR *, const char *, const char *);
|
||||
int xdrclose(XDR *);
|
||||
void xdrfreebuf();
|
||||
int xdr3dfcoord(XDR *, float *, int *, float *);
|
||||
static int xdropen(XDR *, const char *, const char *);
|
||||
static int xdrclose(XDR *);
|
||||
static void xdrfreebuf();
|
||||
static int xdr3dfcoord(XDR *, float *, int *, float *);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg),
|
||||
coords(nullptr)
|
||||
DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg)
|
||||
: Dump(lmp, narg, arg), coords(nullptr), xd(nullptr)
|
||||
{
|
||||
if (narg != 5) error->all(FLERR,"Illegal dump xtc command");
|
||||
if (binary || compressed || multifile || multiproc)
|
||||
@ -68,6 +70,7 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg),
|
||||
flush_flag = 0;
|
||||
unwrap_flag = 0;
|
||||
precision = 1000.0;
|
||||
xd = new XDR;
|
||||
|
||||
// allocate global array for atom coords
|
||||
|
||||
@ -105,9 +108,10 @@ DumpXTC::~DumpXTC()
|
||||
memory->destroy(coords);
|
||||
|
||||
if (me == 0) {
|
||||
xdrclose(&xd);
|
||||
xdrclose(xd);
|
||||
xdrfreebuf();
|
||||
}
|
||||
delete xd;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -150,7 +154,8 @@ void DumpXTC::openfile()
|
||||
|
||||
fp = nullptr;
|
||||
if (me == 0)
|
||||
if (xdropen(&xd,filename,"w") == 0) error->one(FLERR,"Cannot open dump file");
|
||||
if (xdropen(xd,filename,"w") == 0)
|
||||
error->one(FLERR,"Cannot open XTC format dump file {}: {}", filename, utils::getsyserror());
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -176,11 +181,11 @@ void DumpXTC::write_header(bigint nbig)
|
||||
if (me != 0) return;
|
||||
|
||||
int tmp = XTC_MAGIC;
|
||||
xdr_int(&xd,&tmp);
|
||||
xdr_int(&xd,&n);
|
||||
xdr_int(&xd,&ntimestep);
|
||||
xdr_int(xd,&tmp);
|
||||
xdr_int(xd,&n);
|
||||
xdr_int(xd,&ntimestep);
|
||||
float time_value = ntimestep * tfactor * update->dt;
|
||||
xdr_float(&xd,&time_value);
|
||||
xdr_float(xd,&time_value);
|
||||
|
||||
// cell basis vectors
|
||||
if (domain->triclinic) {
|
||||
@ -192,18 +197,18 @@ void DumpXTC::write_header(bigint nbig)
|
||||
float xz = sfactor * domain->xz;
|
||||
float yz = sfactor * domain->yz;
|
||||
|
||||
xdr_float(&xd,&xdim); xdr_float(&xd,&zero); xdr_float(&xd,&zero);
|
||||
xdr_float(&xd,&xy ); xdr_float(&xd,&ydim); xdr_float(&xd,&zero);
|
||||
xdr_float(&xd,&xz ); xdr_float(&xd,&yz ); xdr_float(&xd,&zdim);
|
||||
xdr_float(xd,&xdim); xdr_float(xd,&zero); xdr_float(xd,&zero);
|
||||
xdr_float(xd,&xy ); xdr_float(xd,&ydim); xdr_float(xd,&zero);
|
||||
xdr_float(xd,&xz ); xdr_float(xd,&yz ); xdr_float(xd,&zdim);
|
||||
} else {
|
||||
float zero = 0.0;
|
||||
float xdim = sfactor * (domain->boxhi[0] - domain->boxlo[0]);
|
||||
float ydim = sfactor * (domain->boxhi[1] - domain->boxlo[1]);
|
||||
float zdim = sfactor * (domain->boxhi[2] - domain->boxlo[2]);
|
||||
|
||||
xdr_float(&xd,&xdim); xdr_float(&xd,&zero); xdr_float(&xd,&zero);
|
||||
xdr_float(&xd,&zero); xdr_float(&xd,&ydim); xdr_float(&xd,&zero);
|
||||
xdr_float(&xd,&zero); xdr_float(&xd,&zero); xdr_float(&xd,&zdim);
|
||||
xdr_float(xd,&xdim); xdr_float(xd,&zero); xdr_float(xd,&zero);
|
||||
xdr_float(xd,&zero); xdr_float(xd,&ydim); xdr_float(xd,&zero);
|
||||
xdr_float(xd,&zero); xdr_float(xd,&zero); xdr_float(xd,&zdim);
|
||||
}
|
||||
}
|
||||
|
||||
@ -328,7 +333,7 @@ double DumpXTC::memory_usage()
|
||||
|
||||
void DumpXTC::write_frame()
|
||||
{
|
||||
xdr3dfcoord(&xd,coords,&natoms,&precision);
|
||||
xdr3dfcoord(xd,coords,&natoms,&precision);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@ -406,7 +411,7 @@ static int magicints[] = {
|
||||
|
|
||||
| xdropen - open xdr file
|
||||
|
|
||||
| This versions differs from xdrstdio_create, because I need to know
|
||||
| This version differs from xdrstdio_create, because I need to know
|
||||
| the state of the file (read or write) so I can use xdr3dfcoord
|
||||
| in eigther read or write mode, and the file descriptor
|
||||
| so I can close the file (something xdr_destroy doesn't do).
|
||||
@ -1048,7 +1053,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
|
||||
}
|
||||
if (buf[1] != 0) buf[0]++;
|
||||
xdr_int(xdrs, &(buf[0])); /* buf[0] holds the length in bytes */
|
||||
return errval * (xdr_opaque(xdrs, (caddr_t)&(buf[3]), (u_int)buf[0]));
|
||||
return errval * (xdr_opaque(xdrs, (char *)&(buf[3]), (unsigned int)buf[0]));
|
||||
} else {
|
||||
|
||||
/* xdrs is open for reading */
|
||||
@ -1129,7 +1134,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
|
||||
|
||||
if (xdr_int(xdrs, &(buf[0])) == 0)
|
||||
return 0;
|
||||
if (xdr_opaque(xdrs, (caddr_t)&(buf[3]), (u_int)buf[0]) == 0)
|
||||
if (xdr_opaque(xdrs, (char *)&(buf[3]), (unsigned int)buf[0]) == 0)
|
||||
return 0;
|
||||
buf[0] = buf[1] = buf[2] = 0;
|
||||
|
||||
|
||||
@ -21,8 +21,8 @@ DumpStyle(xtc,DumpXTC);
|
||||
#define LMP_DUMP_XTC_H
|
||||
|
||||
#include "dump.h"
|
||||
#include "xdr_compat.h"
|
||||
|
||||
struct XDR;
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class DumpXTC : public Dump {
|
||||
@ -37,7 +37,7 @@ class DumpXTC : public Dump {
|
||||
float precision; // user-adjustable precision setting
|
||||
float *coords;
|
||||
double sfactor, tfactor; // scaling factors for positions and time unit
|
||||
XDR xd;
|
||||
XDR *xd;
|
||||
|
||||
void init_style() override;
|
||||
int modify_param(int, char **) override;
|
||||
|
||||
@ -1,54 +1,63 @@
|
||||
// clang-format off
|
||||
#include "xdr_compat.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
/* This file is needed for systems, that do not provide XDR support
|
||||
* in their system libraries. It was written for windows, but will
|
||||
* most probably work on other platforms too. better make sure you
|
||||
* test that the xtc files produced are ok before using it.
|
||||
/*
|
||||
* This file contains an implementation of the Sun External Data Representation (XDR)
|
||||
* routines. They have been adapted specifically for the use with the LAMMPS xtc dump
|
||||
* style to produce compressed trajectory files in the Gromacs XTC format.
|
||||
*
|
||||
* It is also needed on BG/L and Cray XT3/XT4 as we don't have
|
||||
* XDR support in the lightweight kernel runtimes either.
|
||||
* The XDR sources are available under the BSD 3-clause license for example in
|
||||
* the MIT Kerberos 5 distribution with the following copyright notice and license.
|
||||
*
|
||||
* This file contains the definitions for Sun External Data
|
||||
* Representation (XDR) headers and routines.
|
||||
* @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC
|
||||
*
|
||||
* Although the rest of LAMPPS is GPL, you can copy and use the XDR
|
||||
* routines in any way you want as long as you obey Sun's license:
|
||||
* Copyright (c) 2010, Oracle America, Inc.
|
||||
*
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
* All rights reserved.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
* * Neither the name of the "Oracle America, Inc." nor the names of
|
||||
* its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
|
||||
#define BYTES_PER_XDR_UNIT (4)
|
||||
|
||||
/*
|
||||
* for unit alignment
|
||||
*/
|
||||
@ -58,19 +67,18 @@ static xdr_uint32_t xdr_swapbytes(xdr_uint32_t x)
|
||||
{
|
||||
xdr_uint32_t y;
|
||||
int i;
|
||||
char *px=(char *)&x;
|
||||
char *py=(char *)&y;
|
||||
char *px = (char *) &x;
|
||||
char *py = (char *) &y;
|
||||
|
||||
for (i=0;i<4;i++)
|
||||
py[i]=px[3-i];
|
||||
for (i = 0; i < 4; i++) py[i] = px[3 - i];
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
static xdr_uint32_t xdr_htonl(xdr_uint32_t x)
|
||||
{
|
||||
short s=0x0F00;
|
||||
if (*((char *)&s)==(char)0x0F) {
|
||||
short s = 0x0F00;
|
||||
if (*((char *) &s) == (char) 0x0F) {
|
||||
/* bigendian, do nothing */
|
||||
return x;
|
||||
} else {
|
||||
@ -81,8 +89,8 @@ static xdr_uint32_t xdr_htonl(xdr_uint32_t x)
|
||||
|
||||
static xdr_uint32_t xdr_ntohl(xdr_uint32_t x)
|
||||
{
|
||||
short s=0x0F00;
|
||||
if (*((char *)&s)==(char)0x0F) {
|
||||
short s = 0x0F00;
|
||||
if (*((char *) &s) == (char) 0x0F) {
|
||||
/* bigendian, do nothing */
|
||||
return x;
|
||||
} else {
|
||||
@ -91,221 +99,39 @@ static xdr_uint32_t xdr_ntohl(xdr_uint32_t x)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Free a data structure using XDR
|
||||
* Not a filter, but a convenient utility nonetheless
|
||||
*/
|
||||
void
|
||||
xdr_free (xdrproc_t proc, char *objp)
|
||||
{
|
||||
XDR x;
|
||||
|
||||
x.x_op = XDR_FREE;
|
||||
(*proc) (&x, objp);
|
||||
}
|
||||
|
||||
/*
|
||||
* XDR nothing
|
||||
*/
|
||||
bool_t
|
||||
xdr_void (void)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* XDR integers
|
||||
*/
|
||||
bool_t
|
||||
xdr_int (XDR *xdrs, int *ip)
|
||||
bool_t xdr_int(XDR *xdrs, int *ip)
|
||||
{
|
||||
xdr_int32_t l;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
switch (xdrs->x_op) {
|
||||
|
||||
case XDR_ENCODE:
|
||||
l = (xdr_int32_t) (*ip);
|
||||
return xdr_putint32 (xdrs, &l);
|
||||
return xdr_putint32(xdrs, &l);
|
||||
break;
|
||||
|
||||
case XDR_DECODE:
|
||||
if (!xdr_getint32 (xdrs, &l))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (!xdr_getint32(xdrs, &l)) return FALSE;
|
||||
*ip = (int) l;
|
||||
return TRUE;
|
||||
break;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XDR unsigned integers
|
||||
*/
|
||||
bool_t
|
||||
xdr_u_int (XDR *xdrs, unsigned int *up)
|
||||
{
|
||||
xdr_uint32_t l;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_ENCODE:
|
||||
l = (xdr_uint32_t) (*up);
|
||||
return xdr_putuint32 (xdrs, &l);
|
||||
|
||||
case XDR_DECODE:
|
||||
if (!xdr_getuint32 (xdrs, &l))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
*up = (unsigned int) l;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* XDR short integers
|
||||
*/
|
||||
bool_t
|
||||
xdr_short (XDR *xdrs, short *sp)
|
||||
{
|
||||
xdr_int32_t l;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_ENCODE:
|
||||
l = (xdr_int32_t) *sp;
|
||||
return xdr_putint32 (xdrs, &l);
|
||||
|
||||
case XDR_DECODE:
|
||||
if (!xdr_getint32 (xdrs, &l))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
*sp = (short) l;
|
||||
return TRUE;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XDR unsigned short integers
|
||||
*/
|
||||
bool_t
|
||||
xdr_u_short (XDR *xdrs, unsigned short *usp)
|
||||
{
|
||||
xdr_uint32_t l;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_ENCODE:
|
||||
l = (xdr_uint32_t) *usp;
|
||||
return xdr_putuint32 (xdrs, &l);
|
||||
|
||||
case XDR_DECODE:
|
||||
if (!xdr_getuint32 (xdrs, &l))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
*usp = (unsigned short) l;
|
||||
return TRUE;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XDR a char
|
||||
*/
|
||||
bool_t
|
||||
xdr_char (XDR *xdrs, char *cp)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = (*cp);
|
||||
if (!xdr_int (xdrs, &i))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
*cp = i;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* XDR an unsigned char
|
||||
*/
|
||||
bool_t
|
||||
xdr_u_char (XDR *xdrs, unsigned char *cp)
|
||||
{
|
||||
unsigned int u;
|
||||
|
||||
u = (*cp);
|
||||
if (!xdr_u_int (xdrs, &u))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
*cp = u;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* XDR booleans
|
||||
*/
|
||||
bool_t
|
||||
xdr_bool (XDR *xdrs, int *bp)
|
||||
{
|
||||
#define XDR_FALSE ((xdr_int32_t) 0)
|
||||
#define XDR_TRUE ((xdr_int32_t) 1)
|
||||
|
||||
xdr_int32_t lb;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_ENCODE:
|
||||
lb = *bp ? XDR_TRUE : XDR_FALSE;
|
||||
return xdr_putint32 (xdrs, &lb);
|
||||
|
||||
case XDR_DECODE:
|
||||
if (!xdr_getint32 (xdrs, &lb))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
*bp = (lb == XDR_FALSE) ? FALSE : TRUE;
|
||||
return TRUE;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
#undef XDR_FALSE
|
||||
#undef XDR_TRUE
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* XDR opaque data
|
||||
* Allows the specification of a fixed size sequence of opaque bytes.
|
||||
* cp points to the opaque object and cnt gives the byte length.
|
||||
*/
|
||||
bool_t
|
||||
xdr_opaque (XDR *xdrs, char *cp, unsigned int cnt)
|
||||
bool_t xdr_opaque(XDR *xdrs, char *cp, unsigned int cnt)
|
||||
{
|
||||
unsigned int rndup;
|
||||
static char crud[BYTES_PER_XDR_UNIT];
|
||||
@ -313,219 +139,61 @@ xdr_opaque (XDR *xdrs, char *cp, unsigned int cnt)
|
||||
/*
|
||||
* if no data we are done
|
||||
*/
|
||||
if (cnt == 0)
|
||||
return TRUE;
|
||||
if (cnt == 0) return TRUE;
|
||||
|
||||
/*
|
||||
* round byte count to full xdr units
|
||||
*/
|
||||
rndup = cnt % BYTES_PER_XDR_UNIT;
|
||||
if (rndup > 0)
|
||||
rndup = BYTES_PER_XDR_UNIT - rndup;
|
||||
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_DECODE:
|
||||
if (!xdr_getbytes (xdrs, cp, cnt))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (rndup == 0)
|
||||
return TRUE;
|
||||
return xdr_getbytes (xdrs, (char *)crud, rndup);
|
||||
|
||||
case XDR_ENCODE:
|
||||
if (!xdr_putbytes (xdrs, cp, cnt))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (rndup == 0)
|
||||
return TRUE;
|
||||
return xdr_putbytes (xdrs, xdr_zero, rndup);
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XDR null terminated ASCII strings
|
||||
* xdr_string deals with "C strings" - arrays of bytes that are
|
||||
* terminated by a nullptr character. The parameter cpp references a
|
||||
* pointer to storage; If the pointer is null, then the necessary
|
||||
* storage is allocated. The last parameter is the max allowed length
|
||||
* of the string as specified by a protocol.
|
||||
*/
|
||||
bool_t
|
||||
xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize)
|
||||
{
|
||||
char *sp = *cpp; /* sp is the actual string pointer */
|
||||
unsigned int size = 0;
|
||||
unsigned int nodesize = 0;
|
||||
|
||||
/*
|
||||
* first deal with the length since xdr strings are counted-strings
|
||||
*/
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_FREE:
|
||||
if (sp == nullptr)
|
||||
{
|
||||
return TRUE; /* already free */
|
||||
}
|
||||
/* fall through... */
|
||||
case XDR_ENCODE:
|
||||
if (sp == nullptr)
|
||||
return FALSE;
|
||||
size = strlen (sp);
|
||||
break;
|
||||
case XDR_DECODE:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!xdr_u_int (xdrs, &size))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if (size > maxsize)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
nodesize = size + 1;
|
||||
|
||||
/*
|
||||
* now deal with the actual bytes
|
||||
*/
|
||||
switch (xdrs->x_op)
|
||||
{
|
||||
case XDR_DECODE:
|
||||
if (nodesize == 0)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
if (sp == nullptr)
|
||||
*cpp = sp = (char *) malloc (nodesize);
|
||||
if (sp == nullptr)
|
||||
{
|
||||
(void) fputs ("xdr_string: out of memory\n", stderr);
|
||||
return FALSE;
|
||||
}
|
||||
sp[size] = 0;
|
||||
/* fall into ... */
|
||||
|
||||
case XDR_ENCODE:
|
||||
return xdr_opaque (xdrs, sp, size);
|
||||
|
||||
case XDR_FREE:
|
||||
free (sp);
|
||||
*cpp = nullptr;
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Floating-point stuff */
|
||||
|
||||
bool_t
|
||||
xdr_float(XDR *xdrs, float *fp)
|
||||
{
|
||||
xdr_int32_t tmp;
|
||||
|
||||
switch (xdrs->x_op) {
|
||||
|
||||
case XDR_ENCODE:
|
||||
tmp = *(xdr_int32_t *)fp;
|
||||
return (xdr_putint32(xdrs, &tmp));
|
||||
|
||||
break;
|
||||
|
||||
case XDR_DECODE:
|
||||
if (xdr_getint32(xdrs, &tmp)) {
|
||||
*(xdr_int32_t *)fp = tmp;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case XDR_FREE:
|
||||
return (TRUE);
|
||||
}
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
bool_t
|
||||
xdr_double(XDR *xdrs, double *dp)
|
||||
{
|
||||
|
||||
/* Windows and some other systems dont define double-precision
|
||||
* word order in the header files, so unfortunately we have
|
||||
* to calculate it!
|
||||
*/
|
||||
static int LSW=-1; /* Least significant fp word */
|
||||
int *ip;
|
||||
xdr_int32_t tmp[2];
|
||||
|
||||
if (LSW<0) {
|
||||
double x=0.987654321; /* Just a number */
|
||||
|
||||
/* Possible representations in IEEE double precision:
|
||||
* (S=small endian, B=big endian)
|
||||
*
|
||||
* Byte order, Word order, Hex
|
||||
* S S b8 56 0e 3c dd 9a ef 3f
|
||||
* B S 3c 0e 56 b8 3f ef 9a dd
|
||||
* S B dd 9a ef 3f b8 56 0e 3c
|
||||
* B B 3f ef 9a dd 3c 0e 56 b8
|
||||
*/
|
||||
|
||||
unsigned char ix = *((char *)&x);
|
||||
|
||||
if (ix==0xdd || ix==0x3f)
|
||||
LSW=1; /* Big endian word order */
|
||||
else if (ix==0xb8 || ix==0x3c)
|
||||
LSW=0; /* Small endian word order */
|
||||
else { /* Catch strange errors */
|
||||
printf("Error when detecting floating-point word order.\n"
|
||||
"Do you have a non-IEEE system?\n"
|
||||
"If possible, use the XDR libraries provided with your system,\n"
|
||||
"instead of the Gromacs fallback XDR source.\n");
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
if (rndup > 0) rndup = BYTES_PER_XDR_UNIT - rndup;
|
||||
|
||||
switch (xdrs->x_op) {
|
||||
|
||||
case XDR_ENCODE:
|
||||
ip = (int *)dp;
|
||||
tmp[0] = ip[!LSW];
|
||||
tmp[1] = ip[LSW];
|
||||
return (xdr_putint32(xdrs, tmp) &&
|
||||
xdr_putint32(xdrs, tmp+1));
|
||||
case XDR_DECODE:
|
||||
if (!xdr_getbytes(xdrs, cp, cnt)) { return FALSE; }
|
||||
if (rndup == 0) return TRUE;
|
||||
return xdr_getbytes(xdrs, (char *) crud, rndup);
|
||||
break;
|
||||
|
||||
break;
|
||||
case XDR_ENCODE:
|
||||
if (!xdr_putbytes(xdrs, cp, cnt)) { return FALSE; }
|
||||
if (rndup == 0) return TRUE;
|
||||
return xdr_putbytes(xdrs, xdr_zero, rndup);
|
||||
break;
|
||||
|
||||
case XDR_DECODE:
|
||||
ip = (int *)dp;
|
||||
if (xdr_getint32(xdrs, tmp+!LSW) &&
|
||||
xdr_getint32(xdrs, tmp+LSW)) {
|
||||
ip[0] = tmp[0];
|
||||
ip[1] = tmp[1];
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case XDR_FREE:
|
||||
return (TRUE);
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
return (FALSE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Floating-point stuff */
|
||||
|
||||
bool_t xdr_float(XDR *xdrs, float *fp)
|
||||
{
|
||||
xdr_int32_t tmp;
|
||||
|
||||
switch (xdrs->x_op) {
|
||||
|
||||
case XDR_ENCODE:
|
||||
tmp = *(xdr_int32_t *) fp;
|
||||
return (xdr_putint32(xdrs, &tmp));
|
||||
break;
|
||||
|
||||
case XDR_DECODE:
|
||||
if (xdr_getint32(xdrs, &tmp)) {
|
||||
*(xdr_int32_t *) fp = tmp;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case XDR_FREE:
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Array routines */
|
||||
|
||||
@ -539,55 +207,37 @@ xdr_double(XDR *xdrs, double *dp)
|
||||
* > elemsize: size of each element
|
||||
* > xdr_elem: routine to XDR each element
|
||||
*/
|
||||
bool_t
|
||||
xdr_vector (XDR *xdrs, char *basep, unsigned int nelem,
|
||||
unsigned int elemsize, xdrproc_t xdr_elem)
|
||||
bool_t xdr_vector(XDR *xdrs, char *basep, unsigned int nelem, unsigned int elemsize,
|
||||
xdrproc_t xdr_elem)
|
||||
{
|
||||
#define LASTUNSIGNED ((unsigned int)0-1)
|
||||
#define LASTUNSIGNED ((unsigned int) 0 - 1)
|
||||
unsigned int i;
|
||||
char *elptr;
|
||||
|
||||
elptr = basep;
|
||||
for (i = 0; i < nelem; i++)
|
||||
{
|
||||
if (!(*xdr_elem) (xdrs, elptr, LASTUNSIGNED))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
elptr += elemsize;
|
||||
}
|
||||
for (i = 0; i < nelem; i++) {
|
||||
if (!(*xdr_elem)(xdrs, elptr, LASTUNSIGNED)) { return FALSE; }
|
||||
elptr += elemsize;
|
||||
}
|
||||
return TRUE;
|
||||
#undef LASTUNSIGNED
|
||||
}
|
||||
|
||||
|
||||
|
||||
static bool_t xdrstdio_getbytes (XDR *, char *, unsigned int);
|
||||
static bool_t xdrstdio_putbytes (XDR *, char *, unsigned int);
|
||||
static unsigned int xdrstdio_getpos (XDR *);
|
||||
static bool_t xdrstdio_setpos (XDR *, unsigned int);
|
||||
static xdr_int32_t *xdrstdio_inline (XDR *, int);
|
||||
static void xdrstdio_destroy (XDR *);
|
||||
static bool_t xdrstdio_getint32 (XDR *, xdr_int32_t *);
|
||||
static bool_t xdrstdio_putint32 (XDR *, xdr_int32_t *);
|
||||
static bool_t xdrstdio_getuint32 (XDR *, xdr_uint32_t *);
|
||||
static bool_t xdrstdio_putuint32 (XDR *, xdr_uint32_t *);
|
||||
static bool_t xdrstdio_getbytes(XDR *, char *, unsigned int);
|
||||
static bool_t xdrstdio_putbytes(XDR *, char *, unsigned int);
|
||||
static void xdrstdio_destroy(XDR *);
|
||||
static bool_t xdrstdio_getint32(XDR *, xdr_int32_t *);
|
||||
static bool_t xdrstdio_putint32(XDR *, xdr_int32_t *);
|
||||
|
||||
/*
|
||||
* Ops vector for stdio type XDR
|
||||
*/
|
||||
static const struct xdr_ops xdrstdio_ops =
|
||||
{
|
||||
xdrstdio_getbytes, /* deserialize counted bytes */
|
||||
xdrstdio_putbytes, /* serialize counted bytes */
|
||||
xdrstdio_getpos, /* get offset in the stream */
|
||||
xdrstdio_setpos, /* set offset in the stream */
|
||||
xdrstdio_inline, /* prime stream for inline macros */
|
||||
xdrstdio_destroy, /* destroy stream */
|
||||
xdrstdio_getint32, /* deserialize a int */
|
||||
xdrstdio_putint32, /* serialize a int */
|
||||
xdrstdio_getuint32, /* deserialize a int */
|
||||
xdrstdio_putuint32 /* serialize a int */
|
||||
static const struct xdr_ops xdrstdio_ops = {
|
||||
xdrstdio_getbytes, /* deserialize counted bytes */
|
||||
xdrstdio_putbytes, /* serialize counted bytes */
|
||||
xdrstdio_destroy, /* destroy stream */
|
||||
xdrstdio_getint32, /* deserialize a int */
|
||||
xdrstdio_putint32, /* serialize a int */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -595,8 +245,7 @@ static const struct xdr_ops xdrstdio_ops =
|
||||
* Sets the xdr stream handle xdrs for use on the stream file.
|
||||
* Operation flag is set to op.
|
||||
*/
|
||||
void
|
||||
xdrstdio_create (XDR *xdrs, FILE *file, enum xdr_op op)
|
||||
void xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op)
|
||||
{
|
||||
xdrs->x_op = op;
|
||||
/* We have to add the const since the `struct xdr_ops' in `struct XDR'
|
||||
@ -611,104 +260,42 @@ xdrstdio_create (XDR *xdrs, FILE *file, enum xdr_op op)
|
||||
* Destroy a stdio xdr stream.
|
||||
* Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create.
|
||||
*/
|
||||
static void
|
||||
xdrstdio_destroy (XDR *xdrs)
|
||||
static void xdrstdio_destroy(XDR *xdrs)
|
||||
{
|
||||
(void) fflush ((FILE *) xdrs->x_private);
|
||||
(void) fflush((FILE *) xdrs->x_private);
|
||||
/* xx should we close the file ?? */
|
||||
}
|
||||
|
||||
|
||||
static bool_t
|
||||
xdrstdio_getbytes (XDR *xdrs, char *addr, unsigned int len)
|
||||
static bool_t xdrstdio_getbytes(XDR *xdrs, char *addr, unsigned int len)
|
||||
{
|
||||
if ((len != 0) && (fread (addr, (int) len, 1,
|
||||
(FILE *) xdrs->x_private) != 1))
|
||||
return FALSE;
|
||||
if ((len != 0) && (fread(addr, (int) len, 1, (FILE *) xdrs->x_private) != 1)) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool_t
|
||||
xdrstdio_putbytes (XDR *xdrs, char *addr, unsigned int len)
|
||||
static bool_t xdrstdio_putbytes(XDR *xdrs, char *addr, unsigned int len)
|
||||
{
|
||||
if ((len != 0) && (fwrite (addr, (int) len, 1,
|
||||
(FILE *) xdrs->x_private) != 1))
|
||||
return FALSE;
|
||||
if ((len != 0) && (fwrite(addr, (int) len, 1, (FILE *) xdrs->x_private) != 1)) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
xdrstdio_getpos (XDR *xdrs)
|
||||
{
|
||||
return (unsigned int) ftell ((FILE *) xdrs->x_private);
|
||||
}
|
||||
|
||||
static bool_t
|
||||
xdrstdio_setpos (XDR *xdrs, unsigned int pos)
|
||||
{
|
||||
return fseek ((FILE *) xdrs->x_private, (xdr_int32_t) pos, 0) < 0 ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
static xdr_int32_t *
|
||||
xdrstdio_inline (XDR * /*xdrs*/, int /*len*/)
|
||||
{
|
||||
/*
|
||||
* Must do some work to implement this: must ensure
|
||||
* enough data in the underlying stdio buffer,
|
||||
* that the buffer is aligned so that we can indirect through a
|
||||
* long *, and stuff this pointer in xdrs->x_buf. Doing
|
||||
* a fread or fwrite to a scratch buffer would defeat
|
||||
* most of the gains to be had here and require storage
|
||||
* management on this buffer, so we don't do this.
|
||||
*/
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static bool_t
|
||||
xdrstdio_getint32 (XDR *xdrs, xdr_int32_t *ip)
|
||||
static bool_t xdrstdio_getint32(XDR *xdrs, xdr_int32_t *ip)
|
||||
{
|
||||
xdr_int32_t mycopy;
|
||||
|
||||
if (fread ((char *) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1)
|
||||
return FALSE;
|
||||
*ip = xdr_ntohl (mycopy);
|
||||
if (fread((char *) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE;
|
||||
*ip = xdr_ntohl(mycopy);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool_t
|
||||
xdrstdio_putint32 (XDR *xdrs, xdr_int32_t *ip)
|
||||
static bool_t xdrstdio_putint32(XDR *xdrs, xdr_int32_t *ip)
|
||||
{
|
||||
xdr_int32_t mycopy = xdr_htonl (*ip);
|
||||
xdr_int32_t mycopy = xdr_htonl(*ip);
|
||||
|
||||
ip = &mycopy;
|
||||
if (fwrite ((char *) ip, 4, 1, (FILE *) xdrs->x_private) != 1)
|
||||
return FALSE;
|
||||
if (fwrite((char *) ip, 4, 1, (FILE *) xdrs->x_private) != 1) return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool_t
|
||||
xdrstdio_getuint32 (XDR *xdrs, xdr_uint32_t *ip)
|
||||
{
|
||||
xdr_uint32_t mycopy;
|
||||
|
||||
if (fread ((char *) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1)
|
||||
return FALSE;
|
||||
*ip = xdr_ntohl (mycopy);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static bool_t
|
||||
xdrstdio_putuint32 (XDR *xdrs, xdr_uint32_t *ip)
|
||||
{
|
||||
xdr_uint32_t mycopy = xdr_htonl (*ip);
|
||||
|
||||
ip = &mycopy;
|
||||
if (fwrite ((char *) ip, 4, 1, (FILE *) xdrs->x_private) != 1)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef LMP_XDR_COMPAT_H
|
||||
#define LMP_XDR_COMPAT_H
|
||||
|
||||
#include <climits>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -9,47 +9,53 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This file is needed for systems, that do not provide XDR support
|
||||
* in their system libraries. It was written for windows, but will
|
||||
* most probably work on other platforms too. better make sure you
|
||||
* test that the xtc files produced are ok before using it.
|
||||
* This file contains the definitions for Sun External Data Representation (XDR).
|
||||
* They have been adapted specifically for the use with the LAMMPS xtc dump style
|
||||
* to produce compressed trajectory files in the Gromacs XTC format.
|
||||
*
|
||||
* It is also needed on BG/L, BG/P and Cray XT3/XT4/XT5 as we don't
|
||||
* have XDR support in the lightweight kernel runtimes either.
|
||||
* The XDR sources are available under the BSD 3-clause license for example in
|
||||
* the MIT Kerberos 5 distribution with the following copyright notice and license.
|
||||
*
|
||||
* This file contains the definitions for Sun External Data
|
||||
* Representation (XDR) headers and routines.
|
||||
* @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC
|
||||
*
|
||||
* Although the rest of LAMPPS is GPL, you can copy and use the XDR
|
||||
* routines in any way you want as long as you obey Sun's license:
|
||||
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
|
||||
* unrestricted use provided that this legend is included on all tape
|
||||
* media and as a part of the software program in whole or part. Users
|
||||
* may copy or modify Sun RPC without charge, but are not authorized
|
||||
* to license or distribute it to anyone else except as part of a product or
|
||||
* program developed by the user.
|
||||
* Copyright (c) 2010, Oracle America, Inc.
|
||||
*
|
||||
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
|
||||
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Sun RPC is provided with no support and without any obligation on the
|
||||
* part of Sun Microsystems, Inc. to assist in its use, correction,
|
||||
* modification or enhancement.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
|
||||
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
|
||||
* OR ANY PART THEREOF.
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
|
||||
* or profits or other special, indirect and consequential damages, even if
|
||||
* Sun has been advised of the possibility of such damages.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* Sun Microsystems, Inc.
|
||||
* 2550 Garcia Avenue
|
||||
* Mountain View, California 94043
|
||||
* * Neither the name of the "Oracle America, Inc." nor the names of
|
||||
* its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* compatibility typedefs */
|
||||
typedef int bool_t;
|
||||
|
||||
typedef int32_t xdr_int32_t;
|
||||
typedef uint32_t xdr_uint32_t;
|
||||
|
||||
/*
|
||||
* Xdr operations. XDR_ENCODE causes the type to be encoded into the
|
||||
* stream. XDR_DECODE causes the type to be extracted from the stream.
|
||||
@ -57,44 +63,8 @@ extern "C" {
|
||||
* XDR_DECODE request.
|
||||
*/
|
||||
|
||||
typedef int bool_t;
|
||||
|
||||
#if defined(_WIN32) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__DragonFly__) || \
|
||||
defined(__OpenBSD__) || defined(__NetBSD__) || (defined(__linux__) && !defined(__GLIBC_MINOR__))
|
||||
typedef char *caddr_t;
|
||||
typedef unsigned int u_int;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Aninteger type that is 32 bits wide. Check if int,
|
||||
* long or short is 32 bits and die if none of them is :-)
|
||||
*/
|
||||
#if (INT_MAX == 2147483647)
|
||||
typedef int xdr_int32_t;
|
||||
typedef unsigned int xdr_uint32_t;
|
||||
#elif (LONG_MAX == 2147483647L)
|
||||
typedef long xdr_int32_t;
|
||||
typedef unsigned long xdr_uint32_t;
|
||||
#elif (SHRT_MAX == 2147483647)
|
||||
typedef short xdr_int32_t;
|
||||
typedef unsigned short xdr_uint32_t;
|
||||
#else
|
||||
#error ERROR: No 32 bit wide integer type found!
|
||||
#endif
|
||||
|
||||
enum xdr_op { XDR_ENCODE = 0, XDR_DECODE = 1, XDR_FREE = 2 };
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE (0)
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE (1)
|
||||
#endif
|
||||
|
||||
#define BYTES_PER_XDR_UNIT (4)
|
||||
/* Macro to round up to units of 4. */
|
||||
#define XDR_RNDUP(x) (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1))
|
||||
|
||||
/*
|
||||
* The XDR handle.
|
||||
* Contains operation which is being applied to the stream,
|
||||
@ -113,26 +83,16 @@ struct XDR {
|
||||
};
|
||||
|
||||
struct xdr_ops {
|
||||
/* get some bytes from XDR stream */
|
||||
bool_t (*x_getbytes)(XDR *__xdrs, char *__addr, unsigned int __len);
|
||||
/* get some bytes from " */
|
||||
/* put some bytes to XDR stream */
|
||||
bool_t (*x_putbytes)(XDR *__xdrs, char *__addr, unsigned int __len);
|
||||
/* put some bytes to " */
|
||||
unsigned int (*x_getpostn)(XDR *__xdrs);
|
||||
/* returns bytes off from beginning */
|
||||
bool_t (*x_setpostn)(XDR *__xdrs, unsigned int __pos);
|
||||
/* lets you reposition the stream */
|
||||
xdr_int32_t *(*x_inline)(XDR *__xdrs, int __len);
|
||||
/* buf quick ptr to buffered data */
|
||||
void (*x_destroy)(XDR *__xdrs);
|
||||
/* free privates of this xdr_stream */
|
||||
void (*x_destroy)(XDR *__xdrs);
|
||||
/* get a int from XDR stream */
|
||||
bool_t (*x_getint32)(XDR *__xdrs, xdr_int32_t *__ip);
|
||||
/* get a int from underlying stream */
|
||||
/* put a int to XDR stream */
|
||||
bool_t (*x_putint32)(XDR *__xdrs, xdr_int32_t *__ip);
|
||||
/* put a int to " */
|
||||
bool_t (*x_getuint32)(XDR *__xdrs, xdr_uint32_t *__ip);
|
||||
/* get a unsigned int from underlying stream */
|
||||
bool_t (*x_putuint32)(XDR *__xdrs, xdr_uint32_t *__ip);
|
||||
/* put a int to " */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -151,53 +111,25 @@ typedef bool_t (*xdrproc_t)(XDR *, void *, ...);
|
||||
*
|
||||
* XDR *xdrs;
|
||||
* xdr_int32_t *int32p;
|
||||
* long *longp;
|
||||
* char *addr;
|
||||
* unsigned int len;
|
||||
* unsigned int pos;
|
||||
*/
|
||||
|
||||
#define xdr_getint32(xdrs, int32p) (*(xdrs)->x_ops->x_getint32)(xdrs, int32p)
|
||||
|
||||
#define xdr_putint32(xdrs, int32p) (*(xdrs)->x_ops->x_putint32)(xdrs, int32p)
|
||||
|
||||
#define xdr_getuint32(xdrs, uint32p) (*(xdrs)->x_ops->x_getuint32)(xdrs, uint32p)
|
||||
|
||||
#define xdr_putuint32(xdrs, uint32p) (*(xdrs)->x_ops->x_putuint32)(xdrs, uint32p)
|
||||
|
||||
#define xdr_getbytes(xdrs, addr, len) (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
|
||||
|
||||
#define xdr_putbytes(xdrs, addr, len) (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
|
||||
|
||||
#define xdr_getpos(xdrs) (*(xdrs)->x_ops->x_getpostn)(xdrs)
|
||||
|
||||
#define xdr_setpos(xdrs, pos) (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
|
||||
|
||||
#define xdr_inline(xdrs, len) (*(xdrs)->x_ops->x_inline)(xdrs, len)
|
||||
|
||||
#define xdr_destroy(xdrs) \
|
||||
do { \
|
||||
if ((xdrs)->x_ops->x_destroy) (*(xdrs)->x_ops->x_destroy)(xdrs); \
|
||||
} while (0)
|
||||
|
||||
extern bool_t xdr_int(XDR *__xdrs, int *__ip);
|
||||
extern bool_t xdr_u_int(XDR *__xdrs, unsigned int *__ip);
|
||||
extern bool_t xdr_short(XDR *__xdrs, short *__ip);
|
||||
extern bool_t xdr_u_short(XDR *__xdrs, unsigned short *__ip);
|
||||
extern bool_t xdr_bool(XDR *__xdrs, int *__bp);
|
||||
extern bool_t xdr_opaque(XDR *__xdrs, char *__cp, unsigned int __cnt);
|
||||
extern bool_t xdr_string(XDR *__xdrs, char **__cpp, unsigned int __maxsize);
|
||||
extern bool_t xdr_char(XDR *__xdrs, char *__cp);
|
||||
extern bool_t xdr_u_char(XDR *__xdrs, unsigned char *__cp);
|
||||
extern bool_t xdr_vector(XDR *__xdrs, char *__basep, unsigned int __nelem, unsigned int __elemsize,
|
||||
xdrproc_t __xdr_elem);
|
||||
extern bool_t xdr_float(XDR *__xdrs, float *__fp);
|
||||
extern bool_t xdr_double(XDR *__xdrs, double *__dp);
|
||||
extern void xdrstdio_create(XDR *__xdrs, FILE *__file, enum xdr_op __xop);
|
||||
|
||||
/* free memory buffers for xdr */
|
||||
extern void xdr_free(xdrproc_t __proc, char *__objp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -701,7 +701,7 @@ void FixPour::pre_exchange()
|
||||
// rebuild atom map
|
||||
|
||||
if (atom->map_style != Atom::MAP_NONE) {
|
||||
if (success) atom->map_init();
|
||||
atom->map_init();
|
||||
atom->map_set();
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "neighbor.h"
|
||||
#include "respa.h"
|
||||
#include "update.h"
|
||||
|
||||
#include <cmath>
|
||||
@ -339,8 +340,13 @@ void FixNHIntel::reset_dt()
|
||||
|
||||
// If using respa, then remap is performed in innermost level
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^respa"))
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
auto respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
if (!respa_ptr) error->all(FLERR, "Failure to access Respa style {}", update->integrate_style);
|
||||
nlevels_respa = respa_ptr->nlevels;
|
||||
step_respa = respa_ptr->step;
|
||||
dto = 0.5*step_respa[0];
|
||||
}
|
||||
|
||||
if (pstat_flag)
|
||||
pdrag_factor = 1.0 - (update->dt * p_freq_max * drag / nc_pchain);
|
||||
|
||||
@ -123,7 +123,9 @@ struct vector_ops<double, KNC> {
|
||||
static fvec recip(const fvec &a) { return _mm512_recip_pd(a); }
|
||||
template<int scale>
|
||||
static void gather_prefetch_t0(const ivec &idx, bvec mask, const void *base) {
|
||||
#ifdef __AVX512PF__
|
||||
_mm512_mask_prefetch_i32gather_ps(idx, mask, base, scale, _MM_HINT_T0);
|
||||
#endif
|
||||
}
|
||||
template<int scale>
|
||||
static fvec gather(const fvec &from, bvec mask, const ivec &idx, const void *base) {
|
||||
@ -262,7 +264,9 @@ struct vector_ops<float, KNC> {
|
||||
static fvec recip(const fvec &a) { return _mm512_recip_ps(a); }
|
||||
template<int scale>
|
||||
static void gather_prefetch_t0(const ivec &idx, bvec mask, const void *base) {
|
||||
#ifdef __AVX512PF__
|
||||
_mm512_mask_prefetch_i32gather_ps(idx, mask, base, scale, _MM_HINT_T0);
|
||||
#endif
|
||||
}
|
||||
template<int scale>
|
||||
static fvec gather(const fvec &from, bvec mask, const ivec &idx, const void *base) {
|
||||
|
||||
@ -639,8 +639,10 @@ public:
|
||||
AVEC_BINOP(-, sub)
|
||||
|
||||
VEC_INLINE static void gather_prefetch0(const IVEC_NAME &a, void * mem) {
|
||||
#ifdef __AVX512PF__
|
||||
_mm512_mask_prefetch_i32gather_ps(a.val_, BVEC_NAME::full().val_, mem,
|
||||
sizeof(FVEC_SCAL_T), _MM_HINT_T0);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
@ -697,8 +699,10 @@ public:
|
||||
AVEC2_BINOP(-, sub)
|
||||
|
||||
VEC_INLINE static void gather_prefetch0(const IVEC_NAME &a, void * mem) {
|
||||
#ifdef __AVX512PF__
|
||||
_mm512_mask_prefetch_i32gather_ps(a.val_, BVEC_NAME::full().val_, mem,
|
||||
sizeof(double), _MM_HINT_T0);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -142,28 +142,6 @@ class AtomVecKokkos : virtual public AtomVec {
|
||||
public:
|
||||
|
||||
#ifdef LMP_KOKKOS_GPU
|
||||
template<class ViewType>
|
||||
Kokkos::View<typename ViewType::data_type,
|
||||
typename ViewType::array_layout,
|
||||
LMPPinnedHostType,
|
||||
Kokkos::MemoryTraits<Kokkos::Unmanaged> >
|
||||
create_async_copy(const ViewType& src) {
|
||||
typedef Kokkos::View<typename ViewType::data_type,
|
||||
typename ViewType::array_layout,
|
||||
typename std::conditional<
|
||||
std::is_same<typename ViewType::execution_space,LMPDeviceType>::value,
|
||||
LMPPinnedHostType,typename ViewType::memory_space>::type,
|
||||
Kokkos::MemoryTraits<Kokkos::Unmanaged> > mirror_type;
|
||||
if (buffer_size == 0) {
|
||||
buffer = Kokkos::kokkos_malloc<LMPPinnedHostType>(src.span());
|
||||
buffer_size = src.span();
|
||||
} else if (buffer_size < src.span()) {
|
||||
buffer = Kokkos::kokkos_realloc<LMPPinnedHostType>(buffer,src.span());
|
||||
buffer_size = src.span();
|
||||
}
|
||||
return mirror_type(buffer, src.d_view.layout());
|
||||
}
|
||||
|
||||
template<class ViewType>
|
||||
void perform_async_copy(ViewType& src, unsigned int space) {
|
||||
typedef Kokkos::View<typename ViewType::data_type,
|
||||
@ -173,11 +151,11 @@ class AtomVecKokkos : virtual public AtomVec {
|
||||
LMPPinnedHostType,typename ViewType::memory_space>::type,
|
||||
Kokkos::MemoryTraits<Kokkos::Unmanaged> > mirror_type;
|
||||
if (buffer_size == 0) {
|
||||
buffer = Kokkos::kokkos_malloc<LMPPinnedHostType>(src.span()*sizeof(typename ViewType::value_type));
|
||||
buffer_size = src.span();
|
||||
} else if (buffer_size < src.span()) {
|
||||
buffer = Kokkos::kokkos_realloc<LMPPinnedHostType>(buffer,src.span()*sizeof(typename ViewType::value_type));
|
||||
buffer_size = src.span();
|
||||
buffer_size = src.span() * sizeof(typename ViewType::value_type);
|
||||
buffer = Kokkos::kokkos_malloc<LMPPinnedHostType>(buffer_size);
|
||||
} else if (buffer_size < (src.span() * sizeof(typename ViewType::value_type))) {
|
||||
buffer_size = src.span() * sizeof(typename ViewType::value_type);
|
||||
buffer = Kokkos::kokkos_realloc<LMPPinnedHostType>(buffer, buffer_size);
|
||||
}
|
||||
mirror_type tmp_view((typename ViewType::value_type*)buffer, src.d_view.layout());
|
||||
|
||||
|
||||
@ -22,8 +22,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define BIG 1.0e20
|
||||
#define SMALL 1.0e-4
|
||||
static constexpr double BIG = 1.0e20;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -81,6 +80,11 @@ public:
|
||||
void DomainKokkos::reset_box()
|
||||
{
|
||||
// perform shrink-wrapping
|
||||
|
||||
// nothing to do for empty systems
|
||||
|
||||
if (atom->natoms == 0) return;
|
||||
|
||||
// compute extent of atoms on this proc
|
||||
// for triclinic, this is done in lamda space
|
||||
|
||||
|
||||
@ -220,9 +220,11 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
// Flags for fix references (i.e. quantities accessible via f_ID[n]
|
||||
vector_flag = 1;
|
||||
extvector = 0;
|
||||
size_vector = 5;
|
||||
|
||||
scalar_flag = 1;
|
||||
extscalar = 0;
|
||||
|
||||
int iarg = 6;
|
||||
while (iarg < narg) {
|
||||
|
||||
@ -25,13 +25,14 @@
|
||||
|
||||
#include "compute_smd_vol.h"
|
||||
|
||||
#include <cstring>
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "modify.h"
|
||||
#include "comm.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "update.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -39,12 +40,12 @@ using namespace LAMMPS_NS;
|
||||
|
||||
ComputeSMDVol::ComputeSMDVol(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg) {
|
||||
if (narg != 3)
|
||||
error->all(FLERR, "Illegal compute smd/volume command");
|
||||
if (narg != 3) error->all(FLERR, "Illegal compute smd/volume command");
|
||||
if (atom->vfrac_flag != 1)
|
||||
error->all(FLERR, "compute smd/volume command requires atom_style with density (e.g. smd)");
|
||||
error->all(FLERR, "compute smd/volume command requires atom_style with density (e.g. smd)");
|
||||
|
||||
scalar_flag = 1;
|
||||
extscalar = 1;
|
||||
peratom_flag = 1;
|
||||
size_peratom_cols = 0;
|
||||
|
||||
|
||||
@ -24,15 +24,18 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_smd_integrate_tlsph.h"
|
||||
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "pair.h"
|
||||
#include "update.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <Eigen/Eigen>
|
||||
#include "atom.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "error.h"
|
||||
#include "pair.h"
|
||||
#include "comm.h"
|
||||
|
||||
using namespace Eigen;
|
||||
using namespace LAMMPS_NS;
|
||||
@ -115,6 +118,11 @@ void FixSMDIntegrateTlsph::init() {
|
||||
dtv = update->dt;
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
vlimitsq = vlimit * vlimit;
|
||||
|
||||
// Cannot use vremap since its effects aren't propagated to vest
|
||||
// see RHEO or SPH packages for examples of patches
|
||||
if (domain->deform_vremap)
|
||||
error->all(FLERR, "Fix smd/integrate_tlsph cannot be used with velocity remapping");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -24,15 +24,18 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_smd_integrate_ulsph.h"
|
||||
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "pair.h"
|
||||
#include "update.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <Eigen/Eigen>
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "error.h"
|
||||
#include "pair.h"
|
||||
|
||||
using namespace Eigen;
|
||||
using namespace LAMMPS_NS;
|
||||
@ -144,6 +147,11 @@ void FixSMDIntegrateUlsph::init() {
|
||||
dtv = update->dt;
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
vlimitsq = vlimit * vlimit;
|
||||
|
||||
// Cannot use vremap since its effects aren't propagated to vest
|
||||
// see RHEO or SPH packages for examples of patches
|
||||
if (domain->deform_vremap)
|
||||
error->all(FLERR, "Fix smd/integrate_ulsph cannot be used with velocity remapping");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -408,15 +408,15 @@ void FixBondCreate::post_integrate()
|
||||
int *mask = atom->mask;
|
||||
int *type = atom->type;
|
||||
|
||||
if (constrainflag) {
|
||||
// communicate partner and 1-2 special neighbors
|
||||
// to correctly handle angle constraints
|
||||
// communicate partner and 1-2 special neighbors
|
||||
// to correctly handle angle constraints
|
||||
|
||||
if (constrainflag) {
|
||||
commflag = 3;
|
||||
comm->forward_comm(this);
|
||||
}
|
||||
|
||||
neighbor->build_one(list,1);
|
||||
neighbor->build_one(list);
|
||||
inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
numneigh = list->numneigh;
|
||||
|
||||
@ -229,7 +229,7 @@ void FixBondSwap::post_integrate()
|
||||
type = atom->type;
|
||||
x = atom->x;
|
||||
|
||||
neighbor->build_one(list,1);
|
||||
neighbor->build_one(list);
|
||||
inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
numneigh = list->numneigh;
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
|
||||
constexpr int maxelt = 5;
|
||||
constexpr int maxelt = 8;
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
class Memory;
|
||||
|
||||
@ -550,14 +550,14 @@ void PairMEAM::read_user_meam_file(const std::string &userfile)
|
||||
|
||||
std::shared_ptr<PotentialFileReader> reader;
|
||||
|
||||
if (comm->me == 0) { reader = std::make_shared<PotentialFileReader>(lmp, userfile, "MEAM"); }
|
||||
if (comm->me == 0) reader = std::make_shared<PotentialFileReader>(lmp, userfile, "MEAM");
|
||||
|
||||
// read settings
|
||||
// pass them one at a time to MEAM package
|
||||
// match strings to list of corresponding ints
|
||||
char *line = nullptr;
|
||||
char buffer[MAXLINE];
|
||||
|
||||
int lineno = 0;
|
||||
while (true) {
|
||||
int which;
|
||||
int nindex, index[3];
|
||||
@ -565,6 +565,7 @@ void PairMEAM::read_user_meam_file(const std::string &userfile)
|
||||
int nline;
|
||||
if (comm->me == 0) {
|
||||
line = reader->next_line();
|
||||
++lineno;
|
||||
if (line == nullptr) {
|
||||
nline = -1;
|
||||
} else
|
||||
@ -584,20 +585,32 @@ void PairMEAM::read_user_meam_file(const std::string &userfile)
|
||||
for (which = 0; which < nkeywords; which++)
|
||||
if (keyword == keywords[which]) break;
|
||||
if (which == nkeywords)
|
||||
error->all(FLERR, "Keyword {} in MEAM parameter file not recognized", keyword);
|
||||
error->all(FLERR, "Keyword {} in MEAM parameter file {}:{} not recognized", keyword,
|
||||
userfile, lineno);
|
||||
|
||||
nindex = nparams - 2;
|
||||
for (int i = 0; i < nindex; i++) index[i] = values.next_int() - 1;
|
||||
try {
|
||||
nindex = nparams - 2;
|
||||
for (int i = 0; i < nindex; i++) index[i] = values.next_int() - 1;
|
||||
} catch (std::exception &e) {
|
||||
error->all(FLERR, "Error parsing MEAM parameter file {}:{}: {}", userfile, lineno, e.what());
|
||||
}
|
||||
|
||||
// map lattce_meam value to an integer
|
||||
if (which == 4) {
|
||||
std::string lattice_type = values.next_string();
|
||||
lattice_t latt;
|
||||
if (!MEAM::str_to_lat(lattice_type, false, latt))
|
||||
error->all(FLERR, "Unrecognized lattice type in MEAM parameter file: {}", lattice_type);
|
||||
error->all(FLERR, "Unrecognized lattice type {} in MEAM parameter file {}:{}",
|
||||
lattice_type, userfile, lineno);
|
||||
value = latt;
|
||||
} else
|
||||
value = values.next_double();
|
||||
} else {
|
||||
try {
|
||||
value = values.next_double();
|
||||
} catch (std::exception &e) {
|
||||
error->all(FLERR, "Error parsing MEAM parameter file {}:{}: {}", userfile, lineno,
|
||||
e.what());
|
||||
}
|
||||
}
|
||||
|
||||
// pass single setting to MEAM package
|
||||
|
||||
@ -607,7 +620,8 @@ void PairMEAM::read_user_meam_file(const std::string &userfile)
|
||||
const char *descr[] = {"has an unknown error", "is out of range (please report a bug)",
|
||||
"expected more indices", "has out of range element index"};
|
||||
if ((errorflag < 0) || (errorflag > 3)) errorflag = 0;
|
||||
error->all(FLERR, "Error in MEAM parameter file: keyword {} {}", keyword, descr[errorflag]);
|
||||
error->all(FLERR, "Error in MEAM parameter file {}:{}: keyword {} {}", userfile, lineno,
|
||||
keyword, descr[errorflag]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,6 +48,7 @@ using namespace FixConst;
|
||||
#ifndef _WIN32
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
@ -78,7 +79,7 @@ static void open_socket(int &sockfd, int inet, int port, char *host, Error *erro
|
||||
error: pointer to a LAMMPS Error object
|
||||
*/
|
||||
{
|
||||
int ai_err;
|
||||
int ai_err,flagNagle;
|
||||
|
||||
#ifdef _WIN32
|
||||
error->one(FLERR, "i-PI socket implementation requires UNIX environment");
|
||||
@ -100,6 +101,11 @@ static void open_socket(int &sockfd, int inet, int port, char *host, Error *erro
|
||||
sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
||||
if (sockfd < 0) error->one(FLERR, "Error creating socket for fix ipi");
|
||||
|
||||
// set TCP_NODELAY=1 to disable Nagle's algorithm as it slows down the small transactions for i-PI
|
||||
flagNagle = 1;
|
||||
int result_TCP = setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char *)&flagNagle, sizeof(int));
|
||||
if (result_TCP < 0) { perror("Error setting TCP_NODELAY"); }
|
||||
|
||||
// makes connection
|
||||
if (connect(sockfd, res->ai_addr, res->ai_addrlen) < 0)
|
||||
error->one(FLERR, "Error opening INET socket: wrong port or server unreachable");
|
||||
@ -182,6 +188,7 @@ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), irregul
|
||||
master = (comm->me == 0) ? 1 : 0;
|
||||
inet = 1;
|
||||
reset_flag = 0;
|
||||
firsttime = 1;
|
||||
|
||||
int iarg = 5;
|
||||
while (iarg < narg) {
|
||||
@ -247,6 +254,7 @@ void FixIPI::init()
|
||||
ipisock = 0;
|
||||
// TODO: should check for success in socket opening,
|
||||
// but the current open_socket routine dies brutally if unsuccessful
|
||||
|
||||
// tell lammps we have assigned a socket
|
||||
socketflag = 1;
|
||||
|
||||
@ -363,17 +371,40 @@ void FixIPI::initial_integrate(int /*vflag*/)
|
||||
// has to be be done before invoking Irregular::migrate_atoms()
|
||||
// since it requires atoms be inside simulation box
|
||||
|
||||
// folds atomic coordinates close to the origin
|
||||
if (domain->triclinic) domain->x2lamda(atom->nlocal);
|
||||
domain->pbc();
|
||||
domain->reset_box();
|
||||
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
||||
|
||||
// move atoms to new processors via irregular()
|
||||
// only needed if migrate_check() says an atom moves to far
|
||||
if (domain->triclinic) domain->x2lamda(atom->nlocal);
|
||||
if (irregular->migrate_check()) irregular->migrate_atoms();
|
||||
if (domain->triclinic) domain->lamda2x(atom->nlocal);
|
||||
|
||||
// ensures continuity of trajectories relative to the
|
||||
// snapshot at neighbor list creation, minimizing the
|
||||
// number of neighbor list updates
|
||||
auto xhold = neighbor->get_xhold();
|
||||
if (xhold != NULL && !firsttime) {
|
||||
// don't wrap if xhold is not used in the NL, or the
|
||||
// first call (because the NL is initialized from the
|
||||
// data file that might have nothing to do with the
|
||||
// current structure
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
auto delx = x[i][0] - xhold[i][0];
|
||||
auto dely = x[i][1] - xhold[i][1];
|
||||
auto delz = x[i][2] - xhold[i][2];
|
||||
|
||||
domain->minimum_image(delx, dely, delz);
|
||||
|
||||
x[i][0] = xhold[i][0] + delx;
|
||||
x[i][1] = xhold[i][1] + dely;
|
||||
x[i][2] = xhold[i][2] + delz;
|
||||
}
|
||||
}
|
||||
}
|
||||
firsttime = 0;
|
||||
|
||||
// check if kspace solver is used
|
||||
if (reset_flag && kspace_flag) {
|
||||
// reset kspace, pair, angles, ... b/c simulation box might have changed.
|
||||
@ -452,6 +483,7 @@ void FixIPI::final_integrate()
|
||||
retstr[0]=0;
|
||||
|
||||
if (master) {
|
||||
// check for new messages
|
||||
while (true) {
|
||||
readbuffer(ipisock, header, MSGLEN, error); header[MSGLEN]=0;
|
||||
|
||||
@ -464,6 +496,7 @@ void FixIPI::final_integrate()
|
||||
error->one(FLERR, "Got EXIT message from i-PI. Now leaving!");
|
||||
|
||||
if (strcmp(header,"GETFORCE ") == 0) {
|
||||
// return force and energy data
|
||||
writebuffer(ipisock,"FORCEREADY ",MSGLEN, error);
|
||||
writebuffer(ipisock,(char*) &pot,8, error);
|
||||
writebuffer(ipisock,(char*) &nat,4, error);
|
||||
@ -478,5 +511,3 @@ void FixIPI::final_integrate()
|
||||
|
||||
hasdata=0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ class FixIPI : public Fix {
|
||||
long bsize;
|
||||
int kspace_flag;
|
||||
int reset_flag;
|
||||
int firsttime;
|
||||
|
||||
private:
|
||||
class Irregular *irregular;
|
||||
|
||||
@ -167,6 +167,10 @@ void FixOMP::init()
|
||||
// adjust number of data objects when the number of OpenMP
|
||||
// threads has been changed somehow
|
||||
const int nthreads = comm->nthreads;
|
||||
#if defined(_OPENMP)
|
||||
// make certain threads are initialized correctly. avoids segfaults with LAMMPS-GUI
|
||||
if (nthreads != omp_get_max_threads()) omp_set_num_threads(nthreads);
|
||||
#endif
|
||||
if (_nthr != nthreads) {
|
||||
if (comm->me == 0)
|
||||
utils::logmesg(lmp,"Re-init OPENMP for {} OpenMP thread(s)\n", nthreads);
|
||||
@ -226,7 +230,8 @@ void FixOMP::init()
|
||||
check_hybrid = 0; \
|
||||
if (force->name) { \
|
||||
if ( (strcmp(force->name ## _style,"hybrid") == 0) || \
|
||||
(strcmp(force->name ## _style,"hybrid/overlay") == 0) ) \
|
||||
(strcmp(force->name ## _style,"hybrid/overlay") == 0) || \
|
||||
(strcmp(force->name ## _style,"hybrid/scaled") == 0) ) \
|
||||
check_hybrid=1; \
|
||||
if (force->name->suffix_flag & Suffix::OMP) { \
|
||||
last_force_name = (const char *) #name; \
|
||||
|
||||
@ -155,7 +155,7 @@ namespace ReaxFF {
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
static void Validate_ListsOMP(reax_system *system, reax_list **lists,
|
||||
int step, int n, int N, int numH)
|
||||
int step, int N, int numH)
|
||||
{
|
||||
int comp, Hindex;
|
||||
reax_list *bonds, *hbonds;
|
||||
@ -195,7 +195,7 @@ namespace ReaxFF {
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp for schedule(guided)
|
||||
#endif
|
||||
for (int i = 0; i < n; ++i) {
|
||||
for (int i = 0; i < N; ++i) {
|
||||
Hindex = system->my_atoms[i].Hindex;
|
||||
if (Hindex > -1) {
|
||||
system->my_atoms[i].num_hbonds =
|
||||
@ -457,8 +457,7 @@ namespace ReaxFF {
|
||||
workspace->realloc.num_bonds = num_bonds;
|
||||
workspace->realloc.num_hbonds = num_hbonds;
|
||||
|
||||
Validate_ListsOMP(system, lists, data->step,
|
||||
system->n, system->N, system->numH);
|
||||
Validate_ListsOMP(system, lists, data->step, system->N, system->numH);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -77,9 +77,9 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
int api_version=0;
|
||||
p->cmd("getApiVersion",&api_version);
|
||||
if ((api_version < 5) || (api_version > 9))
|
||||
if ((api_version < 5) || (api_version > 10))
|
||||
error->all(FLERR,"Incompatible API version for PLUMED in fix plumed. "
|
||||
"Only Plumed 2.4.x, 2.5.x, 2.6.x, 2.7.x, 2.8.x are tested and supported.");
|
||||
"Only Plumed 2.4.x, 2.5.x, 2.6.x, 2.7.x, 2.8.x, 2.9.x are tested and supported.");
|
||||
|
||||
#if !defined(MPI_STUBS)
|
||||
// If the -partition option is activated then enable
|
||||
|
||||
@ -105,6 +105,13 @@ void FixPythonInvoke::end_of_step()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixPythonInvoke::setup(int vflag)
|
||||
{
|
||||
if (selected_callback == POST_FORCE) post_force(vflag);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixPythonInvoke::post_force(int vflag)
|
||||
{
|
||||
if (update->ntimestep % nevery != 0) return;
|
||||
|
||||
@ -30,6 +30,7 @@ class FixPythonInvoke : public Fix {
|
||||
FixPythonInvoke(class LAMMPS *, int, char **);
|
||||
~FixPythonInvoke() override;
|
||||
int setmask() override;
|
||||
void setup(int) override;
|
||||
void end_of_step() override;
|
||||
void post_force(int) override;
|
||||
|
||||
|
||||
@ -55,29 +55,53 @@ void FixQEqShielded::init()
|
||||
|
||||
neighbor->add_request(this, NeighConst::REQ_FULL);
|
||||
|
||||
int ntypes = atom->ntypes;
|
||||
const int ntypes = atom->ntypes;
|
||||
memory->create(shld, ntypes + 1, ntypes + 1, "qeq:shielding");
|
||||
|
||||
init_shielding();
|
||||
|
||||
int i;
|
||||
for (i = 1; i <= ntypes; i++) {
|
||||
if (gamma[i] == 0.0) error->all(FLERR, "Invalid param file for fix qeq/shielded");
|
||||
// check if valid parameters for all atom types in the fix group are provided
|
||||
const int *type = atom->type;
|
||||
const int *mask = atom->mask;
|
||||
int tmp = 0, tmp_all = 0;
|
||||
for (int i = 0; i < nlocal; ++i) {
|
||||
if (mask[i] & groupbit) {
|
||||
if (gamma[type[i]] == 0.0)
|
||||
tmp = type[i];
|
||||
}
|
||||
}
|
||||
MPI_Allreduce(&tmp, &tmp_all, 1, MPI_INT, MPI_MAX, world);
|
||||
if (tmp_all)
|
||||
error->all(FLERR, "Invalid QEq parameters for atom type {} provided", tmp_all);
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixQEqShielded::extract_reax()
|
||||
{
|
||||
const int nlocal = atom->nlocal;
|
||||
const int *mask = atom->mask;
|
||||
const int *type = atom->type;
|
||||
|
||||
Pair *pair = force->pair_match("^reax..", 0);
|
||||
if (pair == nullptr) error->all(FLERR, "No pair reaxff for fix qeq/shielded");
|
||||
int tmp;
|
||||
int tmp, tmp_all;
|
||||
chi = (double *) pair->extract("chi", tmp);
|
||||
eta = (double *) pair->extract("eta", tmp);
|
||||
gamma = (double *) pair->extract("gamma", tmp);
|
||||
if (chi == nullptr || eta == nullptr || gamma == nullptr)
|
||||
error->all(FLERR, "Fix qeq/shielded could not extract params from pair reaxff");
|
||||
if ((chi == nullptr) || (eta == nullptr) || (gamma == nullptr))
|
||||
error->all(FLERR, "Fix qeq/shielded could not extract all QEq parameters from pair reaxff");
|
||||
|
||||
tmp = tmp_all = 0;
|
||||
for (int i = 0; i < nlocal; ++i) {
|
||||
if (mask[i] & groupbit) {
|
||||
if ((chi[type[i]] == 0.0) && (eta[type[i]] == 0.0) && (gamma[type[i]] == 0.0))
|
||||
tmp = type[i];
|
||||
}
|
||||
}
|
||||
MPI_Allreduce(&tmp, &tmp_all, 1, MPI_INT, MPI_MAX, world);
|
||||
if (tmp_all)
|
||||
error->all(FLERR, "No QEq parameters for atom type {} provided by pair reaxff", tmp_all);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
|
||||
@ -919,7 +919,7 @@ void FixBondReact::post_integrate()
|
||||
tagint *tag = atom->tag;
|
||||
int *type = atom->type;
|
||||
|
||||
neighbor->build_one(list,1);
|
||||
neighbor->build_one(list);
|
||||
|
||||
// here we define a full special list
|
||||
// may need correction for unusual special bond settings
|
||||
|
||||
@ -205,24 +205,42 @@ int FixQEqReaxFF::setmask()
|
||||
|
||||
void FixQEqReaxFF::pertype_parameters(char *arg)
|
||||
{
|
||||
const int nlocal = atom->nlocal;
|
||||
const int *mask = atom->mask;
|
||||
const int *type = atom->type;
|
||||
|
||||
// match either new keyword "reaxff" or old keyword "reax/c"
|
||||
if (utils::strmatch(arg,"^reax..$")) {
|
||||
reaxflag = 1;
|
||||
Pair *pair = force->pair_match("^reax..",0);
|
||||
if (!pair) error->all(FLERR,"No reaxff pair style for fix qeq/reaxff");
|
||||
|
||||
int tmp;
|
||||
int tmp, tmp_all;
|
||||
chi = (double *) pair->extract("chi",tmp);
|
||||
eta = (double *) pair->extract("eta",tmp);
|
||||
gamma = (double *) pair->extract("gamma",tmp);
|
||||
if (chi == nullptr || eta == nullptr || gamma == nullptr)
|
||||
error->all(FLERR, "Fix qeq/reaxff could not extract params from pair reaxff");
|
||||
if ((chi == nullptr) || (eta == nullptr) || (gamma == nullptr))
|
||||
error->all(FLERR, "Fix qeq/reaxff could not extract all QEq parameters from pair reaxff");
|
||||
tmp = tmp_all = 0;
|
||||
for (int i = 0; i < nlocal; ++i) {
|
||||
if (mask[i] & groupbit) {
|
||||
if ((chi[type[i]] == 0.0) && (eta[type[i]] == 0.0) && (gamma[type[i]] == 0.0))
|
||||
tmp = type[i];
|
||||
}
|
||||
}
|
||||
MPI_Allreduce(&tmp, &tmp_all, 1, MPI_INT, MPI_MAX, world);
|
||||
if (tmp_all)
|
||||
error->all(FLERR, "No QEq parameters for atom type {} provided by pair reaxff", tmp_all);
|
||||
return;
|
||||
} else if (platform::file_is_readable(arg)) {
|
||||
; // arg is readable file. will read below
|
||||
} else {
|
||||
error->all(FLERR, "Unknown fix qeq/reaxff keyword {}", arg);
|
||||
}
|
||||
|
||||
reaxflag = 0;
|
||||
const int ntypes = atom->ntypes;
|
||||
|
||||
const int ntypes = atom->ntypes;
|
||||
memory->create(chi,ntypes+1,"qeq/reaxff:chi");
|
||||
memory->create(eta,ntypes+1,"qeq/reaxff:eta");
|
||||
memory->create(gamma,ntypes+1,"qeq/reaxff:gamma");
|
||||
|
||||
@ -44,6 +44,7 @@ FixReaxFFBonds::FixReaxFFBonds(LAMMPS *lmp, int narg, char **arg) :
|
||||
ntypes = atom->ntypes;
|
||||
nmax = atom->nmax;
|
||||
compressed = 0;
|
||||
first_flag = true;
|
||||
|
||||
nevery = utils::inumeric(FLERR,arg[3],false,lmp);
|
||||
|
||||
@ -94,7 +95,10 @@ int FixReaxFFBonds::setmask()
|
||||
|
||||
void FixReaxFFBonds::setup(int /*vflag*/)
|
||||
{
|
||||
end_of_step();
|
||||
// only print output during setup() at the very beginning
|
||||
// to avoid duplicate outputs when using multiple run statements
|
||||
if (first_flag) end_of_step();
|
||||
first_flag = false;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -41,6 +41,7 @@ class FixReaxFFBonds : public Fix {
|
||||
tagint **neighid;
|
||||
double **abo;
|
||||
FILE *fp;
|
||||
bool first_flag;
|
||||
|
||||
void allocate();
|
||||
void destroy();
|
||||
|
||||
@ -691,24 +691,28 @@ void *PairReaxFF::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 1;
|
||||
if (strcmp(str,"chi") == 0 && chi) {
|
||||
chi[0] = 0.0;
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
if (map[i] >= 0) chi[i] = api->system->reax_param.sbp[map[i]].chi;
|
||||
else chi[i] = 0.0;
|
||||
return (void *) chi;
|
||||
}
|
||||
if (strcmp(str,"eta") == 0 && eta) {
|
||||
eta[0] = 0.0;
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
if (map[i] >= 0) eta[i] = api->system->reax_param.sbp[map[i]].eta;
|
||||
else eta[i] = 0.0;
|
||||
return (void *) eta;
|
||||
}
|
||||
if (strcmp(str,"gamma") == 0 && gamma) {
|
||||
gamma[0] = 0.0;
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
if (map[i] >= 0) gamma[i] = api->system->reax_param.sbp[map[i]].gamma;
|
||||
else gamma[i] = 0.0;
|
||||
return (void *) gamma;
|
||||
}
|
||||
if (strcmp(str,"bcut_acks2") == 0 && bcut_acks2) {
|
||||
bcut_acks2[0] = 0.0;
|
||||
for (int i = 1; i <= atom->ntypes; i++)
|
||||
if (map[i] >= 0) bcut_acks2[i] = api->system->reax_param.sbp[map[i]].bcut_acks2;
|
||||
else bcut_acks2[i] = 0.0;
|
||||
|
||||
@ -200,7 +200,7 @@ void NEB::run()
|
||||
if (me == 0)
|
||||
color = 0;
|
||||
else
|
||||
color = 1;
|
||||
color = MPI_UNDEFINED;
|
||||
MPI_Comm_split(uworld, color, 0, &roots);
|
||||
|
||||
auto fixes = modify->get_fix_by_style("^neb$");
|
||||
@ -610,17 +610,20 @@ void NEB::open(char *file)
|
||||
void NEB::print_status()
|
||||
{
|
||||
double fnorm2 = sqrt(update->minimize->fnorm_sqr());
|
||||
double fmaxreplica;
|
||||
MPI_Allreduce(&fnorm2, &fmaxreplica, 1, MPI_DOUBLE, MPI_MAX, roots);
|
||||
double fnorminf = update->minimize->fnorm_inf();
|
||||
double fmaxatom;
|
||||
MPI_Allreduce(&fnorminf, &fmaxatom, 1, MPI_DOUBLE, MPI_MAX, roots);
|
||||
double fmaxreplica = 0.0;
|
||||
double fmaxatom = 0.0;
|
||||
|
||||
if (print_mode == VERBOSE) {
|
||||
freplica = new double[nreplica];
|
||||
MPI_Allgather(&fnorm2, 1, MPI_DOUBLE, &freplica[0], 1, MPI_DOUBLE, roots);
|
||||
fmaxatomInRepl = new double[nreplica];
|
||||
MPI_Allgather(&fnorminf, 1, MPI_DOUBLE, &fmaxatomInRepl[0], 1, MPI_DOUBLE, roots);
|
||||
if (me == 0) {
|
||||
MPI_Allreduce(&fnorm2, &fmaxreplica, 1, MPI_DOUBLE, MPI_MAX, roots);
|
||||
MPI_Allreduce(&fnorminf, &fmaxatom, 1, MPI_DOUBLE, MPI_MAX, roots);
|
||||
|
||||
if (print_mode == VERBOSE) {
|
||||
freplica = new double[nreplica];
|
||||
MPI_Allgather(&fnorm2, 1, MPI_DOUBLE, &freplica[0], 1, MPI_DOUBLE, roots);
|
||||
fmaxatomInRepl = new double[nreplica];
|
||||
MPI_Allgather(&fnorminf, 1, MPI_DOUBLE, &fmaxatomInRepl[0], 1, MPI_DOUBLE, roots);
|
||||
}
|
||||
}
|
||||
|
||||
double one[7];
|
||||
@ -705,7 +708,7 @@ void NEB::print_status()
|
||||
fflush(universe->ulogfile);
|
||||
}
|
||||
}
|
||||
if (print_mode == VERBOSE) {
|
||||
if ((me == 0) && (print_mode == VERBOSE)) {
|
||||
delete[] freplica;
|
||||
delete[] fmaxatomInRepl;
|
||||
}
|
||||
|
||||
@ -2160,7 +2160,7 @@ void FixRigidSmall::setup_bodies_static()
|
||||
xgc = body[ibody].xgc;
|
||||
double delta[3];
|
||||
MathExtra::sub3(xgc,xcm,delta);
|
||||
domain->minimum_image(delta);
|
||||
domain->minimum_image_big(delta);
|
||||
MathExtra::transpose_matvec(ex,ey,ez,delta,body[ibody].xgc_body);
|
||||
MathExtra::add3(xcm,delta,xgc);
|
||||
}
|
||||
|
||||
@ -371,7 +371,9 @@ void FixShake::init()
|
||||
// if rRESPA, find associated fix that must exist
|
||||
// could have changed locations in fix list since created
|
||||
// set ptrs to rRESPA variables
|
||||
// set respa to 0 if verlet is used and to 1 otherwise
|
||||
|
||||
respa = 0;
|
||||
fix_respa = nullptr;
|
||||
if (utils::strmatch(update->integrate_style,"^respa")) {
|
||||
if (update->whichflag > 0) {
|
||||
@ -379,10 +381,12 @@ void FixShake::init()
|
||||
if (fixes.size() > 0) fix_respa = dynamic_cast<FixRespa *>(fixes.front());
|
||||
else error->all(FLERR,"Run style respa did not create fix RESPA");
|
||||
}
|
||||
auto respa_style = dynamic_cast<Respa *>(update->integrate);
|
||||
nlevels_respa = respa_style->nlevels;
|
||||
loop_respa = respa_style->loop;
|
||||
step_respa = respa_style->step;
|
||||
auto respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
if (!respa_ptr) error->all(FLERR, "Failure to access Respa style {}", update->integrate_style);
|
||||
respa = 1;
|
||||
nlevels_respa = respa_ptr->nlevels;
|
||||
loop_respa = respa_ptr->loop;
|
||||
step_respa = respa_ptr->step;
|
||||
}
|
||||
|
||||
// set equilibrium bond distances
|
||||
@ -473,18 +477,22 @@ void FixShake::setup(int vflag)
|
||||
next_output = (ntimestep/output_every)*output_every + output_every;
|
||||
} else next_output = -1;
|
||||
|
||||
// set respa to 0 if verlet is used and to 1 otherwise
|
||||
|
||||
if (utils::strmatch(update->integrate_style,"^verlet"))
|
||||
respa = 0;
|
||||
else
|
||||
respa = 1;
|
||||
|
||||
if (!respa) {
|
||||
dtv = update->dt;
|
||||
dtfsq = 0.5 * update->dt * update->dt * force->ftm2v;
|
||||
if (!rattle) dtfsq = update->dt * update->dt * force->ftm2v;
|
||||
} else {
|
||||
auto respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
if (!respa_ptr) error->all(FLERR, "Failure to access Respa style {}", update->integrate_style);
|
||||
if (update->whichflag > 0) {
|
||||
auto fixes = modify->get_fix_by_style("^RESPA");
|
||||
if (fixes.size() > 0) fix_respa = dynamic_cast<FixRespa *>(fixes.front());
|
||||
else error->all(FLERR,"Run style respa did not create fix RESPA");
|
||||
}
|
||||
respa = 1;
|
||||
nlevels_respa = respa_ptr->nlevels;
|
||||
loop_respa = respa_ptr->loop;
|
||||
step_respa = respa_ptr->step;
|
||||
dtv = step_respa[0];
|
||||
dtf_innerhalf = 0.5 * step_respa[0] * force->ftm2v;
|
||||
dtf_inner = dtf_innerhalf;
|
||||
@ -3123,7 +3131,14 @@ void FixShake::reset_dt()
|
||||
dtv = update->dt;
|
||||
if (rattle) dtfsq = 0.5 * update->dt * update->dt * force->ftm2v;
|
||||
else dtfsq = update->dt * update->dt * force->ftm2v;
|
||||
respa = 0;
|
||||
} else {
|
||||
auto respa_ptr = dynamic_cast<Respa *>(update->integrate);
|
||||
if (!respa_ptr) error->all(FLERR, "Failure to access Respa style {}", update->integrate_style);
|
||||
respa = 1;
|
||||
nlevels_respa = respa_ptr->nlevels;
|
||||
loop_respa = respa_ptr->loop;
|
||||
step_respa = respa_ptr->step;
|
||||
dtv = step_respa[0];
|
||||
dtf_innerhalf = 0.5 * step_respa[0] * force->ftm2v;
|
||||
if (rattle) dtf_inner = dtf_innerhalf;
|
||||
|
||||
@ -13,13 +13,15 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "compute_sph_e_atom.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "modify.h"
|
||||
#include "comm.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "update.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -31,7 +33,7 @@ ComputeSPHEAtom::ComputeSPHEAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (narg != 3)
|
||||
error->all(FLERR,"Number of arguments for compute sph/e/atom command != 3");
|
||||
if (atom->esph_flag != 1)
|
||||
error->all(FLERR,"Compute sph/e/atom command requires atom_style sph)");
|
||||
error->all(FLERR,"Compute sph/e/atom requires atom attribute energy, e.g. in atom_style sph");
|
||||
|
||||
peratom_flag = 1;
|
||||
size_peratom_cols = 0;
|
||||
@ -51,12 +53,11 @@ ComputeSPHEAtom::~ComputeSPHEAtom()
|
||||
|
||||
void ComputeSPHEAtom::init()
|
||||
{
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < modify->ncompute; i++)
|
||||
if (strcmp(modify->compute[i]->style,"evector/atom") == 0) count++;
|
||||
if (strcmp(modify->compute[i]->style,"sph/e/atom") == 0) count++;
|
||||
if (count > 1 && comm->me == 0)
|
||||
error->warning(FLERR,"More than one compute evector/atom");
|
||||
error->warning(FLERR,"More than one compute sph/e/atom");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -78,14 +79,13 @@ void ComputeSPHEAtom::compute_peratom()
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
evector[i] = esph[i];
|
||||
}
|
||||
else {
|
||||
evector[i] = 0.0;
|
||||
}
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
evector[i] = esph[i];
|
||||
} else {
|
||||
evector[i] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -13,13 +13,15 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "compute_sph_rho_atom.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "modify.h"
|
||||
#include "comm.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "update.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -30,8 +32,7 @@ ComputeSPHRhoAtom::ComputeSPHRhoAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
{
|
||||
if (narg != 3) error->all(FLERR,"Illegal compute sph/rho/atom command");
|
||||
if (atom->rho_flag != 1)
|
||||
error->all(FLERR,"Compute sph/rho/atom command requires atom_style sph");
|
||||
|
||||
error->all(FLERR, "Compute sph/rho/atom requires atom attribute density, e.g. in atom_style sph");
|
||||
peratom_flag = 1;
|
||||
size_peratom_cols = 0;
|
||||
|
||||
@ -50,12 +51,11 @@ ComputeSPHRhoAtom::~ComputeSPHRhoAtom()
|
||||
|
||||
void ComputeSPHRhoAtom::init()
|
||||
{
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < modify->ncompute; i++)
|
||||
if (strcmp(modify->compute[i]->style,"rhoVector/atom") == 0) count++;
|
||||
if (strcmp(modify->compute[i]->style,"sph/rho/atom") == 0) count++;
|
||||
if (count > 1 && comm->me == 0)
|
||||
error->warning(FLERR,"More than one compute rhoVector/atom");
|
||||
error->warning(FLERR,"More than one compute sph/rho/atom");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -73,20 +73,17 @@ void ComputeSPHRhoAtom::compute_peratom()
|
||||
vector_atom = rhoVector;
|
||||
}
|
||||
|
||||
// compute kinetic energy for each atom in group
|
||||
|
||||
double *rho = atom->rho;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
rhoVector[i] = rho[i];
|
||||
}
|
||||
else {
|
||||
rhoVector[i] = 0.0;
|
||||
}
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
rhoVector[i] = rho[i];
|
||||
} else {
|
||||
rhoVector[i] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -13,13 +13,15 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "compute_sph_t_atom.h"
|
||||
#include <cstring>
|
||||
|
||||
#include "atom.h"
|
||||
#include "update.h"
|
||||
#include "modify.h"
|
||||
#include "comm.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "update.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -31,7 +33,7 @@ ComputeSPHTAtom::ComputeSPHTAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (narg != 3)
|
||||
error->all(FLERR,"Number of arguments for compute sph/t/atom command != 3");
|
||||
if ((atom->esph_flag != 1) || (atom->cv_flag != 1))
|
||||
error->all(FLERR,"Compute sph/t/atom command requires atom_style sph");
|
||||
error->all(FLERR, "Compute sph/t/atom requires atom attributes energy and specific heat, e.g. in atom_style sph");
|
||||
|
||||
peratom_flag = 1;
|
||||
size_peratom_cols = 0;
|
||||
@ -51,12 +53,11 @@ ComputeSPHTAtom::~ComputeSPHTAtom()
|
||||
|
||||
void ComputeSPHTAtom::init()
|
||||
{
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < modify->ncompute; i++)
|
||||
if (strcmp(modify->compute[i]->style,"meso/t/atom") == 0) count++;
|
||||
if (strcmp(modify->compute[i]->style,"sph/t/atom") == 0) count++;
|
||||
if (count > 1 && comm->me == 0)
|
||||
error->warning(FLERR,"More than one compute meso/t/atom");
|
||||
error->warning(FLERR,"More than one compute sph/t/atom");
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -79,16 +80,15 @@ void ComputeSPHTAtom::compute_peratom()
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
if (cv[i] > 0.0) {
|
||||
tvector[i] = esph[i] / cv[i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
tvector[i] = 0.0;
|
||||
for (int i = 0; i < nlocal; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
if (cv[i] > 0.0) {
|
||||
tvector[i] = esph[i] / cv[i];
|
||||
}
|
||||
} else {
|
||||
tvector[i] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -13,10 +13,13 @@
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_sph.h"
|
||||
|
||||
#include "atom.h"
|
||||
#include "comm.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
#include "update.h"
|
||||
#include "error.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
@ -24,11 +27,10 @@ using namespace FixConst;
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
FixSPH::FixSPH(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg) {
|
||||
|
||||
if ((atom->esph_flag != 1) || (atom->rho_flag != 1))
|
||||
error->all(FLERR,
|
||||
"Fix sph command requires atom_style with both energy and density");
|
||||
Fix(lmp, narg, arg)
|
||||
{
|
||||
if ((atom->esph_flag != 1) || (atom->rho_flag != 1) || (atom->vest_flag != 1))
|
||||
error->all(FLERR, "Fix sph requires atom attributes energy, density, and velocity estimates, e.g. in atom_style sph");
|
||||
|
||||
if (narg != 3)
|
||||
error->all(FLERR,"Illegal number of arguments for fix sph command");
|
||||
@ -38,7 +40,8 @@ FixSPH::FixSPH(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
int FixSPH::setmask() {
|
||||
int FixSPH::setmask()
|
||||
{
|
||||
int mask = 0;
|
||||
mask |= INITIAL_INTEGRATE;
|
||||
mask |= FINAL_INTEGRATE;
|
||||
@ -48,13 +51,20 @@ int FixSPH::setmask() {
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixSPH::init() {
|
||||
void FixSPH::init()
|
||||
{
|
||||
dtv = update->dt;
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixSPH::setup_pre_force(int /*vflag*/)
|
||||
{
|
||||
remap_v_flag = domain->deform_vremap;
|
||||
if (remap_v_flag && (!comm->ghost_velocity))
|
||||
error->all(FLERR, "Fix sph requires ghost atoms store velocity when deforming with remap v");
|
||||
|
||||
// set vest equal to v
|
||||
double **v = atom->v;
|
||||
double **vest = atom->vest;
|
||||
@ -76,7 +86,8 @@ void FixSPH::setup_pre_force(int /*vflag*/)
|
||||
allow for both per-type and per-atom mass
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixSPH::initial_integrate(int /*vflag*/) {
|
||||
void FixSPH::initial_integrate(int /*vflag*/)
|
||||
{
|
||||
// update v and x and rho and e of atoms in group
|
||||
|
||||
double **x = atom->x;
|
||||
@ -112,9 +123,16 @@ void FixSPH::initial_integrate(int /*vflag*/) {
|
||||
rho[i] += dtf * drho[i]; // ... and density
|
||||
|
||||
// extrapolate velocity for use with velocity-dependent potentials, e.g. SPH
|
||||
vest[i][0] = v[i][0] + 2.0 * dtfm * f[i][0];
|
||||
vest[i][1] = v[i][1] + 2.0 * dtfm * f[i][1];
|
||||
vest[i][2] = v[i][2] + 2.0 * dtfm * f[i][2];
|
||||
// if velocities are remapped, perform this extrapolation after communication
|
||||
if (remap_v_flag) {
|
||||
vest[i][0] = dtfm * f[i][0];
|
||||
vest[i][1] = dtfm * f[i][1];
|
||||
vest[i][2] = dtfm * f[i][2];
|
||||
} else {
|
||||
vest[i][0] = v[i][0] + 2.0 * dtfm * f[i][0];
|
||||
vest[i][1] = v[i][1] + 2.0 * dtfm * f[i][1];
|
||||
vest[i][2] = v[i][2] + 2.0 * dtfm * f[i][2];
|
||||
}
|
||||
|
||||
v[i][0] += dtfm * f[i][0];
|
||||
v[i][1] += dtfm * f[i][1];
|
||||
@ -129,8 +147,33 @@ void FixSPH::initial_integrate(int /*vflag*/) {
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixSPH::final_integrate() {
|
||||
void FixSPH::pre_force(int /*vflag*/)
|
||||
{
|
||||
// if velocities are remapped, calculate estimates here
|
||||
// note that vest currently stores dtfm * force
|
||||
if (!remap_v_flag) return;
|
||||
|
||||
double **v = atom->v;
|
||||
double **vest = atom->vest;
|
||||
int *mask = atom->mask;
|
||||
int nlocal = atom->nlocal;
|
||||
if (igroup == atom->firstgroup)
|
||||
nlocal = atom->nfirst;
|
||||
|
||||
int nall = nlocal + atom->nghost;
|
||||
for (int i = 0; i < nall; i++) {
|
||||
if (mask[i] & groupbit) {
|
||||
vest[i][0] += v[i][0];
|
||||
vest[i][1] += v[i][1];
|
||||
vest[i][2] += v[i][2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixSPH::final_integrate()
|
||||
{
|
||||
// update v, rho, and e of atoms in group
|
||||
|
||||
double **v = atom->v;
|
||||
@ -169,7 +212,8 @@ void FixSPH::final_integrate() {
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixSPH::reset_dt() {
|
||||
void FixSPH::reset_dt()
|
||||
{
|
||||
dtv = update->dt;
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user