diff -Naur lammps-18Nov09/doc/Section_commands.html lammps-19Nov09/doc/Section_commands.html --- lammps-18Nov09/doc/Section_commands.html 2009-11-06 14:01:28.000000000 -0700 +++ lammps-19Nov09/doc/Section_commands.html 2009-11-17 18:05:23.000000000 -0700 @@ -327,8 +327,8 @@
These are fix styles contributed by users, which can be used if diff -Naur lammps-18Nov09/doc/Section_commands.txt lammps-19Nov09/doc/Section_commands.txt --- lammps-18Nov09/doc/Section_commands.txt 2009-11-06 14:01:28.000000000 -0700 +++ lammps-19Nov09/doc/Section_commands.txt 2009-11-17 17:30:50.000000000 -0700 @@ -441,10 +441,10 @@ "ttm"_fix_ttm.html, "viscosity"_fix_viscosity.html, "viscous"_fix_viscous.html, -"wall/colloid"_fix_wall_colloid.html, +"wall/colloid"_fix_wall.html, "wall/gran"_fix_wall_gran.html, -"wall/lj126"_fix_wall_lj126.html, -"wall/lj93"_fix_wall_lj93.html, +"wall/lj126"_fix_wall.html, +"wall/lj93"_fix_wall.html, "wall/reflect"_fix_wall_reflect.html, "wiggle"_fix_wiggle.html :tb(c=8,ea=c) diff -Naur lammps-18Nov09/doc/fix_ave_atom.html lammps-19Nov09/doc/fix_ave_atom.html --- lammps-18Nov09/doc/fix_ave_atom.html 2009-03-17 10:11:05.000000000 -0600 +++ lammps-19Nov09/doc/fix_ave_atom.html 2009-11-18 08:22:46.000000000 -0700 @@ -121,6 +121,8 @@ fixes, or variables when they are evaluated, so this is a very general means of generating per-atom quantities to time average.
+Restart, fix_modify, output, run start/stop, minimize info:
No information about this fix is written to binary restart
diff -Naur lammps-18Nov09/doc/fix_ave_atom.txt lammps-19Nov09/doc/fix_ave_atom.txt
--- lammps-18Nov09/doc/fix_ave_atom.txt 2009-03-17 10:11:05.000000000 -0600
+++ lammps-19Nov09/doc/fix_ave_atom.txt 2009-11-18 08:22:46.000000000 -0700
@@ -110,6 +110,8 @@
fixes, or variables when they are evaluated, so this is a very general
means of generating per-atom quantities to time average.
+:line
+
[Restart, fix_modify, output, run start/stop, minimize info:]
No information about this fix is written to "binary restart
diff -Naur lammps-18Nov09/doc/fix_wall.html lammps-19Nov09/doc/fix_wall.html
--- lammps-18Nov09/doc/fix_wall.html 1969-12-31 17:00:00.000000000 -0700
+++ lammps-19Nov09/doc/fix_wall.html 2009-11-18 09:14:23.000000000 -0700
@@ -0,0 +1,206 @@
+
+ Syntax:
+ Examples:
+ Description:
+ Bound the simulation domain on one or more of its faces with a flat
+wall that interacts with the atoms in the group by generating a force
+on the atom in a direction perpendicular to the wall. The energy of
+wall-particle interactions depends on the style.
+ For style wall/lj93, the energy E is given by the 9/3 potential:
+ For style wall/lj126, the energy E is given by the 12/6 potential:
+ For style wall/colloid, the energy E is given by an integrated form of
+the pair_style colloid potential:
+ In all cases, r is the distance from the particle to the wall at
+position coord, and Rc is the cutoff distance at which the
+particle and wall no longer interact. The energy of the wall
+potential is shifted so that the wall-particle interaction energy is
+0.0 at the cutoff distance.
+ For the wall/lj93 and wall/lj126 styles, epsilon and sigma are
+the usual Lennard-Jones parameters, which determine the strength and
+size of the particle as it interacts with the wall. Note that this
+epsilon and sigma may be different than any epsilon or sigma
+values defined for a pair style that computes particle-particle
+interactions.
+ The wall/lj93 interaction is derived by integrating over a 3d
+half-lattice of Lennard-Jones 12/6 particles. The wall/lj126
+interaction is effectively a harder, more repulsive wall interaction.
+ For the wall/colloid style, epsilon is effectively a Hamaker
+constant for the colloid-wall interaction, R is the radius of the
+colloid particle, D is the distance from the surface of the colloid
+particle to the wall (r-R), and sigma is the size of the constituent
+LJ particle inside the colloid particle. Note that the cutoff
+distance Rc in this case is the distance from the colloid particle
+center to the wall.
+ The wall/colloid interaction is derived by integrating over
+constituent LJ particles of size sigma within the colloid particle
+and a 3d half-lattice of Lennard-Jones 12/6 particles of size sigma
+in the wall.
+ If the vel keyword is specified, the position of all walls will move
+during the simulation in a perpendicular direction, based on their
+initial coord position, the specified velocity vel, and the time
+elapsed since the beginning of the simulation. See the note below
+about making a wall move continuously across multiple runs. A
+positive velocity means each wall moves inward, towards the center of
+the box. I.e. an xlo wall will move in the +x direction and an
+xhi wall will move in the -x direction. A negative velocity means
+each wall moves outward, away from the center of the box. If you want
+different walls to move with different velocities, then you need to
+use multiple fix wall commands.
+ If the wiggle/sin keyword is specified, the position of all walls
+will oscillate sinusoidally during the simulation in the perpendicular
+direction, according to the equation:
+ If the wiggle/cos keyword is specified, the position of all walls
+will oscillate sinusoidally during the simulation in the perpendicular
+direction, according to the equation:
+ In both cases, pos0 is the position at the beginning of the
+simulation, A is the amplitude, omega is 2 PI / period, and
+delta is the time elapsed since the beginning of the simulation.
+See the note below about making a wall oscillate continuously across
+multiple runs. A positive amplitude means each wall initially moves
+inward, towards the center of the box. I.e. an xlo wall will move
+initially in the +x direction and an xhi wall will move initially in
+the -x direction. A negative velocity means each wall moves initially
+outward, away from the center of the box. Note that the wiggle/sin
+option oscillates with amplitude A around the pos0 position and the
+velocity of the wall is a maximum at time 0. By contrast, for the
+wiggle/cos option the wall moves up to 2A away from pos0 in one
+direction and the velocity of the wall is 0 at time 0. If you want
+different walls to oscillate with different amplitudes or periods,
+then you need to use multiple fix wall commands.
+ The units keyword determines the meaning of the distance units used
+to define the position of the wall and its velocity and wiggle
+amplitude. A box value selects standard distance units as defined
+by the units command, e.g. Angstroms for units = real or
+metal. A lattice value means the distance units are in lattice
+spacings. The lattice command must have been
+previously used to define the lattice spacing. Note that with the
+lattice option, the wall's position is specified in lattice
+spacings, the wall's velocity is specified in lattice spacings per
+time, and the wall's oscillation amplitude is specified in lattice
+spacings. Each of these 3 quantities may be dependent on the x,y,z
+dimension, since the lattice spacings can be different in x,y,z.
+ Restart, fix_modify, output, run start/stop, minimize info:
+ No information about this fix is written to binary restart
+files.
+ The fix_modify energy option is supported by this
+fix to add the energy of interaction between atoms and each wall to
+the system's potential energy as part of thermodynamic
+output.
+ This fix computes a scalar energy and a 6-length vector of forces (one
+force magnitude per wall), which can be accessed by various output
+commands. The scalar and vector values
+calculated by this fix are "extensive", meaning they scale with the
+number of atoms in the simulation. Note that the scalar energy is the
+sum of interactions with all defined walls. If you want the energy on
+a per-wall basis, you need to use multiple fix wall commands. The 6
+vector quantities are the force on the xlo wall, the xhi wall,
+ylo, yhi, zlo, zhi. These values will only be non-zero if the
+corresponding wall is defined. Note that an outward force on a wall
+will be a negative value for lo walls and a positive value for hi
+walls.
+ This fix can change the position of each wall, due to the vel or
+wiggle keywords, continuously over multiple runs, using the start
+and stop keywords of the run command. If you do not do
+this, the wall position will be reset to coord at the beginning of
+each run.
+ The forces due to this fix are imposed during an energy minimization,
+invoked by the minimize command.
+ IMPORTANT NOTE: If you want the atom/wall interaction energy to be
+included in the total potential energy of the system (the quantity
+being minimized), you MUST enable the fix_modify
+energy option for this fix.
+ Restrictions:
+ Any dimension (xyz) that has a wall must be non-periodic.
+ You cannot use both the vel and wiggle keywords together.
+ Related commands:
+ >fix wall/reflect wall/gran
+
+fix wall/lj93 command
+
+fix wall/lj126 command
+
+fix wall/colloid command
+
+fix ID group-ID style keyword values ...
+
+
+ xlo, xhi, ylo, yhi, zlo, zhi values = coord epsilon sigma cutoff
+ coord = position of wall (distance units)
+ epsilon = strength factor for wall-particle interaction (energy units)
+ sigma = size factor for wall-particle interaction (distance units)
+ cutoff = distance from wall at which wall-particle interaction is cut off (distance units)
+ vel value = v
+ v = velocity of wall in perpendicular direction (velocity units)
+ wiggle values = amplitude period
+ amplitude = size of oscillation (distance units)
+ period = time of oscillation (time units)
+ units value = lattice or box
+ lattice = the wall is defined in lattice units
+ box = the wall is defined in simulation box units
+
+
+fix wallhi all wall/lj93 xhi 10.0 1.0 1.0 2.5
+fix wallhi all wall/lj126 xhi 23.2 1.0 1.0 2.5 vel 1.0 units box
+fix zwalls all wall/colloid zlo 0.0 1.0 1.0 0.858 zhi 40.0 1.0 1.0 0.858
+
+
+
+
+position = pos0 + A sin(omega*delta)
+
+position = pos0 + A (1 - cos(omega*delta))
+
+
Default: +
+The option defaults are no velocity and no wiggle. +
+ diff -Naur lammps-18Nov09/doc/fix_wall.txt lammps-19Nov09/doc/fix_wall.txt --- lammps-18Nov09/doc/fix_wall.txt 1969-12-31 17:00:00.000000000 -0700 +++ lammps-19Nov09/doc/fix_wall.txt 2009-11-18 09:14:23.000000000 -0700 @@ -0,0 +1,194 @@ +"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 + +fix wall/lj93 command :h3 +fix wall/lj126 command :h3 +fix wall/colloid command :h3 + +[Syntax:] + +fix ID group-ID style keyword values ... :pre + +ID, group-ID are documented in "fix"_fix.html command :ulb,l +style = {wall/lj93} or {wall/lj126} or {wall/colloid} :l +one or more keyword/value pairs may be appended :l +keyword = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} or {vel} or {wiggle/sin} or {wiggle/cos} or {units} :l + {xlo}, {xhi}, {ylo}, {yhi}, {zlo}, {zhi} values = coord epsilon sigma cutoff + coord = position of wall (distance units) + epsilon = strength factor for wall-particle interaction (energy units) + sigma = size factor for wall-particle interaction (distance units) + cutoff = distance from wall at which wall-particle interaction is cut off (distance units) + {vel} value = v + v = velocity of wall in perpendicular direction (velocity units) + {wiggle} values = amplitude period + amplitude = size of oscillation (distance units) + period = time of oscillation (time units) + {units} value = {lattice} or {box} + lattice = the wall is defined in lattice units + box = the wall is defined in simulation box units :pre +:ule + +[Examples:] + +fix wallhi all wall/lj93 xhi 10.0 1.0 1.0 2.5 +fix wallhi all wall/lj126 xhi 23.2 1.0 1.0 2.5 vel 1.0 units box +fix zwalls all wall/colloid zlo 0.0 1.0 1.0 0.858 zhi 40.0 1.0 1.0 0.858 :pre + +[Description:] + +Bound the simulation domain on one or more of its faces with a flat +wall that interacts with the atoms in the group by generating a force +on the atom in a direction perpendicular to the wall. The energy of +wall-particle interactions depends on the style. + +For style {wall/lj93}, the energy E is given by the 9/3 potential: + +:c,image(Eqs/fix_wall_lj93.jpg) + +For style {wall/lj126}, the energy E is given by the 12/6 potential: + +:c,image(Eqs/pair_lj.jpg) + +For style {wall/colloid}, the energy E is given by an integrated form of +the "pair_style colloid"_pair_colloid.html potential: + +:c,image(Eqs/fix_wall_colloid.jpg) + +In all cases, {r} is the distance from the particle to the wall at +position {coord}, and Rc is the {cutoff} distance at which the +particle and wall no longer interact. The energy of the wall +potential is shifted so that the wall-particle interaction energy is +0.0 at the cutoff distance. + +For the {wall/lj93} and {wall/lj126} styles, {epsilon} and {sigma} are +the usual Lennard-Jones parameters, which determine the strength and +size of the particle as it interacts with the wall. Note that this +{epsilon} and {sigma} may be different than any {epsilon} or {sigma} +values defined for a pair style that computes particle-particle +interactions. + +The {wall/lj93} interaction is derived by integrating over a 3d +half-lattice of Lennard-Jones 12/6 particles. The {wall/lj126} +interaction is effectively a harder, more repulsive wall interaction. + +For the {wall/colloid} style, {epsilon} is effectively a Hamaker +constant for the colloid-wall interaction, {R} is the radius of the +colloid particle, {D} is the distance from the surface of the colloid +particle to the wall (r-R), and {sigma} is the size of the constituent +LJ particle inside the colloid particle. Note that the cutoff +distance Rc in this case is the distance from the colloid particle +center to the wall. + +The {wall/colloid} interaction is derived by integrating over +constituent LJ particles of size {sigma} within the colloid particle +and a 3d half-lattice of Lennard-Jones 12/6 particles of size {sigma} +in the wall. + +If the {vel} keyword is specified, the position of all walls will move +during the simulation in a perpendicular direction, based on their +initial {coord} position, the specified velocity {vel}, and the time +elapsed since the beginning of the simulation. See the note below +about making a wall move continuously across multiple runs. A +positive velocity means each wall moves inward, towards the center of +the box. I.e. an {xlo} wall will move in the +x direction and an +{xhi} wall will move in the -x direction. A negative velocity means +each wall moves outward, away from the center of the box. If you want +different walls to move with different velocities, then you need to +use multiple fix wall commands. + +If the {wiggle/sin} keyword is specified, the position of all walls +will oscillate sinusoidally during the simulation in the perpendicular +direction, according to the equation: + +position = pos0 + A sin(omega*delta) :pre + +If the {wiggle/cos} keyword is specified, the position of all walls +will oscillate sinusoidally during the simulation in the perpendicular +direction, according to the equation: + +position = pos0 + A (1 - cos(omega*delta)) :pre + +In both cases, {pos0} is the position at the beginning of the +simulation, {A} is the {amplitude}, {omega} is 2 PI / {period}, and +{delta} is the time elapsed since the beginning of the simulation. +See the note below about making a wall oscillate continuously across +multiple runs. A positive amplitude means each wall initially moves +inward, towards the center of the box. I.e. an {xlo} wall will move +initially in the +x direction and an {xhi} wall will move initially in +the -x direction. A negative velocity means each wall moves initially +outward, away from the center of the box. Note that the {wiggle/sin} +option oscillates with amplitude {A} around the pos0 position and the +velocity of the wall is a maximum at time 0. By contrast, for the +{wiggle/cos} option the wall moves up to {2A} away from pos0 in one +direction and the velocity of the wall is 0 at time 0. If you want +different walls to oscillate with different amplitudes or periods, +then you need to use multiple fix wall commands. + +The {units} keyword determines the meaning of the distance units used +to define the position of the wall and its velocity and wiggle +amplitude. A {box} value selects standard distance units as defined +by the "units"_units.html command, e.g. Angstroms for units = real or +metal. A {lattice} value means the distance units are in lattice +spacings. The "lattice"_lattice.html command must have been +previously used to define the lattice spacing. Note that with the +{lattice} option, the wall's position is specified in lattice +spacings, the wall's velocity is specified in lattice spacings per +time, and the wall's oscillation amplitude is specified in lattice +spacings. Each of these 3 quantities may be dependent on the x,y,z +dimension, since the lattice spacings can be different in x,y,z. + +[Restart, fix_modify, output, run start/stop, minimize info:] + +No information about this fix is written to "binary restart +files"_restart.html. + +The "fix_modify"_fix_modify.html {energy} option is supported by this +fix to add the energy of interaction between atoms and each wall to +the system's potential energy as part of "thermodynamic +output"_thermo_style.html. + +This fix computes a scalar energy and a 6-length vector of forces (one +force magnitude per wall), which can be accessed by various "output +commands"_Section_howto.html#4_15. The scalar and vector values +calculated by this fix are "extensive", meaning they scale with the +number of atoms in the simulation. Note that the scalar energy is the +sum of interactions with all defined walls. If you want the energy on +a per-wall basis, you need to use multiple fix wall commands. The 6 +vector quantities are the force on the {xlo} wall, the {xhi} wall, +{ylo}, {yhi}, {zlo}, {zhi}. These values will only be non-zero if the +corresponding wall is defined. Note that an outward force on a wall +will be a negative value for {lo} walls and a positive value for {hi} +walls. + +This fix can change the position of each wall, due to the {vel} or +{wiggle} keywords, continuously over multiple runs, using the {start} +and {stop} keywords of the "run"_run.html command. If you do not do +this, the wall position will be reset to {coord} at the beginning of +each run. + +The forces due to this fix are imposed during an energy minimization, +invoked by the "minimize"_minimize.html command. + +IMPORTANT NOTE: If you want the atom/wall interaction energy to be +included in the total potential energy of the system (the quantity +being minimized), you MUST enable the "fix_modify"_fix_modify.html +{energy} option for this fix. + +[Restrictions:] + +Any dimension (xyz) that has a wall must be non-periodic. + +You cannot use both the {vel} and {wiggle} keywords together. + +[Related commands:] + +"fix wall/reflect"_fix_wall_reflect.html wall/gran"_fix_wall_gran.html + +[Default:] + +The option defaults are no velocity and no wiggle. diff -Naur lammps-18Nov09/doc/fix_wall_colloid.html lammps-19Nov09/doc/fix_wall_colloid.html --- lammps-18Nov09/doc/fix_wall_colloid.html 2009-11-06 16:23:24.000000000 -0700 +++ lammps-19Nov09/doc/fix_wall_colloid.html 1969-12-31 17:00:00.000000000 -0700 @@ -1,94 +0,0 @@ - -Syntax: -
-fix ID group-ID wall/colloid style coord A sigma cutoff --
Examples: -
-fix wallhi all wall/colloid xhi 10.0 20.0 1.0 2.5 -fix leftwall all wall/colloid zlo 0.0 10.0 1.0 0.858 --
Description: -
-Bound the simulation domain on one of its faces with a wall of -Lennard-Jones particles that interacts with finite-size colloidal -particles in the group. The energy E of wall-colloid interactions is -given by an integrated form of the pair_style -colloid potential -
-
-where A is the specified Hamaker constant for the colloid-wall -interaction, r is the distance from the center of the particle to -the wall coord, R is the radius of the colloid particle, D is -the distance from the surface of the colloid particle to the wall -(r-R), sigma is the size of the constituent LJ particle integrated -over as described below, and Rc is the cutoff value specified in the -fix command and is the distance from the particle center to the wall. -
-This colloid/wall interaction is derived by integrating over both the -constituent LJ particles in the colloid particle and a 3d half-lattice -of Lennard-Jones 12-6 particles in the wall. -
-The wall potential is shifted so that the energy of a wall-particle -interaction is 0.0 at the cutoff distance. -
-Restart, fix_modify, output, run start/stop, minimize info: -
-No information about this fix is written to binary restart -files. -
-The fix_modify energy option is supported by this -fix to add the energy of interaction between atoms and the wall to the -system's potential energy as part of thermodynamic -output. -
-This fix computes a scalar energy and a 3-vector of forces (on the -wall), which can be accessed by various output -commands. The scalar and vector values -calculated by this fix are "extensive", meaning they scale with the -number of atoms in the simulation. -
-No parameter of this fix can be used with the start/stop keywords of -the run command. -
-The forces due to this fix are imposed during an energy minimization, -invoked by the minimize command. -
-IMPORTANT NOTE: If you want the atom/wall interaction energy to be -included in the total potential energy of the system (the quantity -being minimized), you MUST enable the fix_modify -energy option for this fix. -
-Restrictions: -
-Any dimension (xyz) that has a colloid wall must be non-periodic. -
-Related commands: -
-fix wall/lj93, pair_style -colloid -
-Default: none -
- diff -Naur lammps-18Nov09/doc/fix_wall_colloid.txt lammps-19Nov09/doc/fix_wall_colloid.txt --- lammps-18Nov09/doc/fix_wall_colloid.txt 2009-11-06 16:23:24.000000000 -0700 +++ lammps-19Nov09/doc/fix_wall_colloid.txt 1969-12-31 17:00:00.000000000 -0700 @@ -1,89 +0,0 @@ -"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 - -fix wall/colloid command :h3 - -[Syntax:] - -fix ID group-ID wall/colloid style coord A sigma cutoff :pre - -ID, group-ID are documented in "fix"_fix.html command -wall/colloid = style name of this fix command -style = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} -coord = position of wall (distance units) -A = Hamaker constant for colloid-wall interactions (energy units) -sigma = size of constituent LJ particle that integration is done over (distance units) -cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :ul - -[Examples:] - -fix wallhi all wall/colloid xhi 10.0 20.0 1.0 2.5 -fix leftwall all wall/colloid zlo 0.0 10.0 1.0 0.858 :pre - -[Description:] - -Bound the simulation domain on one of its faces with a wall of -Lennard-Jones particles that interacts with finite-size colloidal -particles in the group. The energy E of wall-colloid interactions is -given by an integrated form of the "pair_style -colloid"_pair_colloid.html potential - -:c,image(Eqs/fix_wall_colloid.jpg) - -where A is the specified Hamaker constant for the colloid-wall -interaction, {r} is the distance from the center of the particle to -the wall {coord}, {R} is the radius of the colloid particle, {D} is -the distance from the surface of the colloid particle to the wall -(r-R), sigma is the size of the constituent LJ particle integrated -over as described below, and Rc is the cutoff value specified in the -fix command and is the distance from the particle center to the wall. - -This colloid/wall interaction is derived by integrating over both the -constituent LJ particles in the colloid particle and a 3d half-lattice -of Lennard-Jones 12-6 particles in the wall. - -The wall potential is shifted so that the energy of a wall-particle -interaction is 0.0 at the cutoff distance. - -[Restart, fix_modify, output, run start/stop, minimize info:] - -No information about this fix is written to "binary restart -files"_restart.html. - -The "fix_modify"_fix_modify.html {energy} option is supported by this -fix to add the energy of interaction between atoms and the wall to the -system's potential energy as part of "thermodynamic -output"_thermo_style.html. - -This fix computes a scalar energy and a 3-vector of forces (on the -wall), which can be accessed by various "output -commands"_Section_howto.html#4_15. The scalar and vector values -calculated by this fix are "extensive", meaning they scale with the -number of atoms in the simulation. - -No parameter of this fix can be used with the {start/stop} keywords of -the "run"_run.html command. - -The forces due to this fix are imposed during an energy minimization, -invoked by the "minimize"_minimize.html command. - -IMPORTANT NOTE: If you want the atom/wall interaction energy to be -included in the total potential energy of the system (the quantity -being minimized), you MUST enable the "fix_modify"_fix_modify.html -{energy} option for this fix. - -[Restrictions:] - -Any dimension (xyz) that has a colloid wall must be non-periodic. - -[Related commands:] - -"fix wall/lj93"_fix_wall_lj93.html, "pair_style -colloid"_pair_colloid.html - -[Default:] none diff -Naur lammps-18Nov09/doc/fix_wall_lj126.html lammps-19Nov09/doc/fix_wall_lj126.html --- lammps-18Nov09/doc/fix_wall_lj126.html 2009-11-06 15:32:29.000000000 -0700 +++ lammps-19Nov09/doc/fix_wall_lj126.html 1969-12-31 17:00:00.000000000 -0700 @@ -1,113 +0,0 @@ - -Syntax: -
-fix ID group-ID wall/lj126 style coord epsilon sigma cutoff keyword values ... --
vel args = v - v = velocity of wall in perpendicular direction (velocity units) -- -
Examples: -
-fix wallhi all wall/lj126 xhi 10.0 1.0 1.0 1.12 -fix leftwall all wall/lj126 zlo 0.0 1.0 1.0 0.858 vel 1.0 --
Description: -
-Bound the simulation domain on one of its faces with a Lennard-Jones -wall that interacts with the atoms in the group. The energy E of -wall-particle interactions is given by the 12-6 potential -
-
-where r is the distance from the particle to the wall coord, and -epsilon and sigma are the usual LJ parameters. Rc is the cutoff value -specified in the command. This interaction provides a harder, more -repulsive interaction with the wall than the softer 9-3 potential -provided by the fix wall/lj93 command. -
-The wall potential is shifted so that the energy of a wall-particle -interaction is 0.0 at the cutoff distance. -
-If the vel keyword is specified, the position of wall will move -during the simulation, based on its initial position (coord), the -specified velocity (vel), and the time elapsed since the beginning of -the simulation. Xlo or xhi walls move in the x direction with -whatever sign you give the v argument. Ditto for y and z walls. -See the note below about making the wall move continuously across -multiple runs. -
-Restart, fix_modify, output, run start/stop, minimize info: -
-No information about this fix is written to binary restart -files. -
-The fix_modify energy option is supported by this -fix to add the energy of interaction between atoms and the wall to the -system's potential energy as part of thermodynamic -output. -
-This fix computes a scalar energy and a 3-vector of forces (on the -wall), which can be accessed by various output -commands. The scalar and vector values -calculated by this fix are "extensive", meaning they scale with the -number of atoms in the simulation. -
-This fix can change the position of the wall, due to the vel -keyword, continuously over multiple runs, using the start and stop -keywords of the run command. If you do not do this, the -wall position will be reset to coord at the beginning of each run. -
-The forces due to this fix are imposed during an energy minimization, -invoked by the minimize command. -
-IMPORTANT NOTE: If you want the atom/wall interaction energy to be -included in the total potential energy of the system (the quantity -being minimized), you MUST enable the fix_modify -energy option for this fix. -
-Restrictions: -
-Any dimension (xyz) that has a LJ 12/6 wall must be non-periodic. -
-Related commands: -
-fix wall/reflect, fix -wall/lj93 -
-Default: -
-The option defaults are vel = 0. -
- diff -Naur lammps-18Nov09/doc/fix_wall_lj126.txt lammps-19Nov09/doc/fix_wall_lj126.txt --- lammps-18Nov09/doc/fix_wall_lj126.txt 2009-11-06 15:32:29.000000000 -0700 +++ lammps-19Nov09/doc/fix_wall_lj126.txt 1969-12-31 17:00:00.000000000 -0700 @@ -1,98 +0,0 @@ -"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 - -fix wall/lj126 command :h3 - -[Syntax:] - -fix ID group-ID wall/lj126 style coord epsilon sigma cutoff keyword values ... :pre - -ID, group-ID are documented in "fix"_fix.html command :ulb,l -wall/lj126 = style name of this fix command :l -style = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l -coord = position of wall (distance units) :l -epsilon = Lennard-Jones epsilon for wall-particle interaction (energy units) :l -sigma = Lennard-Jones sigma for wall-particle interaction (distance units) :l -cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :l -one or more keyword/value pairs may be appended :l -keyword = {vel} :l - {vel} args = v - v = velocity of wall in perpendicular direction (velocity units) :pre -:ule - -[Examples:] - -fix wallhi all wall/lj126 xhi 10.0 1.0 1.0 1.12 -fix leftwall all wall/lj126 zlo 0.0 1.0 1.0 0.858 vel 1.0 :pre - -[Description:] - -Bound the simulation domain on one of its faces with a Lennard-Jones -wall that interacts with the atoms in the group. The energy E of -wall-particle interactions is given by the 12-6 potential - -:c,image(Eqs/pair_lj.jpg) - -where {r} is the distance from the particle to the wall {coord}, and -epsilon and sigma are the usual LJ parameters. Rc is the cutoff value -specified in the command. This interaction provides a harder, more -repulsive interaction with the wall than the softer 9-3 potential -provided by the "fix wall/lj93"_fix_wall_lj93.html command. - -The wall potential is shifted so that the energy of a wall-particle -interaction is 0.0 at the cutoff distance. - -If the {vel} keyword is specified, the position of wall will move -during the simulation, based on its initial position (coord), the -specified velocity (vel), and the time elapsed since the beginning of -the simulation. {Xlo} or {xhi} walls move in the x direction with -whatever sign you give the {v} argument. Ditto for {y} and {z} walls. -See the note below about making the wall move continuously across -multiple runs. - -[Restart, fix_modify, output, run start/stop, minimize info:] - -No information about this fix is written to "binary restart -files"_restart.html. - -The "fix_modify"_fix_modify.html {energy} option is supported by this -fix to add the energy of interaction between atoms and the wall to the -system's potential energy as part of "thermodynamic -output"_thermo_style.html. - -This fix computes a scalar energy and a 3-vector of forces (on the -wall), which can be accessed by various "output -commands"_Section_howto.html#4_15. The scalar and vector values -calculated by this fix are "extensive", meaning they scale with the -number of atoms in the simulation. - -This fix can change the position of the wall, due to the {vel} -keyword, continuously over multiple runs, using the {start} and {stop} -keywords of the "run"_run.html command. If you do not do this, the -wall position will be reset to {coord} at the beginning of each run. - -The forces due to this fix are imposed during an energy minimization, -invoked by the "minimize"_minimize.html command. - -IMPORTANT NOTE: If you want the atom/wall interaction energy to be -included in the total potential energy of the system (the quantity -being minimized), you MUST enable the "fix_modify"_fix_modify.html -{energy} option for this fix. - -[Restrictions:] - -Any dimension (xyz) that has a LJ 12/6 wall must be non-periodic. - -[Related commands:] - -"fix wall/reflect"_fix_wall_reflect.html, "fix -wall/lj93"_fix_wall_lj93.html - -[Default:] - -The option defaults are vel = 0. diff -Naur lammps-18Nov09/doc/fix_wall_lj93.html lammps-19Nov09/doc/fix_wall_lj93.html --- lammps-18Nov09/doc/fix_wall_lj93.html 2009-11-06 15:32:29.000000000 -0700 +++ lammps-19Nov09/doc/fix_wall_lj93.html 1969-12-31 17:00:00.000000000 -0700 @@ -1,114 +0,0 @@ - -Syntax: -
-fix ID group-ID wall/lj93 style coord epsilon sigma cutoff keyword values ... --
vel args = v - v = velocity of wall in perpendicular direction (velocity units) -- -
Examples: -
-fix wallhi all wall/lj93 xhi 10.0 1.0 1.0 2.5 -fix leftwall all wall/lj93 zlo 0.0 1.0 1.0 0.858 vel 1.0 --
Description: -
-Bound the simulation domain on one of its faces with a Lennard-Jones -wall that interacts with the atoms in the group. The energy E of -wall-particle interactions is given by the 9-3 potential -
-
-where r is the distance from the particle to the wall coord, and -epsilon and sigma are the usual LJ parameters. Rc is the cutoff value -specified in the command. This interaction is derived by integrating -over a 3d half-lattice of Lennard-Jones 12-6 particles. A harder, -more repulsive wall interaction can be computed by using the fix -wall/lj126 command. -
-The wall potential is shifted so that the energy of a wall-particle -interaction is 0.0 at the cutoff distance. -
-If the vel keyword is specified, the position of wall will move -during the simulation, based on its initial position (coord), the -specified velocity (vel), and the time elapsed since the beginning of -the simulation. Xlo or xhi walls move in the x direction with -whatever sign you give the v argument. Ditto for y and z walls. -See the note below about making the wall move continuously across -multiple runs. -
-Restart, fix_modify, output, run start/stop, minimize info: -
-No information about this fix is written to binary restart -files. -
-The fix_modify energy option is supported by this -fix to add the energy of interaction between atoms and the wall to the -system's potential energy as part of thermodynamic -output. -
-This fix computes a scalar energy and a 3-vector of forces (on the -wall), which can be accessed by various output -commands. The scalar and vector values -calculated by this fix are "extensive", meaning they scale with the -number of atoms in the simulation. -
-This fix can change the position of the wall, due to the vel -keyword, continuously over multiple runs, using the start and stop -keywords of the run command. If you do not do this, the -wall position will be reset to coord at the beginning of each run. -
-The forces due to this fix are imposed during an energy minimization, -invoked by the minimize command. -
-IMPORTANT NOTE: If you want the atom/wall interaction energy to be -included in the total potential energy of the system (the quantity -being minimized), you MUST enable the fix_modify -energy option for this fix. -
-Restrictions: -
-Any dimension (xyz) that has a LJ 9/3 wall must be non-periodic. -
-Related commands: -
-fix wall/reflect, fix -wall/lj126 -
-Default: -
-The option defaults are vel = 0. -
- diff -Naur lammps-18Nov09/doc/fix_wall_lj93.txt lammps-19Nov09/doc/fix_wall_lj93.txt --- lammps-18Nov09/doc/fix_wall_lj93.txt 2009-11-06 15:32:29.000000000 -0700 +++ lammps-19Nov09/doc/fix_wall_lj93.txt 1969-12-31 17:00:00.000000000 -0700 @@ -1,99 +0,0 @@ -"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 - -fix wall/lj93 command :h3 - -[Syntax:] - -fix ID group-ID wall/lj93 style coord epsilon sigma cutoff keyword values ... :pre - -ID, group-ID are documented in "fix"_fix.html command :ulb,l -wall/lj93 = style name of this fix command :l -style = {xlo} or {xhi} or {ylo} or {yhi} or {zlo} or {zhi} :l -coord = position of wall (distance units) :l -epsilon = Lennard-Jones epsilon for wall-particle interaction (energy units) :l -sigma = Lennard-Jones sigma for wall-particle interaction (distance units) :l -cutoff = distance from wall at which wall-particle interaction is cut off (distance units) :l -one or more keyword/value pairs may be appended :l -keyword = {vel} :l - {vel} args = v - v = velocity of wall in perpendicular direction (velocity units) :pre -:ule - -[Examples:] - -fix wallhi all wall/lj93 xhi 10.0 1.0 1.0 2.5 -fix leftwall all wall/lj93 zlo 0.0 1.0 1.0 0.858 vel 1.0 :pre - -[Description:] - -Bound the simulation domain on one of its faces with a Lennard-Jones -wall that interacts with the atoms in the group. The energy E of -wall-particle interactions is given by the 9-3 potential - -:c,image(Eqs/fix_wall_lj93.jpg) - -where {r} is the distance from the particle to the wall {coord}, and -epsilon and sigma are the usual LJ parameters. Rc is the cutoff value -specified in the command. This interaction is derived by integrating -over a 3d half-lattice of Lennard-Jones 12-6 particles. A harder, -more repulsive wall interaction can be computed by using the "fix -wall/lj126"_fix_wall_lj126.html command. - -The wall potential is shifted so that the energy of a wall-particle -interaction is 0.0 at the cutoff distance. - -If the {vel} keyword is specified, the position of wall will move -during the simulation, based on its initial position (coord), the -specified velocity (vel), and the time elapsed since the beginning of -the simulation. {Xlo} or {xhi} walls move in the x direction with -whatever sign you give the {v} argument. Ditto for {y} and {z} walls. -See the note below about making the wall move continuously across -multiple runs. - -[Restart, fix_modify, output, run start/stop, minimize info:] - -No information about this fix is written to "binary restart -files"_restart.html. - -The "fix_modify"_fix_modify.html {energy} option is supported by this -fix to add the energy of interaction between atoms and the wall to the -system's potential energy as part of "thermodynamic -output"_thermo_style.html. - -This fix computes a scalar energy and a 3-vector of forces (on the -wall), which can be accessed by various "output -commands"_Section_howto.html#4_15. The scalar and vector values -calculated by this fix are "extensive", meaning they scale with the -number of atoms in the simulation. - -This fix can change the position of the wall, due to the {vel} -keyword, continuously over multiple runs, using the {start} and {stop} -keywords of the "run"_run.html command. If you do not do this, the -wall position will be reset to {coord} at the beginning of each run. - -The forces due to this fix are imposed during an energy minimization, -invoked by the "minimize"_minimize.html command. - -IMPORTANT NOTE: If you want the atom/wall interaction energy to be -included in the total potential energy of the system (the quantity -being minimized), you MUST enable the "fix_modify"_fix_modify.html -{energy} option for this fix. - -[Restrictions:] - -Any dimension (xyz) that has a LJ 9/3 wall must be non-periodic. - -[Related commands:] - -"fix wall/reflect"_fix_wall_reflect.html, "fix -wall/lj126"_fix_wall_lj126.html - -[Default:] - -The option defaults are vel = 0. diff -Naur lammps-18Nov09/potentials/ffield.reax lammps-19Nov09/potentials/ffield.reax --- lammps-18Nov09/potentials/ffield.reax 2009-06-03 13:59:19.000000000 -0600 +++ lammps-19Nov09/potentials/ffield.reax 2009-11-18 08:18:37.000000000 -0700 @@ -39,7 +39,7 @@ 5.0000 !Molecular energy (not used) 0.0000 !Molecular energy (not used) 3.6942 !Valency angle conjugation parameter - 6 ! Nr of atoms; cov.r; valency;a.m;Rvdw;Evdw;gammaEEM;cov.r2;# + 5 ! Nr of atoms; cov.r; valency;a.m;Rvdw;Evdw;gammaEEM;cov.r2;# alfa;gammavdW;valency;Eunder;Eover;chiEEM;etaEEM;n.u. cov r3;Elp;Heat inc.;n.u.;n.u.;n.u.;n.u. ov/un;val1;n.u.;val3,vval4 @@ -63,11 +63,7 @@ 9.9575 4.9055 4.0000 52.9998 112.1416 6.5000 8.2545 2.0000 1.4601 9.7177 -2.3700 5.7487 23.2859 12.7147 0.9745 0.0000 -11.0000 2.7466 1.0338 4.0000 2.8793 0.0000 0.0000 0.0000 - Si 2.0276 4.0000 28.0600 2.2042 0.1322 0.8218 1.5758 4.0000 - 11.9413 2.0618 4.0000 11.8211 136.4845 1.8038 7.3852 0.0000 - -1.0000 0.0000 -2.3700 6.4918 8.5961 0.2368 0.8563 0.0000 - -3.8112 3.1873 1.0338 4.0000 2.5791 0.0000 0.0000 0.0000 - 18 ! Nr of bonds; Edis1;LPpen;n.u.;pbe1;pbo5;13corr;pbo6 + 15 ! Nr of bonds; Edis1;LPpen;n.u.;pbe1;pbo5;13corr;pbo6 pbe2;pbo3;pbo4;n.u.;pbo1;pbo2;ovcorr 1 1 145.4070 103.0681 73.7841 0.2176 -0.7816 1.0000 28.4167 0.3217 0.1111 -0.1940 8.6733 1.0000 -0.0994 5.9724 1.0000 0.0000 @@ -99,22 +95,14 @@ 0.3296 -0.3153 9.1227 1.0000 -0.1805 5.6864 1.0000 0.0000 5 5 96.1871 93.7006 68.6860 0.0955 -0.4781 1.0000 17.8574 0.6000 0.2723 -0.2373 9.7875 1.0000 -0.0950 6.4757 1.0000 0.0000 - 6 6 109.1904 70.8314 30.0000 0.2765 -0.3000 1.0000 16.0000 0.1583 - 0.2804 -0.1994 8.1117 1.0000 -0.0675 8.2993 0.0000 0.0000 - 2 6 137.1002 0.0000 0.0000 -0.1902 0.0000 1.0000 6.0000 0.4256 - 17.7186 1.0000 0.0000 1.0000 -0.0377 6.4281 0.0000 0.0000 - 3 6 191.1743 52.0733 43.3991 -0.2584 -0.3000 1.0000 36.0000 0.8764 - 1.0248 -0.3658 4.2151 1.0000 -0.5004 4.2605 1.0000 0.0000 - 8 ! Nr of off-diagonal terms; Ediss;Ro;gamma;rsigma;rpi;rpi2 + 6 ! Nr of off-diagonal terms; Ediss;Ro;gamma;rsigma;rpi;rpi2 1 2 0.0455 1.7218 10.4236 1.0379 -1.0000 -1.0000 2 3 0.0469 1.9185 10.3707 0.9406 -1.0000 -1.0000 2 4 0.0999 1.8372 9.6539 0.9692 -1.0000 -1.0000 1 3 0.1186 1.9820 9.5927 1.2936 1.1203 1.0805 1 4 0.1486 1.8922 9.7989 1.3746 1.2091 1.1427 3 4 0.1051 2.0060 10.0691 1.3307 1.1034 1.0060 - 2 6 0.0470 1.6738 11.6877 1.1931 -1.0000 -1.0000 - 3 6 0.1263 1.8163 10.6833 1.6266 1.2052 -1.0000 - 62 ! Nr of angles;at1;at2;at3;Thetao,o;ka;kb;pv1;pv2 + 50 ! Nr of angles;at1;at2;at3;Thetao,o;ka;kb;pv1;pv2 1 1 1 70.0265 13.6338 2.1884 0.0000 0.1676 26.3587 1.0400 1 1 2 69.7786 10.3544 8.4326 0.0000 0.1153 0.0000 1.0400 2 1 2 74.6020 11.8629 2.9294 0.0000 0.1367 0.0000 1.0400 @@ -164,20 +152,8 @@ 1 5 5 85.3644 36.9951 2.0903 0.1463 0.0559 0.0000 1.0400 2 5 2 93.1959 36.9951 2.0903 0.0000 0.0000 0.0000 1.0400 2 5 5 84.3331 36.9951 2.0903 0.0000 0.0000 0.0000 1.0400 - 6 6 6 69.3456 21.7361 1.4283 0.0000 -0.2101 0.0000 1.3241 - 2 6 6 75.6168 21.5317 1.0435 0.0000 2.5179 0.0000 1.0400 - 2 6 2 78.3939 20.9772 0.8630 0.0000 2.8421 0.0000 1.0400 - 3 6 6 70.3016 15.4081 1.3267 0.0000 2.1459 0.0000 1.0400 - 2 6 3 73.8232 16.6592 3.7425 0.0000 0.8613 0.0000 1.0400 - 3 6 3 90.0344 7.7656 1.7264 0.0000 0.7689 0.0000 1.0400 - 6 3 6 22.1715 3.6615 0.3160 0.0000 4.1125 0.0000 1.0400 - 2 3 6 83.7634 5.6693 2.7780 0.0000 1.6982 0.0000 1.0400 - 3 3 6 73.4663 25.0761 0.9143 0.0000 2.2466 0.0000 1.0400 - 2 2 6 0.0000 47.1300 6.0000 0.0000 1.6371 0.0000 1.0400 - 6 2 6 0.0000 31.5209 6.0000 0.0000 1.6371 0.0000 1.0400 - 3 2 6 0.0000 31.0427 4.5625 0.0000 1.6371 0.0000 1.0400 2 2 5 0.0000 0.0019 6.0000 0.0000 0.0000 0.0000 1.0400 - 20 ! Nr of torsions;at1;at2;at3;at4;;V1;V2;V3;V2(BO);vconj;n.u;n + 17 ! Nr of torsions;at1;at2;at3;at4;;V1;V2;V3;V2(BO);vconj;n.u;n 1 1 1 1 0.0000 23.2168 0.1811 -4.6220 -1.9387 0.0000 0.0000 1 1 1 2 0.0000 45.7984 0.3590 -5.7106 -2.9459 0.0000 0.0000 2 1 1 2 0.0000 44.6445 0.3486 -5.1725 -0.8717 0.0000 0.0000 @@ -195,9 +171,6 @@ 0 1 5 0 3.3423 30.3435 0.0365 -2.7171 0.0000 0.0000 0.0000 0 5 5 0 -0.0555 -42.7738 0.1515 -2.2056 0.0000 0.0000 0.0000 0 2 5 0 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 - 0 6 6 0 0.0000 0.0000 0.1200 -2.4426 0.0000 0.0000 0.0000 - 0 2 6 0 0.0000 0.0000 0.1200 -2.4847 0.0000 0.0000 0.0000 - 0 3 6 0 0.0000 0.0000 0.1200 -2.4703 0.0000 0.0000 0.0000 9 ! Nr of hydrogen bonds;at1;at2;at3;Rhb;Dehb;vhb1 3 2 3 2.0431 -6.6813 3.5000 1.7295 3 2 4 1.6740 -10.9581 3.5000 1.7295 diff -Naur lammps-18Nov09/src/COLLOID/fix_wall_colloid.cpp lammps-19Nov09/src/COLLOID/fix_wall_colloid.cpp --- lammps-18Nov09/src/COLLOID/fix_wall_colloid.cpp 2009-11-09 17:23:57.000000000 -0700 +++ lammps-19Nov09/src/COLLOID/fix_wall_colloid.cpp 2009-11-17 17:59:12.000000000 -0700 @@ -16,14 +16,11 @@ ------------------------------------------------------------------------- */ #include "math.h" -#include "stdlib.h" #include "string.h" #include "fix_wall_colloid.h" #include "atom.h" #include "atom_vec.h" -#include "domain.h" #include "update.h" -#include "output.h" #include "respa.h" #include "error.h" @@ -31,75 +28,8 @@ /* ---------------------------------------------------------------------- */ -FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) -{ - if (narg != 8) error->all("Illegal fix wall/colloid command"); - - scalar_flag = 1; - vector_flag = 1; - size_vector = 3; - scalar_vector_freq = 1; - extscalar = 1; - extvector = 1; - - if (strcmp(arg[3],"xlo") == 0) { - dim = 0; - side = -1; - } else if (strcmp(arg[3],"xhi") == 0) { - dim = 0; - side = 1; - } else if (strcmp(arg[3],"ylo") == 0) { - dim = 1; - side = -1; - } else if (strcmp(arg[3],"yhi") == 0) { - dim = 1; - side = 1; - } else if (strcmp(arg[3],"zlo") == 0) { - dim = 2; - side = -1; - } else if (strcmp(arg[3],"zhi") == 0) { - dim = 2; - side = 1; - } else error->all("Illegal fix wall/colloid command"); - - coord = atof(arg[4]); - hamaker = atof(arg[5]); - sigma = atof(arg[6]); - cutoff = atof(arg[7]); - - coeff1 = -4.0/315.0 * hamaker * pow(sigma,6.0); - coeff2 = -2.0/3.0 * hamaker; - coeff3 = hamaker * pow(sigma,6.0)/7560.0; - coeff4 = hamaker/6.0; - - double rinv = 1.0/cutoff; - double r2inv = rinv*rinv; - double r4inv = r2inv*r2inv; - offset = coeff3*r4inv*r4inv*rinv - coeff4*r2inv*rinv; - - if (dim == 0 && domain->xperiodic) - error->all("Cannot use wall in periodic dimension"); - if (dim == 1 && domain->yperiodic) - error->all("Cannot use wall in periodic dimension"); - if (dim == 2 && domain->zperiodic) - error->all("Cannot use wall in periodic dimension"); - - wall_flag = 0; - wall[0] = wall[1] = wall[2] = wall[3] = 0.0; -} - -/* ---------------------------------------------------------------------- */ - -int FixWallColloid::setmask() -{ - int mask = 0; - mask |= POST_FORCE; - mask |= THERMO_ENERGY; - mask |= POST_FORCE_RESPA; - mask |= MIN_POST_FORCE; - return mask; -} +FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) : + FixWall(lmp, narg, arg) {} /* ---------------------------------------------------------------------- */ @@ -135,34 +65,33 @@ MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall) error->all("Fix wall/colloid requires extended particles"); - if (strcmp(update->integrate_style,"respa") == 0) - nlevels_respa = ((Respa *) update->integrate)->nlevels; + FixWall::init(); } /* ---------------------------------------------------------------------- */ -void FixWallColloid::setup(int vflag) +void FixWallColloid::precompute(int m) { - if (strcmp(update->integrate_style,"verlet") == 0) - post_force(vflag); - else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); - post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); - } -} - -/* ---------------------------------------------------------------------- */ + coeff1[m] = -4.0/315.0 * epsilon[m] * pow(sigma[m],6.0); + coeff2[m] = -2.0/3.0 * epsilon[m]; + coeff3[m] = epsilon[m] * pow(sigma[m],6.0)/7560.0; + coeff4[m] = epsilon[m]/6.0; -void FixWallColloid::min_setup(int vflag) -{ - post_force(vflag); + double rinv = 1.0/cutoff[m]; + double r2inv = rinv*rinv; + double r4inv = r2inv*r2inv; + offset[m] = coeff3[m]*r4inv*r4inv*rinv - coeff4[m]*r2inv*rinv; } /* ---------------------------------------------------------------------- */ -void FixWallColloid::post_force(int vflag) +void FixWallColloid::wall_particle(int m, double coord) { + double delta,delta2,rinv,r2inv,r4inv,r8inv,fwall; + double r2,rinv2,r2inv2,r4inv2,r6inv2; + double r3,rinv3,r2inv3,r4inv3,r6inv3; + double rad,rad2,rad4,rad8,diam,new_coeff2; + double **x = atom->x; double **f = atom->f; double **shape = atom->shape; @@ -170,21 +99,17 @@ int *type = atom->type; int nlocal = atom->nlocal; - double delta,delta2,rinv,r2inv,r4inv,r8inv,fwall; - double r2,rinv2,r2inv2,r4inv2,r6inv2; - double r3,rinv3,r2inv3,r4inv3,r6inv3; - double rad,rad2,rad4,rad8,diam,new_coeff2; - wall[0] = wall[1] = wall[2] = wall[3] = 0.0; - wall_flag = 0; + int dim = m/2; + int side = m % 2; for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { - if (side == -1) delta = x[i][dim] - coord; + if (side == 0) delta = x[i][dim] - coord; else delta = coord - x[i][dim]; if (delta <= 0.0) continue; - if (delta > cutoff) continue; + if (delta > cutoff[m]) continue; rad = shape[type[i]][0]; - new_coeff2 = coeff2*rad*rad*rad; + new_coeff2 = coeff2[m]*rad*rad*rad; diam = 2.0*rad; rad2 = rad*rad; rad4 = rad2*rad2; @@ -194,9 +119,9 @@ r2inv = rinv*rinv; r4inv = r2inv*r2inv; r8inv = r4inv*r4inv; - fwall = (coeff1*(rad8*rad + 27.0*rad4*rad2*rad*pow(delta,2.0) - + 63.0*rad4*rad*pow(delta,4.0) - + 21.0*rad2*rad*pow(delta,6.0))*r8inv - + fwall = (coeff1[m]*(rad8*rad + 27.0*rad4*rad2*rad*pow(delta,2.0) + + 63.0*rad4*rad*pow(delta,4.0) + + 21.0*rad2*rad*pow(delta,6.0))*r8inv - new_coeff2*r2inv) * side; f[i][dim] -= fwall; r2 = 0.5*diam - delta; @@ -204,59 +129,15 @@ r2inv2 = rinv2*rinv2; r4inv2 = r2inv2*r2inv2; r6inv2 = r4inv2*r2inv2; - r3 = delta+0.5*diam; + r3 = delta + 0.5*diam; rinv3 = 1.0/r3; r2inv3 = rinv3*rinv3; r4inv3 = r2inv3*r2inv3; r6inv3 = r4inv3*r2inv3; - wall[0] += coeff3*((-3.5*diam+delta)*r4inv2*r2inv2*rinv2 - + (3.5*diam+delta)*r4inv3*r2inv3*rinv3) - - coeff4*((-diam*delta+r2*r3*(log(-r2)-log(r3)))* - (-rinv2)*rinv3) - offset; - wall[dim+1] += fwall; + ewall[0] += coeff3[m]*((-3.5*diam+delta)*r4inv2*r2inv2*rinv2 + + (3.5*diam+delta)*r4inv3*r2inv3*rinv3) - + coeff4[m]*((-diam*delta+r2*r3*(log(-r2)-log(r3)))* + (-rinv2)*rinv3) - offset[m]; + ewall[m+1] += fwall; } } - -/* ---------------------------------------------------------------------- */ - -void FixWallColloid::post_force_respa(int vflag, int ilevel, int iloop) -{ - if (ilevel == nlevels_respa-1) post_force(vflag); -} - -/* ---------------------------------------------------------------------- */ - -void FixWallColloid::min_post_force(int vflag) -{ - post_force(vflag); -} - -/* ---------------------------------------------------------------------- - energy of wall interaction -------------------------------------------------------------------------- */ - -double FixWallColloid::compute_scalar() -{ - // only sum across procs one time - - if (wall_flag == 0) { - MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); - wall_flag = 1; - } - return wall_all[0]; -} - -/* ---------------------------------------------------------------------- - components of force on wall -------------------------------------------------------------------------- */ - -double FixWallColloid::compute_vector(int n) -{ - // only sum across procs one time - - if (wall_flag == 0) { - MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); - wall_flag = 1; - } - return wall_all[n+1]; -} diff -Naur lammps-18Nov09/src/COLLOID/fix_wall_colloid.h lammps-19Nov09/src/COLLOID/fix_wall_colloid.h --- lammps-18Nov09/src/COLLOID/fix_wall_colloid.h 2009-11-06 16:24:54.000000000 -0700 +++ lammps-19Nov09/src/COLLOID/fix_wall_colloid.h 2009-11-17 17:59:12.000000000 -0700 @@ -14,31 +14,19 @@ #ifndef FIX_WALL_COLLOID_H #define FIX_WALL_COLLOID_H -#include "fix.h" +#include "fix_wall.h" namespace LAMMPS_NS { -class FixWallColloid : public Fix { +class FixWallColloid : public FixWall { public: FixWallColloid(class LAMMPS *, int, char **); - ~FixWallColloid() {} - int setmask(); void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + void precompute(int); + void wall_particle(int, double); private: - int dim,side,thermo_flag,eflag_enable; - double coord,hamaker,sigma,cutoff; - double coeff1,coeff2,coeff3,coeff4,offset; - double wall[4],wall_all[4]; - int wall_flag; - int nlevels_respa; + double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6]; }; } diff -Naur lammps-18Nov09/src/fix_wall.cpp lammps-19Nov09/src/fix_wall.cpp --- lammps-18Nov09/src/fix_wall.cpp 1969-12-31 17:00:00.000000000 -0700 +++ lammps-19Nov09/src/fix_wall.cpp 2009-11-18 09:51:03.000000000 -0700 @@ -0,0 +1,273 @@ +/* ---------------------------------------------------------------------- + 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 "math.h" +#include "stdlib.h" +#include "string.h" +#include "fix_wall.h" +#include "atom.h" +#include "domain.h" +#include "lattice.h" +#include "update.h" +#include "output.h" +#include "respa.h" +#include "error.h" + +using namespace LAMMPS_NS; + +enum{XLO,XHI,YLO,YHI,ZLO,ZHI}; + +/* ---------------------------------------------------------------------- */ + +FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg) +{ + scalar_flag = 1; + vector_flag = 1; + size_vector = 6; + scalar_vector_freq = 1; + extscalar = 1; + extvector = 1; + + // parse args + + for (int m = 0; m < 6; m++) wallflag[m] = 0; + velflag = 0; + wigflag = 0; + int scaleflag = 1; + + int iarg = 3; + while (iarg < narg) { + if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) || + (strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) || + (strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) { + if (iarg+5 > narg) error->all("Illegal fix wall command"); + int m; + if (strcmp(arg[iarg],"xlo") == 0) m = XLO; + else if (strcmp(arg[iarg],"xhi") == 0) m = XHI; + else if (strcmp(arg[iarg],"ylo") == 0) m = YLO; + else if (strcmp(arg[iarg],"yhi") == 0) m = YHI; + else if (strcmp(arg[iarg],"zlo") == 0) m = ZLO; + else if (strcmp(arg[iarg],"zhi") == 0) m = ZHI; + wallflag[m] = 1; + coord0[m] = atof(arg[iarg+1]); + epsilon[m] = atof(arg[iarg+2]); + sigma[m] = atof(arg[iarg+3]); + cutoff[m] = atof(arg[iarg+4]); + iarg += 5; + } else if (strcmp(arg[iarg],"vel") == 0) { + if (iarg+2 > narg) error->all("Illegal fix wall command"); + velflag = 1; + double vtmp = atof(arg[iarg+1]); + for (int m = 0; m < 6; m++) vel[m] = vtmp; + iarg += 2; + } else if (strcmp(arg[iarg],"wiggle/sin") == 0) { + if (iarg+3 > narg) error->all("Illegal fix wall command"); + wigflag = 1; + double atmp = atof(arg[iarg+1]); + period = atof(arg[iarg+2]); + for (int m = 0; m < 6; m++) amplitude[m] = atmp; + iarg += 3; + } else if (strcmp(arg[iarg],"wiggle/cos") == 0) { + if (iarg+3 > narg) error->all("Illegal fix wall command"); + wigflag = 2; + double atmp = atof(arg[iarg+1]); + period = atof(arg[iarg+2]); + for (int m = 0; m < 6; m++) amplitude[m] = atmp; + iarg += 3; + } else if (strcmp(arg[iarg],"units") == 0) { + if (iarg+2 > narg) error->all("Illegal fix wall command"); + if (strcmp(arg[iarg+1],"box") == 0) scaleflag = 0; + else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1; + else error->all("Illegal fix wall command"); + iarg += 2; + } else error->all("Illegal fix wall command"); + } + + // error check + + int flag = 0; + for (int m = 0; m < 6; m++) if (wallflag[m]) flag = 1; + if (!flag) error->all("Illegal fix wall command"); + + if (velflag && wigflag) + error->all("Cannot set both vel and wiggle in fix wall command"); + + if ((wallflag[XLO] || wallflag[XHI]) && domain->xperiodic) + error->all("Cannot use fix wall in periodic dimension"); + if ((wallflag[YLO] || wallflag[YHI]) && domain->yperiodic) + error->all("Cannot use fix wall in periodic dimension"); + if ((wallflag[ZLO] || wallflag[ZHI]) && domain->xperiodic) + error->all("Cannot use fix wall in periodic zimension"); + + if ((wallflag[ZLO] || wallflag[ZHI]) && domain->dimension == 2) + error->all("Cannot use fix wall zlo/zhi for a 2d simulation"); + + // setup scaling + + if (scaleflag && domain->lattice == NULL) + error->all("Use of fix wall with undefined lattice"); + + double xscale,yscale,zscale; + if (scaleflag) { + xscale = domain->lattice->xlattice; + yscale = domain->lattice->ylattice; + zscale = domain->lattice->zlattice; + } + else xscale = yscale = zscale = 1.0; + + // apply scaling factors to coord0, vel, amplitude + + double scale; + for (int m = 0; m < 6; m++) { + if (wallflag[m] == 0) continue; + if (m < 2) scale = xscale; + else if (m < 4) scale = yscale; + else scale = zscale; + coord0[m] *= scale; + if (velflag) vel[m] *= scale; + if (wigflag) amplitude[m] *= scale; + } + + // setup oscillations + + if (wigflag) { + double PI = 4.0 * atan(1.0); + omega = 2.0*PI / period; + } + + eflag = 0; + for (int m = 0; m < 7; m++) ewall[m] = 0.0; +} + +/* ---------------------------------------------------------------------- */ + +int FixWall::setmask() +{ + int mask = 0; + mask |= POST_FORCE; + mask |= THERMO_ENERGY; + mask |= POST_FORCE_RESPA; + mask |= MIN_POST_FORCE; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixWall::init() +{ + dt = update->dt; + + // setup coefficients + + for (int m = 0; m < 6; m++) + if (wallflag[m]) precompute(m); + + if (strcmp(update->integrate_style,"respa") == 0) + nlevels_respa = ((Respa *) update->integrate)->nlevels; +} + +/* ---------------------------------------------------------------------- */ + +void FixWall::setup(int vflag) +{ + if (strcmp(update->integrate_style,"verlet") == 0) + post_force(vflag); + else { + ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); + post_force_respa(vflag,nlevels_respa-1,0); + ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixWall::min_setup(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixWall::post_force(int vflag) +{ + eflag = 0; + for (int m = 0; m < 7; m++) ewall[m] = 0.0; + + // coord0 = initial position of wall + // coord = current position of wall + + double delta = (update->ntimestep - update->beginstep) * dt; + double coord; + + for (int m = 0; m < 6; m++) { + if (wallflag[m] == 0) continue; + + if (velflag) { + if (m % 2 == 0) coord = coord0[m] + delta*vel[m]; + else coord = coord0[m] - delta*vel[m]; + } else if (wigflag == 1) { + if (m % 2 == 0) coord = coord0[m] + amplitude[m]*sin(omega*delta); + else coord = coord0[m] - amplitude[m]*sin(omega*delta); + } else if (wigflag == 2) { + if (m % 2 == 0) coord = coord0[m] + amplitude[m]*(1.0-cos(omega*delta)); + else coord = coord0[m] - amplitude[m]*(1.0-cos(omega*delta)); + } else coord = coord0[m]; + + wall_particle(m,coord); + } +} + +/* ---------------------------------------------------------------------- */ + +void FixWall::post_force_respa(int vflag, int ilevel, int iloop) +{ + if (ilevel == nlevels_respa-1) post_force(vflag); +} + +/* ---------------------------------------------------------------------- */ + +void FixWall::min_post_force(int vflag) +{ + post_force(vflag); +} + +/* ---------------------------------------------------------------------- + energy of wall interaction +------------------------------------------------------------------------- */ + +double FixWall::compute_scalar() +{ + // only sum across procs one time + + if (eflag == 0) { + MPI_Allreduce(ewall,ewall_all,7,MPI_DOUBLE,MPI_SUM,world); + eflag = 1; + } + return ewall_all[0]; +} + +/* ---------------------------------------------------------------------- + components of force on wall +------------------------------------------------------------------------- */ + +double FixWall::compute_vector(int n) +{ + // only sum across procs one time + + if (eflag == 0) { + MPI_Allreduce(ewall,ewall_all,7,MPI_DOUBLE,MPI_SUM,world); + eflag = 1; + } + return ewall_all[n+1]; +} diff -Naur lammps-18Nov09/src/fix_wall.h lammps-19Nov09/src/fix_wall.h --- lammps-18Nov09/src/fix_wall.h 1969-12-31 17:00:00.000000000 -0700 +++ lammps-19Nov09/src/fix_wall.h 2009-11-18 09:23:15.000000000 -0700 @@ -0,0 +1,52 @@ +/* ---------------------------------------------------------------------- + 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. +------------------------------------------------------------------------- */ + +#ifndef FIX_WALL_H +#define FIX_WALL_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixWall : public Fix { + public: + FixWall(class LAMMPS *, int, char **); + virtual ~FixWall() {} + int setmask(); + virtual void init(); + void setup(int); + void min_setup(int); + void post_force(int); + void post_force_respa(int, int, int); + void min_post_force(int); + double compute_scalar(); + double compute_vector(int); + + virtual void precompute(int) = 0; + virtual void wall_particle(int, double) = 0; + + protected: + int wallflag[6]; + double coord0[6],epsilon[6],sigma[6],cutoff[6]; + int velflag,wigflag; + double vel[6],amplitude[6]; + double period,omega; + int eflag; + double ewall[7],ewall_all[7]; + int nlevels_respa; + double dt; +}; + +} + +#endif diff -Naur lammps-18Nov09/src/fix_wall_lj126.cpp lammps-19Nov09/src/fix_wall_lj126.cpp --- lammps-18Nov09/src/fix_wall_lj126.cpp 2009-08-18 12:11:26.000000000 -0600 +++ lammps-19Nov09/src/fix_wall_lj126.cpp 2009-11-18 09:01:25.000000000 -0700 @@ -11,212 +11,58 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -/* ---------------------------------------------------------------------- - Contributing author: Mark Stevens (SNL) -------------------------------------------------------------------------- */ - #include "math.h" -#include "stdlib.h" -#include "string.h" #include "fix_wall_lj126.h" #include "atom.h" -#include "domain.h" -#include "update.h" -#include "output.h" -#include "respa.h" -#include "error.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -FixWallLJ126::FixWallLJ126(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) -{ - if (narg < 8) error->all("Illegal fix wall/lj126 command"); - - scalar_flag = 1; - vector_flag = 1; - size_vector = 3; - scalar_vector_freq = 1; - extscalar = 1; - extvector = 1; - - // set defaults - - if (strcmp(arg[3],"xlo") == 0) { - dim = 0; - side = -1; - } else if (strcmp(arg[3],"xhi") == 0) { - dim = 0; - side = 1; - } else if (strcmp(arg[3],"ylo") == 0) { - dim = 1; - side = -1; - } else if (strcmp(arg[3],"yhi") == 0) { - dim = 1; - side = 1; - } else if (strcmp(arg[3],"zlo") == 0) { - dim = 2; - side = -1; - } else if (strcmp(arg[3],"zhi") == 0) { - dim = 2; - side = 1; - } else error->all("Illegal fix wall/lj126 command"); - - coord0 = atof(arg[4]); - epsilon = atof(arg[5]); - sigma = atof(arg[6]); - cutoff = atof(arg[7]); - - // read options - - vel = 0.0; - - int iarg = 8; - while (iarg < narg) { - if (strcmp(arg[iarg],"vel") == 0) { - if (iarg+2 > narg) error->all("Illegal fix wall/lj126 command"); - vel = atof(arg[iarg+1]); - iarg += 2; - } else error->all("Illegal fix wall/lj126 command"); - } - - coeff1 = 48.0 * epsilon * pow(sigma,12.0); - coeff2 = 24.0 * epsilon * pow(sigma,6.0); - coeff3 = 4.0 * epsilon * pow(sigma,12.0); - coeff4 = 4.0 * epsilon * pow(sigma,6.0); - - double r2inv = 1.0/(cutoff*cutoff); - double r6inv = r2inv*r2inv*r2inv; - offset = r6inv*(coeff3*r6inv - coeff4); - - if (dim == 0 && domain->xperiodic) - error->all("Cannot use wall in periodic dimension"); - if (dim == 1 && domain->yperiodic) - error->all("Cannot use wall in periodic dimension"); - if (dim == 2 && domain->zperiodic) - error->all("Cannot use wall in periodic dimension"); - - wall_flag = 0; - wall[0] = wall[1] = wall[2] = wall[3] = 0.0; -} - -/* ---------------------------------------------------------------------- */ - -int FixWallLJ126::setmask() -{ - int mask = 0; - mask |= POST_FORCE; - mask |= THERMO_ENERGY; - mask |= POST_FORCE_RESPA; - mask |= MIN_POST_FORCE; - return mask; -} +FixWallLJ126::FixWallLJ126(LAMMPS *lmp, int narg, char **arg) : + FixWall(lmp, narg, arg) {} /* ---------------------------------------------------------------------- */ -void FixWallLJ126::init() +void FixWallLJ126::precompute(int m) { - if (strcmp(update->integrate_style,"respa") == 0) - nlevels_respa = ((Respa *) update->integrate)->nlevels; -} + coeff1[m] = 48.0 * epsilon[m] * pow(sigma[m],12.0); + coeff2[m] = 24.0 * epsilon[m] * pow(sigma[m],6.0); + coeff3[m] = 4.0 * epsilon[m] * pow(sigma[m],12.0); + coeff4[m] = 4.0 * epsilon[m] * pow(sigma[m],6.0); -/* ---------------------------------------------------------------------- */ - -void FixWallLJ126::setup(int vflag) -{ - if (strcmp(update->integrate_style,"verlet") == 0) - post_force(vflag); - else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); - post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); - } + double r2inv = 1.0/(cutoff[m]*cutoff[m]); + double r6inv = r2inv*r2inv*r2inv; + offset[m] = r6inv*(coeff3[m]*r6inv - coeff4[m]); } /* ---------------------------------------------------------------------- */ -void FixWallLJ126::min_setup(int vflag) +void FixWallLJ126::wall_particle(int m, double coord) { - post_force(vflag); -} - -/* ---------------------------------------------------------------------- */ + double delta,rinv,r2inv,r6inv,fwall; -void FixWallLJ126::post_force(int vflag) -{ double **x = atom->x; double **f = atom->f; int *mask = atom->mask; int nlocal = atom->nlocal; - double delta,rinv,r2inv,r6inv,fwall; - wall[0] = wall[1] = wall[2] = wall[3] = 0.0; - wall_flag = 0; - - // coord = current position of wall - // coord0 = initial position of wall - - double delt = (update->ntimestep - update->beginstep) * update->dt; - double coord = coord0 + delt*vel; + int dim = m/2; + int side = m % 2; + if (side == 0) side = -1; for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { - if (side == -1) delta = x[i][dim] - coord; + if (side < 0) delta = x[i][dim] - coord; else delta = coord - x[i][dim]; if (delta <= 0.0) continue; - if (delta > cutoff) continue; + if (delta > cutoff[m]) continue; rinv = 1.0/delta; r2inv = rinv*rinv; r6inv = r2inv*r2inv*r2inv; - fwall = side * r6inv*(coeff1*r6inv - coeff2) * rinv; + fwall = side * r6inv*(coeff1[m]*r6inv - coeff2[m]) * rinv; f[i][dim] -= fwall; - wall[0] += r6inv*(coeff3*r6inv - coeff4) - offset; - wall[dim+1] += fwall; + ewall[0] += r6inv*(coeff3[m]*r6inv - coeff4[m]) - offset[m]; + ewall[m+1] += fwall; } } - -/* ---------------------------------------------------------------------- */ - -void FixWallLJ126::post_force_respa(int vflag, int ilevel, int iloop) -{ - if (ilevel == nlevels_respa-1) post_force(vflag); -} - -/* ---------------------------------------------------------------------- */ - -void FixWallLJ126::min_post_force(int vflag) -{ - post_force(vflag); -} - -/* ---------------------------------------------------------------------- - energy of wall interaction -------------------------------------------------------------------------- */ - -double FixWallLJ126::compute_scalar() -{ - // only sum across procs one time - - if (wall_flag == 0) { - MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); - wall_flag = 1; - } - return wall_all[0]; -} - -/* ---------------------------------------------------------------------- - components of force on wall -------------------------------------------------------------------------- */ - -double FixWallLJ126::compute_vector(int n) -{ - // only sum across procs one time - - if (wall_flag == 0) { - MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); - wall_flag = 1; - } - return wall_all[n+1]; -} diff -Naur lammps-18Nov09/src/fix_wall_lj126.h lammps-19Nov09/src/fix_wall_lj126.h --- lammps-18Nov09/src/fix_wall_lj126.h 2008-10-03 20:38:52.000000000 -0600 +++ lammps-19Nov09/src/fix_wall_lj126.h 2009-11-17 17:59:12.000000000 -0700 @@ -14,34 +14,19 @@ #ifndef FIX_WALL_LJ126_H #define FIX_WALL_LJ126_H -#include "fix.h" +#include "fix_wall.h" namespace LAMMPS_NS { -class FixWallLJ126 : public Fix { +class FixWallLJ126 : public FixWall { public: FixWallLJ126(class LAMMPS *, int, char **); - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + void precompute(int); + void wall_particle(int, double); private: - int dim,side,thermo_flag,eflag_enable; - double coord,epsilon,sigma,cutoff; - double coeff1,coeff2,coeff3,coeff4,offset; - double wall[4],wall_all[4]; - double vel,coord0; - int wall_flag; - int nlevels_respa; + double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6]; }; #endif } - - diff -Naur lammps-18Nov09/src/fix_wall_lj93.cpp lammps-19Nov09/src/fix_wall_lj93.cpp --- lammps-18Nov09/src/fix_wall_lj93.cpp 2009-08-18 12:11:26.000000000 -0600 +++ lammps-19Nov09/src/fix_wall_lj93.cpp 2009-11-18 09:51:03.000000000 -0700 @@ -12,209 +12,60 @@ ------------------------------------------------------------------------- */ #include "math.h" -#include "stdlib.h" -#include "string.h" #include "fix_wall_lj93.h" #include "atom.h" -#include "domain.h" -#include "update.h" -#include "output.h" -#include "respa.h" -#include "error.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -FixWallLJ93::FixWallLJ93(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg) -{ - if (narg < 8) error->all("Illegal fix wall/lj93 command"); - - scalar_flag = 1; - vector_flag = 1; - size_vector = 3; - scalar_vector_freq = 1; - extscalar = 1; - extvector = 1; - - // set defaults - - if (strcmp(arg[3],"xlo") == 0) { - dim = 0; - side = -1; - } else if (strcmp(arg[3],"xhi") == 0) { - dim = 0; - side = 1; - } else if (strcmp(arg[3],"ylo") == 0) { - dim = 1; - side = -1; - } else if (strcmp(arg[3],"yhi") == 0) { - dim = 1; - side = 1; - } else if (strcmp(arg[3],"zlo") == 0) { - dim = 2; - side = -1; - } else if (strcmp(arg[3],"zhi") == 0) { - dim = 2; - side = 1; - } else error->all("Illegal fix wall/lj93 command"); - - coord0 = atof(arg[4]); - epsilon = atof(arg[5]); - sigma = atof(arg[6]); - cutoff = atof(arg[7]); - - // read options - - vel = 0.0; - - int iarg = 8; - while (iarg < narg) { - if (strcmp(arg[iarg],"vel") == 0) { - if (iarg+2 > narg) error->all("Illegal fix wall/lj93 command"); - vel = atof(arg[iarg+1]); - iarg += 2; - } else error->all("Illegal fix wall/lj93 command"); - } - - coeff1 = 6.0/5.0 * epsilon * pow(sigma,9.0); - coeff2 = 3.0 * epsilon * pow(sigma,3.0); - coeff3 = 2.0/15.0 * epsilon * pow(sigma,9.0); - coeff4 = epsilon * pow(sigma,3.0); - - double rinv = 1.0/cutoff; - double r2inv = rinv*rinv; - double r4inv = r2inv*r2inv; - offset = coeff3*r4inv*r4inv*rinv - coeff4*r2inv*rinv; - - if (dim == 0 && domain->xperiodic) - error->all("Cannot use wall in periodic dimension"); - if (dim == 1 && domain->yperiodic) - error->all("Cannot use wall in periodic dimension"); - if (dim == 2 && domain->zperiodic) - error->all("Cannot use wall in periodic dimension"); - - wall_flag = 0; - wall[0] = wall[1] = wall[2] = wall[3] = 0.0; -} +FixWallLJ93::FixWallLJ93(LAMMPS *lmp, int narg, char **arg) : + FixWall(lmp, narg, arg) {} /* ---------------------------------------------------------------------- */ -int FixWallLJ93::setmask() +void FixWallLJ93::precompute(int m) { - int mask = 0; - mask |= POST_FORCE; - mask |= THERMO_ENERGY; - mask |= POST_FORCE_RESPA; - mask |= MIN_POST_FORCE; - return mask; -} - -/* ---------------------------------------------------------------------- */ + coeff1[m] = 6.0/5.0 * epsilon[m] * pow(sigma[m],9.0); + coeff2[m] = 3.0 * epsilon[m] * pow(sigma[m],3.0); + coeff3[m] = 2.0/15.0 * epsilon[m] * pow(sigma[m],9.0); + coeff4[m] = epsilon[m] * pow(sigma[m],3.0); -void FixWallLJ93::init() -{ - if (strcmp(update->integrate_style,"respa") == 0) - nlevels_respa = ((Respa *) update->integrate)->nlevels; -} - -/* ---------------------------------------------------------------------- */ - -void FixWallLJ93::setup(int vflag) -{ - if (strcmp(update->integrate_style,"verlet") == 0) - post_force(vflag); - else { - ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); - post_force_respa(vflag,nlevels_respa-1,0); - ((Respa *) update->integrate)->copy_f_flevel(nlevels_respa-1); - } + double rinv = 1.0/cutoff[m]; + double r2inv = rinv*rinv; + double r4inv = r2inv*r2inv; + offset[m] = coeff3[m]*r4inv*r4inv*rinv - coeff4[m]*r2inv*rinv; } /* ---------------------------------------------------------------------- */ -void FixWallLJ93::min_setup(int vflag) +void FixWallLJ93::wall_particle(int m, double coord) { - post_force(vflag); -} - -/* ---------------------------------------------------------------------- */ + double delta,rinv,r2inv,r4inv,r10inv,fwall; -void FixWallLJ93::post_force(int vflag) -{ double **x = atom->x; double **f = atom->f; int *mask = atom->mask; int nlocal = atom->nlocal; - double delta,rinv,r2inv,r4inv,r10inv,fwall; - wall[0] = wall[1] = wall[2] = wall[3] = 0.0; - wall_flag = 0; - - // coord = current position of wall - // coord0 = initial position of wall - - double delt = (update->ntimestep - update->beginstep) * update->dt; - double coord = coord0 + delt*vel; + int dim = m/2; + int side = m % 2; + if (side == 0) side = -1; for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) { - if (side == -1) delta = x[i][dim] - coord; + if (side < 0) delta = x[i][dim] - coord; else delta = coord - x[i][dim]; if (delta <= 0.0) continue; - if (delta > cutoff) continue; + if (delta > cutoff[m]) continue; rinv = 1.0/delta; r2inv = rinv*rinv; r4inv = r2inv*r2inv; r10inv = r4inv*r4inv*r2inv; - fwall = (coeff1*r10inv - coeff2*r4inv) * side; + fwall = side * (coeff1[m]*r10inv - coeff2[m]*r4inv); f[i][dim] -= fwall; - wall[0] += coeff3*r4inv*r4inv*rinv - coeff4*r2inv*rinv - offset; - wall[dim+1] += fwall; + ewall[0] += coeff3[m]*r4inv*r4inv*rinv - + coeff4[m]*r2inv*rinv - offset[m]; + ewall[m+1] += fwall; } } - -/* ---------------------------------------------------------------------- */ - -void FixWallLJ93::post_force_respa(int vflag, int ilevel, int iloop) -{ - if (ilevel == nlevels_respa-1) post_force(vflag); -} - -/* ---------------------------------------------------------------------- */ - -void FixWallLJ93::min_post_force(int vflag) -{ - post_force(vflag); -} - -/* ---------------------------------------------------------------------- - energy of wall interaction -------------------------------------------------------------------------- */ - -double FixWallLJ93::compute_scalar() -{ - // only sum across procs one time - - if (wall_flag == 0) { - MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); - wall_flag = 1; - } - return wall_all[0]; -} - -/* ---------------------------------------------------------------------- - components of force on wall -------------------------------------------------------------------------- */ - -double FixWallLJ93::compute_vector(int n) -{ - // only sum across procs one time - - if (wall_flag == 0) { - MPI_Allreduce(wall,wall_all,4,MPI_DOUBLE,MPI_SUM,world); - wall_flag = 1; - } - return wall_all[n+1]; -} diff -Naur lammps-18Nov09/src/fix_wall_lj93.h lammps-19Nov09/src/fix_wall_lj93.h --- lammps-18Nov09/src/fix_wall_lj93.h 2008-10-03 20:38:52.000000000 -0600 +++ lammps-19Nov09/src/fix_wall_lj93.h 2009-11-17 17:59:12.000000000 -0700 @@ -14,32 +14,18 @@ #ifndef FIX_WALL_LJ93_H #define FIX_WALL_LJ93_H -#include "fix.h" +#include "fix_wall.h" namespace LAMMPS_NS { -class FixWallLJ93 : public Fix { +class FixWallLJ93 : public FixWall { public: FixWallLJ93(class LAMMPS *, int, char **); - ~FixWallLJ93() {} - int setmask(); - void init(); - void setup(int); - void min_setup(int); - void post_force(int); - void post_force_respa(int, int, int); - void min_post_force(int); - double compute_scalar(); - double compute_vector(int); + void precompute(int); + void wall_particle(int, double); private: - int dim,side,thermo_flag,eflag_enable; - double coord,epsilon,sigma,cutoff; - double coeff1,coeff2,coeff3,coeff4,offset; - double wall[4],wall_all[4]; - double vel,coord0; - int wall_flag; - int nlevels_respa; + double coeff1[6],coeff2[6],coeff3[6],coeff4[6],offset[6]; }; }