Compare commits

...

40 Commits

Author SHA1 Message Date
fa73fab5df patch 16Jul18 2018-07-16 18:12:15 -06:00
a3b6f38a42 Merge pull request #1003 from akohlmey/restart_extra_flags
include support for 'extra/XXX/per/atom' info in restart files
2018-07-16 15:07:43 -06:00
783839e985 add support for restarting extra/XXX/per/atom settings in binary restarts 2018-07-16 15:21:52 -04:00
c589029219 Merge pull request #1002 from rbberger/set_velocity_command
Allow 'set' command to change atom velocities
2018-07-16 08:50:15 -06:00
140767be16 Merge pull request #1001 from stanmoore1/kk_bugfix
Fix rare crash in Kokkos ReaxFF on GPUs
2018-07-16 08:49:30 -06:00
1c007ce7a1 Merge pull request #1000 from HaoZeke/fixDocs
docs: Fix sneaky unicode character
2018-07-16 08:49:13 -06:00
6f1b6e7abd Merge pull request #999 from junghans/cmake_doc
cmake/README.md: fix GPU_ARCH options
2018-07-16 08:48:48 -06:00
5fc4aaef06 Merge pull request #940 from Pakketeretet2/port-enforce2d-kokkos
Port enforce2d kokkos
2018-07-16 08:48:21 -06:00
aa3d3213c9 Update set command documentation 2018-07-13 23:06:42 -04:00
d00eaef070 Allow 'set' command to change atom velocities 2018-07-13 23:05:44 -04:00
d4f8940ff2 Update command doc page for Kokkos enforce2d 2018-07-13 07:40:06 -06:00
16381a52b1 Fix crash in ReaxFF on GPUs 2018-07-12 20:22:38 -06:00
85511a4db8 docs: Fix sneaky unicode character
Fixes the `pdf` target of the `Makefile`.
2018-07-13 00:44:04 +05:30
4ac47ba037 cmake/README.md: fix GPU_ARCH options 2018-07-12 07:27:11 -06:00
6dfb74f23e Merge pull request #997 from lammps/balance-bug-fix
2 small bug fixes to load balancing
2018-07-11 16:13:22 -06:00
b31f0245d0 2 small bug fixes to load balancing 2018-07-11 15:55:16 -06:00
f288331874 Merge pull request #993 from lammps/doc-plus-makefile
better rRESPA doc page, also a new Makefile.theta
2018-07-11 12:53:31 -06:00
71f6991233 Small tweaks to fix_enforce2d_kokkos 2018-07-11 12:39:04 -06:00
5d13321425 Standardize suffix paragraph in fix_enforce2d.txt 2018-07-11 12:15:50 -06:00
acdc240cdd better rRESPA doc page, also a new Makefile.theta 2018-07-11 08:42:28 -06:00
69baaaec16 Merge pull request #991 from akohlmey/collected-small-updates
Collected small updates for the next patch release
2018-07-11 07:50:31 -06:00
1f1447c3ac need to update exclusions with the new atom IDs in case of molecular systems 2018-07-11 07:22:47 -04:00
1ed25d195b convert c-style includes for c-library calls to c++-style 2018-07-10 09:48:49 -04:00
792b182cb0 whitespace cleanup 2018-07-10 09:46:08 -04:00
ade9b7bfc3 Commit2 JT 070918
- modified the citeme reference (replaced by the JCP one)
- same modification in doc and src/SPIN
2018-07-10 09:44:14 -04:00
9d5dc561ca Commit1 JT 070918
- created README in examples/SPIN
- modified doc/src/set.txt to define 'spin' and 'spin/random' keywords
2018-07-10 09:44:14 -04:00
199c96f985 update and clarify the choice of atom ids for angle style dipole (which is not really an angle potential) 2018-07-10 09:22:41 -04:00
ad4f61a5ce update fatbin makefile for libgpu.a to latest additions 2018-07-10 09:07:54 -04:00
0c1dcfb617 Favor copymode instead of cleanup_copy 2018-07-06 17:06:37 -06:00
db75232957 Removed debug print and comment. 2018-07-06 11:31:48 -04:00
24405217d0 Updated Install.sh in KOKKOS. 2018-07-05 11:20:27 -04:00
e08ccd0a7c Forgot to include change in fix_enforce2d to access fixlist in kokkos port. 2018-06-29 11:58:27 -04:00
14c4aea32d Merge branch 'master' into port-enforce2d-kokkos 2018-06-13 14:59:07 -04:00
666a13ea8a Merge branch 'master' of https://www.github.com/lammps/lammps 2018-06-13 14:58:58 -04:00
4bf9a93c11 Removed x dependency from enforce2d_kokkos. 2018-06-06 10:47:07 -04:00
824a21a661 Removed debug printing from setup. 2018-06-04 12:28:06 -04:00
0e96918313 Made enforce2d_kokkos actually set data masks. 2018-06-01 17:22:25 -04:00
031077b4fa Made enforce2d also set rotations to in-plane. 2018-06-01 17:19:53 -04:00
962946ee45 Ported fix enforce2d to Kokkos. 2018-06-01 14:52:34 -04:00
1ee85e59c3 Removed obsolete changes to fix_nve-manifold_rattle 2018-06-01 14:50:41 -04:00
43 changed files with 704 additions and 119 deletions

View File

@ -1421,11 +1421,11 @@ target API.
<td>CUDA SM architecture targeted by GPU package</td>
<td>
<dl>
<dt><code>sm20</code> (Fermi)</dt>
<dt><code>sm30</code> (Kepler)</dt>
<dt><code>sm50</code> (Maxwell)</dt>
<dt><code>sm60</code> (Pascal)</dt>
<dt><code>sm70</code> (Volta)</dt>
<dt><code>sm_20</code> (Fermi)</dt>
<dt><code>sm_30</code> (Kepler)</dt>
<dt><code>sm_50</code> (Maxwell)</dt>
<dt><code>sm_60</code> (Pascal)</dt>
<dt><code>sm_70</code> (Volta)</dt>
</dl>
</td>
</tr>

View File

@ -476,7 +476,7 @@ 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,
this file is generated automatically - all files starting with prefix
fix\_ are included, so call your header the same way. Otherwise, don<EFBFBD>t
fix\_ are included, so call your header the same way. Otherwise, don't
forget to add your include into "style\_fix.h".
Let's write a simple fix which will print average velocity at the end

