Merge branch 'master' into BPM

This commit is contained in:
jtclemm
2021-08-27 10:04:04 -06:00
committed by GitHub
684 changed files with 18358 additions and 15317 deletions

2
.github/CODEOWNERS vendored
View File

@ -129,7 +129,7 @@ src/math_eigen_impl.h @jewettaij
tools/msi2lmp/* @akohlmey
tools/emacs/* @HaoZeke
tools/singularity/* @akohlmey @rbberger
tools/code_standard/* @rbberger
tools/coding_standard/* @rbberger
tools/valgrind/* @akohlmey
tools/swig/* @akohlmey
tools/offline/* @rbberger

10
cmake/.coveragerc.in Normal file
View File

@ -0,0 +1,10 @@
[run]
source = @LAMMPS_PYTHON_DIR@
parallel=True
branch=True
omit=*/install.py
*/setup.py
[paths]
sources = python
@LAMMPS_PYTHON_DIR@

View File

@ -770,6 +770,13 @@ endif()
include(Testing)
include(CodeCoverage)
include(CodingStandard)
find_package(ClangFormat 8.0)
if(ClangFormat_FOUND)
add_custom_target(format-src
COMMAND ${ClangFormat_EXECUTABLE} --verbose -i -style=file *.cpp *.h */*.cpp */*.h
WORKING_DIRECTORY ${LAMMPS_SOURCE_DIR})
endif()
get_target_property(DEFINES lammps COMPILE_DEFINITIONS)
include(FeatureSummary)

View File

@ -54,6 +54,8 @@ if(ENABLE_COVERAGE)
if(COVERAGE_FOUND)
set(PYTHON_COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/python_coverage_html)
configure_file(.coveragerc.in ${CMAKE_BINARY_DIR}/.coveragerc @ONLY)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/unittest/python/.coverage
COMMAND ${COVERAGE_BINARY} combine
@ -63,16 +65,16 @@ if(ENABLE_COVERAGE)
add_custom_target(
gen_python_coverage_html
COMMAND ${COVERAGE_BINARY} html -d ${PYTHON_COVERAGE_HTML_DIR}
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage
COMMAND ${COVERAGE_BINARY} html --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -d ${PYTHON_COVERAGE_HTML_DIR}
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
COMMENT "Generating HTML Python coverage report..."
)
add_custom_target(
gen_python_coverage_xml
COMMAND ${COVERAGE_BINARY} xml -o ${CMAKE_BINARY_DIR}/python_coverage.xml
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage
COMMAND ${COVERAGE_BINARY} xml --rcfile=${CMAKE_BINARY_DIR}/.coveragerc -o ${CMAKE_BINARY_DIR}/python_coverage.xml
DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage ${CMAKE_BINARY_DIR}/.coveragerc
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python
COMMENT "Generating XML Python coverage report..."
)

View File

