Compare commits

...

118 Commits

Author SHA1 Message Date
7069b52a44 Merge pull request #1172 from akohlmey/next-patch-release
Patch release 24 October 2018
2018-10-23 18:08:38 -04:00
45f28517ef Merge pull request #1174 from akohlmey/fix-kspace-refactor
Bug fix for Kspace refactoring in USER-INTEL package
2018-10-23 13:33:36 -04:00
fccc26758b Merge pull request #1152 from lammps/doc-adjust2
More Documentation consistency improvements
2018-10-23 13:05:04 -04:00
b6b6270716 fix bug reported in issue #1173 2018-10-23 11:58:00 -04:00
0293dee9b2 patch 24Oct2018 2018-10-23 11:03:51 -04:00
6107f00e9d Merge pull request #1164 from akohlmey/fix-halt-for-minimize
Enable use of fix halt for minimizations
2018-10-23 10:35:26 -04:00
1d38f2d725 Merge pull request #1165 from akohlmey/refactor-kspace-base-class
Refactor kspace base class to have a settings() method
2018-10-23 10:35:12 -04:00
4a5c14f60d Merge pull request #1148 from akohlmey/deprecated-styles
Implement dummy classes for deprecated and removed styles
2018-10-23 10:34:58 -04:00
aa27c8f733 convert double quotes to latex style 2018-10-23 09:17:00 -04:00
527ec61586 Merge pull request #1169 from akohlmey/kokkos-parallel-for-workaround
Workaround for parallel_for() compilation issue with newer GNU compilers
2018-10-22 11:17:47 -04:00
8649081904 fix broken links in manual 2018-10-21 18:39:25 -04:00
c0dd187802 make sure all pictures are includes in epub/mobi files 2018-10-21 18:38:46 -04:00
3661836a3b Merge pull request #1168 from athomps/compute-adf
Created new compute ADF for angular distribution function
2018-10-20 20:57:38 -04:00
76a2a9ab0a Fixed normalization error for ordinate degree 2018-10-20 17:16:47 -06:00
8223f5e0a3 Eliminated another initialization error and tweaked rdf-adf example 2018-10-20 16:46:45 -06:00
07a499fcc1 improve check for missing styles in lammps.book 2018-10-20 10:01:55 -04:00
8aecefe233 fix uninitialized data bug in compute adf 2018-10-20 08:12:19 -04:00
2140caa6f5 add an example for RDF and ADF computation with water molecules 2018-10-20 08:12:02 -04:00
fb6f019a11 correct link to output options 2018-10-20 06:45:57 -04:00
79da210dc4 integrate compute adf into manual build infrastructure 2018-10-20 06:45:28 -04:00
348febdf4b work around for parallel_for() compilation issue with newer compilers
apparently, data items used inside parallel_for() constructs have
rather strict requirements on const-ness, which is enforced by
newer GNU compilers. As a workaround we construct explicit const
copies of those class instances. This closes #1045
2018-10-20 02:54:48 -04:00
0783f8ad2f Added compute_rdf.txt 2018-10-19 18:43:58 -06:00
3a735d15d4 Added compute_rdf.cpp 2018-10-19 18:43:04 -06:00
04a4a29fcf Creatd new compute ADF for angular distribution function 2018-10-19 18:36:11 -06:00
52f02f2bbb Merge pull request #1167 from lammps/create-triclinic-lib
fix triclinic rounding bug for lib interface as well
2018-10-19 19:06:01 -04:00
f82a8493fa Merge pull request #1166 from rbberger/cmake_prevent_src_builds
Add src directory to PreventInSourceBuilds checks
2018-10-19 17:56:25 -04:00
8cd70f7d78 fix triclinic rounding bug for lib interface as well 2018-10-19 15:27:38 -06:00
27a46cec8c Add src directory to PreventInSourceBuilds checks 2018-10-19 17:25:18 -04:00
15de09683e Merge pull request #1162 from lammps/restart2dump
added -restart2dump command-line option
2018-10-19 17:24:17 -04:00
f542590090 Merge pull request #1136 from junghans/cmake_out_source
cmake: prevent in-source build
2018-10-19 17:02:05 -04:00
01c3ab5979 update embedded command line help summary string for new feature 2018-10-19 16:49:06 -04:00
709013be5a harden code against buffer overflows 2018-10-19 16:48:37 -04:00
db32373b32 fix some typos caused by trusting emacs' smart case-preserving replace too much 2018-10-19 16:11:13 -04:00
9d7c4ac5f2 add depreacted kspace style 2018-10-19 16:01:26 -04:00
0ec94b2ad6 replace non-ASCII character 2018-10-19 16:01:13 -04:00
83c830fd8a port kspace refactor to GPU and KOKKOS package 2018-10-19 15:47:00 -04:00
3a4bef351c refactor kspace style in USER-SCAFACOS and fix uninitialized handle bug 2018-10-19 15:32:29 -04:00
da84138475 correct scafacos input example 2018-10-19 15:31:53 -04:00
2f52eee6bf kspace refactor compiles for KSPACE and USER-OMP 2018-10-19 15:11:37 -04:00
80e0dddae0 use min_post_force() method to hook fix halt into minimization 2018-10-19 14:08:25 -04:00
1c994bda46 corrections to fix neb doc page 2018-10-19 09:53:19 -06:00
f5206d2f7b more one-liner in pair_style doc page 2018-10-19 09:53:19 -06:00
9bca5ae607 added one-line pair descriptions 2018-10-19 09:53:19 -06:00
d1f260a765 undo changes to PRD doc from another branch 2018-10-19 09:53:19 -06:00
36a1ca7e72 updates some one-line style defs 2018-10-19 09:53:19 -06:00
5f1c77ced2 tweaks to USER-PTM package doc 2018-10-19 09:53:18 -06:00
dc89bdd924 more changes augmenting lists with USER styles and to core/shell doc pages 2018-10-19 09:53:18 -06:00
a979c6eeec updating files that have lists of command styles 2018-10-19 09:53:18 -06:00
cc6f1be82d first attempt to port fix halt to minimizations 2018-10-19 07:26:49 -04:00
9090fd0255 propagate the kspace change to a the first few kspace styles 2018-10-18 16:31:17 -04:00
7deb1df2b6 split kspace style constructor into plain constructor and settings() method 2018-10-18 16:30:45 -04:00
d9dd80b368 added -restart2dump command-line option 2018-10-18 14:24:48 -06:00
4015b36a1a Merge pull request #1161 from lammps/create-atoms-single
bug fix for create_atoms single remap and triclinic
2018-10-18 13:41:28 -04:00
dcde84eb53 bug fix for create_atoms single remap and triclinic 2018-10-18 11:22:51 -06:00
7bb5821baf add deprecated dump and region styles 2018-10-17 18:13:12 -04:00
2b0e474729 implement deprecated styles for bond, angle, dihedral, and improper 2018-10-17 16:26:20 -04:00
65ebbdada3 add DEPRECATED compute style 2018-10-17 16:05:10 -04:00
b71f530bd0 make default style name for deprecated styles uppercase, so it is considered internal
also consolidate the writeout message across styles into a single convenience function
2018-10-17 16:04:52 -04:00
0ec9b9a71a Merge pull request #1160 from akohlmey/user-ptm-portability
Make USER-PTM compile with MinGW64 for Windows
2018-10-16 14:52:26 -04:00
2273604533 resolve portability issues to windows w.r.t. fixed width integer types 2018-10-16 13:49:06 -04:00
6e99b3d8ff Merge pull request #1159 from wmbrownIntel/user-intel-sf-hybrid
Fix to allow suffix and pair hybrid to work together with USER-INTEL.
2018-10-16 06:09:58 -04:00
bea0a3091d Fix to allow suffix and pair hybrid to work together with USER-INTEL. 2018-10-15 10:25:39 -07:00
7968d2ed22 Merge pull request #1155 from athomps/sna-atom-leakfix2
Fixed a segfault introduced by memory-leak fix (#1125)
2018-10-12 13:01:15 -04:00
382e91cf5b Merge pull request #1156 from wmbrownIntel/user-intel-hybrid
Adding hybrid support to USER-INTEL package + EAM/intel bug fix
2018-10-12 12:35:36 -04:00
ce63a22783 Merge pull request #1157 from wmbrownIntel/user-intel-makefiles
Changes to intel Makefiles to make use of MKL consistent.
2018-10-12 12:32:28 -04:00
00c75ecb74 Merge pull request #988 from valleymouth/granular-kokkos
Kokkos port for GRANULAR
2018-10-12 09:04:36 -06:00
8224c89f93 Revert size_velocity change in atom_vec_dpd_kokkos 2018-10-11 16:38:44 -06:00
a223338b47 Fix hang with Kokkos and USER-DPD examples 2018-10-11 16:32:44 -06:00
8eb74d8fb3 Add missing Kokkos pack/unpack comm vel functions 2018-10-11 13:21:44 -06:00
e5c6b6987a Merge branch 'master' of github.com:lammps/lammps into granular-kokkos 2018-10-11 13:14:25 -06:00
8cbee78725 Changes to intel Makefiles to make use of MKL consistent. 2018-10-11 05:46:40 -07:00
c37deebffa Adding full hybrid support to USER-INTEL package and fixing bug with EAM parameter initialization. 2018-10-11 05:12:00 -07:00
c142288eb3 Fixed a segfault introduced by memory-leak fix 2018-10-10 17:24:14 -06:00
7faa48b4c3 Merge pull request #1154 from stanmoore1/small_fixes
Small fixes
2018-10-10 23:05:21 +02:00
a1266a1a1e Fix compile error with copysign function 2018-10-10 14:19:23 -06:00
7cce002cf9 Makefile fix from the mailing list 2018-10-10 14:18:24 -06:00
2def00d4c9 Add missing files to .gitignore 2018-10-10 14:18:00 -06:00
3d0722b974 Merge branch 'master' of github.com:lammps/lammps into granular-kokkos 2018-10-10 10:43:54 -06:00
747f72aca2 Merge branch 'granular-kokkos' of https://github.com/valleymouth/lammps into granular-kokkos 2018-10-10 09:53:15 +01:00
0c1ff5ac3e Fixing issues with AtomVecSphereKokkos not correctly handling cases with varying and constant radius. 2018-10-05 17:10:31 +01:00
43ae9656d7 add a "deprecated" command style for flagging future removed commands 2018-10-05 17:23:09 +02:00
b02d3b1b94 cosmetic change 2018-10-04 12:24:46 +02:00
a1a9f34c18 pair style deprecated now functional and compatible with hybrid pair styles 2018-10-04 12:18:28 +02:00
c3abf13af1 don't allow hybrid/overlay as hybrid substyle as well 2018-10-04 12:18:01 +02:00
b481af51d6 add pair_style deprecated and some tweaks for fix style 2018-10-02 16:26:20 +02:00
2da999d864 cmake: prevent in-source build 2018-09-27 12:18:43 -06:00
cca1e0a399 Merge branch 'master' into granular-kokkos 2018-08-20 22:02:41 -04:00
9765a9a430 Implementing forward/border comm in Kokkos. 2018-08-13 16:03:23 +01:00
5412204ff7 Merge branch 'master' into granular-kokkos 2018-08-02 10:11:50 +02:00
591e782415 Optimizing PairGranHookeHistoryKokkos to be less divergent. 2018-07-19 17:08:44 +01:00
406aaf011f Improving global memory access pattern for firstflag and firstvalue in FixNeighHistoryKokkos. 2018-07-16 15:30:24 +01:00
56c2127127 Merge branch 'granular-kokkos' of github.com:valleymouth/lammps into granular-kokkos 2018-07-11 12:03:57 -06:00
b5816f2637 Update docs for Kokkos version of GRANULAR package 2018-07-11 12:03:34 -06:00
0d1e55c99d Removing unnecessary calls to sync/modified in AtomVecSphereKokkos. 2018-07-11 11:06:16 -04:00
c83b5ec226 Prevent error when Kokkos debug mode turned on 2018-07-10 19:49:41 -06:00
687a4427da Fix runtime error in pair_dpd_fdt_energy_kokkos due to rmass change 2018-07-10 12:15:08 -06:00
af0eb52410 Error out if using fix pour with the KOKKOS package 2018-07-10 10:21:42 -06:00
a49f946f2f Add missing modify in atom_vec_sphere_kokkos 2018-07-10 10:04:13 -06:00
8c3cbad7ae Fix runtime error in fix_nve_kokkos 2018-07-10 09:15:24 -06:00
ca8b109a1c Fix issues with rmass in KOKKOS package 2018-07-10 08:59:06 -06:00
55980294f1 Fix issues in atom_vec_sphere_kokkos 2018-07-09 18:47:17 -06:00
ee98daeba5 Fix bug in atom_vec_sphere_kokkos 2018-07-06 16:47:55 -06:00
2cd95d1a99 Fix misnamed variable in comm_kokkos 2018-07-06 15:47:14 -06:00
13d562e969 Removed wrong which variable 2018-07-06 12:06:09 -06:00
228caa3fab Remove randomread from radius to prevent Kokkos runtime error when radius isn't defined 2018-07-06 11:59:25 -06:00
64fb7674b1 Fix compile warning in fix_freeze_kokkos 2018-07-06 11:58:42 -06:00
cce0755ee9 Fix memory free issue in fix_neigh_history_kokkos 2018-07-06 10:08:21 -06:00
67ed11a960 Allow Kokkos version of fix gravity in fix pour, including kk/device and kk/host suffixes 2018-07-06 09:52:41 -06:00
acb0436057 Allow Kokkos version of fix gravity in fix pour 2018-07-06 09:31:48 -06:00
2f3343b7ed Fixing dependencies with GRANULAR. 2018-07-06 05:24:26 -04:00
13efc1b76d Attempt to fix compilation issue with kokkos_omp. 2018-07-05 18:32:19 -04:00
dc93d4ceea Added virial computation to PairGranHookeHistoryKokkos. 2018-07-05 06:03:27 -04:00
a6df61a637 Making ComputeTempKokkos compatible with rmass in device memory. 2018-07-03 12:05:21 -04:00
f394ed94f3 dump vtk also works with VTK version 8. 2018-07-03 11:33:55 -04:00
11a5ed0e03 Porting fix freeze to Kokkos. 2018-07-03 11:29:13 -04:00
a365246e3a Porting fix gravity to Kokkos. 2018-07-03 11:21:54 -04:00
8ebe38474d Porting fix nve/sphere to Kokkos. 2018-07-03 11:13:27 -04:00
0a5b027bac Porting pair gran/hooke/history to Kokkos. 2018-07-03 11:10:27 -04:00
233 changed files with 19709 additions and 1433 deletions

View File

@ -69,6 +69,8 @@ get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
# Cmake modules/macros are in a subdirectory to keep this file cleaner
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Modules)
include(PreventInSourceBuilds)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
#release comes with -O3 by default
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)

View File