View File

@ -1,7 +1,7 @@
<!-- HTML_ONLY -->
<HEAD>
<TITLE>LAMMPS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="29 Jun 2018 version">
<META NAME="docnumber" CONTENT="16 Jul 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>
@ -19,7 +19,7 @@
:line
LAMMPS Documentation :c,h1
29 Jun 2018 version :c,h2
16 Jul 2018 version :c,h2
Version info: :h3

View File

@ -582,7 +582,7 @@ USER-INTEL, k = KOKKOS, o = USER-OMP, t = OPT.
"dt/reset"_fix_dt_reset.html,
"efield"_fix_efield.html,
"ehex"_fix_ehex.html,
"enforce2d"_fix_enforce2d.html,
"enforce2d (k)"_fix_enforce2d.html,
"evaporate"_fix_evaporate.html,
"external"_fix_external.html,
"freeze"_fix_freeze.html,

View File

@ -96,16 +96,17 @@ USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_2_3
section for more info on packages.
NOTE: In the "Angles" section of the data file, the atom ID 'j'
corresponding to the dipole to restrain must come before the atom ID
of the reference atom 'i'. A third atom ID 'k' must also be provided,
although 'k' is just a 'dummy' atom which can be any atom; it may be
useful to choose a convention (e.g., 'k'='i') and adhere to it. For
example, if ID=1 for the dipolar atom to restrain, and ID=2 for the
reference atom, the corresponding line in the "Angles" section of the
data file would read: X X 1 2 2
defining the direction of the dipole vector to restrain must come
before the atom ID of the reference atom 'i'. A third atom ID 'k' must
also be provided to comply with the requirement of a valid angle
definition. This atom ID k should be chosen to be that of an atom
bonded to atom 'i' to avoid errors with "lost angle atoms" when running
in parallel. Since the LAMMPS code checks for valid angle definitions,
cannot use the same atom ID of either 'i' or 'j' (this was allowed
and recommended with older LAMMPS versions).
The "newton" command for intramolecular interactions must be "on"
(which is the default).
(which is the default except when using some accelerator packages).
This angle style should not be used with SHAKE.

View File

@ -7,6 +7,7 @@
:line
fix enforce2d command :h3
fix enforce2d/kk command :h3
[Syntax:]
@ -27,12 +28,13 @@ not move from their initial z coordinate.
:line
Styles with a suffix are functionally the same as the corresponding
style without the suffix. They have been optimized to run faster,
depending on your available hardware, as discussed in
"Section 5"_Section_accelerate.html of the manual. The
accelerated styles take the same arguments and should produce the same
results, except for round-off and precision issues.
Styles with a {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
functionally the same as the corresponding style without the suffix.
They have been optimized to run faster, depending on your available
hardware, as discussed in "Section 5"_Section_accelerate.html
of the manual. The accelerated styles take the same arguments and
should produce the same results, except for round-off and precision
issues.
These accelerated styles are part of the GPU, USER-INTEL, KOKKOS,
USER-OMP and OPT packages, respectively. They are only enabled if

View File

@ -98,5 +98,5 @@ integration fix (e.g. {fix nve/spin}).
[(Mayergoyz)] I.D. Mayergoyz, G. Bertotti, C. Serpico (2009). Elsevier (2009)
:link(Tranchida2)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
Journal of Computational Physics, (2018).

View File

@ -73,4 +73,4 @@ instead of "array" is also valid.
:link(Tranchida1)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -63,4 +63,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida5)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -79,4 +79,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida3)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -70,4 +70,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida4)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau, and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -78,4 +78,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida6)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -138,13 +138,19 @@ iterations of level 1 for a single iteration of level 2, N2 is the
iterations of level 2 per iteration of level 3, etc. N-1 looping
parameters must be specified.
The "timestep"_timestep.html command sets the timestep for the
outermost rRESPA level. Thus if the example command above for a
4-level rRESPA had an outer timestep of 4.0 fmsec, the inner timestep
would be 8x smaller or 0.5 fmsec. All other LAMMPS commands that
specify number of timesteps (e.g. "neigh_modify"_neigh_modify.html
parameters, "dump"_dump.html every N timesteps, etc) refer to the
outermost timesteps.
Thus with a 4-level respa setting of "2 2 2" for the 3 loop factors,
you could choose to have bond interactions computed 8x per large
timestep, angle interactions computed 4x, pair interactions computed
2x, and long-range interactions once per large timestep.
The "timestep"_timestep.html command sets the large timestep for the
outermost rRESPA level. Thus if the 3 loop factors are "2 2 2" for
4-level rRESPA, and the outer timestep is set to 4.0 fmsec, then the
inner timestep would be 8x smaller or 0.5 fmsec. All other LAMMPS
commands that specify number of timesteps (e.g. "thermo"_thermo.html
for thermo output every N steps, "neigh_modify
delay/every"_neigh_modify.html parameters, "dump"_dump.html every N
steps, etc) refer to the outermost timesteps.
The rRESPA keywords enable you to specify at what level of the
hierarchy various forces will be computed. If not specified, the
@ -167,11 +173,17 @@ have their force go ramped to 0.0 so the overlap with the next regime
compute forces for all pairs from 5.0 outward, with those from 5.0 to
6.0 having their value ramped in an inverse manner.
Only some pair potentials support the use of the {inner} and {middle}
and {outer} keywords. If not, only the {pair} keyword can be used
with that pair style, meaning all pairwise forces are computed at the
same rRESPA level. See the doc pages for individual pair styles for
details.i
Note that you can use {inner} and {outer} without using {middle} to
split the pairwise computations into two portions instead of three.
Unless you are using a very long pairwise cutoff, a 2-way split is
often faster than a 3-way split, since it avoids too much duplicate
computation of pairwise interactions near the intermediate cutoffs.
Also note that only a few pair potentials support the use of the
{inner} and {middle} and {outer} keywords. If not, only the {pair}
keyword can be used with that pair style, meaning all pairwise forces
are computed at the same rRESPA level. See the doc pages for
individual pair styles for details.
Another option for using pair potentials with rRESPA is with the
{hybrid} keyword, which requires the use of the "pair_style hybrid or
@ -238,12 +250,24 @@ roughly a 1.5 fold speedup over the {verlet} style with SHAKE and a
For non-biomolecular simulations, the {respa} style can be
advantageous if there is a clear separation of time scales - fast and
slow modes in the simulation. Even a LJ system can benefit from
rRESPA if the interactions are divided by the inner, middle and outer
keywords. A 2-fold or more speedup can be obtained while maintaining
good energy conservation. In real units, for a pure LJ fluid at
liquid density, with a sigma of 3.0 angstroms, and epsilon of 0.1
Kcal/mol, the following settings seem to work well:
slow modes in the simulation. For example, a system of slowly-moving
charged polymer chains could be setup as follows:
timestep 4.0
run_style respa 2 8 :pre
This is two-level rRESPA with an 8x difference between the short and
long timesteps. The bonds, angles, dihedrals will be computed every
0.5 fs (assuming real units), while the pair and kspace interactions
will be computed once every 4 fs. These are the default settings for
each kind of interaction, so no additional keywords are necessary.
Even a LJ system can benefit from rRESPA if the interactions are
divided by the inner, middle and outer keywords. A 2-fold or more
speedup can be obtained while maintaining good energy conservation.
In real units, for a pure LJ fluid at liquid density, with a sigma of
3.0 angstroms, and epsilon of 0.1 Kcal/mol, the following settings
seem to work well:
timestep 36.0
run_style respa 3 3 4 inner 1 3.0 4.0 middle 2 6.0 7.0 outer 3 :pre
@ -271,9 +295,9 @@ more instructions on how to use the accelerated styles effectively.
[Restrictions:]
The {verlet/split} style can only be used if LAMMPS was built with the
REPLICA package. Correspondingly the {respa/omp} style is available only
if the USER-OMP package was included. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
REPLICA package. Correspondingly the {respa/omp} style is available
only if the USER-OMP package was included. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
Whenever using rRESPA, the user should experiment with trade-offs in
speed and accuracy for their system, and verify that they are
@ -287,6 +311,17 @@ conserving energy to adequate precision.
run_style verlet :pre
For run_style respa, the default assignment of interactions
to rRESPA levels is as follows:
bond forces = level 1 (innermost loop)
angle forces = same level as bond forces
dihedral forces = same level as angle forces
improper forces = same level as dihedral forces
pair forces = leven N (outermost level)
kspace forces = same level as pair forces
inner, middle, outer forces = no default :ul
:line
:link(Tuckerman3)

