Merge branch 'develop' into test-fix-numdiff
This commit is contained in:
2
.github/workflows/coverity.yml
vendored
2
.github/workflows/coverity.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
||||
|
||||
- name: Cache Coverity
|
||||
id: cache-coverity
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ./download/
|
||||
key: ${{ runner.os }}-download-${{ hashFiles('**/coverity_tool.*') }}
|
||||
|
||||
2
.github/workflows/unittest-macos.yml
vendored
2
.github/workflows/unittest-macos.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
run: mkdir build
|
||||
|
||||
- name: Set up ccache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
key: macos-ccache-${{ github.sha }}
|
||||
|
||||
@ -1,3 +1,10 @@
|
||||
|
||||
# Silence CMake warnings about FindCUDA being obsolete.
|
||||
# We may need to eventually rewrite this section to use enable_language(CUDA)
|
||||
if(POLICY CMP0146)
|
||||
cmake_policy(SET CMP0146 OLD)
|
||||
endif()
|
||||
|
||||
set(GPU_SOURCES_DIR ${LAMMPS_SOURCE_DIR}/GPU)
|
||||
set(GPU_SOURCES ${GPU_SOURCES_DIR}/gpu_extra.h
|
||||
${GPU_SOURCES_DIR}/fix_gpu.h
|
||||
|
||||
@ -8,8 +8,8 @@ option(DOWNLOAD_MDI "Download and compile the MDI library instead of using an al
|
||||
|
||||
if(DOWNLOAD_MDI)
|
||||
message(STATUS "MDI download requested - we will build our own")
|
||||
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.16.tar.gz" CACHE STRING "URL for MDI tarball")
|
||||
set(MDI_MD5 "407db44e2d79447ab5c1233af1965f65" CACHE STRING "MD5 checksum for MDI tarball")
|
||||
set(MDI_URL "https://github.com/MolSSI-MDI/MDI_Library/archive/v1.4.26.tar.gz" CACHE STRING "URL for MDI tarball")
|
||||
set(MDI_MD5 "3124bb85259471e2a53a891f04bf697a" CACHE STRING "MD5 checksum for MDI tarball")
|
||||
mark_as_advanced(MDI_URL)
|
||||
mark_as_advanced(MDI_MD5)
|
||||
GetFallbackURL(MDI_URL MDI_FALLBACK)
|
||||
|
||||
@ -100,6 +100,7 @@ html: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX)
|
||||
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst ;\
|
||||
$(PYTHON) $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\
|
||||
echo "############################################" ;\
|
||||
deactivate ;\
|
||||
@ -182,6 +183,7 @@ pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK)
|
||||
env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst ;\
|
||||
env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst ;\
|
||||
$(PYTHON) utils/check-styles.py -s ../src -d src ;\
|
||||
echo "############################################" ;\
|
||||
deactivate ;\
|
||||
@ -231,6 +233,7 @@ role_check :
|
||||
@( env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst && exit 1 || : )
|
||||
@( env LC_ALL=C grep -n ' `[^`]\+<[a-z][^`]\+`[^_]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||
@( env LC_ALL=C grep -n ':\(ref\|doc\):[^`]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||
@( env LC_ALL=C grep -n '\(ref\|doc\)`[^`]' $(RSTDIR)/*.rst && exit 1 || : )
|
||||
|
||||
link_check : $(VENV) html
|
||||
@(\
|
||||
|
||||
@ -124,7 +124,7 @@ OPT.
|
||||
*
|
||||
*
|
||||
* :doc:`charmm (iko) <dihedral_charmm>`
|
||||
* :doc:`charmmfsw <dihedral_charmm>`
|
||||
* :doc:`charmmfsw (k) <dihedral_charmm>`
|
||||
* :doc:`class2 (ko) <dihedral_class2>`
|
||||
* :doc:`cosine/shift/exp (o) <dihedral_cosine_shift_exp>`
|
||||
* :doc:`fourier (io) <dihedral_fourier>`
|
||||
|
||||
@ -146,7 +146,7 @@ OPT.
|
||||
* :doc:`lj/charmm/coul/long/soft (o) <pair_fep_soft>`
|
||||
* :doc:`lj/charmm/coul/msm (o) <pair_charmm>`
|
||||
* :doc:`lj/charmmfsw/coul/charmmfsh <pair_charmm>`
|
||||
* :doc:`lj/charmmfsw/coul/long <pair_charmm>`
|
||||
* :doc:`lj/charmmfsw/coul/long (k) <pair_charmm>`
|
||||
* :doc:`lj/class2 (gko) <pair_class2>`
|
||||
* :doc:`lj/class2/coul/cut (ko) <pair_class2>`
|
||||
* :doc:`lj/class2/coul/cut/soft <pair_fep_soft>`
|
||||
|
||||
@ -20,6 +20,7 @@ Available topics in mostly chronological order are:
|
||||
- `Use ev_init() to initialize variables derived from eflag and vflag`_
|
||||
- `Use utils::numeric() functions instead of force->numeric()`_
|
||||
- `Use utils::open_potential() function to open potential files`_
|
||||
- `Use symbolic Atom and AtomVec constants instead of numerical values`_
|
||||
- `Simplify customized error messages`_
|
||||
- `Use of "override" instead of "virtual"`_
|
||||
- `Simplified and more compact neighbor list requests`_
|
||||
@ -196,6 +197,71 @@ New:
|
||||
|
||||
fp = utils::open_potential(filename, lmp);
|
||||
|
||||
Use symbolic Atom and AtomVec constants instead of numerical values
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. versionchanged:: 18Sep2020
|
||||
|
||||
Properties in LAMMPS that were represented by integer values (0, 1,
|
||||
2, 3) to indicate settings in the ``Atom`` and ``AtomVec`` classes (or
|
||||
classes derived from it) (and its derived classes) have been converted
|
||||
to use scoped enumerators instead.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: auto
|
||||
|
||||
* - Symbolic Constant
|
||||
- Value
|
||||
- Symbolic Constant
|
||||
- Value
|
||||
* - Atom::GROW
|
||||
- 0
|
||||
- Atom::MAP_NONE
|
||||
- 0
|
||||
* - Atom::RESTART
|
||||
- 1
|
||||
- Atom::MAP_ARRAY
|
||||
- 1
|
||||
* - Atom::BORDER
|
||||
- 2
|
||||
- Atom::MAP_HASH
|
||||
- 2
|
||||
* - Atom::ATOMIC
|
||||
- 0
|
||||
- Atom::MAP_YES
|
||||
- 3
|
||||
* - Atom::MOLECULAR
|
||||
- 1
|
||||
- AtomVec::PER_ATOM
|
||||
- 0
|
||||
* - Atom::TEMPLATE
|
||||
- 2
|
||||
- AtomVec::PER_TYPE
|
||||
- 1
|
||||
|
||||
Old:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
molecular = 0;
|
||||
mass_type = 1;
|
||||
if (atom->molecular == 2)
|
||||
if (atom->map_style == 2)
|
||||
atom->add_callback(0);
|
||||
atom->delete_callback(id,1);
|
||||
|
||||
New:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
molecular = Atom::ATOMIC;
|
||||
mass_type = AtomVec::PER_TYPE;
|
||||
if (atom->molecular == Atom::TEMPLATE)
|
||||
if (atom->map_style == Atom::MAP_HASH)
|
||||
atom->add_callback(Atom::GROW);
|
||||
atom->delete_callback(id,Atom::RESTART);
|
||||
|
||||
Simplify customized error messages
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@ -315,6 +315,10 @@ of the contents of the :f:mod:`LIBLAMMPS` Fortran interface to LAMMPS.
|
||||
:ftype extract_variable: function
|
||||
:f set_variable: :f:subr:`set_variable`
|
||||
:ftype set_variable: subroutine
|
||||
:f set_string_variable: :f:subr:`set_set_string_variable`
|
||||
:ftype set_string_variable: subroutine
|
||||
:f set_internal_variable: :f:subr:`set_internal_variable`
|
||||
:ftype set_internal_variable: subroutine
|
||||
:f gather_atoms: :f:subr:`gather_atoms`
|
||||
:ftype gather_atoms: subroutine
|
||||
:f gather_atoms_concat: :f:subr:`gather_atoms_concat`
|
||||
@ -1398,7 +1402,28 @@ Procedures Bound to the :f:type:`lammps` Derived Type
|
||||
|
||||
Set the value of a string-style variable.
|
||||
|
||||
.. versionadded:: 3Nov2022
|
||||
.. deprecated:: TBD
|
||||
|
||||
This function assigns a new value from the string *str* to the string-style
|
||||
variable *name*\ . If *name* does not exist or is not a string-style
|
||||
variable, an error is generated.
|
||||
|
||||
.. warning::
|
||||
|
||||
This subroutine is deprecated and :f:subr:`set_string_variable`
|
||||
should be used instead.
|
||||
|
||||
:p character(len=*) name: name of the variable
|
||||
:p character(len=*) str: new value to assign to the variable
|
||||
:to: :cpp:func:`lammps_set_variable`
|
||||
|
||||
--------
|
||||
|
||||
.. f:subroutine:: set_string_variable(name, str)
|
||||
|
||||
Set the value of a string-style variable.
|
||||
|
||||
.. versionadded:: TBD
|
||||
|
||||
This function assigns a new value from the string *str* to the string-style
|
||||
variable *name*\ . If *name* does not exist or is not a string-style
|
||||
@ -1406,7 +1431,23 @@ Procedures Bound to the :f:type:`lammps` Derived Type
|
||||
|
||||
:p character(len=*) name: name of the variable
|
||||
:p character(len=*) str: new value to assign to the variable
|
||||
:to: :cpp:func:`lammps_set_variable`
|
||||
:to: :cpp:func:`lammps_set_string_variable`
|
||||
|
||||
--------
|
||||
|
||||
.. f:subroutine:: set_internal_variable(name, val)
|
||||
|
||||
Set the value of a internal-style variable.
|
||||
|
||||
.. versionadded:: TBD
|
||||
|
||||
This function assigns a new value from the floating-point number *val* to
|
||||
the internal-style variable *name*\ . If *name* does not exist or is not
|
||||
an internal-style variable, an error is generated.
|
||||
|
||||
:p character(len=*) name: name of the variable
|
||||
:p read(c_double) val: new value to assign to the variable
|
||||
:to: :cpp:func:`lammps_set_internal_variable`
|
||||
|
||||
--------
|
||||
|
||||
|
||||
@ -9,6 +9,8 @@ fixes, or variables in LAMMPS using the following functions:
|
||||
- :cpp:func:`lammps_extract_variable_datatype`
|
||||
- :cpp:func:`lammps_extract_variable`
|
||||
- :cpp:func:`lammps_set_variable`
|
||||
- :cpp:func:`lammps_set_string_variable`
|
||||
- :cpp:func:`lammps_set_internal_variable`
|
||||
- :cpp:func:`lammps_variable_info`
|
||||
|
||||
-----------------------
|
||||
@ -38,6 +40,16 @@ fixes, or variables in LAMMPS using the following functions:
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_set_string_variable
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_set_internal_variable
|
||||
:project: progguide
|
||||
|
||||
-----------------------
|
||||
|
||||
.. doxygenfunction:: lammps_variable_info
|
||||
:project: progguide
|
||||
|
||||
|
||||
@ -70,7 +70,9 @@ for more info.
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`angle_coeff <angle_coeff>`
|
||||
:doc:`angle_coeff <angle_coeff>`, :doc:`pair_style lj/charmm variants <pair_charmm>`,
|
||||
:doc:`dihedral_style charmm <dihedral_charmm>`,
|
||||
:doc:`dihedral_style charmmfsw <dihedral_charmm>`, :doc:`fix cmap <fix_cmap>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -11,7 +11,16 @@ Syntax
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
angle_style lepton
|
||||
angle_style style args
|
||||
|
||||
* style = *lepton*
|
||||
* args = optional arguments
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
args = *auto_offset* or *no_offset*
|
||||
*auto_offset* = offset the potential energy so that the value at theta0 is 0.0 (default)
|
||||
*no_offset* = do not offset the potential energy
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -19,6 +28,7 @@ Examples
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
angle_style lepton
|
||||
angle_style lepton no_offset
|
||||
|
||||
angle_coeff 1 120.0 "k*theta^2; k=250.0"
|
||||
angle_coeff 2 90.0 "k2*theta^2 + k3*theta^3 + k4*theta^4; k2=300.0; k3=-100.0; k4=50.0"
|
||||
@ -41,6 +51,13 @@ angle coefficient. For example `"200.0*theta^2"` represents a
|
||||
|
||||
U_{angle,i} = K (\theta_i - \theta_0)^2 = K \theta^2 \qquad \theta = \theta_i - \theta_0
|
||||
|
||||
.. versionchanged:: TBD
|
||||
|
||||
By default the potential energy U is shifted so that the value U is 0.0
|
||||
for $theta = theta_0$. This is equivalent to using the optional keyword
|
||||
*auto_offset*. When using the keyword *no_offset* instead, the
|
||||
potential energy is not shifted.
|
||||
|
||||
The `Lepton library <https://simtk.org/projects/lepton>`_, that the
|
||||
*lepton* angle style interfaces with, evaluates this expression string
|
||||
at run time to compute the pairwise energy. It also creates an
|
||||
|
||||
@ -49,248 +49,221 @@ Examples
|
||||
Description
|
||||
"""""""""""
|
||||
|
||||
Define what style of atoms to use in a simulation. This determines
|
||||
what attributes are associated with the atoms. This command must be
|
||||
used before a simulation is setup via a :doc:`read_data <read_data>`,
|
||||
:doc:`read_restart <read_restart>`, or :doc:`create_box <create_box>`
|
||||
command.
|
||||
The *atom_style* command selects which per-atom attributes are
|
||||
associated with atoms in a LAMMPS simulation and thus stored and
|
||||
communicated with those atoms as well as read from and stored in data
|
||||
and restart files. Different models (e.g. :doc:`pair styles
|
||||
<pair_style>`) require access to specific per-atom attributes and thus
|
||||
require a specific atom style. For example, to compute Coulomb
|
||||
interactions, the atom must have a "charge" (aka "q") attribute.
|
||||
|
||||
A number of distinct atom styles exist that combine attributes. Some
|
||||
atom styles are a superset of other atom styles. Further attributes
|
||||
may be added to atoms either via using a hybrid style which provides a
|
||||
union of the attributes of the sub-styles, or via the :doc:`fix
|
||||
property/atom <fix_property_atom>` command. The *atom_style* command
|
||||
must be used before a simulation is setup via a :doc:`read_data
|
||||
<read_data>`, :doc:`read_restart <read_restart>`, or :doc:`create_box
|
||||
<create_box>` command.
|
||||
|
||||
.. note::
|
||||
|
||||
Many of the atom styles discussed here are only enabled if
|
||||
LAMMPS was built with a specific package, as listed below in the
|
||||
Restrictions section.
|
||||
Many of the atom styles discussed here are only enabled if LAMMPS was
|
||||
built with a specific package, as listed below in the Restrictions
|
||||
section.
|
||||
|
||||
Once a style is assigned, it cannot be changed, so use a style general
|
||||
enough to encompass all attributes. E.g. with style *bond*, angular
|
||||
terms cannot be used or added later to the model. It is OK to use a
|
||||
style more general than needed, though it may be slightly inefficient.
|
||||
Once a style is selected and the simulation box defined, it cannot be
|
||||
changed but only augmented with the :doc:`fix property/atom
|
||||
<fix_property_atom>` command. So one should select an atom style
|
||||
general enough to encompass all attributes required. E.g. with atom
|
||||
style *bond*, it is not possible to define angles and use angle styles.
|
||||
|
||||
The choice of style affects what quantities are stored by each atom,
|
||||
what quantities are communicated between processors to enable forces
|
||||
to be computed, and what quantities are listed in the data file read
|
||||
by the :doc:`read_data <read_data>` command.
|
||||
It is OK to use a style more general than needed, though it may be
|
||||
slightly inefficient because it will allocate and communicate
|
||||
additional unused data.
|
||||
|
||||
These are the additional attributes of each style and the typical
|
||||
kinds of physical systems they are used to model. All styles store
|
||||
coordinates, velocities, atom IDs and types. See the
|
||||
Atom style attributes
|
||||
"""""""""""""""""""""
|
||||
|
||||
The atom style *atomic* has the minimum subset of per-atom attributes
|
||||
and is also the default setting. It encompasses the following per-atom
|
||||
attributes (name of the vector or array in the :doc:`Atom class
|
||||
<Classes_atom>` is given in parenthesis): atom-ID (tag), type (type),
|
||||
position (x), velocities (v), forces (f), image flags (image), group
|
||||
membership (mask). Since all atom styles are a superset of atom style
|
||||
*atomic*\ , they all include these attributes.
|
||||
|
||||
This table lists all the available atom styles, which attributes they
|
||||
provide, which :doc:`package <Packages>` is required to use them, and
|
||||
what the typical applications are that use them. See the
|
||||
:doc:`read_data <read_data>`, :doc:`create_atoms <create_atoms>`, and
|
||||
:doc:`set <set>` commands for info on how to set these various
|
||||
quantities.
|
||||
:doc:`set <set>` commands for details on how to set these various
|
||||
quantities. More information about many of the styles is provided in
|
||||
the Additional Information section below.
|
||||
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *amoeba* | molecular + charge + 1/5 neighbors | AMOEBA/HIPPO polarized force fields |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *angle* | bonds and angles | bead-spring polymers with stiffness |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *atomic* | only the default values | coarse-grain liquids, solids, metals |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *body* | mass, inertia moments, quaternion, angular momentum | arbitrary bodies |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *bond* | bonds | bead-spring polymers |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *charge* | charge | atomic system with charges |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *dielectric* | normx normy normz area/patch ed em epsilon curv | system with surface polarization |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *dipole* | charge and dipole moment | system with dipolar particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *dpd* | internal temperature and internal energies | DPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *edpd* | temperature and heat capacity | eDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *electron* | charge and spin and eradius | electronic force field |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *ellipsoid* | shape, quaternion, angular momentum | aspherical particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *full* | molecular + charge | bio-molecules |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *line* | end points, angular velocity | rigid bodies |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *mdpd* | density | mDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *molecular* | bonds, angles, dihedrals, impropers | uncharged molecules |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *oxdna* | nucleotide polarity | coarse-grained DNA and RNA models |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *peri* | mass, volume | mesoscopic Peridynamic models |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *smd* | volume, kernel diameter, contact radius, mass | solid and fluid SPH particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *sph* | rho, esph, cv | SPH particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *sphere* | diameter, mass, angular velocity | granular models |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *bpm/sphere* | diameter, mass, angular velocity, quaternion | granular bonded particle models (BPM)|
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *spin* | magnetic moment | system with magnetic particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *tdpd* | chemical concentration | tDPD particles |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *template* | template index, template atom | small molecules with fixed topology |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *tri* | corner points, angular momentum | rigid bodies |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
| *wavepacket* | charge, spin, eradius, etag, cs_re, cs_im | AWPMD |
|
||||
+--------------+-----------------------------------------------------+--------------------------------------+
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: auto
|
||||
|
||||
* - Atom style
|
||||
- Attributes
|
||||
- Required package
|
||||
- Applications
|
||||
* - *amoeba*
|
||||
- *full* + "1-5 special neighbor data"
|
||||
- :ref:`AMOEBA <PKG-AMOEBA>`
|
||||
- AMOEBA/HIPPO force fields
|
||||
* - *angle*
|
||||
- *bond* + "angle data"
|
||||
- :ref:`MOLECULE <PKG-MOLECULE>`
|
||||
- bead-spring polymers with stiffness
|
||||
* - *atomic*
|
||||
- tag, type, x, v, f, image, mask
|
||||
-
|
||||
- atomic liquids, solids, metals
|
||||
* - *body*
|
||||
- *atomic* + radius, rmass, angmom, torque, body
|
||||
- :ref:`BODY <PKG-BODY>`
|
||||
- arbitrary bodies, see :doc:`body howto <Howto_body>`
|
||||
* - *bond*
|
||||
- *atomic* + molecule, nspecial, special + "bond data"
|
||||
- :ref:`MOLECULE <PKG-MOLECULE>`
|
||||
- bead-spring polymers
|
||||
* - *bpm/sphere*
|
||||
- *bond* + radius, rmass, omega, torque, quat
|
||||
- :ref:`BPM <PKG-BPM>`
|
||||
- granular bonded particle models, see :doc:`BPM howto <Howto_bpm>`
|
||||
* - *charge*
|
||||
- *atomic* + q
|
||||
-
|
||||
- atomic systems with charges
|
||||
* - *dielectric*
|
||||
- *full* + mu, area, ed, em, epsilon, curvature, q_scaled
|
||||
- :ref:`DIELECTRIC <PKG-DIELECTRIC>`
|
||||
- systems with surface polarization
|
||||
* - *dipole*
|
||||
- *charge* + mu
|
||||
- :ref:`DIPOLE <PKG-DIPOLE>`
|
||||
- atomic systems with charges and point dipoles
|
||||
* - *dpd*
|
||||
- *atomic* + rho + "reactive DPD data"
|
||||
- :ref:`DPD-REACT <PKG-DPD-REACT>`
|
||||
- reactive DPD
|
||||
* - *edpd*
|
||||
- *atomic* + "eDPD data"
|
||||
- :ref:`DPD-MESO <PKG-DPD-MESO>`
|
||||
- Energy conservative DPD (eDPD)
|
||||
* - *electron*
|
||||
- *charge* + espin, eradius, ervel, erforce
|
||||
- :ref:`EFF <PKG-EFF>`
|
||||
- Electron force field systems
|
||||
* - *ellipsoid*
|
||||
- *atomic* + rmass, angmom, torque, ellipsoid
|
||||
-
|
||||
- aspherical particles
|
||||
* - *full*
|
||||
- *molecular* + q
|
||||
- :ref:`MOLECULE <PKG-MOLECULE>`
|
||||
- molecular force fields
|
||||
* - *line*
|
||||
- *atomic* + molecule, radius, rmass, omega, torque, line
|
||||
-
|
||||
- 2-d rigid body particles
|
||||
* - *mdpd*
|
||||
- *atomic* + rho, drho, vest
|
||||
- :ref:`DPD-MESO <PKG-DPD-MESO>`
|
||||
- Many-body DPD (mDPD)
|
||||
* - *molecular*
|
||||
- *angle* + "dihedral and improper data"
|
||||
- :ref:`MOLECULE <PKG-MOLECULE>`
|
||||
- apolar and uncharged molecules
|
||||
* - *oxdna*
|
||||
- *atomic* + id5p
|
||||
- :ref:`CG-DNA <PKG-CG-DNA>`
|
||||
- coarse-grained DNA and RNA models
|
||||
* - *peri*
|
||||
- *atomic* + rmass, vfrac, s0, x0
|
||||
- :ref:`PERI <PKG-PERI>`
|
||||
- mesoscopic Peridynamics models
|
||||
* - *smd*
|
||||
- *atomic* + molecule, radius, rmass + "smd data"
|
||||
- :ref:`MACHDYN <PKG-MACHDYN>`
|
||||
- Smooth Mach Dynamics models
|
||||
* - *sph*
|
||||
- *atomic* + "sph data"
|
||||
- :ref:`SPH <PKG-SPH>`
|
||||
- Smoothed particle hydrodynamics models
|
||||
* - *sphere*
|
||||
- *atomic* + radius, rmass, omega, torque
|
||||
-
|
||||
- finite size spherical particles, e.g. granular models
|
||||
* - *spin*
|
||||
- *atomic* + "magnetic moment data"
|
||||
- :ref:`SPIN <PKG-SPIN>`
|
||||
- magnetic particles
|
||||
* - *tdpd*
|
||||
- *atomic* + cc, cc_flux, vest
|
||||
- :ref:`DPD-MESO <PKG-DPD-MESO>`
|
||||
- Transport DPD (tDPD)
|
||||
* - *template*
|
||||
- *atomic* + molecule, molindex, molatom
|
||||
- :ref:`MOLECULE <PKG-MOLECULE>`
|
||||
- molecular systems where attributes are taken from :doc:`molecule files <molecule>`
|
||||
* - *tri*
|
||||
- *sphere* + molecule, angmom, tri
|
||||
-
|
||||
- 3-d triangulated rigid body LJ particles
|
||||
* - *wavepacket*
|
||||
- *charge* + "wavepacket data"
|
||||
- :ref:`AWPMD <PKG-AWPMD>`
|
||||
- Antisymmetrized wave packet MD
|
||||
|
||||
.. note::
|
||||
|
||||
It is possible to add some attributes, such as a molecule ID, to
|
||||
atom styles that do not have them via the :doc:`fix property/atom
|
||||
<fix_property_atom>` command. This command also allows new custom
|
||||
attributes consisting of extra integer or floating-point values to
|
||||
be added to atoms. See the :doc:`fix property/atom
|
||||
<fix_property_atom>` page for examples of cases where this is
|
||||
useful and details on how to initialize, access, and output the
|
||||
custom values.
|
||||
It is possible to add some attributes, such as a molecule ID and
|
||||
charge, to atom styles that do not have them built in using the
|
||||
:doc:`fix property/atom <fix_property_atom>` command. This command
|
||||
also allows new custom-named attributes consisting of extra integer
|
||||
or floating-point values or vectors to be added to atoms. See the
|
||||
:doc:`fix property/atom <fix_property_atom>` page for examples of
|
||||
cases where this is useful and details on how to initialize,
|
||||
access, and output these custom values.
|
||||
|
||||
All of the above styles define point particles, except the *sphere*,
|
||||
*bpm/sphere*, *ellipsoid*, *electron*, *peri*, *wavepacket*, *line*,
|
||||
*tri*, and *body* styles, which define finite-size particles. See the
|
||||
:doc:`Howto spherical <Howto_spherical>` page for an overview of using
|
||||
finite-size particle models with LAMMPS.
|
||||
----------
|
||||
|
||||
All of the point-particle styles assign mass to particles on a
|
||||
per-type basis, using the :doc:`mass <mass>` command, The finite-size
|
||||
particle styles assign mass to individual particles on a per-particle
|
||||
basis.
|
||||
Particle size and mass
|
||||
""""""""""""""""""""""
|
||||
|
||||
For the *sphere* and *bpm/sphere* styles, the particles are spheres
|
||||
and each stores a per-particle diameter and mass. If the diameter >
|
||||
0.0, the particle is a finite-size sphere. If the diameter = 0.0, it
|
||||
is a point particle. Note that by use of the *disc* keyword with the
|
||||
:doc:`fix nve/sphere <fix_nve_sphere>`, :doc:`fix nvt/sphere
|
||||
<fix_nvt_sphere>`, :doc:`fix nph/sphere <fix_nph_sphere>`,
|
||||
:doc:`fix npt/sphere <fix_npt_sphere>` commands for the *sphere* style,
|
||||
spheres can be effectively treated as 2d discs for a 2d simulation if
|
||||
desired. See also the :doc:`set density/disc <set>` command. These
|
||||
styles take an optional 0 or 1 argument. A value of 0 means the
|
||||
radius of each sphere is constant for the duration of the simulation.
|
||||
A value of 1 means the radii may vary dynamically during the simulation,
|
||||
e.g. due to use of the :doc:`fix adapt <fix_adapt>` command.
|
||||
All of the atom styles define point particles unless they (1) define
|
||||
finite-size spherical particles via the *radius* attribute, or (2)
|
||||
define finite-size aspherical particles (e.g. the *body*, *ellipsoid*,
|
||||
*line*, and *tri* styles). Most of these styles can also be used with
|
||||
mixtures of point and finite-size particles.
|
||||
|
||||
For the *ellipsoid* style, the particles are ellipsoids and each
|
||||
stores a flag which indicates whether it is a finite-size ellipsoid or
|
||||
a point particle. If it is an ellipsoid, it also stores a shape
|
||||
vector with the 3 diameters of the ellipsoid and a quaternion 4-vector
|
||||
with its orientation.
|
||||
Note that the *radius* property may need to be provided as a
|
||||
*diameter* (e.g. in :doc:`molecule files <molecule>` or :doc:`data
|
||||
files <read_data>`). See the :doc:`Howto spherical <Howto_spherical>`
|
||||
page for an overview of using finite-size spherical and aspherical
|
||||
particle models with LAMMPS.
|
||||
|
||||
For the *dielectric* style, each particle can be either a physical
|
||||
particle (e.g. an ion), or an interface particle representing a boundary
|
||||
element between two regions of different dielectric constant. For
|
||||
interface particles, in addition to the properties associated with
|
||||
atom_style full, each particle also should be assigned a normal unit
|
||||
vector (defined by normx, normy, normz), an area (area/patch), the
|
||||
difference and mean of the dielectric constants of two sides of the
|
||||
interface along the direction of the normal vector (ed and em), the
|
||||
local dielectric constant at the boundary element (epsilon), and a mean
|
||||
local curvature (curv). Physical particles must be assigned these
|
||||
values, as well, but only their local dielectric constants will be used;
|
||||
see documentation for associated :doc:`pair styles <pair_dielectric>`
|
||||
and :doc:`fixes <fix_polarize>`. The distinction between the physical
|
||||
and interface particles is only meaningful when :doc:`fix polarize
|
||||
<fix_polarize>` commands are applied to the interface particles. This
|
||||
style is part of the DIELECTRIC package.
|
||||
Unless an atom style defines the per-atom *rmass* attribute, particle
|
||||
masses are defined on a per-type basis, using the :doc:`mass <mass>`
|
||||
command. This means each particle's mass is indexed by its atom
|
||||
*type*.
|
||||
|
||||
For the *dipole* style, a point dipole is defined for each point
|
||||
particle. Note that if you wish the particles to be finite-size
|
||||
spheres as in a Stockmayer potential for a dipolar fluid, so that the
|
||||
particles can rotate due to dipole-dipole interactions, then you need
|
||||
to use atom_style hybrid sphere dipole, which will assign both a
|
||||
diameter and dipole moment to each particle.
|
||||
A few styles define the per-atom *rmass* attribute which can also be
|
||||
added using the :doc:`fix property/atom <fix_property_atom>` command.
|
||||
In this case each particle stores its own mass. Atom styles that have
|
||||
a per-atom rmass may define it indirectly through setting particle
|
||||
diameter and density on a per-particle basis. If both per-type mass
|
||||
and per-atom *rmass* are defined (e.g. in a hybrid style), the
|
||||
per-atom mass will take precedence in any operation which which works
|
||||
with both flavors of mass.
|
||||
|
||||
For the *electron* style, the particles representing electrons are 3d
|
||||
Gaussians with a specified position and bandwidth or uncertainty in
|
||||
position, which is represented by the eradius = electron size.
|
||||
----------
|
||||
|
||||
For the *peri* style, the particles are spherical and each stores a
|
||||
per-particle mass and volume.
|
||||
|
||||
The *bpm/sphere* style is part of the BPM package.
|
||||
|
||||
The *oxdna* style is for coarse-grained nucleotides and stores the
|
||||
3'-to-5' polarity of the nucleotide strand, which is set through
|
||||
the bond topology in the data file. The first (second) atom in a
|
||||
bond definition is understood to point towards the 3'-end (5'-end)
|
||||
of the strand. Note that this style is part of the CG-DNA package.
|
||||
|
||||
The *dpd* style is for dissipative particle dynamics (DPD) particles.
|
||||
Note that it is part of the DPD-REACT package, and is not for use with
|
||||
the :doc:`pair_style dpd or dpd/stat <pair_dpd>` commands, which can
|
||||
simply use atom_style atomic. Atom_style dpd extends DPD particle
|
||||
properties with internal temperature (dpdTheta), internal conductive
|
||||
energy (uCond), internal mechanical energy (uMech), and internal
|
||||
chemical energy (uChem).
|
||||
|
||||
The *edpd* style is for energy-conserving dissipative particle
|
||||
dynamics (eDPD) particles which store a temperature (edpd_temp), and
|
||||
heat capacity(edpd_cv).
|
||||
|
||||
The *mdpd* style is for many-body dissipative particle dynamics (mDPD)
|
||||
particles which store a density (rho) for considering
|
||||
density-dependent many-body interactions.
|
||||
|
||||
The *tdpd* style is for transport dissipative particle dynamics (tDPD)
|
||||
particles which store a set of chemical concentration. An integer
|
||||
"cc_species" is required to specify the number of chemical species
|
||||
involved in a tDPD system.
|
||||
|
||||
The *sph* style is for smoothed particle hydrodynamics (SPH)
|
||||
particles which store a density (rho), energy (esph), and heat capacity
|
||||
(cv).
|
||||
|
||||
The *smd* style is for a general formulation of Smooth Particle
|
||||
Hydrodynamics. Both fluids and solids can be modeled. Particles
|
||||
store the mass and volume of an integration point, a kernel diameter
|
||||
used for calculating the field variables (e.g. stress and deformation)
|
||||
and a contact radius for calculating repulsive forces which prevent
|
||||
individual physical bodies from penetrating each other.
|
||||
|
||||
For the *spin* style, a magnetic spin is associated to each atom.
|
||||
Those spins have a norm (their magnetic moment) and a direction.
|
||||
|
||||
The *wavepacket* style is similar to *electron*, but the electrons may
|
||||
consist of several Gaussian wave packets, summed up with coefficients
|
||||
cs= (cs_re,cs_im). Each of the wave packets is treated as a separate
|
||||
particle in LAMMPS, wave packets belonging to the same electron must
|
||||
have identical *etag* values.
|
||||
|
||||
For the *line* style, the particles are idealized line segments and
|
||||
each stores a per-particle mass and length and orientation (i.e. the
|
||||
end points of the line segment).
|
||||
|
||||
For the *tri* style, the particles are planar triangles and each
|
||||
stores a per-particle mass and size and orientation (i.e. the corner
|
||||
points of the triangle).
|
||||
|
||||
The *template* style allows molecular topology (bonds,angles,etc) to be
|
||||
defined via a molecule template using the :doc:`molecule <molecule>`
|
||||
command. The template stores one or more molecules with a single copy
|
||||
of the topology info (bonds,angles,etc) of each. Individual atoms
|
||||
only store a template index and template atom to identify which
|
||||
molecule and which atom-within-the-molecule they represent. Using the
|
||||
*template* style instead of the *bond*, *angle*, *molecular* styles
|
||||
can save memory for systems comprised of a large number of small
|
||||
molecules, all of a single type (or small number of types). See the
|
||||
paper by Grime and Voth, in :ref:`(Grime) <Grime>`, for examples of how this
|
||||
can be advantageous for large-scale coarse-grained systems.
|
||||
The ``examples/template`` directory has a few demo inputs and examples
|
||||
showing the use of the *template* atom style versus *molecular*.
|
||||
|
||||
.. note::
|
||||
|
||||
When using the *template* style with a :doc:`molecule template
|
||||
<molecule>` that contains multiple molecules, you should ensure the
|
||||
atom types, bond types, angle_types, etc in all the molecules are
|
||||
consistent. E.g. if one molecule represents H2O and another CO2,
|
||||
then you probably do not want each molecule file to define 2 atom
|
||||
types and a single bond type, because they will conflict with each
|
||||
other when a mixture system of H2O and CO2 molecules is defined,
|
||||
e.g. by the :doc:`read_data <read_data>` command. Rather the H2O
|
||||
molecule should define atom types 1 and 2, and bond type 1. And
|
||||
the CO2 molecule should define atom types 3 and 4 (or atom types 3
|
||||
and 2 if a single oxygen type is desired), and bond type 2.
|
||||
Additional information about specific atom styles
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
For the *body* style, the particles are arbitrary bodies with internal
|
||||
attributes defined by the "style" of the bodies, which is specified by
|
||||
@ -309,6 +282,148 @@ Note that there may be additional arguments required along with the
|
||||
*bstyle* specification, in the atom_style body command. These
|
||||
arguments are described on the :doc:`Howto body <Howto_body>` doc page.
|
||||
|
||||
For the *dielectric* style, each particle can be either a physical
|
||||
particle (e.g. an ion), or an interface particle representing a boundary
|
||||
element between two regions of different dielectric constant. For
|
||||
interface particles, in addition to the properties associated with
|
||||
atom_style full, each particle also should be assigned a normal unit
|
||||
vector (defined by normx, normy, normz), an area (area/patch), the
|
||||
difference and mean of the dielectric constants of two sides of the
|
||||
interface along the direction of the normal vector (ed and em), the
|
||||
local dielectric constant at the boundary element (epsilon), and a mean
|
||||
local curvature (curv). Physical particles must be assigned these
|
||||
values, as well, but only their local dielectric constants will be used;
|
||||
see documentation for associated :doc:`pair styles <pair_dielectric>`
|
||||
and :doc:`fixes <fix_polarize>`. The distinction between the physical
|
||||
and interface particles is only meaningful when :doc:`fix polarize
|
||||
<fix_polarize>` commands are applied to the interface particles. This
|
||||
style is part of the DIELECTRIC package.
|
||||
|
||||
For the *dipole* style, a point dipole vector mu is defined for each
|
||||
point particle. Note that if you wish the particles to be finite-size
|
||||
spheres as in a Stockmayer potential for a dipolar fluid, so that the
|
||||
particles can rotate due to dipole-dipole interactions, then you need
|
||||
to use the command `atom_style hybrid sphere dipole`, which will
|
||||
assign both a diameter and dipole moment to each particle. This also
|
||||
requires using an integrator with a "/sphere" suffix like :doc:`fix
|
||||
nve/sphere <fix_nve_sphere>` or :doc:`fix nvt/sphere <fix_nvt_sphere>`
|
||||
and the "update dipole" or "update dlm" parameters to the fix
|
||||
commands.
|
||||
|
||||
The *dpd* style is for reactive dissipative particle dynamics (DPD)
|
||||
particles. Note that it is part of the DPD-REACT package, and is not
|
||||
required for use with the :doc:`pair_style dpd or dpd/stat <pair_dpd>`
|
||||
commands, which only require the attributes from atom_style *atomic*.
|
||||
Atom_style *dpd* extends DPD particle properties with internal
|
||||
temperature (dpdTheta), internal conductive energy (uCond), internal
|
||||
mechanical energy (uMech), and internal chemical energy (uChem).
|
||||
|
||||
The *edpd* style is for energy-conserving dissipative particle
|
||||
dynamics (eDPD) particles which store a temperature (edpd_temp), and
|
||||
heat capacity (edpd_cv).
|
||||
|
||||
For the *electron* style, the particles representing electrons are 3d
|
||||
Gaussians with a specified position and bandwidth or uncertainty in
|
||||
position, which is represented by the eradius = electron size.
|
||||
|
||||
For the *ellipsoid* style, particles can be ellipsoids which each
|
||||
stores a shape vector with the 3 diameters of the ellipsoid and a
|
||||
quaternion 4-vector with its orientation. Each particle stores a flag
|
||||
in the ellipsoid vector which indicates whether it is an ellipsoid (1)
|
||||
or a point particle (0).
|
||||
|
||||
For the *line* style, particles can be are idealized line segments
|
||||
which store a per-particle mass and length and orientation (i.e. the
|
||||
end points of the line segment). Each particle stores a flag in the
|
||||
line vector which indicates whether it is a line segment (1) or a
|
||||
point particle (0).
|
||||
|
||||
The *mdpd* style is for many-body dissipative particle dynamics (mDPD)
|
||||
particles which store a density (rho) for considering density-dependent
|
||||
many-body interactions.
|
||||
|
||||
The *oxdna* style is for coarse-grained nucleotides and stores the
|
||||
3'-to-5' polarity of the nucleotide strand, which is set through
|
||||
the bond topology in the data file. The first (second) atom in a
|
||||
bond definition is understood to point towards the 3'-end (5'-end)
|
||||
of the strand.
|
||||
|
||||
For the *peri* style, the particles are spherical and each stores a
|
||||
per-particle mass and volume.
|
||||
|
||||
The *smd* style is for Smooth Particle Mach dynamics. Both fluids and
|
||||
solids can be modeled. Particles store the mass and volume of an
|
||||
integration point, a kernel diameter used for calculating the field
|
||||
variables (e.g. stress and deformation) and a contact radius for
|
||||
calculating repulsive forces which prevent individual physical bodies
|
||||
from penetrating each other.
|
||||
|
||||
The *sph* style is for smoothed particle hydrodynamics (SPH) particles
|
||||
which store a density (rho), energy (esph), and heat capacity (cv).
|
||||
|
||||
For the *spin* style, a magnetic spin is associated with each atom.
|
||||
Those spins have a norm (their magnetic moment) and a direction.
|
||||
|
||||
The *tdpd* style is for transport dissipative particle dynamics (tDPD)
|
||||
particles which store a set of chemical concentration. An integer
|
||||
"cc_species" is required to specify the number of chemical species
|
||||
involved in a tDPD system.
|
||||
|
||||
The *wavepacket* style is similar to the *electron* style, but the
|
||||
electrons may consist of several Gaussian wave packets, summed up with
|
||||
coefficients cs= (cs_re,cs_im). Each of the wave packets is treated
|
||||
as a separate particle in LAMMPS, wave packets belonging to the same
|
||||
electron must have identical *etag* values.
|
||||
|
||||
The *sphere* and *bpm/sphere* styles allow particles to be either point
|
||||
particles or finite-size particles. If the *radius* attribute is >
|
||||
0.0, the particle is a finite-size sphere. If the diameter = 0.0, it
|
||||
is a point particle. Note that by using the *disc* keyword with the
|
||||
:doc:`fix nve/sphere <fix_nve_sphere>`, :doc:`fix nvt/sphere
|
||||
<fix_nvt_sphere>`, :doc:`fix nph/sphere <fix_nph_sphere>`, :doc:`fix
|
||||
npt/sphere <fix_npt_sphere>` commands for the *sphere* style, spheres
|
||||
can be effectively treated as 2d discs for a 2d simulation if desired.
|
||||
See also the :doc:`set density/disc <set>` command. These styles also
|
||||
take an optional 0 or 1 argument. A value of 0 means the radius of
|
||||
each sphere is constant for the duration of the simulation (this is
|
||||
the default). A value of 1 means the radii may vary dynamically
|
||||
during the simulation, e.g. due to use of the :doc:`fix adapt
|
||||
<fix_adapt>` command.
|
||||
|
||||
The *template* style allows molecular topology (bonds,angles,etc) to be
|
||||
defined via a molecule template using the :doc:`molecule <molecule>`
|
||||
command. The template stores one or more molecules with a single copy
|
||||
of the topology info (bonds,angles,etc) of each. Individual atoms only
|
||||
store a template index and template atom to identify which molecule and
|
||||
which atom-within-the-molecule they represent. Using the *template*
|
||||
style instead of the *bond*, *angle*, *molecular* styles can save memory
|
||||
for systems comprised of a large number of small molecules, all of a
|
||||
single type (or small number of types). See the paper by Grime and
|
||||
Voth, in :ref:`(Grime) <Grime>`, for examples of how this can be
|
||||
advantageous for large-scale coarse-grained systems. The
|
||||
``examples/template`` directory has a few demo inputs and examples
|
||||
showing the use of the *template* atom style versus *molecular*.
|
||||
|
||||
.. note::
|
||||
|
||||
When using the *template* style with a :doc:`molecule template
|
||||
<molecule>` that contains multiple molecules, you should ensure the
|
||||
atom types, bond types, angle_types, etc in all the molecules are
|
||||
consistent. E.g. if one molecule represents H2O and another CO2,
|
||||
then you probably do not want each molecule file to define 2 atom
|
||||
types and a single bond type, because they will conflict with each
|
||||
other when a mixture system of H2O and CO2 molecules is defined,
|
||||
e.g. by the :doc:`read_data <read_data>` command. Rather the H2O
|
||||
molecule should define atom types 1 and 2, and bond type 1. And
|
||||
the CO2 molecule should define atom types 3 and 4 (or atom types 3
|
||||
and 2 if a single oxygen type is desired), and bond type 2.
|
||||
|
||||
For the *tri* style, particles can be planar triangles which each
|
||||
stores a per-particle mass and size and orientation (i.e. the corner
|
||||
points of the triangle). Each particle stores a flag in the tri
|
||||
vector which indicates whether it is a triangle (1) or a point
|
||||
particle (0).
|
||||
|
||||
----------
|
||||
|
||||
Typically, simulations require only a single (non-hybrid) atom style.
|
||||
@ -326,11 +441,12 @@ dipole". When a hybrid style is used, atoms store and communicate the
|
||||
union of all quantities implied by the individual styles.
|
||||
|
||||
When using the *hybrid* style, you cannot combine the *template* style
|
||||
with another molecular style that stores bond,angle,etc info on a
|
||||
with another molecular style that stores bond, angle, etc info on a
|
||||
per-atom basis.
|
||||
|
||||
LAMMPS can be extended with new atom styles as well as new body
|
||||
styles; see the :doc:`Modify <Modify>` doc page.
|
||||
LAMMPS can be extended with new atom styles as well as new body styles;
|
||||
see the corresponding manual page on :doc:`modifying & extending LAMMPS
|
||||
<Modify_atom>`.
|
||||
|
||||
----------
|
||||
|
||||
@ -346,54 +462,20 @@ This command cannot be used after the simulation box is defined by a
|
||||
|
||||
Many of the styles listed above are only enabled if LAMMPS was built
|
||||
with a specific package, as listed below. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
The *amoeba* style is part of the AMOEBA package.
|
||||
|
||||
The *angle*, *bond*, *full*, *molecular*, and *template* styles are
|
||||
part of the MOLECULE package.
|
||||
|
||||
The *line* and *tri* styles are part of the ASPHERE package.
|
||||
|
||||
The *body* style is part of the BODY package.
|
||||
|
||||
The *dipole* style is part of the DIPOLE package.
|
||||
|
||||
The *peri* style is part of the PERI package for Peridynamics.
|
||||
|
||||
The *oxdna* style is part of the CG-DNA package for coarse-grained
|
||||
simulation of DNA and RNA.
|
||||
|
||||
The *electron* style is part of the EFF package for :doc:`electronic
|
||||
force fields <pair_eff>`.
|
||||
|
||||
The *dpd* style is part of the DPD-REACT package for dissipative
|
||||
particle dynamics (DPD).
|
||||
|
||||
The *edpd*, *mdpd*, and *tdpd* styles are part of the DPD-MESO package
|
||||
for energy-conserving dissipative particle dynamics (eDPD), many-body
|
||||
dissipative particle dynamics (mDPD), and transport dissipative particle
|
||||
dynamics (tDPD), respectively.
|
||||
|
||||
The *sph* style is part of the SPH package for smoothed particle
|
||||
hydrodynamics (SPH). See `this PDF guide
|
||||
<PDF/SPH_LAMMPS_userguide.pdf>`_ to using SPH in LAMMPS.
|
||||
|
||||
The *spin* style is part of the SPIN package.
|
||||
|
||||
The *wavepacket* style is part of the AWPMD package for the
|
||||
:doc:`antisymmetrized wave packet MD method <pair_awpmd>`.
|
||||
<Build_package>` page for more info. The table above lists which package
|
||||
is required for individual atom styles.
|
||||
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`read_data <read_data>`, :doc:`pair_style <pair_style>`
|
||||
:doc:`read_data <read_data>`, :doc:`pair_style <pair_style>`,
|
||||
:doc:`fix property/atom <fix_property_atom>`, :doc:`set <set>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
The default atom style is atomic. If atom_style sphere is used its
|
||||
default argument is 0.
|
||||
The default atom style is *atomic*. If atom_style *sphere* or
|
||||
*bpm/sphere* is used, its default argument is 0.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -11,7 +11,16 @@ Syntax
|
||||
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
bond_style lepton
|
||||
bond_style style args
|
||||
|
||||
* style = *lepton*
|
||||
* args = optional arguments
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
args = *auto_offset* or *no_offset*
|
||||
*auto_offset* = offset the potential energy so that the value at r0 is 0.0 (default)
|
||||
*no_offset* = do not offset the potential energy
|
||||
|
||||
Examples
|
||||
""""""""
|
||||
@ -19,6 +28,7 @@ Examples
|
||||
.. code-block:: LAMMPS
|
||||
|
||||
bond_style lepton
|
||||
bond_style lepton no_offset
|
||||
|
||||
bond_coeff 1 1.5 "k*r^2; k=250.0"
|
||||
bond_coeff 2 1.1 "k2*r^2 + k3*r^3 + k4*r^4; k2=300.0; k3=-100.0; k4=50.0"
|
||||
@ -40,6 +50,13 @@ constant *K* of 200.0 energy units:
|
||||
|
||||
U_{bond,i} = K (r_i - r_0)^2 = K r^2 \qquad r = r_i - r_0
|
||||
|
||||
.. versionchanged:: TBD
|
||||
|
||||
By default the potential energy U is shifted so that he value U is 0.0
|
||||
for $r = r_0$. This is equivalent to using the optional keyword
|
||||
*auto_offset*. When using the keyword *no_offset* instead, the
|
||||
potential energy is not shifted.
|
||||
|
||||
The `Lepton library <https://simtk.org/projects/lepton>`_, that the
|
||||
*lepton* bond style interfaces with, evaluates this expression string at
|
||||
run time to compute the pairwise energy. It also creates an analytical
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
.. index:: dihedral_style charmm/kk
|
||||
.. index:: dihedral_style charmm/omp
|
||||
.. index:: dihedral_style charmmfsw
|
||||
.. index:: dihedral_style charmmfsw/kk
|
||||
|
||||
dihedral_style charmm command
|
||||
=============================
|
||||
@ -12,6 +13,8 @@ Accelerator Variants: *charmm/intel*, *charmm/kk*, *charmm/omp*
|
||||
dihedral_style charmmfsw command
|
||||
================================
|
||||
|
||||
Accelerator Variants: *charmmfsw/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -144,7 +147,9 @@ for more info.
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`dihedral_coeff <dihedral_coeff>`
|
||||
:doc:`dihedral_coeff <dihedral_coeff>`,
|
||||
:doc:`pair_style lj/charmm variants <pair_charmm>`,
|
||||
:doc:`angle_style charmm <angle_charmm>`, :doc:`fix cmap <fix_cmap>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -109,7 +109,7 @@ Note that in this case the specified *Kspring* is in
|
||||
force/distance units.
|
||||
|
||||
With a value of *ideal*, the spring force is computed as suggested in
|
||||
ref`(WeinanE) <WeinanE>`
|
||||
:ref:`(WeinanE) <WeinanE>`
|
||||
|
||||
.. math::
|
||||
|
||||
@ -120,18 +120,18 @@ and :math:`RD_{ideal}` is the ideal *RD* for which all the images are
|
||||
equally spaced. I.e. :math:`RD_{ideal} = (i-1) \cdot meanDist` when the
|
||||
climbing replica is off, where *i* is the replica number). The
|
||||
*meanDist* is the average distance between replicas. Note that in this
|
||||
case the specified *Kspring* is in force units. When the climbing replica
|
||||
is on, :math:`RD_{ideal}` and :math:`meanDist` are calculated separately
|
||||
each side of the climbing image. Note that the *ideal* form of nudging
|
||||
can often be more effective at keeping the replicas equally spaced before
|
||||
climbing, then equally spaced either side of the climbing image whilst
|
||||
climbing.
|
||||
case the specified *Kspring* is in force units. When the climbing
|
||||
replica is on, :math:`RD_{ideal}` and :math:`meanDist` are calculated
|
||||
separately each side of the climbing image. Note that the *ideal* form
|
||||
of nudging can often be more effective at keeping the replicas equally
|
||||
spaced before climbing, then equally spaced either side of the climbing
|
||||
image whilst climbing.
|
||||
|
||||
With a value of *equal* the spring force is computed as for *ideal*
|
||||
when the climbing replica is off, promoting equidistance. When the climbing
|
||||
With a value of *equal* the spring force is computed as for *ideal* when
|
||||
the climbing replica is off, promoting equidistance. When the climbing
|
||||
replica is on, the spring force is computed to promote equidistant
|
||||
absolute differences in energy, rather than distance, each side of
|
||||
the climbing image:
|
||||
absolute differences in energy, rather than distance, each side of the
|
||||
climbing image:
|
||||
|
||||
.. math::
|
||||
|
||||
@ -143,23 +143,22 @@ where *ED* is the cumulative sum of absolute energy differences:
|
||||
|
||||
ED = \sum_{i<N} \left|E(R_{i+1}) - E(R_i)\right|,
|
||||
|
||||
*meanEdist* is the average absolute energy difference between
|
||||
replicas up to the climbing image or from the climbing image
|
||||
to the final image, for images before or after the climbing
|
||||
image respectively. :math:`ED_{ideal}` is the corresponding
|
||||
cumulative sum of average absolute energy differences in
|
||||
each case, in close analogy to *ideal*. This form of nudging
|
||||
is to aid schemes which integrate forces along, or near to,
|
||||
NEB pathways such as :doc:`fix_pafi <fix_pafi>`.
|
||||
*meanEdist* is the average absolute energy difference between replicas
|
||||
up to the climbing image or from the climbing image to the final image,
|
||||
for images before or after the climbing image
|
||||
respectively. :math:`ED_{ideal}` is the corresponding cumulative sum of
|
||||
average absolute energy differences in each case, in close analogy to
|
||||
*ideal*. This form of nudging is to aid schemes which integrate forces
|
||||
along, or near to, NEB pathways such as :doc:`fix_pafi <fix_pafi>`.
|
||||
|
||||
----------
|
||||
|
||||
The keyword *perp* specifies if and how a perpendicular nudging force
|
||||
is computed. It adds a spring force perpendicular to the path in
|
||||
order to prevent the path from becoming too strongly kinked. It can
|
||||
The keyword *perp* specifies if and how a perpendicular nudging force is
|
||||
computed. It adds a spring force perpendicular to the path in order to
|
||||
prevent the path from becoming too strongly kinked. It can
|
||||
significantly improve the convergence of the NEB calculation when the
|
||||
resolution is poor. I.e. when few replicas are used; see
|
||||
:ref:`(Maras) <Maras1>` for details.
|
||||
resolution is poor. I.e. when few replicas are used; see :ref:`(Maras)
|
||||
<Maras1>` for details.
|
||||
|
||||
The perpendicular spring force is given by
|
||||
|
||||
@ -181,10 +180,10 @@ force is added.
|
||||
|
||||
By default, no additional forces act on the first and last replicas
|
||||
during the NEB relaxation, so these replicas simply relax toward their
|
||||
respective local minima. By using the key word *end*, additional
|
||||
forces can be applied to the first and/or last replicas, to enable
|
||||
them to relax toward a MEP while constraining their energy E to the
|
||||
target energy ETarget.
|
||||
respective local minima. By using the key word *end*, additional forces
|
||||
can be applied to the first and/or last replicas, to enable them to
|
||||
relax toward a MEP while constraining their energy E to the target
|
||||
energy ETarget.
|
||||
|
||||
If :math:`E_{Target} > E`, the interatomic force :math:`F_i` for the
|
||||
specified replica becomes:
|
||||
@ -197,33 +196,33 @@ specified replica becomes:
|
||||
The "spring" constant on the difference in energies is the specified
|
||||
*Kspring3* value.
|
||||
|
||||
When *estyle* is specified as *first*, the force is applied to the
|
||||
first replica. When *estyle* is specified as *last*, the force is
|
||||
applied to the last replica. Note that the *end* keyword can be used
|
||||
twice to add forces to both the first and last replicas.
|
||||
When *estyle* is specified as *first*, the force is applied to the first
|
||||
replica. When *estyle* is specified as *last*, the force is applied to
|
||||
the last replica. Note that the *end* keyword can be used twice to add
|
||||
forces to both the first and last replicas.
|
||||
|
||||
For both these *estyle* settings, the target energy *ETarget* is set
|
||||
to the initial energy of the replica (at the start of the NEB
|
||||
calculation).
|
||||
|
||||
If the *estyle* is specified as *last/efirst* or *last/efirst/middle*,
|
||||
force is applied to the last replica, but the target energy *ETarget*
|
||||
is continuously set to the energy of the first replica, as it evolves
|
||||
force is applied to the last replica, but the target energy *ETarget* is
|
||||
continuously set to the energy of the first replica, as it evolves
|
||||
during the NEB relaxation.
|
||||
|
||||
The difference between these two *estyle* options is as follows. When
|
||||
*estyle* is specified as *last/efirst*, no change is made to the
|
||||
inter-replica force applied to the intermediate replicas (neither
|
||||
first or last). If the initial path is too far from the MEP, an
|
||||
intermediate replica may relax "faster" and reach a lower energy than
|
||||
the last replica. In this case the intermediate replica will be
|
||||
relaxing toward its own local minima. This behavior can be prevented
|
||||
by specifying *estyle* as *last/efirst/middle* which will alter the
|
||||
inter-replica force applied to intermediate replicas by removing the
|
||||
contribution of the gradient to the inter-replica force. This will
|
||||
only be done if a particular intermediate replica has a lower energy
|
||||
than the first replica. This should effectively prevent the
|
||||
intermediate replicas from over-relaxing.
|
||||
inter-replica force applied to the intermediate replicas (neither first
|
||||
or last). If the initial path is too far from the MEP, an intermediate
|
||||
replica may relax "faster" and reach a lower energy than the last
|
||||
replica. In this case the intermediate replica will be relaxing toward
|
||||
its own local minima. This behavior can be prevented by specifying
|
||||
*estyle* as *last/efirst/middle* which will alter the inter-replica
|
||||
force applied to intermediate replicas by removing the contribution of
|
||||
the gradient to the inter-replica force. This will only be done if a
|
||||
particular intermediate replica has a lower energy than the first
|
||||
replica. This should effectively prevent the intermediate replicas from
|
||||
over-relaxing.
|
||||
|
||||
After converging a NEB calculation using an *estyle* of
|
||||
*last/efirst/middle*, you should check that all intermediate replicas
|
||||
@ -237,9 +236,10 @@ target energy.
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to :doc:`binary restart files <restart>`. None of the :doc:`fix_modify <fix_modify>` options
|
||||
are relevant to this fix. No global or per-atom quantities are stored
|
||||
by this fix for access by various :doc:`output commands <Howto_output>`.
|
||||
No information about this fix is written to :doc:`binary restart files
|
||||
<restart>`. None of the :doc:`fix_modify <fix_modify>` options are
|
||||
relevant to this fix. No global or per-atom quantities are stored by
|
||||
this fix for access by various :doc:`output commands <Howto_output>`.
|
||||
No parameter of this fix can be used with the *start/stop* keywords of
|
||||
the :doc:`run <run>` command.
|
||||
|
||||
|
||||
@ -232,8 +232,6 @@ These fixes are part of the QEQ package. They are only enabled if
|
||||
LAMMPS was built with that package. See the :doc:`Build package
|
||||
<Build_package>` page for more info.
|
||||
|
||||
These qeq fixes are not compatible with the GPU and USER-INTEL packages.
|
||||
|
||||
These qeq fixes will ignore electric field contributions from
|
||||
:doc:`fix efield <fix_efield>`.
|
||||
|
||||
|
||||
@ -126,14 +126,50 @@ molecule (header keyword = inertia).
|
||||
Format of a molecule file
|
||||
"""""""""""""""""""""""""
|
||||
|
||||
The format of an individual molecule file is similar but
|
||||
(not identical) to the data file read by the :doc:`read_data <read_data>`
|
||||
commands, and is as follows.
|
||||
The format of an individual molecule file looks similar but is
|
||||
different than that of a data file read by the :doc:`read_data <read_data>`
|
||||
commands. Here is a simple example for a TIP3P water molecule:
|
||||
|
||||
.. code-block::
|
||||
|
||||
# Water molecule. TIP3P geometry
|
||||
# header section:
|
||||
3 atoms
|
||||
2 bonds
|
||||
1 angles
|
||||
|
||||
# body section:
|
||||
Coords
|
||||
|
||||
1 0.00000 -0.06556 0.00000
|
||||
2 0.75695 0.52032 0.00000
|
||||
3 -0.75695 0.52032 0.00000
|
||||
|
||||
Types
|
||||
|
||||
1 1 # O
|
||||
2 2 # H
|
||||
3 2 # H
|
||||
|
||||
Charges
|
||||
|
||||
1 -0.834
|
||||
2 0.417
|
||||
3 0.417
|
||||
|
||||
Bonds
|
||||
|
||||
1 1 1 2
|
||||
2 1 1 3
|
||||
|
||||
Angles
|
||||
|
||||
1 1 2 1 3
|
||||
|
||||
A molecule file has a header and a body. The header appears first. The
|
||||
first line of the header and thus of the molecule file is *always* skipped;
|
||||
it typically contains a description of the file or a comment from the software
|
||||
that created the file.
|
||||
first line of the header and thus of the molecule file is *always*
|
||||
skipped; it typically contains a description of the file or a comment
|
||||
from the software that created the file.
|
||||
|
||||
Then lines are read one line at a time. Lines can have a trailing
|
||||
comment starting with '#' that is ignored. There *must* be at least one
|
||||
@ -158,25 +194,62 @@ appear if the value(s) are different than the default, except when
|
||||
defining a *body* particle, which requires setting the number of
|
||||
*atoms* to 1, and setting the *inertia* in a specific section (see below).
|
||||
|
||||
* N *atoms* = # of atoms N in molecule, default = 0
|
||||
* Nb *bonds* = # of bonds Nb in molecule, default = 0
|
||||
* Na *angles* = # of angles Na in molecule, default = 0
|
||||
* Nd *dihedrals* = # of dihedrals Nd in molecule, default = 0
|
||||
* Ni *impropers* = # of impropers Ni in molecule, default = 0
|
||||
* Nf *fragments* = # of fragments Nf in molecule, default = 0
|
||||
* Ninteger Ndouble *body* = # of integer and floating-point values
|
||||
in body particle, default = 0
|
||||
* Mtotal *mass* = total mass of molecule
|
||||
* Xc Yc Zc *com* = coordinates of center-of-mass of molecule
|
||||
* Ixx Iyy Izz Ixy Ixz Iyz *inertia* = 6 components of inertia tensor of molecule
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: auto
|
||||
|
||||
For *mass*, *com*, and *inertia*, the default is for LAMMPS to
|
||||
calculate this quantity itself if needed, assuming the molecules
|
||||
consist of a set of point particles or finite-size particles (with a
|
||||
non-zero diameter) that do not overlap. If finite-size particles in
|
||||
the molecule do overlap, LAMMPS will not account for the overlap
|
||||
effects when calculating any of these 3 quantities, so you should
|
||||
pre-compute them yourself and list the values in the file.
|
||||
* - Number(s)
|
||||
- Keyword
|
||||
- Meaning
|
||||
- Default Value
|
||||
* - N
|
||||
- atoms
|
||||
- # of atoms N in molecule
|
||||
- 0
|
||||
* - Nb
|
||||
- bonds
|
||||
- # of bonds Nb in molecule
|
||||
- 0
|
||||
* - Na
|
||||
- angles
|
||||
- # of angles Na in molecule
|
||||
- 0
|
||||
* - Nd
|
||||
- dihedrals
|
||||
- # of dihedrals Nd in molecule
|
||||
- 0
|
||||
* - Ni
|
||||
- impropers
|
||||
- # of impropers Ni in molecule
|
||||
- 0
|
||||
* - Nf
|
||||
- fragments
|
||||
- # of fragments Nf in molecule
|
||||
- 0
|
||||
* - Ninteger Ndouble
|
||||
- body
|
||||
- # of integer and floating-point values in body particle
|
||||
- 0
|
||||
* - Mtotal
|
||||
- mass
|
||||
- total mass of molecule
|
||||
- computed
|
||||
* - Xc Yc Zc
|
||||
- com
|
||||
- coordinates of center-of-mass of molecule
|
||||
- computed
|
||||
* - Ixx Iyy Izz Ixy Ixz Iyz
|
||||
- inertia
|
||||
- 6 components of inertia tensor of molecule
|
||||
- computed
|
||||
|
||||
For *mass*, *com*, and *inertia*, the default is for LAMMPS to calculate
|
||||
this quantity itself if needed, assuming the molecules consist of a set
|
||||
of point particles or finite-size particles (with a non-zero diameter)
|
||||
that do **not** overlap. If finite-size particles in the molecule
|
||||
**do** overlap, LAMMPS will not account for the overlap effects when
|
||||
calculating any of these 3 quantities, so you should pre-compute them
|
||||
yourself and list the values in the file.
|
||||
|
||||
The mass and center-of-mass coordinates (Xc,Yc,Zc) are
|
||||
self-explanatory. The 6 moments of inertia (ixx,iyy,izz,ixy,ixz,iyz)
|
||||
@ -188,7 +261,7 @@ internally.
|
||||
|
||||
These are the allowed section keywords for the body of the file.
|
||||
|
||||
* *Coords, Types, Molecules, Fragments, Charges, Diameters, Masses* = atom-property sections
|
||||
* *Coords, Types, Molecules, Fragments, Charges, Diameters, Dipoles, Masses* = atom-property sections
|
||||
* *Bonds, Angles, Dihedrals, Impropers* = molecular topology sections
|
||||
* *Special Bond Counts, Special Bonds* = special neighbor info
|
||||
* *Shake Flags, Shake Atoms, Shake Bond Types* = SHAKE info
|
||||
@ -303,6 +376,21 @@ not listed, the default diameter of each atom in the molecule is 1.0.
|
||||
|
||||
----------
|
||||
|
||||
.. versionadded:: TBD
|
||||
|
||||
*Dipoles* section:
|
||||
|
||||
* one line per atom
|
||||
* line syntax: ID mux muy muz
|
||||
* mux,muy,muz = x-, y-, and z-component of point dipole vector of atom
|
||||
|
||||
This section is only allowed for :doc:`atom styles <atom_style>` that
|
||||
support particles with point dipoles, e.g. atom_style dipole. If not
|
||||
listed, the default dipole component of each atom in the molecule is set
|
||||
to 0.0.
|
||||
|
||||
----------
|
||||
|
||||
*Masses* section:
|
||||
|
||||
* one line per atom
|
||||
|
||||
@ -10,7 +10,7 @@ Syntax
|
||||
|
||||
neb etol ftol N1 N2 Nevery file-style arg keyword values
|
||||
|
||||
* etol = stopping tolerance for energy (energy units)
|
||||
* etol = stopping tolerance for energy (dimensionless)
|
||||
* ftol = stopping tolerance for force (force units)
|
||||
* N1 = max # of iterations (timesteps) to run initial NEB
|
||||
* N2 = max # of iterations (timesteps) to run barrier-climbing NEB
|
||||
@ -89,10 +89,11 @@ potentials, and the starting configuration when the neb command is
|
||||
issued should be the same for every replica.
|
||||
|
||||
In a NEB calculation each replica is connected to other replicas by
|
||||
inter-replica nudging forces. These forces are imposed by the :doc:`fix neb <fix_neb>` command, which must be used in conjunction with the
|
||||
neb command. The group used to define the fix neb command defines the
|
||||
NEB atoms which are the only ones that inter-replica springs are
|
||||
applied to. If the group does not include all atoms, then non-NEB
|
||||
inter-replica nudging forces. These forces are imposed by the
|
||||
:doc:`fix neb <fix_neb>` command, which must be used in conjunction
|
||||
with the neb command. The group used to define the fix neb command
|
||||
defines the NEB atoms which are the only ones that inter-replica springs
|
||||
are applied to. If the group does not include all atoms, then non-NEB
|
||||
atoms have no inter-replica springs and the forces they feel and their
|
||||
motion is computed in the usual way due only to other atoms within
|
||||
their replica. Conceptually, the non-NEB atoms provide a background
|
||||
@ -445,7 +446,7 @@ Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`prd <prd>`, :doc:`temper <temper>`, :doc:`fix langevin <fix_langevin>`,
|
||||
:doc:`fix viscous <fix_viscous>`
|
||||
:doc:`fix viscous <fix_viscous>`, :doc:`fix neb <fix_neb>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
.. index:: pair_style lj/charmm/coul/msm/omp
|
||||
.. index:: pair_style lj/charmmfsw/coul/charmmfsh
|
||||
.. index:: pair_style lj/charmmfsw/coul/long
|
||||
.. index:: pair_style lj/charmmfsw/coul/long/kk
|
||||
|
||||
pair_style lj/charmm/coul/charmm command
|
||||
========================================
|
||||
@ -43,6 +44,8 @@ pair_style lj/charmmfsw/coul/charmmfsh command
|
||||
pair_style lj/charmmfsw/coul/long command
|
||||
=========================================
|
||||
|
||||
Accelerator Variants: *lj/charmmfsw/coul/long/kk*
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
@ -281,7 +284,9 @@ page for more info.
|
||||
Related commands
|
||||
""""""""""""""""
|
||||
|
||||
:doc:`pair_coeff <pair_coeff>`
|
||||
:doc:`pair_coeff <pair_coeff>`, :doc:`angle_style charmm <angle_charmm>`,
|
||||
:doc:`dihedral_style charmm <dihedral_charmm>`,
|
||||
:doc:`dihedral_style charmmfsw <dihedral_charmm>`, :doc:`fix cmap <fix_cmap>`
|
||||
|
||||
Default
|
||||
"""""""
|
||||
|
||||
@ -72,7 +72,7 @@ interactions between particles which depend on the distance and have a
|
||||
cutoff. The potential function must be provided as an expression string
|
||||
using "r" as the distance variable. With pair style *lepton/coul* one
|
||||
may additionally reference the charges of the two atoms of the pair with
|
||||
"qi" and "qj", respectively. With pair style *lepton/coul* one may
|
||||
"qi" and "qj", respectively. With pair style *lepton/sphere* one may
|
||||
instead reference the radii of the two atoms of the pair with "radi" and
|
||||
"radj", respectively; this is half of the diameter that can be set in
|
||||
:doc:`data files <read_data>` or the :doc:`set command <set>`.
|
||||
@ -166,8 +166,8 @@ mixing. Thus, expressions for *all* I,J pairs must be specified
|
||||
explicitly.
|
||||
|
||||
Only pair style *lepton* supports the :doc:`pair_modify shift <pair_modify>`
|
||||
option for shifting the energy of the pair interaction so that it is
|
||||
0 at the cutoff, pair styles *lepton/coul* and *lepton/sphere* do *not*.
|
||||
option for shifting the potential energy of the pair interaction so that
|
||||
it is 0 at the cutoff, pair styles *lepton/coul* and *lepton/sphere* do *not*.
|
||||
|
||||
The :doc:`pair_modify table <pair_modify>` options are not relevant for
|
||||
the these pair styles.
|
||||
|
||||
@ -125,6 +125,7 @@ antisymmetry
|
||||
anton
|
||||
Antonelli
|
||||
api
|
||||
apolar
|
||||
Apoorva
|
||||
Appl
|
||||
Appshaw
|
||||
@ -151,6 +152,7 @@ asphericity
|
||||
Asq
|
||||
assignee
|
||||
assively
|
||||
associativity
|
||||
Asta
|
||||
Astart
|
||||
Astop
|
||||
@ -798,6 +800,7 @@ dlabel
|
||||
dlambda
|
||||
DLAMMPS
|
||||
dll
|
||||
dlm
|
||||
dlopen
|
||||
dm
|
||||
dmax
|
||||
@ -1015,6 +1018,7 @@ Ercolessi
|
||||
Erdmann
|
||||
erf
|
||||
erfc
|
||||
erforce
|
||||
Erhart
|
||||
erorate
|
||||
erose
|
||||
@ -2235,8 +2239,10 @@ Mohd
|
||||
Mohles
|
||||
mol
|
||||
Mol
|
||||
molatom
|
||||
molfile
|
||||
Molfile
|
||||
molindex
|
||||
MolPairStyle
|
||||
moltemplate
|
||||
momb
|
||||
@ -2569,6 +2575,7 @@ ns
|
||||
Ns
|
||||
Nsample
|
||||
Nskip
|
||||
nspecial
|
||||
Nspecies
|
||||
nsq
|
||||
Nstart
|
||||
@ -3877,6 +3884,7 @@ versa
|
||||
Verstraelen
|
||||
ves
|
||||
vflag
|
||||
vfrac
|
||||
vhi
|
||||
vibrational
|
||||
Vij
|
||||
|
||||
@ -110,6 +110,8 @@ liblammpsplugin_t *liblammpsplugin_load(const char *lib)
|
||||
ADDSYM(extract_variable);
|
||||
ADDSYM(extract_variable_datatype);
|
||||
ADDSYM(set_variable);
|
||||
ADDSYM(set_string_variable);
|
||||
ADDSYM(set_internal_variable);
|
||||
ADDSYM(variable_info);
|
||||
|
||||
ADDSYM(gather_atoms);
|
||||
|
||||
@ -152,9 +152,11 @@ struct _liblammpsplugin {
|
||||
|
||||
void *(*extract_compute)(void *, const char *, int, int);
|
||||
void *(*extract_fix)(void *, const char *, int, int, int, int);
|
||||
void *(*extract_variable)(void *, const char *, char *);
|
||||
void *(*extract_variable)(void *, const char *, const char *);
|
||||
int (*extract_variable_datatype)(void *, const char *);
|
||||
int (*set_variable)(void *, char *, char *);
|
||||
int (*set_variable)(void *, const char *, const char *);
|
||||
int (*set_string_variable)(void *, const char *, const char *);
|
||||
int (*set_internal_variable)(void *, const char *, double);
|
||||
int (*variable_info)(void *, int, char *, int);
|
||||
|
||||
void (*gather_atoms)(void *, const char *, int, int, void *);
|
||||
|
||||
@ -22,22 +22,26 @@
|
||||
"""
|
||||
Import basic modules
|
||||
"""
|
||||
|
||||
# for python2/3 compatibility
|
||||
from __future__ import print_function
|
||||
|
||||
import sys, os, timeit
|
||||
|
||||
from timeit import default_timer as timer
|
||||
start_time = timer()
|
||||
"""
|
||||
Try to import numpy; if failed, import a local version mynumpy
|
||||
Try to import numpy; if failed, import a local version mynumpy
|
||||
which needs to be provided
|
||||
"""
|
||||
try:
|
||||
import numpy as np
|
||||
except:
|
||||
print >> sys.stderr, "numpy not found. Exiting."
|
||||
print("numpy not found. Exiting.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
"""
|
||||
Check that the required arguments (box offset and size in simulation units
|
||||
Check that the required arguments (box offset and size in simulation units
|
||||
and the sequence file were provided
|
||||
"""
|
||||
try:
|
||||
@ -45,8 +49,8 @@ try:
|
||||
box_length = float(sys.argv[2])
|
||||
infile = sys.argv[3]
|
||||
except:
|
||||
print >> sys.stderr, "Usage: %s <%s> <%s> <%s>" % (sys.argv[0], \
|
||||
"box offset", "box length", "file with sequences")
|
||||
print( "Usage: %s <%s> <%s> <%s>" % (sys.argv[0], \
|
||||
"box offset", "box length", "file with sequences"), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
box = np.array ([box_length, box_length, box_length])
|
||||
|
||||
@ -57,8 +61,7 @@ try:
|
||||
inp = open (infile, 'r')
|
||||
inp.close()
|
||||
except:
|
||||
print >> sys.stderr, "Could not open file '%s' for reading. \
|
||||
Aborting." % infile
|
||||
print( "Could not open file '%s' for reading. Aborting." % infile, file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
# return parts of a string
|
||||
@ -86,7 +89,7 @@ Define auxiliary variables for the construction of a helix
|
||||
# center of the double strand
|
||||
CM_CENTER_DS = POS_BASE + 0.2
|
||||
|
||||
# ideal distance between base sites of two nucleotides
|
||||
# ideal distance between base sites of two nucleotides
|
||||
# which are to be base paired in a duplex
|
||||
BASE_BASE = 0.3897628551303122
|
||||
|
||||
@ -118,7 +121,7 @@ strandnum = []
|
||||
|
||||
bonds = []
|
||||
|
||||
"""
|
||||
"""
|
||||
Convert local body frame to quaternion DOF
|
||||
"""
|
||||
def exyz_to_quat (mya1, mya3):
|
||||
@ -135,25 +138,25 @@ def exyz_to_quat (mya1, mya3):
|
||||
# compute other components from it
|
||||
|
||||
if q0sq >= 0.25:
|
||||
myquat[0] = np.sqrt(q0sq)
|
||||
myquat[1] = (mya2[2] - mya3[1]) / (4.0*myquat[0])
|
||||
myquat[2] = (mya3[0] - mya1[2]) / (4.0*myquat[0])
|
||||
myquat[3] = (mya1[1] - mya2[0]) / (4.0*myquat[0])
|
||||
myquat[0] = np.sqrt(q0sq)
|
||||
myquat[1] = (mya2[2] - mya3[1]) / (4.0*myquat[0])
|
||||
myquat[2] = (mya3[0] - mya1[2]) / (4.0*myquat[0])
|
||||
myquat[3] = (mya1[1] - mya2[0]) / (4.0*myquat[0])
|
||||
elif q1sq >= 0.25:
|
||||
myquat[1] = np.sqrt(q1sq)
|
||||
myquat[0] = (mya2[2] - mya3[1]) / (4.0*myquat[1])
|
||||
myquat[2] = (mya2[0] + mya1[1]) / (4.0*myquat[1])
|
||||
myquat[3] = (mya1[2] + mya3[0]) / (4.0*myquat[1])
|
||||
myquat[1] = np.sqrt(q1sq)
|
||||
myquat[0] = (mya2[2] - mya3[1]) / (4.0*myquat[1])
|
||||
myquat[2] = (mya2[0] + mya1[1]) / (4.0*myquat[1])
|
||||
myquat[3] = (mya1[2] + mya3[0]) / (4.0*myquat[1])
|
||||
elif q2sq >= 0.25:
|
||||
myquat[2] = np.sqrt(q2sq)
|
||||
myquat[0] = (mya3[0] - mya1[2]) / (4.0*myquat[2])
|
||||
myquat[1] = (mya2[0] + mya1[1]) / (4.0*myquat[2])
|
||||
myquat[3] = (mya3[1] + mya2[2]) / (4.0*myquat[2])
|
||||
myquat[2] = np.sqrt(q2sq)
|
||||
myquat[0] = (mya3[0] - mya1[2]) / (4.0*myquat[2])
|
||||
myquat[1] = (mya2[0] + mya1[1]) / (4.0*myquat[2])
|
||||
myquat[3] = (mya3[1] + mya2[2]) / (4.0*myquat[2])
|
||||
elif q3sq >= 0.25:
|
||||
myquat[3] = np.sqrt(q3sq)
|
||||
myquat[0] = (mya1[1] - mya2[0]) / (4.0*myquat[3])
|
||||
myquat[1] = (mya3[0] + mya1[2]) / (4.0*myquat[3])
|
||||
myquat[2] = (mya3[1] + mya2[2]) / (4.0*myquat[3])
|
||||
myquat[3] = np.sqrt(q3sq)
|
||||
myquat[0] = (mya1[1] - mya2[0]) / (4.0*myquat[3])
|
||||
myquat[1] = (mya3[0] + mya1[2]) / (4.0*myquat[3])
|
||||
myquat[2] = (mya3[1] + mya2[2]) / (4.0*myquat[3])
|
||||
|
||||
norm = 1.0/np.sqrt(myquat[0]*myquat[0] + myquat[1]*myquat[1] + \
|
||||
myquat[2]*myquat[2] + myquat[3]*myquat[3])
|
||||
@ -169,62 +172,62 @@ Adds a strand to the system by appending it to the array of previous strands
|
||||
"""
|
||||
def add_strands (mynewpositions, mynewa1s, mynewa3s):
|
||||
overlap = False
|
||||
|
||||
# This is a simple check for each of the particles where for previously
|
||||
# placed particles i we check whether it overlaps with any of the
|
||||
|
||||
# This is a simple check for each of the particles where for previously
|
||||
# placed particles i we check whether it overlaps with any of the
|
||||
# newly created particles j
|
||||
|
||||
print >> sys.stdout, "## Checking for overlaps"
|
||||
print( "## Checking for overlaps", file=sys.stdout)
|
||||
|
||||
for i in xrange(len(positions)):
|
||||
for i in range(len(positions)):
|
||||
|
||||
p = positions[i]
|
||||
pa1 = a1s[i]
|
||||
p = positions[i]
|
||||
pa1 = a1s[i]
|
||||
|
||||
for j in xrange (len(mynewpositions)):
|
||||
for j in range (len(mynewpositions)):
|
||||
|
||||
q = mynewpositions[j]
|
||||
qa1 = mynewa1s[j]
|
||||
q = mynewpositions[j]
|
||||
qa1 = mynewa1s[j]
|
||||
|
||||
# skip particles that are anyway too far away
|
||||
dr = p - q
|
||||
dr -= box * np.rint (dr / box)
|
||||
if np.dot(dr, dr) > RC2:
|
||||
continue
|
||||
# skip particles that are anyway too far away
|
||||
dr = p - q
|
||||
dr -= box * np.rint(dr / box)
|
||||
if np.dot(dr, dr) > RC2:
|
||||
continue
|
||||
|
||||
# base site and backbone site of the two particles
|
||||
# base site and backbone site of the two particles
|
||||
p_pos_back = p + pa1 * POS_BACK
|
||||
p_pos_base = p + pa1 * POS_BASE
|
||||
q_pos_back = q + qa1 * POS_BACK
|
||||
q_pos_base = q + qa1 * POS_BASE
|
||||
|
||||
# check for no overlap between the two backbone sites
|
||||
# check for no overlap between the two backbone sites
|
||||
dr = p_pos_back - q_pos_back
|
||||
dr -= box * np.rint (dr / box)
|
||||
dr -= box * np.rint(dr / box)
|
||||
if np.dot(dr, dr) < RC2_BACK:
|
||||
overlap = True
|
||||
|
||||
# check for no overlap between the two base sites
|
||||
# check for no overlap between the two base sites
|
||||
dr = p_pos_base - q_pos_base
|
||||
dr -= box * np.rint (dr / box)
|
||||
dr -= box * np.rint(dr / box)
|
||||
if np.dot(dr, dr) < RC2_BASE:
|
||||
overlap = True
|
||||
|
||||
# check for no overlap between backbone site of particle p
|
||||
# with base site of particle q
|
||||
# check for no overlap between backbone site of particle p
|
||||
# with base site of particle q
|
||||
dr = p_pos_back - q_pos_base
|
||||
dr -= box * np.rint (dr / box)
|
||||
if np.dot(dr, dr) < RC2_BACK_BASE:
|
||||
overlap = True
|
||||
|
||||
# check for no overlap between base site of particle p and
|
||||
# backbone site of particle q
|
||||
# check for no overlap between base site of particle p and
|
||||
# backbone site of particle q
|
||||
dr = p_pos_base - q_pos_back
|
||||
dr -= box * np.rint (dr / box)
|
||||
if np.dot(dr, dr) < RC2_BACK_BASE:
|
||||
overlap = True
|
||||
|
||||
# exit if there is an overlap
|
||||
# exit if there is an overlap
|
||||
if overlap:
|
||||
return False
|
||||
|
||||
@ -237,10 +240,10 @@ def add_strands (mynewpositions, mynewa1s, mynewa3s):
|
||||
a1s.append (p)
|
||||
for p in mynewa3s:
|
||||
a3s.append (p)
|
||||
# calculate quaternion from local body frame and append
|
||||
for ia in xrange(len(mynewpositions)):
|
||||
mynewquaternions = exyz_to_quat(mynewa1s[ia],mynewa3s[ia])
|
||||
quaternions.append(mynewquaternions)
|
||||
# calculate quaternion from local body frame and append
|
||||
for ia in range(len(mynewpositions)):
|
||||
mynewquaternions = exyz_to_quat(mynewa1s[ia],mynewa3s[ia])
|
||||
quaternions.append(mynewquaternions)
|
||||
|
||||
return True
|
||||
|
||||
@ -281,7 +284,7 @@ def get_rotation_matrix(axis, anglest):
|
||||
[olc*x*z-st*y, olc*y*z+st*x, olc*z*z+ct]])
|
||||
|
||||
"""
|
||||
Generates the position and orientation vectors of a
|
||||
Generates the position and orientation vectors of a
|
||||
(single or double) strand from a sequence string
|
||||
"""
|
||||
def generate_strand(bp, sequence=None, start_pos=np.array([0, 0, 0]), \
|
||||
@ -295,76 +298,75 @@ def generate_strand(bp, sequence=None, start_pos=np.array([0, 0, 0]), \
|
||||
# overall direction of the helix
|
||||
dir = np.array(dir, dtype=float)
|
||||
if sequence == None:
|
||||
sequence = np.random.randint(1, 5, bp)
|
||||
sequence = np.random.randint(1, 5, bp)
|
||||
|
||||
# the elseif here is most likely redundant
|
||||
# the elseif here is most likely redundant
|
||||
elif len(sequence) != bp:
|
||||
n = bp - len(sequence)
|
||||
sequence += np.random.randint(1, 5, n)
|
||||
print >> sys.stderr, "sequence is too short, adding %d random bases" % n
|
||||
n = bp - len(sequence)
|
||||
sequence += np.random.randint(1, 5, n)
|
||||
print( "sequence is too short, adding %d random bases" % n, file=sys.stderr)
|
||||
|
||||
# normalize direction
|
||||
dir_norm = np.sqrt(np.dot(dir,dir))
|
||||
if dir_norm < 1e-10:
|
||||
print >> sys.stderr, "direction must be a valid vector, \
|
||||
defaulting to (0, 0, 1)"
|
||||
dir = np.array([0, 0, 1])
|
||||
print( "direction must be a valid vector, defaulting to (0, 0, 1)", file=sys.stderr)
|
||||
dir = np.array([0, 0, 1])
|
||||
else: dir /= dir_norm
|
||||
|
||||
# find a vector orthogonal to dir to act as helix direction,
|
||||
# if not provided switch off random orientation
|
||||
if perp is None or perp is False:
|
||||
v1 = np.random.random_sample(3)
|
||||
v1 -= dir * (np.dot(dir, v1))
|
||||
v1 /= np.sqrt(sum(v1*v1))
|
||||
v1 = np.random.random_sample(3)
|
||||
v1 -= dir * (np.dot(dir, v1))
|
||||
v1 /= np.sqrt(sum(v1*v1))
|
||||
else:
|
||||
v1 = perp;
|
||||
v1 = perp;
|
||||
|
||||
# generate rotational matrix representing the overall rotation of the helix
|
||||
R0 = get_rotation_matrix(dir, rot)
|
||||
|
||||
|
||||
# rotation matrix corresponding to one step along the helix
|
||||
R = get_rotation_matrix(dir, [1, "bp"])
|
||||
|
||||
# set the vector a1 (backbone to base) to v1
|
||||
# set the vector a1 (backbone to base) to v1
|
||||
a1 = v1
|
||||
|
||||
# apply the global rotation to a1
|
||||
|
||||
# apply the global rotation to a1
|
||||
a1 = np.dot(R0, a1)
|
||||
|
||||
|
||||
# set the position of the fist backbone site to start_pos
|
||||
rb = np.array(start_pos)
|
||||
|
||||
|
||||
# set a3 to the direction of the helix
|
||||
a3 = dir
|
||||
for i in range(bp):
|
||||
# work out the position of the centre of mass of the nucleotide
|
||||
rcdm = rb - CM_CENTER_DS * a1
|
||||
|
||||
# append to newpositions
|
||||
mynewpositions.append(rcdm)
|
||||
mynewa1s.append(a1)
|
||||
mynewa3s.append(a3)
|
||||
|
||||
# if we are not at the end of the helix, we work out a1 and rb for the
|
||||
# next nucleotide along the helix
|
||||
if i != bp - 1:
|
||||
a1 = np.dot(R, a1)
|
||||
rb += a3 * BASE_BASE
|
||||
rcdm = rb - CM_CENTER_DS * a1
|
||||
|
||||
# if we are working on a double strand, we do a cycle similar
|
||||
# append to newpositions
|
||||
mynewpositions.append(rcdm)
|
||||
mynewa1s.append(a1)
|
||||
mynewa3s.append(a3)
|
||||
|
||||
# if we are not at the end of the helix, we work out a1 and rb for the
|
||||
# next nucleotide along the helix
|
||||
if i != bp - 1:
|
||||
a1 = np.dot(R, a1)
|
||||
rb += a3 * BASE_BASE
|
||||
|
||||
# if we are working on a double strand, we do a cycle similar
|
||||
# to the previous one but backwards
|
||||
if double == True:
|
||||
a1 = -a1
|
||||
a3 = -dir
|
||||
R = R.transpose()
|
||||
for i in range(bp):
|
||||
rcdm = rb - CM_CENTER_DS * a1
|
||||
mynewpositions.append (rcdm)
|
||||
mynewa1s.append (a1)
|
||||
mynewa3s.append (a3)
|
||||
a1 = np.dot(R, a1)
|
||||
rb += a3 * BASE_BASE
|
||||
a1 = -a1
|
||||
a3 = -dir
|
||||
R = R.transpose()
|
||||
for i in range(bp):
|
||||
rcdm = rb - CM_CENTER_DS * a1
|
||||
mynewpositions.append (rcdm)
|
||||
mynewa1s.append (a1)
|
||||
mynewa3s.append (a3)
|
||||
a1 = np.dot(R, a1)
|
||||
rb += a3 * BASE_BASE
|
||||
|
||||
assert (len (mynewpositions) > 0)
|
||||
|
||||
@ -391,10 +393,10 @@ def read_strands(filename):
|
||||
try:
|
||||
infile = open (filename)
|
||||
except:
|
||||
print >> sys.stderr, "Could not open file '%s'. Aborting." % filename
|
||||
print( "Could not open file '%s'. Aborting." % filename, file=sys.stderr )
|
||||
sys.exit(2)
|
||||
|
||||
# This block works out the number of nucleotides and strands by reading
|
||||
# This block works out the number of nucleotides and strands by reading
|
||||
# the number of non-empty lines in the input file and the number of letters,
|
||||
# taking the possible DOUBLE keyword into account.
|
||||
nstrands, nnucl, nbonds = 0, 0, 0
|
||||
@ -406,30 +408,29 @@ def read_strands(filename):
|
||||
if line[:6] == 'DOUBLE':
|
||||
line = line.split()[1]
|
||||
length = len(line)
|
||||
print >> sys.stdout, "## Found duplex of %i base pairs" % length
|
||||
print( "## Found duplex of %i base pairs" % length, file=sys.stdout)
|
||||
nnucl += 2*length
|
||||
nstrands += 2
|
||||
nbonds += (2*length-2)
|
||||
nbonds += (2*length-2)
|
||||
else:
|
||||
line = line.split()[0]
|
||||
length = len(line)
|
||||
print >> sys.stdout, \
|
||||
"## Found single strand of %i bases" % length
|
||||
print( "## Found single strand of %i bases" % length, file=sys.stdout)
|
||||
nnucl += length
|
||||
nstrands += 1
|
||||
nbonds += length-1
|
||||
nbonds += length-1
|
||||
# rewind the sequence input file
|
||||
infile.seek(0)
|
||||
|
||||
print >> sys.stdout, "## nstrands, nnucl = ", nstrands, nnucl
|
||||
print( "## nstrands, nnucl = ", nstrands, nnucl, file=sys.stdout)
|
||||
|
||||
# generate the data file in LAMMPS format
|
||||
try:
|
||||
out = open ("data.oxdna", "w")
|
||||
except:
|
||||
print >> sys.stderr, "Could not open data file for writing. Aborting."
|
||||
print( "Could not open data file for writing. Aborting.", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
|
||||
lines = infile.readlines()
|
||||
nlines = len(lines)
|
||||
i = 1
|
||||
@ -440,115 +441,114 @@ def read_strands(filename):
|
||||
line = line.upper().strip()
|
||||
|
||||
# skip empty lines
|
||||
if len(line) == 0:
|
||||
i += 1
|
||||
continue
|
||||
if len(line) == 0:
|
||||
i += 1
|
||||
continue
|
||||
|
||||
# block for duplexes: last argument of the generate function
|
||||
# is set to 'True'
|
||||
# block for duplexes: last argument of the generate function
|
||||
# is set to 'True'
|
||||
if line[:6] == 'DOUBLE':
|
||||
line = line.split()[1]
|
||||
length = len(line)
|
||||
seq = [(base_to_number[x]) for x in line]
|
||||
|
||||
myns += 1
|
||||
for b in xrange(length):
|
||||
basetype.append(seq[b])
|
||||
strandnum.append(myns)
|
||||
myns += 1
|
||||
for b in range(length):
|
||||
basetype.append(seq[b])
|
||||
strandnum.append(myns)
|
||||
|
||||
for b in xrange(length-1):
|
||||
bondpair = [noffset + b, noffset + b + 1]
|
||||
bonds.append(bondpair)
|
||||
noffset += length
|
||||
for b in range(length-1):
|
||||
bondpair = [noffset + b, noffset + b + 1]
|
||||
bonds.append(bondpair)
|
||||
noffset += length
|
||||
|
||||
# create the sequence of the second strand as made of
|
||||
# complementary bases
|
||||
seq2 = [5-s for s in seq]
|
||||
seq2.reverse()
|
||||
# create the sequence of the second strand as made of
|
||||
# complementary bases
|
||||
seq2 = [5-s for s in seq]
|
||||
seq2.reverse()
|
||||
|
||||
myns += 1
|
||||
for b in xrange(length):
|
||||
basetype.append(seq2[b])
|
||||
strandnum.append(myns)
|
||||
myns += 1
|
||||
for b in range(length):
|
||||
basetype.append(seq2[b])
|
||||
strandnum.append(myns)
|
||||
|
||||
for b in xrange(length-1):
|
||||
bondpair = [noffset + b, noffset + b + 1]
|
||||
bonds.append(bondpair)
|
||||
noffset += length
|
||||
|
||||
print >> sys.stdout, "## Created duplex of %i bases" % (2*length)
|
||||
for b in range(length-1):
|
||||
bondpair = [noffset + b, noffset + b + 1]
|
||||
bonds.append(bondpair)
|
||||
noffset += length
|
||||
|
||||
# generate random position of the first nucleotide
|
||||
print( "## Created duplex of %i bases" % (2*length), file=sys.stdout)
|
||||
|
||||
# generate random position of the first nucleotide
|
||||
cdm = box_offset + np.random.random_sample(3) * box
|
||||
|
||||
# generate the random direction of the helix
|
||||
# generate the random direction of the helix
|
||||
axis = np.random.random_sample(3)
|
||||
axis /= np.sqrt(np.dot(axis, axis))
|
||||
|
||||
# use the generate function defined above to create
|
||||
# the position and orientation vector of the strand
|
||||
# use the generate function defined above to create
|
||||
# the position and orientation vector of the strand
|
||||
newpositions, newa1s, newa3s = generate_strand(len(line), \
|
||||
sequence=seq, dir=axis, start_pos=cdm, double=True)
|
||||
sequence=seq, dir=axis, start_pos=cdm, double=True)
|
||||
|
||||
# generate a new position for the strand until it does not overlap
|
||||
# with anything already present
|
||||
start = timer()
|
||||
# with anything already present
|
||||
start = timer()
|
||||
while not add_strands(newpositions, newa1s, newa3s):
|
||||
cdm = box_offset + np.random.random_sample(3) * box
|
||||
axis = np.random.random_sample(3)
|
||||
axis /= np.sqrt(np.dot(axis, axis))
|
||||
newpositions, newa1s, newa3s = generate_strand(len(line), \
|
||||
sequence=seq, dir=axis, start_pos=cdm, double=True)
|
||||
print >> sys.stdout, "## Trying %i" % i
|
||||
end = timer()
|
||||
print >> sys.stdout, "## Added duplex of %i bases (line %i/%i) in %.2fs, now at %i/%i" % \
|
||||
(2*length, i, nlines, end-start, len(positions), nnucl)
|
||||
sequence=seq, dir=axis, start_pos=cdm, double=True)
|
||||
print( "## Trying %i" % i, file=sys.stdout)
|
||||
end = timer()
|
||||
print( "## Added duplex of %i bases (line %i/%i) in %.2fs, now at %i/%i" % \
|
||||
(2*length, i, nlines, end-start, len(positions), nnucl), file=sys.stdout)
|
||||
|
||||
# block for single strands: last argument of the generate function
|
||||
# is set to 'False'
|
||||
# block for single strands: last argument of the generate function
|
||||
# is set to 'False'
|
||||
else:
|
||||
length = len(line)
|
||||
seq = [(base_to_number[x]) for x in line]
|
||||
|
||||
myns += 1
|
||||
for b in xrange(length):
|
||||
basetype.append(seq[b])
|
||||
strandnum.append(myns)
|
||||
myns += 1
|
||||
for b in range(length):
|
||||
basetype.append(seq[b])
|
||||
strandnum.append(myns)
|
||||
|
||||
for b in xrange(length-1):
|
||||
bondpair = [noffset + b, noffset + b + 1]
|
||||
bonds.append(bondpair)
|
||||
noffset += length
|
||||
for b in range(length-1):
|
||||
bondpair = [noffset + b, noffset + b + 1]
|
||||
bonds.append(bondpair)
|
||||
noffset += length
|
||||
|
||||
# generate random position of the first nucleotide
|
||||
# generate random position of the first nucleotide
|
||||
cdm = box_offset + np.random.random_sample(3) * box
|
||||
|
||||
# generate the random direction of the helix
|
||||
# generate the random direction of the helix
|
||||
axis = np.random.random_sample(3)
|
||||
axis /= np.sqrt(np.dot(axis, axis))
|
||||
|
||||
print >> sys.stdout, \
|
||||
"## Created single strand of %i bases" % length
|
||||
print("## Created single strand of %i bases" % length, file=sys.stdout)
|
||||
|
||||
newpositions, newa1s, newa3s = generate_strand(length, \
|
||||
sequence=seq, dir=axis, start_pos=cdm, double=False)
|
||||
start = timer()
|
||||
start = timer()
|
||||
while not add_strands(newpositions, newa1s, newa3s):
|
||||
cdm = box_offset + np.random.random_sample(3) * box
|
||||
axis = np.random.random_sample(3)
|
||||
axis /= np.sqrt(np.dot(axis, axis))
|
||||
axis /= np.sqrt(np.dot(axis, axis))
|
||||
newpositions, newa1s, newa3s = generate_strand(length, \
|
||||
sequence=seq, dir=axis, start_pos=cdm, double=False)
|
||||
sequence=seq, dir=axis, start_pos=cdm, double=False)
|
||||
print >> sys.stdout, "## Trying %i" % (i)
|
||||
end = timer()
|
||||
print >> sys.stdout, "## Added single strand of %i bases (line %i/%i) in %.2fs, now at %i/%i" % \
|
||||
(length, i, nlines, end-start,len(positions), nnucl)
|
||||
end = timer()
|
||||
print( "## Added single strand of %i bases (line %i/%i) in %.2fs, now at %i/%i" % \
|
||||
(length, i, nlines, end-start,len(positions), nnucl), file=sys.stdout)
|
||||
|
||||
i += 1
|
||||
|
||||
# sanity check
|
||||
if not len(positions) == nnucl:
|
||||
print len(positions), nnucl
|
||||
print( len(positions), nnucl )
|
||||
raise AssertionError
|
||||
|
||||
out.write('# LAMMPS data file\n')
|
||||
@ -580,44 +580,41 @@ def read_strands(filename):
|
||||
out.write('Atoms\n')
|
||||
out.write('\n')
|
||||
|
||||
for i in xrange(nnucl):
|
||||
out.write('%d %d %22.15le %22.15le %22.15le %d 1 1\n' \
|
||||
% (i+1, basetype[i], \
|
||||
positions[i][0], positions[i][1], positions[i][2], \
|
||||
strandnum[i]))
|
||||
for i in range(nnucl):
|
||||
out.write('%d %d %22.15le %22.15le %22.15le %d 1 1\n' \
|
||||
% (i+1, basetype[i], positions[i][0], positions[i][1], positions[i][2], strandnum[i]))
|
||||
|
||||
out.write('\n')
|
||||
out.write('# Atom-ID, translational, rotational velocity\n')
|
||||
out.write('Velocities\n')
|
||||
out.write('\n')
|
||||
|
||||
for i in xrange(nnucl):
|
||||
out.write("%d %22.15le %22.15le %22.15le %22.15le %22.15le %22.15le\n" \
|
||||
% (i+1,0.0,0.0,0.0,0.0,0.0,0.0))
|
||||
for i in range(nnucl):
|
||||
out.write("%d %22.15le %22.15le %22.15le %22.15le %22.15le %22.15le\n" \
|
||||
% (i+1,0.0,0.0,0.0,0.0,0.0,0.0))
|
||||
|
||||
out.write('\n')
|
||||
out.write('# Atom-ID, shape, quaternion\n')
|
||||
out.write('Ellipsoids\n')
|
||||
out.write('\n')
|
||||
|
||||
for i in xrange(nnucl):
|
||||
out.write(\
|
||||
"%d %22.15le %22.15le %22.15le %22.15le %22.15le %22.15le %22.15le\n" \
|
||||
% (i+1,1.1739845031423408,1.1739845031423408,1.1739845031423408, \
|
||||
quaternions[i][0],quaternions[i][1], quaternions[i][2],quaternions[i][3]))
|
||||
|
||||
for i in range(nnucl):
|
||||
out.write("%d %22.15le %22.15le %22.15le %22.15le %22.15le %22.15le %22.15le\n" \
|
||||
% (i+1,1.1739845031423408,1.1739845031423408,1.1739845031423408, \
|
||||
quaternions[i][0],quaternions[i][1], quaternions[i][2],quaternions[i][3]))
|
||||
|
||||
out.write('\n')
|
||||
out.write('# Bond topology\n')
|
||||
out.write('Bonds\n')
|
||||
out.write('\n')
|
||||
|
||||
for i in xrange(nbonds):
|
||||
out.write("%d %d %d %d\n" % (i+1,1,bonds[i][0],bonds[i][1]))
|
||||
for i in range(nbonds):
|
||||
out.write("%d %d %d %d\n" % (i+1,1,bonds[i][0],bonds[i][1]))
|
||||
|
||||
out.close()
|
||||
|
||||
print >> sys.stdout, "## Wrote data to 'data.oxdna'"
|
||||
print >> sys.stdout, "## DONE"
|
||||
print("## Wrote data to 'data.oxdna'", file=sys.stdout)
|
||||
print("## DONE", file=sys.stdout)
|
||||
|
||||
# call the above main() function, which executes the program
|
||||
read_strands (infile)
|
||||
@ -627,4 +624,6 @@ runtime = end_time-start_time
|
||||
hours = runtime/3600
|
||||
minutes = (runtime-np.rint(hours)*3600)/60
|
||||
seconds = (runtime-np.rint(hours)*3600-np.rint(minutes)*60)%60
|
||||
print >> sys.stdout, "## Total runtime %ih:%im:%.2fs" % (hours,minutes,seconds)
|
||||
print( "## Total runtime %ih:%im:%.2fs" % (hours,minutes,seconds), file=sys.stdout)
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
# Setup tool for oxDNA input in LAMMPS format.
|
||||
|
||||
# for python2/3 compatibility
|
||||
from __future__ import print_function
|
||||
|
||||
import math,numpy as np,sys,os
|
||||
|
||||
# system size
|
||||
@ -250,59 +253,59 @@ def duplex_array():
|
||||
qrot3=math.sin(0.5*twist)
|
||||
|
||||
for letter in strand[2]:
|
||||
temp1=[]
|
||||
temp2=[]
|
||||
temp1=[]
|
||||
temp2=[]
|
||||
|
||||
temp1.append(nt2num[letter])
|
||||
temp2.append(compnt2num[letter])
|
||||
temp1.append(nt2num[letter])
|
||||
temp2.append(compnt2num[letter])
|
||||
|
||||
temp1.append([posx1,posy1,posz1])
|
||||
temp2.append([posx2,posy2,posz2])
|
||||
temp1.append([posx1,posy1,posz1])
|
||||
temp2.append([posx2,posy2,posz2])
|
||||
|
||||
vel=[0,0,0,0,0,0]
|
||||
temp1.append(vel)
|
||||
temp2.append(vel)
|
||||
vel=[0,0,0,0,0,0]
|
||||
temp1.append(vel)
|
||||
temp2.append(vel)
|
||||
|
||||
temp1.append(shape)
|
||||
temp2.append(shape)
|
||||
temp1.append(shape)
|
||||
temp2.append(shape)
|
||||
|
||||
temp1.append(quat1)
|
||||
temp2.append(quat2)
|
||||
temp1.append(quat1)
|
||||
temp2.append(quat2)
|
||||
|
||||
quat1_0 = quat1[0]*qrot0 - quat1[1]*qrot1 - quat1[2]*qrot2 - quat1[3]*qrot3
|
||||
quat1_1 = quat1[0]*qrot1 + quat1[1]*qrot0 + quat1[2]*qrot3 - quat1[3]*qrot2
|
||||
quat1_2 = quat1[0]*qrot2 + quat1[2]*qrot0 + quat1[3]*qrot1 - quat1[1]*qrot3
|
||||
quat1_3 = quat1[0]*qrot3 + quat1[3]*qrot0 + quat1[1]*qrot2 + quat1[2]*qrot1
|
||||
quat1_0 = quat1[0]*qrot0 - quat1[1]*qrot1 - quat1[2]*qrot2 - quat1[3]*qrot3
|
||||
quat1_1 = quat1[0]*qrot1 + quat1[1]*qrot0 + quat1[2]*qrot3 - quat1[3]*qrot2
|
||||
quat1_2 = quat1[0]*qrot2 + quat1[2]*qrot0 + quat1[3]*qrot1 - quat1[1]*qrot3
|
||||
quat1_3 = quat1[0]*qrot3 + quat1[3]*qrot0 + quat1[1]*qrot2 + quat1[2]*qrot1
|
||||
|
||||
quat1 = [quat1_0,quat1_1,quat1_2,quat1_3]
|
||||
quat1 = [quat1_0,quat1_1,quat1_2,quat1_3]
|
||||
|
||||
posx1=axisx - dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy1=axisy - dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz1=posz1+risez
|
||||
posx1=axisx - dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy1=axisy - dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz1=posz1+risez
|
||||
|
||||
quat2_0 = quat2[0]*qrot0 - quat2[1]*qrot1 - quat2[2]*qrot2 + quat2[3]*qrot3
|
||||
quat2_1 = quat2[0]*qrot1 + quat2[1]*qrot0 - quat2[2]*qrot3 - quat2[3]*qrot2
|
||||
quat2_2 = quat2[0]*qrot2 + quat2[2]*qrot0 + quat2[3]*qrot1 + quat2[1]*qrot3
|
||||
quat2_3 =-quat2[0]*qrot3 + quat2[3]*qrot0 + quat2[1]*qrot2 + quat2[2]*qrot1
|
||||
quat2_0 = quat2[0]*qrot0 - quat2[1]*qrot1 - quat2[2]*qrot2 + quat2[3]*qrot3
|
||||
quat2_1 = quat2[0]*qrot1 + quat2[1]*qrot0 - quat2[2]*qrot3 - quat2[3]*qrot2
|
||||
quat2_2 = quat2[0]*qrot2 + quat2[2]*qrot0 + quat2[3]*qrot1 + quat2[1]*qrot3
|
||||
quat2_3 =-quat2[0]*qrot3 + quat2[3]*qrot0 + quat2[1]*qrot2 + quat2[2]*qrot1
|
||||
|
||||
quat2 = [quat2_0,quat2_1,quat2_2,quat2_3]
|
||||
quat2 = [quat2_0,quat2_1,quat2_2,quat2_3]
|
||||
|
||||
posx2=axisx + dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy2=axisy + dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz2=posz1
|
||||
posx2=axisx + dcomh*(quat1[0]**2+quat1[1]**2-quat1[2]**2-quat1[3]**2)
|
||||
posy2=axisy + dcomh*(2*(quat1[1]*quat1[2]+quat1[0]*quat1[3]))
|
||||
posz2=posz1
|
||||
|
||||
if (len(nucleotide)+1 > strandstart):
|
||||
topology.append([1,len(nucleotide),len(nucleotide)+1])
|
||||
comptopo.append([1,len(nucleotide)+len(strand[2]),len(nucleotide)+len(strand[2])+1])
|
||||
if (len(nucleotide)+1 > strandstart):
|
||||
topology.append([1,len(nucleotide),len(nucleotide)+1])
|
||||
comptopo.append([1,len(nucleotide)+len(strand[2]),len(nucleotide)+len(strand[2])+1])
|
||||
|
||||
nucleotide.append(temp1)
|
||||
compstrand.append(temp2)
|
||||
nucleotide.append(temp1)
|
||||
compstrand.append(temp2)
|
||||
|
||||
for ib in range(len(compstrand)):
|
||||
nucleotide.append(compstrand[len(compstrand)-1-ib])
|
||||
nucleotide.append(compstrand[len(compstrand)-1-ib])
|
||||
|
||||
for ib in range(len(comptopo)):
|
||||
topology.append(comptopo[ib])
|
||||
topology.append(comptopo[ib])
|
||||
|
||||
return
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ fix 1 statted_grp_REACT nvt temp $T $T 100
|
||||
|
||||
fix 4 bond_react_MASTER_group temp/rescale 1 $T $T 1 1
|
||||
|
||||
thermo_style custom step temp press density f_myrxns[1]
|
||||
thermo_style custom step temp press density f_myrxns[*]
|
||||
|
||||
thermo 100
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ read_data large_nylon_melt.data.gz &
|
||||
extra/angle/per/atom 15 &
|
||||
extra/dihedral/per/atom 15 &
|
||||
extra/improper/per/atom 25 &
|
||||
extra/special/per/atom 25
|
||||
extra/special/per/atom 25
|
||||
|
||||
velocity all create 800.0 4928459 dist gaussian
|
||||
|
||||
@ -50,7 +50,7 @@ fix 1 statted_grp_REACT nvt temp 800 800 100
|
||||
# you can use the internally created 'bond_react_MASTER_group', like so:
|
||||
# fix 2 bond_react_MASTER_group temp/rescale 1 800 800 10 1
|
||||
|
||||
thermo_style custom step temp press density f_myrxns[1] f_myrxns[2] # cumulative reaction counts
|
||||
thermo_style custom step temp press density f_myrxns[*] # cumulative reaction counts
|
||||
|
||||
# restart 100 restart1 restart2
|
||||
|
||||
|
||||
@ -20,7 +20,8 @@ improper_style class2
|
||||
special_bonds lj/coul 0 0 1
|
||||
pair_modify tail yes mix sixthpower
|
||||
|
||||
read_data tiny_epoxy.data
|
||||
read_data tiny_epoxy.data &
|
||||
extra/special/per/atom 25
|
||||
|
||||
velocity all create 300.0 4928459 dist gaussian
|
||||
|
||||
@ -44,7 +45,7 @@ fix rxns all bond/react stabilization yes statted_grp .03 &
|
||||
|
||||
fix 1 statted_grp_REACT nvt temp 300 300 100
|
||||
|
||||
thermo_style custom step temp f_rxns[1] f_rxns[2] f_rxns[3] f_rxns[4]
|
||||
thermo_style custom step temp f_rxns[*]
|
||||
|
||||
run 2000
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ fix 1 statted_grp_REACT nvt temp 300 300 100
|
||||
# by using the internally-created 'bond_react_MASTER_group', like so:
|
||||
fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1
|
||||
|
||||
thermo_style custom step temp press density f_myrxns[1] f_myrxns[2]
|
||||
thermo_style custom step temp press density f_myrxns[*]
|
||||
|
||||
# restart 100 restart1 restart2
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ fix 1 statted_grp_REACT nvt temp 300 300 100
|
||||
# by using the internally-created 'bond_react_MASTER_group', like so:
|
||||
fix 4 bond_react_MASTER_group temp/rescale 1 300 300 10 1
|
||||
|
||||
thermo_style custom step temp press density v_prob1 v_prob2 f_myrxns[1] f_myrxns[2]
|
||||
thermo_style custom step temp press density v_prob1 v_prob2 f_myrxns[*]
|
||||
|
||||
# restart 100 restart1 restart2
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ fix myrxns all bond/react stabilization no &
|
||||
|
||||
fix 1 all nve/limit .03
|
||||
|
||||
thermo_style custom step temp press density f_myrxns[1] f_myrxns[2]
|
||||
thermo_style custom step temp press density f_myrxns[*]
|
||||
|
||||
# restart 100 restart1 restart2
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ fix 1 statted_grp_REACT nvt temp $T $T 100
|
||||
|
||||
fix 4 bond_react_MASTER_group temp/rescale 1 $T $T 1 1
|
||||
|
||||
thermo_style custom step temp press density f_rxn1[1] f_rxn1[2] f_rxn1[3]
|
||||
thermo_style custom step temp press density f_rxn1[*]
|
||||
|
||||
run 10000
|
||||
|
||||
|
||||
@ -118,6 +118,8 @@ MODULE LIBLAMMPS
|
||||
PROCEDURE :: extract_fix => lmp_extract_fix
|
||||
PROCEDURE :: extract_variable => lmp_extract_variable
|
||||
PROCEDURE :: set_variable => lmp_set_variable
|
||||
PROCEDURE :: set_string_variable => lmp_set_string_variable
|
||||
PROCEDURE :: set_internal_variable => lmp_set_internal_variable
|
||||
PROCEDURE, PRIVATE :: lmp_gather_atoms_int
|
||||
PROCEDURE, PRIVATE :: lmp_gather_atoms_double
|
||||
GENERIC :: gather_atoms => lmp_gather_atoms_int, &
|
||||
@ -557,6 +559,21 @@ MODULE LIBLAMMPS
|
||||
INTEGER(c_int) :: lammps_set_variable
|
||||
END FUNCTION lammps_set_variable
|
||||
|
||||
FUNCTION lammps_set_string_variable(handle, name, str) BIND(C)
|
||||
IMPORT :: c_int, c_ptr
|
||||
IMPLICIT NONE
|
||||
TYPE(c_ptr), VALUE :: handle, name, str
|
||||
INTEGER(c_int) :: lammps_set_string_variable
|
||||
END FUNCTION lammps_set_string_variable
|
||||
|
||||
FUNCTION lammps_set_internal_variable(handle, name, val) BIND(C)
|
||||
IMPORT :: c_int, c_ptr, c_double
|
||||
IMPLICIT NONE
|
||||
TYPE(c_ptr), VALUE :: handle, name
|
||||
REAL(c_double), VALUE :: val
|
||||
INTEGER(c_int) :: lammps_set_internal_variable
|
||||
END FUNCTION lammps_set_internal_variable
|
||||
|
||||
SUBROUTINE lammps_gather_atoms(handle, name, type, count, data) BIND(C)
|
||||
IMPORT :: c_int, c_ptr
|
||||
IMPLICIT NONE
|
||||
@ -1631,6 +1648,43 @@ CONTAINS
|
||||
END IF
|
||||
END SUBROUTINE lmp_set_variable
|
||||
|
||||
! equivalent function to lammps_set_string_variable
|
||||
SUBROUTINE lmp_set_string_variable(self, name, str)
|
||||
CLASS(lammps), INTENT(IN) :: self
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name, str
|
||||
INTEGER :: err
|
||||
TYPE(c_ptr) :: Cstr, Cname
|
||||
|
||||
Cstr = f2c_string(str)
|
||||
Cname = f2c_string(name)
|
||||
err = lammps_set_string_variable(self%handle, Cname, Cstr)
|
||||
CALL lammps_free(Cname)
|
||||
CALL lammps_free(Cstr)
|
||||
IF (err /= 0) THEN
|
||||
CALL lmp_error(self, LMP_ERROR_WARNING + LMP_ERROR_WORLD, &
|
||||
'WARNING: unable to set string variable "' // name &
|
||||
// '" [Fortran/set_variable]')
|
||||
END IF
|
||||
END SUBROUTINE lmp_set_string_variable
|
||||
|
||||
! equivalent function to lammps_set_internal_variable
|
||||
SUBROUTINE lmp_set_internal_variable(self, name, val)
|
||||
CLASS(lammps), INTENT(IN) :: self
|
||||
CHARACTER(LEN=*), INTENT(IN) :: name
|
||||
REAL(KIND=c_double), INTENT(IN) :: val
|
||||
INTEGER :: err
|
||||
TYPE(c_ptr) :: Cstr, Cname
|
||||
|
||||
Cname = f2c_string(name)
|
||||
err = lammps_set_internal_variable(self%handle, Cname, val)
|
||||
CALL lammps_free(Cname)
|
||||
IF (err /= 0) THEN
|
||||
CALL lmp_error(self, LMP_ERROR_WARNING + LMP_ERROR_WORLD, &
|
||||
'WARNING: unable to set internal variable "' // name &
|
||||
// '" [Fortran/set_variable]')
|
||||
END IF
|
||||
END SUBROUTINE lmp_set_internal_variable
|
||||
|
||||
! equivalent function to lammps_gather_atoms (for integers)
|
||||
SUBROUTINE lmp_gather_atoms_int(self, name, count, data)
|
||||
CLASS(lammps), INTENT(IN) :: self
|
||||
|
||||
@ -134,11 +134,11 @@ $(OBJ_DIR)/scan_app.cu_o: cudpp_mini/scan_app.cu
|
||||
$(GPU_LIB): $(OBJS) $(CUDPP)
|
||||
$(AR) -crusv $(GPU_LIB) $(OBJS) $(CUDPP)
|
||||
@cp $(EXTRAMAKE) Makefile.lammps
|
||||
|
||||
|
||||
# test app for querying device info
|
||||
|
||||
$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
|
||||
clean:
|
||||
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo
|
||||
|
||||
@ -133,11 +133,11 @@ $(OBJ_DIR)/scan_app.cu_o: cudpp_mini/scan_app.cu
|
||||
$(GPU_LIB): $(OBJS) $(CUDPP)
|
||||
$(AR) -crusv $(GPU_LIB) $(OBJS) $(CUDPP)
|
||||
@cp $(EXTRAMAKE) Makefile.lammps
|
||||
|
||||
|
||||
# test app for querying device info
|
||||
|
||||
$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
|
||||
clean:
|
||||
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo
|
||||
|
||||
@ -98,10 +98,10 @@ HIP_GPU_OPTS += $(HIP_OPTS) -I./
|
||||
ifeq (spirv,$(HIP_PLATFORM))
|
||||
HIP_HOST_OPTS += -fPIC
|
||||
HIP_GPU_CC = $(HIP_PATH)/bin/hipcc -c
|
||||
HIP_GPU_OPTS_S =
|
||||
HIP_GPU_OPTS_S =
|
||||
HIP_GPU_OPTS_E =
|
||||
HIP_KERNEL_SUFFIX = .cpp
|
||||
HIP_LIBS_TARGET =
|
||||
HIP_LIBS_TARGET =
|
||||
export HCC_AMDGPU_TARGET := $(HIP_ARCH)
|
||||
else ifeq (clang,$(HIP_COMPILER))
|
||||
HIP_HOST_OPTS += -fPIC
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
gpu_SYSINC = -DFFT_SINGLE
|
||||
gpu_SYSLIB = -framework OpenCL
|
||||
gpu_SYSPATH =
|
||||
gpu_SYSPATH =
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
# settings for OpenCL builds
|
||||
gpu_SYSINC =
|
||||
gpu_SYSLIB = -Wl,--enable-stdcall-fixup -L../../tools/mingw-cross$(LIBOBJDIR) -Wl,-Bdynamic,-lOpenCL,-Bstatic
|
||||
gpu_SYSPATH =
|
||||
gpu_SYSPATH =
|
||||
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
|
||||
gpu_SYSINC =
|
||||
gpu_SYSLIB = -lOpenCL
|
||||
gpu_SYSPATH =
|
||||
gpu_SYSPATH =
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Generic Linux Makefile for CUDA
|
||||
# - Change CUDA_ARCH for your GPU
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Generic Linux Makefile for CUDA complied for multiple compute capabilities
|
||||
# - Add your GPU to CUDA_CODE
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Generic Linux Makefile for OpenCL - Mixed precision
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
@ -11,7 +11,7 @@ EXTRAMAKE = Makefile.lammps.opencl
|
||||
|
||||
LMP_INC = -DLAMMPS_SMALLBIG
|
||||
|
||||
OCL_INC =
|
||||
OCL_INC =
|
||||
OCL_CPP = mpic++ -std=c++11 -O3 -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC)
|
||||
OCL_LINK = -lOpenCL
|
||||
OCL_PREC = -D_SINGLE_DOUBLE
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Generic Mac Makefile for OpenCL - Single precision with FFT_SINGLE
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Generic Mac Makefile for OpenCL - Single precision with FFT_SINGLE
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Linux Makefile for Intel oneAPI - Mixed precision
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Linux Makefile for Intel oneAPI - Mixed precision (with timing enabled)
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# /* ----------------------------------------------------------------------
|
||||
# /* ----------------------------------------------------------------------
|
||||
# Generic Linux Makefile for CUDA without MPI libraries
|
||||
# - Change CUDA_ARCH for your GPU
|
||||
# ------------------------------------------------------------------------- */
|
||||
|
||||
@ -11,7 +11,7 @@ HOST_H = lal_answer.h lal_atom.h lal_balance.h lal_base_atomic.h lal_base_amoeba
|
||||
lal_base_charge.h lal_base_dipole.h lal_base_dpd.h \
|
||||
lal_base_ellipsoid.h lal_base_three.h lal_device.h lal_neighbor.h \
|
||||
lal_neighbor_shared.h lal_pre_ocl_config.h $(NVD_H)
|
||||
|
||||
|
||||
# Source files
|
||||
SRCS := $(wildcard ./lal_*.cpp)
|
||||
OBJS := $(subst ./,$(OBJ_DIR)/,$(SRCS:%.cpp=%.o))
|
||||
@ -127,7 +127,7 @@ $(GPU_LIB): $(OBJS) $(CUDPP)
|
||||
# test app for querying device info
|
||||
|
||||
$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
|
||||
clean:
|
||||
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.cubin *.linkinfo
|
||||
|
||||
@ -89,7 +89,7 @@ $(GPU_LIB): $(OBJS) $(CUDPP)
|
||||
# test app for querying device info
|
||||
|
||||
$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda
|
||||
|
||||
clean:
|
||||
-rm -f $(EXECS) $(GPU_LIB) $(OBJS) $(CUDPP) $(CUHS) *.linkinfo
|
||||
|
||||
@ -138,7 +138,7 @@ class UCL_Device {
|
||||
/** \note You cannot delete the default stream **/
|
||||
inline void pop_command_queue() {
|
||||
if (_cq.size()<2) return;
|
||||
CU_SAFE_CALL_NS(cuStreamDestroy(_cq.back()));
|
||||
cuStreamDestroy(_cq.back());
|
||||
_cq.pop_back();
|
||||
}
|
||||
|
||||
@ -426,8 +426,8 @@ void UCL_Device::clear() {
|
||||
if (_device>-1) {
|
||||
for (int i=1; i<num_queues(); i++) pop_command_queue();
|
||||
#if GERYON_NVD_PRIMARY_CONTEXT
|
||||
CU_SAFE_CALL_NS(cuCtxSetCurrent(_old_context));
|
||||
CU_SAFE_CALL_NS(cuDevicePrimaryCtxRelease(_cu_device));
|
||||
cuCtxSetCurrent(_old_context);
|
||||
cuDevicePrimaryCtxRelease(_cu_device);
|
||||
#else
|
||||
cuCtxDestroy(_context);
|
||||
#endif
|
||||
|
||||
@ -108,7 +108,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n,
|
||||
return UCL_MEMORY_ERROR;
|
||||
*mat.host_ptr() = (typename mat_type::data_type*)
|
||||
clEnqueueMapBuffer(cm.cq(),mat.cbegin(),CL_TRUE,
|
||||
map_perm,0,n,0,NULL,NULL,NULL);
|
||||
map_perm,0,n,0,NULL,NULL,NULL);
|
||||
|
||||
mat.cq()=cm.cq();
|
||||
CL_SAFE_CALL(clRetainCommandQueue(mat.cq()));
|
||||
|
||||
@ -2033,13 +2033,13 @@ __kernel void k_amoeba_special15(__global int * dev_nbor,
|
||||
const __global tagint *restrict special15,
|
||||
const int inum, const int nall, const int nbor_pitch,
|
||||
const int t_per_atom) {
|
||||
int tid, ii, offset, n_stride, i;
|
||||
int tid, ii, offset, n_stride, j;
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
if (ii<inum) {
|
||||
|
||||
int numj, nbor, nbor_end;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,j,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
int n15 = nspecial15[ii];
|
||||
@ -2048,7 +2048,7 @@ __kernel void k_amoeba_special15(__global int * dev_nbor,
|
||||
|
||||
int sj=dev_packed[nbor];
|
||||
int which = sj >> SBBITS & 3;
|
||||
int j = sj & NEIGHMASK;
|
||||
j = sj & NEIGHMASK;
|
||||
tagint jtag = tag[j];
|
||||
|
||||
if (!which) {
|
||||
|
||||
@ -195,7 +195,7 @@ void BaseSPHT::compute(const int f_ago, const int inum_full, const int nall,
|
||||
int **firstneigh, const bool eflag_in, const bool vflag_in,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, tagint *tag,
|
||||
double **host_v, const int nlocal) {
|
||||
double **host_v) {
|
||||
acc_timers();
|
||||
int eflag, vflag;
|
||||
if (eatom) eflag=2;
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LAL_BASE_SPH_H
|
||||
#define LAL_BASE_DPD_H
|
||||
#define LAL_BASE_SPH_H
|
||||
|
||||
#include "lal_device.h"
|
||||
#include "lal_balance.h"
|
||||
@ -132,7 +132,7 @@ class BaseSPH {
|
||||
int **firstneigh, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, tagint *tag,
|
||||
double **v, const int nlocal);
|
||||
double **v);
|
||||
|
||||
/// Pair loop with device neighboring
|
||||
int** compute(const int ago, const int inum_full, const int nall,
|
||||
|
||||
@ -102,6 +102,7 @@ __kernel void k_coul_slater_long(const __global numtyp4 *restrict x_,
|
||||
numtyp t = ucl_recip((numtyp)1.0 + EWALD_P*grij);
|
||||
_erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
|
||||
fetch(prefactor,j,q_tex);
|
||||
prefactor *= qqrd2e * scale[mtype] * qtmp/r;
|
||||
numtyp rlamdainv = r * lamdainv;
|
||||
numtyp exprlmdainv = ucl_exp((numtyp)-2.0*rlamdainv);
|
||||
numtyp slater_term = exprlmdainv*((numtyp)1.0 + ((numtyp)2.0*rlamdainv*((numtyp)1.0+rlamdainv)));
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
email : ndactrung@gmail.com
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LAL_Coul_Slater_Long_H
|
||||
#define LAL_Coul_Slater_Long_H
|
||||
#ifndef LAL_COUL_SLATER_LONG_H
|
||||
#define LAL_COUL_SLATER_LONG_H
|
||||
|
||||
#include "lal_base_charge.h"
|
||||
|
||||
|
||||
@ -303,7 +303,7 @@ double EAMT::host_memory_usage() const {
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Copy nbor list from host if necessary and then compute atom energies/forces
|
||||
// Copy nbor list from host if necessary and then compute per-atom fp
|
||||
// ---------------------------------------------------------------------------
|
||||
template <class numtyp, class acctyp>
|
||||
void EAMT::compute(const int f_ago, const int inum_full, const int nlocal,
|
||||
@ -379,7 +379,7 @@ void EAMT::compute(const int f_ago, const int inum_full, const int nlocal,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Reneighbor on GPU and then compute per-atom densities
|
||||
// Reneighbor on GPU and then compute per-atom fp
|
||||
// ---------------------------------------------------------------------------
|
||||
template <class numtyp, class acctyp>
|
||||
int** EAMT::compute(const int ago, const int inum_full, const int nall,
|
||||
@ -461,7 +461,7 @@ int** EAMT::compute(const int ago, const int inum_full, const int nall,
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Copy nbor list from host if necessary and then calculate forces, virials,..
|
||||
// Update per-atom fp, and then calculate forces, virials,..
|
||||
// ---------------------------------------------------------------------------
|
||||
template <class numtyp, class acctyp>
|
||||
void EAMT::compute2(int *ilist, const bool eflag, const bool vflag,
|
||||
|
||||
@ -324,8 +324,8 @@ __kernel void k_edpd(const __global numtyp4 *restrict x_,
|
||||
f.z+=delz*force;
|
||||
|
||||
// heat transfer
|
||||
|
||||
if (r < coeff2w) {
|
||||
|
||||
if (r < coeff2w) {
|
||||
numtyp wrT = (numtyp)1.0 - r/coeff2w;
|
||||
wrT = MAX((numtyp)0.0,MIN((numtyp)1.0,wrT));
|
||||
wrT = ucl_pow(wrT, (numtyp)0.5*coeff2z); // powerT[itype][jtype]
|
||||
@ -401,10 +401,8 @@ __kernel void k_edpd_fast(const __global numtyp4 *restrict x_,
|
||||
__local numtyp4 sc[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp4 kc[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp sp_lj[4];
|
||||
__local numtyp sp_sqrt[4];
|
||||
if (tid<4) {
|
||||
sp_lj[tid]=sp_lj_in[tid];
|
||||
sp_sqrt[tid]=sp_sqrt_in[tid];
|
||||
}
|
||||
if (tid<MAX_SHARED_TYPES*MAX_SHARED_TYPES) {
|
||||
coeff[tid]=coeff_in[tid];
|
||||
@ -567,7 +565,7 @@ __kernel void k_edpd_fast(const __global numtyp4 *restrict x_,
|
||||
|
||||
// heat transfer
|
||||
|
||||
if (r < coeff2w) {
|
||||
if (r < coeff2w) {
|
||||
numtyp wrT = (numtyp)1.0 - r/coeff2w;
|
||||
wrT = MAX((numtyp)0.0,MIN((numtyp)1.0,wrT));
|
||||
wrT = ucl_pow(wrT, (numtyp)0.5*coeff2z); // powerT[itype][jtype]
|
||||
@ -581,10 +579,10 @@ __kernel void k_edpd_fast(const __global numtyp4 *restrict x_,
|
||||
factor += kcx*T_pow.x + kcy*T_pow.y + kcz*T_pow.z + kcw*T_pow.w;
|
||||
kappaT *= factor;
|
||||
}
|
||||
|
||||
|
||||
numtyp kij = cvi*cvj*kappaT * T_ij*T_ij;
|
||||
numtyp alphaij = ucl_sqrt((numtyp)2.0*kboltz*kij);
|
||||
|
||||
|
||||
numtyp dQc = kij * wrT*wrT * (Tj - Ti )/(Ti*Tj);
|
||||
numtyp dQd = wr*wr*( GammaIJ * vijeij*vijeij - SigmaIJ*SigmaIJ/mass_itype ) - SigmaIJ * wr *vijeij *randnum;
|
||||
dQd /= (cvi+cvj);
|
||||
|
||||
@ -1225,7 +1225,9 @@ __kernel void k_hippo_udirect2b(const __global numtyp4 *restrict x_,
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
int n_stride;
|
||||
#if (SHUFFLE_AVAIL == 0)
|
||||
local_allocate_store_charge();
|
||||
#endif
|
||||
|
||||
acctyp _fieldp[6];
|
||||
for (int l=0; l<6; l++) _fieldp[l]=(acctyp)0;
|
||||
@ -1410,7 +1412,9 @@ __kernel void k_hippo_umutual2b(const __global numtyp4 *restrict x_,
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
int n_stride;
|
||||
#if (SHUFFLE_AVAIL == 0)
|
||||
local_allocate_store_charge();
|
||||
#endif
|
||||
|
||||
acctyp _fieldp[6];
|
||||
for (int l=0; l<6; l++) _fieldp[l]=(acctyp)0;
|
||||
@ -2452,13 +2456,13 @@ __kernel void k_hippo_special15(__global int * dev_nbor,
|
||||
const __global tagint *restrict special15,
|
||||
const int inum, const int nall, const int nbor_pitch,
|
||||
const int t_per_atom) {
|
||||
int tid, ii, offset, n_stride, i;
|
||||
int tid, ii, offset, n_stride, j;
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
if (ii<inum) {
|
||||
|
||||
int numj, nbor, nbor_end;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,j,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
int n15 = nspecial15[ii];
|
||||
@ -2467,7 +2471,7 @@ __kernel void k_hippo_special15(__global int * dev_nbor,
|
||||
|
||||
int sj=dev_packed[nbor];
|
||||
int which = sj >> SBBITS & 3;
|
||||
int j = sj & NEIGHMASK;
|
||||
j = sj & NEIGHMASK;
|
||||
tagint jtag = tag[j];
|
||||
|
||||
if (!which) {
|
||||
|
||||
@ -210,13 +210,12 @@ __kernel void k_mdpd(const __global numtyp4 *restrict x_,
|
||||
|
||||
const numtyp rhoi = extra[i].x;
|
||||
|
||||
numtyp factor_dpd, factor_sqrt;
|
||||
numtyp factor_dpd;
|
||||
for ( ; nbor<nbor_end; nbor+=n_stride) {
|
||||
ucl_prefetch(dev_packed+nbor+n_stride);
|
||||
|
||||
int j=dev_packed[nbor];
|
||||
factor_dpd = sp_lj[sbmask(j)];
|
||||
factor_sqrt = sp_sqrt[sbmask(j)];
|
||||
j &= NEIGHMASK;
|
||||
|
||||
numtyp4 jx; fetch4(jx,j,pos_tex); //x_[j];
|
||||
@ -240,22 +239,21 @@ __kernel void k_mdpd(const __global numtyp4 *restrict x_,
|
||||
numtyp delvy = iv.y - jv.y;
|
||||
numtyp delvz = iv.z - jv.z;
|
||||
numtyp dot = delx*delvx + dely*delvy + delz*delvz;
|
||||
|
||||
|
||||
numtyp A_attij = coeff[mtype].x;
|
||||
numtyp B_repij = coeff[mtype].y;
|
||||
numtyp gammaij = coeff[mtype].z;
|
||||
numtyp sigmaij = coeff[mtype].w;
|
||||
numtyp cutij = coeff2[mtype].x;
|
||||
numtyp cut_rij = coeff2[mtype].y;
|
||||
numtyp cutsqij = coeff2[mtype].z;
|
||||
|
||||
|
||||
numtyp wc = (numtyp)1.0 - r/cutij;
|
||||
numtyp wc_r = (numtyp)1.0 - r/cut_rij;
|
||||
wc_r = MAX(wc_r,(numtyp)0.0);
|
||||
numtyp wr = wc;
|
||||
|
||||
const numtyp rhoj = extra[j].x;
|
||||
|
||||
|
||||
unsigned int tag1=itag, tag2=jtag;
|
||||
if (tag1 > tag2) {
|
||||
tag1 = jtag; tag2 = itag;
|
||||
@ -322,10 +320,8 @@ __kernel void k_mdpd_fast(const __global numtyp4 *restrict x_,
|
||||
__local numtyp4 coeff[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp4 coeff2[MAX_SHARED_TYPES*MAX_SHARED_TYPES];
|
||||
__local numtyp sp_lj[4];
|
||||
__local numtyp sp_sqrt[4];
|
||||
if (tid<4) {
|
||||
sp_lj[tid]=sp_lj_in[tid];
|
||||
sp_sqrt[tid]=sp_sqrt_in[tid];
|
||||
}
|
||||
if (tid<MAX_SHARED_TYPES*MAX_SHARED_TYPES) {
|
||||
coeff[tid]=coeff_in[tid];
|
||||
@ -339,7 +335,6 @@ __kernel void k_mdpd_fast(const __global numtyp4 *restrict x_,
|
||||
const numtyp sigmaij=coeff_in[ONETYPE].w;
|
||||
const numtyp cutij=coeff2_in[ONETYPE].x;
|
||||
const numtyp cut_rij=coeff2_in[ONETYPE].y;
|
||||
const numtyp cutsqij=coeff2_in[ONETYPE].z;
|
||||
const numtyp cutsq_p=cutsq[ONETYPE];
|
||||
#endif
|
||||
|
||||
@ -412,7 +407,6 @@ __kernel void k_mdpd_fast(const __global numtyp4 *restrict x_,
|
||||
numtyp sigmaij = coeff[mtype].w;
|
||||
numtyp cutij = coeff2[mtype].x;
|
||||
numtyp cut_rij = coeff2[mtype].y;
|
||||
numtyp cutsqij = coeff2[mtype].z;
|
||||
#endif
|
||||
|
||||
numtyp wc = (numtyp)1.0 - r/cutij;
|
||||
@ -421,7 +415,7 @@ __kernel void k_mdpd_fast(const __global numtyp4 *restrict x_,
|
||||
numtyp wr = wc;
|
||||
|
||||
const numtyp rhoj = extra[j].x;
|
||||
|
||||
|
||||
unsigned int tag1=itag, tag2=jtag;
|
||||
if (tag1 > tag2) {
|
||||
tag1 = jtag; tag2 = itag;
|
||||
|
||||
@ -70,7 +70,9 @@ __kernel void k_sph_heatconduction(const __global numtyp4 *restrict x_,
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
int n_stride;
|
||||
#if (SHUFFLE_AVAIL == 0)
|
||||
local_allocate_store_pair();
|
||||
#endif
|
||||
|
||||
acctyp dEacc = (acctyp)0;
|
||||
|
||||
@ -171,7 +173,9 @@ __kernel void k_sph_heatconduction_fast(const __global numtyp4 *restrict x_,
|
||||
#endif
|
||||
|
||||
int n_stride;
|
||||
#if (SHUFFLE_AVAIL == 0)
|
||||
local_allocate_store_pair();
|
||||
#endif
|
||||
|
||||
acctyp dEacc = (acctyp)0;
|
||||
|
||||
@ -234,7 +238,7 @@ __kernel void k_sph_heatconduction_fast(const __global numtyp4 *restrict x_,
|
||||
// Lucy Kernel, 2d
|
||||
wfd = (numtyp)-19.098593171027440292 * wfd * wfd * ihsq * ihsq * ihsq;
|
||||
}
|
||||
|
||||
|
||||
// total thermal energy increment
|
||||
numtyp D = coeffx; // alpha[itype][jtype] diffusion coefficient
|
||||
numtyp deltaE = (numtyp)2.0 * mass_itype * mass_jtype / (mass_itype + mass_jtype);
|
||||
|
||||
@ -13,8 +13,8 @@
|
||||
email : ndactrung@gmail.com
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LAL_SPH_LJ_H
|
||||
#define LAL_SPH_LJ_H
|
||||
#ifndef LAL_SPH_HEATCONDUCTION_H
|
||||
#define LAL_SPH_HEATCONDUCTION_H
|
||||
|
||||
#include "lal_base_sph.h"
|
||||
|
||||
|
||||
@ -110,10 +110,10 @@ void sph_heatconduction_gpu_compute(const int ago, const int inum_full, const in
|
||||
int **firstneigh, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, tagint *host_tag,
|
||||
double **host_v, const int nlocal) {
|
||||
double **host_v) {
|
||||
SPHHeatConductionMF.compute(ago, inum_full, nall, host_x, host_type, ilist, numj,
|
||||
firstneigh, eflag, vflag, eatom, vatom, host_start, cpu_time, success,
|
||||
host_tag, host_v, nlocal);
|
||||
host_tag, host_v);
|
||||
}
|
||||
|
||||
void sph_heatconduction_gpu_get_extra_data(double *host_rho, double *host_esph) {
|
||||
|
||||
@ -362,7 +362,7 @@ __kernel void k_sph_lj_fast(const __global numtyp4 *restrict x_,
|
||||
// Lucy Kernel, 2d
|
||||
wfd = (numtyp)-19.098593171027440292 * wfd * wfd * ihsq * ihsq * ihsq;
|
||||
}
|
||||
|
||||
|
||||
// function call to LJ EOS
|
||||
numtyp fcj[2];
|
||||
LJEOS2(rhoj, esphj, cvj, fcj);
|
||||
@ -404,7 +404,7 @@ __kernel void k_sph_lj_fast(const __global numtyp4 *restrict x_,
|
||||
drhoEacc.y += deltaE;
|
||||
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0;
|
||||
numtyp e = (numtyp)0;
|
||||
energy+=e;
|
||||
}
|
||||
if (EVFLAG && vflag) {
|
||||
|
||||
@ -110,10 +110,10 @@ void sph_lj_gpu_compute(const int ago, const int inum_full, const int nall,
|
||||
int **firstneigh, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, tagint *host_tag,
|
||||
double **host_v, const int nlocal) {
|
||||
double **host_v) {
|
||||
SPHLJMF.compute(ago, inum_full, nall, host_x, host_type, ilist, numj,
|
||||
firstneigh, eflag, vflag, eatom, vatom, host_start, cpu_time, success,
|
||||
host_tag, host_v, nlocal);
|
||||
host_tag, host_v);
|
||||
}
|
||||
|
||||
void sph_lj_gpu_get_extra_data(double *host_rho, double *host_esph, double *host_cv) {
|
||||
|
||||
@ -145,9 +145,9 @@ __kernel void k_sph_taitwater(const __global numtyp4 *restrict x_,
|
||||
// Lucy Kernel, 2d
|
||||
wfd = (numtyp)-19.098593171027440292 * wfd * wfd * ihsq * ihsq * ihsq;
|
||||
}
|
||||
|
||||
|
||||
// compute pressure of atom j with Tait EOS
|
||||
|
||||
|
||||
numtyp tmp = rhoj / rho0_jtype;
|
||||
numtyp fj = tmp * tmp * tmp;
|
||||
fj = B_jtype * (fj * fj * tmp - (numtyp)1.0);
|
||||
@ -321,7 +321,7 @@ __kernel void k_sph_taitwater_fast(const __global numtyp4 *restrict x_,
|
||||
wfd = (numtyp)-19.098593171027440292 * wfd * wfd * ihsq * ihsq * ihsq;
|
||||
}
|
||||
|
||||
// compute pressure of atom j with Tait EOS
|
||||
// compute pressure of atom j with Tait EOS
|
||||
numtyp tmp = rhoj / rho0_jtype;
|
||||
numtyp fj = tmp * tmp * tmp;
|
||||
fj = B_jtype * (fj * fj * tmp - (numtyp)1.0);
|
||||
@ -356,7 +356,7 @@ __kernel void k_sph_taitwater_fast(const __global numtyp4 *restrict x_,
|
||||
drhoEacc.y += deltaE;
|
||||
|
||||
if (EVFLAG && eflag) {
|
||||
numtyp e = (numtyp)0;
|
||||
numtyp e = (numtyp)0;
|
||||
energy+=e;
|
||||
}
|
||||
if (EVFLAG && vflag) {
|
||||
|
||||
@ -114,10 +114,10 @@ void sph_taitwater_gpu_compute(const int ago, const int inum_full, const int nal
|
||||
int **firstneigh, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, tagint *host_tag,
|
||||
double **host_v, const int nlocal) {
|
||||
double **host_v) {
|
||||
SPHTaitwaterMF.compute(ago, inum_full, nall, host_x, host_type, ilist, numj,
|
||||
firstneigh, eflag, vflag, eatom, vatom, host_start, cpu_time, success,
|
||||
host_tag, host_v, nlocal);
|
||||
host_tag, host_v);
|
||||
}
|
||||
|
||||
void sph_taitwater_gpu_get_extra_data(double *host_rho) {
|
||||
|
||||
@ -32,7 +32,7 @@ make lib-mdi args="-m mpi" # build MDI lib with same settings as in the mpi Make
|
||||
|
||||
# settings
|
||||
|
||||
version = "1.4.16"
|
||||
version = "1.4.26"
|
||||
url = "https://github.com/MolSSI-MDI/MDI_Library/archive/v%s.tar.gz" % version
|
||||
|
||||
# known checksums for different MDI versions. used to validate the download.
|
||||
@ -41,6 +41,7 @@ checksums = { \
|
||||
'1.4.12' : '7a222353ae8e03961d5365e6cd48baee', \
|
||||
'1.4.14' : '7a059bb12535360fdcb7de8402f9a0fc', \
|
||||
'1.4.16' : '407db44e2d79447ab5c1233af1965f65', \
|
||||
'1.4.26' : '3124bb85259471e2a53a891f04bf697a', \
|
||||
}
|
||||
|
||||
# print error message or help
|
||||
|
||||
@ -282,6 +282,8 @@ class lammps(object):
|
||||
self.lib.lammps_config_accelerator.argtypes = [c_char_p, c_char_p, c_char_p]
|
||||
|
||||
self.lib.lammps_set_variable.argtypes = [c_void_p, c_char_p, c_char_p]
|
||||
self.lib.lammps_set_string_variable.argtypes = [c_void_p, c_char_p, c_char_p]
|
||||
self.lib.lammps_set_internal_variable.argtypes = [c_void_p, c_char_p, c_double]
|
||||
|
||||
self.lib.lammps_has_style.argtypes = [c_void_p, c_char_p, c_char_p]
|
||||
|
||||
@ -1252,6 +1254,8 @@ class lammps(object):
|
||||
def set_variable(self,name,value):
|
||||
"""Set a new value for a LAMMPS string style variable
|
||||
|
||||
.. deprecated:: TBD
|
||||
|
||||
This is a wrapper around the :cpp:func:`lammps_set_variable`
|
||||
function of the C-library interface.
|
||||
|
||||
@ -1271,6 +1275,52 @@ class lammps(object):
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def set_string_variable(self,name,value):
|
||||
"""Set a new value for a LAMMPS string style variable
|
||||
|
||||
.. versionadded:: TBD
|
||||
|
||||
This is a wrapper around the :cpp:func:`lammps_set_string_variable`
|
||||
function of the C-library interface.
|
||||
|
||||
:param name: name of the variable
|
||||
:type name: string
|
||||
:param value: new variable value
|
||||
:type value: any. will be converted to a string
|
||||
:return: either 0 on success or -1 on failure
|
||||
:rtype: int
|
||||
"""
|
||||
if name: name = name.encode()
|
||||
else: return -1
|
||||
if value: value = str(value).encode()
|
||||
else: return -1
|
||||
with ExceptionCheck(self):
|
||||
return self.lib.lammps_set_string_variable(self.lmp,name,value)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def set_internal_variable(self,name,value):
|
||||
"""Set a new value for a LAMMPS internal style variable
|
||||
|
||||
.. versionadded:: TBD
|
||||
|
||||
This is a wrapper around the :cpp:func:`lammps_set_internal_variable`
|
||||
function of the C-library interface.
|
||||
|
||||
:param name: name of the variable
|
||||
:type name: string
|
||||
:param value: new variable value
|
||||
:type value: float or compatible. will be converted to float
|
||||
:return: either 0 on success or -1 on failure
|
||||
:rtype: int
|
||||
"""
|
||||
if name: name = name.encode()
|
||||
else: return -1
|
||||
with ExceptionCheck(self):
|
||||
return self.lib.lammps_set_internal_variable(self.lmp,name,value)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
# return vector of atom properties gathered across procs
|
||||
# 3 variants to match src/library.cpp
|
||||
# name = atom property recognized by LAMMPS in atom->extract()
|
||||
|
||||
2
src/.gitignore
vendored
2
src/.gitignore
vendored
@ -346,8 +346,6 @@
|
||||
/bond_bpm_spring.h
|
||||
/compute_nbond_atom.cpp
|
||||
/compute_nbond_atom.h
|
||||
/fix_bond_history.cpp
|
||||
/fix_bond_history.h
|
||||
/fix_nve_bpm_sphere.cpp
|
||||
/fix_nve_bpm_sphere.h
|
||||
/fix_update_special_bonds.cpp
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define SMALL 1.0e-6
|
||||
static constexpr double SMALL = 1.0e-6;
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
class ReadADIOSInternal {
|
||||
|
||||
@ -47,13 +47,8 @@ enum{MPOLE_GRID,POLAR_GRID,POLAR_GRIDC,DISP_GRID,INDUCE_GRID,INDUCE_GRIDC};
|
||||
//#define SCALE 1
|
||||
#define SCALE 0
|
||||
|
||||
#ifdef FFT_SINGLE
|
||||
#define ZEROF 0.0f
|
||||
#define ONEF 1.0f
|
||||
#else
|
||||
#define ZEROF 0.0
|
||||
#define ONEF 1.0
|
||||
#endif
|
||||
static constexpr FFT_SCALAR ZEROF = 0.0;
|
||||
static constexpr FFT_SCALAR ONEF = 1.0;
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
partition an FFT grid across processors
|
||||
|
||||
@ -25,23 +25,23 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
enum{UNKNOWN,FFIELD,LITERATURE,ATOMTYPE,VDWL,VDWLPAIR,BSTRETCH,SBEND,ABEND,
|
||||
PAULI,DISPERSION,UB,OUTPLANE,TORSION,PITORSION,ATOMMULT,
|
||||
QPENETRATION,DIPPOLAR,QTRANSFER,END_OF_FILE};
|
||||
enum{ALLINGER,BUFFERED_14_7};
|
||||
enum{ARITHMETIC,GEOMETRIC,CUBIC_MEAN,R_MIN,SIGMA,DIAMETER,HARMONIC,HHG,W_H};
|
||||
enum{MUTUAL,OPT,TCG,DIRECT};
|
||||
enum{NOFRAME,ZONLY,ZTHENX,BISECTOR,ZBISECT,THREEFOLD};
|
||||
enum{GEAR,ASPC,LSQR};
|
||||
enum { UNKNOWN, FFIELD, LITERATURE, ATOMTYPE, VDWL, VDWLPAIR, BSTRETCH, SBEND, ABEND,
|
||||
PAULI, DISPERSION, UB, OUTPLANE, TORSION, PITORSION, ATOMMULT, QPENETRATION, DIPPOLAR,
|
||||
QTRANSFER, END_OF_FILE };
|
||||
enum { ALLINGER, BUFFERED_14_7 };
|
||||
enum { ARITHMETIC, GEOMETRIC, CUBIC_MEAN, R_MIN, SIGMA, DIAMETER, HARMONIC, HHG, W_H };
|
||||
enum { MUTUAL, OPT, TCG, DIRECT };
|
||||
enum { NOFRAME, ZONLY, ZTHENX, BISECTOR, ZBISECT, THREEFOLD };
|
||||
enum { GEAR, ASPC, LSQR };
|
||||
|
||||
#define MAXLINE 65536 // crazy big for TORSION-TORSION section
|
||||
#define MAX_TYPE_PER_GROUP 6 // max types per AMOEBA group
|
||||
#define MAX_FRAME_PER_TYPE 32 // max multipole frames for any AMOEBA type
|
||||
static constexpr int MAXLINE = 65536; // crazy big for TORSION-TORSION section
|
||||
static constexpr int MAX_TYPE_PER_GROUP = 6; // max types per AMOEBA group
|
||||
static constexpr int MAX_FRAME_PER_TYPE = 32; // max multipole frames for any AMOEBA type
|
||||
|
||||
#define DELTA_TYPE_CLASS 32
|
||||
#define DELTA_VDWL_PAIR 16
|
||||
static constexpr int DELTA_TYPE_CLASS = 32;
|
||||
static constexpr int DELTA_VDWL_PAIR = 16;
|
||||
|
||||
#define BOHR 0.52917721067 // Bohr in Angstroms
|
||||
static constexpr double BOHR = 0.52917721067; // Bohr in Angstroms
|
||||
|
||||
// methods to read, parse, and store info from force field file
|
||||
|
||||
@ -79,7 +79,7 @@ void PairAmoeba::read_prmfile(char *filename)
|
||||
|
||||
int me = comm->me;
|
||||
FILE *fptr;
|
||||
char line[MAXLINE];
|
||||
char line[MAXLINE] = {'\0'};
|
||||
|
||||
if (me == 0) {
|
||||
fptr = utils::open_potential(filename, lmp, nullptr);
|
||||
@ -179,8 +179,7 @@ void PairAmoeba::read_prmfile(char *filename)
|
||||
for (int i = 1; i <= n_amtype; i++) nmultiframe[i] = 0;
|
||||
}
|
||||
|
||||
char next[MAXLINE];
|
||||
next[0] = '\0';
|
||||
char next[MAXLINE] = {'\0'};
|
||||
bool has_next = false;
|
||||
int n;
|
||||
while (true) {
|
||||
@ -381,7 +380,7 @@ void PairAmoeba::read_keyfile(char *filename)
|
||||
|
||||
int me = comm->me;
|
||||
FILE *fptr;
|
||||
char line[MAXLINE];
|
||||
char line[MAXLINE] = {'\0'};
|
||||
if (me == 0) {
|
||||
fptr = utils::open_potential(filename, lmp, nullptr);
|
||||
if (fptr == nullptr)
|
||||
|
||||
@ -41,7 +41,7 @@ enum{GEAR,ASPC,LSQR};
|
||||
enum{BUILD,APPLY};
|
||||
enum{GORDON1,GORDON2};
|
||||
|
||||
#define DEBYE 4.80321 // conversion factor from q-Angs (real units) to Debye
|
||||
static constexpr double DEBYE = 4.80321; // conversion factor from q-Angs (real units) to Debye
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
induce = induced dipole moments via pre-conditioned CG solver
|
||||
|
||||
@ -35,11 +35,11 @@ enum{FIELD,ZRSD,TORQUE,UFLD}; // reverse comm
|
||||
enum{VDWL,REPULSE,QFER,DISP,MPOLE,POLAR,USOLV,DISP_LONG,MPOLE_LONG,POLAR_LONG};
|
||||
|
||||
#ifdef FFT_SINGLE
|
||||
#define ZEROF 0.0f
|
||||
#define ONEF 1.0f
|
||||
static constexpr FFT_SCALAR ZEROF = 0.0f;
|
||||
static constexpr FFT_SCALAR ONEF = 1.0f;
|
||||
#else
|
||||
#define ZEROF 0.0
|
||||
#define ONEF 1.0
|
||||
static constexpr FFT_SCALAR ZEROF = 0.0;
|
||||
static constexpr FFT_SCALAR ONEF = 1.0;
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
|
||||
#define SMALL 0.001
|
||||
static constexpr double SMALL = 0.001;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -32,10 +32,10 @@ using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
using namespace MathConst;
|
||||
|
||||
#define BITORSIONMAX 6 // max # of BiTorsion terms stored by one atom
|
||||
#define LISTDELTA 10000
|
||||
#define LB_FACTOR 1.5
|
||||
#define MAXLINE 1024
|
||||
static constexpr int BITORSIONMAX = 6; // max # of BiTorsion terms stored by one atom
|
||||
static constexpr int LISTDELTA = 10000;
|
||||
static constexpr double LB_FACTOR = 1.5;
|
||||
static constexpr int MAXLINE = 1024;
|
||||
|
||||
// spline weighting factors
|
||||
|
||||
@ -724,7 +724,7 @@ double FixAmoebaBiTorsion::compute_scalar()
|
||||
|
||||
void FixAmoebaBiTorsion::read_grid_data(char *bitorsion_file)
|
||||
{
|
||||
char line[MAXLINE];
|
||||
char line[MAXLINE] = {'\0'};
|
||||
char *eof;
|
||||
|
||||
FILE *fp = nullptr;
|
||||
|
||||
@ -32,9 +32,9 @@ using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
using namespace MathConst;
|
||||
|
||||
#define PITORSIONMAX 6 // max # of PiTorsion terms stored by one atom
|
||||
#define LISTDELTA 8196
|
||||
#define LB_FACTOR 1.5
|
||||
static constexpr int PITORSIONMAX = 6; // max # of PiTorsion terms stored by one atom
|
||||
static constexpr int LISTDELTA = 8196;
|
||||
static constexpr double LB_FACTOR = 1.5;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
|
||||
#define TOLERANCE 0.05
|
||||
#define SMALL 0.001
|
||||
static constexpr double TOLERANCE = 0.05;
|
||||
static constexpr double SMALL = 0.001;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ enum{MPOLE_GRID,POLAR_GRID,POLAR_GRIDC,DISP_GRID,INDUCE_GRID,INDUCE_GRIDC};
|
||||
enum{MUTUAL,OPT,TCG,DIRECT};
|
||||
enum{GEAR,ASPC,LSQR};
|
||||
|
||||
#define DELTASTACK 16
|
||||
static constexpr int DELTASTACK = 16;
|
||||
#define DEBUG_AMOEBA 0
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
|
||||
|
||||
enum{ROTATE,ALL};
|
||||
|
||||
#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid
|
||||
static constexpr double INERTIA = 0.2; // moment of inertia prefactor for ellipsoid
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
|
||||
#define INERTIA 0.2 // moment of inertia prefactor for ellipsoid
|
||||
static constexpr double INERTIA = 0.2; // moment of inertia prefactor for ellipsoid
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
using namespace MathConst;
|
||||
|
||||
#define INERTIA (1.0/12.0) // moment of inertia prefactor for line segment
|
||||
static constexpr double INERTIA = (1.0/12.0); // moment of inertia prefactor for line segment
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define DELTA 10000
|
||||
static constexpr int DELTA = 10000;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define DELTA 20
|
||||
static constexpr int DELTA = 20;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
// clang-format off
|
||||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
https://www.lammps.org/, Sandia National Laboratories
|
||||
@ -42,31 +41,30 @@ using namespace LAMMPS_NS;
|
||||
using namespace FixConst;
|
||||
|
||||
static const char cite_user_bocs_package[] =
|
||||
"BOCS package: doi:10.1021/acs.jpcb.7b09993\n\n"
|
||||
"@Article{Dunn2018,\n"
|
||||
" author = {N. J. H. Dunn and K. M. Lebold and M. R. {DeLyser} and\n"
|
||||
" J. F. Rudzinski and W. G. Noid},\n"
|
||||
" title = {{BOCS}: Bottom-Up Open-Source Coarse-Graining Software},\n"
|
||||
" journal = {J.~Phys.\\ Chem.~B},\n"
|
||||
" year = 2018,\n"
|
||||
" volume = 122,\n"
|
||||
" number = 13,\n"
|
||||
" pages = {3363--3377}\n"
|
||||
"}\n\n";
|
||||
"BOCS package: doi:10.1021/acs.jpcb.7b09993\n\n"
|
||||
"@Article{Dunn2018,\n"
|
||||
" author = {N. J. H. Dunn and K. M. Lebold and M. R. {DeLyser} and\n"
|
||||
" J. F. Rudzinski and W. G. Noid},\n"
|
||||
" title = {{BOCS}: Bottom-Up Open-Source Coarse-Graining Software},\n"
|
||||
" journal = {J.~Phys.\\ Chem.~B},\n"
|
||||
" year = 2018,\n"
|
||||
" volume = 122,\n"
|
||||
" number = 13,\n"
|
||||
" pages = {3363--3377}\n"
|
||||
"}\n\n";
|
||||
|
||||
static constexpr double DELTAFLIP = 0.1;
|
||||
static constexpr double TILTMAX = 1.5;
|
||||
static constexpr int NUM_INPUT_DATA_COLUMNS = 2; // columns in the pressure correction file
|
||||
|
||||
#define DELTAFLIP 0.1
|
||||
#define TILTMAX 1.5
|
||||
|
||||
enum{NOBIAS,BIAS};
|
||||
enum{NONE,XYZ,XY,YZ,XZ};
|
||||
enum{ISO,ANISO,TRICLINIC};
|
||||
|
||||
const int NUM_INPUT_DATA_COLUMNS = 2; // columns in the pressure correction file
|
||||
enum { NOBIAS, BIAS };
|
||||
enum { NONE, XYZ, XY, YZ, XZ };
|
||||
enum { ISO, ANISO, TRICLINIC };
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion
|
||||
---------------------------------------------------------------------- */
|
||||
// clang-format off
|
||||
|
||||
FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr),
|
||||
@ -75,7 +73,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
|
||||
{
|
||||
if (lmp->citeme) lmp->citeme->add(cite_user_bocs_package);
|
||||
|
||||
if (narg < 4) error->all(FLERR,"Illegal fix bocs command");
|
||||
if (narg < 4) utils::missing_cmd_args(FLERR,"fix bocs",error);
|
||||
|
||||
restart_global = 1;
|
||||
dynamic_group_allow = 1;
|
||||
@ -102,8 +100,6 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
|
||||
omega_mass_flag = 0;
|
||||
etap_mass_flag = 0;
|
||||
flipflag = 1;
|
||||
dipole_flag = 0;
|
||||
dlm_flag = 0;
|
||||
|
||||
tcomputeflag = 0;
|
||||
pcomputeflag = 0;
|
||||
@ -266,13 +262,6 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) :
|
||||
if (p_flag[2] && domain->zperiodic == 0)
|
||||
error->all(FLERR,"Cannot use fix bocs on a non-periodic dimension");
|
||||
|
||||
if (dipole_flag) {
|
||||
if (!atom->sphere_flag)
|
||||
error->all(FLERR,"Using update dipole flag requires atom style sphere");
|
||||
if (!atom->mu_flag)
|
||||
error->all(FLERR,"Using update dipole flag requires atom attribute mu");
|
||||
}
|
||||
|
||||
if ((tstat_flag && t_period <= 0.0) ||
|
||||
(p_flag[0] && p_period[0] <= 0.0) ||
|
||||
(p_flag[1] && p_period[1] <= 0.0) ||
|
||||
@ -616,8 +605,8 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
|
||||
// Data file lines hold two floating point numbers.
|
||||
// Line length we allocate should be long enough without being too long.
|
||||
// 128 seems safe for a line we expect to be < 30 chars.
|
||||
const int MAX_F_TABLE_LINE_LENGTH = 128;
|
||||
char line[MAX_F_TABLE_LINE_LENGTH];
|
||||
constexpr int MAX_F_TABLE_LINE_LENGTH = 128;
|
||||
char line[MAX_F_TABLE_LINE_LENGTH] = {'\0'};
|
||||
std::vector<std::string> inputLines;
|
||||
while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) {
|
||||
inputLines.emplace_back(line);
|
||||
@ -649,17 +638,13 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
|
||||
for (int i = 0; i < (int)inputLines.size(); ++i) {
|
||||
lineNum++; // count each line processed now so lineNum messages can be 1-based
|
||||
test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2);
|
||||
if (test_sscanf == 2)
|
||||
{
|
||||
if (test_sscanf == 2) {
|
||||
data[VOLUME][i] = (double)f1;
|
||||
data[PRESSURE_CORRECTION][i] = (double)f2;
|
||||
if (i == 1)
|
||||
{
|
||||
if (i == 1) {
|
||||
// second entry is used to compute the validation interval used below
|
||||
stdVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
} else if (i > 1) {
|
||||
// after second entry, all intervals are validated
|
||||
currVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1];
|
||||
if (fabs(currVolumeInterval - stdVolumeInterval) > volumeIntervalTolerance) {
|
||||
@ -673,17 +658,14 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
|
||||
}
|
||||
// no concluding else is intentional: i = 0, first line, no interval to validate
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Bad input format: did not find 2 comma separated numeric"
|
||||
" values in line {} of file {}\nWARNING:\tline: {}",
|
||||
lineNum, filename, inputLines.at(i));
|
||||
badInput = true;
|
||||
}
|
||||
if (badInput)
|
||||
{
|
||||
if (badInput) {
|
||||
numBadVolumeIntervals++;
|
||||
}
|
||||
}
|
||||
@ -700,18 +682,13 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
|
||||
error->warning(FLERR,"Bad volume / pressure-correction data: {}\nSee details above", filename);
|
||||
}
|
||||
|
||||
if (p_basis_type == BASIS_LINEAR_SPLINE)
|
||||
{
|
||||
if (p_basis_type == BASIS_LINEAR_SPLINE) {
|
||||
spline_length = numEntries;
|
||||
numEntries = build_linear_splines(data);
|
||||
}
|
||||
else if (p_basis_type == BASIS_CUBIC_SPLINE)
|
||||
{
|
||||
} else if (p_basis_type == BASIS_CUBIC_SPLINE) {
|
||||
spline_length = numEntries;
|
||||
numEntries = build_cubic_splines(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
error->all(FLERR,"ERROR: invalid p_basis_type value of {} in read_F_table", p_basis_type);
|
||||
}
|
||||
|
||||
@ -724,8 +701,7 @@ int FixBocs::build_linear_splines(double **data) {
|
||||
splines[VOLUME] = (double *) calloc(spline_length,sizeof(double));
|
||||
splines[PRESSURE_CORRECTION] = (double *) calloc(spline_length,sizeof(double));
|
||||
|
||||
for (int i = 0; i < spline_length; ++i)
|
||||
{
|
||||
for (int i = 0; i < spline_length; ++i) {
|
||||
splines[VOLUME][i] = data[VOLUME][i];
|
||||
splines[PRESSURE_CORRECTION][i] = data[PRESSURE_CORRECTION][i];
|
||||
}
|
||||
@ -758,18 +734,15 @@ int FixBocs::build_cubic_splines(double **data)
|
||||
memory->create(mu, n, "mu");
|
||||
memory->create(z, n, "z");
|
||||
|
||||
for (int i=0; i<n; i++)
|
||||
{
|
||||
for (int i=0; i<n; i++) {
|
||||
a[i] = data[1][i];
|
||||
b[i] = 0.0;
|
||||
d[i] = 0.0;
|
||||
if (i<(n-1))
|
||||
{
|
||||
if (i<(n-1)) {
|
||||
h[i] = (data[0][i+1] - data[0][i]);
|
||||
}
|
||||
double alpha_i;
|
||||
if (i>1 && i<(n-1))
|
||||
{
|
||||
if (i>1 && i<(n-1)) {
|
||||
alpha_i = (3.0 / h[i]) * ( data[1][i+1] - data[1][i]) - (3.0 / h[i-1] )
|
||||
* ( data[1][i] - data[1][i-1] );
|
||||
alpha[i-1] = alpha_i;
|
||||
@ -779,8 +752,7 @@ int FixBocs::build_cubic_splines(double **data)
|
||||
mu[0] = 0.0;
|
||||
z[0] = 0.0;
|
||||
|
||||
for (int i=1; i<n-1; i++)
|
||||
{
|
||||
for (int i=1; i<n-1; i++) {
|
||||
l[i] = 2*(data[0][i+1] - data[0][i-1]) - h[i-1] * mu[i-1];
|
||||
mu[i] = h[i]/l[i];
|
||||
z[i] = (alpha[i] - h[i-1] * z[i-1]) / l[i];
|
||||
@ -797,19 +769,15 @@ int FixBocs::build_cubic_splines(double **data)
|
||||
c[n] = 0.0;
|
||||
d[n] = 0.0;
|
||||
|
||||
for (int j=n-1; j>=0; j--)
|
||||
{
|
||||
for (int j=n-1; j>=0; j--) {
|
||||
c[j] = z[j] - mu[j]*c[j+1];
|
||||
|
||||
b[j] = (a[j+1]-a[j])/h[j] - h[j]*(c[j+1] + 2.0 * c[j])/3.0;
|
||||
|
||||
d[j] = (c[j+1]-c[j])/(3.0 * h[j]);
|
||||
}
|
||||
|
||||
int numSplines = n - 1;
|
||||
memory->create(splines, NUM_CUBIC_SPLINE_COLUMNS, numSplines, "splines");
|
||||
for (int idx = 0; idx < numSplines; ++idx)
|
||||
{
|
||||
for (int idx = 0; idx < numSplines; ++idx) {
|
||||
splines[0][idx] = data[0][idx];
|
||||
splines[1][idx] = a[idx];
|
||||
splines[2][idx] = b[idx];
|
||||
|
||||
@ -129,8 +129,6 @@ class FixBocs : public Fix {
|
||||
int eta_mass_flag; // 1 if eta_mass updated, 0 if not.
|
||||
int omega_mass_flag; // 1 if omega_mass updated, 0 if not.
|
||||
int etap_mass_flag; // 1 if etap_mass updated, 0 if not.
|
||||
int dipole_flag; // 1 if dipole is updated, 0 if not.
|
||||
int dlm_flag; // 1 if using the DLM rotational integrator, 0 if not
|
||||
|
||||
int scaleyz; // 1 if yz scaled with lz
|
||||
int scalexz; // 1 if xz scaled with lz
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EPSILON 1.0e-7
|
||||
static constexpr double EPSILON = 1.0e-7;
|
||||
enum{SPHERE,LINE,TRI}; // also in DumpImage
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EPSILON 1.0e-7
|
||||
static constexpr double EPSILON = 1.0e-7;
|
||||
enum{SPHERE,LINE}; // also in DumpImage
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define EPSILON 1.0e-7
|
||||
static constexpr double EPSILON = 1.0e-7;
|
||||
#define MAX_FACE_SIZE 4 // maximum number of vertices per face (for now)
|
||||
|
||||
enum{SPHERE,LINE}; // also in DumpImage
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define DELTA 10000
|
||||
static constexpr int DELTA = 10000;
|
||||
|
||||
enum{ID,TYPE,INDEX};
|
||||
|
||||
|
||||
@ -43,9 +43,9 @@ enum {INVALID=0,NONE=1,VERTEX=2};
|
||||
enum {FAR=0,XLO,XHI,YLO,YHI};
|
||||
|
||||
//#define _POLYGON_DEBUG
|
||||
#define DELTA 10000
|
||||
#define EPSILON 1e-2 // dimensionless threshold (dot products, end point checks, contact checks)
|
||||
#define BIG 1.0e20
|
||||
static constexpr int DELTA = 10000;
|
||||
static constexpr double EPSILON = 1e-2; // dimensionless threshold (dot products, end point checks, contact checks)
|
||||
static constexpr double BIG = 1.0e20;
|
||||
#define MAX_CONTACTS 4 // maximum number of contacts for 2D models
|
||||
#define EFF_CONTACTS 2 // effective contacts for 2D models
|
||||
|
||||
|
||||
@ -43,9 +43,9 @@ enum {INVALID=0,NONE=1,VERTEX=2};
|
||||
enum {FAR=0,XLO,XHI,YLO,YHI,ZLO,ZHI};
|
||||
|
||||
//#define _POLYHEDRON_DEBUG
|
||||
#define DELTA 10000
|
||||
#define EPSILON 1e-3 // dimensionless threshold (dot products, end point checks)
|
||||
#define BIG 1.0e20
|
||||
static constexpr int DELTA = 10000;
|
||||
static constexpr double EPSILON = 1e-3; // dimensionless threshold (dot products, end point checks)
|
||||
static constexpr double BIG = 1.0e20;
|
||||
#define MAX_CONTACTS 4 // maximum number of contacts for 2D models
|
||||
#define EFF_CONTACTS 2 // effective contacts for 2D models
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define DELTA 10000
|
||||
static constexpr int DELTA = 10000;
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -39,8 +39,8 @@
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
#define DELTA 10000
|
||||
#define EPSILON 1e-3 // dimensionless threshold (dot products, end point checks, contact checks)
|
||||
static constexpr int DELTA = 10000;
|
||||
static constexpr double EPSILON = 1e-3; // dimensionless threshold (dot products, end point checks, contact checks)
|
||||
#define MAX_CONTACTS 4 // maximum number of contacts for 2D models
|
||||
#define EFF_CONTACTS 2 // effective contacts for 2D models
|
||||
|
||||
|
||||
@ -43,8 +43,8 @@
|
||||
using namespace LAMMPS_NS;
|
||||
using namespace MathConst;
|
||||
|
||||
#define DELTA 10000
|
||||
#define EPSILON 1e-3 // dimensionless threshold (dot products, end point checks, contact checks)
|
||||
static constexpr int DELTA = 10000;
|
||||
static constexpr double EPSILON = 1e-3; // dimensionless threshold (dot products, end point checks, contact checks)
|
||||
#define MAX_FACE_SIZE 4 // maximum number of vertices per face (same as BodyRoundedPolyhedron)
|
||||
#define MAX_CONTACTS 32 // for 3D models (including duplicated counts)
|
||||
|
||||
|
||||
@ -35,7 +35,6 @@ AtomVecBPMSphere::AtomVecBPMSphere(LAMMPS *_lmp) : AtomVec(_lmp)
|
||||
radvary = 0;
|
||||
|
||||
atom->molecule_flag = 1;
|
||||
atom->sphere_flag = 1;
|
||||
atom->radius_flag = atom->rmass_flag = atom->omega_flag = atom->torque_flag = atom->quat_flag = 1;
|
||||
|
||||
// strings with peratom variables to include in each AtomVec method
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#define EPSILON 1e-10
|
||||
static constexpr double EPSILON = 1e-10;
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
using MathConst::MY_SQRT2;
|
||||
@ -645,7 +645,7 @@ void BondBPMRotational::init_style()
|
||||
{
|
||||
BondBPM::init_style();
|
||||
|
||||
if (!atom->quat_flag || !atom->sphere_flag)
|
||||
if (!atom->quat_flag || !atom->radius_flag || !atom->omega_flag)
|
||||
error->all(FLERR, "Bond bpm/rotational requires atom style bpm/sphere");
|
||||
if (comm->ghost_velocity == 0)
|
||||
error->all(FLERR, "Bond bpm/rotational requires ghost atoms store velocity");
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#define EPSILON 1e-10
|
||||
static constexpr double EPSILON = 1e-10;
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user