@ -0,0 +1,23 @@
# - Prevent in-source builds.
# https://stackoverflow.com/questions/1208681/with-cmake-how-would-you-disable-in-source-builds/
function(prevent_in_source_builds)
# make sure the user doesn't play dirty with symlinks
get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component(srcdir2 "${CMAKE_SOURCE_DIR}/.." REALPATH)
get_filename_component(srcdir3 "${CMAKE_SOURCE_DIR}/../src" REALPATH)
get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
# disallow in-source builds
if("${srcdir}" STREQUAL "${bindir}" OR "${srcdir2}" STREQUAL "${bindir}" OR "${srcdir3}" STREQUAL "${bindir}")
message(FATAL_ERROR "\
CMake must not to be run in the source directory. \
Rather create a dedicated build directory and run CMake there. \
To clean up after this aborted in-place compilation:
rm -r CMakeCache.txt CMakeFiles
")
endif()
endfunction()
prevent_in_source_builds()

View File

@ -95,9 +95,10 @@ spelling: $(OBJECTS) utils/sphinx-config/false_positives.txt
@echo "Spell check finished."
epub: $(OBJECTS)
@mkdir -p epub
@mkdir -p epub/JPG
@rm -f LAMMPS.epub
@cp src/JPG/lammps-logo.png epub/
@cp src/JPG/*.* epub/JPG
@(\
. $(VENV)/bin/activate ;\
cp -r src/* $(RSTDIR)/ ;\
@ -123,9 +124,9 @@ pdf: utils/txt2html/txt2html.exe
cd ..; \
../utils/txt2html/txt2html.exe -b *.txt; \
htmldoc --batch lammps.book; \
for s in `echo *.txt | sed -e 's,\.txt,\.html,g'` ; \
do grep -q $$s lammps.book || \
echo doc file $$s missing in src/lammps.book; done; \
for s in `echo *.txt | sed -e 's/ \(pairs\|bonds\|angles\|dihedrals\|impropers\|commands_list\|fixes\|computes\).txt/ /g' | sed -e 's,\.txt,\.html,g'` ; \
do grep -q ^$$s lammps.book || \
echo WARNING: doc file $$s missing in src/lammps.book; done; \
rm *.html; \
)

View File

@ -563,9 +563,9 @@ file.
VORONOI package :h4,link(voronoi)
To build with this package, you must download and build the "Voro++
library"_voro_home.
library"_voro-home.
:link(voro_home,http://math.lbl.gov/voro++)
:link(voro-home,http://math.lbl.gov/voro++)
[CMake build]:
@ -932,9 +932,9 @@ successfully build on your system.
USER-SCAFACOS package :h4,link(user-scafacos)
To build with this package, you must download and build the "ScaFaCoS
Coulomb solver library"_scafacos_home
Coulomb solver library"_scafacos-home
:link(scafacos_home,http://www.scafacos.de)
:link(scafacos-home,http://www.scafacos.de)
[CMake build]:

View File

@ -34,7 +34,7 @@ OPT.
"fene (iko)"_bond_fene.html,
"fene/expand (o)"_bond_fene_expand.html,
"gromos (o)"_bond_gromos.html,
"harmonic (ko)"_bond_harmonic.html,
"harmonic (iko)"_bond_harmonic.html,
"harmonic/shift (o)"_bond_harmonic_shift.html,
"harmonic/shift/cut (o)"_bond_harmonic_shift_cut.html,
"morse (o)"_bond_morse.html,
@ -57,9 +57,11 @@ OPT.
"zero"_angle_zero.html,
"hybrid"_angle_hybrid.html :tb(c=3,ea=c)
"charmm (ko)"_angle_charmm.html,
"charmm (iko)"_angle_charmm.html,
"class2 (ko)"_angle_class2.html,
"class2/p6"_angle_class2.html,
"cosine (o)"_angle_cosine.html,
"cosine/buck6d"_angle_cosine_buck6d.html,
"cosine/delta (o)"_angle_cosine_delta.html,
"cosine/periodic (o)"_angle_cosine_periodic.html,
"cosine/shift (o)"_angle_cosine_shift.html,
@ -97,7 +99,7 @@ OPT.
"nharmonic (o)"_dihedral_nharmonic.html,
"opls (iko)"_dihedral_opls.html,
"quadratic (o)"_dihedral_quadratic.html,
"spherical (o)"_dihedral_spherical.html,
"spherical"_dihedral_spherical.html,
"table (o)"_dihedral_table.html,
"table/cut"_dihedral_table_cut.html :tb(c=4,ea=c)
@ -120,5 +122,6 @@ OPT.
"distance"_improper_distance.html,
"fourier (o)"_improper_fourier.html,
"harmonic (iko)"_improper_harmonic.html,
"inversion/harmonic"_improper_inversion_harmonic.html,
"ring (o)"_improper_ring.html,
"umbrella (o)"_improper_umbrella.html :tb(c=4,ea=c)

View File

@ -25,6 +25,7 @@ additional letters in parenthesis: g = GPU, i = USER-INTEL, k =
KOKKOS, o = USER-OMP, t = OPT.
"ackland/atom"_compute_ackland_atom.html,
"adf"_compute_adf.html,
"aggregate/atom"_compute_cluster_atom.html,
"angle"_compute_angle.html,
"angle/local"_compute_angle_local.html,
@ -92,6 +93,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"pe/tally"_compute_tally.html,
"plasticity/atom"_compute_plasticity_atom.html,
"pressure"_compute_pressure.html,
"pressure/cylinder"_compute_pressure_cylinder.html,
"pressure/uef"_compute_pressure_uef.html,
"property/atom"_compute_property_atom.html,
"property/chunk"_compute_property_chunk.html,
@ -118,7 +120,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"smd/tlsph/strain"_compute_smd_tlsph_strain.html,
"smd/tlsph/strain/rate"_compute_smd_tlsph_strain_rate.html,
"smd/tlsph/stress"_compute_smd_tlsph_stress.html,
"smd/triangle/mesh/vertices"_compute_smd_triangle_vertices.html,
"smd/triangle/vertices"_compute_smd_triangle_vertices.html,
"smd/ulsph/num/neighs"_compute_smd_ulsph_num_neighs.html,
"smd/ulsph/strain"_compute_smd_ulsph_strain.html,
"smd/ulsph/strain/rate"_compute_smd_ulsph_strain_rate.html,
@ -129,6 +131,8 @@ KOKKOS, o = USER-OMP, t = OPT.
"snav/atom"_compute_sna_atom.html,
"spin"_compute_spin.html,
"stress/atom"_compute_stress_atom.html,
"stress/mop"_compute_stress_mop.html,
"stress/mop/profile"_compute_stress_mop.html,
"stress/tally"_compute_tally.html,
"tdpd/cc/atom"_compute_tdpd_cc_atom.html,
"temp (k)"_compute_temp.html,
@ -136,6 +140,7 @@ KOKKOS, o = USER-OMP, t = OPT.
"temp/body"_compute_temp_body.html,
"temp/chunk"_compute_temp_chunk.html,
"temp/com"_compute_temp_com.html,
"temp/cs"_compute_temp_cs.html,
"temp/deform"_compute_temp_deform.html,
"temp/deform/eff"_compute_temp_deform_eff.html,
"temp/drude"_compute_temp_drude.html,

View File

@ -40,11 +40,13 @@ OPT.
"ave/time"_fix_ave_time.html,
"aveforce"_fix_aveforce.html,
"balance"_fix_balance.html,
"bocs"_fix_bocs.html,
"bond/break"_fix_bond_break.html,
"bond/create"_fix_bond_create.html,
"bond/react"_fix_bond_react.html,
"bond/swap"_fix_bond_swap.html,
"box/relax"_fix_box_relax.html,
"client/md"_fix_client_md.html,
"cmap"_fix_cmap.html,
"colvars"_fix_colvars.html,
"controller"_fix_controller.html,
@ -54,7 +56,7 @@ OPT.
"drag"_fix_drag.html,
"drude"_fix_drude.html,
"drude/transform/direct"_fix_drude_transform.html,
"drude/transform/reverse"_fix_drude_transform.html,
"drude/transform/inverse"_fix_drude_transform.html,
"dt/reset"_fix_dt_reset.html,
"edpd/source"_fix_dpd_source.html,
"efield"_fix_efield.html,
@ -68,11 +70,11 @@ OPT.
"ffl"_fix_ffl.html,
"filter/corotate"_fix_filter_corotate.html,
"flow/gauss"_fix_flow_gauss.html,
"freeze"_fix_freeze.html,
"freeze (k)"_fix_freeze.html,
"gcmc"_fix_gcmc.html,
"gld"_fix_gld.html,
"gle"_fix_gle.html,
"gravity (o)"_fix_gravity.html,
"gravity (ko)"_fix_gravity.html,
"grem"_fix_grem.html,
"halt"_fix_halt.html,
"heat"_fix_heat.html,
@ -105,17 +107,18 @@ OPT.
"nph/asphere (o)"_fix_nph_asphere.html,
"nph/body"_fix_nph_body.html,
"nph/eff"_fix_nh_eff.html,
"nph/sphere (o)"_fix_nph_sphere.html,
"nph/sphere (ko)"_fix_nph_sphere.html,
"nphug (o)"_fix_nphug.html,
"npt (kio)"_fix_nh.html,
"npt (iko)"_fix_nh.html,
"npt/asphere (o)"_fix_npt_asphere.html,
"npt/body"_fix_npt_body.html,
"npt/eff"_fix_nh_eff.html,
"npt/sphere (o)"_fix_npt_sphere.html,
"npt/uef"_fix_nh_uef.html,
"nve (kio)"_fix_nve.html,
"nve (iko)"_fix_nve.html,
"nve/asphere (i)"_fix_nve_asphere.html,
"nve/asphere/noforce"_fix_nve_asphere_noforce.html,
"nve/awpmd"_fix_nve_awpmd.html,
"nve/body"_fix_nve_body.html,
"nve/dot"_fix_nve_dot.html,
"nve/dotc/langevin"_fix_nve_dotc_langevin.html,
@ -170,26 +173,26 @@ OPT.
"rhok"_fix_rhok.html,
"rigid (o)"_fix_rigid.html,
"rigid/nph (o)"_fix_rigid.html,
"rigid/nph/small"_fix_rigid.html,
"rigid/npt (o)"_fix_rigid.html,
"rigid/npt/small"_fix_rigid.html,
"rigid/nve (o)"_fix_rigid.html,
"rigid/nve/small"_fix_rigid.html,
"rigid/nvt (o)"_fix_rigid.html,
"rigid/nvt/small"_fix_rigid.html,
"rigid/small (o)"_fix_rigid.html,
"rigid/small/nph"_fix_rigid.html,
"rigid/small/npt"_fix_rigid.html,
"rigid/small/nve"_fix_rigid.html,
"rigid/small/nvt"_fix_rigid.html,
"rx (k)"_fix_rx.html,
"saed/vtk"_fix_saed_vtk.html,
"setforce (k)"_fix_setforce.html,
"shake"_fix_shake.html,
"shardlow (k)"_fix_shardlow.html,
"smd"_fix_smd.html,
"smd/adjust/dt"_fix_smd_adjust_dt.html,
"smd/integrate/tlsph"_fix_smd_integrate_tlsph.html,
"smd/integrate/ulsph"_fix_smd_integrate_ulsph.html,
"smd/move/triangulated/surface"_fix_smd_move_triangulated_surface.html,
"smd/adjust_dt"_fix_smd_adjust_dt.html,
"smd/integrate_tlsph"_fix_smd_integrate_tlsph.html,
"smd/integrate_ulsph"_fix_smd_integrate_ulsph.html,
"smd/move_tri_surf"_fix_smd_move_triangulated_surface.html,
"smd/setvel"_fix_smd_setvel.html,
"smd/wall/surface"_fix_smd_wall_surface.html,
"smd/wall_surface"_fix_smd_wall_surface.html,
"spring"_fix_spring.html,
"spring/chunk"_fix_spring_chunk.html,
"spring/rg"_fix_spring_rg.html,

View File

@ -31,8 +31,8 @@ OPT.
"adp (o)"_pair_adp.html,
"agni (o)"_pair_agni.html,
"airebo (oi)"_pair_airebo.html,
"airebo/morse (oi)"_pair_airebo.html,
"airebo (io)"_pair_airebo.html,
"airebo/morse (io)"_pair_airebo.html,
"atm"_pair_atm.html,
"awpmd/cut"_pair_awpmd.html,
"beck (go)"_pair_beck.html,
@ -42,21 +42,23 @@ OPT.
"bop"_pair_bop.html,
"born (go)"_pair_born.html,
"born/coul/dsf"_pair_born.html,
"born/coul/dsf/cs"_pair_born.html,
"born/coul/dsf/cs"_pair_cs.html,
"born/coul/long (go)"_pair_born.html,
"born/coul/long/cs"_pair_born.html,
"born/coul/long/cs (g)"_pair_cs.html,
"born/coul/msm (o)"_pair_born.html,
"born/coul/wolf (go)"_pair_born.html,
"born/coul/wolf/cs"_pair_born.html,
"born/coul/wolf/cs (g)"_pair_cs.html,
"brownian (o)"_pair_brownian.html,
"brownian/poly (o)"_pair_brownian.html,
"buck (giko)"_pair_buck.html,
"buck/coul/cut (giko)"_pair_buck.html,
"buck/coul/long (giko)"_pair_buck.html,
"buck/coul/long/cs"_pair_buck.html,
"buck/coul/long/cs"_pair_cs.html,
"buck/coul/msm (o)"_pair_buck.html,
"buck/long/coul/long (o)"_pair_buck_long.html,
"buck/mdf"_pair_mdf.html,
"buck6d/coul/gauss/dsf"_pair_buck6d_coul_gauss.html,
"buck6d/coul/gauss/long"_pair_buck6d_coul_gauss.html,
"colloid (go)"_pair_colloid.html,
"comb (o)"_pair_comb.html,
"comb3"_pair_comb.html,
@ -66,13 +68,13 @@ OPT.
"coul/diel (o)"_pair_coul_diel.html,
"coul/dsf (gko)"_pair_coul.html,
"coul/long (gko)"_pair_coul.html,
"coul/long/cs"_pair_coul.html,
"coul/long/cs (g)"_pair_cs.html,
"coul/long/soft (o)"_pair_lj_soft.html,
"coul/msm"_pair_coul.html,
"coul/msm (o)"_pair_coul.html,
"coul/shield"_pair_coul_shield.html,
"coul/streitz"_pair_coul.html,
"coul/wolf (ko)"_pair_coul.html,
"coul/wolf/cs"_pair_coul.html,
"coul/wolf/cs"_pair_cs.html,
"dpd (gio)"_pair_dpd.html,
"dpd/fdt"_pair_dpd_fdt.html,
"dpd/fdt/energy (k)"_pair_dpd_fdt.html,
@ -91,11 +93,11 @@ OPT.
"exp6/rx (k)"_pair_exp6_rx.html,
"extep"_pair_extep.html,
"gauss (go)"_pair_gauss.html,
"gauss/cut"_pair_gauss.html,
"gauss/cut (o)"_pair_gauss.html,
"gayberne (gio)"_pair_gayberne.html,
"gran/hertz/history (o)"_pair_gran.html,
"gran/hooke (o)"_pair_gran.html,
"gran/hooke/history (o)"_pair_gran.html,
"gran/hooke/history (ko)"_pair_gran.html,
"gw"_pair_gw.html,
"gw/zbl"_pair_gw.html,
"hbond/dreiding/lj (o)"_pair_hbond_dreiding.html,
@ -110,9 +112,9 @@ OPT.
"list"_pair_list.html,
"lj/charmm/coul/charmm (iko)"_pair_charmm.html,
"lj/charmm/coul/charmm/implicit (ko)"_pair_charmm.html,
"lj/charmm/coul/long (giko)"_pair_charmm.html,
"lj/charmm/coul/long/soft (o)"_pair_charmm.html,
"lj/charmm/coul/msm"_pair_charmm.html,
"lj/charmm/coul/long (gikot)"_pair_charmm.html,
"lj/charmm/coul/long/soft (o)"_pair_lj_soft.html,
"lj/charmm/coul/msm (o)"_pair_charmm.html,
"lj/charmmfsw/coul/charmmfsh"_pair_charmm.html,
"lj/charmmfsw/coul/long"_pair_charmm.html,
"lj/class2 (gko)"_pair_class2.html,
@ -125,12 +127,12 @@ OPT.
"lj/cut/coul/debye (gko)"_pair_lj.html,
"lj/cut/coul/dsf (gko)"_pair_lj.html,
"lj/cut/coul/long (gikot)"_pair_lj.html,
"lj/cut/coul/long/cs"_pair_lj.html,
"lj/cut/coul/long/cs"_pair_cs.html,
"lj/cut/coul/long/soft (o)"_pair_lj_soft.html,
"lj/cut/coul/msm (go)"_pair_lj.html,
"lj/cut/coul/wolf (o)"_pair_lj.html,
"lj/cut/dipole/cut (go)"_pair_dipole.html,
"lj/cut/dipole/long"_pair_dipole.html,
"lj/cut/dipole/long (g)"_pair_dipole.html,
"lj/cut/dipole/sf (go)"_pair_dipole.html,
"lj/cut/soft (o)"_pair_lj_soft.html,
"lj/cut/thole/long (o)"_pair_thole.html,
@ -138,15 +140,17 @@ OPT.
"lj/cut/tip4p/long (ot)"_pair_lj.html,
"lj/cut/tip4p/long/soft (o)"_pair_lj_soft.html,
"lj/expand (gko)"_pair_lj_expand.html,
"lj/expand/coul/long (g)"_pair_lj_expand.html,
"lj/gromacs (gko)"_pair_gromacs.html,
"lj/gromacs/coul/gromacs (ko)"_pair_gromacs.html,
"lj/long/coul/long (io)"_pair_lj_long.html,
"lj/long/coul/long (iot)"_pair_lj_long.html,
"lj/long/dipole/long"_pair_dipole.html,
"lj/long/tip4p/long"_pair_lj_long.html,
"lj/long/tip4p/long (o)"_pair_lj_long.html,
"lj/mdf"_pair_mdf.html,
"lj/sdk (gko)"_pair_sdk.html,
"lj/sdk/coul/long (go)"_pair_sdk.html,
"lj/sdk/coul/msm (o)"_pair_sdk.html,
"lj/sf/dipole/sf (go)"_pair_dipole.html,
"lj/smooth (o)"_pair_lj_smooth.html,
"lj/smooth/linear (o)"_pair_lj_smooth_linear.html,
"lj96/cut (go)"_pair_lj96.html,
@ -161,10 +165,10 @@ OPT.
"meam/spline (o)"_pair_meam_spline.html,
"meam/sw/spline"_pair_meam_sw_spline.html,
"mgpt"_pair_mgpt.html,
"mie/cut (o)"_pair_mie.html,
"mie/cut (g)"_pair_mie.html,
"momb"_pair_momb.html,
"morse (gkot)"_pair_morse.html,
"morse/smooth/linear"_pair_morse.html,
"morse/smooth/linear (o)"_pair_morse.html,
"morse/soft"_pair_morse.html,
"multi/lucy"_pair_multi_lucy.html,
"multi/lucy/rx (k)"_pair_multi_lucy_rx.html,
@ -180,7 +184,9 @@ OPT.
"oxdna2/coaxstk"_pair_oxdna2.html,
"oxdna2/dh"_pair_oxdna2.html,
"oxdna2/excv"_pair_oxdna2.html,
"oxdna2/hbond"_pair_oxdna2.html,
"oxdna2/stk"_pair_oxdna2.html,
"oxdna2/xstk"_pair_oxdna2.html,
"peri/eps"_pair_peri.html,
"peri/lps (o)"_pair_peri.html,
"peri/pmb (o)"_pair_peri.html,
@ -190,11 +196,11 @@ OPT.
"quip"_pair_quip.html,
"reax"_pair_reax.html,
"reax/c (ko)"_pair_reaxc.html,
"rebo (oi)"_pair_airebo.html,
"rebo (io)"_pair_airebo.html,
"resquared (go)"_pair_resquared.html,
"smd/hertz"_pair_smd_hertz.html,
"smd/tlsph"_pair_smd_tlsph.html,
"smd/triangulated/surface"_pair_smd_triangulated_surface.html,
"smd/tri_surface"_pair_smd_triangulated_surface.html,
"smd/ulsph"_pair_smd_ulsph.html,
"smtbq"_pair_smtbq.html,
"snap (k)"_pair_snap.html,
@ -226,8 +232,8 @@ OPT.
"tip4p/long/soft (o)"_pair_lj_soft.html,
"tri/lj"_pair_tri_lj.html,
"ufm (got)"_pair_ufm.html,
"vashishta (ko)"_pair_vashishta.html,
"vashishta (gko)"_pair_vashishta.html,
"vashishta/table (o)"_pair_vashishta.html,
"yukawa (gok)"_pair_yukawa.html,
"yukawa (gko)"_pair_yukawa.html,
"yukawa/colloid (go)"_pair_yukawa_colloid.html,
"zbl (gok)"_pair_zbl.html :tb(c=4,ea=c)
"zbl (gko)"_pair_zbl.html :tb(c=4,ea=c)

View File

@ -22,10 +22,10 @@ users.
LAMMPS source files are in two directories of the distribution
tarball. The src directory has the majority of them, all of which are
C++ files (*.cpp and *.h). Many of these files are in the src
directory itself. There are also dozens of "packages", which can be
directory itself. There are also dozens of ``packages'', which can be
included or excluded when LAMMPS is built. See the
doc/Section\_build.html section of the manual for more information
about packages, or type "make" from within the src directory, which
about packages, or type ``make'' from within the src directory, which
lists package-related commands, such as ``make package-status''. The
source files for each package are in an all-uppercase sub-directory of
src, like src/MOLECULE or src/USER-CUDA. If the package is currently
@ -38,17 +38,17 @@ The lib directory also contains source code for external libraries,
used by a few of the packages. Each sub-directory, like meam or gpu,
contains the source files, some of which are in different languages
such as Fortran. The files are compiled into libraries from within
each sub-directory, e.g. performing a "make" in the lib/meam directory
each sub-directory, e.g. performing a ``make'' in the lib/meam directory
creates a libmeam.a file. These libraries are linked to during a
LAMMPS build, if the corresponding package is installed.
LAMMPS C++ source files almost always come in pairs, such as run.cpp
and run.h. The pair of files defines a C++ class, the Run class in
this case, which contains the code invoked by the "run" command in a
this case, which contains the code invoked by the ``run'' command in a
LAMMPS input script. As this example illustrates, source file and
class names often have a one-to-one correspondence with a command used
in a LAMMPS input script. Some source files and classes do not have a
corresponding input script command, e.g. force.cpp and the Force
corresponding input script command, e.g. ``force.cpp'' and the Force
class. They are discussed in the next section.
\pagebreak
@ -57,12 +57,12 @@ class. They are discussed in the next section.
Though LAMMPS has a lot of source files and classes, its class
hierarchy is quite simple, as outlined in Fig \ref{fig:classes}. Each
boxed name refers to a class and has a pair of associated source files
in lammps/src, e.g. memory.cpp and memory.h. More details on the
in lammps/src, e.g. ``memory.cpp'' and ``memory.h''. More details on the
class and its methods and data structures can be found by examining
its *.h file.
LAMMPS (lammps.cpp/h) is the top-level class for the entire code. It
holds an "instance" of LAMMPS and can be instantiated one or more
holds an ``instance'' of LAMMPS and can be instantiated one or more
times by a calling code. For example, the file src/main.cpp simply
instantiates one instance of LAMMPS and passes it the input script.
@ -81,7 +81,7 @@ enabled by a bit of cleverness in the Pointers class (see
src/pointers.h) which every class inherits from.
There are a handful of virtual parent classes in LAMMPS that define
what LAMMPS calls "styles". They are shaded red in Fig
what LAMMPS calls ``styles''. They are shaded red in Fig
\ref{fig:classes}. Each of these are parents of a number of child
classes that implement the interface defined by the parent class. For
example, the fix style has around 100 child classes. They are the
@ -89,17 +89,17 @@ possible fixes that can be specified by the fix command in an input
script, e.g. fix nve, fix shake, fix ave/time, etc. The corresponding
classes are Fix (for the parent class), FixNVE, FixShake, FixAveTime,
etc. The source files for these classes are easy to identify in the
src directory, since they begin with the word "fix", e,g,
src directory, since they begin with the word ``fix'', e,g,
fix\_nve.cpp, fix\_shake,cpp, fix\_ave\_time.cpp, etc.
The one exception is child class files for the "command" style. These
The one exception is child class files for the ``command'' style. These
implement specific commands in the input script that can be invoked
before/after/between runs or which launch a simulation. Examples are
the create\_box, minimize, run, and velocity commands which encode the
CreateBox, Minimize, Run, and Velocity classes. The corresponding
files are create\_box,cpp, minimize.cpp, run.cpp, and velocity.cpp.
The list of command style files can be found by typing "grep
COMMAND\_CLASS *.h" from within the src directory, since that word in
The list of command style files can be found by typing ``grep
COMMAND\_CLASS *.h'' from within the src directory, since that word in
the header file identifies the class as an input script command.
Similar words can be grepped to list files for the other LAMMPS
styles. E.g. ATOM\_CLASS, PAIR\_CLASS, BOND\_CLASS, REGION\_CLASS,
@ -471,13 +471,13 @@ FixStyle(your/fix/name,FixMine)
\end{verbatim}
\end{center}
Where "your/fix/name" is a name of your fix in the script and FixMine
Where ``your/fix/name'' is a name of your fix in the script and FixMine
is the name of the class. This code allows LAMMPS to find your fix
when it parses input script. In addition, your fix header must be
included in the file "style\_fix.h". In case if you use LAMMPS make,
included in the file ``style\_fix.h''. In case if you use LAMMPS make,
this file is generated automatically - all files starting with prefix
fix\_ are included, so call your header the same way. Otherwise, don't
forget to add your include into "style\_fix.h".
forget to add your include into ``style\_fix.h''.
Let's write a simple fix which will print average velocity at the end
of each timestep. First of all, implement a constructor:
@ -567,11 +567,11 @@ void FixPrintVel::end_of_step()
\end{center}
In the code above, we use MathExtra routines defined in
"math\_extra.h". There are bunch of math functions to work with
``math\_extra.h''. There are bunch of math functions to work with
arrays of doubles as with math vectors.
In this code we use an instance of Atom class. This object is stored
in the Pointers class (see "pointers.h"). This object contains all
in the Pointers class (see ``pointers.h''). This object contains all
global information about the simulation system. Data from Pointers
class available to all classes inherited from it using protected
inheritance. Hence when you write you own class, which is going to use
@ -689,7 +689,7 @@ int FixSavePos::unpack_exchange(int nlocal, double *buf)
Now, a little bit about memory allocation. We used Memory class which
is just a bunch of template functions for allocating 1D and 2D
arrays. So you need to add include "memory.h" to have access to them.
arrays. So you need to add include ``memory.h'' to have access to them.
Finally, if you need to write/read some global information used in
your fix to the restart file, you might do it by setting flag

View File

@ -49,7 +49,8 @@ Lennard-Jones benchmark file:
% brew test lammps -v :pre
If you have problems with the installation you can post issues to
"this link"_https://github.com/Homebrew/homebrew-science/issues.
"this link"_homebrew.
Thanks to Derek Thomas (derekt at cello.t.u-tokyo.ac.jp) for setting
up the Homebrew capability.
:link(homebrew,https://github.com/Homebrew/homebrew-science/issues)

View File

@ -1,7 +1,7 @@
<!-- HTML_ONLY -->
<HEAD>
<TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="10 Oct 2018 version">
<META NAME="docnumber" CONTENT="24 Oct 2018 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -21,7 +21,7 @@
:line
LAMMPS Documentation :c,h1
10 Oct 2018 version :c,h2
24 Oct 2018 version :c,h2
"What is a LAMMPS version?"_Manual_version.html

View File

@ -462,10 +462,10 @@ dynamics can be run with LAMMPS using density-functional tight-binding
quantum forces calculated by LATTE.
More information on LATTE can be found at this web site:
"https://github.com/lanl/LATTE"_latte_home. A brief technical
"https://github.com/lanl/LATTE"_latte-home. A brief technical
description is given with the "fix latte"_fix_latte.html command.
:link(latte_home,https://github.com/lanl/LATTE)
:link(latte-home,https://github.com/lanl/LATTE)
[Authors:] Christian Negre (LANL) and Steve Plimpton (Sandia). LATTE
itself is developed at Los Alamos National Laboratory by Marc
@ -668,9 +668,9 @@ MSCG package :link(PKG-mscg),h4
A "fix mscg"_fix_mscg.html command which can parameterize a
Multi-Scale Coarse-Graining (MSCG) model using the open-source "MS-CG
library"_mscg_home.
library"_mscg-home.
:link(mscg_home,https://github.com/uchicago-voth/MSCG-release)
:link(mscg-home,https://github.com/uchicago-voth/MSCG-release)
To use this package you must have the MS-CG library available on your
system.
@ -1008,11 +1008,11 @@ VORONOI package :link(PKG-VORONOI),h4
[Contents:]
A compute command which calculates the Voronoi tesselation of a
collection of atoms by wrapping the "Voro++ library"_voro_home. This
collection of atoms by wrapping the "Voro++ library"_voro-home. This
can be used to calculate the local volume or each atoms or its near
neighbors.
:link(voro_home,http://math.lbl.gov/voro++)
:link(voro-home,http://math.lbl.gov/voro++)
To use this package you must have the Voro++ library available on your
system.
@ -1520,7 +1520,7 @@ USER-MEAMC package :link(PKG-USER-MEAMC),h4
[Contents:]
A pair style for the modified embedded atom (MEAM) potential
translated from the Fortran version in the "MEAM"_MEAM package
translated from the Fortran version in the "MEAM"_#PKG-MEAM package
to plain C++. In contrast to the MEAM package, no library
needs to be compiled and the pair style can be instantiated
multiple times.
@ -1601,7 +1601,7 @@ USER-MOLFILE package :link(PKG-USER-MOLFILE),h4
[Contents:]
A "dump molfile"_dump_molfile.html command which uses molfile plugins
that are bundled with the "VMD"_vmd_home
that are bundled with the "VMD"_vmd-home
molecular visualization and analysis program, to enable LAMMPS to dump
snapshots in formats compatible with various molecular simulation
tools.
@ -1653,11 +1653,11 @@ Note that NetCDF files can be directly visualized with the following
tools:
"Ovito"_ovito (Ovito supports the AMBER convention and the extensions mentioned above)
"VMD"_vmd_home
"VMD"_vmd-home
"AtomEye"_atomeye (the libAtoms version of AtomEye contains a NetCDF reader not present in the standard distribution) :ul
:link(ovito,http://www.ovito.org)
:link(vmd_home,https://www.ks.uiuc.edu/Research/vmd/)
:link(vmd-home,https://www.ks.uiuc.edu/Research/vmd/)
:link(atomeye,http://www.libatoms.org)
[Author:] Lars Pastewka (Karlsruhe Institute of Technology).
@ -1757,7 +1757,8 @@ Matching methodology.
[Supporting info:]
src/USER-PTM: filename starting with ptm_ -> supporting code, other filenames -> commands
src/USER-PTM: filenames not starting with ptm_ -> commands
src/USER-PTM: filenames starting with ptm_ -> supporting code
src/USER-PTM/LICENSE
"compute ptm/atom"_compute_ptm_atom.html :ul

View File

@ -74,3 +74,4 @@ Package, Description, Doc page, Example, Library
"USER-TALLY"_Packages_details.html#PKG-USER-TALLY, pairwise tally computes,"compute XXX/tally"_compute_tally.html, USER/tally, no
"USER-UEF"_Packages_details.html#PKG-USER-UEF, extensional flow,"fix nvt/uef"_fix_nh_uef.html, USER/uef, no
"USER-VTK"_Packages_details.html#PKG-USER-VTK, dump output via VTK, "compute vtk"_dump_vtk.html, n/a, ext :tb(ea=c,ca1=l)
:link(MOFplus,https://www.mofplus.org/content/show/MOF-FF)

View File

@ -24,8 +24,9 @@ letter abbreviation can be used:
"-p or -partition"_#partition
"-pl or -plog"_#plog
"-ps or -pscreen"_#pscreen
"-r or -restart"_#restart
"-ro or -reorder"_#reorder
"-r2data or -restart2data"_#restart2data
"-r2dump or -restart2dump"_#restart2dump
"-sc or -screen"_#screen
"-sf or -suffix"_#suffix
"-v or -var"_#var :ul
@ -280,34 +281,6 @@ specified by the -screen command-line option.
:line
[-restart restartfile {remap} datafile keyword value ...] :link(restart)
Convert the restart file into a data file and immediately exit. This
is the same operation as if the following 2-line input script were
run:
read_restart restartfile {remap}
write_data datafile keyword value ... :pre
Note that the specified restartfile and datafile can have wild-card
characters ("*",%") as described by the
"read_restart"_read_restart.html and "write_data"_write_data.html
commands. But a filename such as file.* will need to be enclosed in
quotes to avoid shell expansion of the "*" character.
Note that following restartfile, the optional flag {remap} can be
used. This has the same effect as adding it to the
"read_restart"_read_restart.html command, as explained on its doc
page. This is only useful if the reading of the restart file triggers
an error that atoms have been lost. In that case, use of the remap
flag should allow the data file to still be produced.
Also note that following datafile, the same optional keyword/value
pairs can be listed as used by the "write_data"_write_data.html
command.
:line
[-reorder] :link(reorder)
This option has 2 forms:
@ -381,6 +354,77 @@ the LAMMPS simulation domain.
:line
[-restart2data restartfile (remap) datafile keyword value ...] :link(restart2data)
Convert the restart file into a data file and immediately exit. This
is the same operation as if the following 2-line input script were
run:
read_restart restartfile (remap)
write_data datafile keyword value ... :pre
Note that the specified restartfile and/or datafile can have the
wild-card character "*". The restartfile can also have the wild-card
character "%". The meaning of these characters is explained on the
"read_restart"_read_restart.html and "write_data"_write_data.html doc
pages. The use of "%" means that a parallel restart file can be read.
Note that a filename such as file.* will need to be enclosed in quotes
to avoid shell expansion of the "*" character.
Note that following restartfile, the optional word "remap" can be
used. This has the effect of adding it to the
"read_restart"_read_restart.html command, as explained on its doc
page. This is useful if reading the restart file triggers an error
that atoms have been lost. In that case, use of the remap flag should
allow the data file to still be produced.
The syntax following restartfile (or remap), namely
datafile keyword value ... :pre
is identical to the arguments of the "write_data"_write_data.html
command. See its doc page for details. This includes its
optional keyword/value settings.
:line
[-restart2dump restartfile {remap} group-ID dumpstyle dumpfile arg1 arg2 ...] :link(restart2dump)
Convert the restart file into a dump file and immediately exit. This
is the same operation as if the following 2-line input script were
run:
read_restart restartfile (remap)
write_dump group-ID dumpstyle dumpfile arg1 arg2 ... :pre
Note that the specified restartfile and dumpfile can have wild-card
characters ("*","%") as explained on the
"read_restart"_read_restart.html and "write_dump"_write_dump.html doc
pages. The use of "%" means that a parallel restart file and/or
parallel dump file can be read and/or written. Note that a filename
such as file.* will need to be enclosed in quotes to avoid shell
expansion of the "*" character.
Note that following restartfile, the optional word "remap" can be
used. This has the effect as adding it to the
"read_restart"_read_restart.html command, as explained on its doc
page. This is useful if reading the restart file triggers an error
that atoms have been lost. In that case, use of the remap flag should
allow the dump file to still be produced.
The syntax following restartfile (or remap), namely
group-ID dumpstyle dumpfile arg1 arg2 ... :pre
is identical to the arguments of the "write_dump"_write_dump.html
command. See its doc page for details. This includes what per-atom
fields are written to the dump file and optional dump_modify settings,
including ones that affect how parallel dump files are written, e.g.
the {nfile} and {fileper} keywords. See the
"dump_modify"_dump_modify.html doc page for details.
:line
[-screen file] :link(screen)
Specify a file for LAMMPS to write its screen information to. In

View File

@ -499,7 +499,7 @@ MPI task.
When offloading to a coprocessor, "hybrid"_pair_hybrid.html styles
that require skip lists for neighbor builds cannot be offloaded.
Using "hybrid/overlay"_pair_hybrid.html is allowed. Only one intel
accelerated style may be used with hybrid styles.
accelerated style may be used with hybrid styles when offloading.
"Special_bonds"_special_bonds.html exclusion lists are not currently
supported with offload, however, the same effect can often be
accomplished by setting cutoffs for excluded atom types to 0. None of

View File

@ -7,8 +7,8 @@
:line
angle_style class2 command :h3
angle_style class2/omp command :h3
angle_style class2/kk command :h3
angle_style class2/omp command :h3
angle_style class2/p6 command :h3
[Syntax:]

View File

@ -40,8 +40,8 @@ internally.
Additional to the cosine term the {cosine/buck6d} angle style computes
the short range (vdW) interaction belonging to the
"pair_buck6d"_pair_buck6d_coul_gauss.html between the end atoms of
the angle. For this reason this angle style only works in combination
"pair_buck6d"_pair_buck6d_coul_gauss.html between the end atoms of the
angle. For this reason this angle style only works in combination
with the "pair_buck6d"_pair_buck6d_coul_gauss.html styles and needs
the "special_bonds"_special_bonds.html 1-3 interactions to be weighted
0.0 to prevent double counting.

View File

@ -62,18 +62,27 @@ which are included in the LAMMPS distribution. The full list of all
angle styles are is on the "Commands bond"_Commands_bond.html#angle
doc page.
"angle_style none"_angle_none.html - turn off angle interactions
"angle_style zero"_angle_zero.html - topology but no interactions
"angle_style hybrid"_angle_hybrid.html - define multiple styles of angle interactions :ul
"none"_angle_none.html - turn off angle interactions
"zero"_angle_zero.html - topology but no interactions
"hybrid"_angle_hybrid.html - define multiple styles of angle interactions :ul
"angle_style charmm"_angle_charmm.html - CHARMM angle
"angle_style class2"_angle_class2.html - COMPASS (class 2) angle
"angle_style cosine"_angle_cosine.html - cosine angle potential
"angle_style cosine/delta"_angle_cosine_delta.html - difference of cosines angle potential
"angle_style cosine/periodic"_angle_cosine_periodic.html - DREIDING angle
"angle_style cosine/squared"_angle_cosine_squared.html - cosine squared angle potential
"angle_style harmonic"_angle_harmonic.html - harmonic angle
"angle_style table"_angle_table.html - tabulated by angle :ul
"charmm"_angle_charmm.html - CHARMM angle
"class2"_angle_class2.html - COMPASS (class 2) angle
"class2/p6"_angle_class2.html - COMPASS (class 2) angle expanded to 6th order
"cosine"_angle_cosine.html - angle with cosine term
"cosine/buck6d"_angle_cosine_buck6d.html - same as cosine with Buckingham term between 1-3 atoms
"cosine/delta"_angle_cosine_delta.html - angle with difference of cosines
"cosine/periodic"_angle_cosine_periodic.html - DREIDING angle
"cosine/shift"_angle_cosine_shift.html - angle cosine with a shift
"cosine/shift/exp"_angle_cosine_shift_exp.html - cosine with shift and exponential term in spring constant
"cosine/squared"_angle_cosine_squared.html - angle with cosine squared term
"dipole"_angle_dipole.html - angle that controls orientation of a point dipole
"fourier"_angle_fourier.html - angle with multiple cosine terms
"fourier/simple"_angle_fourier_simple.html - angle with a single cosine term
"harmonic"_angle_harmonic.html - harmonic angle
"quartic"_angle_quartic.html - angle with cubic and quartic terms
"sdk"_angle_sdk.html - harmonic angle with repulsive SDK pair style between 1-3 atoms
"table"_angle_table.html - tabulated by angle :ul
:line

View File

@ -516,3 +516,4 @@ appear in {dimstr} for the {shift} style.
"fix balance"_fix_balance.html
[Default:] none
:link(pizza,http://pizza.sandia.gov)

View File

@ -28,34 +28,44 @@ The {oxdna/fene} and {oxdna2/fene} bond styles use the potential
:c,image(Eqs/bond_oxdna_fene.jpg)
to define a modified finite extensible nonlinear elastic (FENE) potential
"(Ouldridge)"_#oxdna_fene to model the connectivity of the phosphate backbone
in the oxDNA force field for coarse-grained modelling of DNA.
to define a modified finite extensible nonlinear elastic (FENE)
potential "(Ouldridge)"_#oxdna_fene to model the connectivity of the
phosphate backbone in the oxDNA force field for coarse-grained
modelling of DNA.
The following coefficients must be defined for the bond type via the
"bond_coeff"_bond_coeff.html command as given in the above example, or in
the data file or restart files read by the "read_data"_read_data.html
or "read_restart"_read_restart.html commands:
"bond_coeff"_bond_coeff.html command as given in the above example, or
in the data file or restart files read by the
"read_data"_read_data.html or "read_restart"_read_restart.html
commands:
epsilon (energy)
Delta (distance)
r0 (distance) :ul
NOTE: The oxDNA bond style has to be used together with the corresponding oxDNA pair styles
for excluded volume interaction {oxdna/excv}, stacking {oxdna/stk}, cross-stacking {oxdna/xstk}
and coaxial stacking interaction {oxdna/coaxstk} as well as hydrogen-bonding interaction {oxdna/hbond} (see also documentation of
"pair_style oxdna/excv"_pair_oxdna.html). For the oxDNA2 "(Snodin)"_#oxdna2 bond style the analogous pair styles and an additional Debye-Hueckel pair
style {oxdna2/dh} have to be defined.
The coefficients in the above example have to be kept fixed and cannot be changed without reparametrizing the entire model.
NOTE: The oxDNA bond style has to be used together with the
corresponding oxDNA pair styles for excluded volume interaction
{oxdna/excv}, stacking {oxdna/stk}, cross-stacking {oxdna/xstk} and
coaxial stacking interaction {oxdna/coaxstk} as well as
hydrogen-bonding interaction {oxdna/hbond} (see also documentation of
"pair_style oxdna/excv"_pair_oxdna.html). For the oxDNA2
"(Snodin)"_#oxdna2 bond style the analogous pair styles and an
additional Debye-Hueckel pair style {oxdna2/dh} have to be defined.
The coefficients in the above example have to be kept fixed and cannot
be changed without reparametrizing the entire model.
Example input and data files for DNA duplexes can be found in examples/USER/cgdna/examples/oxDNA/ and /oxDNA2/.
A simple python setup tool which creates single straight or helical DNA strands,
DNA duplexes or arrays of DNA duplexes can be found in examples/USER/cgdna/util/.
Example input and data files for DNA duplexes can be found in
examples/USER/cgdna/examples/oxDNA/ and /oxDNA2/. A simple python
setup tool which creates single straight or helical DNA strands, DNA
duplexes or arrays of DNA duplexes can be found in
examples/USER/cgdna/util/.
Please cite "(Henrich)"_#Henrich2 and the relevant oxDNA articles in any publication that uses this implementation.
The article contains more information on the model, the structure of the input file, the setup tool
and the performance of the LAMMPS-implementation of oxDNA.
The preprint version of the article can be found "here"_PDF/USER-CGDNA.pdf.
Please cite "(Henrich)"_#Henrich2 and the relevant oxDNA articles in
any publication that uses this implementation. The article contains
more information on the model, the structure of the input file, the
setup tool and the performance of the LAMMPS-implementation of oxDNA.
The preprint version of the article can be found
"here"_PDF/USER-CGDNA.pdf.
:line
@ -65,20 +75,25 @@ This bond style can only be used if LAMMPS was built with the
USER-CGDNA package and the MOLECULE and ASPHERE package. See the
"Build package"_Build_package.html doc page for more info.
[Related commands:]
"pair_style oxdna/excv"_pair_oxdna.html, "pair_style oxdna2/excv"_pair_oxdna2.html, "fix nve/dotc/langevin"_fix_nve_dotc_langevin.html, "bond_coeff"_bond_coeff.html
"pair_style oxdna/excv"_pair_oxdna.html, "pair_style
oxdna2/excv"_pair_oxdna2.html, "fix
nve/dotc/langevin"_fix_nve_dotc_langevin.html,
"bond_coeff"_bond_coeff.html
[Default:] none
:line
:link(Henrich2)
[(Henrich)] O. Henrich, Y. A. Gutierrez-Fosado, T. Curk, T. E. Ouldridge, Eur. Phys. J. E 41, 57 (2018).
[(Henrich)] O. Henrich, Y. A. Gutierrez-Fosado, T. Curk,
T. E. Ouldridge, Eur. Phys. J. E 41, 57 (2018).
:link(oxdna_fene)
[(Ouldridge)] T.E. Ouldridge, A.A. Louis, J.P.K. Doye, J. Chem. Phys. 134, 085101 (2011).
[(Ouldridge)] T.E. Ouldridge, A.A. Louis, J.P.K. Doye,
J. Chem. Phys. 134, 085101 (2011).
:link(oxdna2)
[(Snodin)] B.E. Snodin, F. Randisi, M. Mosayebi, et al., J. Chem. Phys. 142, 234901 (2015).
[(Snodin)] B.E. Snodin, F. Randisi, M. Mosayebi, et al.,
J. Chem. Phys. 142, 234901 (2015).

View File

@ -69,18 +69,23 @@ Note that there are also additional bond styles submitted by users
which are included in the LAMMPS distribution. The full list of all
bond styles is on the "Commands bond"_Commands_bond.html doc page.
"bond_style none"_bond_none.html - turn off bonded interactions
"bond_style zero"_bond_zero.html - topology but no interactions
"bond_style hybrid"_bond_hybrid.html - define multiple styles of bond interactions :ul
"none"_bond_none.html - turn off bonded interactions
"zero"_bond_zero.html - topology but no interactions
"hybrid"_bond_hybrid.html - define multiple styles of bond interactions :ul
"bond_style class2"_bond_class2.html - COMPASS (class 2) bond
"bond_style fene"_bond_fene.html - FENE (finite-extensible non-linear elastic) bond
"bond_style fene/expand"_bond_fene_expand.html - FENE bonds with variable size particles
"bond_style harmonic"_bond_harmonic.html - harmonic bond
"bond_style morse"_bond_morse.html - Morse bond
"bond_style nonlinear"_bond_nonlinear.html - nonlinear bond
"bond_style quartic"_bond_quartic.html - breakable quartic bond
"bond_style table"_bond_table.html - tabulated by bond length :ul
"class2"_bond_class2.html - COMPASS (class 2) bond
"fene"_bond_fene.html - FENE (finite-extensible non-linear elastic) bond
"fene/expand"_bond_fene_expand.html - FENE bonds with variable size particles
"gromos"_bond_gromos.html - GROMOS force field bond
"harmonic"_bond_harmonic.html - harmonic bond
"harmonic/shift"_bond_harmonic_shift.html - shifted harmonic bond
"harmonic/shift/cut"_bond_harmonic_shift_cut.html - shifted harmonic bond with a cutoff
"morse"_bond_morse.html - Morse bond
"nonlinear"_bond_nonlinear.html - nonlinear bond
"oxdna/fene"_bond_oxdna.html - modified FENE bond suitable for DNA modeling
"oxdna2/fene"_bond_oxdna.html - same as oxdna but used with different pair styles
"quartic"_bond_quartic.html - breakable quartic bond
"table"_bond_table.html - tabulated by bond length :ul
:line

View File

@ -175,9 +175,13 @@ The individual style names on the "Commands
compute"_Commands_compute.html doc page are followed by one or more of
(g,i,k,o,t) to indicate which accelerated styles exist.
"ackland/atom"_compute_ackland_atom.html -
"aggregate/atom"_compute_cluster_atom.html - aggregate ID for each atom
"angle"_compute_angle.html -
"angle/local"_compute_angle_local.html -
"angle/local"_compute_bond_local.html - theta and energy of each angle
"angmom/chunk"_compute_angmom_chunk.html - angular momentum for each chunk
"basal/atom"_compute_basal_atom.html -
"body/local"_compute_body_local.html - attributes of body sub-particles
"bond"_compute_bond.html - values computed by a bond style
"bond/local"_compute_bond_local.html - distance and energy of each bond
@ -186,30 +190,48 @@ compute"_Commands_compute.html doc page are followed by one or more of
"chunk/spread/atom"_compute_chunk_spread_atom.html - spreads chunk values to each atom in chunk
"cluster/atom"_compute_cluster_atom.html - cluster ID for each atom
"cna/atom"_compute_cna_atom.html - common neighbor analysis (CNA) for each atom
"cnp/atom"_compute_cnp_atom.html -
"com"_compute_com.html - center-of-mass of group of atoms
"com/chunk"_compute_com_chunk.html - center-of-mass for each chunk
"contact/atom"_compute_contact_atom.html - contact count for each spherical particle
"coord/atom"_compute_coord_atom.html - coordination number for each atom
"damage/atom"_compute_damage_atom.html - Peridynamic damage for each atom
"dihedral"_compute_dihedral.html -
"dihedral/local"_compute_dihedral_local.html - angle of each dihedral
"dilatation/atom"_compute_dilatation_atom.html - Peridynamic dilatation for each atom
"dipole/chunk"_compute_dipole_chunk.html -
"displace/atom"_compute_displace_atom.html - displacement of each atom
"dpd"_compute_dpd.html -
"dpd/atom"_compute_dpd_atom.html -
"edpd/temp/atom"_compute_edpd_temp_atom.html -
"entropy/atom"_compute_entropy_atom.html -
"erotate/asphere"_compute_erotate_asphere.html - rotational energy of aspherical particles
"erotate/rigid"_compute_erotate_rigid.html - rotational energy of rigid bodies
"erotate/sphere"_compute_erotate_sphere.html - rotational energy of spherical particles
"erotate/sphere/atom"_compute_erotate_sphere.html - rotational energy for each spherical particle
"erotate/sphere/atom"_compute_erotate_sphere_atom.html -
"event/displace"_compute_event_displace.html - detect event on atom displacement
"fep"_compute_fep.html -
"force/tally"_compute_tally.html -
"fragment/atom"_compute_cluster_atom.html - fragment ID for each atom
"global/atom"_compute_global_atom.html -
"group/group"_compute_group_group.html - energy/force between two groups of atoms
"gyration"_compute_gyration.html - radius of gyration of group of atoms
"gyration/chunk"_compute_gyration_chunk.html - radius of gyration for each chunk
"heat/flux"_compute_heat_flux.html - heat flux through a group of atoms
"heat/flux/tally"_compute_tally.html -
"hexorder/atom"_compute_hexorder_atom.html - bond orientational order parameter q6
"improper"_compute_improper.html -
"improper/local"_compute_improper_local.html - angle of each improper
"inertia/chunk"_compute_inertia_chunk.html - inertia tensor for each chunk
"ke"_compute_ke.html - translational kinetic energy
"ke/atom"_compute_ke_atom.html - kinetic energy for each atom
"ke/atom/eff"_compute_ke_atom_eff.html -
"ke/eff"_compute_ke_eff.html -
"ke/rigid"_compute_ke_rigid.html - translational kinetic energy of rigid bodies
"meso/e/atom"_compute_meso_e_atom.html -
"meso/rho/atom"_compute_meso_rho_atom.html -
"meso/t/atom"_compute_meso_t_atom.html -
"msd"_compute_msd.html - mean-squared displacement of group of atoms
"msd/chunk"_compute_msd_chunk.html - mean-squared displacement for each chunk
"msd/nongauss"_compute_msd_nongauss.html - MSD and non-Gaussian parameter of group of atoms
@ -219,37 +241,77 @@ compute"_Commands_compute.html doc page are followed by one or more of
"pair/local"_compute_pair_local.html - distance/energy/force of each pairwise interaction
"pe"_compute_pe.html - potential energy
"pe/atom"_compute_pe_atom.html - potential energy for each atom
"pe/mol/tally"_compute_tally.html -
"pe/tally"_compute_tally.html -
"plasticity/atom"_compute_plasticity_atom.html - Peridynamic plasticity for each atom
"pressure"_compute_pressure.html - total pressure and pressure tensor
"pressure/cylinder"_compute_pressure_cylinder.html -
"pressure/uef"_compute_pressure_uef.html -
"property/atom"_compute_property_atom.html - convert atom attributes to per-atom vectors/arrays
"property/local"_compute_property_local.html - convert local attributes to localvectors/arrays
"property/chunk"_compute_property_chunk.html - extract various per-chunk attributes
"property/local"_compute_property_local.html - convert local attributes to localvectors/arrays
"ptm/atom"_compute_ptm_atom.html -
"rdf"_compute_rdf.html - radial distribution function g(r) histogram of group of atoms
"reduce"_compute_reduce.html - combine per-atom quantities into a single global value
"reduce/chunk"_compute_reduce_chunk.html - reduce per-atom quantities within each chunk
"reduce/region"_compute_reduce.html - same as compute reduce, within a region
"rigid/local"_compute_rigid_local.html - extract rigid body attributes
"saed"_compute_saed.html -
"slice"_compute_slice.html - extract values from global vector or array
"smd/contact/radius"_compute_smd_contact_radius.html -
"smd/damage"_compute_smd_damage.html -
"smd/hourglass/error"_compute_smd_hourglass_error.html -
"smd/internal/energy"_compute_smd_internal_energy.html -
"smd/plastic/strain"_compute_smd_plastic_strain.html -
"smd/plastic/strain/rate"_compute_smd_plastic_strain_rate.html -
"smd/rho"_compute_smd_rho.html -
"smd/tlsph/defgrad"_compute_smd_tlsph_defgrad.html -
"smd/tlsph/dt"_compute_smd_tlsph_dt.html -
"smd/tlsph/num/neighs"_compute_smd_tlsph_num_neighs.html -
"smd/tlsph/shape"_compute_smd_tlsph_shape.html -
"smd/tlsph/strain"_compute_smd_tlsph_strain.html -
"smd/tlsph/strain/rate"_compute_smd_tlsph_strain_rate.html -
"smd/tlsph/stress"_compute_smd_tlsph_stress.html -
"smd/triangle/vertices"_compute_smd_triangle_vertices.html -
"smd/triangle/vertices"_compute_smd_triangle_vertices.html -
"smd/ulsph/num/neighs"_compute_smd_ulsph_num_neighs.html -
"smd/ulsph/strain"_compute_smd_ulsph_strain.html -
"smd/ulsph/strain/rate"_compute_smd_ulsph_strain_rate.html -
"smd/ulsph/stress"_compute_smd_ulsph_stress.html -
"smd/vol"_compute_smd_vol.html -
"sna/atom"_compute_sna_atom.html - calculate bispectrum coefficients for each atom
"snad/atom"_compute_sna_atom.html - derivative of bispectrum coefficients for each atom
"snav/atom"_compute_sna_atom.html - virial contribution from bispectrum coefficients for each atom
"spin"_compute_spin.html -
"stress/atom"_compute_stress_atom.html - stress tensor for each atom
"stress/mop"_compute_stress_mop.html -
"stress/mop/profile"_compute_stress_mop.html -
"stress/tally"_compute_tally.html -
"tdpd/cc/atom"_compute_tdpd_cc_atom.html -
"temp"_compute_temp.html - temperature of group of atoms
"temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles
"temp/body"_compute_temp_body.html - temperature of body particles
"temp/chunk"_compute_temp_chunk.html - temperature of each chunk
"temp/com"_compute_temp_com.html - temperature after subtracting center-of-mass velocity
"temp/cs"_compute_temp_cs.html -
"temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity
"temp/deform/eff"_compute_temp_deform_eff.html -
"temp/drude"_compute_temp_drude.html -
"temp/eff"_compute_temp_eff.html -
"temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity
"temp/profile"_compute_temp_profile.html - temperature excluding a binned velocity profile
"temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component
"temp/region"_compute_temp_region.html - temperature of a region of atoms
"temp/region/eff"_compute_temp_region_eff.html -
"temp/rotate"_compute_temp_rotate.html -
"temp/sphere"_compute_temp_sphere.html - temperature of spherical particles
"temp/uef"_compute_temp_uef.html -
"ti"_compute_ti.html - thermodynamic integration free energy values
"torque/chunk"_compute_torque_chunk.html - torque applied on each chunk
"vacf"_compute_vacf.html - velocity-autocorrelation function of group of atoms
"vcm/chunk"_compute_vcm_chunk.html - velocity of center-of-mass for each chunk
"voronoi/atom"_compute_voronoi_atom.html - Voronoi volume and neighbors for each atom :ul
"voronoi/atom"_compute_voronoi_atom.html - Voronoi volume and neighbors for each atom
"xrd"_compute_xrd.html - :ul
[Restrictions:] none

213
doc/src/compute_adf.txt Normal file
View File

@ -0,0 +1,213 @@
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)
:line
compute adf command :h3
[Syntax:]
compute ID group-ID adf Nbin itype1 jtype1 ktype1 Rjinner1 Rjouter1 Rkinner1 Rkouter1 ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
adf = style name of this compute command :l
Nbin = number of ADF bins :l
itypeN = central atom type for Nth ADF histogram (see asterisk form below) :l
jtypeN = J atom type for Nth ADF histogram (see asterisk form below) :l
ktypeN = K atom type for Nth ADF histogram (see asterisk form below) :l
RjinnerN = inner radius of J atom shell for Nth ADF histogram (distance units) :l
RjouterN = outer radius of J atom shell for Nth ADF histogram (distance units) :l
RkinnerN = inner radius of K atom shell for Nth ADF histogram (distance units) :l
RkouterN = outer radius of K atom shell for Nth ADF histogram (distance units) :l
zero or one keyword/value pairs may be appended :l
keyword = {ordinate} :l
{ordinate} value = {degree} or {radian} or {cosine}
Choose the ordinate parameter for the histogram :pre
:ule
[Examples:]
compute 1 fluid adf 32 1 1 1 0.0 1.2 0.0 1.2 &
1 1 2 0.0 1.2 0.0 1.5 &
1 2 2 0.0 1.5 0.0 1.5 &
2 1 1 0.0 1.2 0.0 1.2 &
2 1 2 0.0 1.5 2.0 3.5 &
2 2 2 2.0 3.5 2.0 3.5
compute 1 fluid adf 32 1*2 1*2 1*2 0.5 3.5
compute 1 fluid adf 32 :pre
[Description:]
Define a computation that calculates one or more angular distribution functions
(ADF) for a group of particles. Each ADF is calculated in histogram form
by measuring the angle formed by a central atom and two neighbor atoms and
binning these angles into {Nbin} bins.
Only neighbors for which {Rinner} < {R} < {Router} are counted, where
{Rinner} and {Router} are specified separately for the first and second
neighbor atom in each requested ADF.
NOTE: If you have a bonded system, then the settings of
"special_bonds"_special_bonds.html command can remove pairwise
interactions between atoms in the same bond, angle, or dihedral. This
is the default setting for the "special_bonds"_special_bonds.html
command, and means those pairwise interactions do not appear in the
neighbor list. Because this fix uses a neighbor list, it also means
those pairs will not be included in the ADF. This does not apply when
using long-range coulomb interactions ({coul/long}, {coul/msm},
{coul/wolf} or similar. One way to get around this would be to set
special_bond scaling factors to very tiny numbers that are not exactly
zero (e.g. 1.0e-50). Another workaround is to write a dump file, and
use the "rerun"_rerun.html command to compute the ADF for snapshots in
the dump file. The rerun script can use a
"special_bonds"_special_bonds.html command that includes all pairs in
the neighbor list.
NOTE: If you request any outer cutoff {Router} > force cutoff, or if no
pair style is defined, e.g. the "rerun"_rerun.html command is being used to
post-process a dump file of snapshots you must insure ghost atom information
out to the largest value of {Router} + {skin} is communicated, via the
"comm_modify cutoff"_comm_modify.html command, else the ADF computation
cannot be performed, and LAMMPS will give an error message. The {skin} value
is what is specified with the "neighbor"_neighbor.html command.
The {itypeN},{jtypeN},{ktypeN} settings can be specified in one of two
ways. An explicit numeric value can be used, as in the 1st example
above. Or a wild-card asterisk can be used to specify a range of atom
types as in the 2nd example above.
This takes the form "*" or "*n" or "n*" or "m*n". If N = the
number of atom types, then an asterisk with no numeric values means
all types from 1 to N. A leading asterisk means all types from 1 to n
(inclusive). A trailing asterisk means all types from n to N
(inclusive). A middle asterisk means all types from m to n
(inclusive).
If {itypeN}, {jtypeN}, and {ktypeN} are single values, as in the 1st example
above, this means that the ADF is computed where atoms of type {itypeN}
are the central atom, and neighbor atoms of type {jtypeN} and {ktypeN}
are forming the angle. If any of {itypeN}, {jtypeN}, or {ktypeN}
represent a range of values via
the wild-card asterisk, as in the 2nd example above, this means that the
ADF is computed where atoms of any of the range of types represented
by {itypeN} are the central atom, and the angle is formed by two neighbors,
one neighbor in the range of types represented by {jtypeN} and another neighbor
in the range of types represented by {ktypeN}.
If no {itypeN}, {jtypeN}, {ktypeN} settings are specified, then
LAMMPS will generate a single ADF for all atoms in the group.
The inner cutoff is set to zero and the outer cutoff is set
to the force cutoff. If no pair_style is specified, there is no
force cutoff and LAMMPS will give an error message. Note that
in most cases, generating an ADF for all atoms is not a good thing.
Such an ADF is both uninformative and
extremely expensive to compute. For example, with liquid water
with a 10 A force cutoff, there are 80,000 angles per atom.
In addition, most of the interesting angular structure occurs for
neighbors that are the closest to the central atom, involving
just a few dozen angles.
Angles for each ADF are generated by double-looping over the list of
neighbors of each central atom I,
just as they would be in the force calculation for
a threebody potential such as "Stillinger-Weber"_pair_sw.html.
The angle formed by central atom I and neighbor atoms J and K is included in an
ADF if the following criteria are met:
atoms I,J,K are all in the specified compute group
the distance between atoms I,J is between Rjinner and Rjouter
the distance between atoms I,K is between Rkinner and Rkouter
the type of the I atom matches itypeN (one or a range of types)
atoms I,J,K are distinct
the type of the J atom matches jtypeN (one or a range of types)
the type of the K atom matches ktypeN (one or a range of types) :ul
Each unique angle satisfying the above criteria is counted only once, regardless
of whether either or both of the neighbor atoms making up the
angle appear in both the J and K lists.
It is OK if a particular angle is included in more than
one individual histogram, due to the way the {itypeN}, {jtypeN}, {ktypeN}
arguments are specified.
The first ADF value for a bin is calculated from the histogram count by
dividing by the total number of triples satisfying the criteria,
so that the integral of the ADF w.r.t. angle is 1, i.e. the ADF
is a probability density function.
The second ADF value is reported as a cumulative sum of
all bins up to the current bins, averaged
over atoms of type {itypeN}. It represents the
number of angles per central atom with angle less
than or equal to the angle of the current bin,
analogous to the coordination
number radial distribution function.
The {ordinate} optional keyword determines
whether the bins are of uniform angular size from zero
to 180 ({degree}), zero to Pi ({radian}), or the
cosine of the angle uniform in the range \[-1,1\] ({cosine}).
{cosine} has the advantage of eliminating the {acos()} function
call, which speeds up the compute by 2-3x, and it is also preferred
on physical grounds, because the for uniformly distributed particles
in 3D, the angular probability density w.r.t dtheta is
sin(theta)/2, while for d(cos(theta)), it is 1/2,
Regardless of which ordinate is chosen, the first column of ADF
values is normalized w.r.t. the range of that ordinate, so that
the integral is 1.
The simplest way to output the results of the compute adf calculation
to a file is to use the "fix ave/time"_fix_ave_time.html command, for
example:
compute myADF all adf 32 2 2 2 0.5 3.5 0.5 3.5
fix 1 all ave/time 100 1 100 c_myADF\[*\] file tmp.adf mode vector :pre
[Output info:]
This compute calculates a global array with the number of rows =
{Nbins}, and the number of columns = 1 + 2*Ntriples, where Ntriples is the
number of I,J,K triples specified. The first column has the bin
coordinate (angle-related ordinate at midpoint of bin). Each subsequent column has
the two ADF values for a specific set of ({itypeN},{jtypeN},{ktypeN})
interactions, as described above. These values can be used
by any command that uses a global values from a compute as input. See
the "Howto output"_Howto_output.html doc page for an overview of
LAMMPS output options.
The array values calculated by this compute are all "intensive".
The first column of array values is the angle-related ordinate, either
the angle in degrees or radians, or the cosine of the angle. Each
subsequent pair of columns gives the first and second kinds of ADF
for a specific set of ({itypeN},{jtypeN},{ktypeN}). The values
in the first ADF column are normalized numbers >= 0.0,
whose integral w.r.t. the ordinate is 1,
i.e. the first ADF is a normalized probability distribution.
The values in the second ADF column are also numbers >= 0.0.
They are the cumulative density distribution of angles per atom.
By definition, this ADF is monotonically increasing from zero to
a maximum value equal to the average total number of
angles per atom satisfying the ADF criteria.
[Restrictions:]
The ADF is not computed for neighbors outside the force cutoff,
since processors (in parallel) don't know about atom coordinates for
atoms further away than that distance. If you want an ADF for larger
distances, you can use the "rerun"_rerun.html command to post-process
a dump file and set the cutoff for the potential to be longer in the
rerun script. Note that in the rerun context, the force cutoff is
arbitrary, since you aren't running dynamics and thus are not changing
your model.
[Related commands:]
"compute rdf"_compute_rdf.html, "fix ave/time"_fix_ave_time.html, "compute_modify"_compute_modify.html
[Default:]
The keyword default is ordinate = degree.

View File

@ -191,7 +191,8 @@ via "compute_modify dynamic yes"_compute_modify.html
[Related commands:]
"fix ave/time"_fix_ave_time.html, "compute_modify"_compute_modify.html
"fix ave/time"_fix_ave_time.html, "compute_modify"_compute_modify.html,
"compute adf"_compute_adf.html
[Default:]

View File

@ -6,6 +6,7 @@ Computes :h1
:maxdepth: 1
compute_ackland_atom
compute_adf
compute_angle
compute_angle_local
compute_angmom_chunk

View File

@ -85,16 +85,24 @@ which are included in the LAMMPS distribution. The full list of all
dihedral styles is on the "Commands bond"_Commands_bond.html#dihedral
doc page.
"dihedral_style none"_dihedral_none.html - turn off dihedral interactions
"dihedral_style zero"_dihedral_zero.html - topology but no interactions
"dihedral_style hybrid"_dihedral_hybrid.html - define multiple styles of dihedral interactions :ul
"none"_dihedral_none.html - turn off dihedral interactions
"zero"_dihedral_zero.html - topology but no interactions
"hybrid"_dihedral_hybrid.html - define multiple styles of dihedral interactions :ul
"dihedral_style charmm"_dihedral_charmm.html - CHARMM dihedral
"dihedral_style class2"_dihedral_class2.html - COMPASS (class 2) dihedral
"dihedral_style harmonic"_dihedral_harmonic.html - harmonic dihedral
"dihedral_style helix"_dihedral_helix.html - helix dihedral
"dihedral_style multi/harmonic"_dihedral_multi_harmonic.html - multi-harmonic dihedral
"dihedral_style opls"_dihedral_opls.html - OPLS dihedral :ul
"charmm"_dihedral_charmm.html - CHARMM dihedral
"charmmfsw"_dihedral_charmm.html - CHARMM dihedral with force switching
"class2"_dihedral_class2.html - COMPASS (class 2) dihedral
"cosine/shift/exp"_dihedral_cosine_shift_exp.html - dihedral with exponential in spring constant
"fourier"_dihedral_fourier.html - dihedral with multiple cosine terms
"harmonic"_dihedral_harmonic.html - harmonic dihedral
"helix"_dihedral_helix.html - helix dihedral
"multi/harmonic"_dihedral_multi_harmonic.html - dihedral with 5 harmonic terms
"nharmonic"_dihedral_nharmonic.html - same as multi-harmonic with N terms
"opls"_dihedral_opls.html - OPLS dihedral
"quadratic"_dihedral_quadratic.html - dihedral with quadratic term in angle
"spherical"_dihedral_spherical.html - dihedral which includes angle terms to avoid singularities
"table"_dihedral_table.html - tabulated dihedral
"table/cut"_dihedral_table_cut.html - tabulated dihedral with analytic cutoff :ul
:line

View File

@ -50,7 +50,7 @@ dump h5md1 all h5md 100 dump_h5md.h5 velocity author "John Doe" :pre
[Description:]
Dump a snapshot of atom coordinates every N timesteps in the
"HDF5"_HDF5_ws based "H5MD"_h5md file format "(de Buyl)"_#h5md_cpc.
"HDF5"_HDF5-ws based "H5MD"_h5md file format "(de Buyl)"_#h5md_cpc.
HDF5 files are binary, portable and self-describing. This dump style
will write only one file, on the root node.
@ -102,11 +102,11 @@ enabled if LAMMPS was built with that package. See the "Build
package"_Build_package.html doc page for more info. It also requires
(i) building the ch5md library provided with LAMMPS (See the "Build
package"_Build_package.html doc page for more info.) and (ii) having
the "HDF5"_HDF5_ws library installed (C bindings are sufficient) on
the "HDF5"_HDF5-ws library installed (C bindings are sufficient) on
your system. The library ch5md is compiled with the h5cc wrapper
provided by the HDF5 library.
:link(HDF5_ws,http://www.hdfgroup.org/HDF5/)
:link(HDF5-ws,http://www.hdfgroup.org/HDF5/)
:line

View File

@ -167,136 +167,211 @@ page are followed by one or more of (g,i,k,o,t) to indicate which
accelerated styles exist.
"adapt"_fix_adapt.html - change a simulation parameter over time
"adapt/fep"_fix_adapt_fep.html -
"addforce"_fix_addforce.html - add a force to each atom
"addtorque"_fix_addtorque.html -
"append/atoms"_fix_append_atoms.html - append atoms to a running simulation
"atc"_fix_atc.html -
"atom/swap"_fix_atom_swap.html - Monte Carlo atom type swapping
"aveforce"_fix_aveforce.html - add an averaged force to each atom
"ave/atom"_fix_ave_atom.html - compute per-atom time-averaged quantities
"ave/chunk"_fix_ave_chunk.html - compute per-chunk time-averaged quantities
"ave/correlate"_fix_ave_correlate.html - compute/output time correlations
"ave/correlate/long"_fix_ave_correlate_long.html -
"ave/histo"_fix_ave_histo.html - compute/output time-averaged histograms
"ave/histo/weight"_fix_ave_histo.html -
"ave/time"_fix_ave_time.html - compute/output global time-averaged quantities
"aveforce"_fix_aveforce.html - add an averaged force to each atom
"balance"_fix_balance.html - perform dynamic load-balancing
"bocs"_fix_bocs.html -
"bond/break"_fix_bond_break.html - break bonds on the fly
"bond/create"_fix_bond_create.html - create bonds on the fly
"bond/react"_fix_bond_react.html -
"bond/swap"_fix_bond_swap.html - Monte Carlo bond swapping
"box/relax"_fix_box_relax.html - relax box size during energy minimization
"client/md"_fix_client_md.html -
"cmap"_fix_cmap.html -
"colvars"_fix_colvars.html -
"controller"_fix_controller.html -
"deform"_fix_deform.html - change the simulation box size/shape
"deposit"_fix_deposit.html - add new atoms above a surface
"dpd/energy"_fix_dpd_energy.html -
"drag"_fix_drag.html - drag atoms towards a defined coordinate
"drude"_fix_drude.html -
"drude/transform/direct"_fix_drude_transform.html -
"drude/transform/inverse"_fix_drude_transform.html -
"dt/reset"_fix_dt_reset.html - reset the timestep based on velocity, forces
"edpd/source"_fix_dpd_source.html -
"efield"_fix_efield.html - impose electric field on system
"ehex"_fix_ehex.html - ehanced heat exchange algorithm
"enforce2d"_fix_enforce2d.html - zero out z-dimension velocity and force
"eos/cv"_fix_eos_cv.html -
"eos/table"_fix_eos_table.html -
"eos/table/rx"_fix_eos_table_rx.html -
"evaporate"_fix_evaporate.html - remove atoms from simulation periodically
"external"_fix_external.html - callback to an external driver program
"ffl"_fix_ffl.html -
"filter/corotate"_fix_filter_corotate.html -
"flow/gauss"_fix_flow_gauss.html -
"freeze"_fix_freeze.html - freeze atoms in a granular simulation
"gcmc"_fix_gcmc.html - grand canonical insertions/deletions
"gld"_fix_gcmc.html - generalized Langevin dynamics integrator
"gld"_fix_gld.html -
"gle"_fix_gle.html -
"gravity"_fix_gravity.html - add gravity to atoms in a granular simulation
"grem"_fix_grem.html -
"halt"_fix_halt.html - terminate a dynamics run or minimization
"heat"_fix_heat.html - add/subtract momentum-conserving heat
"imd"_fix_imd.html -
"indent"_fix_indent.html - impose force due to an indenter
"latte"_fix_latte.html - wrapper on LATTE density-functional tight-binding code
"ipi"_fix_ipi.html -
"langevin"_fix_langevin.html - Langevin temperature control
"langevin/drude"_fix_langevin_drude.html -
"langevin/eff"_fix_langevin_eff.html -
"langevin/spin"_fix_langevin_spin.html -
"latte"_fix_latte.html - wrapper on LATTE density-functional tight-binding code
"lb/fluid"_fix_lb_fluid.html -
"lb/momentum"_fix_lb_momentum.html -
"lb/pc"_fix_lb_pc.html -
"lb/rigid/pc/sphere"_fix_lb_rigid_pc_sphere.html -
"lb/viscous"_fix_lb_viscous.html -
"lineforce"_fix_lineforce.html - constrain atoms to move in a line
"manifoldforce"_fix_manifoldforce.html -
"meso"_fix_meso.html -
"meso/stationary"_fix_meso_stationary.html -
"momentum"_fix_momentum.html - zero the linear and/or angular momentum of a group of atoms
"move"_fix_move.html - move atoms in a prescribed fashion
"mscg"_fix_mscg.html -
"msst"_fix_msst.html - multi-scale shock technique (MSST) integration
"mvv/dpd"_fix_mvv_dpd.html -
"mvv/edpd"_fix_mvv_dpd.html -
"mvv/tdpd"_fix_mvv_dpd.html -
"neb"_fix_neb.html - nudged elastic band (NEB) spring forces
"nph"_fix_nh.html - constant NPH time integration via Nose/Hoover
"nphug"_fix_nphug.html - constant-stress Hugoniostat integration
"nph/asphere"_fix_nph_asphere.html - NPH for aspherical particles
"nph/body"_fix_nph_body.html -
"nph/body"_fix_nve_body.html - NPH for body particles
"nph/eff"_fix_nh_eff.html -
"nph/sphere"_fix_nph_sphere.html - NPH for spherical particles
"nphug"_fix_nphug.html - constant-stress Hugoniostat integration
"npt"_fix_nh.html - constant NPT time integration via Nose/Hoover
"npt/asphere"_fix_npt_asphere.html - NPT for aspherical particles
"npt/body"_fix_npt_body.html -
"npt/body"_fix_nve_body.html - NPT for body particles
"npt/eff"_fix_nh_eff.html -
"npt/sphere"_fix_npt_sphere.html - NPT for spherical particles
"npt/uef"_fix_nh_uef.html -
"nve"_fix_nve.html - constant NVE time integration
"nve/asphere"_fix_nve_asphere.html - NVE for aspherical particles
"nve/asphere/noforce"_fix_nve_asphere_noforce.html - NVE for aspherical particles without forces"
"nve/awpmd"_fix_nve_awpmd.html -
"nve/body"_fix_nve_body.html - NVE for body particles
"nve/dot"_fix_nve_dot.html -
"nve/dotc/langevin"_fix_nve_dotc_langevin.html -
"nve/eff"_fix_nve_eff.html -
"nve/limit"_fix_nve_limit.html - NVE with limited step length
"nve/line"_fix_nve_line.html - NVE for line segments
"nve/manifold/rattle"_fix_nve_manifold_rattle.html -
"nve/noforce"_fix_nve_noforce.html - NVE without forces (v only)
"nve/sphere"_fix_nve_sphere.html - NVE for spherical particles
"nve/spin"_fix_nve_spin.html -
"nve/tri"_fix_nve_tri.html - NVE for triangles
"nvk"_fix_nvk.html -
"nvt"_fix_nh.html - constant NVT time integration via Nose/Hoover
"nvt/asphere"_fix_nvt_asphere.html - NVT for aspherical particles
"nvt/body"_fix_nve_body.html - NVT for body particles
"nvt/body"_fix_nvt_body.html -
"nvt/eff"_fix_nh_eff.html -
"nvt/manifold/rattle"_fix_nvt_manifold_rattle.html -
"nvt/sllod"_fix_nvt_sllod.html - NVT for NEMD with SLLOD equations
"nvt/sllod/eff"_fix_nvt_sllod_eff.html -
"nvt/sphere"_fix_nvt_sphere.html - NVT for spherical particles
"nvt/uef"_fix_nh_uef.html -
"oneway"_fix_oneway.html - constrain particles on move in one direction
"orient/bcc"_fix_orient.html - add grain boundary migration force for BCC
"orient/fcc"_fix_orient.html - add grain boundary migration force for FCC
"phonon"_fix_phonon.html -
"pimd"_fix_pimd.html -
"planeforce"_fix_planeforce.html - constrain atoms to move in a plane
"poems"_fix_poems.html - constrain clusters of atoms to move \
as coupled rigid bodies
"poems"_fix_poems.html - constrain clusters of atoms to move as coupled rigid bodies
"pour"_fix_pour.html - pour new atoms/molecules into a granular simulation domain
"press/berendsen"_fix_press_berendsen.html - pressure control by \
Berendsen barostat
"precession/spin"_fix_precession_spin.html -
"press/berendsen"_fix_press_berendsen.html - pressure control by Berendsen barostat
"print"_fix_print.html - print text and variables during a simulation
"property/atom"_fix_property_atom.html - add customized per-atom values
"qeq/comb"_fix_qeq_comb.html - charge equilibration for COMB potential \
"qeq/dynamic"_fix_qeq.html - charge equilibration via dynamic method \
"qeq/fire"_fix_qeq.html - charge equilibration via FIRE minimizer \
"qeq/point"_fix_qeq.html - charge equilibration via point method \
"qeq/shielded"_fix_qeq.html - charge equilibration via shielded method \
"qeq/slater"_fix_qeq.html - charge equilibration via Slater method \
"python/invoke"_fix_python_invoke.html -
"python/move"_fix_python_move.html -
"qbmsst"_fix_qbmsst.html -
"qeq/comb"_fix_qeq_comb.html - charge equilibration for COMB potential
"qeq/dynamic"_fix_qeq.html - charge equilibration via dynamic method
"qeq/fire"_fix_qeq.html - charge equilibration via FIRE minimizer
"qeq/point"_fix_qeq.html - charge equilibration via point method
"qeq/reax"_fix_qeq_reax.html -
"qeq/shielded"_fix_qeq.html - charge equilibration via shielded method
"qeq/slater"_fix_qeq.html - charge equilibration via Slater method
"qmmm"_fix_qmmm.html -
"qtb"_fix_qtb.html -
"rattle"_fix_shake.html - RATTLE constraints on bonds and/or angles
"reax/bonds"_fix_reax_bonds.html - write out ReaxFF bond information \
"recenter"_fix_recenter.html - constrain the center-of-mass position \
of a group of atoms
"reax/bonds"_fix_reax_bonds.html - write out ReaxFF bond information
"reax/c/bonds"_fix_reax_bonds.html -
"reax/c/species"_fix_reaxc_species.html -
"recenter"_fix_recenter.html - constrain the center-of-mass position of a group of atoms
"restrain"_fix_restrain.html - constrain a bond, angle, dihedral
"rigid"_fix_rigid.html - constrain one or more clusters of atoms to \
move as a rigid body with NVE integration
"rigid/nph"_fix_rigid.html - constrain one or more clusters of atoms to \
move as a rigid body with NPH integration
"rigid/npt"_fix_rigid.html - constrain one or more clusters of atoms to \
move as a rigid body with NPT integration
"rigid/nve"_fix_rigid.html - constrain one or more clusters of atoms to \
move as a rigid body with alternate NVE integration
"rigid/nvt"_fix_rigid.html - constrain one or more clusters of atoms to \
move as a rigid body with NVT integration
"rigid/small"_fix_rigid.html - constrain many small clusters of atoms to \
move as a rigid body with NVE integration
"rigid/small/nph"_fix_rigid.html - constrain many small clusters of atoms to \
move as a rigid body with NPH integration
"rigid/small/npt"_fix_rigid.html - constrain many small clusters of atoms to \
move as a rigid body with NPT integration
"rigid/small/nve"_fix_rigid.html - constrain many small clusters of atoms to \
move as a rigid body with alternate NVE integration
"rigid/small/nvt"_fix_rigid.html - constrain many small clusters of atoms to \
move as a rigid body with NVT integration
"rhok"_fix_rhok.html -
"rigid"_fix_rigid.html - constrain one or more clusters of atoms to move as a rigid body with NVE integration
"rigid/nph"_fix_rigid.html - constrain one or more clusters of atoms to move as a rigid body with NPH integration
"rigid/nph/small"_fix_rigid.html -
"rigid/npt"_fix_rigid.html - constrain one or more clusters of atoms to move as a rigid body with NPT integration
"rigid/npt/small"_fix_rigid.html -
"rigid/nve"_fix_rigid.html - constrain one or more clusters of atoms to move as a rigid body with alternate NVE integration
"rigid/nve/small"_fix_rigid.html -
"rigid/nvt"_fix_rigid.html - constrain one or more clusters of atoms to move as a rigid body with NVT integration
"rigid/nvt/small"_fix_rigid.html -
"rigid/small"_fix_rigid.html - constrain many small clusters of atoms to move as a rigid body with NVE integration
"rigid/small/nph"_fix_rigid.html - constrain many small clusters of atoms to move as a rigid body with NPH integration
"rigid/small/npt"_fix_rigid.html - constrain many small clusters of atoms to move as a rigid body with NPT integration
"rigid/small/nve"_fix_rigid.html - constrain many small clusters of atoms to move as a rigid body with alternate NVE integration
"rigid/small/nvt"_fix_rigid.html - constrain many small clusters of atoms to move as a rigid body with NVT integration
"rx"_fix_rx.html -
"saed/vtk"_fix_saed_vtk.html -
"setforce"_fix_setforce.html - set the force on each atom
"shake"_fix_shake.html - SHAKE constraints on bonds and/or angles
"shardlow"_fix_shardlow.html -
"smd"_fix_smd.html -
"smd/adjust_dt"_fix_smd_adjust_dt.html -
"smd/integrate_tlsph"_fix_smd_integrate_tlsph.html -
"smd/integrate_ulsph"_fix_smd_integrate_ulsph.html -
"smd/move_tri_surf"_fix_smd_move_triangulated_surface.html -
"smd/setvel"_fix_smd_setvel.html -
"smd/wall_surface"_fix_smd_wall_surface.html -
"spring"_fix_spring.html - apply harmonic spring force to group of atoms
"spring/chunk"_fix_spring_chunk.html - apply harmonic spring force to each chunk of atoms
"spring/rg"_fix_spring_rg.html - spring on radius of gyration of \
group of atoms
"spring/rg"_fix_spring_rg.html - spring on radius of gyration of group of atoms
"spring/self"_fix_spring_self.html - spring from each atom to its origin
"srd"_fix_srd.html - stochastic rotation dynamics (SRD)
"store/force"_fix_store_force.html - store force on each atom
"store/state"_fix_store_state.html - store attributes for each atom
"temp/berendsen"_fix_temp_berendsen.html - temperature control by \
Berendsen thermostat
"tdpd/source"_fix_dpd_source.html -
"temp/berendsen"_fix_temp_berendsen.html - temperature control by Berendsen thermostat
"temp/csld"_fix_temp_csvr.html - canonical sampling thermostat with Langevin dynamics
"temp/csvr"_fix_temp_csvr.html - canonical sampling thermostat with Hamiltonian dynamics
"temp/rescale"_fix_temp_rescale.html - temperature control by \
velocity rescaling
"temp/rescale"_fix_temp_rescale.html - temperature control by velocity rescaling
"temp/rescale/eff"_fix_temp_rescale_eff.html -
"tfmc"_fix_tfmc.html - perform force-bias Monte Carlo with time-stamped method
"thermal/conductivity"_fix_thermal_conductivity.html - Muller-Plathe kinetic energy exchange for \
thermal conductivity calculation
"thermal/conductivity"_fix_thermal_conductivity.html - Muller-Plathe kinetic energy exchange for thermal conductivity calculation
"ti/spring"_fix_ti_spring.html -
"tmd"_fix_tmd.html - guide a group of atoms to a new configuration
"ttm"_fix_ttm.html - two-temperature model for electronic/atomic coupling
"ttm/mod"_fix_ttm.html -
"tune/kspace"_fix_tune_kspace.html - auto-tune KSpace parameters
"vector"_fix_vector.html - accumulate a global vector every N timesteps
"viscosity"_fix_viscosity.html - Muller-Plathe momentum exchange for \
viscosity calculation
"viscosity"_fix_viscosity.html - Muller-Plathe momentum exchange for viscosity calculation
"viscous"_fix_viscous.html - viscous damping for granular simulations
"wall/body/polygon"_fix_wall_body_polygon.html -
"wall/body/polyhedron"_fix_wall_body_polyhedron.html -
"wall/colloid"_fix_wall.html - Lennard-Jones wall interacting with finite-size particles
"wall/ees"_fix_wall_ees.html -
"wall/gran"_fix_wall_gran.html - frictional wall(s) for granular simulations
"wall/gran/region"_fix_wall_gran_region.html -
"wall/harmonic"_fix_wall.html - harmonic spring wall
"wall/lj1043"_fix_wall.html - Lennard-Jones 10-4-3 wall
"wall/lj126"_fix_wall.html - Lennard-Jones 12-6 wall
@ -304,6 +379,7 @@ accelerated styles exist.
"wall/piston"_fix_wall_piston.html - moving reflective piston wall
"wall/reflect"_fix_wall_reflect.html - reflecting wall(s)
"wall/region"_fix_wall_region.html - use region surface as wall
"wall/region/ees"_fix_wall_ees.html -
"wall/srd"_fix_wall_srd.html - slip/no-slip wall for SRD particles :ul
[Restrictions:]

View File

@ -376,3 +376,4 @@ appear in {dimstr} for the {shift} style.
"group"_group.html, "processors"_processors.html, "balance"_balance.html
[Default:] none
:link(pizza,http://pizza.sandia.gov)

View File

@ -7,6 +7,7 @@
:line
fix freeze command :h3
fix freeze/kk command :h3
[Syntax:]

View File

@ -8,6 +8,7 @@
fix gravity command :h3
fix gravity/omp command :h3
fix gravity/kk command :h3
[Syntax:]

View File

@ -135,8 +135,7 @@ files"_restart.html. None of the "fix_modify"_fix_modify.html options
are relevant to this fix. No global or per-atom quantities are stored
by this fix for access by various "output commands"_Howto_output.html.
No parameter of this fix can be used with the {start/stop} keywords of
the "run"_run.html command. This fix is not invoked during "energy
minimization"_minimize.html.
the "run"_run.html command.
[Restrictions:] none

View File

@ -35,7 +35,7 @@ keyword = {parallel} or {perp} or {end} :l
fix 1 active neb 10.0
fix 2 all neb 1.0 perp 1.0 end last
fix 2 all neb 1.0 perp 1.0 end first 1.0 end last 1.0
fix 1 all neb 1.0 nudge ideal end last/efirst 1 :pre
fix 1 all neb 1.0 parallel ideal end last/efirst 1 :pre
[Description:]
@ -212,7 +212,7 @@ page for more info.
[Default:]
The option defaults are nudge = neigh, perp = 0.0, ends is not
The option defaults are parallel = neigh, perp = 0.0, ends is not
specified (no inter-replica force on the end replicas).
:line

View File

@ -8,6 +8,7 @@
fix nve/sphere command :h3
fix nve/sphere/omp command :h3
fix nve/sphere/kk command :h3
[Syntax:]

View File

@ -64,14 +64,19 @@ which are included in the LAMMPS distribution. The full list of all
improper styles is on the "Commands bond"_Commands_bond.html#improper
doc page.
"improper_style none"_improper_none.html - turn off improper interactions
"improper_style zero"_improper_zero.html - topology but no interactions
"improper_style hybrid"_improper_hybrid.html - define multiple styles of improper interactions :ul
"none"_improper_none.html - turn off improper interactions
"zero"_improper_zero.html - topology but no interactions
"hybrid"_improper_hybrid.html - define multiple styles of improper interactions :ul
"improper_style class2"_improper_class2.html - COMPASS (class 2) improper
"improper_style cvff"_improper_cvff.html - CVFF improper
"improper_style harmonic"_improper_harmonic.html - harmonic improper
"improper_style umbrella"_improper_umbrella.html - DREIDING improper :ul
"class2"_improper_class2.html - COMPASS (class 2) improper
"cossq"_improper_cossq.html - improper with a cosine squared term
"cvff"_improper_cvff.html - CVFF improper
"distance"_improper_distance.html - improper based on distance between atom planes
"fourier"_improper_fourier.html - improper with multiple cosine terms
"harmonic"_improper_harmonic.html - harmonic improper
"inversion/harmonic"_improper_inversion_harmonic.html - harmonic improper with Wilson-Decius out-of-plane definition
"ring"_improper_ring.html - improper which prevents planar conformations
"umbrella"_improper_umbrella.html - DREIDING improper :ul
:line

View File

@ -404,6 +404,7 @@ lammps_commands_compute.html
compute.html
compute_modify.html
compute_ackland_atom.html
compute_adf.html
compute_angle.html
compute_angle_local.html
compute_angmom_chunk.html

View File

@ -137,8 +137,8 @@ If LAMMPS is the server code, it will begin receiving messages when
the "server"_server.html command is invoked.
A fix client command will terminate its messaging with the server when
LAMMPS ends, or the fix is deleted via the "unfix"_unfix command. The
server command will terminate its messaging with the client when the
LAMMPS ends, or the fix is deleted via the "unfix"_unfix.html command.
The server command will terminate its messaging with the client when the
client signals it. Then the remainder of the LAMMPS input script will
be processed.

View File

@ -24,21 +24,21 @@ pair_style born/coul/dsf command :h3
pair_style style args :pre
style = {born} or {born/coul/long} or {born/coul/long/cs} or {born/coul/msm} or {born/coul/wolf}
style = {born} or {born/coul/long} or {born/coul/msm} or {born/coul/wolf}
args = list of arguments for a particular style :ul
{born} args = cutoff
cutoff = global cutoff for non-Coulombic interactions (distance units)
{born/coul/long} or {born/coul/long/cs} args = cutoff (cutoff2)
{born/coul/long} args = cutoff (cutoff2)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{born/coul/msm} args = cutoff (cutoff2)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{born/coul/wolf} or {born/coul/wolf/cs} args = alpha cutoff (cutoff2)
{born/coul/wolf} args = alpha cutoff (cutoff2)
alpha = damping parameter (inverse distance units)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{born/coul/dsf} or {born/coul/dsf/cs} args = alpha cutoff (cutoff2)
{born/coul/dsf} args = alpha cutoff (cutoff2)
alpha = damping parameter (inverse distance units)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (distance units) :pre

View File

@ -19,8 +19,6 @@ pair_style coul/dsf/gpu command :h3
pair_style coul/dsf/kk command :h3
pair_style coul/dsf/omp command :h3
pair_style coul/long command :h3
pair_style coul/long/cs command :h3
pair_style coul/long/cs/gpu command :h3
pair_style coul/long/omp command :h3
pair_style coul/long/gpu command :h3
pair_style coul/long/kk command :h3
@ -30,7 +28,6 @@ pair_style coul/streitz command :h3
pair_style coul/wolf command :h3
pair_style coul/wolf/kk command :h3
pair_style coul/wolf/omp command :h3
pair_style coul/wolf/cs command :h3
pair_style tip4p/cut command :h3
pair_style tip4p/long command :h3
pair_style tip4p/cut/omp command :h3
@ -42,10 +39,8 @@ pair_style coul/cut cutoff
pair_style coul/debye kappa cutoff
pair_style coul/dsf alpha cutoff
pair_style coul/long cutoff
pair_style coul/long/cs cutoff
pair_style coul/long/gpu cutoff
pair_style coul/wolf alpha cutoff
pair_style coul/wolf/cs alpha cutoff
pair_style coul/streitz cutoff keyword alpha
pair_style tip4p/cut otype htype btype atype qdist cutoff
pair_style tip4p/long otype htype btype atype qdist cutoff :pre
@ -68,14 +63,12 @@ pair_style coul/dsf 0.05 10.0
pair_coeff * * :pre
pair_style coul/long 10.0
pair_style coul/long/cs 10.0
pair_coeff * * :pre
pair_style coul/msm 10.0
pair_coeff * * :pre
pair_style coul/wolf 0.2 9.0
pair_style coul/wolf/cs 0.2 9.0
pair_coeff * * :pre
pair_style coul/streitz 12.0 ewald
@ -204,12 +197,6 @@ option. The Coulombic cutoff specified for this style means that
pairwise interactions within this distance are computed directly;
interactions outside that distance are computed in reciprocal space.
Style {coul/long/cs} is identical to {coul/long} except that a term is
added for the "core/shell model"_Howto_coreshell.html to allow charges
on core and shell particles to be separated by r = 0.0. The same
correction is introduced for the {coul/wolf/cs} style which is
identical to {coul/wolf}.
Styles {tip4p/cut} and {tip4p/long} implement the coulomb part of
the TIP4P water model of "(Jorgensen)"_#Jorgensen3, which introduces
a massless site located a short distance away from the oxygen atom
@ -317,9 +304,9 @@ This pair style can only be used via the {pair} keyword of the
[Restrictions:]
The {coul/long}, {coul/msm} and {tip4p/long} styles are part of the
KSPACE package. The {coul/long/cs} style is part of the CORESHELL
package. They are only enabled if LAMMPS was built with that package.
See the "Build package"_Build_package.html doc page for more info.
KSPACE package. They are only enabled if LAMMPS was built with that
package. See the "Build package"_Build_package.html doc page for more
info.
[Related commands:]

View File

@ -6,51 +6,74 @@
:line
pair_style born/coul/dsf/cs command :h3
pair_style born/coul/long/cs command :h3
pair_style born/coul/long/cs/gpu command :h3
pair_style buck/coul/long/cs command :h3
pair_style born/coul/dsf/cs command :h3
pair_style born/coul/wolf/cs command :h3
pair_style born/coul/wolf/cs/gpu command :h3
pair_style buck/coul/long/cs command :h3
pair_style coul/long/cs command :h3
pair_style coul/long/cs/gpu command :h3
pair_style coul/wolf/cs command :h3
pair_style lj/cut/coul/long/cs command :h3
[Syntax:]
pair_style style args :pre
style = {born/coul/long/cs} or {buck/coul/long/cs} or {born/coul/dsf/cs} or {born/coul/wolf/cs}
style = {born/coul/dsf/cs} or {born/coul/long/cs} or {born/coul/wolf/cs} or {buck/coul/long/cs} or {coul/long/cs} or {coul/wolf/cs} or {lj/cut/coul/long/cs}
args = list of arguments for a particular style :ul
{born/coul/long/cs} args = cutoff (cutoff2)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{buck/coul/long/cs} args = cutoff (cutoff2)
cutoff = global cutoff for Buckingham (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{born/coul/dsf/cs} args = alpha cutoff (cutoff2)
alpha = damping parameter (inverse distance units)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (distance units) :pre
cutoff2 = global cutoff for Coulombic (distance units)
{born/coul/long/cs} args = cutoff (cutoff2)
cutoff = global cutoff for non-Coulombic (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{born/coul/wolf/cs} args = alpha cutoff (cutoff2)
alpha = damping parameter (inverse distance units)
cutoff = global cutoff for Buckingham (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{buck/coul/long/cs} args = cutoff (cutoff2)
cutoff = global cutoff for Buckingham (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units)
{coul/long} args = cutoff
cutoff = global cutoff for Coulombic (distance units)
{coul/wolf} args = alpha cutoff
alpha = damping parameter (inverse distance units)
cutoff = global cutoff for Coulombic (distance units)
{lj/cut/coul/long/cs} args = cutoff (cutoff2)
cutoff = global cutoff for LJ (and Coulombic if only 1 arg) (distance units)
cutoff2 = global cutoff for Coulombic (optional) (distance units) :pre
[Examples:]
pair_style born/coul/dsf/cs 0.1 10.0 12.0
pair_coeff * * 0.0 1.00 0.00 0.00 0.00
pair_coeff 1 1 480.0 0.25 0.00 1.05 0.50 :pre
pair_style born/coul/long/cs 10.0 8.0
pair_coeff 1 1 6.08 0.317 2.340 24.18 11.51 :pre
pair_style born/coul/wolf/cs 0.25 10.0 12.0
pair_coeff * * 0.0 1.00 0.00 0.00 0.00
pair_coeff 1 1 480.0 0.25 0.00 1.05 0.50 :pre
pair_style buck/coul/long/cs 10.0
pair_style buck/coul/long/cs 10.0 8.0
pair_coeff * * 100.0 1.5 200.0
pair_coeff 1 1 100.0 1.5 200.0 9.0 :pre
pair_style born/coul/dsf/cs 0.1 10.0 12.0
pair_coeff * * 0.0 1.00 0.00 0.00 0.00
pair_coeff 1 1 480.0 0.25 0.00 1.05 0.50 :pre
pair_style coul/long/cs 10.0
pair_coeff * * :pre
pair_style born/coul/wolf/cs 0.25 10.0 12.0
pair_coeff * * 0.0 1.00 0.00 0.00 0.00
pair_coeff 1 1 480.0 0.25 0.00 1.05 0.50 :pre
pair_style coul/wolf/cs 0.2 9.0
pair_coeff * * :pre
pair_style lj/cut/coul/long/cs 10.0
pair_style lj/cut/coul/long/cs 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0 :pre
[Description:]
@ -59,16 +82,28 @@ core/shell model of "(Mitchell and Finchham)"_#MitchellFinchham2. See
the "Howto coreshell"_Howto_coreshell.html doc page for an overview of
the model as implemented in LAMMPS.
The styles with a {coul/long} term are identical to the "pair_style
born/coul/long"_pair_born.html and "pair_style
buck/coul/long"_pair_buck.html styles, except they correctly treat the
special case where the distance between two charged core and shell
atoms in the same core/shell pair approach r = 0.0. This needs
special treatment when a long-range solver for Coulombic interactions
is also used, i.e. via the "kspace_style"_kspace_style.html command.
All the styles are identical to the corresponding pair style without
the "/cs" in the name:
More specifically, the short-range Coulomb interaction between a core
and its shell should be turned off using the
"pair_style born/coul/dsf"_pair_born.html
"pair_style born/coul/long"_pair_born.html
"pair_style born/coul/wolf"_pair_born.html
"pair_style buck/coul/long"_pair_buck.html
"pair_style coul/long"_pair_coul.html
"pair_style coul/wolf"_pair_coul.html
"pair_style lj/cut/coul/long"_pair_lj.html :ul
except that they correctly treat the special case where the distance
between two charged core and shell atoms in the same core/shell pair
approach r = 0.0.
Styles with a "/long" in the name are used with a long-range solver
for Coulombic interactions via the "kspace_style"_kspace_style.html
command. They require special treatment of the short-range Coulombic
interactions within the cor/shell model.
Specifically, the short-range Coulomb interaction between a core and
its shell should be turned off using the
"special_bonds"_special_bonds.html command by setting the 1-2 weight
to 0.0, which works because the core and shell atoms are bonded to
each other. This induces a long-range correction approximation which
@ -83,21 +118,10 @@ where C is an energy-conversion constant, Qi and Qj are the charges on
the core and shell, epsilon is the dielectric constant and r_min is the
minimal distance.
The pair style {born/coul/dsf/cs} is identical to the
"pair_style born/coul/dsf"_pair_born.html style, which uses
the damped shifted force model as in "coul/dsf"_pair_coul.html
to compute the Coulomb contribution. This approach does not require
a long-range solver, thus the only correction is the addition of a
minimal distance to avoid the possible r = 0.0 case for a
core/shell pair.
The pair style {born/coul/wolf/cs} is identical to the
"pair_style born/coul/wolf"_pair_born.html style, which uses
the Wolf summation as in "coul/wolf"_pair_coul.html to compute
the Coulomb contribution. This approach does not require
a long-range solver, thus the only correction is the addition of a
minimal distance to avoid the possible r = 0.0 case for a
core/shell pair.
For styles that are not used with a long-range solver, i.e. those with
"/dsf" or "/wolf" in the name, the only correction is the addition of
a minimal distance to avoid the possible r = 0.0 case for a core/shell
pair.
:line

View File

@ -10,6 +10,7 @@ pair_style gran/hooke command :h3
pair_style gran/hooke/omp command :h3
pair_style gran/hooke/history command :h3
pair_style gran/hooke/history/omp command :h3
pair_style gran/hooke/history/kk command :h3
pair_style gran/hertz/history command :h3
pair_style gran/hertz/history/omp command :h3

View File

@ -25,7 +25,6 @@ pair_style lj/cut/coul/dsf/gpu command :h3
pair_style lj/cut/coul/dsf/kk command :h3
pair_style lj/cut/coul/dsf/omp command :h3
pair_style lj/cut/coul/long command :h3
pair_style lj/cut/coul/long/cs command :h3
pair_style lj/cut/coul/long/gpu command :h3
pair_style lj/cut/coul/long/kk command :h3
pair_style lj/cut/coul/long/intel command :h3
@ -46,7 +45,7 @@ pair_style lj/cut/tip4p/long/opt command :h3
pair_style style args :pre
style = {lj/cut} or {lj/cut/coul/cut} or {lj/cut/coul/debye} or {lj/cut/coul/dsf} or {lj/cut/coul/long} or {lj/cut/coul/long/cs} or {lj/cut/coul/msm} or {lj/cut/tip4p/long}
style = {lj/cut} or {lj/cut/coul/cut} or {lj/cut/coul/debye} or {lj/cut/coul/dsf} or {lj/cut/coul/long} {lj/cut/coul/msm} or {lj/cut/tip4p/long}
args = list of arguments for a particular style :ul
{lj/cut} args = cutoff
cutoff = global cutoff for Lennard Jones interactions (distance units)
@ -107,9 +106,7 @@ pair_coeff * * 1.0 1.0
pair_coeff 1 1 1.0 1.0 2.5 :pre
pair_style lj/cut/coul/long 10.0
pair_style lj/cut/coul/long/cs 10.0
pair_style lj/cut/coul/long 10.0 8.0
pair_style lj/cut/coul/long/cs 10.0 8.0
pair_coeff * * 100.0 3.0
pair_coeff 1 1 100.0 3.5 9.0 :pre
@ -186,11 +183,6 @@ specified for this style means that pairwise interactions within this
distance are computed directly; interactions outside that distance are
computed in reciprocal space.
Style {lj/cut/coul/long/cs} is identical to {lj/cut/coul/long} except
that a term is added for the "core/shell model"_Howto_coreshell.html
to allow charges on core and shell particles to be separated by r =
0.0.
Style {coul/wolf} adds a Coulombic pairwise interaction via the Wolf
summation method, described in "Wolf"_#Wolf1, given by:

View File

@ -95,120 +95,217 @@ GPUs, and KNLs. The individual style names on the "Commands
pair"_Commands_pair.html doc page are followed by one or more of
(g,i,k,o,t) to indicate which accelerated styles exist.
"pair_style none"_pair_none.html - turn off pairwise interactions
"pair_style hybrid"_pair_hybrid.html - multiple styles of pairwise interactions
"pair_style hybrid/overlay"_pair_hybrid.html - multiple styles of superposed pairwise interactions
"pair_style zero"_pair_zero.html - neighbor list but no interactions :ul
"none"_pair_none.html - turn off pairwise interactions
"hybrid"_pair_hybrid.html - multiple styles of pairwise interactions
"hybrid/overlay"_pair_hybrid.html - multiple styles of superposed pairwise interactions
"zero"_pair_zero.html - neighbor list but no interactions :ul
"pair_style adp"_pair_adp.html - angular dependent potential (ADP) of Mishin
"pair_style airebo"_pair_airebo.html - AIREBO potential of Stuart
"pair_style airebo/morse"_pair_airebo.html - AIREBO with Morse instead of LJ
"pair_style atm"_pair_atm.html - Axilrod-Teller-Muto potential
"pair_style beck"_pair_beck.html - Beck potential
"pair_style body/nparticle"_pair_body_nparticle.html - interactions between body particles
"pair_style bop"_pair_bop.html - BOP potential of Pettifor
"pair_style born"_pair_born.html - Born-Mayer-Huggins potential
"pair_style born/coul/long"_pair_born.html - Born-Mayer-Huggins with long-range Coulombics
"pair_style born/coul/long/cs"_pair_born.html - Born-Mayer-Huggins with long-range Coulombics and core/shell
"pair_style born/coul/msm"_pair_born.html - Born-Mayer-Huggins with long-range MSM Coulombics
"pair_style born/coul/wolf"_pair_born.html - Born-Mayer-Huggins with Coulombics via Wolf potential
"pair_style brownian"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics
"pair_style brownian/poly"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics with polydispersity
"pair_style buck"_pair_buck.html - Buckingham potential
"pair_style buck/coul/cut"_pair_buck.html - Buckingham with cutoff Coulomb
"pair_style buck/coul/long"_pair_buck.html - Buckingham with long-range Coulombics
"pair_style buck/coul/long/cs"_pair_buck.html - Buckingham with long-range Coulombics and core/shell
"pair_style buck/coul/msm"_pair_buck.html - Buckingham long-range MSM Coulombics
"pair_style buck/long/coul/long"_pair_buck_long.html - long-range Buckingham with long-range Coulombics
"pair_style colloid"_pair_colloid.html - integrated colloidal potential
"pair_style comb"_pair_comb.html - charge-optimized many-body (COMB) potential
"pair_style comb3"_pair_comb.html - charge-optimized many-body (COMB3) potential
"pair_style coul/cut"_pair_coul.html - cutoff Coulombic potential
"pair_style coul/debye"_pair_coul.html - cutoff Coulombic potential with Debye screening
"pair_style coul/dsf"_pair_coul.html - Coulombics via damped shifted forces
"pair_style coul/long"_pair_coul.html - long-range Coulombic potential
"pair_style coul/long/cs"_pair_coul.html - long-range Coulombic potential and core/shell
"pair_style coul/msm"_pair_coul.html - long-range MSM Coulombics
"pair_style coul/streitz"_pair_coul.html - Coulombics via Streitz/Mintmire Slater orbitals
"pair_style coul/wolf"_pair_coul.html - Coulombics via Wolf potential
"pair_style dpd"_pair_dpd.html - dissipative particle dynamics (DPD)
"pair_style dpd/tstat"_pair_dpd.html - DPD thermostatting
"pair_style dsmc"_pair_dsmc.html - Direct Simulation Monte Carlo (DSMC)
"pair_style eam"_pair_eam.html - embedded atom method (EAM)
"pair_style eam/alloy"_pair_eam.html - alloy EAM
"pair_style eam/fs"_pair_eam.html - Finnis-Sinclair EAM
"pair_style eim"_pair_eim.html - embedded ion method (EIM)
"pair_style gauss"_pair_gauss.html - Gaussian potential
"pair_style gayberne"_pair_gayberne.html - Gay-Berne ellipsoidal potential
"pair_style gran/hertz/history"_pair_gran.html - granular potential with Hertzian interactions
"pair_style gran/hooke"_pair_gran.html - granular potential with history effects
"pair_style gran/hooke/history"_pair_gran.html - granular potential without history effects
"pair_style hbond/dreiding/lj"_pair_hbond_dreiding.html - DREIDING hydrogen bonding LJ potential
"pair_style hbond/dreiding/morse"_pair_hbond_dreiding.html - DREIDING hydrogen bonding Morse potential
"pair_style kim"_pair_kim.html - interface to potentials provided by KIM project
"pair_style lcbop"_pair_lcbop.html - long-range bond-order potential (LCBOP)
"pair_style line/lj"_pair_line_lj.html - LJ potential between line segments
"pair_style lj/charmm/coul/charmm"_pair_charmm.html - CHARMM potential with cutoff Coulomb
"pair_style lj/charmm/coul/charmm/implicit"_pair_charmm.html - CHARMM for implicit solvent
"pair_style lj/charmm/coul/long"_pair_charmm.html - CHARMM with long-range Coulomb
"pair_style lj/charmm/coul/msm"_pair_charmm.html - CHARMM with long-range MSM Coulombics
"pair_style lj/class2"_pair_class2.html - COMPASS (class 2) force field with no Coulomb
"pair_style lj/class2/coul/cut"_pair_class2.html - COMPASS with cutoff Coulomb
"pair_style lj/class2/coul/long"_pair_class2.html - COMPASS with long-range Coulomb
"pair_style lj/cubic"_pair_lj_cubic.html - LJ with cubic after inflection point
"pair_style lj/cut"_pair_lj.html - cutoff Lennard-Jones potential with no Coulomb
"pair_style lj/cut/coul/cut"_pair_lj.html - LJ with cutoff Coulomb
"pair_style lj/cut/coul/debye"_pair_lj.html - LJ with Debye screening added to Coulomb
"pair_style lj/cut/coul/dsf"_pair_lj.html - LJ with Coulombics via damped shifted forces
"pair_style lj/cut/coul/long"_pair_lj.html - LJ with long-range Coulombics
"pair_style lj/cut/coul/long/cs"_pair_lj.html - LJ with long-range Coulombics and core/shell
"pair_style lj/cut/coul/msm"_pair_lj.html - LJ with long-range MSM Coulombics
"pair_style lj/cut/dipole/cut"_pair_dipole.html - point dipoles with cutoff
"pair_style lj/cut/dipole/long"_pair_dipole.html - point dipoles with long-range Ewald
"pair_style lj/cut/tip4p/cut"_pair_lj.html - LJ with cutoff Coulomb for TIP4P water
"pair_style lj/cut/tip4p/long"_pair_lj.html - LJ with long-range Coulomb for TIP4P water
"pair_style lj/expand"_pair_lj_expand.html - Lennard-Jones for variable size particles
"pair_style lj/gromacs"_pair_gromacs.html - GROMACS-style Lennard-Jones potential
"pair_style lj/gromacs/coul/gromacs"_pair_gromacs.html - GROMACS-style LJ and Coulombic potential
"pair_style lj/long/coul/long"_pair_lj_long.html - long-range LJ and long-range Coulombics
"pair_style lj/long/dipole/long"_pair_dipole.html - long-range LJ and long-range point dipoles
"pair_style lj/long/tip4p/long"_pair_lj_long.html - long-range LJ and long-range Coulomb for TIP4P water
"pair_style lj/smooth"_pair_lj_smooth.html - smoothed Lennard-Jones potential
"pair_style lj/smooth/linear"_pair_lj_smooth_linear.html - linear smoothed Lennard-Jones potential
"pair_style lj96/cut"_pair_lj96.html - Lennard-Jones 9/6 potential
"pair_style lubricate"_pair_lubricate.html - hydrodynamic lubrication forces
"pair_style lubricate/poly"_pair_lubricate.html - hydrodynamic lubrication forces with polydispersity
"pair_style lubricateU"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication Dynamics
"pair_style lubricateU/poly"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication with polydispersity
"pair_style meam"_pair_meam.html - modified embedded atom method (MEAM)
"pair_style mie/cut"_pair_mie.html - Mie potential
"pair_style morse"_pair_morse.html - Morse potential
"pair_style nb3b/harmonic"_pair_nb3b_harmonic.html - nonbonded 3-body harmonic potential
"pair_style nm/cut"_pair_nm.html - N-M potential
"pair_style nm/cut/coul/cut"_pair_nm.html - N-M potential with cutoff Coulomb
"pair_style nm/cut/coul/long"_pair_nm.html - N-M potential with long-range Coulombics
"pair_style peri/eps"_pair_peri.html - peridynamic EPS potential
"pair_style peri/lps"_pair_peri.html - peridynamic LPS potential
"pair_style peri/pmb"_pair_peri.html - peridynamic PMB potential
"pair_style peri/ves"_pair_peri.html - peridynamic VES potential
"pair_style polymorphic"_pair_polymorphic.html - polymorphic 3-body potential
"pair_style reax"_pair_reax.html - ReaxFF potential
"pair_style rebo"_pair_airebo.html - 2nd generation REBO potential of Brenner
"pair_style resquared"_pair_resquared.html - Everaers RE-Squared ellipsoidal potential
"pair_style snap"_pair_snap.html - SNAP quantum-accurate potential
"pair_style soft"_pair_soft.html - Soft (cosine) potential
"pair_style sw"_pair_sw.html - Stillinger-Weber 3-body potential
"pair_style table"_pair_table.html - tabulated pair potential
"pair_style tersoff"_pair_tersoff.html - Tersoff 3-body potential
"pair_style tersoff/mod"_pair_tersoff_mod.html - modified Tersoff 3-body potential
"pair_style tersoff/zbl"_pair_tersoff_zbl.html - Tersoff/ZBL 3-body potential
"pair_style tip4p/cut"_pair_coul.html - Coulomb for TIP4P water w/out LJ
"pair_style tip4p/long"_pair_coul.html - long-range Coulombics for TIP4P water w/out LJ
"pair_style tri/lj"_pair_tri_lj.html - LJ potential between triangles
"pair_style vashishta"_pair_vashishta.html - Vashishta 2-body and 3-body potential
"pair_style yukawa"_pair_yukawa.html - Yukawa potential
"pair_style yukawa/colloid"_pair_yukawa_colloid.html - screened Yukawa potential for finite-size particles
"pair_style zbl"_pair_zbl.html - Ziegler-Biersack-Littmark potential :ul
"adp"_pair_adp.html - angular dependent potential (ADP) of Mishin
"agni"_pair_agni.html - machine learned potential mapping atomic environment to forces
"airebo"_pair_airebo.html - AIREBO potential of Stuart
"airebo/morse"_pair_airebo.html - AIREBO with Morse instead of LJ
"atm"_pair_atm.html - Axilrod-Teller-Muto potential
"awpmd/cut"_pair_awpmd.html - Antisymmetrized Wave Packet MD potential for atoms and electrons
"beck"_pair_beck.html - Beck potential
"body/nparticle"_pair_body_nparticle.html - interactions between body particles
"body/rounded/polygon"_pair_body_rounded_polygon.html - granular-style 2d polygon potential
"body/rounded/polyhedron"_pair_body_rounded_polyhedron.html - granular-style 3d polyhedron potential
"bop"_pair_bop.html - BOP potential of Pettifor
"born"_pair_born.html - Born-Mayer-Huggins potential
"born/coul/dsf"_pair_born.html - Born with damped-shifted-force model
"born/coul/dsf/cs"_pair_cs.html - Born with damped-shifted-force and core/shell model
"born/coul/long"_pair_born.html - Born with long-range Coulombics
"born/coul/long/cs"_pair_cs.html - Born with long-range Coulombics and core/shell
"born/coul/msm"_pair_born.html - Born with long-range MSM Coulombics
"born/coul/wolf"_pair_born.html - Born with Wolf potential for Coulombics
"born/coul/wolf/cs"_pair_cs.html - Born with Wolf potential for Coulombics and core/shell model
"brownian"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics
"brownian/poly"_pair_brownian.html - Brownian potential for Fast Lubrication Dynamics with polydispersity
"buck"_pair_buck.html - Buckingham potential
"buck/coul/cut"_pair_buck.html - Buckingham with cutoff Coulomb
"buck/coul/long"_pair_buck.html - Buckingham with long-range Coulombics
"buck/coul/long/cs"_pair_cs.html - Buckingham with long-range Coulombics and core/shell
"buck/coul/msm"_pair_buck.html - Buckingham with long-range MSM Coulombics
"buck/long/coul/long"_pair_buck_long.html - long-range Buckingham with long-range Coulombics
"buck/mdf"_pair_mdf.html - Buckingham with a taper function
"buck6d/coul/gauss/dsf"_pair_buck6d_coul_gauss.html - dispersion-damped Buckingham with damped-shift-force model
"buck6d/coul/gauss/long"_pair_buck6d_coul_gauss.html - dispersion-damped Buckingham with long-range Coulombics
"colloid"_pair_colloid.html - integrated colloidal potential
"comb"_pair_comb.html - charge-optimized many-body (COMB) potential
"comb3"_pair_comb.html - charge-optimized many-body (COMB3) potential
"coul/cut"_pair_coul.html - cutoff Coulombic potential
"coul/cut/soft"_pair_lj_soft.html - Coulombic potential with a soft core
"coul/debye"_pair_coul.html - cutoff Coulombic potential with Debye screening
"coul/diel"_pair_coul_diel.html - Coulomb potential with dielectric permittivity
"coul/dsf"_pair_coul.html - Coulombics with damped-shifted-force model
"coul/long"_pair_coul.html - long-range Coulombic potential
"coul/long/cs"_pair_cs.html - long-range Coulombic potential and core/shell
"coul/long/soft"_pair_lj_soft.html - long-range Coulombic potential with a soft core
"coul/msm"_pair_coul.html - long-range MSM Coulombics
"coul/shield"_pair_coul_shield.html - Coulombics for boron nitride for use with "ilp/graphene/hbn"_pair_ilp_graphene_hbn.html potential
"coul/streitz"_pair_coul.html - Coulombics via Streitz/Mintmire Slater orbitals
"coul/wolf"_pair_coul.html - Coulombics via Wolf potential
"coul/wolf/cs"_pair_cs.html - ditto with core/shell adjustments
"dpd"_pair_dpd.html - dissipative particle dynamics (DPD)
"dpd/fdt"_pair_dpd_fdt.html - DPD for constant temperature and pressure
"dpd/fdt/energy"_pair_dpd_fdt.html - DPD for constant energy and enthalpy
"dpd/tstat"_pair_dpd.html - pair-wise DPD thermostatting
"dsmc"_pair_dsmc.html - Direct Simulation Monte Carlo (DSMC)
"eam"_pair_eam.html - embedded atom method (EAM)
"eam/alloy"_pair_eam.html - alloy EAM
"eam/cd"_pair_eam.html - concentration-dependent EAM
"eam/cd/old"_pair_eam.html - older two-site model for concentration-dependent EAM
"eam/fs"_pair_eam.html - Finnis-Sinclair EAM
"edip"_pair_edip.html - three-body EDIP potential
"edip/multi"_pair_edip.html - multi-element EDIP potential
"edpd"_pair_meso.html - eDPD particle interactions
"eff/cut"_pair_eff.html - electron force field with a cutoff
"eim"_pair_eim.html - embedded ion method (EIM)
"exp6/rx"_pair_exp6_rx.html - reactive DPD potential
"extep"_pair_extep.html - extended Tersoff potential
"gauss"_pair_gauss.html - Gaussian potential
"gauss/cut"_pair_gauss.html - generalized Gaussian potential
"gayberne"_pair_gayberne.html - Gay-Berne ellipsoidal potential
"gran/hertz/history"_pair_gran.html - granular potential with Hertzian interactions
"gran/hooke"_pair_gran.html - granular potential with history effects
"gran/hooke/history"_pair_gran.html - granular potential without history effects
"gw"_pair_gw.html - Gao-Weber potential
"gw/zbl"_pair_gw.html - Gao-Weber potential with a repulsive ZBL core
"hbond/dreiding/lj"_pair_hbond_dreiding.html - DREIDING hydrogen bonding LJ potential
"hbond/dreiding/morse"_pair_hbond_dreiding.html - DREIDING hydrogen bonding Morse potential
"ilp/graphene/hbn"_pair_ilp_graphene_hbn.html - registry-dependent interlayer potential (ILP)
"kim"_pair_kim.html - interface to potentials provided by KIM project
"kolmogorov/crespi/full"_pair_kolmogorov_crespi_full.html - Kolmogorov-Crespi (KC) potential with no simplifications
"kolmogorov/crespi/z"_pair_kolmogorov_crespi_z.html - Kolmogorov-Crespi (KC) potential with normals along z-axis
"lcbop"_pair_lcbop.html - long-range bond-order potential (LCBOP)
"lennard/mdf"_pair_mdf.html - LJ potential in A/B form with a taper function
"line/lj"_pair_line_lj.html - LJ potential between line segments
"list"_pair_list.html - potential between pairs of atoms explicitly listed in an input file
"lj/charmm/coul/charmm"_pair_charmm.html - CHARMM potential with cutoff Coulomb
"lj/charmm/coul/charmm/implicit"_pair_charmm.html - CHARMM for implicit solvent
"lj/charmm/coul/long"_pair_charmm.html - CHARMM with long-range Coulomb
"lj/charmm/coul/long/soft"_pair_lj_soft.html - CHARMM with long-range Coulomb and a soft core
"lj/charmm/coul/msm"_pair_charmm.html - CHARMM with long-range MSM Coulombics
"lj/charmmfsw/coul/charmmfsh"_pair_charmm.html - CHARMM with force switching and shifting
"lj/charmmfsw/coul/long"_pair_charmm.html - CHARMM with force switching and long-rnage Coulombics
"lj/class2"_pair_class2.html - COMPASS (class 2) force field with no Coulomb
"lj/class2/coul/cut"_pair_class2.html - COMPASS with cutoff Coulomb
"lj/class2/coul/long"_pair_class2.html - COMPASS with long-range Coulomb
"lj/cubic"_pair_lj_cubic.html - LJ with cubic after inflection point
"lj/cut"_pair_lj.html - cutoff Lennard-Jones potential with no Coulomb
"lj/cut/coul/cut"_pair_lj.html - LJ with cutoff Coulomb
"lj/cut/coul/cut/soft"_pair_lj_soft.html - LJ with cutoff Coulomb with a soft core
"lj/cut/coul/debye"_pair_lj.html - LJ with Debye screening added to Coulomb
"lj/cut/coul/dsf"_pair_lj.html - LJ with Coulombics via damped shifted forces
"lj/cut/coul/long"_pair_lj.html - LJ with long-range Coulombics
"lj/cut/coul/long/cs"_pair_cs.html - ditto with core/shell adjustments
"lj/cut/coul/long/soft"_pair_lj_soft.html - LJ with long-range Coulombics with a soft core
"lj/cut/coul/msm"_pair_lj.html - LJ with long-range MSM Coulombics
"lj/cut/coul/wolf"_pair_lj.html - LJ with Coulombics via Wolf potential
"lj/cut/dipole/cut"_pair_dipole.html - point dipoles with cutoff
"lj/cut/dipole/long"_pair_dipole.html - point dipoles with long-range Ewald
"lj/cut/soft"_pair_lj_soft.html - LJ with a soft core
"lj/cut/thole/long"_pair_thole.html - LJ with Coulomibics with thole damping
"lj/cut/tip4p/cut"_pair_lj.html - LJ with cutoff Coulomb for TIP4P water
"lj/cut/tip4p/long"_pair_lj.html - LJ with long-range Coulomb for TIP4P water
"lj/cut/tip4p/long/soft"_pair_lj_soft.html - LJ with cutoff Coulomb for TIP4P water with a soft core
"lj/expand"_pair_lj_expand.html - Lennard-Jones for variable size particles
"lj/expand/coul/long"_pair_lj_expand.html - Lennard-Jones for variable size particles with long-range Coulombics
"lj/gromacs"_pair_gromacs.html - GROMACS-style Lennard-Jones potential
"lj/gromacs/coul/gromacs"_pair_gromacs.html - GROMACS-style LJ and Coulombic potential
"lj/long/coul/long"_pair_lj_long.html - long-range LJ and long-range Coulombics
"lj/long/dipole/long"_pair_dipole.html - long-range LJ and long-range point dipoles
"lj/long/tip4p/long"_pair_lj_long.html - long-range LJ and long-range Coulombics for TIP4P water
"lj/mdf"_pair_mdf.html - LJ potential with a taper function
"lj/sdk"_pair_sdk.html - LJ for SDK coarse-graining
"lj/sdk/coul/long"_pair_sdk.html - LJ for SDK coarse-graining with long-range Coulombics
"lj/sdk/coul/msm"_pair_sdk.html - LJ for SDK coarse-graining with long-range Coulombics via MSM
"lj/sf/dipole/sf"_pair_dipole.html - LJ with dipole interaction with shifted forces
"lj/smooth"_pair_lj_smooth.html - smoothed Lennard-Jones potential
"lj/smooth/linear"_pair_lj_smooth_linear.html - linear smoothed LJ potential
"lj96/cut"_pair_lj96.html - Lennard-Jones 9/6 potential
"lubricate"_pair_lubricate.html - hydrodynamic lubrication forces
"lubricate/poly"_pair_lubricate.html - hydrodynamic lubrication forces with polydispersity
"lubricateU"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication Dynamics
"lubricateU/poly"_pair_lubricateU.html - hydrodynamic lubrication forces for Fast Lubrication with polydispersity
"mdpd"_pair_meso.html - mDPD particle interactions
"mdpd/rhosum"_pair_meso.html - mDPD particle interactions for mass density
"meam"_pair_meam.html - modified embedded atom method (MEAM) in Fortran
"meam/c"_pair_meam.html - modified embedded atom method (MEAM) in C
"meam/spline"_pair_meam_spline.html - splined version of MEAM
"meam/sw/spline"_pair_meam_sw_spline.html - splined version of MEAM with a Stillinger-Weber term
"mgpt"_pair_mgpt.html - simplified model generalized pseudopotential theory (MGPT) potential
"mie/cut"_pair_mie.html - Mie potential
"momb"_pair_momb.html - Many-Body Metal-Organic (MOMB) force field
"morse"_pair_morse.html - Morse potential
"morse/smooth/linear"_pair_morse.html - linear smoothed Morse potential
"morse/soft"_pair_morse.html - Morse potential with a soft core
"multi/lucy"_pair_multi_lucy.html - DPD potential with density-dependent force
"multi/lucy/rx"_pair_multi_lucy_rx.html - reactive DPD potential with density-dependent force
"nb3b/harmonic"_pair_nb3b_harmonic.html - nonbonded 3-body harmonic potential
"nm/cut"_pair_nm.html - N-M potential
"nm/cut/coul/cut"_pair_nm.html - N-M potential with cutoff Coulomb
"nm/cut/coul/long"_pair_nm.html - N-M potential with long-range Coulombics
"oxdna/coaxstk"_pair_oxdna.html -
"oxdna/excv"_pair_oxdna.html -
"oxdna/hbond"_pair_oxdna.html -
"oxdna/stk"_pair_oxdna.html -
"oxdna/xstk"_pair_oxdna.html -
"oxdna2/coaxstk"_pair_oxdna2.html -
"oxdna2/dh"_pair_oxdna2.html -
"oxdna2/excv"_pair_oxdna2.html -
"oxdna2/hbond"_pair_oxdna2.html -
"oxdna2/stk"_pair_oxdna2.html -
"oxdna2/xstk"_pair_oxdna2.html -
"peri/eps"_pair_peri.html - peridynamic EPS potential
"peri/lps"_pair_peri.html - peridynamic LPS potential
"peri/pmb"_pair_peri.html - peridynamic PMB potential
"peri/ves"_pair_peri.html - peridynamic VES potential
"polymorphic"_pair_polymorphic.html - polymorphic 3-body potential
"python"_pair_python.html -
"quip"_pair_quip.html -
"reax"_pair_reax.html - ReaxFF potential in Fortran
"reax/c"_pair_reaxc.html - ReaxFF potential in C
"rebo"_pair_airebo.html - 2nd generation REBO potential of Brenner
"resquared"_pair_resquared.html - Everaers RE-Squared ellipsoidal potential
"smd/hertz"_pair_smd_hertz.html -
"smd/tlsph"_pair_smd_tlsph.html -
"smd/tri_surface"_pair_smd_triangulated_surface.html -
"smd/ulsph"_pair_smd_ulsph.html -
"smtbq"_pair_smtbq.html -
"snap"_pair_snap.html - SNAP quantum-accurate potential
"soft"_pair_soft.html - Soft (cosine) potential
"sph/heatconduction"_pair_sph_heatconduction.html -
"sph/idealgas"_pair_sph_idealgas.html -
"sph/lj"_pair_sph_lj.html -
"sph/rhosum"_pair_sph_rhosum.html -
"sph/taitwater"_pair_sph_taitwater.html -
"sph/taitwater/morris"_pair_sph_taitwater_morris.html -
"spin/dmi"_pair_spin_dmi.html -
"spin/exchange"_pair_spin_exchange.html -
"spin/magelec"_pair_spin_magelec.html -
"spin/neel"_pair_spin_neel.html -
"srp"_pair_srp.html -
"sw"_pair_sw.html - Stillinger-Weber 3-body potential
"table"_pair_table.html - tabulated pair potential
"table/rx"_pair_table_rx.html -
"tdpd"_pair_meso.html - tDPD particle interactions
"tersoff"_pair_tersoff.html - Tersoff 3-body potential
"tersoff/mod"_pair_tersoff_mod.html - modified Tersoff 3-body potential
"tersoff/mod/c"_pair_tersoff_mod.html -
"tersoff/table"_pair_tersoff.html -
"tersoff/zbl"_pair_tersoff_zbl.html - Tersoff/ZBL 3-body potential
"thole"_pair_thole.html - Coulomb interactions with thole damping
"tip4p/cut"_pair_coul.html - Coulomb for TIP4P water w/out LJ
"tip4p/long"_pair_coul.html - long-range Coulombics for TIP4P water w/out LJ
"tip4p/long/soft"_pair_lj_soft.html -
"tri/lj"_pair_tri_lj.html - LJ potential between triangles
"ufm"_pair_ufm.html -
"vashishta"_pair_vashishta.html - Vashishta 2-body and 3-body potential
"vashishta/table"_pair_vashishta.html -
"yukawa"_pair_yukawa.html - Yukawa potential
"yukawa/colloid"_pair_yukawa_colloid.html - screened Yukawa potential for finite-size particles
"zbl"_pair_zbl.html - Ziegler-Biersack-Littmark potential :ul
:line

View File

@ -1,7 +1,7 @@
# Point dipoles in a 2d box
units lj
atom_style full
atom_style charge
read_data data.NaCl
@ -29,7 +29,7 @@ pair_coeff * *
#fix 2 all scafacos p3m tolerance field 0.001
kspace_style scafacos p3m 0.001
kspace_style scafacos tolerance field
#kspace_style scafacos tolerance field
timestep 0.005
thermo 10

9029
examples/rdf-adf/data.spce Normal file

File diff suppressed because it is too large Load Diff

45
examples/rdf-adf/in.spce Normal file
View File

@ -0,0 +1,45 @@
# Liquid water RDFs and ADFs (~12 O-O-O/atom, ~1 O-H...O/atom)
units real
atom_style full
read_data data.spce
pair_style lj/cut/coul/long 12.0 12.0
pair_coeff * * 0.0 1.0
pair_coeff 1 1 0.15535 3.166
kspace_style pppm 1.0e-6
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
# need to set bond/angle inclusion to > 0.0
# so that intramolecular pairs are included in neighbor lists (required for second ADF)
special_bonds lj/coul 1.0e-100 1.0e-100 1.0
neighbor 2.0 bin
timestep 2.0
neigh_modify every 1 delay 2 check yes
fix 1 all shake 0.0001 20 0 b 1 a 1
fix 2 all nvt temp 300.0 300.0 100.0
velocity all create 300.0 6244325
thermo 100
run 500
reset_timestep 0
compute gofr all rdf 100 1 1 2 2 1 2 # O-O, H-H, O-H
compute gofa all adf 45 1 1 1 2.0 3.5 2.0 3.5 &
2 1 1 0.0 1.2 1.5 2.5 # O-O-O, O-H...O
fix rdf all ave/time 100 10 1000 c_gofr[*] file spce-rdf.dat mode vector
fix adf all ave/time 10 100 1000 c_gofa[*] file spce-adf.dat mode vector
run 1000

View File

@ -0,0 +1,202 @@
LAMMPS (10 Oct 2018)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (src/comm.cpp:87)
using 1 OpenMP thread(s) per MPI task
units real
atom_style full
read_data data.spce
orthogonal box = (0.02645 0.02645 0.02641) to (35.5328 35.5328 35.4736)
1 by 2 by 1 MPI processor grid
reading atoms ...
4500 atoms
scanning bonds ...
2 = max bonds/atom
scanning angles ...
1 = max angles/atom
reading bonds ...
3000 bonds
reading angles ...
1500 angles
2 = max # of 1-2 neighbors
1 = max # of 1-3 neighbors
1 = max # of 1-4 neighbors
2 = max # of special neighbors
pair_style lj/cut/coul/long 12.0 12.0
pair_coeff * * 0.0 1.0
pair_coeff 1 1 0.15535 3.166
kspace_style pppm 1.0e-6
bond_style harmonic
angle_style harmonic
dihedral_style none
improper_style none
bond_coeff 1 1000.00 1.000
angle_coeff 1 100.0 109.47
# need to set bond/angle inclusion to > 0.0
# so that intramolecular pairs are included in neighbor lists (required for second ADF)
special_bonds lj/coul 1.0e-100 1.0e-100 1.0
2 = max # of 1-2 neighbors
1 = max # of 1-3 neighbors
2 = max # of special neighbors
neighbor 2.0 bin
timestep 2.0
neigh_modify every 1 delay 2 check yes
fix 1 all shake 0.0001 20 0 b 1 a 1
0 = # of size 2 clusters
0 = # of size 3 clusters
0 = # of size 4 clusters
1500 = # of frozen angles
fix 2 all nvt temp 300.0 300.0 100.0
velocity all create 300.0 6244325
thermo 100
run 500
PPPM initialization ...
using 12-bit tables for long-range coulomb (src/kspace.cpp:321)
G vector (1/distance) = 0.279652
grid = 40 40 40
stencil order = 5
estimated absolute RMS force accuracy = 0.000394674
estimated relative force accuracy = 1.18855e-06
using double precision FFTs
3d grid and FFT values/proc = 59643 32000
Neighbor list info ...
update every 1 steps, delay 2 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 14
ghost atom cutoff = 14
binsize = 7, bins = 6 6 6
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair lj/cut/coul/long, perpetual
attributes: half, newton on
pair build: half/bin/newton
stencil: half/bin/3d/newton
bin: standard
Per MPI rank memory allocation (min/avg/max) = 25.06 | 25.25 | 25.44 Mbytes
Step Temp E_pair E_mol TotEng Press
0 300 -16692.369 0 -14010.534 -112.83562
100 283.44729 -17008.717 0 -14474.854 -162.06374
200 298.75279 -16765.544 0 -14094.858 428.79127
300 296.6501 -16589.155 0 -13937.267 547.40768
400 303.83151 -16625.028 0 -13908.942 237.9775
500 298.01615 -16717.015 0 -14052.915 230.7095
Loop time of 21.4041 on 2 procs for 500 steps with 4500 atoms
Performance: 4.037 ns/day, 5.946 hours/ns, 23.360 timesteps/s
94.8% CPU use with 2 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 14.892 | 15.034 | 15.176 | 3.7 | 70.24
Bond | 0.00056624 | 0.00059342 | 0.0006206 | 0.0 | 0.00
Kspace | 3.987 | 4.1321 | 4.2773 | 7.1 | 19.31
Neigh | 1.7494 | 1.7496 | 1.7497 | 0.0 | 8.17
Comm | 0.20554 | 0.20637 | 0.2072 | 0.2 | 0.96
Output | 0.00015688 | 0.00036144 | 0.00056601 | 0.0 | 0.00
Modify | 0.25707 | 0.2606 | 0.26413 | 0.7 | 1.22
Other | | 0.02059 | | | 0.10
Nlocal: 2250 ave 2258 max 2242 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Nghost: 16319 ave 16381 max 16257 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Neighs: 1.30073e+06 ave 1.32386e+06 max 1.2776e+06 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Total # of neighbors = 2601457
Ave neighs/atom = 578.102
Ave special neighs/atom = 2
Neighbor list builds = 45
Dangerous builds = 0
reset_timestep 0
compute gofr all rdf 100 1 1 2 2 1 2 # O-O, H-H, O-H
compute gofa all adf 45 1 1 1 2.0 3.5 2.0 3.5 1 2 1 0.0 1.2 1.5 2.5
fix rdf all ave/time 100 10 1000 c_gofr[*] file spce-rdf.dat mode vector
fix adf all ave/time 10 100 1000 c_gofa[*] file spce-adf.dat mode vector
run 1000
PPPM initialization ...
using 12-bit tables for long-range coulomb (src/kspace.cpp:321)
G vector (1/distance) = 0.279652
grid = 40 40 40
stencil order = 5
estimated absolute RMS force accuracy = 0.000394674
estimated relative force accuracy = 1.18855e-06
using double precision FFTs
3d grid and FFT values/proc = 59643 32000
Neighbor list info ...
update every 1 steps, delay 2 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 14
ghost atom cutoff = 14
binsize = 7, bins = 6 6 6
3 neighbor lists, perpetual/occasional/extra = 1 2 0
(1) pair lj/cut/coul/long, perpetual
attributes: half, newton on
pair build: half/bin/newton
stencil: half/bin/3d/newton
bin: standard
(2) compute rdf, occasional, copy from (1)
attributes: half, newton on
pair build: copy
stencil: none
bin: none
(3) compute adf, occasional
attributes: full, newton on
pair build: full/bin
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 26.78 | 26.78 | 26.78 Mbytes
Step Temp E_pair E_mol TotEng Press
0 298.01615 -16717.015 0 -14052.915 230.81371
100 307.1766 -16759.33 0 -14013.341 454.2771
200 298.94628 -16674.186 0 -14001.771 114.20846
300 293.13091 -16581.542 0 -13961.113 272.85574
400 294.47017 -16556.872 0 -13924.471 180.3252
500 305.57174 -16647.976 0 -13916.333 -444.14856
600 302.53992 -16670.304 0 -13965.764 114.82353
700 306.56761 -16616.508 0 -13875.962 534.02537
800 299.06297 -16644.133 0 -13970.675 83.643063
900 301.15522 -16674.021 0 -13981.859 325.04538
1000 298.14963 -16701.663 0 -14036.369 356.0601
Loop time of 53.3181 on 2 procs for 1000 steps with 4500 atoms
Performance: 3.241 ns/day, 7.405 hours/ns, 18.755 timesteps/s
97.3% CPU use with 2 MPI tasks x 1 OpenMP threads
MPI task timing breakdown:
Section | min time | avg time | max time |%varavg| %total
---------------------------------------------------------------
Pair | 28.831 | 29.365 | 29.899 | 9.9 | 55.07
Bond | 0.00097084 | 0.0010794 | 0.001188 | 0.3 | 0.00
Kspace | 7.3086 | 7.8356 | 8.3626 | 18.8 | 14.70
Neigh | 3.7241 | 3.7245 | 3.7248 | 0.0 | 6.99
Comm | 0.32839 | 0.33495 | 0.34151 | 1.1 | 0.63
Output | 0.00043344 | 0.0015392 | 0.002645 | 2.8 | 0.00
Modify | 12.013 | 12.014 | 12.015 | 0.0 | 22.53
Other | | 0.04153 | | | 0.08
Nlocal: 2250 ave 2251 max 2249 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Nghost: 16300 ave 16358 max 16242 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Neighs: 1.301e+06 ave 1.31594e+06 max 1.28606e+06 min
Histogram: 1 0 0 0 0 0 0 0 0 1
FullNghs: 2.602e+06 ave 2.60923e+06 max 2.59476e+06 min
Histogram: 1 0 0 0 0 0 0 0 0 1
Total # of neighbors = 5203998
Ave neighs/atom = 1156.44
Ave special neighs/atom = 2
Neighbor list builds = 93
Dangerous builds = 0
Total wall time: 0:01:14

View File

@ -0,0 +1,49 @@
# Time-averaged data for fix adf
# TimeStep Number-of-rows
# Row c_gofa[1] c_gofa[2] c_gofa[3] c_gofa[4] c_gofa[5]
1000 45
1 2 0 0 0 0
2 6 0 0 0 0
3 10 0 0 0 0
4 14 0 0 0 0
5 18 0 0 0 0
6 22 0 0 0 0
7 26 0 0 0 0
8 30 0 0 0 0
9 34 0 0 0 0
10 38 0 0 0 0
11 42 2.66805e-05 0.00123333 0 0
12 46 0.00168251 0.07888 0 0
13 50 0.00730338 0.41588 0 0
14 54 0.00883969 0.82378 0 0
15 58 0.00712558 1.15264 0 0
16 62 0.00681516 1.46717 0 0
17 66 0.00753965 1.81511 0 0
18 70 0.0086394 2.21377 0 0
19 74 0.00958735 2.65613 0 0
20 78 0.0102438 3.12873 5.076e-06 2e-05
21 82 0.0108097 3.62739 2.62642e-05 0.000123333
22 86 0.0112538 4.14651 0.000100091 0.000516667
23 90 0.0115997 4.68151 0.000173925 0.0012
24 94 0.0118726 5.22921 0.00025685 0.00221
25 98 0.0118616 5.77635 0.000341943 0.00355333
26 102 0.0117868 6.32011 0.000488452 0.00547333
27 106 0.0115064 6.85083 0.000753934 0.00843667
28 110 0.0111827 7.36672 0.00118587 0.0130967
29 114 0.0106304 7.85709 0.00157663 0.0192933
30 118 0.0100947 8.32278 0.00223856 0.0280933
31 122 0.009349 8.75409 0.00295997 0.0397267
32 126 0.008637 9.15256 0.00363466 0.05401
33 130 0.00785049 9.51475 0.00480604 0.0728967
34 134 0.00712391 9.8434 0.00617924 0.09718
35 138 0.00633303 10.1356 0.00801778 0.12869
36 142 0.00574158 10.4005 0.0105777 0.170257
37 146 0.00509275 10.6354 0.0138935 0.224857
38 150 0.0045349 10.8446 0.0182593 0.296613
39 154 0.00398109 11.0283 0.0234156 0.38863
40 158 0.00334665 11.1827 0.0283932 0.500213
41 162 0.00273371 11.3088 0.032517 0.627997
42 166 0.00212695 11.407 0.0330644 0.757927
43 170 0.00153822 11.4779 0.0292715 0.872957
44 174 0.000912858 11.52 0.0205789 0.953827
45 178 0.000296337 11.5337 0.00728348 0.98245

View File

@ -0,0 +1,104 @@
# Time-averaged data for fix rdf
# TimeStep Number-of-rows
# Row c_gofr[1] c_gofr[2] c_gofr[3] c_gofr[4] c_gofr[5] c_gofr[6] c_gofr[7]
1000 100
1 0.06 0 0 0 0 0 0
2 0.18 0 0 0 0 0 0
3 0.3 0 0 0 0 0 0
4 0.42 0 0 0 0 0 0
5 0.54 0 0 0 0 0 0
6 0.66 0 0 0 0 0 0
7 0.78 0 0 0 0 0 0
8 0.9 0 0 0 0 0 0
9 1.02 0 0 0 0 18.9675 2
10 1.14 0 0 0 0 0 2
11 1.26 0 0 0 0 0 2
12 1.38 0 0 0 0 0 2
13 1.5 0 0 0.00146316 0.000333333 0.0485606 2.01107
14 1.62 0 0 3.77986 1.00467 0.691259 2.1948
15 1.74 0 0 0.087001 1.03133 1.5081 2.6572
16 1.86 0 0 0.261354 1.12287 1.29225 3.10993
17 1.98 0 0 0.557712 1.3442 0.791284 3.42407
18 2.1 0 0 0.890071 1.74153 0.441155 3.62107
19 2.22 0 0 1.18482 2.3326 0.280275 3.76093
20 2.34 0 0 1.33539 3.07273 0.203573 3.8738
21 2.46 0.0296137 0.00906667 1.31236 3.8766 0.199433 3.996
22 2.58 0.910251 0.3156 1.12596 4.6352 0.252635 4.16627
23 2.7 2.74616 1.3284 0.92755 5.3196 0.399944 4.46147
24 2.82 2.69277 2.41173 0.776668 5.94473 0.620912 4.9614
25 2.94 1.69749 3.154 0.715559 6.57073 0.927784 5.77333
26 3.06 1.12844 3.68853 0.734337 7.26667 1.28373 6.99033
27 3.18 0.894502 4.14613 0.785685 8.0708 1.53008 8.55687
28 3.3 0.830879 4.60387 0.853285 9.01127 1.55205 10.2681
29 3.42 0.837147 5.0992 0.940998 10.1252 1.42789 11.9589
30 3.54 0.87264 5.6524 1.02352 11.4233 1.30488 13.6145
31 3.66 0.890146 6.2556 1.10007 12.9147 1.15043 15.1747
32 3.78 0.923629 6.9232 1.14816 14.5751 1.05067 16.6945
33 3.9 0.948076 7.65267 1.1789 16.3898 0.995284 18.2271
34 4.02 1.02003 8.48653 1.14251 18.2584 0.987649 19.843
35 4.14 1.05003 9.39693 1.09918 20.1651 0.973183 21.5317
36 4.26 1.0578 10.368 1.05588 22.1043 0.968154 23.3104
37 4.38 1.08788 11.4237 1.04202 24.1275 0.95294 25.1612
38 4.5 1.0991 12.5496 1.02603 26.2302 0.948747 27.1062
39 4.62 1.08758 13.7239 1.0199 28.4333 0.952182 29.1637
40 4.74 1.08319 14.9549 1.0085 30.7265 0.958425 31.3437
41 4.86 1.06718 16.23 1.0021 33.1219 0.966773 33.6555
42 4.98 1.0236 17.5141 0.983127 35.5894 0.975683 36.1051
43 5.1 0.979245 18.8025 0.968484 38.1387 0.993353 38.7208
44 5.22 0.967438 20.136 0.960781 40.7882 1.0117 41.5116
45 5.34 0.9397 21.4915 0.95327 43.5392 1.02048 44.4575
46 5.46 0.933775 22.8996 0.957903 46.4292 1.02138 47.5401
47 5.58 0.905728 24.3261 0.96475 49.4692 1.01134 50.7279
48 5.7 0.908316 25.8189 0.985709 52.7103 1.00699 54.0401
49 5.82 0.922062 27.3988 0.992001 56.1108 0.993731 57.4477
50 5.94 0.933444 29.0648 1.00316 59.6929 0.985977 60.9695
51 6.06 0.967112 30.8613 1.00148 63.4149 0.975667 64.5968
52 6.18 0.995762 32.7851 1.00378 67.2946 0.966562 68.3339
53 6.3 1.01856 34.83 1.01103 71.3556 0.980183 72.2723
54 6.42 1.02375 36.9644 1.00763 75.5586 0.975791 76.3439
55 6.54 1.02443 39.1808 1.0048 79.9079 0.988272 80.6231
56 6.66 1.04424 41.5237 0.994556 84.3723 0.992933 85.0817
57 6.78 1.02624 43.91 0.993082 88.9922 1.00275 89.7481
58 6.9 1.05342 46.4469 0.995881 93.7905 1.0039 94.5867
59 7.02 1.04804 49.0595 1.0028 98.7917 1.0061 99.606
60 7.14 1.03565 51.7301 0.999035 103.946 1.00976 104.817
61 7.26 1.01185 54.4279 0.999229 109.276 1.01388 110.227
62 7.38 1.00714 57.2025 0.997563 114.774 1.02243 115.864
63 7.5 0.997335 60.0403 1.00429 120.491 1.01948 121.67
64 7.62 0.98964 62.9469 1.00029 126.369 1.01107 127.613
65 7.74 0.986472 65.9363 1.01014 132.493 1.0127 133.755
66 7.86 0.976805 68.9888 1.0082 138.797 1.00837 140.061
67 7.98 0.980184 72.1461 1.00972 145.304 1.00029 146.51
68 8.1 0.99097 75.4349 1.00403 151.97 0.999714 153.15
69 8.22 0.988581 78.8137 1.00883 158.869 1.00011 159.991
70 8.34 1.0046 82.3483 1.00269 165.927 0.994842 166.996
71 8.46 0.987279 85.9225 0.997968 173.155 0.990283 174.171
72 8.58 1.00046 89.648 0.999277 180.6 0.990097 181.55
73 8.7 1.00036 93.478 0.999683 188.257 0.987047 189.113
74 8.82 1.00138 97.4184 0.995158 196.091 0.991812 196.923
75 8.94 1.02075 101.545 0.999836 204.178 0.991287 204.944
76 9.06 1.00201 105.705 0.99005 212.403 0.996973 213.228
77 9.18 0.990377 109.927 0.994103 220.881 1.00126 221.77
78 9.3 1.0021 114.311 0.998366 229.619 0.997051 230.5
79 9.42 1.00911 118.841 0.996714 238.57 1.00147 239.496
80 9.54 1.00129 123.45 0.997009 247.752 1.00442 248.751
81 9.66 0.994425 128.144 0.999099 257.187 1.0036 258.231
82 9.78 0.99875 132.976 1.00089 266.876 1.00798 267.991
83 9.9 1.00475 137.958 1.00485 276.842 1.00223 277.935
84 10.02 1.00821 143.078 1.00531 287.057 1.00199 288.119
85 10.14 1.00146 148.286 1.00396 297.503 1.00607 298.591
86 10.26 0.987716 153.546 1.00115 308.168 1.00195 309.269
87 10.38 0.996668 158.978 0.999956 319.072 0.999207 320.167
88 10.5 1.00737 164.595 1.00266 330.259 0.999525 331.323
89 10.62 1.00322 170.319 1.00368 341.714 0.991347 342.642
90 10.74 1.00197 176.165 1.00151 353.405 1.00118 354.333
91 10.86 1.01265 182.206 0.997669 365.313 1.00021 366.275
92 10.98 1.00566 188.339 1.00218 377.54 0.998434 378.46
93 11.1 1.00615 194.61 0.998681 389.992 1.00219 390.96
94 11.22 0.989815 200.913 0.994781 402.666 0.996803 403.664
95 11.34 0.995666 207.389 0.998115 415.655 0.99786 416.654
96 11.46 0.990077 213.966 0.999458 428.938 1.00053 429.956
97 11.58 0.992053 220.695 0.997809 442.479 0.994388 443.455
98 11.7 1.00038 227.622 0.999064 456.319 1.00445 457.374
99 11.82 0.99774 234.673 1.00106 470.473 0.998027 471.49
100 11.94 1.00539 241.923 0.99896 484.885 1.00035 485.927

8
src/.gitignore vendored
View File

@ -269,6 +269,8 @@
/compute_dpd.h
/compute_dpd_atom.cpp
/compute_dpd_atom.h
/compute_entropy_atom.cpp
/compute_entropy_atom.h
/compute_erotate_asphere.cpp
/compute_erotate_asphere.h
/compute_erotate_rigid.cpp
@ -311,8 +313,8 @@
/compute_spec_atom.h
/compute_stress_mop.cpp
/compute_stress_mop.h
/compute_stress_mop.profile.cpp
/compute_stress_mop.profile.h
/compute_stress_mop_profile.cpp
/compute_stress_mop_profile.h
/compute_stress_tally.cpp
/compute_stress_tally.h
/compute_temp_asphere.cpp
@ -746,6 +748,8 @@
/pair_eam_cd.h
/pair_eam_fs.cpp
/pair_eam_fs.h
/pair_lj_expand_coul_long.cpp
/pair_lj_expand_coul_long.h
/pair_edip.cpp
/pair_edip.h
/pair_edip_multi.cpp

View File

@ -89,10 +89,8 @@ void PPPM_GPU_API(forces)(double **f);
/* ---------------------------------------------------------------------- */
PPPMGPU::PPPMGPU(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
PPPMGPU::PPPMGPU(LAMMPS *lmp) : PPPM(lmp)
{
if (narg != 1) error->all(FLERR,"Illegal kspace_style pppm/gpu command");
triclinic_support = 0;
density_brick_gpu = vd_brick = NULL;
kspace_split = false;

View File

@ -26,7 +26,7 @@ namespace LAMMPS_NS {
class PPPMGPU : public PPPM {
public:
PPPMGPU(class LAMMPS *, int, char **);
PPPMGPU(class LAMMPS *);
virtual ~PPPMGPU();
void init();
void setup();

View File

@ -34,7 +34,7 @@ class FixFreeze : public Fix {
void post_force_respa(int, int, int);
double compute_vector(int);
private:
protected:
int force_flag;
double foriginal[3],foriginal_all[3];
};

View File

@ -53,6 +53,8 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 6) error->all(FLERR,"Illegal fix pour command");
if (lmp->kokkos) error->all(FLERR,"Cannot yet use fix pour with the KOKKOS package");
time_depend = 1;
if (!atom->radius_flag || !atom->rmass_flag)
@ -181,6 +183,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
for (ifix = 0; ifix < modify->nfix; ifix++) {
if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
if (strcmp(modify->fix[ifix]->style,"gravity/omp") == 0) break;
if (strstr(modify->fix[ifix]->style,"gravity/kk") != NULL) break;
}
if (ifix == modify->nfix)
error->all(FLERR,"No fix gravity defined for fix pour");
@ -315,6 +318,7 @@ void FixPour::init()
for (ifix = 0; ifix < modify->nfix; ifix++) {
if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
if (strcmp(modify->fix[ifix]->style,"gravity/omp") == 0) break;
if (strstr(modify->fix[ifix]->style,"gravity/kk") != NULL) break;
}
if (ifix == modify->nfix)
error->all(FLERR,"No fix gravity defined for fix pour");

View File

@ -89,6 +89,10 @@ Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Cannot yet use fix pour with the KOKKOS package
This feature is not yet supported.
E: Fix pour requires atom attributes radius, rmass
The atom style defined does not have these attributes.

View File

@ -63,6 +63,8 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp)
PairGranHookeHistory::~PairGranHookeHistory()
{
if (copymode) return;
delete [] svector;
if (fix_history) modify->delete_fix("NEIGH_HISTORY");

View File

@ -71,6 +71,8 @@ action atom_vec_kokkos.cpp
action atom_vec_kokkos.h
action atom_vec_molecular_kokkos.cpp atom_vec_molecular.cpp
action atom_vec_molecular_kokkos.h atom_vec_molecular.h
action atom_vec_sphere_kokkos.cpp atom_vec_sphere.cpp
action atom_vec_sphere_kokkos.h atom_vec_sphere.h
action bond_class2_kokkos.cpp bond_class2.cpp
action bond_class2_kokkos.h bond_class2.h
action bond_fene_kokkos.cpp bond_fene.cpp
@ -97,8 +99,14 @@ action fix_enforce2d_kokkos.cpp
action fix_enforce2d_kokkos.h
action fix_eos_table_rx_kokkos.cpp fix_eos_table_rx.cpp
action fix_eos_table_rx_kokkos.h fix_eos_table_rx.h
action fix_freeze_kokkos.cpp fix_freeze.cpp
action fix_freeze_kokkos.h fix_freeze.h
action fix_gravity_kokkos.cpp
action fix_gravity_kokkos.h
action fix_langevin_kokkos.cpp
action fix_langevin_kokkos.h
action fix_neigh_history_kokkos.cpp
action fix_neigh_history_kokkos.h
action fix_nh_kokkos.cpp
action fix_nh_kokkos.h
action fix_nph_kokkos.cpp
@ -107,6 +115,8 @@ action fix_npt_kokkos.cpp
action fix_npt_kokkos.h
action fix_nve_kokkos.cpp
action fix_nve_kokkos.h
action fix_nve_sphere_kokkos.cpp
action fix_nve_sphere_kokkos.h
action fix_nvt_kokkos.cpp
action fix_nvt_kokkos.h
action fix_property_atom_kokkos.cpp
@ -193,6 +203,8 @@ action pair_eam_fs_kokkos.cpp pair_eam_fs.cpp
action pair_eam_fs_kokkos.h pair_eam_fs.h
action pair_exp6_rx_kokkos.cpp pair_exp6_rx.cpp
action pair_exp6_rx_kokkos.h pair_exp6_rx.h
action pair_gran_hooke_history_kokkos.h pair_gran_hooke_history.h
action pair_gran_hooke_history_kokkos.cpp pair_gran_hooke_history.cpp
action pair_hybrid_kokkos.cpp
action pair_hybrid_kokkos.h
action pair_hybrid_overlay_kokkos.cpp

View File

@ -48,6 +48,8 @@ AtomVecDPDKokkos::AtomVecDPDKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp)
k_count = DAT::tdual_int_1d("atom::k_count",1);
atomKK = (AtomKokkos *) atom;
commKK = (CommKokkos *) comm;
no_comm_vel_flag = 1;
}
/* ----------------------------------------------------------------------

View File

@ -26,7 +26,10 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
AtomVecHybridKokkos::AtomVecHybridKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) {}
AtomVecHybridKokkos::AtomVecHybridKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) {
no_comm_vel_flag = 1;
no_border_vel_flag = 1;
}
/* ---------------------------------------------------------------------- */

View File

@ -26,6 +26,9 @@ AtomVecKokkos::AtomVecKokkos(LAMMPS *lmp) : AtomVec(lmp)
kokkosable = 1;
buffer = NULL;
buffer_size = 0;
no_comm_vel_flag = 0;
no_border_vel_flag = 1;
}
/* ---------------------------------------------------------------------- */
@ -305,6 +308,277 @@ void AtomVecKokkos::unpack_comm_kokkos(const int &n, const int &first,
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType,int PBC_FLAG,int TRICLINIC,int DEFORM_VREMAP>
struct AtomVecKokkos_PackCommVel {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array_randomread _x;
typename ArrayTypes<DeviceType>::t_int_1d _mask;
typename ArrayTypes<DeviceType>::t_v_array _v;
typename ArrayTypes<DeviceType>::t_xfloat_2d_um _buf;
typename ArrayTypes<DeviceType>::t_int_2d_const _list;
const int _iswap;
X_FLOAT _xprd,_yprd,_zprd,_xy,_xz,_yz;
X_FLOAT _pbc[6];
X_FLOAT _h_rate[6];
const int _deform_vremap;
AtomVecKokkos_PackCommVel(
const typename DAT::tdual_x_array &x,
const typename DAT::tdual_int_1d &mask,
const typename DAT::tdual_v_array &v,
const typename DAT::tdual_xfloat_2d &buf,
const typename DAT::tdual_int_2d &list,
const int &iswap,
const X_FLOAT &xprd, const X_FLOAT &yprd, const X_FLOAT &zprd,
const X_FLOAT &xy, const X_FLOAT &xz, const X_FLOAT &yz, const int* const pbc,
const double * const h_rate,
const int &deform_vremap):
_x(x.view<DeviceType>()),
_mask(mask.view<DeviceType>()),
_v(v.view<DeviceType>()),
_list(list.view<DeviceType>()),_iswap(iswap),
_xprd(xprd),_yprd(yprd),_zprd(zprd),
_xy(xy),_xz(xz),_yz(yz),
_deform_vremap(deform_vremap)
{
const size_t elements = 6;
const int maxsend = (buf.template view<DeviceType>().extent(0)*buf.template view<DeviceType>().extent(1))/elements;
_buf = typename ArrayTypes<DeviceType>::t_xfloat_2d_um(buf.view<DeviceType>().data(),maxsend,elements);
_pbc[0] = pbc[0]; _pbc[1] = pbc[1]; _pbc[2] = pbc[2];
_pbc[3] = pbc[3]; _pbc[4] = pbc[4]; _pbc[5] = pbc[5];
_h_rate[0] = h_rate[0]; _h_rate[1] = h_rate[1]; _h_rate[2] = h_rate[2];
_h_rate[3] = h_rate[3]; _h_rate[4] = h_rate[4]; _h_rate[5] = h_rate[5];
}
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
const int j = _list(_iswap,i);
if (PBC_FLAG == 0) {
_buf(i,0) = _x(j,0);
_buf(i,1) = _x(j,1);
_buf(i,2) = _x(j,2);
_buf(i,3) = _v(j,0);
_buf(i,4) = _v(j,1);
_buf(i,5) = _v(j,2);
} else {
if (TRICLINIC == 0) {
_buf(i,0) = _x(j,0) + _pbc[0]*_xprd;
_buf(i,1) = _x(j,1) + _pbc[1]*_yprd;
_buf(i,2) = _x(j,2) + _pbc[2]*_zprd;
} else {
_buf(i,0) = _x(j,0) + _pbc[0]*_xprd + _pbc[5]*_xy + _pbc[4]*_xz;
_buf(i,1) = _x(j,1) + _pbc[1]*_yprd + _pbc[3]*_yz;
_buf(i,2) = _x(j,2) + _pbc[2]*_zprd;
}
if (DEFORM_VREMAP == 0) {
_buf(i,3) = _v(j,0);
_buf(i,4) = _v(j,1);
_buf(i,5) = _v(j,2);
} else {
if (_mask(i) & _deform_vremap) {
_buf(i,3) = _v(j,0) + _pbc[0]*_h_rate[0] + _pbc[5]*_h_rate[5] + _pbc[4]*_h_rate[4];
_buf(i,4) = _v(j,1) + _pbc[1]*_h_rate[1] + _pbc[3]*_h_rate[3];
_buf(i,5) = _v(j,2) + _pbc[2]*_h_rate[2];
} else {
_buf(i,3) = _v(j,0);
_buf(i,4) = _v(j,1);
_buf(i,5) = _v(j,2);
}
}
}
}
};
/* ---------------------------------------------------------------------- */
int AtomVecKokkos::pack_comm_vel_kokkos(
const int &n,
const DAT::tdual_int_2d &list,
const int & iswap,
const DAT::tdual_xfloat_2d &buf,
const int &pbc_flag,
const int* const pbc)
{
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK|V_MASK);
if (pbc_flag) {
if (deform_vremap) {
if (domain->triclinic) {
struct AtomVecKokkos_PackCommVel<LMPHostType,1,1,1> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecKokkos_PackCommVel<LMPHostType,1,0,1> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecKokkos_PackCommVel<LMPHostType,1,1,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecKokkos_PackCommVel<LMPHostType,1,0,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
}
}
} else {
if(domain->triclinic) {
struct AtomVecKokkos_PackCommVel<LMPHostType,0,1,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecKokkos_PackCommVel<LMPHostType,0,0,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
}
}
} else {
sync(Device,X_MASK|V_MASK);
if(pbc_flag) {
if(deform_vremap) {
if(domain->triclinic) {
struct AtomVecKokkos_PackCommVel<LMPDeviceType,1,1,1> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecKokkos_PackCommVel<LMPDeviceType,1,0,1> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
}
} else {
if(domain->triclinic) {
struct AtomVecKokkos_PackCommVel<LMPDeviceType,1,1,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecKokkos_PackCommVel<LMPDeviceType,1,0,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
}
}
} else {
if(domain->triclinic) {
struct AtomVecKokkos_PackCommVel<LMPDeviceType,0,1,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
} else {
struct AtomVecKokkos_PackCommVel<LMPDeviceType,0,0,0> f(
atomKK->k_x,atomKK->k_mask,
atomKK->k_v,
buf,list,iswap,
domain->xprd,domain->yprd,domain->zprd,
domain->xy,domain->xz,domain->yz,pbc,h_rate,deform_vremap);
Kokkos::parallel_for(n,f);
}
}
}
return n*6;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
struct AtomVecKokkos_UnpackCommVel {
typedef DeviceType device_type;
typename ArrayTypes<DeviceType>::t_x_array _x;
typename ArrayTypes<DeviceType>::t_v_array _v;
typename ArrayTypes<DeviceType>::t_xfloat_2d_const _buf;
int _first;
AtomVecKokkos_UnpackCommVel(
const typename DAT::tdual_x_array &x,
const typename DAT::tdual_v_array &v,
const typename DAT::tdual_xfloat_2d &buf,
const int& first):
_x(x.view<DeviceType>()),
_v(v.view<DeviceType>()),
_first(first)
{
const size_t elements = 6;
const int maxsend = (buf.template view<DeviceType>().extent(0)*buf.template view<DeviceType>().extent(1))/elements;
buffer_view<DeviceType>(_buf,buf,maxsend,elements);
};
KOKKOS_INLINE_FUNCTION
void operator() (const int& i) const {
_x(i+_first,0) = _buf(i,0);
_x(i+_first,1) = _buf(i,1);
_x(i+_first,2) = _buf(i,2);
_v(i+_first,0) = _buf(i,3);
_v(i+_first,1) = _buf(i,4);
_v(i+_first,2) = _buf(i,5);
}
};
/* ---------------------------------------------------------------------- */
void AtomVecKokkos::unpack_comm_vel_kokkos(const int &n, const int &first,
const DAT::tdual_xfloat_2d &buf ) {
if(commKK->forward_comm_on_host) {
sync(Host,X_MASK|V_MASK);
modified(Host,X_MASK|V_MASK);
struct AtomVecKokkos_UnpackCommVel<LMPHostType> f(atomKK->k_x,atomKK->k_v,buf,first);
Kokkos::parallel_for(n,f);
} else {
sync(Device,X_MASK|V_MASK);
modified(Device,X_MASK|V_MASK);
struct AtomVecKokkos_UnpackCommVel<LMPDeviceType> f(atomKK->k_x,atomKK->k_v,buf,first);
Kokkos::parallel_for(n,f);
}
}
/* ---------------------------------------------------------------------- */
int AtomVecKokkos::pack_comm(int n, int *list, double *buf,

View File

@ -60,6 +60,15 @@ class AtomVecKokkos : public AtomVec {
unpack_comm_kokkos(const int &n, const int &nfirst,
const DAT::tdual_xfloat_2d &buf);
virtual int
pack_comm_vel_kokkos(const int &n, const DAT::tdual_int_2d &list,
const int & iswap, const DAT::tdual_xfloat_2d &buf,
const int &pbc_flag, const int pbc[]);
virtual void
unpack_comm_vel_kokkos(const int &n, const int &nfirst,
const DAT::tdual_xfloat_2d &buf);
virtual int
unpack_reverse_self(const int &n, const DAT::tdual_int_2d &list,
const int & iswap, const int nfirst);
@ -82,6 +91,16 @@ class AtomVecKokkos : public AtomVec {
const DAT::tdual_xfloat_2d &buf,
ExecutionSpace space) = 0;
virtual int
pack_border_vel_kokkos(int n, DAT::tdual_int_2d k_sendlist,
DAT::tdual_xfloat_2d buf,int iswap,
int pbc_flag, int *pbc, ExecutionSpace space) { return 0; }
virtual void
unpack_border_vel_kokkos(const int &n, const int &nfirst,
const DAT::tdual_xfloat_2d &buf,
ExecutionSpace space) {}
virtual int
pack_exchange_kokkos(const int &nsend, DAT::tdual_xfloat_2d &buf,
DAT::tdual_int_1d k_sendlist,
@ -94,6 +113,8 @@ class AtomVecKokkos : public AtomVec {
ExecutionSpace space) = 0;
int no_comm_vel_flag,no_border_vel_flag;
protected:
HAT::t_x_array h_x;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,169 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef ATOM_CLASS
AtomStyle(sphere/kk,AtomVecSphereKokkos)
AtomStyle(sphere/kk/device,AtomVecSphereKokkos)
AtomStyle(sphere/kk/host,AtomVecSphereKokkos)
#else
#ifndef LMP_ATOM_VEC_SPHERE_KOKKOS_H
#define LMP_ATOM_VEC_SPHERE_KOKKOS_H
#include "atom_vec_kokkos.h"
#include "kokkos_type.h"
namespace LAMMPS_NS {
class AtomVecSphereKokkos : public AtomVecKokkos {
public:
AtomVecSphereKokkos(class LAMMPS *);
~AtomVecSphereKokkos() {}
void init();
void grow(int);
void grow_reset();
void copy(int, int, int);
int pack_comm(int, int *, double *, int, int *);
int pack_comm_vel(int, int *, double *, int, int *);
int pack_comm_hybrid(int, int *, double *);
void unpack_comm(int, int, double *);
void unpack_comm_vel(int, int, double *);
int unpack_comm_hybrid(int, int, double *);
int pack_reverse(int, int, double *);
int pack_reverse_hybrid(int, int, double *);
void unpack_reverse(int, int *, double *);
int unpack_reverse_hybrid(int, int *, double *);
int pack_border(int, int *, double *, int, int *);
int pack_border_vel(int, int *, double *, int, int *);
int pack_border_hybrid(int, int *, double *);
void unpack_border(int, int, double *);
void unpack_border_vel(int, int, double *);
int unpack_border_hybrid(int, int, double *);
int pack_exchange(int, double *);
int unpack_exchange(double *);
int size_restart();
int pack_restart(int, double *);
int unpack_restart(double *);
void create_atom(int, double *);
void data_atom(double *, imageint, char **);
int data_atom_hybrid(int, char **);
void data_vel(int, char **);
int data_vel_hybrid(int, char **);
void pack_data(double **);
int pack_data_hybrid(int, double *);
void write_data(FILE *, int, double **);
int write_data_hybrid(FILE *, double *);
void pack_vel(double **);
int pack_vel_hybrid(int, double *);
void write_vel(FILE *, int, double **);
int write_vel_hybrid(FILE *, double *);
bigint memory_usage();
int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist,
const int & iswap,
const DAT::tdual_xfloat_2d &buf,
const int &pbc_flag, const int pbc[]);
void unpack_comm_kokkos(const int &n, const int &nfirst,
const DAT::tdual_xfloat_2d &buf);
int pack_comm_vel_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist,
const int & iswap,
const DAT::tdual_xfloat_2d &buf,
const int &pbc_flag, const int pbc[]);
void unpack_comm_vel_kokkos(const int &n, const int &nfirst,
const DAT::tdual_xfloat_2d &buf);
int pack_comm_self(const int &n, const DAT::tdual_int_2d &list,
const int & iswap, const int nfirst,
const int &pbc_flag, const int pbc[]);
int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist,
DAT::tdual_xfloat_2d buf,int iswap,
int pbc_flag, int *pbc, ExecutionSpace space);
void unpack_border_kokkos(const int &n, const int &nfirst,
const DAT::tdual_xfloat_2d &buf,
ExecutionSpace space);
int pack_border_vel_kokkos(int n, DAT::tdual_int_2d k_sendlist,
DAT::tdual_xfloat_2d buf,int iswap,
int pbc_flag, int *pbc, ExecutionSpace space);
void unpack_border_vel_kokkos(const int &n, const int &nfirst,
const DAT::tdual_xfloat_2d &buf,
ExecutionSpace space);
int pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf,
DAT::tdual_int_1d k_sendlist,
DAT::tdual_int_1d k_copylist,
ExecutionSpace space, int dim,
X_FLOAT lo, X_FLOAT hi);
int unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv,
int nlocal, int dim, X_FLOAT lo, X_FLOAT hi,
ExecutionSpace space);
void sync(ExecutionSpace space, unsigned int mask);
void modified(ExecutionSpace space, unsigned int mask);
void sync_overlapping_device(ExecutionSpace space, unsigned int mask);
private:
tagint *tag;
int *type,*mask;
imageint *image;
double **x,**v,**f;
double *radius,*rmass;
double **omega,**torque;
int radvary;
DAT::t_tagint_1d d_tag;
HAT::t_tagint_1d h_tag;
DAT::t_imageint_1d d_image;
HAT::t_imageint_1d h_image;
DAT::t_int_1d d_type, d_mask;
HAT::t_int_1d h_type, h_mask;
DAT::t_x_array d_x;
DAT::t_v_array d_v;
DAT::t_f_array d_f;
DAT::t_float_1d d_radius;
HAT::t_float_1d h_radius;
DAT::t_float_1d d_rmass;
HAT::t_float_1d h_rmass;
DAT::t_v_array d_omega;
HAT::t_v_array h_omega;
DAT::t_f_array d_torque;
HAT::t_f_array h_torque;
DAT::tdual_int_1d k_count;
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Per-processor system is too big
The number of owned atoms plus ghost atoms on a single
processor must fit in 32-bit integer.
E: Invalid atom type in Atoms section of data file
Atom types must range from 1 to specified # of types.
E: Invalid radius in Atoms section of data file
Radius must be >= 0.0.
E: Invalid density in Atoms section of data file
Density value cannot be <= 0.0.
*/

