Skip to content

Commit 47d89e1

Browse files
major changes and bugfixes, also can use Zest now
1 parent a2b554b commit 47d89e1

24 files changed

+14747
-2521
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Smoothed Dissipative Particle Dynamics
22

3-
An isothermal implementation of SDPD based on Español and Revenga, Phys. Rev. E 67, 026705 (2003)
3+
An isothermal implementation of SDPD for water based on Español and Revenga, Phys. Rev. E 67, 026705 (2003)
44

55
## Installation
66

@@ -14,8 +14,8 @@ An isothermal implementation of SDPD based on Español and Revenga, Phys. Rev. E
1414

1515
make yes-user-sph
1616

17-
* The RIGID package is a prerequisite for `fix rigid/sph`. If you like to be able to define rigid bodies
18-
include this as well:
17+
* The RIGID package is a prerequisite for `fix rigid/meso`. If you like to be able to integrate rigid bodies
18+
motion, include this as well:
1919

2020
make yes-rigid
2121

@@ -25,6 +25,19 @@ include this as well:
2525

2626
* Then build again as usual.
2727

28+
### Improving performane with Zest
29+
30+
Most of the time in SDPD simulations are spent producing random gaussian numbers. By default LAMMPS uses the
31+
Box-Muller algorithm to produce random gaussian numbers which is inefficient. The Zest library can produce
32+
random gaussian numbers much more efficiently. Using Zest, SDPD simulations are sped up y a factor of about 3.
33+
Obtain Zest from https://github.com/DiscreteLogarithm/Zest , then copy the header files either into the `src`
34+
directory of the LAMMPS or into your system's include path. Then compile LAMMPS with `-DUSE_ZEST` flag by
35+
adding `-DUSE_ZEST` to the `LMP_INC` variable of your preferred Makefile.
36+
37+
LAMMPS uses an old integer random number generator - RANMAR - which has a relatively low period compared to
38+
modern standards. When LAMMPS is compiled with Zest the 64-bit version of the Mersenne twister is used
39+
which is the de-facto gold standard of uniform random number generators.
40+
2841
## Uninstallation
2942

3043
* Use following command in `src` directory:

doc/src/fix_meso_move.txt

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
2+
3+
:link(lws,http://lammps.sandia.gov)
4+
:link(ld,Manual.html)
5+
:link(lc,Commands_all.html)
6+
7+
:line
8+
9+
fix meso/move command :h3
10+
11+
[Syntax:]
12+
13+
fix ID group-ID meso/move style args keyword values ... :pre
14+
15+
ID, group-ID are documented in "fix"_fix.html command :ulb,l
16+
meso/move = style name of this fix command :l
17+
style = {linear} or {wiggle} or {rotate} or {variable} :l
18+
{linear} args = Vx Vy Vz
19+
Vx,Vy,Vz = components of velocity vector (velocity units), any component can be specified as NULL
20+
{wiggle} args = Ax Ay Az period
21+
Ax,Ay,Az = components of amplitude vector (distance units), any component can be specified as NULL
22+
period = period of oscillation (time units)
23+
{rotate} args = Px Py Pz Rx Ry Rz period
24+
Px,Py,Pz = origin point of axis of rotation (distance units)
25+
Rx,Ry,Rz = axis of rotation vector
26+
period = period of rotation (time units)
27+
{variable} args = v_dx v_dy v_dz v_vx v_vy v_vz
28+
v_dx,v_dy,v_dz = 3 variable names that calculate x,y,z displacement as function of time, any component can be specified as NULL
29+
v_vx,v_vy,v_vz = 3 variable names that calculate x,y,z velocity as function of time, any component can be specified as NULL :pre
30+
31+
zero or more keyword/value pairs may be appended :l
32+
keyword = {units} :l
33+
{units} value = {box} or {lattice} :pre
34+
:ule
35+
36+
[Examples:]
37+
38+
fix 1 boundary meso/move wiggle 3.0 0.0 0.0 1.0 units box
39+
fix 2 boundary meso/move rotate 0.0 0.0 0.0 0.0 0.0 1.0 5.0
40+
fix 2 boundary meso/move variable v_myx v_myy NULL v_VX v_VY NULL :pre
41+
42+
[Description:]
43+
44+
Perform updates of position, velocity, internal energy and local
45+
density for mesoscopic particles in the group each timestep using the
46+
specified settings or formulas, without regard to forces on the
47+
particles. This can be useful for boundary, solid bodies or other
48+
particles, whose movement can influence nearby particles.
49+
50+
The operation of this fix is exactly like that described by the
51+
"fix move"_fix_move.html command, except that particles' density,
52+
internal energy and extrapolated velocity are also updated.
53+
54+
NOTE: The particles affected by this fix should not be time integrated
55+
by other fixes (e.g. "fix meso"_fix_meso.html, "fix
56+
meso/stationary"_fix_meso_stationary.html), since that will change their
57+
positions and velocities twice.
58+
59+
NOTE: As particles move due to this fix, they will pass thru periodic
60+
boundaries and be remapped to the other side of the simulation box,
61+
just as they would during normal time integration (e.g. via the "fix
62+
meso"_fix_meso.html command). It is up to you to decide whether periodic
63+
boundaries are appropriate with the kind of particle motion you are
64+
prescribing with this fix.
65+
66+
NOTE: As dicsussed below, particles are moved relative to their initial
67+
position at the time the fix is specified. These initial coordinates
68+
are stored by the fix in "unwrapped" form, by using the image flags
69+
associated with each particle. See the "dump custom"_dump.html command
70+
for a discussion of "unwrapped" coordinates. See the Atoms section of
71+
the "read_data"_read_data.html command for a discussion of image flags
72+
and how they are set for each particle. You can reset the image flags
73+
(e.g. to 0) before invoking this fix by using the "set image"_set.html
74+
command.
75+
76+
:line
77+
78+
The {linear} style moves particles at a constant velocity, so that their
79+
position {X} = (x,y,z) as a function of time is given in vector
80+
notation as
81+
82+
X(t) = X0 + V * delta :pre
83+
84+
where {X0} = (x0,y0,z0) is their position at the time the fix is
85+
specified, {V} is the specified velocity vector with components
86+
(Vx,Vy,Vz), and {delta} is the time elapsed since the fix was
87+
specified. This style also sets the velocity of each particle to V =
88+
(Vx,Vy,Vz). If any of the velocity components is specified as NULL,
89+
then the position and velocity of that component is time integrated
90+
the same as the "fix meso"_fix_meso.html command would perform, using
91+
the corresponding force component on the particle.
92+
93+
Note that the {linear} style is identical to using the {variable}
94+
style with an "equal-style variable"_variable.html that uses the
95+
vdisplace() function. E.g.
96+
97+
variable V equal 10.0
98+
variable x equal vdisplace(0.0,$V)
99+
fix 1 boundary move variable v_x NULL NULL v_V NULL NULL :pre
100+
101+
The {wiggle} style moves particles in an oscillatory fashion, so that
102+
their position {X} = (x,y,z) as a function of time is given in vector
103+
notation as
104+
105+
X(t) = X0 + A sin(omega*delta) :pre
106+
107+
where {X0} = (x0,y0,z0) is their position at the time the fix is
108+
specified, {A} is the specified amplitude vector with components
109+
(Ax,Ay,Az), {omega} is 2 PI / {period}, and {delta} is the time
110+
elapsed since the fix was specified. This style also sets the
111+
velocity of each particle to the time derivative of this expression.
112+
If any of the amplitude components is specified as NULL, then the
113+
position and velocity of that component is time integrated the same as
114+
the "fix meso"_fix_meso.html command would perform, using the
115+
corresponding force component on the particle.
116+
117+
Note that the {wiggle} style is identical to using the {variable}
118+
style with "equal-style variables"_variable.html that use the
119+
swiggle() and cwiggle() functions. E.g.
120+
121+
variable A equal 10.0
122+
variable T equal 5.0
123+
variable omega equal 2.0*PI/$T
124+
variable x equal swiggle(0.0,$A,$T)
125+
variable v equal v_omega*($A-cwiggle(0.0,$A,$T))
126+
fix 1 boundary move variable v_x NULL NULL v_v NULL NULL :pre
127+
128+
The {rotate} style rotates particles around a rotation axis {R} =
129+
(Rx,Ry,Rz) that goes thru a point {P} = (Px,Py,Pz). The {period} of
130+
the rotation is also specified. The direction of rotation for the
131+
particles around the rotation axis is consistent with the right-hand
132+
rule: if your right-hand thumb points along {R}, then your fingers wrap
133+
around the axis in the direction of rotation.
134+
135+
This style also sets the velocity of each particle to (omega cross
136+
Rperp) where omega is its angular velocity around the rotation axis and
137+
Rperp is a perpendicular vector from the rotation axis to the particle.
138+
139+
The {variable} style allows the position and velocity components of
140+
each particle to be set by formulas specified via the
141+
"variable"_variable.html command. Each of the 6 variables is
142+
specified as an argument to the fix as v_name, where name is the
143+
variable name that is defined elsewhere in the input script.
144+
145+
Each variable must be of either the {equal} or {atom} style.
146+
{Equal}-style variables compute a single numeric quantity, that can be
147+
a function of the timestep as well as of other simulation values.
148+
{Atom}-style variables compute a numeric quantity for each particle, that
149+
can be a function per-atom quantities, such as the particle's position, as
150+
well as of the timestep and other simulation values. Note that this
151+
fix stores the original coordinates of each particle (see note below) so
152+
that per-atom quantity can be used in an atom-style variable formula.
153+
See the "variable"_variable.html command for details.
154+
155+
The first 3 variables (v_dx,v_dy,v_dz) specified for the {variable}
156+
style are used to calculate a displacement from the particle's original
157+
position at the time the fix was specified. The second 3 variables
158+
(v_vx,v_vy,v_vz) specified are used to compute a velocity for each
159+
particle.
160+
161+
Any of the 6 variables can be specified as NULL. If both the
162+
displacement and velocity variables for a particular x,y,z component
163+
are specified as NULL, then the position and velocity of that
164+
component is time integrated the same as the "fix meso"_fix_meso.html
165+
command would perform, using the corresponding force component on the
166+
particle. If only the velocity variable for a component is specified as
167+
NULL, then the displacement variable will be used to set the position
168+
of the particle, and its velocity component will not be changed. If only
169+
the displacement variable for a component is specified as NULL, then
170+
the velocity variable will be used to set the velocity of the particle,
171+
and the position of the particle will be time integrated using that
172+
velocity.
173+
174+
The {units} keyword determines the meaning of the distance units used
175+
to define the {linear} velocity and {wiggle} amplitude and {rotate}
176+
origin. This setting is ignored for the {variable} style. A {box}
177+
value selects standard units as defined by the "units"_units.html
178+
command, e.g. velocity in Angstroms/fmsec and amplitude and position
179+
in Angstroms for units = real. A {lattice} value means the velocity
180+
units are in lattice spacings per time and the amplitude and position
181+
are in lattice spacings. The "lattice"_lattice.html command must have
182+
been previously used to define the lattice spacing. Each of these 3
183+
quantities may be dependent on the x,y,z dimension, since the lattice
184+
spacings can be different in x,y,z.
185+
186+
:line
187+
188+
[Restart, fix_modify, output, run start/stop, minimize info:]
189+
190+
This fix writes the original coordinates of moving particles to "binary
191+
restart files"_restart.html, as well as the initial timestep, so that
192+
the motion can be continuous in a restarted simulation. See the
193+
"read_restart"_read_restart.html command for info on how to re-specify
194+
a fix in an input script that reads a restart file, so that the
195+
operation of the fix continues in an uninterrupted fashion.
196+
197+
NOTE: Because the move positions are a function of the current
198+
timestep and the initial timestep, you cannot reset the timestep to a
199+
different value after reading a restart file, if you expect a fix move
200+
command to work in an uninterrupted fashion.
201+
202+
None of the "fix_modify"_fix_modify.html options are relevant to this
203+
fix.
204+
205+
This fix produces a per-atom array which can be accessed by various
206+
"output commands"_Howto_output.html. The number of columns for each
207+
atom is 3, and the columns store the original unwrapped x,y,z coords
208+
of each particle. The per-atom values can be accessed on any timestep.
209+
210+
No parameter of this fix can be used with the {start/stop} keywords of
211+
the "run"_run.html command.
212+
213+
This fix is not invoked during "energy minimization"_minimize.html.
214+
215+
[Restrictions:]
216+
217+
This fix is part of the USER-SDPD package. It is only enabled if
218+
LAMMPS was built with that package. See the "Build
219+
package"_Build_package.html doc page for more info.
220+
221+
This fix requires that atoms store density and internal energy as
222+
defined by the "atom_style meso"_atom_style.html command.
223+
224+
All particles in the group must be mesoscopic SPH/SDPD particles.
225+
226+
[Related commands:]
227+
228+
"fix move"_fix_move.html, "fix meso"_fix_meso.html,
229+
"displace_atoms"_displace_atoms.html
230+
231+
[Default:]
232+
233+
The option default is units = lattice.

0 commit comments

Comments
 (0)