@ -1,15 +1,15 @@
Development build options (CMake only)
======================================
Development build options
=========================
The CMake build procedure of LAMMPS offers a few extra options which are
The build procedures in LAMMPS offers a few extra options which are
useful during development, testing or debugging.
----------
.. _compilation:
Monitor compilation flags
-------------------------
Monitor compilation flags (CMake only)
--------------------------------------
Sometimes it is necessary to verify the complete sequence of compilation flags
generated by the CMake build. To enable a more verbose output during
@ -30,8 +30,8 @@ variable VERBOSE set to 1:
.. _clang-tidy:
Enable static code analysis with clang-tidy
-------------------------------------------
Enable static code analysis with clang-tidy (CMake only)
--------------------------------------------------------
The `clang-tidy tool <https://clang.llvm.org/extra/clang-tidy/>`_ is a
static code analysis tool to diagnose (and potentially fix) typical
@ -52,8 +52,8 @@ significantly more time consuming than the compilation itself.
.. _iwyu_processing:
Report missing and unneeded '#include' statements
-------------------------------------------------
Report missing and unneeded '#include' statements (CMake only)
--------------------------------------------------------------
The conventions for how and when to use and order include statements in
LAMMPS are `documented in a separate file <https://github.com/lammps/lammps/blob/master/doc/include-file-conventions.md>`_
@ -86,8 +86,8 @@ on recording all commands required to do the compilation.
.. _sanitizer:
Address, Undefined Behavior, and Thread Sanitizer Support
---------------------------------------------------------
Address, Undefined Behavior, and Thread Sanitizer Support (CMake only)
----------------------------------------------------------------------
Compilers such as GCC and Clang support generating instrumented binaries
which use different sanitizer libraries to detect problems in the code
@ -116,8 +116,8 @@ compilation and linking stages. This is done through setting the
.. _testing:
Code Coverage and Unit Testing
------------------------------
Code Coverage and Unit Testing (CMake only)
-------------------------------------------
The LAMMPS code is subject to multiple levels of automated testing
during development: integration testing (i.e. whether the code compiles
@ -464,7 +464,8 @@ Coding style utilities
To aid with enforcing some of the coding style conventions in LAMMPS
some additional build targets have been added. These require Python 3.5
or later and will only work on Unix-like operating and file systems.
or later and will only work properly on Unix-like operating and file systems.
The following options are available.
.. code-block:: bash
@ -476,17 +477,43 @@ The following options are available.
make check-permissions # search for files with permissions issues
make fix-permissions # correct permissions issues in files
These should help to replace all TAB characters with blanks and remove
any trailing whitespace. Also all LAMMPS homepage URL references can be
updated to the location change from Sandia to the lammps.org domain.
And the permission check can remove executable permissions from non-executable
files (like source code).
Clang-format support
--------------------
For the code in the ``unittest`` and ``src`` trees we are transitioning
to use the `clang-format` tool to assist with having a consistent source
code style. The `clang-format` command bundled with Clang version 8.0
or later is required. The configuration is in files ``.clang-format``
in the respective folders. Since the modifications from `clang-format`
can be significant and - especially for "legacy style code" - also is
not always improving readability, a large number of files currently have
a ``// clang-format off`` at the top, which will disable the processing.
Over time, files will be refactored and updated to that `clang-format`
may be applied to them (at least in part).
code formatting style. The `clang-format` command bundled with Clang
version 8.0 or later is required. The configuration is in files called
``.clang-format`` in the respective folders. Since the modifications
from `clang-format` can be significant and - especially for "legacy
style code" - they are not always improving readability, a large number
of files currently have a ``// clang-format off`` at the top, which will
disable the processing. As of fall 2021 all files have been either
"protected" this way or are enabled for full or partial `clang-format`
processing. Over time, the "protected" files will be refactored and
updated so that `clang-format` may be applied to them as well.
If `clang-format` is available, the source code files in the ``unittest``
tree can be updated to conform to the formatting settings using
``make format-tests`` and the files in ``src`` with ``make format-src``.
It is recommended for all newly contributed files to use the clang-format
processing while writing the code or do the coding style processing
(including the scripts mentioned in the previous paragraph)
If `clang-format` is available, files can be updated individually with
commands like the following:
.. code-block:: bash
$ clang-format -i some_file.cpp
The following target are available for both, GNU make and CMake:
.. code-block:: bash
make format-src # apply clang-format to all files in src and the package folders
make format-tests # apply clang-format to all files in the unittest tree

View File

@ -153,7 +153,7 @@ KOKKOS, o = OPENMP, t = OPT.
* :doc:`temp/chunk <compute_temp_chunk>`
* :doc:`temp/com <compute_temp_com>`
* :doc:`temp/cs <compute_temp_cs>`
* :doc:`temp/deform <compute_temp_deform>`
* :doc:`temp/deform (k) <compute_temp_deform>`
* :doc:`temp/deform/eff <compute_temp_deform_eff>`
* :doc:`temp/drude <compute_temp_drude>`
* :doc:`temp/eff <compute_temp_eff>`

View File

@ -149,7 +149,7 @@ OPT.
* :doc:`nvt/body <fix_nvt_body>`
* :doc:`nvt/eff <fix_nh_eff>`
* :doc:`nvt/manifold/rattle <fix_nvt_manifold_rattle>`
* :doc:`nvt/sllod (io) <fix_nvt_sllod>`
* :doc:`nvt/sllod (iko) <fix_nvt_sllod>`
* :doc:`nvt/sllod/eff <fix_nvt_sllod_eff>`
* :doc:`nvt/sphere (o) <fix_nvt_sphere>`
* :doc:`nvt/uef <fix_nh_uef>`

View File

@ -24,6 +24,7 @@ OPT.
* :doc:`ewald (o) <kspace_style>`
* :doc:`ewald/disp <kspace_style>`
* :doc:`ewald/disp/dipole <kspace_style>`
* :doc:`ewald/dipole <kspace_style>`
* :doc:`ewald/dipole/spin <kspace_style>`
* :doc:`msm (o) <kspace_style>`

View File

@ -53,7 +53,8 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package.
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands
""""""""""""""""

View File

@ -64,7 +64,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -50,7 +50,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -49,7 +49,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -49,7 +49,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -57,7 +57,7 @@ Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -50,7 +50,7 @@ Restrictions
""""""""""""
This bond style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -56,7 +56,7 @@ Restrictions
""""""""""""
This bond style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -54,7 +54,7 @@ Restrictions
""""""""""""
This bond style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -1,8 +1,11 @@
.. index:: compute temp/deform
.. index:: compute temp/deform/kk
compute temp/deform command
===========================
Accelerator Variants: *temp/deform/kk*
Syntax
""""""

View File

@ -54,8 +54,8 @@ or :doc:`read_restart <read_restart>` commands:
Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
This dihedral style can only be used if LAMMPS was built with the
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -50,8 +50,8 @@ or :doc:`read_restart <read_restart>` commands:
Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
This dihedral style can only be used if LAMMPS was built with the
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -55,8 +55,8 @@ radian\^2.
Restrictions
""""""""""""
This angle style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
This dihedral style can only be used if LAMMPS was built with the
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -89,7 +89,7 @@ Restrictions
""""""""""""
This dihedral style can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
EXTRA-MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
Related commands

View File

@ -244,9 +244,10 @@ script after reading the restart file.
Restrictions
""""""""""""
These dihedral styles can only be used if LAMMPS was built with the
MOLECULE package. See the :doc:`Build package <Build_package>` doc
page for more info.
The *table* dihedral style can only be used if LAMMPS was built with the
MOLECULE package. The *table/cut* dihedral style can only be used if
LAMMPS was built with the EXTRA-MOLECULE package. See the
:doc:`Build package <Build_package>` doc page for more info.
Related commands
""""""""""""""""

View File

@ -27,21 +27,26 @@ Examples
Description
"""""""""""
In a simulation of polymer chains, this command attempts to swap bonds
between two different chains, effectively grafting the end of one
chain onto another chain and vice versa. This is done via Monte Carlo
rules using the Boltzmann acceptance criterion. The purpose is to
equilibrate the polymer chain conformations more rapidly than dynamics
alone would do it, by enabling instantaneous large conformational
changes in a dense polymer melt. The polymer chains should thus more
rapidly converge to the proper end-to-end distances and radii of
gyration. It is designed for use with systems of
:doc:`FENE <bond_fene>` or :doc:`harmonic <bond_harmonic>` bead-spring
polymer chains where each polymer is a linear chain of monomers, but
LAMMPS does not enforce this requirement, i.e. any
:doc:`bond_style <bond_style>` can be used.
In a simulation of polymer chains this command attempts to swap a pair
of bonds, as illustrated below. This is done via Monte Carlo rules
using the Boltzmann acceptance criterion, typically with the goal of
equilibrating the polymer system more quickly. This fix is designed
for use with idealized bead-spring polymer chains where each polymer
is a linear chain of monomers, but LAMMPS does not check that is the
case for your system.
A schematic of the kinds of bond swaps that can occur is shown here:
Here are two use cases for this fix.
The first use case is for swapping bonds on two different chains,
effectively grafting the end of one chain onto the other chain and
vice versa. The purpose is to equilibrate the polymer chain
conformations more rapidly than dynamics alone would do it, by
enabling instantaneous large conformational changes in a dense polymer
melt. The polymer chains should thus more rapidly converge to the
proper end-to-end distances and radii of gyration.
A schematic of the kinds of bond swaps that can occur in this use case
is shown here:
.. image:: JPG/bondswap.jpg
:align: center
@ -53,38 +58,76 @@ attempt to delete the A1-A2 and B1-B2 bonds and replace them with
A1-B2 and B1-A2 bonds. If the swap is energetically favorable, the
two chains on the right are the result and each polymer chain has
undergone a dramatic conformational change. This reference,
:ref:`(Sides) <Sides>` provides more details on how the algorithm works and
its application:
:ref:`(Sides) <Sides>` provides more details on the algorithm's
effectiveness for this use case.
The bond swapping operation is invoked every *Nevery* timesteps. If
any bond is swapped, a re-build of the neighbor lists is triggered,
since a swap alters the list of which neighbors are considered for
pairwise interaction. At each invocation, each processor considers a
random specified *fraction* of its atoms as potential swapping
monomers for this timestep. Choosing a small *fraction* value can
reduce the likelihood of a reverse swap occurring soon after an
initial swap.
The second use case is a collection of polymer chains with some
fraction of their sites identified as "sticker" sites. Initially each
polymer chain is isolated from the others in a topological sense, and
there is an intra-chain bond between every pair of sticker sites on
the same chain. Over time, bonds swap so that inter-molecular sticker
bonds are created. This models a vitrification-style process whereby
the polymer chains all become interconnected. For this use case, if
angles are defined they should not include bonds between sticker
sites.
For each monomer A1, its neighbors are examined to find a possible B1
monomer. Both A1 and B1 must be in the fix group, their separation
must be less than the specified *cutoff*, and the molecule IDs of A1
and B1 must be the same (see below). If a suitable partner is found,
the energy change due to swapping the 2 bonds is computed. This
includes changes in pairwise, bond, and angle energies due to the
altered connectivity of the 2 chains. Dihedral and improper
interactions are not allowed to be defined when this fix is used.
----------
The bond swapping operation is invoked once every *Nevery* timesteps.
If any bond in the entire system is swapped, a re-build of the
neighbor lists is triggered, since a swap alters the list of which
neighbors are considered for pairwise interaction. At each
invocation, each processor considers a random specified *fraction* of
its atoms as potential swapping monomers for this timestep. Choosing
a small *fraction* value can reduce the likelihood of a reverse swap
occurring soon after an initial swap.
For each monomer A1, its neighbors are looped over as B1 monomers.
For each A1,B1 an additional double loop of bond partners A2 of A1,
and bond partners B2 of B1 a is performed. For each pair of A1-A2 and
B1-B2 bonds to be eligible for swapping, the following 4 criteria must
be met:
(1) All 4 monomers must be in the fix group.
(2) All 4 monomers must be owned by the processor (not ghost atoms).
This insures that another processor does not attempt to swap bonds
involving the same atoms on the same timestep. Note that this also
means that bond pairs which straddle processor boundaries are not
eligible for swapping on this step.
(3) The distances between 4 pairs of atoms -- (A1,A2), (B1,B2),
(A1,B2), (B1,A2) -- must all be less than the specified *cutoff*\ .
(4) The molecule IDs of A1 and B1 must be the same (see below).
If an eligible B1 partner is found, the energy change due to swapping
the 2 bonds is computed. This includes changes in pairwise, bond, and
angle energies due to the altered connectivity of the 2 chains.
Dihedral and improper interactions are not allowed to be defined when
this fix is used.
If the energy decreases due to the swap operation, the bond swap is
accepted. If the energy increases it is accepted with probability
exp(-delta/kT) where delta is the increase in energy, k is the
Boltzmann constant, and T is the current temperature of the system.
Whether the swap is accepted or rejected, no other swaps are attempted
by this processor on this timestep.
The criterion for matching molecule IDs is how bond swaps performed by
this fix conserve chain length. To use this features you must setup
the molecule IDs for your polymer chains in a certain way, typically
in the data file, read by the :doc:`read_data <read_data>` command.
.. note::
IMPORTANT: Whether the swap is accepted or rejected, no other swaps
are attempted by this processor on this timestep. No other
eligible 4-tuples of atoms are considered. This means that each
processor will perform either a single swap or none on timesteps
this fix is invoked.
----------
The criterion for matching molecule IDs is how the first use case
described above can be simulated while conserving chain lengths. This
is done by setting up the molecule IDs for the polymer chains in a
specific way, typically in the data file, read by the :doc:`read_data
<read_data>` command.
Consider a system of 6-mer chains. You have 2 choices. If the
molecule IDs for monomers on each chain are set to 1,2,3,4,5,6 then
swaps will conserve chain length. For a particular monomer there will
@ -113,6 +156,9 @@ ends of a chain swap with each other.
running dynamics, but can affect calculation of some diagnostic
quantities or the printing of unwrapped coordinates to a dump file.
For the second use case described above, the molecule IDs for all
sticker sites should be the same.
----------
This fix computes a temperature each time it is invoked for use by the
@ -129,27 +175,28 @@ appended and the group for the new compute is "all", so that the
temperature of the entire system is used.
Note that this is NOT the compute used by thermodynamic output (see
the :doc:`thermo_style <thermo_style>` command) with ID = *thermo_temp*.
This means you can change the attributes of this fix's temperature
(e.g. its degrees-of-freedom) via the
:doc:`compute_modify <compute_modify>` command or print this temperature
during thermodynamic output via the :doc:`thermo_style custom <thermo_style>` command using the appropriate compute-ID.
It also means that changing attributes of *thermo_temp* will have no
effect on this fix.
the :doc:`thermo_style <thermo_style>` command) with ID =
*thermo_temp*. This means you can change the attributes of this fix's
temperature (e.g. its degrees-of-freedom) via the :doc:`compute_modify
<compute_modify>` command or print this temperature during
thermodynamic output via the :doc:`thermo_style custom <thermo_style>`
command using the appropriate compute-ID. It also means that changing
attributes of *thermo_temp* will have no effect on this fix.
----------
Restart, fix_modify, output, run start/stop, minimize info
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
No information about this fix is written to :doc:`binary restart files <restart>`. Because the state of the random number generator
is not saved in restart files, this means you cannot do "exact"
restarts with this fix, where the simulation continues on the same as
if no restart had taken place. However, in a statistical sense, a
restarted simulation should produce the same behavior. Also note that
each processor generates possible swaps independently of other
processors. Thus if you repeat the same simulation on a different number
of processors, the specific swaps performed will be different.
No information about this fix is written to :doc:`binary restart files
<restart>`. Because the state of the random number generator is not
saved in restart files, this means you cannot do "exact" restarts with
this fix, where the simulation continues on the same as if no restart
had taken place. However, in a statistical sense, a restarted
simulation should produce the same behavior. Also note that each
processor generates possible swaps independently of other processors.
Thus if you repeat the same simulation on a different number of
processors, the specific swaps performed will be different.
The :doc:`fix_modify <fix_modify>` *temp* option is supported by this
fix. You can use it to assign a :doc:`compute <compute>` you have
@ -157,16 +204,18 @@ defined to this fix which will be used to compute the temperature for
the Boltzmann criterion.
This fix computes two statistical quantities as a global 2-vector of
output, which can be accessed by various :doc:`output commands <Howto_output>`. The first component of the vector is the
cumulative number of swaps performed by all processors. The second
component of the vector is the cumulative number of swaps attempted
(whether accepted or rejected). Note that a swap "attempt" only
occurs when swap partners meeting the criteria described above are
found on a particular timestep. The vector values calculated by this
fix are "intensive".
output, which can be accessed by various :doc:`output commands
<Howto_output>`. The first component of the vector is the cumulative
number of swaps performed by all processors. The second component of
the vector is the cumulative number of swaps attempted (whether
accepted or rejected). Note that a swap "attempt" only occurs when
swap partners meeting the criteria described above are found on a
particular timestep. The vector values calculated by this fix are
"intensive".
No parameter of this fix can be used with the *start/stop* keywords of
the :doc:`run <run>` command. This fix is not invoked during :doc:`energy minimization <minimize>`.
the :doc:`run <run>` command. This fix is not invoked during
:doc:`energy minimization <minimize>`.
Restrictions
""""""""""""

View File

@ -1,11 +1,12 @@
.. index:: fix nvt/sllod
.. index:: fix nvt/sllod/intel
.. index:: fix nvt/sllod/omp
.. index:: fix nvt/sllod/kk
fix nvt/sllod command
=====================
Accelerator Variants: *nvt/sllod/intel*, *nvt/sllod/omp*
Accelerator Variants: *nvt/sllod/intel*, *nvt/sllod/omp*, *nvt/sllod/kk*
Syntax
""""""

View File

@ -2,6 +2,7 @@
.. index:: kspace_style ewald/dipole
.. index:: kspace_style ewald/dipole/spin
.. index:: kspace_style ewald/disp
.. index:: kspace_style ewald/disp/dipole
.. index:: kspace_style ewald/omp
.. index:: kspace_style pppm
.. index:: kspace_style pppm/kk
@ -39,7 +40,7 @@ Syntax
kspace_style style value
* style = *none* or *ewald* or *ewald/dipole* or *ewald/dipole/spin* or *ewald/disp* or *ewald/omp* or *pppm* or *pppm/cg* or *pppm/disp* or *pppm/tip4p* or *pppm/stagger* or *pppm/disp/tip4p* or *pppm/gpu* or *pppm/intel* or *pppm/disp/intel* or *pppm/kk* or *pppm/omp* or *pppm/cg/omp* or *pppm/disp/tip4p/omp* or *pppm/tip4p/omp* or *pppm/dielectic* or *pppm/disp/dielectric* or *msm* or *msm/cg* or *msm/omp* or *msm/cg/omp* or *msm/dielectric* or *scafacos*
* style = *none* or *ewald* or *ewald/dipole* or *ewald/dipole/spin* or *ewald/disp* or *ewald/disp/dipole* or *ewald/omp* or *pppm* or *pppm/cg* or *pppm/disp* or *pppm/tip4p* or *pppm/stagger* or *pppm/disp/tip4p* or *pppm/gpu* or *pppm/intel* or *pppm/disp/intel* or *pppm/kk* or *pppm/omp* or *pppm/cg/omp* or *pppm/disp/tip4p/omp* or *pppm/tip4p/omp* or *pppm/dielectic* or *pppm/disp/dielectric* or *msm* or *msm/cg* or *msm/omp* or *msm/cg/omp* or *msm/dielectric* or *scafacos*
.. parsed-literal::
@ -52,6 +53,8 @@ Syntax
accuracy = desired relative error in forces
*ewald/disp* value = accuracy
accuracy = desired relative error in forces
*ewald/disp/dipole* value = accuracy
accuracy = desired relative error in forces
*ewald/omp* value = accuracy
accuracy = desired relative error in forces
*pppm* value = accuracy
@ -156,6 +159,8 @@ matching keyword to the name of the KSpace style, as in this table:
+----------------------+-----------------------+
| tip4p/long | tip4p |
+----------------------+-----------------------+
| dipole/long | dipole |
+----------------------+-----------------------+
----------
@ -168,7 +173,8 @@ The *ewald/disp* style adds a long-range dispersion sum option for
but in a more efficient manner than the *ewald* style. The :math:`1/r^6`
capability means that Lennard-Jones or Buckingham potentials can be
used without a cutoff, i.e. they become full long-range potentials.
The *ewald/disp* style can also be used with point-dipoles, see
The *ewald/disp/dipole* style can also be used with point-dipoles, see
:ref:`(Toukmaji) <Toukmaji>`.
The *ewald/dipole* style adds long-range standard Ewald summations

View File

@ -150,7 +150,8 @@ __kernel void k_lj_tip4p_long_distrib(const __global numtyp4 *restrict x_,
engv[inum*engv_iter + i] += vM.z * (acctyp)0.5 * alpha;
}
}
} else {
}
if (itype == typeO) {
fM = ansO[i];
int iH1 = hneigh[i*4 ];
int iH2 = hneigh[i*4+1];
@ -212,7 +213,8 @@ __kernel void k_lj_tip4p_reneigh(const __global numtyp4 *restrict x_,
hneigh[i*4+1] = iH2;
hneigh[i*4+2] = -1;
}
} else {
}
if (itype == typeH) {
if (hneigh[i*4+2] != -1) {
int iI, iH;
iI = atom_mapping(map,tag[i] - 1);
@ -321,7 +323,8 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_,
iH1 = hneigh[i*4 ];
iH2 = hneigh[i*4+1];
x1 = m[iO];
} else {
}
if (itype == typeH) {
iO = hneigh[i *4 ];
iH1 = hneigh[iO*4 ];
iH2 = hneigh[iO*4+1];
@ -400,16 +403,16 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_,
prefactor *= qqrd2e*qtmp/r;
numtyp force_coul = r2inv*prefactor * (_erfc + EWALD_F*grij*expm2 - factor_coul);
if (itype == typeH) {
f.x += delx * force_coul;
f.y += dely * force_coul;
f.z += delz * force_coul;
f.w += 0;
} else {
if (itype == typeO) {
fO.x += delx * force_coul;
fO.y += dely * force_coul;
fO.z += delz * force_coul;
fO.w += 0;
} else {
f.x += delx * force_coul;
f.y += dely * force_coul;
f.z += delz * force_coul;
f.w += 0;
}
if (EVFLAG && eflag) {
e_coul += prefactor*(_erfc-factor_coul);
@ -419,15 +422,33 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_,
fd.x = delx*force_coul;
fd.y = dely*force_coul;
fd.z = delz*force_coul;
if (itype == typeH) {
if (jtype == typeH) {
virial[0] += delx*fd.x;
virial[1] += dely*fd.y;
virial[2] += delz*fd.z;
virial[3] += delx*fd.y;
virial[4] += delx*fd.z;
virial[5] += dely*fd.z;
if (itype == typeO) {
numtyp cO = 1 - alpha, cH = 0.5*alpha;
numtyp4 vdi, vdj;
numtyp4 xH1; fetch4(xH1,iH1,pos_tex);
numtyp4 xH2; fetch4(xH2,iH2,pos_tex);
numtyp4 xO; fetch4(xO,iO,pos_tex);
vdi.x = xO.x*cO + xH1.x*cH + xH2.x*cH;
vdi.y = xO.y*cO + xH1.y*cH + xH2.y*cH;
vdi.z = xO.z*cO + xH1.z*cH + xH2.z*cH;
//vdi.w = vdi.w;
if (jtype == typeO) {
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
numtyp4 xjH2; fetch4(xjH2,jH2,pos_tex);
numtyp4 xjO; fetch4(xjO,jO,pos_tex);
vdj.x = xjO.x*cO + xjH1.x*cH + xjH2.x*cH;
vdj.y = xjO.y*cO + xjH1.y*cH + xjH2.y*cH;
vdj.z = xjO.z*cO + xjH1.z*cH + xjH2.z*cH;
//vdj.w = vdj.w;
} else vdj = jx;
vO[0] += 0.5*(vdi.x - vdj.x)*fd.x;
vO[1] += 0.5*(vdi.y - vdj.y)*fd.y;
vO[2] += 0.5*(vdi.z - vdj.z)*fd.z;
vO[3] += 0.5*(vdi.x - vdj.x)*fd.y;
vO[4] += 0.5*(vdi.x - vdj.x)*fd.z;
vO[5] += 0.5*(vdi.y - vdj.y)*fd.z;
} else {
if (jtype == typeO) {
numtyp cO = 1 - alpha, cH = 0.5*alpha;
numtyp4 vdj;
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
@ -443,32 +464,14 @@ __kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_,
virial[3] += (ix.x - vdj.x)*fd.y;
virial[4] += (ix.x - vdj.x)*fd.z;
virial[5] += (ix.y - vdj.y)*fd.z;
}
} else {
numtyp cO = 1 - alpha, cH = 0.5*alpha;
numtyp4 vdi, vdj;
numtyp4 xH1; fetch4(xH1,iH1,pos_tex);
numtyp4 xH2; fetch4(xH2,iH2,pos_tex);
numtyp4 xO; fetch4(xO,iO,pos_tex);
vdi.x = xO.x*cO + xH1.x*cH + xH2.x*cH;
vdi.y = xO.y*cO + xH1.y*cH + xH2.y*cH;
vdi.z = xO.z*cO + xH1.z*cH + xH2.z*cH;
//vdi.w = vdi.w;
if (jtype != typeH) {
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
numtyp4 xjH2; fetch4(xjH2,jH2,pos_tex);
numtyp4 xjO; fetch4(xjO,jO,pos_tex);
vdj.x = xjO.x*cO + xjH1.x*cH + xjH2.x*cH;
vdj.y = xjO.y*cO + xjH1.y*cH + xjH2.y*cH;
vdj.z = xjO.z*cO + xjH1.z*cH + xjH2.z*cH;
//vdj.w = vdj.w;
} else vdj = jx;
vO[0] += 0.5*(vdi.x - vdj.x)*fd.x;
vO[1] += 0.5*(vdi.y - vdj.y)*fd.y;
vO[2] += 0.5*(vdi.z - vdj.z)*fd.z;
vO[3] += 0.5*(vdi.x - vdj.x)*fd.y;
vO[4] += 0.5*(vdi.x - vdj.x)*fd.z;
vO[5] += 0.5*(vdi.y - vdj.y)*fd.z;
virial[0] += delx*fd.x;
virial[1] += dely*fd.y;
virial[2] += delz*fd.z;
virial[3] += delx*fd.y;
virial[4] += delx*fd.z;
virial[5] += dely*fd.z;
}
}
}
}
@ -651,7 +654,8 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_,
iH1 = hneigh[i*4 ];
iH2 = hneigh[i*4+1];
x1 = m[iO];
} else {
}
if (itype == typeH) {
iO = hneigh[i *4 ];
iH1 = hneigh[iO*4 ];
iH2 = hneigh[iO*4+1];
@ -730,16 +734,16 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_,
prefactor *= qqrd2e*qtmp/r;
numtyp force_coul = r2inv*prefactor * (_erfc + EWALD_F*grij*expm2 - factor_coul);
if (itype == typeH) {
f.x += delx * force_coul;
f.y += dely * force_coul;
f.z += delz * force_coul;
f.w += 0;
} else {
if (itype == typeO) {
fO.x += delx * force_coul;
fO.y += dely * force_coul;
fO.z += delz * force_coul;
fO.w += 0;
} else {
f.x += delx * force_coul;
f.y += dely * force_coul;
f.z += delz * force_coul;
f.w += 0;
}
if (EVFLAG && eflag) {
e_coul += prefactor*(_erfc-factor_coul);
@ -749,15 +753,33 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_,
fd.x = delx*force_coul;
fd.y = dely*force_coul;
fd.z = delz*force_coul;
if (itype == typeH) {
if (jtype == typeH) {
virial[0] += delx*fd.x;
virial[1] += dely*fd.y;
virial[2] += delz*fd.z;
virial[3] += delx*fd.y;
virial[4] += delx*fd.z;
virial[5] += dely*fd.z;
if (itype == typeO) {
numtyp cO = 1 - alpha, cH = 0.5*alpha;
numtyp4 vdi, vdj;
numtyp4 xH1; fetch4(xH1,iH1,pos_tex);
numtyp4 xH2; fetch4(xH2,iH2,pos_tex);
numtyp4 xO; fetch4(xO,iO,pos_tex);
vdi.x = xO.x*cO + xH1.x*cH + xH2.x*cH;
vdi.y = xO.y*cO + xH1.y*cH + xH2.y*cH;
vdi.z = xO.z*cO + xH1.z*cH + xH2.z*cH;
//vdi.w = vdi.w;
if (jtype == typeO) {
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
numtyp4 xjH2; fetch4(xjH2,jH2,pos_tex);
numtyp4 xjO; fetch4(xjO,jO,pos_tex);
vdj.x = xjO.x*cO + xjH1.x*cH + xjH2.x*cH;
vdj.y = xjO.y*cO + xjH1.y*cH + xjH2.y*cH;
vdj.z = xjO.z*cO + xjH1.z*cH + xjH2.z*cH;
//vdj.w = vdj.w;
} else vdj = jx;
vO[0] += 0.5*(vdi.x - vdj.x)*fd.x;
vO[1] += 0.5*(vdi.y - vdj.y)*fd.y;
vO[2] += 0.5*(vdi.z - vdj.z)*fd.z;
vO[3] += 0.5*(vdi.x - vdj.x)*fd.y;
vO[4] += 0.5*(vdi.x - vdj.x)*fd.z;
vO[5] += 0.5*(vdi.y - vdj.y)*fd.z;
} else {
if (jtype == typeO) {
numtyp cO = 1 - alpha, cH = 0.5*alpha;
numtyp4 vdj;
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
@ -773,32 +795,14 @@ __kernel void k_lj_tip4p_long_fast(const __global numtyp4 *restrict x_,
virial[3] += (ix.x - vdj.x)*fd.y;
virial[4] += (ix.x - vdj.x)*fd.z;
virial[5] += (ix.y - vdj.y)*fd.z;
}
} else {
numtyp cO = 1 - alpha, cH = 0.5*alpha;
numtyp4 vdi, vdj;
numtyp4 xH1; fetch4(xH1,iH1,pos_tex);
numtyp4 xH2; fetch4(xH2,iH2,pos_tex);
numtyp4 xO; fetch4(xO,iO,pos_tex);
vdi.x = xO.x*cO + xH1.x*cH + xH2.x*cH;
vdi.y = xO.y*cO + xH1.y*cH + xH2.y*cH;
vdi.z = xO.z*cO + xH1.z*cH + xH2.z*cH;
//vdi.w = vdi.w;
if (jtype != typeH) {
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
numtyp4 xjH2; fetch4(xjH2,jH2,pos_tex);
numtyp4 xjO; fetch4(xjO,jO,pos_tex);
vdj.x = xjO.x*cO + xjH1.x*cH + xjH2.x*cH;
vdj.y = xjO.y*cO + xjH1.y*cH + xjH2.y*cH;
vdj.z = xjO.z*cO + xjH1.z*cH + xjH2.z*cH;
//vdj.w = vdj.w;
} else vdj = jx;
vO[0] += 0.5*(vdi.x - vdj.x)*fd.x;
vO[1] += 0.5*(vdi.y - vdj.y)*fd.y;
vO[2] += 0.5*(vdi.z - vdj.z)*fd.z;
vO[3] += 0.5*(vdi.x - vdj.x)*fd.y;
vO[4] += 0.5*(vdi.x - vdj.x)*fd.z;
vO[5] += 0.5*(vdi.y - vdj.y)*fd.z;
virial[0] += delx*fd.x;
virial[1] += dely*fd.y;
virial[2] += delz*fd.z;
virial[3] += delx*fd.y;
virial[4] += delx*fd.z;
virial[5] += dely*fd.z;
}
}
}
}

View File

@ -49,7 +49,8 @@ AtomVecOxdna::AtomVecOxdna(LAMMPS *lmp) : AtomVec(lmp)
setup_fields();
if(!force->newton_bond) error->warning(FLERR,"Write_data command requires newton on to preserve 3'->5' bond polarity");
if (!force->newton_bond)
error->warning(FLERR, "Write_data command requires newton on to preserve 3'->5' bond polarity");
}
/* ---------------------------------------------------------------------- */

View File

@ -17,12 +17,12 @@
#include "bond_oxdna_fene.h"
#include "atom.h"
#include "neighbor.h"
#include "comm.h"
#include "update.h"
#include "error.h"
#include "force.h"
#include "memory.h"
#include "error.h"
#include "neighbor.h"
#include "update.h"
#include "atom_vec_ellipsoid.h"
#include "math_extra.h"
@ -43,12 +43,11 @@ BondOxdnaFene::~BondOxdnaFene()
}
}
/* ----------------------------------------------------------------------
compute vector COM-sugar-phosphate backbone interaction site in oxDNA
------------------------------------------------------------------------- */
void BondOxdnaFene::compute_interaction_sites(double e1[3], double /*e2*/[3],
double /*e3*/[3], double r[3]) const
void BondOxdnaFene::compute_interaction_sites(double e1[3], double /*e2*/[3], double /*e3*/[3],
double r[3]) const
{
constexpr double d_cs = -0.4;
@ -61,16 +60,15 @@ void BondOxdnaFene::compute_interaction_sites(double e1[3], double /*e2*/[3],
tally energy and virial into global and per-atom accumulators
------------------------------------------------------------------------- */
void BondOxdnaFene::ev_tally_xyz(int i, int j, int nlocal, int newton_bond,
double ebond,
double fx, double fy, double fz,
double delx, double dely, double delz)
void BondOxdnaFene::ev_tally_xyz(int i, int j, int nlocal, int newton_bond, double ebond, double fx,
double fy, double fz, double delx, double dely, double delz)
{
double ebondhalf, v[6];
if (eflag_either) {
if (eflag_global) {
if (newton_bond) energy += ebond;
if (newton_bond)
energy += ebond;
else {
ebondhalf = 0.5 * ebond;
if (i < nlocal) energy += ebondhalf;
@ -208,8 +206,8 @@ void BondOxdnaFene::compute(int eflag, int vflag)
// if r > 2*Delta something serious is wrong, abort
if (rlogarg < 0.1) {
error->warning(FLERR,"FENE bond too long: {} {} {} {}",
update->ntimestep,atom->tag[a],atom->tag[b],r);
error->warning(FLERR, "FENE bond too long: {} {} {} {}", update->ntimestep, atom->tag[a],
atom->tag[b], r);
rlogarg = 0.1;
}
@ -220,9 +218,7 @@ void BondOxdnaFene::compute(int eflag, int vflag)
// energy
if (eflag) {
ebond = -0.5 * k[type]*log(rlogarg);
}
if (eflag) { ebond = -0.5 * k[type] * log(rlogarg); }
// apply force and torque to each of 2 atoms
@ -237,7 +233,6 @@ void BondOxdnaFene::compute(int eflag, int vflag)
torque[a][0] += delta[0];
torque[a][1] += delta[1];
torque[a][2] += delta[2];
}
if (newton_bond || b < nlocal) {
@ -251,18 +246,16 @@ void BondOxdnaFene::compute(int eflag, int vflag)
torque[b][0] -= deltb[0];
torque[b][1] -= deltb[1];
torque[b][2] -= deltb[2];
}
// increment energy and virial
// NOTE: The virial is calculated on the 'molecular' basis.
// (see G. Ciccotti and J.P. Ryckaert, Comp. Phys. Rep. 4, 345-392 (1986))
if (evflag) ev_tally_xyz(a,b,nlocal,newton_bond,ebond,
delf[0],delf[1],delf[2],x[a][0]-x[b][0],x[a][1]-x[b][1],x[a][2]-x[b][2]);
if (evflag)
ev_tally_xyz(a, b, nlocal, newton_bond, ebond, delf[0], delf[1], delf[2], x[a][0] - x[b][0],
x[a][1] - x[b][1], x[a][2] - x[b][2]);
}
}
/* ---------------------------------------------------------------------- */
@ -278,7 +271,6 @@ void BondOxdnaFene::allocate()
memory->create(setflag, n + 1, "bond:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -308,7 +300,6 @@ void BondOxdnaFene::coeff(int narg, char **arg)
}
if (count == 0) error->all(FLERR, "Incorrect args for bond coefficients in oxdna/fene");
}
/* ----------------------------------------------------------------------
@ -318,7 +309,9 @@ void BondOxdnaFene::coeff(int narg, char **arg)
void BondOxdnaFene::init_style()
{
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 || force->special_lj[3] != 1.0)
error->all(FLERR,"Must use 'special_bonds lj 0 1 1' with bond style oxdna/fene, oxdna2/fene or oxrna2/fene");
error->all(
FLERR,
"Must use 'special_bonds lj 0 1 1' with bond style oxdna/fene, oxdna2/fene or oxrna2/fene");
}
/* ---------------------------------------------------------------------- */
@ -371,8 +364,7 @@ void BondOxdnaFene::write_data(FILE *fp)
/* ---------------------------------------------------------------------- */
double BondOxdnaFene::single(int type, double rsq, int /*i*/, int /*j*/,
double &fforce)
double BondOxdnaFene::single(int type, double rsq, int /*i*/, int /*j*/, double &fforce)
{
double r = sqrt(rsq);
double rr0 = r - r0[type];
@ -385,8 +377,7 @@ double BondOxdnaFene::single(int type, double rsq, int /*i*/, int /*j*/,
// if r > 2*Delta something serious is wrong, abort
if (rlogarg < 0.1) {
error->warning(FLERR,"FENE bond too long: {} {:.8}",
update->ntimestep,sqrt(rsq));
error->warning(FLERR, "FENE bond too long: {} {:.8}", update->ntimestep, sqrt(rsq));
rlogarg = 0.1;
}

View File

@ -29,7 +29,6 @@
#error must have at least zstd version 1.4 to compile with -DLAMMPS_ZSTD
#endif
namespace LAMMPS_NS {
class ZstdFileWriter : public FileWriter {

View File

@ -868,7 +868,8 @@ void FixPolarizeBEMGMRES::set_arrays(int i)
/* ---------------------------------------------------------------------- */
int FixPolarizeBEMGMRES::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
int FixPolarizeBEMGMRES::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/,
int * /*pbc*/)
{
int m;
for (m = 0; m < n; m++) buf[m] = atom->q[list[m]];

View File

@ -396,7 +396,8 @@ int FixPolarizeBEMICC::modify_param(int narg, char **arg)
/* ---------------------------------------------------------------------- */
int FixPolarizeBEMICC::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
int FixPolarizeBEMICC::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/,
int * /*pbc*/)
{
int m;
for (m = 0; m < n; m++) buf[m] = atom->q[list[m]];

View File

@ -538,7 +538,8 @@ int FixPolarizeFunctional::unpack_exchange(int nlocal, double *buf)
/* ---------------------------------------------------------------------- */
int FixPolarizeFunctional::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
int FixPolarizeFunctional::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/,
int * /*pbc*/)
{
int m;
for (m = 0; m < n; m++) buf[m] = atom->q[list[m]];

View File

@ -22,11 +22,11 @@
#include "comm.h"
#include "error.h"
#include "force.h"
#include "neighbor.h"
#include "math_const.h"
#include "memory.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "memory.h"
#include "math_const.h"
#include "neighbor.h"
#include <cmath>
#include <cstring>
@ -159,7 +159,6 @@ void PairCoulCutDielectric::compute(int eflag, int vflag)
if (vflag_fdotr) virial_fdotr_compute();
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
@ -176,10 +175,8 @@ void PairCoulCutDielectric::init_style()
/* ---------------------------------------------------------------------- */
double PairCoulCutDielectric::single(int i, int j, int /*itype*/, int /*jtype*/,
double rsq,
double factor_coul, double /*factor_lj*/,
double &fforce)
double PairCoulCutDielectric::single(int i, int j, int /*itype*/, int /*jtype*/, double rsq,
double factor_coul, double /*factor_lj*/, double &fforce)
{
double r2inv, phicoul, ei, ej;
double *eps = atom->epsilon;
@ -188,10 +185,14 @@ double PairCoulCutDielectric::single(int i, int j, int /*itype*/, int /*jtype*/,
fforce = force->qqrd2e * atom->q[i] * atom->q[j] * sqrt(r2inv) * eps[i];
double eng = 0.0;
if (eps[i] == 1) ei = 0;
else ei = eps[i];
if (eps[j] == 1) ej = 0;
else ej = eps[j];
if (eps[i] == 1)
ei = 0;
else
ei = eps[i];
if (eps[j] == 1)
ej = 0;
else
ej = eps[j];
phicoul = force->qqrd2e * atom->q[i] * atom->q[j] * sqrt(r2inv);
phicoul *= 0.5 * (ei + ej);
eng += factor_coul * phicoul;

View File

@ -267,7 +267,8 @@ void PairLJLongCoulLongDielectric::compute(int eflag, int vflag)
if (eflag) evdwl = f * (rn * (rn * lj3i[jtype] - lj4i[jtype]) - offseti[jtype]);
}
}
} else force_lj = evdwl = 0.0;
} else
force_lj = evdwl = 0.0;
fpair_i = (force_coul * etmp + force_lj) * r2inv;
f[i][0] += delx * fpair_i;

View File

@ -485,3 +485,14 @@ void PairLJCutDipoleCut::read_restart_settings(FILE *fp)
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
}
/* ---------------------------------------------------------------------- */
void *PairLJCutDipoleCut::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"cut_coul") == 0) return (void *) cut_coul;
if (strcmp(str,"epsilon") == 0) return (void *) epsilon;
if (strcmp(str,"sigma") == 0) return (void *) sigma;
return nullptr;
}

View File

@ -37,6 +37,7 @@ class PairLJCutDipoleCut : public Pair {
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void *extract(const char *, int &);
protected:
double cut_lj_global, cut_coul_global;

View File

@ -540,18 +540,18 @@ void PairLJCutDipoleLong::read_restart_settings(FILE *fp)
void *PairLJCutDipoleLong::extract(const char *str, int &dim)
{
if (strcmp(str,"cut_coul") == 0) {
dim = 0;
return (void *) &cut_coul;
} else if (strcmp(str,"ewald_order") == 0) {
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
else if (strcmp(str,"ewald_order") == 0) {
ewald_order = 0;
ewald_order |= 1<<1;
ewald_order |= 1<<3;
dim = 0;
return (void *) &ewald_order;
} else if (strcmp(str,"ewald_mix") == 0) {
dim = 0;
return (void *) &mix_flag;
}
} else if (strcmp(str,"ewald_mix") == 0) return (void *) &mix_flag;
dim = 2;
if (strcmp(str,"epsilon") == 0) return (void *) epsilon;
else if (strcmp(str,"sigma") == 0) return (void *) sigma;
return nullptr;
}

View File

@ -40,6 +40,7 @@ class PairLJCutDipoleLong : public Pair {
void read_restart(FILE *);
void write_restart_settings(FILE *);
void read_restart_settings(FILE *);
void *extract(const char *, int &);
protected:
double cut_lj_global;
@ -49,7 +50,6 @@ class PairLJCutDipoleLong : public Pair {
double **lj1, **lj2, **lj3, **lj4, **offset;
double g_ewald;
int ewald_order;
virtual void *extract(const char *, int &);
void allocate();
};

View File

@ -67,7 +67,7 @@ void PairLJLongDipoleLong::options(char **arg, int order)
for (i=0; option[i]&&strcmp(arg[0], option[i]); ++i);
switch (i) {
case 0: ewald_order |= 1<<order; break; // set kspace r^-order
case 2: ewald_off |= 1<<order; // turn r^-order off
case 2: ewald_off |= 1<<order; break; // turn r^-order off
case 1: break;
default: error->all(FLERR,"Illegal pair_style lj/long/dipole/long command");
}
@ -77,23 +77,25 @@ void PairLJLongDipoleLong::settings(int narg, char **arg)
{
if (narg != 3 && narg != 4) error->all(FLERR,"Illegal pair_style command");
ewald_off = 0;
ewald_order = 0;
ewald_off = 0;
options(arg, 6);
options(++arg, 3);
options(arg, 1);
if (!comm->me && ewald_order&(1<<6))
error->warning(FLERR,"Geometric mixing assumed for 1/r^6 coefficients");
if (!comm->me && ewald_order==((1<<3)|(1<<6)))
error->warning(FLERR,
"Using largest cut-off for lj/long/dipole/long long long");
error->warning(FLERR,"Using largest cut-off for lj/long/dipole/long long long");
if (!*(++arg))
error->all(FLERR,"Cut-offs missing in pair_style lj/long/dipole/long");
error->all(FLERR,"Cutoffs missing in pair_style lj/long/dipole/long");
if (!((ewald_order^ewald_off) & (1<<6)))
dispersionflag = 0;
if (!((ewald_order^ewald_off)&(1<<3)))
error->all(FLERR,
"Coulombic cut not supported in pair_style lj/long/dipole/long");
error->all(FLERR,"Coulombic cut not supported in pair_style lj/long/dipole/long");
cut_lj_global = utils::numeric(FLERR,*(arg++),false,lmp);
if (narg == 4 && (ewald_order==74))
if (narg == 4 && (ewald_order==0x4a))
error->all(FLERR,"Only one cut-off allowed when requesting all long");
if (narg == 4) cut_coul = utils::numeric(FLERR,*(arg++),false,lmp);
else cut_coul = cut_lj_global;
@ -222,10 +224,6 @@ void PairLJLongDipoleLong::coeff(int narg, char **arg)
void PairLJLongDipoleLong::init_style()
{
const char *style3[] = {"ewald/disp", nullptr};
const char *style6[] = {"ewald/disp", nullptr};
int i;
if (strcmp(update->unit_style,"electron") == 0)
error->all(FLERR,"Cannot (yet) use 'electron' units with dipoles");
@ -246,16 +244,14 @@ void PairLJLongDipoleLong::init_style()
if (ewald_order&(1<<3)) { // r^-1 kspace
if (force->kspace == nullptr)
error->all(FLERR,"Pair style requires a KSpace style");
for (i=0; style3[i]&&strcmp(force->kspace_style, style3[i]); ++i);
if (!style3[i])
error->all(FLERR,"Pair style requires use of kspace_style ewald/disp");
if (!force->kspace->dipoleflag)
error->all(FLERR,"Pair style requires use of kspace_style with dipole support");
}
if (ewald_order&(1<<6)) { // r^-6 kspace
if (force->kspace == nullptr)
error->all(FLERR,"Pair style requires a KSpace style");
for (i=0; style6[i]&&strcmp(force->kspace_style, style6[i]); ++i);
if (!style6[i])
error->all(FLERR,"Pair style requires use of kspace_style ewald/disp");
if (!force->kspace->dispersionflag)
error->all(FLERR,"Pair style requires use of kspace_style with dispersion support");
}
if (force->kspace) g_ewald = force->kspace->g_ewald;
}
@ -371,6 +367,8 @@ void PairLJLongDipoleLong::write_restart_settings(FILE *fp)
fwrite(&offset_flag,sizeof(int),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
fwrite(&ewald_order,sizeof(int),1,fp);
fwrite(&ewald_off,sizeof(int),1,fp);
fwrite(&dispersionflag,sizeof(int),1,fp);
}
/* ----------------------------------------------------------------------
@ -385,12 +383,16 @@ void PairLJLongDipoleLong::read_restart_settings(FILE *fp)
utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&ewald_off,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error);
}
MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world);
MPI_Bcast(&offset_flag,1,MPI_INT,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
MPI_Bcast(&ewald_order,1,MPI_INT,0,world);
MPI_Bcast(&ewald_off,1,MPI_INT,0,world);
MPI_Bcast(&dispersionflag,1,MPI_INT,0,world);
}
/* ----------------------------------------------------------------------

View File

@ -19,8 +19,6 @@
#include "pair_lj_sf_dipole_sf.h"
#include <cmath>
#include <cstring>
#include "atom.h"
#include "neighbor.h"
#include "neigh_list.h"
@ -28,9 +26,11 @@
#include "force.h"
#include "memory.h"
#include "error.h"
#include "update.h"
#include <cmath>
#include <cstring>
using namespace LAMMPS_NS;
static int warn_single = 0;
@ -303,9 +303,13 @@ void PairLJSFDipoleSF::allocate()
int n = atom->ntypes;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
memory->create(scale,n+1,n+1,"pair:scale");
for (int i = 1; i <= n; i++) {
for (int j = i; j <= n; j++) {
setflag[i][j] = 0;
scale[i][j] = 1.0;
}
}
memory->create(cutsq,n+1,n+1,"pair:cutsq");
@ -319,7 +323,6 @@ void PairLJSFDipoleSF::allocate()
memory->create(lj2,n+1,n+1,"pair:lj2");
memory->create(lj3,n+1,n+1,"pair:lj3");
memory->create(lj4,n+1,n+1,"pair:lj4");
memory->create(scale,n+1,n+1,"pair:scale");
}
/* ----------------------------------------------------------------------
@ -639,5 +642,6 @@ void *PairLJSFDipoleSF::extract(const char *str, int &dim)
if (strcmp(str,"epsilon") == 0) return (void *) epsilon;
if (strcmp(str,"sigma") == 0) return (void *) sigma;
if (strcmp(str,"scale") == 0) return (void *) scale;
if (strcmp(str,"cut_coul") == 0) return (void *) cut_coul;
return nullptr;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -30,8 +29,8 @@
#include "memory.h"
#include "neighbor.h"
#include <cmath>
#include <cassert>
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathConst;
@ -77,18 +76,16 @@ DihedralSpherical::~DihedralSpherical()
}
}
static void norm3safe(double *v) {
static void norm3safe(double *v)
{
double inv_scale = sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
double scale = 1.0;
if (inv_scale > 0.0)
scale = 1.0 / inv_scale;
if (inv_scale > 0.0) scale = 1.0 / inv_scale;
v[0] *= scale;
v[1] *= scale;
v[2] *= scale;
}
// --------------------------------------------
// ------- Calculate the dihedral angle -------
// --------------------------------------------
@ -141,8 +138,6 @@ static double Phi(double const *x1, //array holding x,y,z coords atom 1
return phi;
} // DihedralSpherical::Phi()
/* ---------------------------------------------------------------------- */
void DihedralSpherical::compute(int eflag, int vflag)
@ -216,7 +211,6 @@ void DihedralSpherical::compute(int eflag, int vflag)
edihedral = 0.0;
ev_init(eflag, vflag);
for (n = 0; n < ndihedrallist; n++) {
i1 = dihedrallist[n][0];
@ -232,13 +226,10 @@ void DihedralSpherical::compute(int eflag, int vflag)
// This function also calculates the vectors:
// vb12, vb23, vb34, n123, and n234, which we will need later.
double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain,
vb12, vb23, vb34, n123, n234);
double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain, vb12, vb23, vb34, n123, n234);
// Step 2: Compute the gradients of phi, theta1, theta2 with atom position:
// ===================== Step2a) phi dependence: ========================
//
// Gradient variables:
@ -344,7 +335,6 @@ void DihedralSpherical::compute(int eflag, int vflag)
dphi_dx3[d] = dphi123_dx3_coef * dphi_dx1[d] + dphi234_dx3_coef * dphi_dx4[d];
}
// ============= Step2b) theta1 and theta2 dependence: =============
// --- Compute the gradient vectors dtheta1/dx1 and dtheta2/dx4: ---
@ -453,12 +443,16 @@ void DihedralSpherical::compute(int eflag, int vflag)
}
double ct1 = -dot123 * inv_L12 * inv_L23;
if (ct1 < -1.0) ct1 = -1.0;
else if (ct1 > 1.0) ct1 = 1.0;
if (ct1 < -1.0)
ct1 = -1.0;
else if (ct1 > 1.0)
ct1 = 1.0;
double theta1 = acos(ct1);
double ct2 = -dot234 * inv_L23 * inv_L34;
if (ct2 < -1.0) ct2 = -1.0;
else if (ct2 > 1.0) ct2 = 1.0;
if (ct2 < -1.0)
ct2 = -1.0;
else if (ct2 > 1.0)
ct2 = 1.0;
double theta2 = acos(ct2);
// - Step 3: Calculate the energy and force in the phi & theta1/2 directions
@ -468,9 +462,7 @@ void DihedralSpherical::compute(int eflag, int vflag)
double m_du_dth2 = 0.0; // m_du_dth2 = -du / d theta2
double m_du_dphi = 0.0; // m_du_dphi = -du / d phi
u = CalcGeneralizedForces(type,
phi, theta1, theta2,
&m_du_dth1, &m_du_dth2, &m_du_dphi);
u = CalcGeneralizedForces(type, phi, theta1, theta2, &m_du_dth1, &m_du_dth2, &m_du_dphi);
if (eflag) edihedral = u;
@ -516,26 +508,15 @@ void DihedralSpherical::compute(int eflag, int vflag)
}
if (evflag)
ev_tally(i1,i2,i3,i4,
nlocal,newton_bond,edihedral,
f1,f3,f4,
vb12[0],vb12[1],vb12[2],
vb23[0],vb23[1],vb23[2],
vb34[0],vb34[1],vb34[2]);
ev_tally(i1, i2, i3, i4, nlocal, newton_bond, edihedral, f1, f3, f4, vb12[0], vb12[1],
vb12[2], vb23[0], vb23[1], vb23[2], vb34[0], vb34[1], vb34[2]);
}
} // void DihedralSpherical::compute()
// --- CalcGeneralizedForces() ---
// --- Calculate the energy as a function of theta1, theta2, and phi ---
// --- as well as its derivatives (with respect to theta1, theta2, and phi) ---
// The code above above is sufficiently general that it can work with any
// any function of the angles theta1, theta2, and phi. However the
// function below calculates the energy and force according to this specific
@ -548,16 +529,8 @@ void DihedralSpherical::compute(int eflag, int vflag)
// \Theta_{2i}(\theta_2) = cos((\theta_2-b_i)L_i) + v_i
// \Phi_i(\phi) = cos((\phi - c_i)M_i) + w_i
double DihedralSpherical::
CalcGeneralizedForces(int type,
double phi,
double theta1,
double theta2,
double *m_du_dth1,
double *m_du_dth2,
double DihedralSpherical::CalcGeneralizedForces(int type, double phi, double theta1, double theta2,
double *m_du_dth1, double *m_du_dth2,
double *m_du_dphi)
{
double energy = 0.0;
@ -597,23 +570,18 @@ CalcGeneralizedForces(int type,
st2 = sin(t2);
}
energy += Ccoeff[i][j] * (phi_offset[i][j] - cp) *
(theta1_offset[i][j] - ct1) *
energy += Ccoeff[i][j] * (phi_offset[i][j] - cp) * (theta1_offset[i][j] - ct1) *
(theta2_offset[i][j] - ct2);
// Forces:
*m_du_dphi += -Ccoeff[i][j] * sp * phi_mult[i][j] *
(theta1_offset[i][j] - ct1) *
*m_du_dphi += -Ccoeff[i][j] * sp * phi_mult[i][j] * (theta1_offset[i][j] - ct1) *
(theta2_offset[i][j] - ct2);
*m_du_dth1 += -Ccoeff[i][j] * (phi_offset[i][j] - cp) *
st1 * theta1_mult[i][j] *
*m_du_dth1 += -Ccoeff[i][j] * (phi_offset[i][j] - cp) * st1 * theta1_mult[i][j] *
(theta2_offset[i][j] - ct2);
*m_du_dth2 += -Ccoeff[i][j] * (phi_offset[i][j] - cp) *
(theta1_offset[i][j] - ct1) *
st2 * theta2_mult[i][j];
*m_du_dth2 += -Ccoeff[i][j] * (phi_offset[i][j] - cp) * (theta1_offset[i][j] - ct1) * st2 *
theta2_mult[i][j];
// Things to consider later:
// To speed up the computation, one could try to simplify the expansion:
@ -631,30 +599,24 @@ CalcGeneralizedForces(int type,
} //CalcGeneralizedForces()
void DihedralSpherical::allocate()
{
allocated = 1;
int n = atom->ndihedraltypes;
int n = atom->ndihedraltypes + 1;
memory->create(nterms,n+1,"dihedral:nterms");
memory->create(nterms, n, "dihedral:nterms");
Ccoeff = new double * [n+1];
phi_mult = new double * [n+1];
phi_shift = new double * [n+1];
phi_offset = new double * [n+1];
theta1_mult = new double * [n+1];
theta1_shift = new double * [n+1];
theta1_offset = new double * [n+1];
theta2_mult = new double * [n+1];
theta2_shift = new double * [n+1];
theta2_offset = new double * [n+1];
for (int i = 1; i <= n; i++) {
Ccoeff = new double *[n];
phi_mult = new double *[n];
phi_shift = new double *[n];
phi_offset = new double *[n];
theta1_mult = new double *[n];
theta1_shift = new double *[n];
theta1_offset = new double *[n];
theta2_mult = new double *[n];
theta2_shift = new double *[n];
theta2_offset = new double *[n];
for (int i = 0; i < n; i++) {
Ccoeff[i] = nullptr;
phi_mult[i] = nullptr;
phi_shift[i] = nullptr;
@ -667,8 +629,8 @@ void DihedralSpherical::allocate()
theta2_offset[i] = nullptr;
}
memory->create(setflag,n+1,"dihedral:setflag");
for (int i = 1; i <= n; i++) setflag[i] = 0;
memory->create(setflag, n, "dihedral:setflag");
for (int i = 1; i < n; i++) setflag[i] = 0;
}
/* ----------------------------------------------------------------------
@ -685,8 +647,7 @@ void DihedralSpherical::coeff(int narg, char **arg)
int nterms_one = utils::inumeric(FLERR, arg[1], false, lmp);
if (nterms_one < 1)
error->all(FLERR,"Incorrect number of terms arg for dihedral coefficients");
if (nterms_one < 1) error->all(FLERR, "Incorrect number of terms arg for dihedral coefficients");
if (2 + 10 * nterms_one < narg)
error->all(FLERR, "Incorrect number of arguments for dihedral coefficients");
@ -694,6 +655,16 @@ void DihedralSpherical::coeff(int narg, char **arg)
int count = 0;
for (int i = ilo; i <= ihi; i++) {
nterms[i] = nterms_one;
delete[] Ccoeff[i];
delete[] phi_mult[i];
delete[] phi_shift[i];
delete[] phi_offset[i];
delete[] theta1_mult[i];
delete[] theta1_shift[i];
delete[] theta1_offset[i];
delete[] theta2_mult[i];
delete[] theta2_shift[i];
delete[] theta2_offset[i];
Ccoeff[i] = new double[nterms_one];
phi_mult[i] = new double[nterms_one];
phi_shift[i] = new double[nterms_one];
@ -730,7 +701,6 @@ void DihedralSpherical::coeff(int narg, char **arg)
void DihedralSpherical::write_restart(FILE *fp)
{
fwrite(&nterms[1], sizeof(int), atom->ndihedraltypes, fp);
for (int i = 1; i <= atom->ndihedraltypes; i++) {
fwrite(Ccoeff[i], sizeof(double), nterms[i], fp);
@ -744,7 +714,6 @@ void DihedralSpherical::write_restart(FILE *fp)
fwrite(theta2_shift[i], sizeof(double), nterms[i], fp);
fwrite(theta2_offset[i], sizeof(double), nterms[i], fp);
}
}
/* ----------------------------------------------------------------------
@ -805,9 +774,6 @@ void DihedralSpherical::read_restart(FILE *fp)
for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
@ -817,21 +783,15 @@ void DihedralSpherical::write_data(FILE *fp)
for (int i = 1; i <= atom->ndihedraltypes; i++) {
fprintf(fp, "%d %d ", i, nterms[i]);
for (int j = 0; j < nterms[i]; j++) {
fprintf(fp, "%g %g %g %g %g %g %g %g %g %g ", Ccoeff[i][j],
phi_mult[i][j], phi_shift[i][j]*180.0/MY_PI, phi_offset[i][j],
theta1_mult[i][j], theta1_shift[i][j]*180.0/MY_PI,
theta1_offset[i][j], theta2_mult[i][j],
fprintf(fp, "%g %g %g %g %g %g %g %g %g %g ", Ccoeff[i][j], phi_mult[i][j],
phi_shift[i][j] * 180.0 / MY_PI, phi_offset[i][j], theta1_mult[i][j],
theta1_shift[i][j] * 180.0 / MY_PI, theta1_offset[i][j], theta2_mult[i][j],
theta2_shift[i][j] * 180.0 / MY_PI, theta2_offset[i][j]);
}
fprintf(fp, "\n");
}
}
// Not needed?
// single() calculates the dihedral-angle energy of atoms i1, i2, i3, i4.
//double DihedralSpherical::single(int type, int i1, int i2, int i3, int i4)
@ -874,4 +834,3 @@ void DihedralSpherical::write_data(FILE *fp)
// &m_du_dth1, &m_du_dth2, &m_du_dphi);
// return u;
//}

View File

@ -489,7 +489,7 @@ double PairNMCutCoulCut::single(int i, int j, int itype, int jtype,
void *PairNMCutCoulCut::extract(const char *str, int &dim)
{
dim = 2;
if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
if (strcmp(str,"cut_coul") == 0) return (void *) cut_coul;
if (strcmp(str,"e0") == 0) return (void *) e0;
if (strcmp(str,"r0") == 0) return (void *) r0;
if (strcmp(str,"nn") == 0) return (void *) nn;

View File

@ -15,11 +15,11 @@
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.h"
#include "memory.h"
#include "math_special.h"
#include "error.h"
#include "force.h"
#include "math_special.h"
#include "memory.h"
#include "neigh_list.h"
#include <cmath>
#include <cstring>
@ -35,9 +35,7 @@ using namespace MathSpecial;
PairMorseSoft::~PairMorseSoft()
{
if (allocated) {
memory->destroy(lambda);
}
if (allocated) { memory->destroy(lambda); }
}
/* ---------------------------------------------------------------------- */
@ -131,7 +129,6 @@ void PairMorseSoft::compute(int eflag, int vflag)
fpair *= factor_lj;
f[i][0] += delx * fpair;
f[i][1] += dely * fpair;
f[i][2] += delz * fpair;
@ -142,12 +139,9 @@ void PairMorseSoft::compute(int eflag, int vflag)
f[j][2] -= delz * fpair;
}
if (eflag) {
evdwl = phi*factor_lj;
}
if (eflag) { evdwl = phi * factor_lj; }
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
if (evflag) ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz);
}
}
}
@ -225,15 +219,13 @@ void PairMorseSoft::settings(int narg, char **arg)
}
}
/* ----------------------------------------------------------------------
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairMorseSoft::init_one(int i, int j)
{
if (setflag[i][j] == 0)
error->all(FLERR,"All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR, "All pair coeffs are not set");
morse1[i][j] = 2.0 * d0[i][j] * alpha[i][j];
@ -263,7 +255,8 @@ double PairMorseSoft::init_one(int i, int j)
offset[i][j] = V0 + B * dexp3;
offset[i][j] *= llf;
}
} else offset[i][j] = 0.0;
} else
offset[i][j] = 0.0;
d0[j][i] = d0[i][j];
alpha[j][i] = alpha[i][j];
@ -366,7 +359,6 @@ void PairMorseSoft::read_restart_settings(FILE *fp)
MPI_Bcast(&mix_flag, 1, MPI_INT, 0, world);
}
/* ----------------------------------------------------------------------
proc 0 writes to data file
------------------------------------------------------------------------- */
@ -374,8 +366,7 @@ void PairMorseSoft::read_restart_settings(FILE *fp)
void PairMorseSoft::write_data(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
fprintf(fp,"%d %g %g %g %g\n",i,d0[i][i],alpha[i][i],r0[i][i],
lambda[i][i]);
fprintf(fp, "%d %g %g %g %g\n", i, d0[i][i], alpha[i][i], r0[i][i], lambda[i][i]);
}
/* ----------------------------------------------------------------------
@ -386,15 +377,14 @@ void PairMorseSoft::write_data_all(FILE *fp)
{
for (int i = 1; i <= atom->ntypes; i++)
for (int j = i; j <= atom->ntypes; j++)
fprintf(fp,"%d %d %g %g %g %g %g\n",i,j,d0[i][j],alpha[i][j],r0[i][j],
lambda[i][j],cut[i][j]);
fprintf(fp, "%d %d %g %g %g %g %g\n", i, j, d0[i][j], alpha[i][j], r0[i][j], lambda[i][j],
cut[i][j]);
}
/* ---------------------------------------------------------------------- */
double PairMorseSoft::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq,
double /*factor_coul*/, double factor_lj,
double &fforce)
double /*factor_coul*/, double factor_lj, double &fforce)
{
double r, dr, dexp, dexp2, dexp3, phi;
double B, D, a, ea, iea2;

View File

@ -592,4 +592,3 @@ double ComputeFabric::compute_scalar()
scalar = nc;
return nc;
}

View File

@ -67,8 +67,8 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp)
// this is so final order of Modify:fix will conform to input script
fix_history = nullptr;
fix_dummy = (FixDummy *) modify->add_fix("NEIGH_HISTORY_HH_DUMMY"
+ std::to_string(instance_me) + " all DUMMY");
fix_dummy = (FixDummy *) modify->add_fix("NEIGH_HISTORY_HH_DUMMY" + std::to_string(instance_me) +
" all DUMMY");
}
/* ---------------------------------------------------------------------- */
@ -79,8 +79,10 @@ PairGranHookeHistory::~PairGranHookeHistory()
delete[] svector;
if (!fix_history) modify->delete_fix("NEIGH_HISTORY_HH_DUMMY"+std::to_string(instance_me));
else modify->delete_fix("NEIGH_HISTORY_HH"+std::to_string(instance_me));
if (!fix_history)
modify->delete_fix("NEIGH_HISTORY_HH_DUMMY" + std::to_string(instance_me));
else
modify->delete_fix("NEIGH_HISTORY_HH" + std::to_string(instance_me));
if (allocated) {
memory->destroy(setflag);
@ -132,8 +134,10 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
}
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++)
if (body[i] >= 0) mass_rigid[i] = mass_body[body[i]];
else mass_rigid[i] = 0.0;
if (body[i] >= 0)
mass_rigid[i] = mass_body[body[i]];
else
mass_rigid[i] = 0.0;
comm->forward_comm_pair(this);
}
@ -261,8 +265,7 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
shear[1] += vtr2 * dt;
shear[2] += vtr3 * dt;
}
shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
shear[2]*shear[2]);
shrmag = sqrt(shear[0] * shear[0] + shear[1] * shear[1] + shear[2] * shear[2]);
// rotate shear displacements
@ -287,16 +290,17 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
if (fs > fn) {
if (shrmag != 0.0) {
shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
meff*gammat*vtr1/kt;
shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
meff*gammat*vtr2/kt;
shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
meff*gammat*vtr3/kt;
shear[0] =
(fn / fs) * (shear[0] + meff * gammat * vtr1 / kt) - meff * gammat * vtr1 / kt;
shear[1] =
(fn / fs) * (shear[1] + meff * gammat * vtr2 / kt) - meff * gammat * vtr2 / kt;
shear[2] =
(fn / fs) * (shear[2] + meff * gammat * vtr3 / kt) - meff * gammat * vtr3 / kt;
fs1 *= fn / fs;
fs2 *= fn / fs;
fs3 *= fn / fs;
} else fs1 = fs2 = fs3 = 0.0;
} else
fs1 = fs2 = fs3 = 0.0;
}
// forces & torques
@ -330,8 +334,7 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
torque[j][2] -= radj * tor3;
}
if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
0.0,0.0,fx,fy,fz,delx,dely,delz);
if (evflag) ev_tally_xyz(i, j, nlocal, newton_pair, 0.0, 0.0, fx, fy, fz, delx, dely, delz);
}
}
}
@ -350,8 +353,7 @@ void PairGranHookeHistory::allocate()
memory->create(setflag, n + 1, n + 1, "pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
for (int j = i; j <= n; j++) setflag[i][j] = 0;
memory->create(cutsq, n + 1, n + 1, "pair:cutsq");
@ -370,12 +372,16 @@ void PairGranHookeHistory::settings(int narg, char **arg)
if (narg != 6 && narg != 7) error->all(FLERR, "Illegal pair_style command");
kn = utils::numeric(FLERR, arg[0], false, lmp);
if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0;
else kt = utils::numeric(FLERR,arg[1],false,lmp);
if (strcmp(arg[1], "NULL") == 0)
kt = kn * 2.0 / 7.0;
else
kt = utils::numeric(FLERR, arg[1], false, lmp);
gamman = utils::numeric(FLERR, arg[2], false, lmp);
if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman;
else gammat = utils::numeric(FLERR,arg[3],false,lmp);
if (strcmp(arg[3], "NULL") == 0)
gammat = 0.5 * gamman;
else
gammat = utils::numeric(FLERR, arg[3], false, lmp);
xmu = utils::numeric(FLERR, arg[4], false, lmp);
dampflag = utils::inumeric(FLERR, arg[5], false, lmp);
@ -383,12 +389,14 @@ void PairGranHookeHistory::settings(int narg, char **arg)
limit_damping = 0;
if (narg == 7) {
if (strcmp(arg[6], "limit_damping") == 0) limit_damping = 1;
else error->all(FLERR,"Illegal pair_style command");
if (strcmp(arg[6], "limit_damping") == 0)
limit_damping = 1;
else
error->all(FLERR, "Illegal pair_style command");
}
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
xmu < 0.0 || xmu > 10000.0 || dampflag < 0 || dampflag > 1)
if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || xmu < 0.0 || xmu > 10000.0 ||
dampflag < 0 || dampflag > 1)
error->all(FLERR, "Illegal pair_style command");
}
@ -445,16 +453,18 @@ void PairGranHookeHistory::init_style()
if (history && (fix_history == nullptr)) {
auto cmd = fmt::format("NEIGH_HISTORY_HH{} all NEIGH_HISTORY {}", instance_me, size_history);
fix_history = (FixNeighHistory *) modify->replace_fix("NEIGH_HISTORY_HH_DUMMY"
+ std::to_string(instance_me),cmd,1);
fix_history = (FixNeighHistory *) modify->replace_fix(
"NEIGH_HISTORY_HH_DUMMY" + std::to_string(instance_me), cmd, 1);
fix_history->pair = this;
}
// check for FixFreeze and set freeze_group_bit
int ifreeze = modify->find_fix_by_style("^freeze");
if (ifreeze < 0) freeze_group_bit = 0;
else freeze_group_bit = modify->fix[ifreeze]->groupbit;
if (ifreeze < 0)
freeze_group_bit = 0;
else
freeze_group_bit = modify->fix[ifreeze]->groupbit;
// check for FixRigid so can extract rigid body masses
// FIXME: this only catches the first rigid fix, there may be multiple.
@ -477,13 +487,11 @@ void PairGranHookeHistory::init_style()
onerad_dynamic[i] = onerad_frozen[i] = 0.0;
if (ipour >= 0) {
itype = i;
onerad_dynamic[i] =
*((double *) modify->fix[ipour]->extract("radius",itype));
onerad_dynamic[i] = *((double *) modify->fix[ipour]->extract("radius", itype));
}
if (idep >= 0) {
itype = i;
onerad_dynamic[i] =
*((double *) modify->fix[idep]->extract("radius",itype));
onerad_dynamic[i] = *((double *) modify->fix[idep]->extract("radius", itype));
}
}
@ -537,8 +545,7 @@ void PairGranHookeHistory::write_restart(FILE *fp)
int i, j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++)
fwrite(&setflag[i][j],sizeof(int),1,fp);
for (j = i; j <= atom->ntypes; j++) fwrite(&setflag[i][j], sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -604,10 +611,8 @@ void PairGranHookeHistory::reset_dt()
/* ---------------------------------------------------------------------- */
double PairGranHookeHistory::single(int i, int j, int /*itype*/, int /*jtype*/,
double rsq,
double /*factor_coul*/, double /*factor_lj*/,
double &fforce)
double PairGranHookeHistory::single(int i, int j, int /*itype*/, int /*jtype*/, double rsq,
double /*factor_coul*/, double /*factor_lj*/, double &fforce)
{
double radi, radj, radsum;
double r, rinv, rsqinv, delx, dely, delz;
@ -713,8 +718,7 @@ double PairGranHookeHistory::single(int i, int j, int /*itype*/, int /*jtype*/,
}
double *shear = &allshear[3 * neighprev];
shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
shear[2]*shear[2]);
shrmag = sqrt(shear[0] * shear[0] + shear[1] * shear[1] + shear[2] * shear[2]);
// rotate shear displacements
@ -738,7 +742,8 @@ double PairGranHookeHistory::single(int i, int j, int /*itype*/, int /*jtype*/,
fs2 *= fn / fs;
fs3 *= fn / fs;
fs *= fn / fs;
} else fs1 = fs2 = fs3 = fs = 0.0;
} else
fs1 = fs2 = fs3 = fs = 0.0;
}
// set force and return no energy
@ -763,8 +768,8 @@ double PairGranHookeHistory::single(int i, int j, int /*itype*/, int /*jtype*/,
/* ---------------------------------------------------------------------- */
int PairGranHookeHistory::pack_forward_comm(int n, int *list, double *buf,
int /*pbc_flag*/, int * /*pbc*/)
int PairGranHookeHistory::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/,
int * /*pbc*/)
{
int i, j, m;
@ -784,8 +789,7 @@ void PairGranHookeHistory::unpack_forward_comm(int n, int first, double *buf)
m = 0;
last = first + n;
for (i = first; i < last; i++)
mass_rigid[i] = buf[m++];
for (i = first; i < last; i++) mass_rigid[i] = buf[m++];
}
/* ----------------------------------------------------------------------

View File

@ -45,20 +45,19 @@ class AngleCharmmIntel : public AngleCharmm {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t k, theta0, k_ub, r_ub; } fc_packed1;
typedef struct {
flt_t k, theta0, k_ub, r_ub;
} fc_packed1;
fc_packed1 *fc;
ForceConst() : _nangletypes(0) {}
@ -74,7 +73,7 @@ class AngleCharmmIntel : public AngleCharmm {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -45,20 +45,19 @@ class AngleHarmonicIntel : public AngleHarmonic {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t k, theta0; } fc_packed1;
typedef struct {
flt_t k, theta0;
} fc_packed1;
fc_packed1 *fc;
ForceConst() : _nangletypes(0) {}
@ -74,7 +73,7 @@ class AngleHarmonicIntel : public AngleHarmonic {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -45,20 +45,19 @@ class BondFENEIntel : public BondFENE {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t k, ir0sq, sigma, epsilon; } fc_packed1;
typedef struct {
flt_t k, ir0sq, sigma, epsilon;
} fc_packed1;
fc_packed1 *fc;
ForceConst() : _nbondtypes(0) {}
@ -74,7 +73,7 @@ class BondFENEIntel : public BondFENE {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -45,20 +45,19 @@ class BondHarmonicIntel : public BondHarmonic {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t k, r0; } fc_packed1;
typedef struct {
flt_t k, r0;
} fc_packed1;
fc_packed1 *fc;
ForceConst() : _nbondtypes(0) {}
@ -74,7 +73,7 @@ class BondHarmonicIntel : public BondHarmonic {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -45,22 +45,23 @@ class DihedralCharmmIntel : public DihedralCharmm {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t lj1, lj2, lj3, lj4; } fc_packed1;
typedef struct { flt_t cos_shift, sin_shift, k;
int multiplicity; } fc_packed3;
typedef struct {
flt_t lj1, lj2, lj3, lj4;
} fc_packed1;
typedef struct {
flt_t cos_shift, sin_shift, k;
int multiplicity;
} fc_packed3;
fc_packed1 **ljp;
fc_packed3 *bp;
@ -79,7 +80,7 @@ class DihedralCharmmIntel : public DihedralCharmm {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -45,29 +45,27 @@ class DihedralFourierIntel : public DihedralFourier {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t cos_shift, sin_shift, k;
int multiplicity; } fc_packed1;
typedef struct {
flt_t cos_shift, sin_shift, k;
int multiplicity;
} fc_packed1;
fc_packed1 **bp;
ForceConst() : _nbondtypes(0) {}
~ForceConst() { set_ntypes(0, nullptr, nullptr, nullptr); }
void set_ntypes(const int nbondtypes, int *setflag, int *nterms,
Memory *memory);
void set_ntypes(const int nbondtypes, int *setflag, int *nterms, Memory *memory);
private:
int _nbondtypes, _maxnterms;
@ -77,7 +75,7 @@ class DihedralFourierIntel : public DihedralFourier {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -45,21 +45,20 @@ class DihedralHarmonicIntel : public DihedralHarmonic {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t cos_shift, sin_shift, k;
int multiplicity; } fc_packed1;
typedef struct {
flt_t cos_shift, sin_shift, k;
int multiplicity;
} fc_packed1;
fc_packed1 *bp;
@ -76,7 +75,7 @@ class DihedralHarmonicIntel : public DihedralHarmonic {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -45,20 +45,19 @@ class DihedralOPLSIntel : public DihedralOPLS {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t k1, k2, k3, k4; } fc_packed1;
typedef struct {
flt_t k1, k2, k3, k4;
} fc_packed1;
fc_packed1 *bp;
@ -75,7 +74,7 @@ class DihedralOPLSIntel : public DihedralOPLS {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,11 +25,11 @@ FixStyle(INTEL,FixIntel);
#ifndef LMP_FIX_INTEL_H
#define LMP_FIX_INTEL_H
#include "fix.h"
#include "intel_buffers.h"
#include "force.h"
#include "pair.h"
#include "error.h"
#include "fix.h"
#include "force.h"
#include "intel_buffers.h"
#include "pair.h"
#include "update.h"
namespace LAMMPS_NS {
@ -53,8 +53,7 @@ class FixIntel : public Fix {
void kspace_init_check();
void pre_reverse(int eflag = 0, int vflag = 0);
inline void min_pre_reverse(int eflag = 0, int vflag = 0)
{ pre_reverse(eflag, vflag); }
inline void min_pre_reverse(int eflag = 0, int vflag = 0) { pre_reverse(eflag, vflag); }
void post_run() { _print_pkg_info = 1; }
@ -63,41 +62,51 @@ class FixIntel : public Fix {
double memory_usage();
typedef struct { double x,y,z; } lmp_ft;
typedef struct {
double x, y, z;
} lmp_ft;
enum { PREC_MODE_SINGLE, PREC_MODE_MIXED, PREC_MODE_DOUBLE };
inline int precision() { return _precision_mode; }
inline IntelBuffers<float,float> * get_single_buffers()
{ return _single_buffers; }
inline IntelBuffers<float,double> * get_mixed_buffers()
{ return _mixed_buffers; }
inline IntelBuffers<double,double> * get_double_buffers()
{ return _double_buffers; }
inline IntelBuffers<float, float> *get_single_buffers() { return _single_buffers; }
inline IntelBuffers<float, double> *get_mixed_buffers() { return _mixed_buffers; }
inline IntelBuffers<double, double> *get_double_buffers() { return _double_buffers; }
inline int nbor_pack_width() const { return _nbor_pack_width; }
inline void nbor_pack_width(const int w) { _nbor_pack_width = w; }
inline int three_body_neighbor() { return _three_body_neighbor; }
inline void three_body_neighbor(const int i) { _three_body_neighbor = i; }
inline int need_zero(const int tid) {
if (_need_reduce == 0 && tid > 0) return 1;
else if (_zero_master && tid == 0) { _zero_master = 0; return 1; }
else return 0;
inline int need_zero(const int tid)
{
if (_need_reduce == 0 && tid > 0)
return 1;
else if (_zero_master && tid == 0) {
_zero_master = 0;
return 1;
} else
return 0;
}
inline void set_reduce_flag() { if (_nthreads > 1) _need_reduce = 1; }
inline int lrt() {
inline void set_reduce_flag()
{
if (_nthreads > 1) _need_reduce = 1;
}
inline int lrt()
{
if (force->kspace_match("^pppm/.*intel$", 0) && update->whichflag == 1)
return _lrt;
else return 0;
else
return 0;
}
inline int pppm_table() {
inline int pppm_table()
{
if (force->kspace_match("^pppm/.*intel$", 0))
return INTEL_P3M_TABLE;
else return 0;
else
return 0;
}
protected:
IntelBuffers<float, float> *_single_buffers;
IntelBuffers<float, double> *_mixed_buffers;
@ -111,20 +120,16 @@ class FixIntel : public Fix {
public:
inline int *get_overflow_flag() { return _overflow_flag; }
inline int *get_off_overflow_flag() { return _off_overflow_flag; }
inline void add_result_array(IntelBuffers<double,double>::vec3_acc_t *f_in,
double *ev_in, const int offload,
const int eatom = 0, const int vatom = 0,
inline void add_result_array(IntelBuffers<double, double>::vec3_acc_t *f_in, double *ev_in,
const int offload, const int eatom = 0, const int vatom = 0,
const int rflag = 0);
inline void add_result_array(IntelBuffers<float,double>::vec3_acc_t *f_in,
double *ev_in, const int offload,
const int eatom = 0, const int vatom = 0,
inline void add_result_array(IntelBuffers<float, double>::vec3_acc_t *f_in, double *ev_in,
const int offload, const int eatom = 0, const int vatom = 0,
const int rflag = 0);
inline void add_result_array(IntelBuffers<float,float>::vec3_acc_t *f_in,
float *ev_in, const int offload,
const int eatom = 0, const int vatom = 0,
inline void add_result_array(IntelBuffers<float, float>::vec3_acc_t *f_in, float *ev_in,
const int offload, const int eatom = 0, const int vatom = 0,
const int rflag = 0);
inline void get_buffern(const int offload, int &nlocal, int &nall,
int &minlocal);
inline void get_buffern(const int offload, int &nlocal, int &nall, int &minlocal);
#ifdef _LMP_INTEL_OFFLOAD
void post_force(int vflag);
@ -135,9 +140,19 @@ class FixIntel : public Fix {
inline int offload_end_neighbor();
inline int offload_end_pair();
inline int host_start_neighbor()
{ if (_offload_noghost) return 0; else return offload_end_neighbor(); }
{
if (_offload_noghost)
return 0;
else
return offload_end_neighbor();
}
inline int host_start_pair()
{ if (_offload_noghost) return 0; else return offload_end_pair(); }
{
if (_offload_noghost)
return 0;
else
return offload_end_pair();
}
inline int offload_nlocal() { return _offload_nlocal; }
inline int offload_nall() { return _offload_nall; }
inline int offload_min_ghost() { return _offload_min_ghost; }
@ -149,11 +164,12 @@ class FixIntel : public Fix {
inline int separate_buffers() { return _separate_buffers; }
inline int offload_noghost() { return _offload_noghost; }
inline void set_offload_noghost(const int v)
{ if (_offload_ghost < 0) _offload_noghost = v; }
{
if (_offload_ghost < 0) _offload_noghost = v;
}
inline void set_neighbor_host_sizes();
inline void zero_timers()
{ memset(_timers, 0, sizeof(double) * NUM_ITIMERS); }
inline void zero_timers() { memset(_timers, 0, sizeof(double) * NUM_ITIMERS); }
inline void start_watch(const int which) { _stopwatch[which] = MPI_Wtime(); }
inline double stop_watch(const int which);
inline double *off_watch_pair() { return _stopwatch_offload_pair; }
@ -219,20 +235,15 @@ class FixIntel : public Fix {
void _sync_main_arrays(const int prereverse);
template <class ft>
void reduce_results(ft * _noalias const f_in);
template <class ft> void reduce_results(ft *_noalias const f_in);
template <class ft, class acc_t>
inline void add_results(const ft * _noalias const f_in,
const acc_t * _noalias const ev_global,
const int eatom, const int vatom,
const int offload);
inline void add_results(const ft *_noalias const f_in, const acc_t *_noalias const ev_global,
const int eatom, const int vatom, const int offload);
template <class ft, class acc_t>
inline void add_oresults(const ft * _noalias const f_in,
const acc_t * _noalias const ev_global,
const int eatom, const int vatom,
const int out_offset, const int nall);
inline void add_oresults(const ft *_noalias const f_in, const acc_t *_noalias const ev_global,
const int eatom, const int vatom, const int out_offset, const int nall);
int _offload_affinity_balanced, _offload_threads, _offload_tpc;
#ifdef _LMP_INTEL_OFFLOAD
@ -240,15 +251,14 @@ class FixIntel : public Fix {
int _im_real_space_task;
MPI_Comm _real_space_comm;
template <class ft, class acc_t>
inline void add_off_results(const ft * _noalias const f_in,
const acc_t * _noalias const ev_global);
inline void add_off_results(const ft *_noalias const f_in, const acc_t *_noalias const ev_global);
#endif
};
/* ---------------------------------------------------------------------- */
void FixIntel::get_buffern(const int offload, int &nlocal, int &nall,
int &minlocal) {
void FixIntel::get_buffern(const int offload, int &nlocal, int &nall, int &minlocal)
{
#ifdef _LMP_INTEL_OFFLOAD
if (_separate_buffers) {
if (offload) {
@ -281,18 +291,17 @@ void FixIntel::get_buffern(const int offload, int &nlocal, int &nall,
/* ---------------------------------------------------------------------- */
void FixIntel::add_result_array(IntelBuffers<double,double>::vec3_acc_t *f_in,
double *ev_in, const int offload,
const int eatom, const int vatom,
const int rflag) {
void FixIntel::add_result_array(IntelBuffers<double, double>::vec3_acc_t *f_in, double *ev_in,
const int offload, const int eatom, const int vatom,
const int rflag)
{
#ifdef _LMP_INTEL_OFFLOAD
if (offload) {
_off_results_eatom = eatom;
_off_results_vatom = vatom;
_off_force_array_d = f_in;
_off_ev_array_d = ev_in;
if (_pair_hybrid_flag && force->pair->fdotr_is_set())
_sync_main_arrays(1);
if (_pair_hybrid_flag && force->pair->fdotr_is_set()) _sync_main_arrays(1);
return;
}
#endif
@ -308,24 +317,23 @@ void FixIntel::add_result_array(IntelBuffers<double,double>::vec3_acc_t *f_in,
if (_overflow_flag[LMP_OVERFLOW])
error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
if (_pair_hybrid_flag > 1 ||
(_pair_hybrid_flag && force->pair->fdotr_is_set())) _sync_main_arrays(0);
if (_pair_hybrid_flag > 1 || (_pair_hybrid_flag && force->pair->fdotr_is_set()))
_sync_main_arrays(0);
}
/* ---------------------------------------------------------------------- */
void FixIntel::add_result_array(IntelBuffers<float,double>::vec3_acc_t *f_in,
double *ev_in, const int offload,
const int eatom, const int vatom,
const int rflag) {
void FixIntel::add_result_array(IntelBuffers<float, double>::vec3_acc_t *f_in, double *ev_in,
const int offload, const int eatom, const int vatom,
const int rflag)
{
#ifdef _LMP_INTEL_OFFLOAD
if (offload) {
_off_results_eatom = eatom;
_off_results_vatom = vatom;
_off_force_array_m = f_in;
_off_ev_array_d = ev_in;
if (_pair_hybrid_flag && force->pair->fdotr_is_set())
_sync_main_arrays(1);
if (_pair_hybrid_flag && force->pair->fdotr_is_set()) _sync_main_arrays(1);
return;
}
#endif
@ -341,25 +349,23 @@ void FixIntel::add_result_array(IntelBuffers<float,double>::vec3_acc_t *f_in,
if (_overflow_flag[LMP_OVERFLOW])
error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
if (_pair_hybrid_flag > 1 ||
(_pair_hybrid_flag && force->pair->fdotr_is_set()))
if (_pair_hybrid_flag > 1 || (_pair_hybrid_flag && force->pair->fdotr_is_set()))
_sync_main_arrays(0);
}
/* ---------------------------------------------------------------------- */
void FixIntel::add_result_array(IntelBuffers<float,float>::vec3_acc_t *f_in,
float *ev_in, const int offload,
const int eatom, const int vatom,
const int rflag) {
void FixIntel::add_result_array(IntelBuffers<float, float>::vec3_acc_t *f_in, float *ev_in,
const int offload, const int eatom, const int vatom,
const int rflag)
{
#ifdef _LMP_INTEL_OFFLOAD
if (offload) {
_off_results_eatom = eatom;
_off_results_vatom = vatom;
_off_force_array_s = f_in;
_off_ev_array_s = ev_in;
if (_pair_hybrid_flag && force->pair->fdotr_is_set())
_sync_main_arrays(1);
if (_pair_hybrid_flag && force->pair->fdotr_is_set()) _sync_main_arrays(1);
return;
}
#endif
@ -375,8 +381,7 @@ void FixIntel::add_result_array(IntelBuffers<float,float>::vec3_acc_t *f_in,
if (_overflow_flag[LMP_OVERFLOW])
error->one(FLERR, "Neighbor list overflow, boost neigh_modify one");
if (_pair_hybrid_flag > 1 ||
(_pair_hybrid_flag && force->pair->fdotr_is_set()))
if (_pair_hybrid_flag > 1 || (_pair_hybrid_flag && force->pair->fdotr_is_set()))
_sync_main_arrays(0);
}
@ -386,10 +391,10 @@ void FixIntel::add_result_array(IntelBuffers<float,float>::vec3_acc_t *f_in,
/* ---------------------------------------------------------------------- */
int FixIntel::offload_end_neighbor() {
int FixIntel::offload_end_neighbor()
{
if (_offload_balance < 0.0) {
if (atom->nlocal < 2)
error->one(FLERR,"Too few atoms for load balancing offload");
if (atom->nlocal < 2) error->one(FLERR, "Too few atoms for load balancing offload");
double granularity = 1.0 / atom->nlocal;
if (_balance_neighbor < granularity)
_balance_neighbor = granularity + 1e-10;
@ -399,14 +404,18 @@ int FixIntel::offload_end_neighbor() {
return _balance_neighbor * atom->nlocal;
}
int FixIntel::offload_end_pair() {
if (neighbor->ago == 0) return _balance_neighbor * atom->nlocal;
else return _balance_pair * atom->nlocal;
int FixIntel::offload_end_pair()
{
if (neighbor->ago == 0)
return _balance_neighbor * atom->nlocal;
else
return _balance_pair * atom->nlocal;
}
/* ---------------------------------------------------------------------- */
double FixIntel::stop_watch(const int which) {
double FixIntel::stop_watch(const int which)
{
double elapsed = MPI_Wtime() - _stopwatch[which];
_timers[which] += elapsed;
return elapsed;
@ -414,7 +423,8 @@ double FixIntel::stop_watch(const int which) {
/* ---------------------------------------------------------------------- */
void FixIntel::balance_stamp() {
void FixIntel::balance_stamp()
{
if (_offload_balance < 0.0) {
double ct = MPI_Wtime();
_balance_other_time = ct;
@ -424,7 +434,8 @@ void FixIntel::balance_stamp() {
/* ---------------------------------------------------------------------- */
void FixIntel::acc_timers() {
void FixIntel::acc_timers()
{
_timers[TIME_OFFLOAD_PAIR] += *_stopwatch_offload_pair;
if (neighbor->ago == 0) {
_timers[TIME_OFFLOAD_NEIGHBOR] += *_stopwatch_offload_neighbor;
@ -437,7 +448,8 @@ void FixIntel::acc_timers() {
/* ---------------------------------------------------------------------- */
void FixIntel::set_neighbor_host_sizes() {
void FixIntel::set_neighbor_host_sizes()
{
_host_min_local = _overflow_flag[LMP_LOCAL_MIN];
_host_min_ghost = _overflow_flag[LMP_GHOST_MIN];
_host_used_local = atom->nlocal - _host_min_local;
@ -450,7 +462,7 @@ void FixIntel::set_neighbor_host_sizes() {
#endif
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -35,7 +35,7 @@ class FixNPTIntel : public FixNHIntel {
~FixNPTIntel() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -46,7 +46,7 @@ class FixNVEAsphereIntel : public FixNVE {
class AtomVecEllipsoid *avec;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -44,7 +44,7 @@ class FixNVEIntel : public FixNVE {
int _nlocal3, _nlocal_max;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -35,7 +35,7 @@ class FixNVTIntel : public FixNHIntel {
~FixNVTIntel() {}
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -41,7 +41,7 @@ class FixNVTSllodIntel : public FixNHIntel {
void nh_v_temp();
};
}
} // namespace LAMMPS_NS
#endif
#endif
@ -70,4 +70,3 @@ E: Using fix nvt/sllod with no fix deform defined
Self-explanatory.
*/

View File

@ -25,8 +25,8 @@ ImproperStyle(cvff/intel,ImproperCvffIntel);
#ifndef LMP_IMPROPER_CVFF_INTEL_H
#define LMP_IMPROPER_CVFF_INTEL_H
#include "improper_cvff.h"
#include "fix_intel.h"
#include "improper_cvff.h"
namespace LAMMPS_NS {
@ -45,20 +45,20 @@ class ImproperCvffIntel : public ImproperCvff {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t k; int sign, multiplicity; } fc_packed1;
typedef struct {
flt_t k;
int sign, multiplicity;
} fc_packed1;
fc_packed1 *fc;
@ -75,7 +75,7 @@ class ImproperCvffIntel : public ImproperCvff {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,8 +25,8 @@ ImproperStyle(harmonic/intel,ImproperHarmonicIntel);
#ifndef LMP_IMPROPER_HARMONIC_INTEL_H
#define LMP_IMPROPER_HARMONIC_INTEL_H
#include "improper_harmonic.h"
#include "fix_intel.h"
#include "improper_harmonic.h"
namespace LAMMPS_NS {
@ -45,20 +45,19 @@ class ImproperHarmonicIntel : public ImproperHarmonic {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EVFLAG, int EFLAG, int NEWTON_BOND, class flt_t, class acc_t>
void eval(const int vflag, IntelBuffers<flt_t,acc_t> * buffers,
const ForceConst<flt_t> &fc);
void eval(const int vflag, IntelBuffers<flt_t, acc_t> *buffers, const ForceConst<flt_t> &fc);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
#ifdef _LMP_INTEL_OFFLOAD
int _use_base;
#endif
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t k, chi; } fc_packed1;
typedef struct {
flt_t k, chi;
} fc_packed1;
fc_packed1 *fc;
@ -75,7 +74,7 @@ class ImproperHarmonicIntel : public ImproperHarmonic {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -23,9 +23,9 @@ NBinStyle(intel,
#ifndef LMP_NBIN_INTEL_H
#define LMP_NBIN_INTEL_H
#include "nbin_standard.h"
#include "fix_intel.h"
#include "memory.h"
#include "nbin_standard.h"
namespace LAMMPS_NS {
@ -43,15 +43,14 @@ class NBinIntel : public NBinStandard {
int _precision_mode;
double memory_usage();
template <class flt_t, class acc_t>
void bin_atoms(IntelBuffers<flt_t,acc_t> *);
template <class flt_t, class acc_t> void bin_atoms(IntelBuffers<flt_t, acc_t> *);
#ifdef _LMP_INTEL_OFFLOAD
int _cop, _offload_alloc;
#endif
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -37,16 +37,16 @@ class NPairFullBinGhostIntel : public NPairIntel {
NPairFullBinGhostIntel(class LAMMPS *);
~NPairFullBinGhostIntel() {}
void build(class NeighList *);
private:
template <class flt_t, class acc_t>
void fbi(NeighList *list, IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t, class acc_t, int need_ic>
void fbi(const int offload, NeighList * list,
IntelBuffers<flt_t,acc_t> * buffers,
void fbi(const int offload, NeighList *list, IntelBuffers<flt_t, acc_t> *buffers,
const int astart, const int aend);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -24,8 +24,8 @@ NPairStyle(full/bin/intel,
#ifndef LMP_NPAIR_FULL_BIN_INTEL_H
#define LMP_NPAIR_FULL_BIN_INTEL_H
#include "npair_intel.h"
#include "fix_intel.h"
#include "npair_intel.h"
namespace LAMMPS_NS {
@ -36,11 +36,10 @@ class NPairFullBinIntel : public NPairIntel {
void build(class NeighList *);
private:
template <class flt_t, class acc_t>
void fbi(NeighList *, IntelBuffers<flt_t,acc_t> *);
template <class flt_t, class acc_t> void fbi(NeighList *, IntelBuffers<flt_t, acc_t> *);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -23,8 +23,8 @@ NPairStyle(half/bin/newton/intel,
#ifndef LMP_NPAIR_HALF_BIN_NEWTON_INTEL_H
#define LMP_NPAIR_HALF_BIN_NEWTON_INTEL_H
#include "npair_intel.h"
#include "fix_intel.h"
#include "npair_intel.h"
namespace LAMMPS_NS {
@ -35,11 +35,10 @@ class NPairHalfBinNewtonIntel : public NPairIntel {
void build(class NeighList *);
private:
template <class flt_t, class acc_t>
void hbni(NeighList *, IntelBuffers<flt_t,acc_t> *);
template <class flt_t, class acc_t> void hbni(NeighList *, IntelBuffers<flt_t, acc_t> *);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -23,8 +23,8 @@ NPairStyle(half/bin/newton/tri/intel,
#ifndef LMP_NPAIR_HALF_BIN_NEWTON_INTEL_TRI_H
#define LMP_NPAIR_HALF_BIN_NEWTON_INTEL_TRI_H
#include "npair_intel.h"
#include "fix_intel.h"
#include "npair_intel.h"
namespace LAMMPS_NS {
@ -35,11 +35,10 @@ class NPairHalfBinNewtonTriIntel : public NPairIntel {
void build(class NeighList *);
private:
template <class flt_t, class acc_t>
void hbnti(NeighList *, IntelBuffers<flt_t,acc_t> *);
template <class flt_t, class acc_t> void hbnti(NeighList *, IntelBuffers<flt_t, acc_t> *);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -33,14 +33,13 @@ NPairStyle(halffull/newton/skip/intel,
#ifndef LMP_NPAIR_HALFFULL_NEWTON_INTEL_H
#define LMP_NPAIR_HALFFULL_NEWTON_INTEL_H
#include "npair.h"
#include "fix_intel.h"
#include "npair.h"
#if defined(_OPENMP)
#include <omp.h>
#endif
namespace LAMMPS_NS {
class NPairHalffullNewtonIntel : public NPair {
@ -52,14 +51,12 @@ class NPairHalffullNewtonIntel : public NPair {
protected:
FixIntel *_fix;
template<class flt_t, class acc_t>
void build_t(NeighList *, IntelBuffers<flt_t,acc_t> *);
template <class flt_t, class acc_t> void build_t(NeighList *, IntelBuffers<flt_t, acc_t> *);
template<class flt_t>
void build_t3(NeighList *, int *);
template <class flt_t> void build_t3(NeighList *, int *);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -31,14 +31,13 @@ NPairStyle(skip/ghost/intel,
#ifndef LMP_NPAIR_SKIP_INTEL_H
#define LMP_NPAIR_SKIP_INTEL_H
#include "npair.h"
#include "fix_intel.h"
#include "npair.h"
#if defined(_OPENMP)
#include <omp.h>
#endif
namespace LAMMPS_NS {
class NPairSkipIntel : public NPair {
@ -56,7 +55,7 @@ class NPairSkipIntel : public NPair {
void build_t(NeighList *, int *numhalf, int *cnumneigh, int *numhalf_skip);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,14 +25,13 @@ PairStyle(airebo/intel,PairAIREBOIntel);
#ifndef LMP_PAIR_AIREBO_INTEL_H
#define LMP_PAIR_AIREBO_INTEL_H
#include "pair.h"
#include "fix_intel.h"
#include "pair.h"
#include "pair_airebo.h"
namespace LAMMPS_NS {
template<class flt_t, class acc_t>
struct PairAIREBOIntelParam;
template <class flt_t, class acc_t> struct PairAIREBOIntelParam;
class PairAIREBOIntel : public PairAIREBO {
public:
@ -40,21 +39,18 @@ class PairAIREBOIntel : public PairAIREBO {
virtual ~PairAIREBOIntel();
virtual void compute(int, int);
virtual void init_style();
protected:
protected:
template <class flt_t, class acc_t>
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers);
template <int EVFLAG, int EFLAG, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(IntelBuffers<flt_t,acc_t> * buffers);
template <class flt_t, class acc_t> void pack_force_const(IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t, class acc_t>
PairAIREBOIntelParam<flt_t,acc_t> get_param();
template <class flt_t, class acc_t> PairAIREBOIntelParam<flt_t, acc_t> get_param();
FixIntel *fix;
int _cop;
@ -62,10 +58,9 @@ class PairAIREBOIntel : public PairAIREBO {
int *REBO_cnumneigh;
int *REBO_num_skin;
int *REBO_list_data;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -35,7 +35,7 @@ class PairAIREBOMorseIntel : public PairAIREBOIntel {
virtual void settings(int, char **);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -26,8 +26,8 @@ PairStyle(buck/coul/cut/intel,PairBuckCoulCutIntel);
#ifndef LMP_PAIR_BUCK_COUL_CUT_INTEL_H
#define LMP_PAIR_BUCK_COUL_CUT_INTEL_H
#include "pair_buck_coul_cut.h"
#include "fix_intel.h"
#include "pair_buck_coul_cut.h"
namespace LAMMPS_NS {
@ -38,7 +38,10 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut {
virtual ~PairBuckCoulCutIntel();
virtual void compute(int, int);
void init_style();
typedef struct { float x, y, z; int w; } sng4_t;
typedef struct {
float x, y, z;
int w;
} sng4_t;
private:
FixIntel *fix;
@ -51,20 +54,23 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut {
const ForceConst<flt_t> &fc);
template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t buck1, buck2, rhoinv, pad; } c_force_t;
typedef struct { flt_t cutsq, cut_ljsq, cut_coulsq, pad; } c_cut_t;
typedef struct { flt_t a, c, offset, pad; } c_energy_t;
typedef struct {
flt_t buck1, buck2, rhoinv, pad;
} c_force_t;
typedef struct {
flt_t cutsq, cut_ljsq, cut_coulsq, pad;
} c_cut_t;
typedef struct {
flt_t a, c, offset, pad;
} c_energy_t;
_alignvar(flt_t special_coul[4], 64);
_alignvar(flt_t special_lj[4], 64);
@ -75,8 +81,7 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut {
ForceConst() : _ntypes(0), _ntable(0) {}
~ForceConst() { set_ntypes(0, 0, nullptr, _cop); }
void set_ntypes(const int ntypes, const int ntable, Memory *memory,
const int cop);
void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop);
private:
int _ntypes, _ntable, _cop;
@ -86,7 +91,7 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif // LMP_PAIR_BUCK_COUL_CUT_INTEL_H
#endif

View File

@ -25,8 +25,8 @@ PairStyle(buck/coul/long/intel,PairBuckCoulLongIntel);
#ifndef LMP_PAIR_BUCK_COUL_LONG_INTEL_H
#define LMP_PAIR_BUCK_COUL_LONG_INTEL_H
#include "pair_buck_coul_long.h"
#include "fix_intel.h"
#include "pair_buck_coul_long.h"
namespace LAMMPS_NS {
@ -37,7 +37,10 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong {
virtual ~PairBuckCoulLongIntel();
virtual void compute(int, int);
void init_style();
typedef struct { float x, y, z; int w; } sng4_t;
typedef struct {
float x, y, z;
int w;
} sng4_t;
private:
FixIntel *fix;
@ -50,20 +53,23 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong {
const ForceConst<flt_t> &fc);
template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t cutsq, cut_ljsq, buck1, buck2; } c_force_t;
typedef struct { flt_t a, c, offset, pad; } c_energy_t;
typedef struct { flt_t r, dr, f, df; } table_t;
typedef struct {
flt_t cutsq, cut_ljsq, buck1, buck2;
} c_force_t;
typedef struct {
flt_t a, c, offset, pad;
} c_energy_t;
typedef struct {
flt_t r, dr, f, df;
} table_t;
_alignvar(flt_t special_coul[4], 64);
_alignvar(flt_t special_lj[4], 64);
flt_t g_ewald, tabinnersq;
@ -76,8 +82,7 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong {
ForceConst() : _ntypes(0), _ntable(0) {}
~ForceConst() { set_ntypes(0, 0, nullptr, _cop); }
void set_ntypes(const int ntypes, const int ntable, Memory *memory,
const int cop);
void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop);
private:
int _ntypes, _ntable, _cop;
@ -87,7 +92,7 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif // LMP_PAIR_BUCK_COUL_LONG_INTEL_H
#endif

View File

@ -25,8 +25,8 @@ PairStyle(buck/intel,PairBuckIntel);
#ifndef LMP_PAIR_BUCK_INTEL_H
#define LMP_PAIR_BUCK_INTEL_H
#include "pair_buck.h"
#include "fix_intel.h"
#include "pair_buck.h"
namespace LAMMPS_NS {
@ -37,7 +37,10 @@ public:
virtual ~PairBuckIntel();
virtual void compute(int, int);
void init_style();
typedef struct { float x, y, z; int w; } sng4_t;
typedef struct {
float x, y, z;
int w;
} sng4_t;
private:
FixIntel *fix;
@ -50,20 +53,21 @@ private:
const ForceConst<flt_t> &fc);
template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t buck1, buck2, rhoinv, cutsq; } c_force_t;
typedef struct { flt_t a, c, offset, pad; } c_energy_t;
typedef struct {
flt_t buck1, buck2, rhoinv, cutsq;
} c_force_t;
typedef struct {
flt_t a, c, offset, pad;
} c_energy_t;
_alignvar(flt_t special_lj[4], 64);
c_force_t **c_force;
@ -72,8 +76,7 @@ private:
ForceConst() : _ntypes(0) {}
~ForceConst() { set_ntypes(0, nullptr, _cop); }
void set_ntypes(const int ntypes, Memory *memory,
const int cop);
void set_ntypes(const int ntypes, Memory *memory, const int cop);
private:
int _ntypes, _cop;
@ -84,7 +87,7 @@ private:
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif // LMP_PAIR_BUCK_INTEL_H
#endif

View File

@ -26,8 +26,8 @@ PairStyle(dpd/intel,PairDPDIntel);
#ifndef LMP_PAIR_DPD_INTEL_H
#define LMP_PAIR_DPD_INTEL_H
#include "pair_dpd.h"
#include "fix_intel.h"
#include "pair_dpd.h"
#ifdef LMP_USE_MKL_RNG
#include "mkl_vsl.h"
@ -63,20 +63,19 @@ class PairDPDIntel : public PairDPD {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int ONETYPE, int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
// ----------------------------------------------------------------------
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t icut, a0, gamma, sigma; } fc_packed1;
typedef struct {
flt_t icut, a0, gamma, sigma;
} fc_packed1;
_alignvar(flt_t special_lj[4], 64);
fc_packed1 **param;
@ -86,8 +85,8 @@ class PairDPDIntel : public PairDPD {
ForceConst() : _ntypes(0) {}
~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); }
void set_ntypes(const int ntypes, const int nthreads, const int max_nbors,
Memory *memory, const int cop);
void set_ntypes(const int ntypes, const int nthreads, const int max_nbors, Memory *memory,
const int cop);
private:
int _ntypes, _cop;
@ -97,7 +96,7 @@ class PairDPDIntel : public PairDPD {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -38,7 +38,7 @@ class PairEAMAlloyIntel : virtual public PairEAMIntel {
void file2array();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -38,7 +38,7 @@ class PairEAMFSIntel : virtual public PairEAMIntel {
void file2array();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -21,12 +21,11 @@ PairStyle(eam/intel,PairEAMIntel);
#ifndef LMP_PAIR_EAM_INTEL_H
#define LMP_PAIR_EAM_INTEL_H
#include "pair_eam.h"
#include "fix_intel.h"
#include "pair_eam.h"
namespace LAMMPS_NS {
class PairEAMIntel : public PairEAM {
public:
friend class FixSemiGrandCanonicalMC; // Alex Stukowski option
@ -39,37 +38,34 @@ class PairEAMIntel : public PairEAM {
void unpack_forward_comm(int, int, double *);
protected:
FixIntel *fix;
int _cop, _onetype, _ccache_stride;
float *fp_float;
template <class flt_t>
int pack_forward_comm(int, int *, double *, flt_t *);
template <class flt_t>
void unpack_forward_comm(int, int, double *, flt_t *);
template <class flt_t> int pack_forward_comm(int, int *, double *, flt_t *);
template <class flt_t> void unpack_forward_comm(int, int, double *, flt_t *);
template <class flt_t> class ForceConst;
template <class flt_t, class acc_t>
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int ONETYPE, int EFLAG, int NEWTON_PAIR, class flt_t,
class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
template <int ONETYPE, int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
// ----------------------------------------------------------------------
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t a, b, c, d; } fc_packed1;
typedef struct { flt_t a, b, c, d, e, f, g, h; } fc_packed2;
typedef struct {
flt_t a, b, c, d;
} fc_packed1;
typedef struct {
flt_t a, b, c, d, e, f, g, h;
} fc_packed2;
flt_t **scale_f;
fc_packed1 *rhor_spline_f, *rhor_spline_e;
@ -79,8 +75,7 @@ class PairEAMIntel : public PairEAM {
ForceConst() : _ntypes(0), _nr(0) {}
~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); }
void set_ntypes(const int ntypes, const int nr, const int nrho,
Memory *memory, const int cop);
void set_ntypes(const int ntypes, const int nr, const int nrho, Memory *memory, const int cop);
inline int rhor_jstride() const { return _nr; }
inline int rhor_istride() const { return _nr * _ntypes; }
inline int frho_stride() const { return _nrho; }
@ -93,7 +88,7 @@ class PairEAMIntel : public PairEAM {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,8 +25,8 @@ PairStyle(gayberne/intel,PairGayBerneIntel);
#ifndef LMP_PAIR_GAYBERNE_INTEL_H
#define LMP_PAIR_GAYBERNE_INTEL_H
#include "pair_gayberne.h"
#include "fix_intel.h"
#include "pair_gayberne.h"
namespace LAMMPS_NS {
@ -45,23 +45,24 @@ class PairGayBerneIntel : public PairGayBerne {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct {
flt_t cutsq, lj1, lj2, offset, sigma, epsilon, lshape;
int form;
} fc_packed1;
typedef struct { flt_t lj3, lj4; } fc_packed2;
typedef struct { flt_t shape2[4], well[4]; } fc_packed3;
typedef struct {
flt_t lj3, lj4;
} fc_packed2;
typedef struct {
flt_t shape2[4], well[4];
} fc_packed3;
_alignvar(flt_t special_lj[4], 64);
_alignvar(flt_t gamma, 64);
@ -77,8 +78,8 @@ class PairGayBerneIntel : public PairGayBerne {
ForceConst() : _ntypes(0) {}
~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); }
void set_ntypes(const int ntypes, const int one_length,
const int nthreads, Memory *memory, const int cop);
void set_ntypes(const int ntypes, const int one_length, const int nthreads, Memory *memory,
const int cop);
private:
int _ntypes, _cop;
@ -89,15 +90,14 @@ class PairGayBerneIntel : public PairGayBerne {
ForceConst<double> force_const_double;
int _max_nbors;
double gayberne_lj(const int i, const int j, double a1[3][3],
double b1[3][3], double g1[3][3], double *r12,
const double rsq, double *fforce, double *ttor);
double gayberne_lj(const int i, const int j, double a1[3][3], double b1[3][3], double g1[3][3],
double *r12, const double rsq, double *fforce, double *ttor);
FixIntel *fix;
int _cop;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,8 +25,8 @@ PairStyle(lj/charmm/coul/charmm/intel,PairLJCharmmCoulCharmmIntel);
#ifndef LMP_PAIR_LJ_CHARMM_COUL_CHARMM_INTEL_H
#define LMP_PAIR_LJ_CHARMM_COUL_CHARMM_INTEL_H
#include "pair_lj_charmm_coul_charmm.h"
#include "fix_intel.h"
#include "pair_lj_charmm_coul_charmm.h"
namespace LAMMPS_NS {
@ -39,7 +39,10 @@ class PairLJCharmmCoulCharmmIntel : public PairLJCharmmCoulCharmm {
virtual void compute(int, int);
void init_style();
typedef struct { float x,y,z; int w; } sng4_t;
typedef struct {
float x, y, z;
int w;
} sng4_t;
private:
FixIntel *fix;
@ -50,17 +53,14 @@ class PairLJCharmmCoulCharmmIntel : public PairLJCharmmCoulCharmm {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
// ----------------------------------------------------------------------
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
_alignvar(flt_t special_coul[4], 64);
_alignvar(flt_t special_lj[4], 64);
@ -82,7 +82,7 @@ class PairLJCharmmCoulCharmmIntel : public PairLJCharmmCoulCharmm {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,8 +25,8 @@ PairStyle(lj/charmm/coul/long/intel,PairLJCharmmCoulLongIntel);
#ifndef LMP_PAIR_LJ_CHARMM_COUL_LONG_INTEL_H
#define LMP_PAIR_LJ_CHARMM_COUL_LONG_INTEL_H
#include "pair_lj_charmm_coul_long.h"
#include "fix_intel.h"
#include "pair_lj_charmm_coul_long.h"
namespace LAMMPS_NS {
@ -39,7 +39,10 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong {
virtual void compute(int, int);
void init_style();
typedef struct { float x,y,z; int w; } sng4_t;
typedef struct {
float x, y, z;
int w;
} sng4_t;
private:
FixIntel *fix;
@ -50,19 +53,18 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
// ----------------------------------------------------------------------
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t r, dr, f, df; } table_t;
typedef struct {
flt_t r, dr, f, df;
} table_t;
_alignvar(flt_t special_coul[4], 64);
_alignvar(flt_t special_lj[4], 64);
flt_t **cutsq, g_ewald, tabinnersq;
@ -75,8 +77,7 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong {
ForceConst() : _ntypes(0), _ntable(0) {}
~ForceConst() { set_ntypes(0, 0, nullptr, _cop); }
void set_ntypes(const int ntypes, const int ntable, Memory *memory,
const int cop);
void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop);
private:
int _ntypes, _ntable, _cop;
@ -86,7 +87,7 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,8 +25,8 @@ PairStyle(lj/cut/coul/long/intel,PairLJCutCoulLongIntel);
#ifndef LMP_PAIR_LJ_CUT_COUL_LONG_INTEL_H
#define LMP_PAIR_LJ_CUT_COUL_LONG_INTEL_H
#include "pair_lj_cut_coul_long.h"
#include "fix_intel.h"
#include "pair_lj_cut_coul_long.h"
namespace LAMMPS_NS {
@ -39,7 +39,10 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong {
virtual void compute(int, int);
void init_style();
typedef struct { float x,y,z; int w; } sng4_t;
typedef struct {
float x, y, z;
int w;
} sng4_t;
private:
FixIntel *fix;
@ -50,21 +53,24 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
// ----------------------------------------------------------------------
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t cutsq, cut_ljsq, lj1, lj2; } c_force_t;
typedef struct { flt_t lj3, lj4, offset, pad; } c_energy_t;
typedef struct { flt_t r, dr, f, df; } table_t;
typedef struct {
flt_t cutsq, cut_ljsq, lj1, lj2;
} c_force_t;
typedef struct {
flt_t lj3, lj4, offset, pad;
} c_energy_t;
typedef struct {
flt_t r, dr, f, df;
} table_t;
_alignvar(flt_t special_coul[4], 64);
_alignvar(flt_t special_lj[4], 64);
flt_t g_ewald, tabinnersq;
@ -76,8 +82,7 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong {
ForceConst() : _ntypes(0), _ntable(0) {}
~ForceConst() { set_ntypes(0, 0, nullptr, _cop); }
void set_ntypes(const int ntypes, const int ntable, Memory *memory,
const int cop);
void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop);
private:
int _ntypes, _ntable, _cop;
@ -87,7 +92,7 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,8 +25,8 @@ PairStyle(lj/cut/intel,PairLJCutIntel);
#ifndef LMP_PAIR_LJ_CUT_INTEL_H
#define LMP_PAIR_LJ_CUT_INTEL_H
#include "pair_lj_cut.h"
#include "fix_intel.h"
#include "pair_lj_cut.h"
namespace LAMMPS_NS {
@ -47,21 +47,22 @@ class PairLJCutIntel : public PairLJCut {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int ONETYPE, int EFLAG, int NEWTON_PAIR, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
// ----------------------------------------------------------------------
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t cutsq, lj1, lj2, offset; } fc_packed1;
typedef struct { flt_t lj3, lj4; } fc_packed2;
typedef struct {
flt_t cutsq, lj1, lj2, offset;
} fc_packed1;
typedef struct {
flt_t lj3, lj4;
} fc_packed2;
_alignvar(flt_t special_lj[4], 64);
fc_packed1 **ljc12o;
@ -80,7 +81,7 @@ class PairLJCutIntel : public PairLJCut {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,16 +25,15 @@ PairStyle(lj/long/coul/long/intel,PairLJLongCoulLongIntel);
#ifndef LMP_PAIR_LJ_LONG_COUL_LONG_INTEL_H
#define LMP_PAIR_LJ_LONG_COUL_LONG_INTEL_H
#include "pair_lj_long_coul_long.h"
#include "fix_intel.h"
#include "pair_lj_long_coul_long.h"
namespace LAMMPS_NS {
class PairLJLongCoulLongIntel : public PairLJLongCoulLong {
public:
PairLJLongCoulLongIntel(class LAMMPS *);
virtual ~PairLJLongCoulLongIntel();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -35,7 +35,7 @@ class PairREBOIntel : public PairAIREBOIntel {
virtual void settings(int, char **);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -25,8 +25,8 @@ PairStyle(sw/intel,PairSWIntel);
#ifndef LMP_PAIR_SW_INTEL_H
#define LMP_PAIR_SW_INTEL_H
#include "pair_sw.h"
#include "fix_intel.h"
#include "pair_sw.h"
namespace LAMMPS_NS {
@ -48,13 +48,11 @@ class PairSWIntel : public PairSW {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int SPQ, int ONETYPE, int EFLAG, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers, const ForceConst<flt_t> &fc,
const int astart, const int aend);
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
int _ccache_stride, _spq, _onetype, _onetype3;
#ifdef LMP_USE_AVXCD
@ -63,8 +61,7 @@ class PairSWIntel : public PairSW {
// ----------------------------------------------------------------------
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct {
flt_t cutsq, cut, sigma_gamma, pad;
@ -101,7 +98,7 @@ class PairSWIntel : public PairSW {
ForceConst<double> force_const_double;
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -24,8 +24,8 @@ PairStyle(tersoff/intel,PairTersoffIntel);
#ifndef LMP_PAIR_TERSOFF_INTEL_H
#define LMP_PAIR_TERSOFF_INTEL_H
#include "pair.h"
#include "fix_intel.h"
#include "pair.h"
#include "pair_tersoff.h"
#ifdef __INTEL_COMPILER
@ -39,7 +39,10 @@ class PairTersoffIntel : public PairTersoff {
void init_style();
protected:
typedef struct { float x,y,z; int w; } sng4_t;
typedef struct {
float x, y, z;
int w;
} sng4_t;
private:
FixIntel *fix;
@ -48,20 +51,31 @@ class PairTersoffIntel : public PairTersoff {
public: // wo needs secrets?
// ----------------------------------------------------------------------
//
template <class flt_t>
class ForceConst {
template <class flt_t> class ForceConst {
public:
typedef struct { flt_t cutsq; } c_cutoff_t;
typedef struct { flt_t bigr, bigd, lam1, biga; } c_first_loop_t;
typedef struct { flt_t lam2, beta, bigb, powern, c1, c2, c3, c4; } c_second_loop_t;
typedef struct { flt_t lam3, bigr, bigd, c2, d2, h, gamma, powermint; } c_inner_loop_t;
typedef struct { flt_t cutsq, pad[3];
typedef struct {
flt_t cutsq;
} c_cutoff_t;
typedef struct {
flt_t bigr, bigd, lam1, biga;
} c_first_loop_t;
typedef struct {
flt_t lam2, beta, bigb, powern, c1, c2, c3, c4;
} c_second_loop_t;
typedef struct {
flt_t lam3, bigr, bigd, c2, d2, h, gamma, powermint;
} c_inner_loop_t;
typedef struct {
flt_t cutsq, pad[3];
flt_t bigr, bigd, lam1, biga;
flt_t lam2, beta, bigb, powern;
flt_t c1, c2, c3, c4; } c_outer_t;
typedef struct { flt_t cutsq, pad[7];
flt_t c1, c2, c3, c4;
} c_outer_t;
typedef struct {
flt_t cutsq, pad[7];
flt_t lam3, powermint, bigr, bigd;
flt_t c2, d2, h, gamma; } c_inner_t;
flt_t c2, d2, h, gamma;
} c_inner_t;
c_cutoff_t **c_cutoff_outer;
c_cutoff_t ***c_cutoff_inner;
c_first_loop_t **c_first_loop;
@ -85,16 +99,14 @@ class PairTersoffIntel : public PairTersoff {
void compute(int eflag, int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc);
template <int EFLAG, class flt_t, class acc_t>
void eval(const int offload, const int vflag,
IntelBuffers<flt_t,acc_t> * buffers,
void eval(const int offload, const int vflag, IntelBuffers<flt_t, acc_t> *buffers,
const ForceConst<flt_t> &fc, const int astart, const int aend);
template <class flt_t, class acc_t>
void pack_force_const(ForceConst<flt_t> &fc,
IntelBuffers<flt_t, acc_t> *buffers);
void pack_force_const(ForceConst<flt_t> &fc, IntelBuffers<flt_t, acc_t> *buffers);
};
}
} // namespace LAMMPS_NS
#endif // __INTEL_COMPILER
#endif

View File

@ -25,8 +25,8 @@ KSpaceStyle(pppm/disp/intel,PPPMDispIntel);
#ifndef LMP_PPPMINTEL_DISP_H
#define LMP_PPPMINTEL_DISP_H
#include "pppm_disp.h"
#include "fix_intel.h"
#include "pppm_disp.h"
namespace LAMMPS_NS {
@ -86,16 +86,13 @@ namespace LAMMPS_NS {
#endif
template <class flt_t, class acc_t>
void particle_map(double, double, double,
double, int **, int, int,
int, int, int,
int, int, int,
void particle_map(double, double, double, double, int **, int, int, int, int, int, int, int, int,
IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t, class acc_t, int use_table>
void make_rho_c(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void make_rho_c(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void make_rho_c(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
make_rho_c<flt_t, acc_t, 1>(buffers);
} else {
@ -105,8 +102,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void make_rho_g(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void make_rho_g(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void make_rho_g(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
make_rho_g<flt_t, acc_t, 1>(buffers);
} else {
@ -116,8 +113,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void make_rho_a(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void make_rho_a(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void make_rho_a(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
make_rho_a<flt_t, acc_t, 1>(buffers);
} else {
@ -125,11 +122,10 @@ namespace LAMMPS_NS {
}
}
template <class flt_t, class acc_t, int use_table>
void make_rho_none(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void make_rho_none(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void make_rho_none(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
make_rho_none<flt_t, acc_t, 1>(buffers);
} else {
@ -137,11 +133,10 @@ namespace LAMMPS_NS {
}
}
template <class flt_t, class acc_t, int use_table>
void fieldforce_c_ik(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_c_ik(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_c_ik(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_c_ik<flt_t, acc_t, 1>(buffers);
} else {
@ -151,8 +146,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void fieldforce_c_ad(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_c_ad(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_c_ad(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_c_ad<flt_t, acc_t, 1>(buffers);
} else {
@ -162,8 +157,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void fieldforce_g_ik(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_g_ik(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_g_ik(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_g_ik<flt_t, acc_t, 1>(buffers);
} else {
@ -173,8 +168,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void fieldforce_g_ad(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_g_ad(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_g_ad(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_g_ad<flt_t, acc_t, 1>(buffers);
} else {
@ -184,8 +179,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void fieldforce_a_ik(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_a_ik(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_a_ik(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_a_ik<flt_t, acc_t, 1>(buffers);
} else {
@ -195,8 +190,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void fieldforce_a_ad(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_a_ad(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_a_ad(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_a_ad<flt_t, acc_t, 1>(buffers);
} else {
@ -205,8 +200,8 @@ namespace LAMMPS_NS {
}
template <class flt_t, class acc_t, int use_table>
void fieldforce_none_ik(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_none_ik(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_none_ik(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_none_ik<flt_t, acc_t, 1>(buffers);
} else {
@ -216,8 +211,8 @@ namespace LAMMPS_NS {
template <class flt_t, class acc_t, int use_table>
void fieldforce_none_ad(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_none_ad(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_none_ad(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_none_ad<flt_t, acc_t, 1>(buffers);
} else {
@ -226,11 +221,8 @@ namespace LAMMPS_NS {
}
void precompute_rho();
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -28,8 +28,8 @@ KSpaceStyle(pppm/intel,PPPMIntel);
#ifndef LMP_PPPMINTEL_H
#define LMP_PPPMINTEL_H
#include "pppm.h"
#include "fix_intel.h"
#include "pppm.h"
namespace LAMMPS_NS {
@ -69,16 +69,14 @@ class PPPMIntel : public PPPM {
virtual void allocate();
template<class flt_t, class acc_t>
void test_function(IntelBuffers<flt_t,acc_t> *buffers);
template <class flt_t, class acc_t> void test_function(IntelBuffers<flt_t, acc_t> *buffers);
void precompute_rho();
template<class flt_t, class acc_t>
void particle_map(IntelBuffers<flt_t,acc_t> *buffers);
template <class flt_t, class acc_t> void particle_map(IntelBuffers<flt_t, acc_t> *buffers);
template <class flt_t, class acc_t, int use_table>
void make_rho(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void make_rho(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void make_rho(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
make_rho<flt_t, acc_t, 1>(buffers);
} else {
@ -87,8 +85,8 @@ class PPPMIntel : public PPPM {
}
template <class flt_t, class acc_t, int use_table>
void fieldforce_ik(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_ik(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_ik(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_ik<flt_t, acc_t, 1>(buffers);
} else {
@ -97,19 +95,18 @@ class PPPMIntel : public PPPM {
}
template <class flt_t, class acc_t, int use_table>
void fieldforce_ad(IntelBuffers<flt_t, acc_t> *buffers);
template<class flt_t, class acc_t>
void fieldforce_ad(IntelBuffers<flt_t,acc_t> *buffers) {
template <class flt_t, class acc_t> void fieldforce_ad(IntelBuffers<flt_t, acc_t> *buffers)
{
if (_use_table == 1) {
fieldforce_ad<flt_t, acc_t, 1>(buffers);
} else {
fieldforce_ad<flt_t, acc_t, 0>(buffers);
}
}
FFT_SCALAR ***create3d_offset(FFT_SCALAR ***&, int, int, int,
int, int, int, const char *name);
FFT_SCALAR ***create3d_offset(FFT_SCALAR ***&, int, int, int, int, int, int, const char *name);
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -21,8 +21,8 @@ IntegrateStyle(verlet/lrt/intel,VerletLRTIntel);
#ifndef LMP_VERLET_LRT_INTEL_H
#define LMP_VERLET_LRT_INTEL_H
#include "verlet.h"
#include "pppm_intel.h"
#include "verlet.h"
#ifdef LMP_INTEL_USELRT
#if defined(LMP_INTEL_LRT11) || defined(__APPLE__)
@ -64,7 +64,7 @@ class VerletLRTIntel : public Verlet {
#endif
};
}
} // namespace LAMMPS_NS
#endif
#endif

View File

@ -339,7 +339,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename)
nparams++;
if (nparams >= pow(atom->ntypes, 3)) break;
}
}
MPI_Bcast(&nparams, 1, MPI_INT, 0, world);
MPI_Bcast(&maxparam, 1, MPI_INT, 0, world);
@ -348,7 +348,6 @@ void PairKolmogorovCrespiZ::read_file(char *filename)
}
MPI_Bcast(params, maxparam * sizeof(Param), MPI_BYTE, 0, world);
}
memory->destroy(elem2param);
memory->create(elem2param, nelements, nelements, "pair:elem2param");

View File

@ -336,6 +336,7 @@ void PairLebedevaZ::read_file(char *filename)
nparams++;
if (nparams >= pow(atom->ntypes,3)) break;
}
}
MPI_Bcast(&nparams, 1, MPI_INT, 0, world);
MPI_Bcast(&maxparam, 1, MPI_INT, 0, world);
@ -345,7 +346,6 @@ void PairLebedevaZ::read_file(char *filename)
}
MPI_Bcast(params, maxparam*sizeof(Param), MPI_BYTE, 0, world);
}
memory->destroy(elem2param);
memory->create(elem2param,nelements,nelements,"pair:elem2param");

View File

@ -43,7 +43,7 @@ elif (test $mode = 0) then
fi
fi
# list of files with optional dependcies
# list of files with optional dependencies
action angle_charmm_kokkos.cpp angle_charmm.cpp
action angle_charmm_kokkos.h angle_charmm.h
@ -94,6 +94,8 @@ action compute_orientorder_atom_kokkos.cpp
action compute_orientorder_atom_kokkos.h
action compute_temp_kokkos.cpp
action compute_temp_kokkos.h
action compute_temp_deform_kokkos.cpp
action compute_temp_deform_kokkos.h
action dihedral_charmm_kokkos.cpp dihedral_charmm.cpp
action dihedral_charmm_kokkos.h dihedral_charmm.h
action dihedral_class2_kokkos.cpp dihedral_class2.cpp
@ -135,6 +137,8 @@ action fix_nve_sphere_kokkos.cpp
action fix_nve_sphere_kokkos.h
action fix_nvt_kokkos.cpp
action fix_nvt_kokkos.h
action fix_nvt_sllod_kokkos.cpp
action fix_nvt_sllod_kokkos.h
action fix_property_atom_kokkos.cpp
action fix_property_atom_kokkos.h
action fix_qeq_reaxff_kokkos.cpp fix_qeq_reaxff.cpp

View File

@ -1,4 +1,3 @@
// clang-format off
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -20,6 +19,7 @@ AngleStyle(charmm/kk/host,AngleCharmmKokkos<LMPHostType>);
// clang-format on
#else
// clang-format off
#ifndef LMP_ANGLE_CHARMM_KOKKOS_H
#define LMP_ANGLE_CHARMM_KOKKOS_H

View File

@ -1,4 +1,3 @@
// clang-format off
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -20,6 +19,7 @@ AngleStyle(class2/kk/host,AngleClass2Kokkos<LMPHostType>);
// clang-format on
#else
// clang-format off
#ifndef LMP_ANGLE_CLASS2_KOKKOS_H
#define LMP_ANGLE_CLASS2_KOKKOS_H

View File

@ -1,4 +1,3 @@
// clang-format off
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -20,6 +19,7 @@ AngleStyle(cosine/kk/host,AngleCosineKokkos<LMPHostType>);
// clang-format on
#else
// clang-format off
#ifndef LMP_ANGLE_COSINE_KOKKOS_H
#define LMP_ANGLE_COSINE_KOKKOS_H

View File

@ -1,4 +1,3 @@
// clang-format off
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -20,6 +19,7 @@ AngleStyle(harmonic/kk/host,AngleHarmonicKokkos<LMPHostType>);
// clang-format on
#else
// clang-format off
#ifndef LMP_ANGLE_HARMONIC_KOKKOS_H
#define LMP_ANGLE_HARMONIC_KOKKOS_H

View File

@ -264,40 +264,27 @@ int AtomKokkos::add_custom(const char *name, int flag, int cols)
if (flag == 0 && cols == 0) {
index = nivector;
nivector++;
ivname = (char **) memory->srealloc(ivname,nivector*sizeof(char *),
"atom:ivname");
int n = strlen(name) + 1;
ivname[index] = new char[n];
strcpy(ivname[index],name);
ivector = (int **) memory->srealloc(ivector,nivector*sizeof(int *),
"atom:ivector");
ivname = (char **) memory->srealloc(ivname, nivector * sizeof(char *), "atom:ivname");
ivname[index] = utils::strdup(name);
ivector = (int **) memory->srealloc(ivector, nivector * sizeof(int *), "atom:ivector");
memory->create(ivector[index], nmax, "atom:ivector");
} else if (flag == 1 && cols == 0) {
index = ndvector;
ndvector++;
dvname = (char **) memory->srealloc(dvname,ndvector*sizeof(char *),
"atom:dvname");
int n = strlen(name) + 1;
dvname[index] = new char[n];
strcpy(dvname[index],name);
dvector = (double **) memory->srealloc(dvector,ndvector*sizeof(double *),
"atom:dvector");
dvname = (char **) memory->srealloc(dvname, ndvector * sizeof(char *), "atom:dvname");
dvname[index] = utils::strdup(name);
dvector = (double **) memory->srealloc(dvector, ndvector * sizeof(double *), "atom:dvector");
this->sync(Device, DVECTOR_MASK);
memoryKK->grow_kokkos(k_dvector,dvector,ndvector,nmax,
"atom:dvector");
memoryKK->grow_kokkos(k_dvector, dvector, ndvector, nmax, "atom:dvector");
this->modified(Device, DVECTOR_MASK);
} else if (flag == 0 && cols) {
index = niarray;
niarray++;
ianame = (char **) memory->srealloc(ianame,niarray*sizeof(char *),
"atom:ianame");
int n = strlen(name) + 1;
ianame[index] = new char[n];
strcpy(ianame[index],name);
iarray = (int ***) memory->srealloc(iarray,niarray*sizeof(int **),
"atom:iarray");
ianame = (char **) memory->srealloc(ianame, niarray * sizeof(char *), "atom:ianame");
ianame[index] = utils::strdup(name);
iarray = (int ***) memory->srealloc(iarray, niarray * sizeof(int **), "atom:iarray");
memory->create(iarray[index], nmax, cols, "atom:iarray");
icols = (int *) memory->srealloc(icols, niarray * sizeof(int), "atom:icols");
@ -306,13 +293,9 @@ int AtomKokkos::add_custom(const char *name, int flag, int cols)
} else if (flag == 1 && cols) {
index = ndarray;
ndarray++;
daname = (char **) memory->srealloc(daname,ndarray*sizeof(char *),
"atom:daname");
int n = strlen(name) + 1;
daname[index] = new char[n];
strcpy(daname[index],name);
darray = (double ***) memory->srealloc(darray,ndarray*sizeof(double **),
"atom:darray");
daname = (char **) memory->srealloc(daname, ndarray * sizeof(char *), "atom:daname");
daname[index] = utils::strdup(name);
darray = (double ***) memory->srealloc(darray, ndarray * sizeof(double **), "atom:darray");
memory->create(darray[index], nmax, cols, "atom:darray");
dcols = (int *) memory->srealloc(dcols, ndarray * sizeof(int), "atom:dcols");

View File

@ -1,4 +1,3 @@
// clang-format off
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -20,6 +19,7 @@ AtomStyle(angle/kk/host,AtomVecAngleKokkos);
// clang-format on
#else
// clang-format off
#ifndef LMP_ATOM_VEC_ANGLE_KOKKOS_H
#define LMP_ATOM_VEC_ANGLE_KOKKOS_H

View File

@ -1,4 +1,3 @@
// clang-format off
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale AtomicKokkos/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -20,6 +19,7 @@ AtomStyle(atomic/kk/host,AtomVecAtomicKokkos);
// clang-format on
#else
// clang-format off
#ifndef LMP_ATOM_VEC_ATOMIC_KOKKOS_H
#define LMP_ATOM_VEC_ATOMIC_KOKKOS_H

Some files were not shown because too many files have changed in this diff Show More