View File

@ -134,11 +134,11 @@ void CommKokkos::init()
if (force->newton == 0) check_reverse = 0;
if (force->pair) check_reverse += force->pair->comm_reverse_off;
if (ghost_velocity)
forward_comm_classic = true;
if (!comm_f_only) // not all Kokkos atom_vec styles have reverse pack/unpack routines yet
reverse_comm_classic = true;
if (ghost_velocity && ((AtomVecKokkos*)atom->avec)->no_comm_vel_flag) // not all Kokkos atom_vec styles have comm vel pack/unpack routines yet
forward_comm_classic = true;
}
/* ----------------------------------------------------------------------
@ -210,17 +210,21 @@ void CommKokkos::forward_comm_device(int dummy)
space,X_MASK);
}
} else if (ghost_velocity) {
error->all(FLERR,"Ghost velocity forward comm not yet "
"implemented with Kokkos");
if (size_forward_recv[iswap])
MPI_Irecv(k_buf_recv.view<LMPHostType>().data(),
if (size_forward_recv[iswap]) {
MPI_Irecv(k_buf_recv.view<DeviceType>().data(),
size_forward_recv[iswap],MPI_DOUBLE,
recvproc[iswap],0,world,&request);
n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
}
n = avec->pack_comm_vel_kokkos(sendnum[iswap],k_sendlist,iswap,
k_buf_send,pbc_flag[iswap],pbc[iswap]);
DeviceType::fence();
if (n) {
MPI_Send(k_buf_send.view<DeviceType>().data(),n,
MPI_DOUBLE,sendproc[iswap],0,world);
}
if (size_forward_recv[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE);
avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_recv);
avec->unpack_comm_vel_kokkos(recvnum[iswap],firstrecv[iswap],k_buf_recv);
DeviceType::fence();
} else {
if (size_forward_recv[iswap])
MPI_Irecv(k_buf_recv.view<DeviceType>().data(),
@ -236,18 +240,18 @@ void CommKokkos::forward_comm_device(int dummy)
avec->unpack_comm_kokkos(recvnum[iswap],firstrecv[iswap],k_buf_recv);
DeviceType::fence();
}
} else {
if (!ghost_velocity) {
if (sendnum[iswap])
n = avec->pack_comm_self(sendnum[iswap],k_sendlist,iswap,
firstrecv[iswap],pbc_flag[iswap],pbc[iswap]);
} else if (ghost_velocity) {
error->all(FLERR,"Ghost velocity forward comm not yet "
"implemented with Kokkos");
n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
buf_send,pbc_flag[iswap],pbc[iswap]);
avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_send);
DeviceType::fence();
} else {
n = avec->pack_comm_vel_kokkos(sendnum[iswap],k_sendlist,iswap,
k_buf_send,pbc_flag[iswap],pbc[iswap]);
DeviceType::fence();
avec->unpack_comm_vel_kokkos(recvnum[iswap],firstrecv[iswap],k_buf_send);
DeviceType::fence();
}
}
}
@ -631,10 +635,9 @@ void CommKokkos::exchange_device()
nsend =
avec->pack_exchange_kokkos(k_count.h_view(),k_buf_send,
k_exchange_sendlist,k_exchange_copylist,
ExecutionSpaceFromDevice<DeviceType>::
space,dim,lo,hi);
ExecutionSpaceFromDevice<DeviceType>::space,
dim,lo,hi);
DeviceType::fence();
} else {
while (i < nlocal) {
if (x[i][dim] < lo || x[i][dim] >= hi) {
@ -725,7 +728,8 @@ void CommKokkos::borders()
if (!exchange_comm_classic) {
static int print = 1;
if (style != Comm::SINGLE || bordergroup || ghost_velocity) {
if (mode != Comm::SINGLE || bordergroup ||
(ghost_velocity && ((AtomVecKokkos*)atom->avec)->no_border_vel_flag)) {
if (print && comm->me==0) {
error->warning(FLERR,"Required border comm not yet implemented in Kokkos communication, "
"switching to classic communication");
@ -833,7 +837,7 @@ void CommKokkos::borders_device() {
// store sent atom indices in list for use in future timesteps
x = atom->x;
if (style == Comm::SINGLE) {
if (mode == Comm::SINGLE) {
lo = slablo[iswap];
hi = slabhi[iswap];
} else {
@ -862,7 +866,7 @@ void CommKokkos::borders_device() {
if (sendflag) {
if (!bordergroup || ineed >= 2) {
if (style == Comm::SINGLE) {
if (mode == Comm::SINGLE) {
k_total_send.h_view() = 0;
k_total_send.template modify<LMPHostType>();
k_total_send.template sync<LMPDeviceType>();
@ -910,7 +914,7 @@ void CommKokkos::borders_device() {
} else {
error->all(FLERR,"Required border comm not yet "
"implemented with Kokkos");
if (style == Comm::SINGLE) {
if (mode == Comm::SINGLE) {
ngroup = atom->nfirst;
for (i = 0; i < ngroup; i++)
if (x[i][dim] >= lo && x[i][dim] <= hi) {
@ -947,10 +951,10 @@ void CommKokkos::borders_device() {
if (nsend*size_border > maxsend)
grow_send_kokkos(nsend*size_border,0);
if (ghost_velocity) {
error->all(FLERR,"Required border comm not yet "
"implemented with Kokkos");
n = avec->pack_border_vel(nsend,sendlist[iswap],buf_send,
pbc_flag[iswap],pbc[iswap]);
n = avec->
pack_border_vel_kokkos(nsend,k_sendlist,k_buf_send,iswap,
pbc_flag[iswap],pbc[iswap],exec_space);
DeviceType::fence();
}
else {
n = avec->
@ -983,11 +987,16 @@ void CommKokkos::borders_device() {
// unpack buffer
if (ghost_velocity) {
error->all(FLERR,"Required border comm not yet "
"implemented with Kokkos");
avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
if (sendproc[iswap] != me) {
avec->unpack_border_vel_kokkos(nrecv,atom->nlocal+atom->nghost,
k_buf_recv,exec_space);
DeviceType::fence();
} else {
avec->unpack_border_vel_kokkos(nrecv,atom->nlocal+atom->nghost,
k_buf_send,exec_space);
DeviceType::fence();
}
else
} else {
if (sendproc[iswap] != me) {
avec->unpack_border_kokkos(nrecv,atom->nlocal+atom->nghost,
k_buf_recv,exec_space);
@ -997,7 +1006,7 @@ void CommKokkos::borders_device() {
k_buf_send,exec_space);
DeviceType::fence();
}
}
// set all pointers & counters
smax = MAX(smax,nsend);
@ -1064,10 +1073,20 @@ void CommKokkos::grow_send_kokkos(int n, int flag, ExecutionSpace space)
else
k_buf_send.modify<LMPHostType>();
if (ghost_velocity)
k_buf_send.resize(maxsend_border,
atom->avec->size_border + atom->avec->size_velocity);
else
k_buf_send.resize(maxsend_border,atom->avec->size_border);
buf_send = k_buf_send.view<LMPHostType>().data();
}
else {
if (ghost_velocity)
k_buf_send = DAT::
tdual_xfloat_2d("comm:k_buf_send",
maxsend_border,
atom->avec->size_border + atom->avec->size_velocity);
else
k_buf_send = DAT::
tdual_xfloat_2d("comm:k_buf_send",maxsend_border,atom->avec->size_border);
buf_send = k_buf_send.view<LMPHostType>().data();
@ -1115,7 +1134,7 @@ void CommKokkos::grow_swap(int n)
{
free_swap();
allocate_swap(n);
if (style == Comm::MULTI) {
if (mode == Comm::MULTI) {
free_multi();
allocate_multi(n);
}

View File

@ -49,7 +49,9 @@ double ComputeTempKokkos<DeviceType>::compute_scalar()
invoked_scalar = update->ntimestep;
v = atomKK->k_v.view<DeviceType>();
rmass = atomKK->rmass;
if (atomKK->rmass)
rmass = atomKK->k_rmass.view<DeviceType>();
else
mass = atomKK->k_mass.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
@ -59,7 +61,7 @@ double ComputeTempKokkos<DeviceType>::compute_scalar()
CTEMP t_kk;
copymode = 1;
if (rmass)
if (atomKK->rmass)
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagComputeTempScalar<1> >(0,nlocal),*this,t_kk);
else
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagComputeTempScalar<0> >(0,nlocal),*this,t_kk);
@ -102,7 +104,9 @@ void ComputeTempKokkos<DeviceType>::compute_vector()
invoked_vector = update->ntimestep;
v = atomKK->k_v.view<DeviceType>();
rmass = atomKK->rmass;
if (atomKK->rmass)
rmass = atomKK->k_rmass.view<DeviceType>();
else
mass = atomKK->k_mass.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
@ -113,7 +117,7 @@ void ComputeTempKokkos<DeviceType>::compute_vector()
CTEMP t_kk;
copymode = 1;
if (rmass)
if (atomKK->rmass)
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagComputeTempVector<1> >(0,nlocal),*this,t_kk);
else
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagComputeTempVector<0> >(0,nlocal),*this,t_kk);

View File

@ -84,7 +84,7 @@ class ComputeTempKokkos : public ComputeTemp {
protected:
typename ArrayTypes<DeviceType>::t_v_array_randomread v;
double *rmass;
typename ArrayTypes<DeviceType>::t_float_1d_randomread rmass;
typename ArrayTypes<DeviceType>::t_float_1d_randomread mass;
typename ArrayTypes<DeviceType>::t_int_1d_randomread type;
typename ArrayTypes<DeviceType>::t_int_1d_randomread mask;

View File

@ -0,0 +1,124 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "fix_freeze_kokkos.h"
#include "atom_masks.h"
#include "atom_kokkos.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
template<class DeviceType>
FixFreezeKokkos<DeviceType>::FixFreezeKokkos(LAMMPS *lmp, int narg, char **arg) :
FixFreeze(lmp, narg, arg)
{
kokkosable = 1;
atomKK = (AtomKokkos *)atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = F_MASK | MASK_MASK;
datamask_modify = F_MASK | TORQUE_MASK;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
int FixFreezeKokkos<DeviceType>::setmask()
{
return FixFreeze::setmask();
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixFreezeKokkos<DeviceType>::init()
{
FixFreeze::init();
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixFreezeKokkos<DeviceType>::setup(int vflag)
{
FixFreeze::setup(vflag);
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixFreezeKokkos<DeviceType>::post_force(int vflag)
{
atomKK->sync(execution_space,datamask_read);
atomKK->modified(execution_space,datamask_modify);
f = atomKK->k_f.view<DeviceType>();
torque = atomKK->k_torque.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
force_flag = 0;
copymode = 1;
OriginalForce original;
Kokkos::parallel_reduce(nlocal, *this, original);
copymode = 0;
foriginal[0] = original.values[0];
foriginal[1] = original.values[1];
foriginal[2] = original.values[2];
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixFreezeKokkos<DeviceType>::post_force_respa(int vflag, int ilevel, int iloop)
{
post_force(vflag);
}
/* ----------------------------------------------------------------------
return components of total force on fix group before force was changed
------------------------------------------------------------------------- */
template<class DeviceType>
double FixFreezeKokkos<DeviceType>::compute_vector(int n)
{
return FixFreeze::compute_vector(n);
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixFreezeKokkos<DeviceType>::operator()(const int i, OriginalForce &original) const {
if (mask[i] & groupbit) {
original.values[0] += f(i,0);
original.values[1] += f(i,1);
original.values[2] += f(i,2);
f(i,0) = 0.0;
f(i,1) = 0.0;
f(i,2) = 0.0;
torque(i,0) = 0.0;
torque(i,1) = 0.0;
torque(i,2) = 0.0;
}
}
namespace LAMMPS_NS {
template class FixFreezeKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class FixFreezeKokkos<LMPHostType>;
#endif
}

View File

@ -0,0 +1,79 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(freeze/kk,FixFreezeKokkos<LMPDeviceType>)
FixStyle(freeze/kk/device,FixFreezeKokkos<LMPDeviceType>)
FixStyle(freeze/kk/host,FixFreezeKokkos<LMPHostType>)
#else
#ifndef LMP_FIX_FREEZE_KOKKOS_H
#define LMP_FIX_FREEZE_KOKKOS_H
#include "fix_freeze.h"
#include "kokkos_type.h"
namespace LAMMPS_NS {
template<class DeviceType>
class FixFreezeKokkos : public FixFreeze {
public:
struct OriginalForce {
double values[3];
KOKKOS_INLINE_FUNCTION
OriginalForce() {
values[0] = 0;
values[1] = 0;
values[2] = 0;
}
KOKKOS_INLINE_FUNCTION
OriginalForce &operator+=(const OriginalForce &rhs) {
values[0] += rhs.values[0];
values[1] += rhs.values[1];
values[2] += rhs.values[2];
return *this;
}
KOKKOS_INLINE_FUNCTION
void operator+=(const volatile OriginalForce &rhs) volatile {
values[0] += rhs.values[0];
values[1] += rhs.values[1];
values[2] += rhs.values[2];
}
};
FixFreezeKokkos(class LAMMPS *, int, char **);
int setmask();
void init();
void setup(int);
void post_force(int);
void post_force_respa(int, int, int);
double compute_vector(int);
KOKKOS_INLINE_FUNCTION
void operator()(const int i, OriginalForce &original) const;
private:
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_f_array torque;
typename ArrayTypes<DeviceType>::t_int_1d mask;
};
} // namespace LAMMPS_NS
#endif // LMP_FIX_FREEZE_KOKKOS_H
#endif // FIX_CLASS

View File

@ -0,0 +1,121 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "fix_gravity_kokkos.h"
#include "atom_masks.h"
#include "modify.h"
#include "input.h"
#include "variable.h"
#include "update.h"
#include "atom_kokkos.h"
#include "atom_vec.h"
using namespace LAMMPS_NS;
enum{CONSTANT,EQUAL};
/* ---------------------------------------------------------------------- */
template<class DeviceType>
FixGravityKokkos<DeviceType>::FixGravityKokkos(LAMMPS *lmp, int narg, char **arg) :
FixGravity(lmp, narg, arg)
{
kokkosable = 1;
atomKK = (AtomKokkos *)atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = X_MASK | F_MASK | RMASS_MASK | MASK_MASK | TYPE_MASK;
datamask_modify = F_MASK;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixGravityKokkos<DeviceType>::post_force(int vflag)
{
// update gravity due to variables
if (varflag != CONSTANT) {
modify->clearstep_compute();
if (mstyle == EQUAL) magnitude = input->variable->compute_equal(mvar);
if (vstyle == EQUAL) vert = input->variable->compute_equal(vvar);
if (pstyle == EQUAL) phi = input->variable->compute_equal(pvar);
if (tstyle == EQUAL) theta = input->variable->compute_equal(tvar);
if (xstyle == EQUAL) xdir = input->variable->compute_equal(xvar);
if (ystyle == EQUAL) ydir = input->variable->compute_equal(yvar);
if (zstyle == EQUAL) zdir = input->variable->compute_equal(zvar);
modify->addstep_compute(update->ntimestep + 1);
set_acceleration();
}
atomKK->sync(execution_space,datamask_read);
atomKK->modified(execution_space,datamask_modify);
x = atomKK->k_x.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
if (atomKK->rmass)
rmass = atomKK->k_rmass.view<DeviceType>();
else
mass = atomKK->k_mass.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
int nlocal = atomKK->nlocal;
if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;
copymode = 1;
eflag = 0;
egrav = 0.0;
if (atomKK->rmass) {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagFixGravityRMass>(0,nlocal), *this, egrav);
}
else {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagFixGravityMass>(0,nlocal), *this, egrav);
}
copymode = 0;
}
template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void FixGravityKokkos<DeviceType>::operator()(TagFixGravityRMass, const int i, double &eg) const
{
if (mask[i] & groupbit) {
double massone = rmass[i];
f(i,0) += massone*xacc;
f(i,1) += massone*yacc;
f(i,2) += massone*zacc;
eg -= massone * (xacc*x(i,0) + yacc*x(i,1) + zacc*x(i,2));
}
}
template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void FixGravityKokkos<DeviceType>::operator()(TagFixGravityMass, const int i, double &eg) const
{
if (mask[i] & groupbit) {
double massone = mass[type[i]];
f(i,0) += massone*xacc;
f(i,1) += massone*yacc;
f(i,2) += massone*zacc;
eg -= massone * (xacc*x(i,0) + yacc*x(i,1) + zacc*x(i,2));
}
}
namespace LAMMPS_NS {
template class FixGravityKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class FixGravityKokkos<LMPHostType>;
#endif
}