View File

@ -17,6 +17,7 @@ ID = atom ID range or type range or mol ID range or group ID or region ID :l
one or more keyword/value pairs may be appended :l
keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \
{charge} or {dipole} or {dipole/random} or {quat} or \
{spin} or {spin/random} or {quat} or \
{quat/random} or {diameter} or {shape} or \
{length} or {tri} or {theta} or {theta/random} or \
{angmom} or {omega} or \
@ -35,6 +36,8 @@ keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \
value can be an atom-style variable (see below)
{x},{y},{z} value = atom coordinate (distance units)
value can be an atom-style variable (see below)
{vx},{vy},{vz} value = atom velocity (velocity units)
value can be an atom-style variable (see below)
{charge} value = atomic charge (charge units)
value can be an atom-style variable (see below)
{dipole} values = x y z
@ -43,6 +46,13 @@ keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \
{dipole/random} value = seed Dlen
seed = random # seed (positive integer) for dipole moment orientations
Dlen = magnitude of dipole moment (dipole units)
{spin} values = g x y z
g = magnitude of magnetic spin vector (in Bohr magneton's unit)
x,y,z = orientation of magnetic spin vector
any of x,y,z can be an atom-style variable (see below)
{spin/random} value = seed Dlen
seed = random # seed (positive integer) for magnetic spin orientations
Dlen = magnitude of magnetic spin vector (in Bohr magneton's unit)
{quat} values = a b c theta
a,b,c = unit vector to rotate particle around via right-hand rule
theta = rotation angle (degrees)
@ -119,6 +129,7 @@ set type 3 charge 0.5
set type 1*3 charge 0.5
set atom * charge v_atomfile
set atom 100*200 x 0.5 y 1.0
set atom 100 vx 0.0 vy 0.0 vz -1.0
set atom 1492 type 3 :pre
[Description:]
@ -217,7 +228,8 @@ IDs.
Keywords {x}, {y}, {z}, and {charge} set the coordinates or charge of
all selected atoms. For {charge}, the "atom style"_atom_style.html
being used must support the use of atomic charge.
being used must support the use of atomic charge. Keywords {vx}, {vy},
and {vz} set the velocities of all selected atoms.
Keyword {dipole} uses the specified x,y,z values as components of a
vector to set as the orientation of the dipole moment vectors of the
@ -232,6 +244,15 @@ the orientation of a particular atom is the same, regardless of how
many processors are being used. This keyword does not allow use of an
atom-style variable.
Keyword {spin} uses the specified g value to set the magnitude of the
magnetic spin vectors, and the x,y,z values as components of a vector
to set as the orientation of the magnetic spin vectors of the selected
atoms.
Keyword {spin/random} randomizes the orientation of the magnetic spin
vectors for the selected atoms and sets the magnitude of each to the
specified {Dlen} value.
Keyword {quat} uses the specified values to create a quaternion
(4-vector) that represents the orientation of the selected atoms. The
particles must define a quaternion for their orientation

20
examples/SPIN/README Normal file
View File

@ -0,0 +1,20 @@
This directory contains examples and applications of the SPIN package
=====================================================================
- the iron, cobalt_hcp, cobalt_fcc and nickel directories provide
examples of spin-lattice calculations.
- the bfo repository provides an example of spin dynamics calculation
performed on a fixed lattice, and applied to the multiferroic
material bismuth-oxide.
- the read_restart directory provides examples allowing to write or
read data files, and restart magneto-mechanical simulations.
- vizualization of the dump files can be achieved using Ovito or
VMD. See the vmd repository for help vizualizing results with VMD.
** Note, the aim of this repository is mainly to provide users with
examples. Better values and tuning of the magnetic and mechanical
interactions can be achieved for more accurate materials
simulations. **

View File

@ -79,7 +79,10 @@ OBJS = $(OBJ_DIR)/lal_atom.o $(OBJ_DIR)/lal_ans.o \
$(OBJ_DIR)/lal_lj_cubic.o $(OBJ_DIR)/lal_lj_cubic_ext.o \
$(OBJ_DIR)/lal_ufm.o $(OBJ_DIR)/lal_ufm_ext.o \
$(OBJ_DIR)/lal_dipole_long_lj.o $(OBJ_DIR)/lal_dipole_long_lj_ext.o \
$(OBJ_DIR)/lal_lj_expand_coul_long.o $(OBJ_DIR)/lal_lj_expand_coul_long_ext.o
$(OBJ_DIR)/lal_lj_expand_coul_long.o $(OBJ_DIR)/lal_lj_expand_coul_long_ext.o \
$(OBJ_DIR)/lal_coul_long_cs.o $(OBJ_DIR)/lal_coul_long_cs_ext.o \
$(OBJ_DIR)/lal_born_coul_long_cs.o $(OBJ_DIR)/lal_born_coul_long_cs_ext.o \
$(OBJ_DIR)/lal_born_coul_wolf_cs.o $(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o
CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \
$(OBJ_DIR)/atom.cubin $(OBJ_DIR)/atom_cubin.h \
@ -137,7 +140,10 @@ CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \
$(OBJ_DIR)/lj_cubic.cubin $(OBJ_DIR)/lj_cubic_cubin.h \
$(OBJ_DIR)/ufm.cubin $(OBJ_DIR)/ufm_cubin.h \
$(OBJ_DIR)/dipole_long_lj.cubin $(OBJ_DIR)/dipole_long_lj_cubin.h \
$(OBJ_DIR)/lj_expand_coul_long.cubin $(OBJ_DIR)/lj_expand_coul_long_cubin.h
$(OBJ_DIR)/lj_expand_coul_long.cubin $(OBJ_DIR)/lj_expand_coul_long_cubin.h \
$(OBJ_DIR)/coul_long_cs.cubin $(OBJ_DIR)/coul_long_cs_cubin.h \
$(OBJ_DIR)/born_coul_long_cs.cubin $(OBJ_DIR)/born_coul_long_cs_cubin.h \
$(OBJ_DIR)/born_coul_wolf_cs.cubin $(OBJ_DIR)/born_coul_wolf_cs_cubin.h
all: $(OBJ_DIR) $(GPU_LIB) $(EXECS)
@ -837,6 +843,42 @@ $(OBJ_DIR)/lal_lj_expand_coul_long.o: $(ALL_H) lal_lj_expand_coul_long.h lal_lj_
$(OBJ_DIR)/lal_lj_expand_coul_long_ext.o: $(ALL_H) lal_lj_expand_coul_long.h lal_lj_expand_coul_long_ext.cpp lal_base_charge.h
$(CUDR) -o $@ -c lal_lj_expand_coul_long_ext.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/coul_long_cs.cubin: lal_coul_long_cs.cu lal_precision.h lal_preprocessor.h
$(CUDA) --fatbin -DNV_KERNEL -o $@ lal_coul_long_cs.cu
$(OBJ_DIR)/coul_long_cs_cubin.h: $(OBJ_DIR)/coul_long_cs.cubin $(OBJ_DIR)/coul_long_cs.cubin
$(BIN2C) -c -n coul_long_cs $(OBJ_DIR)/coul_long_cs.cubin > $(OBJ_DIR)/coul_long_cs_cubin.h
$(OBJ_DIR)/lal_coul_long_cs.o: $(ALL_H) lal_coul_long_cs.h lal_coul_long_cs.cpp $(OBJ_DIR)/coul_long_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_coul_long.o
$(CUDR) -o $@ -c lal_coul_long_cs.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/lal_coul_long_cs_ext.o: $(ALL_H) lal_coul_long_cs.h lal_coul_long_cs_ext.cpp lal_coul_long.h
$(CUDR) -o $@ -c lal_coul_long_cs_ext.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/born_coul_long_cs.cubin: lal_born_coul_long_cs.cu lal_precision.h lal_preprocessor.h
$(CUDA) --fatbin -DNV_KERNEL -o $@ lal_born_coul_long_cs.cu
$(OBJ_DIR)/born_coul_long_cs_cubin.h: $(OBJ_DIR)/born_coul_long_cs.cubin $(OBJ_DIR)/born_coul_long_cs.cubin
$(BIN2C) -c -n born_coul_long_cs $(OBJ_DIR)/born_coul_long_cs.cubin > $(OBJ_DIR)/born_coul_long_cs_cubin.h
$(OBJ_DIR)/lal_born_coul_long_cs.o: $(ALL_H) lal_born_coul_long_cs.h lal_born_coul_long_cs.cpp $(OBJ_DIR)/born_coul_long_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_born_coul_long.o
$(CUDR) -o $@ -c lal_born_coul_long_cs.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/lal_born_coul_long_cs_ext.o: $(ALL_H) lal_born_coul_long_cs.h lal_born_coul_long_cs_ext.cpp lal_born_coul_long.h
$(CUDR) -o $@ -c lal_born_coul_long_cs_ext.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/born_coul_wolf_cs.cubin: lal_born_coul_wolf_cs.cu lal_precision.h lal_preprocessor.h
$(CUDA) --fatbin -DNV_KERNEL -o $@ lal_born_coul_wolf_cs.cu
$(OBJ_DIR)/born_coul_wolf_cs_cubin.h: $(OBJ_DIR)/born_coul_wolf_cs.cubin $(OBJ_DIR)/born_coul_wolf_cs.cubin
$(BIN2C) -c -n born_coul_wolf_cs $(OBJ_DIR)/born_coul_wolf_cs.cubin > $(OBJ_DIR)/born_coul_wolf_cs_cubin.h
$(OBJ_DIR)/lal_born_coul_wolf_cs.o: $(ALL_H) lal_born_coul_wolf_cs.h lal_born_coul_wolf_cs.cpp $(OBJ_DIR)/born_coul_wolf_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_born_coul_wolf.o
$(CUDR) -o $@ -c lal_born_coul_wolf_cs.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o: $(ALL_H) lal_born_coul_wolf_cs.h lal_born_coul_wolf_cs_ext.cpp lal_born_coul_wolf.h
$(CUDR) -o $@ -c lal_born_coul_wolf_cs_ext.cpp -I$(OBJ_DIR)
$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda

View File

@ -708,6 +708,12 @@ class Atom(object):
self.lmp.eval("vy[%d]" % self.index),
self.lmp.eval("vz[%d]" % self.index))
@velocity.setter
def velocity(self, value):
self.lmp.set("atom", self.index, "vx", value[0])
self.lmp.set("atom", self.index, "vy", value[1])
self.lmp.set("atom", self.index, "vz", value[2])
@property
def force(self):
return (self.lmp.eval("fx[%d]" % self.index),
@ -738,6 +744,11 @@ class Atom2D(Atom):
return (self.lmp.eval("vx[%d]" % self.index),
self.lmp.eval("vy[%d]" % self.index))
@velocity.setter
def velocity(self, value):
self.lmp.set("atom", self.index, "vx", value[0])
self.lmp.set("atom", self.index, "vy", value[1])
@property
def force(self):
return (self.lmp.eval("fx[%d]" % self.index),

View File

@ -93,6 +93,8 @@ action domain_kokkos.cpp
action domain_kokkos.h
action fix_deform_kokkos.cpp
action fix_deform_kokkos.h
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_langevin_kokkos.cpp

View File

@ -0,0 +1,168 @@
/* -*- 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.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing authors: Stefan Paquay & Matthew Peterson (Brandeis University)
------------------------------------------------------------------------- */
#include "atom_masks.h"
#include "atom_kokkos.h"
#include "comm.h"
#include "error.h"
#include "fix_enforce2d_kokkos.h"
using namespace LAMMPS_NS;
template <class DeviceType>
FixEnforce2DKokkos<DeviceType>::FixEnforce2DKokkos(LAMMPS *lmp, int narg, char **arg) :
FixEnforce2D(lmp, narg, arg)
{
kokkosable = 1;
atomKK = (AtomKokkos *) atom;
execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
datamask_read = V_MASK | F_MASK | OMEGA_MASK | MASK_MASK
| TORQUE_MASK | ANGMOM_MASK;
datamask_modify = V_MASK | F_MASK | OMEGA_MASK
| TORQUE_MASK | ANGMOM_MASK;
}
template <class DeviceType>
void FixEnforce2DKokkos<DeviceType>::setup(int vflag)
{
post_force(vflag);
}
template <class DeviceType>
void FixEnforce2DKokkos<DeviceType>::post_force(int vflag)
{
atomKK->sync(execution_space,datamask_read);
v = atomKK->k_v.view<DeviceType>();
f = atomKK->k_f.view<DeviceType>();
if( atomKK->omega_flag )
omega = atomKK->k_omega.view<DeviceType>();
if( atomKK->angmom_flag )
angmom = atomKK->k_angmom.view<DeviceType>();
if( atomKK->torque_flag )
torque = atomKK->k_torque.view<DeviceType>();
mask = atomKK->k_mask.view<DeviceType>();
int nlocal = atomKK->nlocal;
if (igroup == atomKK->firstgroup) nlocal = atomKK->nfirst;
int flag_mask = 0;
if( atomKK->omega_flag ) flag_mask |= 1;
if( atomKK->angmom_flag ) flag_mask |= 2;
if( atomKK->torque_flag ) flag_mask |= 4;
copymode = 1;
switch( flag_mask ){
case 0:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,0,0,0> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
case 1:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,1,0,0> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
case 2:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,0,1,0> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
case 3:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,1,1,0> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
case 4:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,0,0,1> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
case 5:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,1,0,1> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
case 6:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,0,1,1> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
case 7:{
FixEnforce2DKokkosPostForceFunctor<DeviceType,1,1,1> functor(this);
Kokkos::parallel_for(nlocal,functor);
break;
}
default:
error->all(FLERR, "Flag in fix_enforce2d_kokkos outside of what it should be");
}
copymode = 0;
atomKK->modified(execution_space,datamask_modify);
for (int m = 0; m < nfixlist; m++) {
atomKK->sync(flist[m]->execution_space,flist[m]->datamask_read);
flist[m]->enforce2d();
atomKK->modified(flist[m]->execution_space,flist[m]->datamask_modify);
}
}
template <class DeviceType>
template <int omega_flag, int angmom_flag, int torque_flag>
void FixEnforce2DKokkos<DeviceType>::post_force_item( int i ) const
{
if (mask[i] & groupbit){
v(i,2) = 0.0;
f(i,2) = 0.0;
if(omega_flag){
omega(i,0) = 0.0;
omega(i,1) = 0.0;
}
if(angmom_flag){
angmom(i,0) = 0.0;
angmom(i,1) = 0.0;
}
if(torque_flag){
torque(i,0) = 0.0;
torque(i,1) = 0.0;
}
}
}
namespace LAMMPS_NS {
template class FixEnforce2DKokkos<LMPDeviceType>;
#ifdef KOKKOS_HAVE_CUDA
template class FixEnforce2DKokkos<LMPHostType>;
#endif
}

View File

@ -0,0 +1,84 @@
/* -*- 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(enforce2d/kk,FixEnforce2DKokkos<LMPDeviceType>)
FixStyle(enforce2d/kk/device,FixEnforce2DKokkos<LMPDeviceType>)
FixStyle(enforce2d/kk/host,FixEnforce2DKokkos<LMPHostType>)
#else
#ifndef LMP_FIX_ENFORCE2D_KOKKOS_H
#define LMP_FIX_ENFORCE2D_KOKKOS_H
#include "fix_enforce2d.h"
#include "kokkos_type.h"
namespace LAMMPS_NS {
template<class DeviceType>
class FixEnforce2DKokkos : public FixEnforce2D {
public:
FixEnforce2DKokkos(class LAMMPS *, int, char **);
// ~FixEnforce2DKokkos() {}
void setup(int);
void post_force(int);
template <int omega_flag, int angmom_flag, int torque_flag>
KOKKOS_INLINE_FUNCTION
void post_force_item(const int i) const;
// void min_setup(int); Kokkos does not support minimization (yet)
// void min_post_force(int); Kokkos does not support minimization (yet)
// void post_force_respa(int, int, int); No RRESPA support yet.
private:
typename ArrayTypes<DeviceType>::t_v_array v;
typename ArrayTypes<DeviceType>::t_f_array f;
typename ArrayTypes<DeviceType>::t_v_array omega;
typename ArrayTypes<DeviceType>::t_v_array angmom;
typename ArrayTypes<DeviceType>::t_f_array torque;
typename ArrayTypes<DeviceType>::t_int_1d mask;
};
template <class DeviceType, int omega_flag, int angmom_flag, int torque_flag>
struct FixEnforce2DKokkosPostForceFunctor {
typedef DeviceType device_type;
FixEnforce2DKokkos<DeviceType> c;
FixEnforce2DKokkosPostForceFunctor(FixEnforce2DKokkos<DeviceType>* c_ptr):
c(*c_ptr) {};
KOKKOS_INLINE_FUNCTION
void operator()(const int i) const {
c.template post_force_item <omega_flag, angmom_flag, torque_flag>(i);
}
};
}
#endif
#endif
/* ERROR/WARNING messages:
E: Flag in fix_enforce2d_kokkos outside of what it should be
LAMMPS developer-only error.
*/

View File

@ -343,6 +343,7 @@ void PairReaxCKokkos<DeviceType>::init_md()
swa = control->nonb_low;
swb = control->nonb_cut;
enobondsflag = control->enobondsflag;
if (fabs(swa) > 0.01 )
error->warning(FLERR,"Warning: non-zero lower Taper-radius cutoff");
@ -2272,12 +2273,12 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeMulti2<NEIGHFLAG,EVF
int numbonds = d_bo_num[i];
e_lp = 0.0;
if (numbonds > 0 || control->enobondsflag)
if (numbonds > 0 || enobondsflag)
e_lp = p_lp2 * d_Delta_lp[i] * inv_expvd2;
const F_FLOAT dElp = p_lp2 * inv_expvd2 + 75.0 * p_lp2 * d_Delta_lp[i] * expvd2 * inv_expvd2*inv_expvd2;
const F_FLOAT CElp = dElp * d_dDelta_lp[i];
if (numbonds > 0 || control->enobondsflag)
if (numbonds > 0 || enobondsflag)
a_CdDelta[i] += CElp;
if (eflag) ev.ereax[0] += e_lp;
@ -2314,7 +2315,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeMulti2<NEIGHFLAG,EVF
const F_FLOAT inv_exp_ovun8 = 1.0 / (1.0 + exp_ovun8);
e_un = 0;
if (numbonds > 0 || control->enobondsflag)
if (numbonds > 0 || enobondsflag)
e_un = -p_ovun5 * (1.0 - exp_ovun6) * inv_exp_ovun2n * inv_exp_ovun8;
if (eflag) ev.ereax[2] += e_un;
@ -2334,7 +2335,7 @@ void PairReaxCKokkos<DeviceType>::operator()(PairReaxComputeMulti2<NEIGHFLAG,EVF
// multibody forces
a_CdDelta[i] += CEover3;
if (numbonds > 0 || control->enobondsflag)
if (numbonds > 0 || enobondsflag)
a_CdDelta[i] += CEunder3;
const int j_start = d_bo_first[i];

View File

@ -427,7 +427,7 @@ class PairReaxCKokkos : public PairReaxC {
friend void pair_virial_fdotr_compute<PairReaxCKokkos>(PairReaxCKokkos*);
int bocnt,hbcnt;
int bocnt,hbcnt,enobondsflag;
typedef LR_lookup_table_kk<DeviceType> LR_lookup_table_kk_DT;

View File

@ -0,0 +1,133 @@
# knl = Flags for Knights Landing Xeon Phi Processor,Intel Compiler/MPI,MKL FFT
# module load perftools-base perftools
# make theta -j 8
# pat_build -g mpi -u ./lmp_theta
SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
CC = CC -mkl
#OPTFLAGS = -O0
OPTFLAGS = -xMIC-AVX512 -O3 -fp-model fast=2 -no-prec-div -qoverride-limits
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -qno-offload \
-fno-alias -ansi-alias -restrict $(OPTFLAGS)
#CCFLAGS += -DLMP_INTEL_NO_TBB
#CCFLAGS += -DLAMMPS_BIGBIG
#CCFLAGS += -D_USE_PAPI
#CCFLAGS += -D_USE_CRAYPAT_API
SHFLAGS = -fPIC
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -g -qopenmp $(OPTFLAGS)
LINKFLAGS += -dynamic
LIB =
#LIB += -L${TBBROOT}/lib/intel64/gcc4.7 -ltbbmalloc
LIB += -ltbbmalloc
#LIB += /soft/debuggers/forge-7.0-2017-02-16/lib/64/libdmallocthcxx.a -zmuldefs
SIZE = size
ARCHIVE = ar
ARFLAGS = -rc
SHLIBFLAGS = -shared
# ---------------------------------------------------------------------
# LAMMPS-specific settings, all OPTIONAL
# specify settings for LAMMPS features you will use
# if you change any -D setting, do full re-compile after "make clean"
# LAMMPS ifdef settings
# see possible settings in Section 2.2 (step 4) of manual
LMP_INC = -DLAMMPS_GZIP #-DLAMMPS_JPEG
# MPI library
# see discussion in Section 2.2 (step 5) of manual
# MPI wrapper compiler/linker can provide this info
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library
MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1
MPI_PATH =
MPI_LIB =
# FFT library
# see discussion in Section 2.2 (step 6) of manaul
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library
FFT_INC = -DFFT_MKL -DFFT_SINGLE
FFT_PATH =
FFT_LIB = -L$(MKLROOT)/lib/intel64/ -Wl,--start-group -lmkl_intel_ilp64 \
-lmkl_intel_thread -lmkl_core -Wl,--end-group
# JPEG and/or PNG library
# see discussion in Section 2.2 (step 7) of manual
# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC
# INC = path(s) for jpeglib.h and/or png.h
# PATH = path(s) for JPEG library and/or PNG library
# LIB = name(s) of JPEG library and/or PNG library
JPG_INC =
JPG_PATH =
JPG_LIB =
# ---------------------------------------------------------------------
# build rules and dependencies
# do not edit this section
include Makefile.package.settings
include Makefile.package
EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
# Path to src files
vpath %.cpp ..
vpath %.h ..
# Link target
$(EXE): $(OBJ)
$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
$(SIZE) $(EXE)
# Library targets
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
shlib: $(OBJ)
$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
$(OBJ) $(EXTRA_LIB) $(LIB)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
%.o:%.cu
$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<
# Individual dependencies
depend : fastdep.exe $(SRC)
@./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1
fastdep.exe: ../DEPEND/fastdep.c
icc -O -o $@ $<
sinclude .depend

View File

@ -20,12 +20,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "atom_vec_spin.h"
#include "comm.h"
@ -54,7 +54,7 @@ AtomVecSpin::AtomVecSpin(LAMMPS *lmp) : AtomVec(lmp)
size_data_atom = 9;
size_data_vel = 4;
xcol_data = 4;
atom->sp_flag = 1;
}

View File

@ -18,11 +18,11 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <mpi.h>
#include <string.h>
#include <cstring>
#include "atom.h"
#include "compute_spin.h"
#include "domain.h"

View File

@ -18,13 +18,13 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include "atom.h"
#include "atom_vec_ellipsoid.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include "atom.h"
#include "atom_vec.h"
@ -59,8 +59,9 @@ static const char cite_fix_nve_spin[] =
"title={Massively parallel symplectic algorithm for coupled magnetic spin "
"dynamics and molecular dynamics},\n"
"author={Tranchida, J and Plimpton, SJ and Thibaudeau, P and Thompson, AP},\n"
"journal={arXiv preprint arXiv:1801.10233},\n"
"year={2018}\n"
"journal={Journal of Computational Physics},\n"
"year={2018},\n"
"publisher={Elsevier}\n"
"}\n\n";
enum{NONE};

View File

@ -18,13 +18,13 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "domain.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"
@ -436,9 +436,9 @@ void PairSpinMagelec::compute_magelec_mech(int i, int j, double fi[3], double sp
meiy *= ME_mech[itype][jtype];
meiz *= ME_mech[itype][jtype];
fi[0] = meiy*vz - meiz*vy;
fi[1] = meiz*vx - meix*vz;
fi[2] = meix*vy - meiy*vx;
fi[0] += meiy*vz - meiz*vy;
fi[1] += meiz*vx - meix*vz;
fi[2] += meix*vy - meiy*vx;
}

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -350,13 +350,13 @@ void Balance::command(int narg, char **arg)
domain->set_local_box();
// move particles to new processors via irregular()
// set disable = 0, so weights migrate with atoms for imbfinal calculation
if (domain->triclinic) domain->x2lamda(atom->nlocal);
Irregular *irregular = new Irregular(lmp);
if (wtflag) fixstore->disable = 0;
if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc);
else irregular->migrate_atoms(1);
if (wtflag) fixstore->disable = 1;
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
@ -377,9 +377,11 @@ void Balance::command(int narg, char **arg)
}
// imbfinal = final imbalance
// set disable = 1, so weights no longer migrate with atoms
double maxfinal;
double imbfinal = imbalance_factor(maxfinal);
if (wtflag) fixstore->disable = 1;
// stats output
@ -540,6 +542,8 @@ void Balance::weight_storage(char *prefix)
fixstore = (FixStore *) modify->fix[modify->nfix-1];
} else fixstore = (FixStore *) modify->fix[ifix];
// do not carry weights with atoms during normal atom migration
fixstore->disable = 1;
if (prefix) delete [] fixargs[0];

View File

@ -114,6 +114,7 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
if (nevery) force_reneighbor = 1;
lastbalance = -1;
next_reneighbor = -1;
// compute initial outputs
@ -248,6 +249,10 @@ void FixBalance::pre_neighbor()
if (!pending) return;
imbfinal = balance->imbalance_factor(maxloadperproc);
pending = 0;
// set disable = 1, so weights no longer migrate with atoms
if (wtflag) balance->fixstore->disable = 1;
}
/* ----------------------------------------------------------------------
@ -275,21 +280,23 @@ void FixBalance::rebalance()
// reset proc sub-domains
// check and warn if any proc's subbox is smaller than neigh skin
// since may lead to lost atoms in exchange()
// since may lead to lost atoms in comm->exchange()
if (domain->triclinic) domain->set_lamda_box();
domain->set_local_box();
domain->subbox_too_small_check(neighbor->skin);
// move atoms to new processors via irregular()
// only needed if migrate_check() says an atom moves to far
// for non-RCB only needed if migrate_check() says an atom moves too far
// else allow caller's comm->exchange() to do it
// set disable = 0, so weights migrate with atoms
// important to delay disable = 1 until after pre_neighbor imbfinal calc
// b/c atoms may migrate again in comm->exchange()
if (domain->triclinic) domain->x2lamda(atom->nlocal);
if (wtflag) balance->fixstore->disable = 0;
if (lbstyle == BISECTION) irregular->migrate_atoms(0,1,sendproc);
else if (irregular->migrate_check()) irregular->migrate_atoms();
if (wtflag) balance->fixstore->disable = 1;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
// invoke KSpace setup_grid() to adjust to new proc sub-domains

View File

@ -38,6 +38,8 @@ FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int narg, char **arg) :
FixEnforce2D::~FixEnforce2D()
{
if (copymode) return;
delete [] flist;
}

View File

@ -36,7 +36,7 @@ class FixEnforce2D : public Fix {
void post_force_respa(int, int, int);
void min_post_force(int);
private:
protected:
int nfixlist;
class Fix **flist;
};

View File

@ -154,8 +154,6 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller)
if (vecflag) memory->create(vstore,nrow,"fix/store:vstore");
else memory->create(astore,nrow,ncol,"fix/store:astore");
memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
// printf("AAA HOW GET HERE\n");
}
/* ----------------------------------------------------------------------

View File

@ -62,7 +62,9 @@ enum{VERSION,SMALLINT,TAGINT,BIGINT,
MULTIPROC,MPIIO,PROCSPERFILE,PERPROC,
IMAGEINT,BOUNDMIN,TIMESTEP,
ATOM_ID,ATOM_MAP_STYLE,ATOM_MAP_USER,ATOM_SORTFREQ,ATOM_SORTBIN,
COMM_MODE,COMM_CUTOFF,COMM_VEL,NO_PAIR};
COMM_MODE,COMM_CUTOFF,COMM_VEL,NO_PAIR,
EXTRA_BOND_PER_ATOM,EXTRA_ANGLE_PER_ATOM,EXTRA_DIHEDRAL_PER_ATOM,
EXTRA_IMPROPER_PER_ATOM,EXTRA_SPECIAL_PER_ATOM};
#define LB_FACTOR 1.1
@ -914,6 +916,17 @@ void ReadRestart::header(int incompatible)
} else if (flag == COMM_VEL) {
comm->ghost_velocity = read_int();
} else if (flag == EXTRA_BOND_PER_ATOM) {
atom->extra_bond_per_atom = read_int();
} else if (flag == EXTRA_ANGLE_PER_ATOM) {
atom->extra_angle_per_atom = read_int();
} else if (flag == EXTRA_DIHEDRAL_PER_ATOM) {
atom->extra_dihedral_per_atom = read_int();
} else if (flag == EXTRA_IMPROPER_PER_ATOM) {
atom->extra_improper_per_atom = read_int();
} else if (flag == EXTRA_SPECIAL_PER_ATOM) {
force->special_extra = read_int();
} else error->all(FLERR,"Invalid flag in header section of restart file");
flag = read_int();

View File

@ -16,6 +16,7 @@
#include "atom_vec.h"
#include "domain.h"
#include "comm.h"
#include "special.h"
#include "memory.h"
#include "error.h"
@ -44,7 +45,7 @@ void ResetIDs::command(int narg, char **arg)
}
// create an atom map if one doesn't exist already
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
@ -93,7 +94,7 @@ void ResetIDs::command(int narg, char **arg)
// forward_comm_array acquires new IDs for ghost atoms
double **newIDs;
memory->create(newIDs,nall,1,"reset_ids:newIDs");
memory->create(newIDs,nall,1,"reset_ids:newIDs");
for (int i = 0; i < nlocal; i++) {
newIDs[i][0] = tag[i];
@ -105,7 +106,7 @@ void ResetIDs::command(int narg, char **arg)
// loop over bonds, angles, etc and reset IDs in stored topology arrays
// only necessary for molecular = 1, not molecular = 2
// badcount = atom IDs that could not be found
int badcount = 0;
if (atom->molecular == 1) {
@ -232,8 +233,15 @@ void ResetIDs::command(int narg, char **arg)
atom->map_init();
atom->map_set();
// need to update exclusions with new atom IDs
if (atom->molecular == 1) {
Special special(lmp);
special.build();
}
// delete temporary atom map
if (mapflag) {
atom->map_delete();
atom->map_style = 0;

View File

@ -48,7 +48,7 @@ enum{TYPE,TYPE_FRACTION,MOLECULE,X,Y,Z,CHARGE,MASS,SHAPE,LENGTH,TRI,
THETA,THETA_RANDOM,ANGMOM,OMEGA,
DIAMETER,DENSITY,VOLUME,IMAGE,BOND,ANGLE,DIHEDRAL,IMPROPER,
MESO_E,MESO_CV,MESO_RHO,EDPD_TEMP,EDPD_CV,CC,SMD_MASS_DENSITY,
SMD_CONTACT_RADIUS,DPDTHETA,INAME,DNAME};
SMD_CONTACT_RADIUS,DPDTHETA,INAME,DNAME,VX,VY,VZ};
#define BIG INT_MAX
@ -141,6 +141,27 @@ void Set::command(int narg, char **arg)
set(Z);
iarg += 2;
} else if (strcmp(arg[iarg],"vx") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
set(VX);
iarg += 2;
} else if (strcmp(arg[iarg],"vy") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
set(VY);
iarg += 2;
} else if (strcmp(arg[iarg],"vz") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
else dvalue = force->numeric(FLERR,arg[iarg+1]);
set(VZ);
iarg += 2;
} else if (strcmp(arg[iarg],"charge") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
@ -732,6 +753,9 @@ void Set::set(int keyword)
else if (keyword == X) atom->x[i][0] = dvalue;
else if (keyword == Y) atom->x[i][1] = dvalue;
else if (keyword == Z) atom->x[i][2] = dvalue;
else if (keyword == VX) atom->v[i][0] = dvalue;
else if (keyword == VY) atom->v[i][1] = dvalue;
else if (keyword == VZ) atom->v[i][2] = dvalue;
else if (keyword == CHARGE) atom->q[i] = dvalue;
else if (keyword == MASS) {
if (dvalue <= 0.0) error->one(FLERR,"Invalid mass in set command");

View File

@ -1 +1 @@
#define LAMMPS_VERSION "29 Jun 2018"
#define LAMMPS_VERSION "16 Jul 2018"

View File

@ -61,7 +61,9 @@ enum{VERSION,SMALLINT,TAGINT,BIGINT,
MULTIPROC,MPIIO,PROCSPERFILE,PERPROC,
IMAGEINT,BOUNDMIN,TIMESTEP,
ATOM_ID,ATOM_MAP_STYLE,ATOM_MAP_USER,ATOM_SORTFREQ,ATOM_SORTBIN,
COMM_MODE,COMM_CUTOFF,COMM_VEL,NO_PAIR};
COMM_MODE,COMM_CUTOFF,COMM_VEL,NO_PAIR,
EXTRA_BOND_PER_ATOM,EXTRA_ANGLE_PER_ATOM,EXTRA_DIHEDRAL_PER_ATOM,
EXTRA_IMPROPER_PER_ATOM,EXTRA_SPECIAL_PER_ATOM};
/* ---------------------------------------------------------------------- */
@ -527,6 +529,12 @@ void WriteRestart::header()
write_double(COMM_CUTOFF,comm->cutghostuser);
write_int(COMM_VEL,comm->ghost_velocity);
write_int(EXTRA_BOND_PER_ATOM,atom->extra_bond_per_atom);
write_int(EXTRA_ANGLE_PER_ATOM,atom->extra_angle_per_atom);
write_int(EXTRA_DIHEDRAL_PER_ATOM,atom->extra_dihedral_per_atom);
write_int(EXTRA_IMPROPER_PER_ATOM,atom->extra_improper_per_atom);
write_int(EXTRA_SPECIAL_PER_ATOM,force->special_extra);
// -1 flag signals end of header
int flag = -1;