View File

@ -0,0 +1,57 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(gravity/kk,FixGravityKokkos<LMPDeviceType>)
FixStyle(gravity/kk/device,FixGravityKokkos<LMPDeviceType>)
FixStyle(gravity/kk/host,FixGravityKokkos<LMPHostType>)
#else
#ifndef LMP_FIX_GRAVITY_KOKKOS_H
#define LMP_FIX_GRAVITY_KOKKOS_H
#include "fix_gravity.h"
#include "kokkos_type.h"
namespace LAMMPS_NS {
struct TagFixGravityRMass {};
struct TagFixGravityMass {};
template<class DeviceType>
class FixGravityKokkos : public FixGravity {
public:
FixGravityKokkos(class LAMMPS *, int, char **);
virtual ~FixGravityKokkos() {}
void post_force(int);
KOKKOS_INLINE_FUNCTION
void operator()(TagFixGravityRMass, const int, double &) const;
KOKKOS_INLINE_FUNCTION
void operator()(TagFixGravityMass, const int, double &) const;
private:
typename ArrayTypes<DeviceType>::t_x_array x;
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_float_1d_randomread rmass;
typename ArrayTypes<DeviceType>::t_float_1d_randomread mass;
typename ArrayTypes<DeviceType>::t_int_1d type;
typename ArrayTypes<DeviceType>::t_int_1d mask;
};
} // namespace LAMMPS_NS
#endif // LMP_FIX_GRAVITY_KOKKOS_H
#endif // FIX_CLASS

View File

@ -133,7 +133,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
{
// sync the device views which might have been modified on host
atomKK->sync(execution_space,datamask_read);
rmass = atomKK->rmass;
rmass = atomKK->k_rmass.view<DeviceType>();
f = atomKK->k_f.template view<DeviceType>();
v = atomKK->k_v.template view<DeviceType>();
type = atomKK->k_type.template view<DeviceType>();
@ -191,7 +191,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (gjfflag)
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -210,7 +210,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -230,7 +230,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
}
else
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -249,7 +249,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,1,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -270,7 +270,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
else
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -289,7 +289,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -309,7 +309,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
}
else
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -328,7 +328,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,1,0,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -350,7 +350,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
if (gjfflag)
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -369,7 +369,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -389,7 +389,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
}
else
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -408,7 +408,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,1,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -429,7 +429,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
else
if (tallyflag)
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -448,7 +448,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,1,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -468,7 +468,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
}
else
if (tbiasflag == BIAS)
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,1,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);
@ -487,7 +487,7 @@ void FixLangevinKokkos<DeviceType>::post_force(int vflag)
Kokkos::parallel_for(nlocal,post_functor);
}
else
if (rmass)
if (rmass.data())
if (zeroflag) {
FixLangevinKokkosPostForceFunctor<DeviceType,0,0,0,0,1,1> post_functor(this);
Kokkos::parallel_reduce(nlocal,post_functor,s_fsum);

View File

@ -93,7 +93,7 @@ namespace LAMMPS_NS {
private:
class CommKokkos *commKK;
double *rmass;
typename ArrayTypes<DeviceType>::t_float_1d rmass;
typename ArrayTypes<DeviceType>::tdual_double_2d k_franprev;
typename ArrayTypes<DeviceType>::t_double_2d d_franprev;
HAT::t_double_2d h_franprev;

View File

@ -111,8 +111,9 @@ void FixMomentumKokkos<DeviceType>::end_of_step()
/* this is needed because Group is not Kokkos-aware ! */
atomKK->sync(ExecutionSpaceFromDevice<LMPHostType>::space,
V_MASK | MASK_MASK | TYPE_MASK | RMASS_MASK);
Few<double, 3> vcm;
group->vcm(igroup,masstotal,&vcm[0]);
Few<double, 3> tmpvcm;
group->vcm(igroup,masstotal,&tmpvcm[0]);
const Few<double, 3> vcm(tmpvcm);
// adjust velocities by vcm to zero linear momentum
// only adjust a component if flag is set
@ -132,19 +133,20 @@ void FixMomentumKokkos<DeviceType>::end_of_step()
}
if (angular) {
Few<double, 3> xcm, angmom, omega;
Few<double, 3> tmpxcm, tmpangmom, tmpomega;
double inertia[3][3];
/* syncs for each Kokkos-unaware Group method */
atomKK->sync(ExecutionSpaceFromDevice<LMPHostType>::space,
X_MASK | MASK_MASK | TYPE_MASK | IMAGE_MASK | RMASS_MASK);
group->xcm(igroup,masstotal,&xcm[0]);
group->xcm(igroup,masstotal,&tmpxcm[0]);
atomKK->sync(ExecutionSpaceFromDevice<LMPHostType>::space,
X_MASK | V_MASK | MASK_MASK | TYPE_MASK | IMAGE_MASK | RMASS_MASK);
group->angmom(igroup,&xcm[0],&angmom[0]);
group->angmom(igroup,&tmpxcm[0],&tmpangmom[0]);
atomKK->sync(ExecutionSpaceFromDevice<LMPHostType>::space,
X_MASK | MASK_MASK | TYPE_MASK | IMAGE_MASK | RMASS_MASK);
group->inertia(igroup,&xcm[0],inertia);
group->omega(&angmom[0],inertia,&omega[0]);
group->inertia(igroup,&tmpxcm[0],inertia);
group->omega(&tmpangmom[0],inertia,&tmpomega[0]);
const Few<double, 3> xcm(tmpxcm), angmom(tmpangmom), omega(tmpomega);
// adjust velocities to zero omega
// vnew_i = v_i - w x r_i

View File

@ -0,0 +1,335 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "fix_neigh_history_kokkos.h"
#include "atom_kokkos.h"
#include "error.h"
#include "memory_kokkos.h"
#include "neigh_list_kokkos.h"
#include "pair_kokkos.h"
#include "comm.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
template <class DeviceType>
FixNeighHistoryKokkos<DeviceType>::FixNeighHistoryKokkos(LAMMPS *lmp, int narg, char **arg) :
FixNeighHistory(lmp, narg, arg)
{
kokkosable = 1;
atomKK = (AtomKokkos *)atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
memory->destroy(npartner);
memory->sfree(partner);
memory->sfree(valuepartner);
npartner = NULL;
partner = NULL;
valuepartner = NULL;
maxpartner = 8;
grow_arrays(atom->nmax);
d_resize = typename ArrayTypes<DeviceType>::t_int_scalar("FixNeighHistoryKokkos::resize");
#ifndef KOKKOS_USE_CUDA_UVM
h_resize = Kokkos::create_mirror_view(d_resize);
#else
h_resize = d_resize;
#endif
h_resize() = 1;
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
FixNeighHistoryKokkos<DeviceType>::~FixNeighHistoryKokkos()
{
if (copymode) return;
memoryKK->destroy_kokkos(k_npartner, npartner);
memoryKK->destroy_kokkos(k_partner, partner);
memoryKK->destroy_kokkos(k_valuepartner, valuepartner);
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::init()
{
if (atomKK->tag_enable == 0)
error->all(FLERR,"Neighbor history requires atoms have IDs");
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::pre_exchange()
{
copymode = 1;
h_resize() = 1;
while (h_resize() > 0) {
FixNeighHistoryKokkosZeroPartnerCountFunctor<DeviceType> zero(this);
Kokkos::parallel_for(nlocal_neigh,zero);
h_resize() = 0;
deep_copy(d_resize, h_resize);
FixNeighHistoryKokkosPreExchangeFunctor<DeviceType> f(this);
Kokkos::parallel_for(nlocal_neigh,f);
deep_copy(h_resize, d_resize);
if (h_resize() > 0) {
maxpartner += 8;
memoryKK->grow_kokkos(k_partner,partner,atom->nmax,maxpartner,"neighbor_history:partner");
memoryKK->grow_kokkos(k_valuepartner,valuepartner,atom->nmax,dnum*maxpartner,"neighbor_history:valuepartner");
}
}
copymode = 0;
comm->maxexchange_fix = MAX(comm->maxexchange_fix,(dnum+1)*maxpartner+1);
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::zero_partner_count_item(const int &i) const
{
d_npartner[i] = 0;
}
template <class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::pre_exchange_item(const int &ii) const
{
const int i = d_ilist[ii];
const int jnum = d_numneigh[i];
for (int jj = 0; jj < jnum; jj++) {
if (d_firstflag(i,jj)) {
int j = d_neighbors(i,jj);
j &= NEIGHMASK;
int m = Kokkos::atomic_fetch_add(&d_npartner[i],1);
if (m < maxpartner) {
d_partner(i,m) = tag[j];
for (int k = 0; k < dnum; k++)
d_valuepartner(i,dnum*m+k) = d_firstvalue(i,dnum*jj+k);
} else {
d_resize() = 1;
}
if (j < nlocal_neigh) {
m = Kokkos::atomic_fetch_add(&d_npartner[j],1);
if (m < maxpartner) {
d_partner(j,m) = tag[i];
for (int k = 0; k < dnum; k++)
d_valuepartner(j,dnum*m+k) = d_firstvalue(i,dnum*jj+k);
} else {
d_resize() = 1;
}
}
}
}
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::setup_post_neighbor()
{
post_neighbor();
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::post_neighbor()
{
tag = atomKK->k_tag.view<DeviceType>();
int inum = pair->list->inum;
NeighListKokkos<DeviceType>* k_list = static_cast<NeighListKokkos<DeviceType>*>(pair->list);
d_numneigh = k_list->d_numneigh;
d_neighbors = k_list->d_neighbors;
d_ilist = k_list->d_ilist;
// store atom counts used for new neighbor list which was just built
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
nlocal_neigh = nlocal;
nall_neigh = nall;
// realloc firstflag and firstvalue if needed
if (maxatom < nlocal || k_list->maxneighs > d_firstflag.extent(1)) {
maxatom = nall;
d_firstflag = Kokkos::View<int**>("neighbor_history:firstflag",maxatom,k_list->maxneighs);
d_firstvalue = Kokkos::View<LMP_FLOAT**>("neighbor_history:firstvalue",maxatom,k_list->maxneighs*dnum);
}
copymode = 1;
FixNeighHistoryKokkosPostNeighborFunctor<DeviceType> f(this);
Kokkos::parallel_for(inum,f);
copymode = 0;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void FixNeighHistoryKokkos<DeviceType>::post_neighbor_item(const int &ii) const
{
const int i = d_ilist[ii];
const int jnum = d_numneigh[i];
const int np = d_npartner[i];
for (int jj = 0; jj < jnum; jj++) {
int j = d_neighbors(i,jj);
const int rflag = j >> SBBITS & 3;
j &= NEIGHMASK;
int m;
if (rflag) {
int jtag = tag(j);
for (m = 0; m < np; m++)
if (d_partner(i, m) == jtag) break;
if (m < np) {
d_firstflag(i,jj) = 1;
for (int k = 0; k < dnum; k++) {
d_firstvalue(i, dnum*jj+k) = d_valuepartner(i, dnum*m+k);
}
} else {
d_firstflag(i,jj) = 0;
for (int k = 0; k < dnum; k++) {
d_firstvalue(i, dnum*jj+k) = 0;
}
}
} else {
d_firstflag(i,jj) = 0;
for (int k = 0; k < dnum; k++) {
d_firstvalue(i, dnum*jj+k) = 0;
}
}
}
}
/* ----------------------------------------------------------------------
memory usage of local atom-based arrays
------------------------------------------------------------------------- */
template<class DeviceType>
double FixNeighHistoryKokkos<DeviceType>::memory_usage()
{
double bytes = d_firstflag.extent(0)*d_firstflag.extent(1)*sizeof(int);
bytes += d_firstvalue.extent(0)*d_firstvalue.extent(1)*sizeof(double);
bytes += 2*k_npartner.extent(0)*sizeof(int);
bytes += 2*k_partner.extent(0)*k_partner.extent(1)*sizeof(int);
bytes += 2*k_valuepartner.extent(0)*k_valuepartner.extent(1)*sizeof(double);
return bytes;
}
/* ----------------------------------------------------------------------
allocate fictitious charge arrays
------------------------------------------------------------------------- */
template<class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::grow_arrays(int nmax)
{
k_npartner.template sync<LMPHostType>(); // force reallocation on host
k_partner.template sync<LMPHostType>();
k_valuepartner.template sync<LMPHostType>();
memoryKK->grow_kokkos(k_npartner,npartner,nmax,"neighbor_history:npartner");
memoryKK->grow_kokkos(k_partner,partner,nmax,maxpartner,"neighbor_history:partner");
memoryKK->grow_kokkos(k_valuepartner,valuepartner,nmax,dnum*maxpartner,"neighbor_history:valuepartner");
d_npartner = k_npartner.template view<DeviceType>();
d_partner = k_partner.template view<DeviceType>();
d_valuepartner = k_valuepartner.template view<DeviceType>();
k_npartner.template modify<LMPHostType>();
k_partner.template modify<LMPHostType>();
k_valuepartner.template modify<LMPHostType>();
}
/* ----------------------------------------------------------------------
copy values within fictitious charge arrays
------------------------------------------------------------------------- */
template<class DeviceType>
void FixNeighHistoryKokkos<DeviceType>::copy_arrays(int i, int j, int delflag)
{
k_npartner.template sync<LMPHostType>();
k_partner.template sync<LMPHostType>();
k_valuepartner.template sync<LMPHostType>();
npartner[j] = npartner[i];
for (int m = 0; m < npartner[i]; m++) {
partner[j][m] = partner[i][m];
valuepartner[j][m] = valuepartner[i][m];
}
k_npartner.template modify<LMPHostType>();
k_partner.template modify<LMPHostType>();
k_valuepartner.template modify<LMPHostType>();
}
/* ----------------------------------------------------------------------
pack values in local atom-based array for exchange with another proc
------------------------------------------------------------------------- */
template<class DeviceType>
int FixNeighHistoryKokkos<DeviceType>::pack_exchange(int i, double *buf)
{
k_npartner.template sync<LMPHostType>();
k_partner.template sync<LMPHostType>();
k_valuepartner.template sync<LMPHostType>();
int n = 0;
buf[n++] = npartner[i];
for (int m = 0; m < npartner[i]; m++) buf[n++] = partner[i][m];
for (int m = 0; m < dnum*npartner[i]; m++) buf[n++] = valuepartner[i][m];
return n;
}
/* ----------------------------------------------------------------------
unpack values in local atom-based array from exchange with another proc
------------------------------------------------------------------------- */
template<class DeviceType>
int FixNeighHistoryKokkos<DeviceType>::unpack_exchange(int nlocal, double *buf)
{
int n = 0;
npartner[nlocal] = static_cast<int>(buf[n++]);
for (int m = 0; m < npartner[nlocal]; m++) partner[nlocal][m] = static_cast<int>(buf[n++]);
for (int m = 0; m < dnum*npartner[nlocal]; m++) valuepartner[nlocal][m] = buf[n++];
k_npartner.template modify<LMPHostType>();
k_partner.template modify<LMPHostType>();
k_valuepartner.template modify<LMPHostType>();
return n;
}
/* ---------------------------------------------------------------------- */
namespace LAMMPS_NS {
template class FixNeighHistoryKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class FixNeighHistoryKokkos<LMPHostType>;
#endif
}

View File

@ -0,0 +1,107 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(NEIGH_HISTORY/KK,FixNeighHistoryKokkos<LMPDeviceType>)
FixStyle(NEIGH_HISTORY/KK/DEVICE,FixNeighHistoryKokkos<LMPDeviceType>)
FixStyle(NEIGH_HISTORY/KK/HOST,FixNeighHistoryKokkos<LMPHostType>)
#else
#ifndef LMP_FIX_NEIGH_HISTORY_KOKKOS_H
#define LMP_FIX_NEIGH_HISTORY_KOKKOS_H
#include "fix_neigh_history.h"
#include "kokkos_type.h"
namespace LAMMPS_NS {
template <class DeviceType>
class FixNeighHistoryKokkos : public FixNeighHistory {
public:
FixNeighHistoryKokkos(class LAMMPS *, int, char **);
~FixNeighHistoryKokkos();
void init();
void pre_exchange();
void setup_post_neighbor();
virtual void post_neighbor();
double memory_usage();
void grow_arrays(int);
void copy_arrays(int, int, int);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
KOKKOS_INLINE_FUNCTION
void zero_partner_count_item(const int &i) const;
KOKKOS_INLINE_FUNCTION
void pre_exchange_item(const int &ii) const;
KOKKOS_INLINE_FUNCTION
void post_neighbor_item(const int &ii) const;
typename Kokkos::View<int**> d_firstflag;
typename Kokkos::View<LMP_FLOAT**> d_firstvalue;
private:
typename ArrayTypes<DeviceType>::tdual_int_1d k_npartner;
typename ArrayTypes<DeviceType>::tdual_tagint_2d k_partner;
typename ArrayTypes<DeviceType>::tdual_float_2d k_valuepartner;
// for neighbor list lookup
typename ArrayTypes<DeviceType>::t_neighbors_2d d_neighbors;
typename ArrayTypes<DeviceType>::t_int_1d_randomread d_ilist;
typename ArrayTypes<DeviceType>::t_int_1d_randomread d_numneigh;
typename ArrayTypes<DeviceType>::t_tagint_1d tag;
typename ArrayTypes<DeviceType>::t_int_1d d_npartner;
typename ArrayTypes<DeviceType>::t_tagint_2d d_partner;
typename ArrayTypes<DeviceType>::t_float_2d d_valuepartner;
typename ArrayTypes<DeviceType>::t_int_scalar d_resize;
typename ArrayTypes<LMPHostType>::t_int_scalar h_resize;
};
template <class DeviceType>
struct FixNeighHistoryKokkosZeroPartnerCountFunctor {
FixNeighHistoryKokkos<DeviceType> c;
FixNeighHistoryKokkosZeroPartnerCountFunctor(FixNeighHistoryKokkos<DeviceType> *c_ptr): c(*c_ptr) {}
KOKKOS_INLINE_FUNCTION
void operator()(const int &i) const {
c.zero_partner_count_item(i);
}
};
template <class DeviceType>
struct FixNeighHistoryKokkosPreExchangeFunctor {
FixNeighHistoryKokkos<DeviceType> c;
FixNeighHistoryKokkosPreExchangeFunctor(FixNeighHistoryKokkos<DeviceType> *c_ptr): c(*c_ptr) {}
KOKKOS_INLINE_FUNCTION
void operator() (const int &i) const {
c.pre_exchange_item(i);
}
};
template <class DeviceType>
struct FixNeighHistoryKokkosPostNeighborFunctor {
FixNeighHistoryKokkos<DeviceType> c;
FixNeighHistoryKokkosPostNeighborFunctor(FixNeighHistoryKokkos<DeviceType> *c_ptr): c(*c_ptr) {}
KOKKOS_INLINE_FUNCTION
void operator() (const int &i) const {
c.post_neighbor_item(i);
}
};
} // namespace LAMMPS_NS
#endif // LMP_FIX_NEIGH_HISTORY_KOKKOS_H
#endif // FIX_CLASS

View File

@ -537,7 +537,7 @@ void FixNHKokkos<DeviceType>::nve_v()
v = atomKK->k_v.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
rmass = atomKK->rmass;
rmass = atomKK->k_rmass.view<DeviceType>();
mass = atomKK->k_mass.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
@ -545,7 +545,7 @@ void FixNHKokkos<DeviceType>::nve_v()
if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;
copymode = 1;
if (rmass)
if (rmass.data())
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNH_nve_v<1> >(0,nlocal),*this);
else
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagFixNH_nve_v<0> >(0,nlocal),*this);

View File

@ -71,8 +71,8 @@ class FixNHKokkos : public FixNH {
typename ArrayTypes<DeviceType>::t_x_array x;
typename ArrayTypes<DeviceType>::t_v_array v;
typename ArrayTypes<DeviceType>::t_f_array_const f;
double *rmass;
typename ArrayTypes<DeviceType>::t_float_1d_randomread mass;
typename ArrayTypes<DeviceType>::t_float_1d rmass;
typename ArrayTypes<DeviceType>::t_float_1d mass;
typename ArrayTypes<DeviceType>::t_int_1d type;
typename ArrayTypes<DeviceType>::t_int_1d mask;
};

View File

@ -62,14 +62,14 @@ void FixNVEKokkos<DeviceType>::initial_integrate(int vflag)
x = atomKK->k_x.view<DeviceType>();
v = atomKK->k_v.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
rmass = atomKK->rmass;
rmass = atomKK->k_rmass.view<DeviceType>();
mass = atomKK->k_mass.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
int nlocal = atomKK->nlocal;
if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;
if (rmass) {
if (rmass.data()) {
FixNVEKokkosInitialIntegrateFunctor<DeviceType,1> functor(this);
Kokkos::parallel_for(nlocal,functor);
} else {
@ -118,14 +118,14 @@ void FixNVEKokkos<DeviceType>::final_integrate()
v = atomKK->k_v.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
rmass = atomKK->rmass;
rmass = atomKK->k_rmass.view<DeviceType>();
mass = atomKK->k_mass.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
int nlocal = atomKK->nlocal;
if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;
if (rmass) {
if (rmass.data()) {
FixNVEKokkosFinalIntegrateFunctor<DeviceType,1> functor(this);
Kokkos::parallel_for(nlocal,functor);
} else {

View File

@ -60,8 +60,8 @@ class FixNVEKokkos : public FixNVE {
typename ArrayTypes<DeviceType>::t_x_array x;
typename ArrayTypes<DeviceType>::t_v_array v;
typename ArrayTypes<DeviceType>::t_f_array_const f;
double *rmass;
typename ArrayTypes<DeviceType>::t_float_1d_randomread mass;
typename ArrayTypes<DeviceType>::t_float_1d rmass;
typename ArrayTypes<DeviceType>::t_float_1d mass;
typename ArrayTypes<DeviceType>::t_int_1d type;
typename ArrayTypes<DeviceType>::t_int_1d mask;
};

View File

@ -0,0 +1,155 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "fix_nve_sphere_kokkos.h"
#include "atom_masks.h"
#include "atom_kokkos.h"
#include "error.h"
using namespace LAMMPS_NS;
enum{NONE,DIPOLE};
/* ---------------------------------------------------------------------- */
template<class DeviceType>
FixNVESphereKokkos<DeviceType>::FixNVESphereKokkos(LAMMPS *lmp, int narg, char **arg) :
FixNVESphere(lmp, narg, arg)
{
kokkosable = 1;
atomKK = (AtomKokkos *)atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = F_MASK | TORQUE_MASK | RMASS_MASK | RADIUS_MASK | MASK_MASK;
datamask_modify = X_MASK | V_MASK | OMEGA_MASK;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixNVESphereKokkos<DeviceType>::cleanup_copy()
{
id = style = NULL;
vatom = NULL;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixNVESphereKokkos<DeviceType>::init()
{
FixNVESphere::init();
if (extra == DIPOLE) {
error->all(FLERR,"Fix nve/sphere/kk doesn't yet support dipole");
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixNVESphereKokkos<DeviceType>::initial_integrate(int vflag)
{
atomKK->sync(execution_space,datamask_read);
atomKK->modified(execution_space,datamask_modify);
x = atomKK->k_x.view<DeviceType>();
v = atomKK->k_v.view<DeviceType>();
omega = atomKK->k_omega.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
torque = atomKK->k_torque.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
rmass = atomKK->k_rmass.view<DeviceType>();
radius = atomKK->k_radius.view<DeviceType>();
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
FixNVESphereKokkosInitialIntegrateFunctor<DeviceType> f(this);
Kokkos::parallel_for(nlocal,f);
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
KOKKOS_INLINE_FUNCTION
void FixNVESphereKokkos<DeviceType>::initial_integrate_item(const int i) const
{
const double dtfrotate = dtf / inertia;
if (mask(i) & groupbit) {
const double dtfm = dtf / rmass(i);
v(i,0) += dtfm * f(i,0);
v(i,1) += dtfm * f(i,1);
v(i,2) += dtfm * f(i,2);
x(i,0) += dtv * v(i,0);
x(i,1) += dtv * v(i,1);
x(i,2) += dtv * v(i,2);
const double dtirotate = dtfrotate / (radius(i)*radius(i)*rmass(i));
omega(i,0) += dtirotate * torque(i,0);
omega(i,1) += dtirotate * torque(i,1);
omega(i,2) += dtirotate * torque(i,2);
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void FixNVESphereKokkos<DeviceType>::final_integrate()
{
atomKK->sync(execution_space,datamask_read);
atomKK->modified(execution_space,datamask_modify);
v = atomKK->k_v.view<DeviceType>();
omega = atomKK->k_omega.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
torque = atomKK->k_torque.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
rmass = atomKK->k_rmass.view<DeviceType>();
radius = atomKK->k_radius.view<DeviceType>();
int nlocal = atom->nlocal;
if (igroup == atom->firstgroup) nlocal = atom->nfirst;
FixNVESphereKokkosFinalIntegrateFunctor<DeviceType> f(this);
Kokkos::parallel_for(nlocal,f);
}
/* ---------------------------------------------------------------------- */
template <class DeviceType>
KOKKOS_INLINE_FUNCTION
void FixNVESphereKokkos<DeviceType>::final_integrate_item(const int i) const
{
const double dtfrotate = dtf / inertia;
if (mask(i) & groupbit) {
const double dtfm = dtf / rmass(i);
v(i,0) += dtfm * f(i,0);
v(i,1) += dtfm * f(i,1);
v(i,2) += dtfm * f(i,2);
const double dtirotate = dtfrotate / (radius(i)*radius(i)*rmass(i));
omega(i,0) += dtirotate * torque(i,0);
omega(i,1) += dtirotate * torque(i,1);
omega(i,2) += dtirotate * torque(i,2);
}
}
namespace LAMMPS_NS {
template class FixNVESphereKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class FixNVESphereKokkos<LMPHostType>;
#endif
}

View File

@ -0,0 +1,79 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef FIX_CLASS
FixStyle(nve/sphere/kk,FixNVESphereKokkos<LMPDeviceType>)
FixStyle(nve/sphere/kk/device,FixNVESphereKokkos<LMPDeviceType>)
FixStyle(nve/sphere/kk/host,FixNVESphereKokkos<LMPHostType>)
#else
#ifndef LMP_FIX_NVE_SPHERE_KOKKOS_H
#define LMP_FIX_NVE_SPHERE_KOKKOS_H
#include "fix_nve_sphere.h"
#include "kokkos_type.h"
namespace LAMMPS_NS {
template<class DeviceType>
class FixNVESphereKokkos : public FixNVESphere {
public:
FixNVESphereKokkos(class LAMMPS *, int, char **);
virtual ~FixNVESphereKokkos() {}
void cleanup_copy();
void init();
void initial_integrate(int);
void final_integrate();
KOKKOS_INLINE_FUNCTION
void initial_integrate_item(const int i) const;
KOKKOS_INLINE_FUNCTION
void final_integrate_item(const int i) const;
private:
typename ArrayTypes<DeviceType>::t_x_array x;
typename ArrayTypes<DeviceType>::t_v_array v;
typename ArrayTypes<DeviceType>::t_v_array omega;
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_f_array torque;
typename ArrayTypes<DeviceType>::t_float_1d rmass;
typename ArrayTypes<DeviceType>::t_float_1d radius;
typename ArrayTypes<DeviceType>::t_int_1d mask;
};
template <class DeviceType>
struct FixNVESphereKokkosInitialIntegrateFunctor {
FixNVESphereKokkos<DeviceType> c;
FixNVESphereKokkosInitialIntegrateFunctor(FixNVESphereKokkos<DeviceType> *c_ptr): c(*c_ptr) { c.cleanup_copy(); }
KOKKOS_INLINE_FUNCTION
void operator()(const int i) const {
c.initial_integrate_item(i);
}
};
template <class DeviceType>
struct FixNVESphereKokkosFinalIntegrateFunctor {
FixNVESphereKokkos<DeviceType> c;
FixNVESphereKokkosFinalIntegrateFunctor(FixNVESphereKokkos<DeviceType> *c_ptr): c(*c_ptr) { c.cleanup_copy(); }
KOKKOS_INLINE_FUNCTION
void operator()(const int i) const {
c.final_integrate_item(i);
}
};
} // namespace LAMMPS_NS
#endif // LMP_FIX_NVE_SPHERE_KOKKOS_H
#endif // FIX_CLASS

View File

@ -24,8 +24,8 @@ namespace LAMMPS_NS {
/* ---------------------------------------------------------------------- */
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI>
NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::NPairKokkos(LAMMPS *lmp) : NPair(lmp) {
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI, int SIZE>
NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::NPairKokkos(LAMMPS *lmp) : NPair(lmp) {
}
@ -33,8 +33,8 @@ NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::NPairKokkos(LAMMPS *lmp) : NPair(l
copy needed info from Neighbor class to this build class
------------------------------------------------------------------------- */
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::copy_neighbor_info()
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI, int SIZE>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::copy_neighbor_info()
{
NPair::copy_neighbor_info();
@ -63,8 +63,8 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::copy_neighbor_info()
copy per-atom and per-bin vectors from NBin class to this build class
------------------------------------------------------------------------- */
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::copy_bin_info()
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI, int SIZE>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::copy_bin_info()
{
NPair::copy_bin_info();
@ -80,8 +80,8 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::copy_bin_info()
copy needed info from NStencil class to this build class
------------------------------------------------------------------------- */
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::copy_stencil_info()
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI, int SIZE>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::copy_stencil_info()
{
NPair::copy_stencil_info();
@ -110,8 +110,8 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::copy_stencil_info()
/* ---------------------------------------------------------------------- */
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI, int SIZE>
void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI,SIZE>::build(NeighList *list_)
{
NeighListKokkos<DeviceType>* list = (NeighListKokkos<DeviceType>*) list_;
const int nlocal = includegroup?atom->nfirst:atom->nlocal;
@ -131,6 +131,7 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
k_stencilxyz.view<DeviceType>(),
nlocal,
atomKK->k_x.view<DeviceType>(),
atomKK->k_radius.view<DeviceType>(),
atomKK->k_type.view<DeviceType>(),
atomKK->k_mask.view<DeviceType>(),
atomKK->k_molecule.view<DeviceType>(),
@ -155,7 +156,8 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
k_ex_mol_intra.view<DeviceType>(),
bboxhi,bboxlo,
domain->xperiodic,domain->yperiodic,domain->zperiodic,
domain->xprd_half,domain->yprd_half,domain->zprd_half);
domain->xprd_half,domain->yprd_half,domain->zprd_half,
skin);
k_cutneighsq.sync<DeviceType>();
k_ex1_type.sync<DeviceType>();
@ -171,7 +173,7 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
k_bincount.sync<DeviceType>();
k_bins.sync<DeviceType>();
k_atom2bin.sync<DeviceType>();
atomKK->sync(Device,X_MASK|TYPE_MASK|MASK_MASK|MOLECULE_MASK|TAG_MASK|SPECIAL_MASK);
atomKK->sync(Device,X_MASK|RADIUS_MASK|TYPE_MASK|MASK_MASK|MOLECULE_MASK|TAG_MASK|SPECIAL_MASK);
data.special_flag[0] = special_flag[0];
data.special_flag[1] = special_flag[1];
@ -198,6 +200,17 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
Kokkos::parallel_for(nall, f);
} else {
if (newton_pair) {
if (SIZE) {
NPairKokkosBuildFunctorSize<DeviceType,TRI?0:HALF_NEIGH,1,TRI> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
#ifdef KOKKOS_HAVE_CUDA
if (ExecutionSpaceFromDevice<DeviceType>::space == Device)
Kokkos::parallel_for(config, f);
else
Kokkos::parallel_for(nall, f);
#else
Kokkos::parallel_for(nall, f);
#endif
} else {
NPairKokkosBuildFunctor<DeviceType,TRI?0:HALF_NEIGH,1,TRI> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
#ifdef KOKKOS_HAVE_CUDA
if (ExecutionSpaceFromDevice<DeviceType>::space == Device)
@ -206,6 +219,18 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
Kokkos::parallel_for(nall, f);
#else
Kokkos::parallel_for(nall, f);
#endif
}
} else {
if (SIZE) {
NPairKokkosBuildFunctorSize<DeviceType,HALF_NEIGH,0,0> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
#ifdef KOKKOS_HAVE_CUDA
if (ExecutionSpaceFromDevice<DeviceType>::space == Device)
Kokkos::parallel_for(config, f);
else
Kokkos::parallel_for(nall, f);
#else
Kokkos::parallel_for(nall, f);
#endif
} else {
NPairKokkosBuildFunctor<DeviceType,HALF_NEIGH,0,0> f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor);
@ -219,6 +244,7 @@ void NPairKokkos<DeviceType,HALF_NEIGH,GHOST,TRI>::build(NeighList *list_)
#endif
}
}
}
deep_copy(data.h_resize, data.resize);
if(data.h_resize()) {
@ -774,19 +800,306 @@ void NeighborKokkosExecute<DeviceType>::
neigh_list.d_ilist(i) = i;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType> template<int HalfNeigh,int Newton,int Tri>
void NeighborKokkosExecute<DeviceType>::
build_ItemSize(const int &i) const
{
/* if necessary, goto next page and add pages */
int n = 0;
// get subview of neighbors of i
const AtomNeighbors neighbors_i = neigh_list.get_neighbors(i);
const X_FLOAT xtmp = x(i, 0);
const X_FLOAT ytmp = x(i, 1);
const X_FLOAT ztmp = x(i, 2);
const X_FLOAT radi = radius(i);
const int itype = type(i);
const int ibin = c_atom2bin(i);
const typename ArrayTypes<DeviceType>::t_int_1d_const_um stencil
= d_stencil;
const int mask_history = 3 << SBBITS;
// loop over all bins in neighborhood (includes ibin)
if(HalfNeigh)
for(int m = 0; m < c_bincount(ibin); m++) {
const int j = c_bins(ibin,m);
const int jtype = type(j);
//for same bin as atom i skip j if i==j and skip atoms "below and to the left" if using HalfNeighborlists
if((j == i) || (HalfNeigh && !Newton && (j < i)) ||
(HalfNeigh && Newton && ((j < i) || ((j >= nlocal) &&
((x(j, 2) < ztmp) || (x(j, 2) == ztmp && x(j, 1) < ytmp) ||
(x(j, 2) == ztmp && x(j, 1) == ytmp && x(j, 0) < xtmp)))))
) continue;
if(exclude && exclusion(i,j,itype,jtype)) continue;
const X_FLOAT delx = xtmp - x(j, 0);
const X_FLOAT dely = ytmp - x(j, 1);
const X_FLOAT delz = ztmp - x(j, 2);
const X_FLOAT rsq = delx * delx + dely * dely + delz * delz;
const X_FLOAT radsum = radi + radius(j);
const X_FLOAT cutsq = (radsum + skin) * (radsum + skin);
if(rsq <= cutsq) {
if(n<neigh_list.maxneighs) {
if(neigh_list.history && rsq < radsum*radsum) neighbors_i(n++) = j ^ mask_history;
else neighbors_i(n++) = j;
}
else n++;
}
}
for(int k = 0; k < nstencil; k++) {
const int jbin = ibin + stencil[k];
// get subview of jbin
if(HalfNeigh && (ibin==jbin)) continue;
//const ArrayTypes<DeviceType>::t_int_1d_const_um =Kokkos::subview<t_int_1d_const_um>(bins,jbin,ALL);
for(int m = 0; m < c_bincount(jbin); m++) {
const int j = c_bins(jbin,m);
const int jtype = type(j);
if(HalfNeigh && !Newton && (j < i)) continue;
if(!HalfNeigh && j==i) continue;
if(Tri) {
if (x(j,2) < ztmp) continue;
if (x(j,2) == ztmp) {
if (x(j,1) < ytmp) continue;
if (x(j,1) == ytmp) {
if (x(j,0) < xtmp) continue;
if (x(j,0) == xtmp && j <= i) continue;
}
}
}
if(exclude && exclusion(i,j,itype,jtype)) continue;
const X_FLOAT delx = xtmp - x(j, 0);
const X_FLOAT dely = ytmp - x(j, 1);
const X_FLOAT delz = ztmp - x(j, 2);
const X_FLOAT rsq = delx * delx + dely * dely + delz * delz;
const X_FLOAT radsum = radi + radius(j);
const X_FLOAT cutsq = (radsum + skin) * (radsum + skin);
if(rsq <= cutsq) {
if(n<neigh_list.maxneighs) {
if(neigh_list.history && rsq < radsum*radsum) neighbors_i(n++) = j ^ mask_history;
else neighbors_i(n++) = j;
}
else n++;
}
}
}
neigh_list.d_numneigh(i) = n;
if(n > neigh_list.maxneighs) {
resize() = 1;
if(n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop
}
neigh_list.d_ilist(i) = i;
}
/* ---------------------------------------------------------------------- */
#ifdef KOKKOS_HAVE_CUDA
template<class DeviceType> template<int HalfNeigh,int Newton,int Tri>
__device__ inline
void NeighborKokkosExecute<DeviceType>::build_ItemSizeCuda(typename Kokkos::TeamPolicy<DeviceType>::member_type dev) const
{
/* loop over atoms in i's bin,
*/
const int atoms_per_bin = c_bins.extent(1);
const int BINS_PER_TEAM = dev.team_size()/atoms_per_bin<1?1:dev.team_size()/atoms_per_bin;
const int TEAMS_PER_BIN = atoms_per_bin/dev.team_size()<1?1:atoms_per_bin/dev.team_size();
const int MY_BIN = dev.team_rank()/atoms_per_bin;
const int ibin = dev.league_rank()*BINS_PER_TEAM+MY_BIN;
if(ibin >=c_bincount.extent(0)) return;
X_FLOAT* other_x = sharedmem;
other_x = other_x + 6*atoms_per_bin*MY_BIN;
int* other_id = (int*) &other_x[5 * atoms_per_bin];
int bincount_current = c_bincount[ibin];
for(int kk = 0; kk < TEAMS_PER_BIN; kk++) {
const int MY_II = dev.team_rank()%atoms_per_bin+kk*dev.team_size();
const int i = MY_II < bincount_current ? c_bins(ibin, MY_II) : -1;
/* if necessary, goto next page and add pages */
int n = 0;
X_FLOAT xtmp;
X_FLOAT ytmp;
X_FLOAT ztmp;
X_FLOAT radi;
int itype;
const AtomNeighbors neighbors_i = neigh_list.get_neighbors((i>=0&&i<nlocal)?i:0);
const int mask_history = 3 << SBBITS;
if(i >= 0) {
xtmp = x(i, 0);
ytmp = x(i, 1);
ztmp = x(i, 2);
radi = radius(i);
itype = type(i);
other_x[MY_II] = xtmp;
other_x[MY_II + atoms_per_bin] = ytmp;
other_x[MY_II + 2 * atoms_per_bin] = ztmp;
other_x[MY_II + 3 * atoms_per_bin] = itype;
other_x[MY_II + 4 * atoms_per_bin] = radi;
}
other_id[MY_II] = i;
int test = (__syncthreads_count(i >= 0 && i <= nlocal) == 0);
if(test) return;
if(i >= 0 && i < nlocal) {
#pragma unroll 4
for(int m = 0; m < bincount_current; m++) {
int j = other_id[m];
const int jtype = other_x[m + 3 * atoms_per_bin];
//for same bin as atom i skip j if i==j and skip atoms "below and to the left" if using halfneighborlists
if((j == i) ||
(HalfNeigh && !Newton && (j < i)) ||
(HalfNeigh && Newton &&
((j < i) ||
((j >= nlocal) && ((x(j, 2) < ztmp) || (x(j, 2) == ztmp && x(j, 1) < ytmp) ||
(x(j, 2) == ztmp && x(j, 1) == ytmp && x(j, 0) < xtmp)))))
) continue;
if(Tri) {
if (x(j,2) < ztmp) continue;
if (x(j,2) == ztmp) {
if (x(j,1) < ytmp) continue;
if (x(j,1) == ytmp) {
if (x(j,0) < xtmp) continue;
if (x(j,0) == xtmp && j <= i) continue;
}
}
}
if(exclude && exclusion(i,j,itype,jtype)) continue;
const X_FLOAT delx = xtmp - other_x[m];
const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin];
const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin];
const X_FLOAT rsq = delx * delx + dely * dely + delz * delz;
const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin];
const X_FLOAT cutsq = (radsum + skin) * (radsum + skin);
if(rsq <= cutsq) {
if(n<neigh_list.maxneighs) {
if (neigh_list.history && rsq < radsum*radsum) neighbors_i(n++) = j ^ mask_history;
else neighbors_i(n++) = j;
}
else n++;
}
}
}
__syncthreads();
const typename ArrayTypes<DeviceType>::t_int_1d_const_um stencil
= d_stencil;
for(int k = 0; k < nstencil; k++) {
const int jbin = ibin + stencil[k];
if(ibin == jbin) continue;
bincount_current = c_bincount[jbin];
int j = MY_II < bincount_current ? c_bins(jbin, MY_II) : -1;
if(j >= 0) {
other_x[MY_II] = x(j, 0);
other_x[MY_II + atoms_per_bin] = x(j, 1);
other_x[MY_II + 2 * atoms_per_bin] = x(j, 2);
other_x[MY_II + 3 * atoms_per_bin] = type(j);
other_x[MY_II + 4 * atoms_per_bin] = radius(j);
}
other_id[MY_II] = j;
__syncthreads();
if(i >= 0 && i < nlocal) {
#pragma unroll 8
for(int m = 0; m < bincount_current; m++) {
const int j = other_id[m];
const int jtype = other_x[m + 3 * atoms_per_bin];
if(HalfNeigh && (j < i)) continue;
if(HalfNeigh && !Newton && (j < i)) continue;
if(!HalfNeigh && j==i) continue;
if(Tri) {
if (x(j,2) < ztmp) continue;
if (x(j,2) == ztmp) {
if (x(j,1) < ytmp) continue;
if (x(j,1) == ytmp) {
if (x(j,0) < xtmp) continue;
if (x(j,0) == xtmp && j <= i) continue;
}
}
}
if(exclude && exclusion(i,j,itype,jtype)) continue;
const X_FLOAT delx = xtmp - other_x[m];
const X_FLOAT dely = ytmp - other_x[m + atoms_per_bin];
const X_FLOAT delz = ztmp - other_x[m + 2 * atoms_per_bin];
const X_FLOAT rsq = delx * delx + dely * dely + delz * delz;
const X_FLOAT radsum = radi + other_x[m + 4 * atoms_per_bin];
const X_FLOAT cutsq = (radsum + skin) * (radsum + skin);
if(rsq <= cutsq) {
if(n<neigh_list.maxneighs) {
if (neigh_list.history && rsq < radsum*radsum) neighbors_i(n++) = j ^ mask_history;
else neighbors_i(n++) = j;
}
else n++;
}
}
}
__syncthreads();
}
if(i >= 0 && i < nlocal) {
neigh_list.d_numneigh(i) = n;
neigh_list.d_ilist(i) = i;
}
if(n > neigh_list.maxneighs) {
resize() = 1;
if(n > new_maxneighs()) new_maxneighs() = n; // avoid atomics, safe because in while loop
}
}
}
#endif
}
namespace LAMMPS_NS {
template class NPairKokkos<LMPDeviceType,0,0,0>;
template class NPairKokkos<LMPDeviceType,0,1,0>;
template class NPairKokkos<LMPDeviceType,1,0,0>;
template class NPairKokkos<LMPDeviceType,1,1,0>;
template class NPairKokkos<LMPDeviceType,1,0,1>;
template class NPairKokkos<LMPDeviceType,0,0,0,0>;
template class NPairKokkos<LMPDeviceType,0,1,0,0>;
template class NPairKokkos<LMPDeviceType,1,0,0,0>;
template class NPairKokkos<LMPDeviceType,1,1,0,0>;
template class NPairKokkos<LMPDeviceType,1,0,1,0>;
template class NPairKokkos<LMPDeviceType,1,0,0,1>;
template class NPairKokkos<LMPDeviceType,1,0,1,1>;
#ifdef KOKKOS_HAVE_CUDA
template class NPairKokkos<LMPHostType,0,0,0>;
template class NPairKokkos<LMPHostType,0,1,0>;
template class NPairKokkos<LMPHostType,1,0,0>;
template class NPairKokkos<LMPHostType,1,1,0>;
template class NPairKokkos<LMPHostType,1,0,1>;
template class NPairKokkos<LMPHostType,0,0,0,0>;
template class NPairKokkos<LMPHostType,0,1,0,0>;
template class NPairKokkos<LMPHostType,1,0,0,0>;
template class NPairKokkos<LMPHostType,1,1,0,0>;
template class NPairKokkos<LMPHostType,1,0,1,0>;
template class NPairKokkos<LMPHostType,1,0,0,1>;
template class NPairKokkos<LMPHostType,1,0,1,1>;
#endif
}

View File

@ -13,56 +13,76 @@
#ifdef NPAIR_CLASS
typedef NPairKokkos<LMPHostType,0,0,0> NPairKokkosFullBinHost;
typedef NPairKokkos<LMPHostType,0,0,0,0> NPairKokkosFullBinHost;
NPairStyle(full/bin/kk/host,
NPairKokkosFullBinHost,
NP_FULL | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI)
typedef NPairKokkos<LMPDeviceType,0,0,0> NPairKokkosFullBinDevice;
typedef NPairKokkos<LMPDeviceType,0,0,0,0> NPairKokkosFullBinDevice;
NPairStyle(full/bin/kk/device,
NPairKokkosFullBinDevice,
NP_FULL | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI)
typedef NPairKokkos<LMPHostType,0,1,0> NPairKokkosFullBinGhostHost;
typedef NPairKokkos<LMPHostType,0,1,0,0> NPairKokkosFullBinGhostHost;
NPairStyle(full/bin/ghost/kk/host,
NPairKokkosFullBinGhostHost,
NP_FULL | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI)
typedef NPairKokkos<LMPDeviceType,0,1,0> NPairKokkosFullBinGhostDevice;
typedef NPairKokkos<LMPDeviceType,0,1,0,0> NPairKokkosFullBinGhostDevice;
NPairStyle(full/bin/ghost/kk/device,
NPairKokkosFullBinGhostDevice,
NP_FULL | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI)
typedef NPairKokkos<LMPHostType,1,0,0> NPairKokkosHalfBinHost;
typedef NPairKokkos<LMPHostType,1,0,0,0> NPairKokkosHalfBinHost;
NPairStyle(half/bin/kk/host,
NPairKokkosHalfBinHost,
NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO)
typedef NPairKokkos<LMPDeviceType,1,0,0> NPairKokkosHalfBinDevice;
typedef NPairKokkos<LMPDeviceType,1,0,0,0> NPairKokkosHalfBinDevice;
NPairStyle(half/bin/kk/device,
NPairKokkosHalfBinDevice,
NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO)
typedef NPairKokkos<LMPHostType,1,0,1> NPairKokkosHalfBinHostTri;
typedef NPairKokkos<LMPHostType,1,0,1,0> NPairKokkosHalfBinHostTri;
NPairStyle(half/bin/kk/host,
NPairKokkosHalfBinHostTri,
NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_TRI)
typedef NPairKokkos<LMPDeviceType,1,0,1> NPairKokkosHalfBinDeviceTri;
typedef NPairKokkos<LMPDeviceType,1,0,1,0> NPairKokkosHalfBinDeviceTri;
NPairStyle(half/bin/kk/device,
NPairKokkosHalfBinDeviceTri,
NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_TRI)
typedef NPairKokkos<LMPHostType,1,1,0> NPairKokkosHalfBinGhostHost;
typedef NPairKokkos<LMPHostType,1,1,0,0> NPairKokkosHalfBinGhostHost;
NPairStyle(half/bin/ghost/kk/host,
NPairKokkosHalfBinGhostHost,
NP_HALF | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI)
typedef NPairKokkos<LMPDeviceType,1,1,0> NPairKokkosHalfBinGhostDevice;
typedef NPairKokkos<LMPDeviceType,1,1,0,0> NPairKokkosHalfBinGhostDevice;
NPairStyle(half/bin/ghost/kk/device,
NPairKokkosHalfBinGhostDevice,
NP_HALF | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_GHOST | NP_ORTHO | NP_TRI)
typedef NPairKokkos<LMPHostType,1,0,0,1> NPairKokkosHalfSizeBinHost;
NPairStyle(half/size/bin/kk/host,
NPairKokkosHalfSizeBinHost,
NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_ORTHO)
typedef NPairKokkos<LMPDeviceType,1,0,0,1> NPairKokkosHalfSizeBinDevice;
NPairStyle(half/size/bin/kk/device,
NPairKokkosHalfSizeBinDevice,
NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_ORTHO)
typedef NPairKokkos<LMPHostType,1,0,1,1> NPairKokkosHalfSizeBinHostTri;
NPairStyle(half/size/bin/kk/host,
NPairKokkosHalfSizeBinHostTri,
NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_HOST | NP_NEWTON | NP_NEWTOFF | NP_TRI)
typedef NPairKokkos<LMPDeviceType,1,0,1,1> NPairKokkosHalfSizeBinDeviceTri;
NPairStyle(half/size/bin/kk/device,
NPairKokkosHalfSizeBinDeviceTri,
NP_HALF | NP_SIZE | NP_BIN | NP_KOKKOS_DEVICE | NP_NEWTON | NP_NEWTOFF | NP_TRI)
#else
#ifndef LMP_NPAIR_KOKKOS_H
@ -73,7 +93,7 @@ NPairStyle(half/bin/ghost/kk/device,
namespace LAMMPS_NS {
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI>
template<class DeviceType, int HALF_NEIGH, int GHOST, int TRI, int SIZE>
class NPairKokkos : public NPair {
public:
NPairKokkos(class LAMMPS *);
@ -162,6 +182,7 @@ class NeighborKokkosExecute
// data from Atom class
const typename AT::t_x_array_randomread x;
const typename AT::t_float_1d radius;
const typename AT::t_int_1d_const type,mask;
const typename AT::t_tagint_1d_const molecule;
const typename AT::t_tagint_1d_const tag;
@ -188,6 +209,9 @@ class NeighborKokkosExecute
const int xperiodic, yperiodic, zperiodic;
const int xprd_half, yprd_half, zprd_half;
// GRANULAR required member variables
const X_FLOAT skin;
NeighborKokkosExecute(
const NeighListKokkos<DeviceType> &_neigh_list,
const typename AT::t_xfloat_2d_randomread &_cutneighsq,
@ -199,6 +223,7 @@ class NeighborKokkosExecute
const typename AT::t_int_1d_3 &_d_stencilxyz,
const int _nlocal,
const typename AT::t_x_array_randomread &_x,
const typename AT::t_float_1d &_radius,
const typename AT::t_int_1d_const &_type,
const typename AT::t_int_1d_const &_mask,
const typename AT::t_tagint_1d_const &_molecule,
@ -225,13 +250,14 @@ class NeighborKokkosExecute
const typename AT::t_int_1d_const & _ex_mol_intra,
const X_FLOAT *_bboxhi, const X_FLOAT* _bboxlo,
const int & _xperiodic, const int & _yperiodic, const int & _zperiodic,
const int & _xprd_half, const int & _yprd_half, const int & _zprd_half):
const int & _xprd_half, const int & _yprd_half, const int & _zprd_half,
const X_FLOAT _skin):
neigh_list(_neigh_list), cutneighsq(_cutneighsq),
bincount(_bincount),c_bincount(_bincount),bins(_bins),c_bins(_bins),
atom2bin(_atom2bin),c_atom2bin(_atom2bin),
nstencil(_nstencil),d_stencil(_d_stencil),d_stencilxyz(_d_stencilxyz),
nlocal(_nlocal),
x(_x),type(_type),mask(_mask),molecule(_molecule),
x(_x),radius(_radius),type(_type),mask(_mask),molecule(_molecule),
tag(_tag),special(_special),nspecial(_nspecial),molecular(_molecular),
nbinx(_nbinx),nbiny(_nbiny),nbinz(_nbinz),
mbinx(_mbinx),mbiny(_mbiny),mbinz(_mbinz),
@ -245,7 +271,8 @@ class NeighborKokkosExecute
ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit),
ex_mol_intra(_ex_mol_intra),
xperiodic(_xperiodic),yperiodic(_yperiodic),zperiodic(_zperiodic),
xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half) {
xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half),
skin(_skin) {
if (molecular == 2) moltemplate = 1;
else moltemplate = 0;
@ -280,10 +307,18 @@ class NeighborKokkosExecute
KOKKOS_FUNCTION
void build_Item_Ghost(const int &i) const;
template<int HalfNeigh, int Newton, int Tri>
KOKKOS_FUNCTION
void build_ItemSize(const int &i) const;
#ifdef KOKKOS_HAVE_CUDA
template<int HalfNeigh, int Newton, int Tri>
__device__ inline
void build_ItemCuda(typename Kokkos::TeamPolicy<DeviceType>::member_type dev) const;
template<int HalfNeigh, int Newton, int Tri>
__device__ inline
void build_ItemSizeCuda(typename Kokkos::TeamPolicy<DeviceType>::member_type dev) const;
#endif
KOKKOS_INLINE_FUNCTION
@ -399,6 +434,48 @@ struct NPairKokkosBuildFunctorGhost {
}
};
template <class DeviceType, int HALF_NEIGH, int GHOST_NEWTON, int TRI>
struct NPairKokkosBuildFunctorSize {
typedef DeviceType device_type;
const NeighborKokkosExecute<DeviceType> c;
const size_t sharedsize;
NPairKokkosBuildFunctorSize(const NeighborKokkosExecute<DeviceType> &_c,
const size_t _sharedsize): c(_c), sharedsize(_sharedsize) {};
KOKKOS_INLINE_FUNCTION
void operator() (const int & i) const {
c.template build_ItemSize<HALF_NEIGH,GHOST_NEWTON,TRI>(i);
}
#ifdef KOKKOS_HAVE_CUDA
__device__ inline
void operator() (typename Kokkos::TeamPolicy<DeviceType>::member_type dev) const {
c.template build_ItemSizeCuda<HALF_NEIGH,GHOST_NEWTON,TRI>(dev);
}
size_t shmem_size(const int team_size) const { (void) team_size; return sharedsize; }
#endif
};
template <int HALF_NEIGH, int GHOST_NEWTON, int TRI>
struct NPairKokkosBuildFunctorSize<LMPHostType,HALF_NEIGH,GHOST_NEWTON,TRI> {
typedef LMPHostType device_type;
const NeighborKokkosExecute<LMPHostType> c;
const size_t sharedsize;
NPairKokkosBuildFunctorSize(const NeighborKokkosExecute<LMPHostType> &_c,
const size_t _sharedsize): c(_c), sharedsize(_sharedsize) {};
KOKKOS_INLINE_FUNCTION
void operator() (const int & i) const {
c.template build_ItemSize<HALF_NEIGH,GHOST_NEWTON,TRI>(i);
}
void operator() (typename Kokkos::TeamPolicy<LMPHostType>::member_type dev) const {} // Should error out
};
}
#endif

View File

@ -186,7 +186,7 @@ void PairDPDfdtEnergyKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
f = atomKK->k_f.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mass = atomKK->k_mass.view<DeviceType>();
rmass = atomKK->rmass;
rmass = atomKK->k_rmass.view<DeviceType>();
dpdTheta = atomKK->k_dpdTheta.view<DeviceType>();
k_cutsq.template sync<DeviceType>();
@ -564,7 +564,7 @@ void PairDPDfdtEnergyKokkos<DeviceType>::operator()(TagPairDPDfdtEnergyComputeNo
a_f(j,2) -= delz*fpair;
}
if (rmass) {
if (rmass.data()) {
mass_i = rmass[i];
mass_j = rmass[j];
} else {

View File

@ -132,7 +132,7 @@ class PairDPDfdtEnergyKokkos : public PairDPDfdtEnergy {
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_int_1d_randomread type;
typename ArrayTypes<DeviceType>::t_float_1d_randomread mass;
double *rmass;
typename ArrayTypes<DeviceType>::t_float_1d rmass;
typename AT::t_efloat_1d dpdTheta;
typename AT::t_efloat_1d d_duCond,d_duMech;
HAT::t_efloat_1d h_duCond,h_duMech;

View File

@ -0,0 +1,587 @@
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#include "pair_gran_hooke_history_kokkos.h"
#include "kokkos.h"
#include "atom_kokkos.h"
#include "atom_masks.h"
#include "memory_kokkos.h"
#include "force.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "neigh_request.h"
#include "error.h"
#include "modify.h"
#include "fix_neigh_history_kokkos.h"
#include "update.h"
using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
template<class DeviceType>
PairGranHookeHistoryKokkos<DeviceType>::PairGranHookeHistoryKokkos(LAMMPS *lmp) : PairGranHookeHistory(lmp)
{
atomKK = (AtomKokkos *) atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = X_MASK | V_MASK | OMEGA_MASK | F_MASK | TORQUE_MASK | TYPE_MASK | MASK_MASK | ENERGY_MASK | VIRIAL_MASK | RMASS_MASK | RADIUS_MASK;
datamask_modify = F_MASK | TORQUE_MASK | ENERGY_MASK | VIRIAL_MASK;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
PairGranHookeHistoryKokkos<DeviceType>::~PairGranHookeHistoryKokkos()
{
if (copymode) return;
if (allocated) {
memoryKK->destroy_kokkos(k_eatom,eatom);
memoryKK->destroy_kokkos(k_vatom,vatom);
eatom = NULL;
vatom = NULL;
}
}
/* ----------------------------------------------------------------------
init specific to this pair style
------------------------------------------------------------------------- */
template<class DeviceType>
void PairGranHookeHistoryKokkos<DeviceType>::init_style()
{
if (history && fix_history == NULL) {
char dnumstr[16];
sprintf(dnumstr,"%d",3);
char **fixarg = new char*[4];
fixarg[0] = (char *) "NEIGH_HISTORY";
fixarg[1] = (char *) "all";
if (execution_space == Device)
fixarg[2] = (char *) "NEIGH_HISTORY/KK/DEVICE";
else
fixarg[2] = (char *) "NEIGH_HISTORY/KK/HOST";
fixarg[3] = dnumstr;
modify->add_fix(4,fixarg,1);
delete [] fixarg;
fix_history = (FixNeighHistory *) modify->fix[modify->nfix-1];
fix_history->pair = this;
fix_historyKK = (FixNeighHistoryKokkos<DeviceType> *)fix_history;
}
PairGranHookeHistory::init_style();
// irequest = neigh request made by parent class
neighflag = lmp->kokkos->neighflag;
int irequest = neighbor->nrequest - 1;
neighbor->requests[irequest]->
kokkos_host = Kokkos::Impl::is_same<DeviceType,LMPHostType>::value &&
!Kokkos::Impl::is_same<DeviceType,LMPDeviceType>::value;
neighbor->requests[irequest]->
kokkos_device = Kokkos::Impl::is_same<DeviceType,LMPDeviceType>::value;
if (neighflag == HALF || neighflag == HALFTHREAD) {
neighbor->requests[irequest]->full = 0;
neighbor->requests[irequest]->half = 1;
} else {
error->all(FLERR,"Cannot use chosen neighbor list style with gran/hooke/history/kk");
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
void PairGranHookeHistoryKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
{
copymode = 1;
eflag = eflag_in;
vflag = vflag_in;
if (neighflag == FULL) no_virial_fdotr_compute = 1;
if (eflag || vflag) ev_setup(eflag,vflag,0);
else evflag = vflag_fdotr = 0;
int shearupdate = 1;
if (update->setupflag) shearupdate = 0;
// reallocate per-atom arrays if necessary
if (eflag_atom) {
memoryKK->destroy_kokkos(k_eatom,eatom);
memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
d_eatom = k_eatom.view<DeviceType>();
}
if (vflag_atom) {
memoryKK->destroy_kokkos(k_vatom,vatom);
memoryKK->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom");
d_vatom = k_vatom.view<DeviceType>();
}
atomKK->sync(execution_space,datamask_read);
if (eflag || vflag) atomKK->modified(execution_space,datamask_modify);
else atomKK->modified(execution_space,F_MASK | TORQUE_MASK);
x = atomKK->k_x.view<DeviceType>();
v = atomKK->k_v.view<DeviceType>();
omega = atomKK->k_omega.view<DeviceType>();
c_x = atomKK->k_x.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
torque = atomKK->k_torque.view<DeviceType>();
type = atomKK->k_type.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
tag = atomKK->k_tag.view<DeviceType>();
rmass = atomKK->k_rmass.view<DeviceType>();
radius = atomKK->k_radius.view<DeviceType>();
nlocal = atom->nlocal;
nall = atom->nlocal + atom->nghost;
newton_pair = force->newton_pair;
special_lj[0] = force->special_lj[0];
special_lj[1] = force->special_lj[1];
special_lj[2] = force->special_lj[2];
special_lj[3] = force->special_lj[3];
int inum = list->inum;
NeighListKokkos<DeviceType>* k_list = static_cast<NeighListKokkos<DeviceType>*>(list);
d_numneigh = k_list->d_numneigh;
d_neighbors = k_list->d_neighbors;
d_ilist = k_list->d_ilist;
if (d_numneigh.extent(0) != d_numneigh_touch.extent(0))
d_numneigh_touch = typename AT::t_int_1d("pair:numneigh_touch",d_numneigh.extent(0));
if (d_neighbors.extent(0) != d_neighbors_touch.extent(0) ||
d_neighbors.extent(1) != d_neighbors_touch.extent(1))
d_neighbors_touch = typename AT::t_neighbors_2d("pair:neighbors_touch",d_neighbors.extent(0),d_neighbors.extent(1));
d_firsttouch = fix_historyKK->d_firstflag;
d_firstshear = fix_historyKK->d_firstvalue;
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryReduce>(0,inum),*this);
EV_FLOAT ev;
if (lmp->kokkos->neighflag == HALF) {
if (force->newton_pair) {
if (vflag_atom) {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,1,2,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,1,2,0>>(0,inum),*this);
}
} else if (vflag_global) {
if (shearupdate) {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,1,1,1>>(0,inum),*this, ev);
} else {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,1,1,0>>(0,inum),*this, ev);
}
} else {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,1,0,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,1,0,0>>(0,inum),*this);
}
}
} else {
if (vflag_atom) {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,0,2,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,0,2,0>>(0,inum),*this);
}
} else if (vflag_global) {
if (shearupdate) {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,0,1,1>>(0,inum),*this, ev);
} else {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,0,1,0>>(0,inum),*this, ev);
}
} else {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,0,0,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALF,0,0,0>>(0,inum),*this);
}
}
}
} else { // HALFTHREAD
if (force->newton_pair) {
if (vflag_atom) {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,1,2,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,1,2,0>>(0,inum),*this);
}
} else if (vflag_global) {
if (shearupdate) {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,1,1,1>>(0,inum),*this, ev);
} else {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,1,1,0>>(0,inum),*this, ev);
}
} else {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,1,0,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,1,0,0>>(0,inum),*this);
}
}
} else {
if (vflag_atom) {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,0,2,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,0,2,0>>(0,inum),*this);
}
} else if (vflag_global) {
if (shearupdate) {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,0,1,1>>(0,inum),*this, ev);
} else {
Kokkos::parallel_reduce(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,0,1,0>>(0,inum),*this, ev);
}
} else {
if (shearupdate) {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,0,0,1>>(0,inum),*this);
} else {
Kokkos::parallel_for(Kokkos::RangePolicy<DeviceType, TagPairGranHookeHistoryCompute<HALFTHREAD,0,0,0>>(0,inum),*this);
}
}
}
}
if (vflag_global) {
virial[0] += ev.v[0];
virial[1] += ev.v[1];
virial[2] += ev.v[2];
virial[3] += ev.v[3];
virial[4] += ev.v[4];
virial[5] += ev.v[5];
}
if (vflag_atom) {
k_vatom.template modify<DeviceType>();
k_vatom.template sync<LMPHostType>();
}
if (vflag_fdotr) pair_virial_fdotr_compute(this);
copymode = 0;
}
template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void PairGranHookeHistoryKokkos<DeviceType>::operator()(TagPairGranHookeHistoryReduce, const int ii) const {
const int i = d_ilist[ii];
const X_FLOAT xtmp = x(i,0);
const X_FLOAT ytmp = x(i,1);
const X_FLOAT ztmp = x(i,2);
const LMP_FLOAT imass = rmass[i];
const LMP_FLOAT irad = radius[i];
const int jnum = d_numneigh[i];
int count = 0;
for (int jj = 0; jj < jnum; jj++) {
const int j = d_neighbors(i,jj) & NEIGHMASK;
const X_FLOAT delx = xtmp - x(j,0);
const X_FLOAT dely = ytmp - x(j,1);
const X_FLOAT delz = ztmp - x(j,2);
const X_FLOAT rsq = delx*delx + dely*dely + delz*delz;
const LMP_FLOAT jmass = rmass[j];
const LMP_FLOAT jrad = radius[j];
const LMP_FLOAT radsum = irad + jrad;
// check for touching neighbors
if (rsq >= radsum * radsum) {
d_firsttouch(i,jj) = 0;
d_firstshear(i,3*jj) = 0;
d_firstshear(i,3*jj+1) = 0;
d_firstshear(i,3*jj+2) = 0;
} else {
d_firsttouch(i,jj) = 1;
d_neighbors_touch(i,count++) = jj;
}
}
d_numneigh_touch[i] = count;
}
template<class DeviceType>
template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG, int SHEARUPDATE>
KOKKOS_INLINE_FUNCTION
void PairGranHookeHistoryKokkos<DeviceType>::operator()(TagPairGranHookeHistoryCompute<NEIGHFLAG,NEWTON_PAIR,EVFLAG,SHEARUPDATE>, const int ii, EV_FLOAT &ev) const {
// The f and torque arrays are atomic for Half/Thread neighbor style
Kokkos::View<F_FLOAT*[3], typename DAT::t_f_array::array_layout,DeviceType,Kokkos::MemoryTraits<AtomicF<NEIGHFLAG>::value> > a_f = f;
Kokkos::View<F_FLOAT*[3], typename DAT::t_f_array::array_layout,DeviceType,Kokkos::MemoryTraits<AtomicF<NEIGHFLAG>::value> > a_torque = torque;
const int i = d_ilist[ii];
const X_FLOAT xtmp = x(i,0);
const X_FLOAT ytmp = x(i,1);
const X_FLOAT ztmp = x(i,2);
const LMP_FLOAT imass = rmass[i];
const LMP_FLOAT irad = radius[i];
const int jnum = d_numneigh_touch[i];
F_FLOAT fx_i = 0.0;
F_FLOAT fy_i = 0.0;
F_FLOAT fz_i = 0.0;
F_FLOAT torquex_i = 0.0;
F_FLOAT torquey_i = 0.0;
F_FLOAT torquez_i = 0.0;
for (int jj = 0; jj < jnum; jj++) {
const int m = d_neighbors_touch(i, jj);
const int j = d_neighbors(i, m) & NEIGHMASK;
const X_FLOAT delx = xtmp - x(j,0);
const X_FLOAT dely = ytmp - x(j,1);
const X_FLOAT delz = ztmp - x(j,2);
const X_FLOAT rsq = delx*delx + dely*dely + delz*delz;
const LMP_FLOAT jmass = rmass[j];
const LMP_FLOAT jrad = radius[j];
const LMP_FLOAT radsum = irad + jrad;
// check for touching neighbors
const LMP_FLOAT r = sqrt(rsq);
const LMP_FLOAT rinv = 1.0/r;
const LMP_FLOAT rsqinv = 1/rsq;
// relative translational velocity
V_FLOAT vr1 = v(i,0) - v(j,0);
V_FLOAT vr2 = v(i,1) - v(j,1);
V_FLOAT vr3 = v(i,2) - v(j,2);
// normal component
V_FLOAT vnnr = vr1*delx + vr2*dely + vr3*delz;
V_FLOAT vn1 = delx*vnnr * rsqinv;
V_FLOAT vn2 = dely*vnnr * rsqinv;
V_FLOAT vn3 = delz*vnnr * rsqinv;
// tangential component
V_FLOAT vt1 = vr1 - vn1;
V_FLOAT vt2 = vr2 - vn2;
V_FLOAT vt3 = vr3 - vn3;
// relative rotational velocity
V_FLOAT wr1 = (irad*omega(i,0) + jrad*omega(j,0)) * rinv;
V_FLOAT wr2 = (irad*omega(i,1) + jrad*omega(j,1)) * rinv;
V_FLOAT wr3 = (irad*omega(i,2) + jrad*omega(j,2)) * rinv;
LMP_FLOAT meff = imass*jmass / (imass+jmass);
if (mask[i] & freeze_group_bit) meff = jmass;
if (mask[j] & freeze_group_bit) meff = imass;
F_FLOAT damp = meff*gamman*vnnr*rsqinv;
F_FLOAT ccel = kn*(radsum-r)*rinv - damp;
// relative velocities
V_FLOAT vtr1 = vt1 - (delz*wr2-dely*wr3);
V_FLOAT vtr2 = vt2 - (delx*wr3-delz*wr1);
V_FLOAT vtr3 = vt3 - (dely*wr1-delx*wr2);
V_FLOAT vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
vrel = sqrt(vrel);
// shear history effects
X_FLOAT shear1 = d_firstshear(i,3*m);
X_FLOAT shear2 = d_firstshear(i,3*m+1);
X_FLOAT shear3 = d_firstshear(i,3*m+2);
if (SHEARUPDATE) {
shear1 += vtr1*dt;
shear2 += vtr2*dt;
shear3 += vtr3*dt;
}
X_FLOAT shrmag = sqrt(shear1*shear1 + shear2*shear2 +
shear3*shear3);
// rotate shear displacements
X_FLOAT rsht = shear1*delx + shear2*dely + shear3*delz;
rsht *= rsqinv;
if (SHEARUPDATE) {
shear1 -= rsht*delx;
shear2 -= rsht*dely;
shear3 -= rsht*delz;
}
// tangential forces = shear + tangential velocity damping
F_FLOAT fs1 = - (kt*shear1 + meff*gammat*vtr1);
F_FLOAT fs2 = - (kt*shear2 + meff*gammat*vtr2);
F_FLOAT fs3 = - (kt*shear3 + meff*gammat*vtr3);
// rescale frictional displacements and forces if needed
F_FLOAT fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
F_FLOAT fn = xmu * fabs(ccel*r);
if (fs > fn) {
if (shrmag != 0.0) {
shear1 = (fn/fs) * (shear1 + meff*gammat*vtr1/kt) -
meff*gammat*vtr1/kt;
shear2 = (fn/fs) * (shear2 + meff*gammat*vtr2/kt) -
meff*gammat*vtr2/kt;
shear3 = (fn/fs) * (shear3 + meff*gammat*vtr3/kt) -
meff*gammat*vtr3/kt;
fs1 *= fn/fs;
fs2 *= fn/fs;
fs3 *= fn/fs;
} else fs1 = fs2 = fs3 = 0.0;
}
if (SHEARUPDATE) {
d_firstshear(i,3*m) = shear1;
d_firstshear(i,3*m+1) = shear2;
d_firstshear(i,3*m+2) = shear3;
}
// forces & torques
F_FLOAT fx = delx*ccel + fs1;
F_FLOAT fy = dely*ccel + fs2;
F_FLOAT fz = delz*ccel + fs3;
fx_i += fx;
fy_i += fy;
fz_i += fz;
F_FLOAT tor1 = rinv * (dely*fs3 - delz*fs2);
F_FLOAT tor2 = rinv * (delz*fs1 - delx*fs3);
F_FLOAT tor3 = rinv * (delx*fs2 - dely*fs1);
torquex_i -= irad*tor1;
torquey_i -= irad*tor2;
torquez_i -= irad*tor3;
if (NEWTON_PAIR || j < nlocal) {
a_f(j,0) -= fx;
a_f(j,1) -= fy;
a_f(j,2) -= fz;
a_torque(j,0) -= jrad*tor1;
a_torque(j,1) -= jrad*tor2;
a_torque(j,2) -= jrad*tor3;
}
if (EVFLAG == 2)
ev_tally_xyz_atom<NEIGHFLAG, NEWTON_PAIR>(ev, i, j, fx_i, fy_i, fz_i, delx, dely, delz);
if (EVFLAG == 1)
ev_tally_xyz<NEWTON_PAIR>(ev, i, j, fx_i, fy_i, fz_i, delx, dely, delz);
}
a_f(i,0) += fx_i;
a_f(i,1) += fy_i;
a_f(i,2) += fz_i;
a_torque(i,0) += torquex_i;
a_torque(i,1) += torquey_i;
a_torque(i,2) += torquez_i;
}
template<class DeviceType>
template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG, int SHEARUPDATE>
KOKKOS_INLINE_FUNCTION
void PairGranHookeHistoryKokkos<DeviceType>::operator()(TagPairGranHookeHistoryCompute<NEIGHFLAG,NEWTON_PAIR,EVFLAG,SHEARUPDATE>, const int ii) const {
EV_FLOAT ev;
this->template operator()<NEIGHFLAG,NEWTON_PAIR,EVFLAG,SHEARUPDATE>(TagPairGranHookeHistoryCompute<NEIGHFLAG,NEWTON_PAIR,EVFLAG,SHEARUPDATE>(), ii, ev);
}
template<class DeviceType>
template<int NEWTON_PAIR>
KOKKOS_INLINE_FUNCTION
void PairGranHookeHistoryKokkos<DeviceType>::ev_tally_xyz(EV_FLOAT &ev, int i, int j,
F_FLOAT fx, F_FLOAT fy, F_FLOAT fz,
X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const
{
F_FLOAT v[6];
v[0] = delx*fx;
v[1] = dely*fy;
v[2] = delz*fz;
v[3] = delx*fy;
v[4] = delx*fz;
v[5] = dely*fz;
if (NEWTON_PAIR) {
ev.v[0] += v[0];
ev.v[1] += v[1];
ev.v[2] += v[2];
ev.v[3] += v[3];
ev.v[4] += v[4];
ev.v[5] += v[5];
} else {
if (i < nlocal) {
ev.v[0] += 0.5*v[0];
ev.v[1] += 0.5*v[1];
ev.v[2] += 0.5*v[2];
ev.v[3] += 0.5*v[3];
ev.v[4] += 0.5*v[4];
ev.v[5] += 0.5*v[5];
}
if (j < nlocal) {
ev.v[0] += 0.5*v[0];
ev.v[1] += 0.5*v[1];
ev.v[2] += 0.5*v[2];
ev.v[3] += 0.5*v[3];
ev.v[4] += 0.5*v[4];
ev.v[5] += 0.5*v[5];
}
}
}
template<class DeviceType>
template<int NEIGHFLAG, int NEWTON_PAIR>
KOKKOS_INLINE_FUNCTION
void PairGranHookeHistoryKokkos<DeviceType>::ev_tally_xyz_atom(EV_FLOAT &ev, int i, int j,
F_FLOAT fx, F_FLOAT fy, F_FLOAT fz,
X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const
{
Kokkos::View<F_FLOAT*[6], typename DAT::t_virial_array::array_layout,DeviceType,Kokkos::MemoryTraits<AtomicF<NEIGHFLAG>::value> > v_vatom = k_vatom.view<DeviceType>();
F_FLOAT v[6];
v[0] = delx*fx;
v[1] = dely*fy;
v[2] = delz*fz;
v[3] = delx*fy;
v[4] = delx*fz;
v[5] = dely*fz;
if (NEWTON_PAIR || i < nlocal) {
v_vatom(i,0) += 0.5*v[0];
v_vatom(i,1) += 0.5*v[1];
v_vatom(i,2) += 0.5*v[2];
v_vatom(i,3) += 0.5*v[3];
v_vatom(i,4) += 0.5*v[4];
v_vatom(i,5) += 0.5*v[5];
}
if (NEWTON_PAIR || j < nlocal) {
v_vatom(j,0) += 0.5*v[0];
v_vatom(j,1) += 0.5*v[1];
v_vatom(j,2) += 0.5*v[2];
v_vatom(j,3) += 0.5*v[3];
v_vatom(j,4) += 0.5*v[4];
v_vatom(j,5) += 0.5*v[5];
}
}
namespace LAMMPS_NS {
template class PairGranHookeHistoryKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class PairGranHookeHistoryKokkos<LMPHostType>;
#endif
}

View File

@ -0,0 +1,150 @@
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(gran/hooke/history/kk,PairGranHookeHistoryKokkos<LMPDeviceType>)
PairStyle(gran/hooke/history/kk/device,PairGranHookeHistoryKokkos<LMPDeviceType>)
PairStyle(gran/hooke/history/kk/host,PairGranHookeHistoryKokkos<LMPHostType>)
#else
#ifndef LMP_PAIR_GRAN_HOOKE_HISTORY_KOKKOS_H
#define LMP_PAIR_GRAN_HOOKE_HISTORY_KOKKOS_H
#include "pair_gran_hooke_history.h"
#include "pair_kokkos.h"
#include "kokkos_type.h"
namespace LAMMPS_NS {
template <class DeviceType>
class FixNeighHistoryKokkos;
template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG, int SHEARUPDATE>
struct TagPairGranHookeHistoryCompute {};
struct TagPairGranHookeHistoryReduce {};
template <class DeviceType>
class PairGranHookeHistoryKokkos : public PairGranHookeHistory {
public:
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
typedef EV_FLOAT value_type;
PairGranHookeHistoryKokkos(class LAMMPS *);
virtual ~PairGranHookeHistoryKokkos();
virtual void compute(int, int);
void init_style();
KOKKOS_INLINE_FUNCTION
void operator()(TagPairGranHookeHistoryReduce, const int ii) const;
template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG, int SHEARUPDATE>
KOKKOS_INLINE_FUNCTION
void operator()(TagPairGranHookeHistoryCompute<NEIGHFLAG,NEWTON_PAIR,EVFLAG,SHEARUPDATE>, const int, EV_FLOAT &ev) const;
template<int NEIGHFLAG, int NEWTON_PAIR, int EVFLAG, int SHEARUPDATE>
KOKKOS_INLINE_FUNCTION
void operator()(TagPairGranHookeHistoryCompute<NEIGHFLAG,NEWTON_PAIR,EVFLAG,SHEARUPDATE>, const int) const;
template<int NEWTON_PAIR>
KOKKOS_INLINE_FUNCTION
void ev_tally_xyz(EV_FLOAT &ev, int i, int j,
F_FLOAT fx, F_FLOAT fy, F_FLOAT fz,
X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const;
template<int NEIGHFLAG, int NEWTON_PAIR>
KOKKOS_INLINE_FUNCTION
void ev_tally_xyz_atom(EV_FLOAT &ev, int i, int j,
F_FLOAT fx, F_FLOAT fy, F_FLOAT fz,
X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const;
protected:
typename AT::t_x_array_randomread x;
typename AT::t_x_array c_x;
typename AT::t_v_array_randomread v;
typename AT::t_v_array_randomread omega;
typename AT::t_f_array f;
typename AT::t_f_array torque;
typename AT::t_int_1d_randomread type;
typename AT::t_int_1d_randomread mask;
typename AT::t_float_1d_randomread rmass;
typename AT::t_float_1d_randomread radius;
DAT::tdual_efloat_1d k_eatom;
DAT::tdual_virial_array k_vatom;
typename AT::t_efloat_1d d_eatom;
typename AT::t_virial_array d_vatom;
typename AT::t_tagint_1d tag;
typename AT::t_neighbors_2d d_neighbors;
typename AT::t_int_1d_randomread d_ilist;
typename AT::t_int_1d_randomread d_numneigh;
typename Kokkos::View<int**> d_firsttouch;
typename Kokkos::View<LMP_FLOAT**> d_firstshear;
typename AT::t_neighbors_2d d_neighbors_touch;
typename AT::t_int_1d d_numneigh_touch;
int newton_pair;
double special_lj[4];
int neighflag;
int nlocal,nall,eflag,vflag;
FixNeighHistoryKokkos<DeviceType> *fix_historyKK;
friend void pair_virial_fdotr_compute<PairGranHookeHistoryKokkos>(PairGranHookeHistoryKokkos*);
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Illegal ... command
Self-explanatory. Check the input script syntax and compare to the
documentation for the command. You can use -echo screen as a
command-line option when running LAMMPS to see the offending line.
E: Incorrect args for pair coefficients
Self-explanatory. Check the input script or data file.
E: Pair granular requires atom attributes radius, rmass
The atom style defined does not have these attributes.
E: Pair granular requires ghost atoms store velocity
Use the comm_modify vel yes command to enable this.
E: Could not find pair fix neigh history ID
UNDOCUMENTED
U: Pair granular with shear history requires newton pair off
This is a current restriction of the implementation of pair
granular styles with history.
U: Could not find pair fix ID
A fix is created internally by the pair style to store shear
history information. You cannot delete it.
*/

View File

@ -64,10 +64,8 @@ enum{FORWARD_IK,FORWARD_IK_PERATOM};
/* ---------------------------------------------------------------------- */
template<class DeviceType>
PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp) : PPPM(lmp)
{
if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");
atomKK = (AtomKokkos *) atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK;
@ -77,8 +75,6 @@ PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp
group_group_enable = 0;
triclinic_support = 0;
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
nfactors = 3;
//factors = new int[nfactors];
factors[0] = 2;
@ -148,6 +144,13 @@ PPPMKokkos<DeviceType>::PPPMKokkos(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp
k_flag = DAT::tdual_int_scalar("PPPM:flag");
}
template<class DeviceType>
void PPPMKokkos<DeviceType>::settings(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm/kk command");
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}
/* ----------------------------------------------------------------------
free all memory
------------------------------------------------------------------------- */

View File

@ -92,11 +92,12 @@ class PPPMKokkos : public PPPM, public KokkosBase {
typedef DeviceType device_type;
typedef ArrayTypes<DeviceType> AT;
PPPMKokkos(class LAMMPS *, int, char **);
PPPMKokkos(class LAMMPS *);
virtual ~PPPMKokkos();
virtual void init();
virtual void setup();
void setup_grid();
virtual void settings(int, char **);
virtual void compute(int, int);
virtual int timing_1d(int, double &);
virtual int timing_3d(int, double &);

View File

@ -55,6 +55,20 @@ struct ForceAdder {
/* ---------------------------------------------------------------------- */
template<class View>
struct Zero {
View v;
Zero(const View &v_):v(v_) {}
KOKKOS_INLINE_FUNCTION
void operator()(const int &i) const {
v(i,0) = 0;
v(i,1) = 0;
v(i,2) = 0;
}
};
/* ---------------------------------------------------------------------- */
VerletKokkos::VerletKokkos(LAMMPS *lmp, int narg, char **arg) :
Verlet(lmp, narg, arg)
{
@ -120,6 +134,7 @@ void VerletKokkos::setup(int flag)
atomKK->modified(Host,ALL_MASK);
neighbor->build(1);
modify->setup_post_neighbor();
neighbor->ncalls = 0;
// compute all forces
@ -175,7 +190,7 @@ void VerletKokkos::setup(int flag)
modify->setup(vflag);
output->setup(flag);
lmp->kokkos->auto_sync = 1;
update->setupflag = 1;
update->setupflag = 0;
}
/* ----------------------------------------------------------------------
@ -223,6 +238,7 @@ void VerletKokkos::setup_minimal(int flag)
atomKK->modified(Host,ALL_MASK);
neighbor->build(1);
modify->setup_post_neighbor();
neighbor->ncalls = 0;
}
@ -567,32 +583,25 @@ void VerletKokkos::run(int n)
void VerletKokkos::force_clear()
{
int i;
if (external_force_clear) return;
atomKK->k_f.modified_host() = 0; // ignore host forces/torques since device views
atomKK->k_torque.modified_host() = 0; // will be cleared below
// clear force on all particles
// if either newton flag is set, also include ghosts
// when using threads always clear all forces.
if (neighbor->includegroup == 0) {
int nall;
if (force->newton) nall = atomKK->nlocal + atomKK->nghost;
else nall = atomKK->nlocal;
int nall = atomKK->nlocal;
if (force->newton) nall += atomKK->nghost;
size_t nbytes = sizeof(double) * nall;
if (nbytes) {
if (atomKK->k_f.modified_host() > atomKK->k_f.modified_device()) {
memset_kokkos(atomKK->k_f.view<LMPHostType>());
atomKK->modified(Host,F_MASK);
atomKK->sync(Device,F_MASK);
} else {
memset_kokkos(atomKK->k_f.view<LMPDeviceType>());
Kokkos::parallel_for(nall, Zero<typename ArrayTypes<LMPDeviceType>::t_f_array>(atomKK->k_f.view<LMPDeviceType>()));
atomKK->modified(Device,F_MASK);
}
if (torqueflag) memset(&(atomKK->torque[0][0]),0,3*nbytes);
if (torqueflag) {
Kokkos::parallel_for(nall, Zero<typename ArrayTypes<LMPDeviceType>::t_f_array>(atomKK->k_torque.view<LMPDeviceType>()));
atomKK->modified(Device,TORQUE_MASK);
}
// neighbor includegroup flag is set
@ -600,36 +609,24 @@ void VerletKokkos::force_clear()
// if either newton flag is set, also include ghosts
} else {
int nall = atomKK->nfirst;
if (atomKK->k_f.modified_host() > atomKK->k_f.modified_device()) {
memset_kokkos(atomKK->k_f.view<LMPHostType>());
atomKK->modified(Host,F_MASK);
} else {
memset_kokkos(atomKK->k_f.view<LMPDeviceType>());
Kokkos::parallel_for(atomKK->nfirst, Zero<typename ArrayTypes<LMPDeviceType>::t_f_array>(atomKK->k_f.view<LMPDeviceType>()));
atomKK->modified(Device,F_MASK);
}
if (torqueflag) {
double **torque = atomKK->torque;
for (i = 0; i < nall; i++) {
torque[i][0] = 0.0;
torque[i][1] = 0.0;
torque[i][2] = 0.0;
}
Kokkos::parallel_for(atomKK->nfirst, Zero<typename ArrayTypes<LMPDeviceType>::t_f_array>(atomKK->k_torque.view<LMPDeviceType>()));
atomKK->modified(Device,TORQUE_MASK);
}
if (force->newton) {
nall = atomKK->nlocal + atomKK->nghost;
auto range = Kokkos::RangePolicy<LMPDeviceType>(atomKK->nlocal, atomKK->nlocal + atomKK->nghost);
Kokkos::parallel_for(range, Zero<typename ArrayTypes<LMPDeviceType>::t_f_array>(atomKK->k_f.view<LMPDeviceType>()));
atomKK->modified(Device,F_MASK);
if (torqueflag) {
double **torque = atomKK->torque;
for (i = atomKK->nlocal; i < nall; i++) {
torque[i][0] = 0.0;
torque[i][1] = 0.0;
torque[i][2] = 0.0;
Kokkos::parallel_for(range, Zero<typename ArrayTypes<LMPDeviceType>::t_f_array>(atomKK->k_torque.view<LMPDeviceType>()));
atomKK->modified(Device,TORQUE_MASK);
}
}
}
}
}

View File

@ -40,7 +40,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
Ewald::Ewald(LAMMPS *lmp) : KSpace(lmp),
kxvecs(NULL), kyvecs(NULL), kzvecs(NULL), ug(NULL), eg(NULL), vg(NULL),
ek(NULL), sfacrl(NULL), sfacim(NULL), sfacrl_all(NULL), sfacim_all(NULL),
cs(NULL), sn(NULL), sfacrl_A(NULL), sfacim_A(NULL), sfacrl_A_all(NULL),
@ -49,12 +49,10 @@ Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
{
group_allocate_flag = 0;
kmax_created = 0;
if (narg != 1) error->all(FLERR,"Illegal kspace_style ewald command");
ewaldflag = 1;
group_group_enable = 1;
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
accuracy_relative = 0.0;
kmax = 0;
kxvecs = kyvecs = kzvecs = NULL;
@ -69,6 +67,13 @@ Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
kcount = 0;
}
void Ewald::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal kspace_style ewald command");
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}
/* ----------------------------------------------------------------------
free all memory
------------------------------------------------------------------------- */

View File

@ -26,10 +26,11 @@ namespace LAMMPS_NS {
class Ewald : public KSpace {
public:
Ewald(class LAMMPS *, int, char **);
Ewald(class LAMMPS *);
virtual ~Ewald();
void init();
void setup();
virtual void settings(int, char **);
virtual void compute(int, int);
double memory_usage();

View File

@ -43,14 +43,11 @@ using namespace MathSpecial;
/* ---------------------------------------------------------------------- */
EwaldDisp::EwaldDisp(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
EwaldDisp::EwaldDisp(LAMMPS *lmp) : KSpace(lmp),
kenergy(NULL), kvirial(NULL), energy_self_peratom(NULL), virial_self_peratom(NULL),
ekr_local(NULL), hvec(NULL), kvec(NULL), B(NULL), cek_local(NULL), cek_global(NULL)
{
if (narg!=1) error->all(FLERR,"Illegal kspace_style ewald/n command");
ewaldflag = dispersionflag = dipoleflag = 1;
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
memset(function, 0, EWALD_NFUNCS*sizeof(int));
kenergy = kvirial = NULL;
@ -68,6 +65,13 @@ EwaldDisp::EwaldDisp(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
M2 = 0;
}
void EwaldDisp::settings(int narg, char **arg)
{
if (narg!=1) error->all(FLERR,"Illegal kspace_style ewald/n command");
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}
/* ---------------------------------------------------------------------- */
EwaldDisp::~EwaldDisp()

View File

@ -36,10 +36,11 @@ typedef struct kvector { long x, y, z; } kvector;
class EwaldDisp : public KSpace {
public:
EwaldDisp(class LAMMPS *, int, char **);
EwaldDisp(class LAMMPS *);
~EwaldDisp();
void init();
void setup();
void settings(int, char **);
void compute(int, int);
double memory_usage() {return bytes;}

View File

@ -273,7 +273,8 @@ void FixTuneKspace::update_kspace_style(char *new_kspace_style,
// delete old kspace style and create new one
force->create_kspace(narg,arg,1);
force->create_kspace(arg[0],1);
force->kspace->settings(narg-1,&arg[1]);
force->kspace->differentiation_flag = old_differentiation_flag;
force->kspace->slabflag = old_slabflag;
force->kspace->slab_volfactor = old_slab_volfactor;

View File

@ -44,7 +44,7 @@ enum{REVERSE_RHO,REVERSE_AD,REVERSE_AD_PERATOM};
enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM};
/* ---------------------------------------------------------------------- */
MSM::MSM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
MSM::MSM(LAMMPS *lmp) : KSpace(lmp),
factors(NULL), delxinv(NULL), delyinv(NULL), delzinv(NULL), nx_msm(NULL),
ny_msm(NULL), nz_msm(NULL), nxlo_in(NULL), nylo_in(NULL), nzlo_in(NULL),
nxhi_in(NULL), nyhi_in(NULL), nzhi_in(NULL), nxlo_out(NULL), nylo_out(NULL),
@ -58,12 +58,8 @@ MSM::MSM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
phi1d(NULL), dphi1d(NULL), procneigh_levels(NULL), cg(NULL), cg_peratom(NULL),
cg_all(NULL), cg_peratom_all(NULL), part2grid(NULL), boxlo(NULL)
{
if (narg < 1) error->all(FLERR,"Illegal kspace_style msm command");
msmflag = 1;
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
nfactors = 1;
factors = new int[nfactors];
factors[0] = 2;
@ -115,6 +111,14 @@ MSM::MSM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
order = 10;
}
/* ---------------------------------------------------------------------- */
void MSM::settings(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal kspace_style msm command");
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}
/* ----------------------------------------------------------------------
free all memory
------------------------------------------------------------------------- */

View File

@ -29,10 +29,11 @@ namespace LAMMPS_NS {
class MSM : public KSpace {
public:
MSM(class LAMMPS *, int, char **);
MSM(class LAMMPS *);
virtual ~MSM();
void init();
void setup();
virtual void settings(int, char **);
virtual void compute(int, int);
protected:

View File

@ -42,18 +42,27 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM};
/* ---------------------------------------------------------------------- */
MSMCG::MSMCG(LAMMPS *lmp, int narg, char **arg) : MSM(lmp, narg, arg),
MSMCG::MSMCG(LAMMPS *lmp) : MSM(lmp),
is_charged(NULL)
{
triclinic_support = 0;
num_charged = -1;
}
/* ---------------------------------------------------------------------- */
void MSMCG::settings(int narg, char **arg)
{
if ((narg < 1) || (narg > 2))
error->all(FLERR,"Illegal kspace_style msm/cg command");
triclinic_support = 0;
// first argument is processed in parent class
MSM::settings(narg,arg);
if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1]));
else smallq = SMALLQ;
num_charged = -1;
}
/* ----------------------------------------------------------------------

View File

@ -26,8 +26,9 @@ namespace LAMMPS_NS {
class MSMCG : public MSM {
public:
MSMCG(class LAMMPS *, int, char **);
MSMCG(class LAMMPS *);
virtual ~MSMCG();
virtual void settings(int, char **);
virtual void compute(int, int);
virtual double memory_usage();

View File

@ -64,7 +64,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM};
/* ---------------------------------------------------------------------- */
PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp),
factors(NULL), density_brick(NULL), vdx_brick(NULL), vdy_brick(NULL), vdz_brick(NULL),
u_brick(NULL), v0_brick(NULL), v1_brick(NULL), v2_brick(NULL), v3_brick(NULL),
v4_brick(NULL), v5_brick(NULL), greensfn(NULL), vg(NULL), fkx(NULL), fky(NULL),
@ -78,14 +78,10 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
peratom_allocate_flag = 0;
group_allocate_flag = 0;
if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");
pppmflag = 1;
group_group_enable = 1;
triclinic = domain->triclinic;
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
nfactors = 3;
factors = new int[nfactors];
factors[0] = 2;
@ -161,6 +157,14 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg),
acons[7][6] = 4887769399.0 / 37838389248.0;
}
/* ---------------------------------------------------------------------- */
void PPPM::settings(int narg, char **arg)
{
if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command");
accuracy_relative = fabs(force->numeric(FLERR,arg[0]));
}
/* ----------------------------------------------------------------------
free all memory
------------------------------------------------------------------------- */

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