diff -Naur lammps-1Oct08/doc/fix_indent.html lammps-2Oct08/doc/fix_indent.html --- lammps-1Oct08/doc/fix_indent.html 2008-01-17 10:02:19.000000000 -0700 +++ lammps-2Oct08/doc/fix_indent.html 2008-10-01 10:01:49.000000000 -0600 @@ -23,15 +23,19 @@
sphere args = x y z R
- x,y,z = initial position of center of indenter
+ x,y,z = initial position of center of indenter (distance units)
R = sphere radius of indenter (distance units)
cylinder args = dim c1 c2 R
- dim = x or y or z = axis of cylinder
+ dim = x or y or z = axis of cylinder
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
R = cylinder radius of indenter (distance units)
+ plane args = dim pos side
+ dim = x or y or z = plane perpendicular to this dimension
+ pos = position of plane in dimension x, y, or z (distance units)
+ side = lo or hi
vel args = vx vy vz
vx,vy,vz = velocity of center of indenter (velocity units)
rstart value = R0
@@ -54,8 +58,8 @@
atoms that touch it, so it can be used to push into a material or as
an obstacle in a flow.
-The indenter can either be spherical or cylindrical. You must set
-one of those 2 keywords.
+
The indenter can either be spherical or cylindrical or planar. You
+must set one of those 3 keywords.
A spherical indenter exerts a force of magnitude
@@ -70,12 +74,20 @@
distance from the atom to the center axis of the cylinder. The
cylinder extends infinitely along its axis.
-If the vel keyword is specified, the center (or axis) of the
-spherical (or cylindrical) indenter will move during the simulation,
-based on its initial position (x,y,z) and the specified (vx,vy,vz).
-Note that if you do multiple runs, the initial position of the
-indenter (x,y,z) does not change, so it will continue to move at the
-specified velocity.
+
A planar indenter is really an axis-aligned infinite-extent wall
+exerting the same force on atoms in the system, where r is the
+distance from the plane. If the side parameter of the plane is
+specified as lo then it will indent from the lo end of the
+simulation box, meaning that atoms with a coordinate less than the
+plane's current position will be pushed towards the hi end of the box.
+Vice versa if side is specified as hi.
+
+If the vel keyword is specified, the center (or axis or position) of
+the spherical (or cylindrical or planar) indenter will move during the
+simulation, based on its initial position (x,y,z) and the specified
+(vx,vy,vz). Note that if you do multiple runs, the initial position
+of the indenter (x,y,z) does not change, so it will continue to move
+at the specified velocity.
If the rstart keyword is specified, then the radius of the indenter
is a time-dependent quantity. R0 is the value assigned at the start
@@ -94,9 +106,10 @@
velocity and force constant since they are defined in terms of
distance as well.
-IMPORTANT NOTE: You should insure the indenter's extent does not
-overlap a periodic boundary, either for a fixed indenter, or one that
-moves. No check for such overlaps is performed by the code.
+
IMPORTANT NOTE: For spherical and cylindrical indenters, you should
+insure the indenter's extent does not overlap a periodic boundary,
+either for a fixed indenter, or one that moves. No check for such
+overlaps is performed by the code.
Restart, fix_modify, output, run start/stop, minimize info:
diff -Naur lammps-1Oct08/doc/fix_indent.txt lammps-2Oct08/doc/fix_indent.txt
--- lammps-1Oct08/doc/fix_indent.txt 2008-01-17 10:02:19.000000000 -0700
+++ lammps-2Oct08/doc/fix_indent.txt 2008-10-01 10:01:49.000000000 -0600
@@ -16,14 +16,18 @@
indent = style name of this fix command :l
k = force constant for indenter surface (force/distance^2 units) :l
one or more keyword/value pairs may be appended :l
-keyword = {sphere} or {cylinder} or {vel} or {rstart} or {units} :l
+keyword = {sphere} or {cylinder} or {plane} or {vel} or {rstart} or {units} :l
{sphere} args = x y z R
- x,y,z = initial position of center of indenter
+ x,y,z = initial position of center of indenter (distance units)
R = sphere radius of indenter (distance units)
{cylinder} args = dim c1 c2 R
- dim = x or y or z = axis of cylinder
+ dim = {x} or {y} or {z} = axis of cylinder
c1,c2 = coords of cylinder axis in other 2 dimensions (distance units)
R = cylinder radius of indenter (distance units)
+ {plane} args = dim pos side
+ dim = {x} or {y} or {z} = plane perpendicular to this dimension
+ pos = position of plane in dimension x, y, or z (distance units)
+ side = {lo} or {hi}
{vel} args = vx vy vz
vx,vy,vz = velocity of center of indenter (velocity units)
{rstart} value = R0
@@ -45,8 +49,8 @@
atoms that touch it, so it can be used to push into a material or as
an obstacle in a flow.
-The indenter can either be spherical or cylindrical. You must set
-one of those 2 keywords.
+The indenter can either be spherical or cylindrical or planar. You
+must set one of those 3 keywords.
A spherical indenter exerts a force of magnitude
@@ -61,12 +65,20 @@
distance from the atom to the center axis of the cylinder. The
cylinder extends infinitely along its axis.
-If the {vel} keyword is specified, the center (or axis) of the
-spherical (or cylindrical) indenter will move during the simulation,
-based on its initial position (x,y,z) and the specified (vx,vy,vz).
-Note that if you do multiple runs, the initial position of the
-indenter (x,y,z) does not change, so it will continue to move at the
-specified velocity.
+A planar indenter is really an axis-aligned infinite-extent wall
+exerting the same force on atoms in the system, where {r} is the
+distance from the plane. If the {side} parameter of the plane is
+specified as {lo} then it will indent from the lo end of the
+simulation box, meaning that atoms with a coordinate less than the
+plane's current position will be pushed towards the hi end of the box.
+Vice versa if {side} is specified as {hi}.
+
+If the {vel} keyword is specified, the center (or axis or position) of
+the spherical (or cylindrical or planar) indenter will move during the
+simulation, based on its initial position (x,y,z) and the specified
+(vx,vy,vz). Note that if you do multiple runs, the initial position
+of the indenter (x,y,z) does not change, so it will continue to move
+at the specified velocity.
If the {rstart} keyword is specified, then the radius of the indenter
is a time-dependent quantity. R0 is the value assigned at the start
@@ -85,9 +97,10 @@
velocity and force constant since they are defined in terms of
distance as well.
-IMPORTANT NOTE: You should insure the indenter's extent does not
-overlap a periodic boundary, either for a fixed indenter, or one that
-moves. No check for such overlaps is performed by the code.
+IMPORTANT NOTE: For spherical and cylindrical indenters, you should
+insure the indenter's extent does not overlap a periodic boundary,
+either for a fixed indenter, or one that moves. No check for such
+overlaps is performed by the code.
[Restart, fix_modify, output, run start/stop, minimize info:]
diff -Naur lammps-1Oct08/doc/fix_wall_lj126.txt lammps-2Oct08/doc/fix_wall_lj126.txt
--- lammps-1Oct08/doc/fix_wall_lj126.txt 2008-01-02 12:25:15.000000000 -0700
+++ lammps-2Oct08/doc/fix_wall_lj126.txt 2008-10-01 10:07:35.000000000 -0600
@@ -26,9 +26,9 @@
[Description:]
-Bound the simulation domain with a Lennard-Jones wall that encloses
-the atoms. The energy E of a wall-particle interactions is given by
-the 12-6 potential
+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)
diff -Naur lammps-1Oct08/doc/fix_wall_lj93.txt lammps-2Oct08/doc/fix_wall_lj93.txt
--- lammps-1Oct08/doc/fix_wall_lj93.txt 2008-01-02 12:25:15.000000000 -0700
+++ lammps-2Oct08/doc/fix_wall_lj93.txt 2008-10-01 10:07:35.000000000 -0600
@@ -26,9 +26,9 @@
[Description:]
-Bound the simulation domain with a Lennard-Jones wall that encloses
-the atoms. The energy E of a wall-particle interactions is given by
-the 9-3 potential
+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)
diff -Naur lammps-1Oct08/src/fix_indent.cpp lammps-2Oct08/src/fix_indent.cpp
--- lammps-1Oct08/src/fix_indent.cpp 2008-01-09 14:56:57.000000000 -0700
+++ lammps-2Oct08/src/fix_indent.cpp 2008-10-01 10:01:41.000000000 -0600
@@ -29,7 +29,7 @@
using namespace LAMMPS_NS;
-enum{NONE,SPHERE,CYLINDER};
+enum{NONE,SPHERE,CYLINDER,PLANE};
/* ---------------------------------------------------------------------- */
@@ -103,6 +103,10 @@
r0_stop *= zscale;
r0_start *= zscale;
}
+ } else if (istyle == PLANE) {
+ if (cdim == 0) planepos *= xscale;
+ else if (cdim == 1) planepos *= yscale;
+ else if (cdim == 2) planepos *= zscale;
} else error->all("Illegal fix indent command");
indenter_flag = 0;
@@ -210,7 +214,7 @@
// cylindrical indenter
- } else {
+ } else if (istyle == CYLINDER) {
// c1new,c2new = current coords of indenter axis from original c1,c2
@@ -264,6 +268,35 @@
indenter[2] -= fy;
indenter[3] -= fz;
}
+
+ // planar indenter
+
+ } else {
+
+ // posnew = current coord of plane from original planepos
+
+ double delta = (update->ntimestep - update->beginstep) * update->dt;
+ double posnew;
+ if (cdim == 0) posnew = planepos + delta*vx;
+ else if (cdim == 1) posnew = planepos + delta*vy;
+ else if (cdim == 2) posnew = planepos + delta*vz;
+
+ double **x = atom->x;
+ double **f = atom->f;
+ int *mask = atom->mask;
+ int nlocal = atom->nlocal;
+
+ double dr,fatom;
+
+ for (int i = 0; i < nlocal; i++)
+ if (mask[i] & groupbit) {
+ dr = planeside * (posnew - x[i][cdim]);
+ if (dr >= 0.0) continue;
+ fatom = -planeside * k*dr*dr;
+ f[i][cdim] += fatom;
+ indenter[0] -= k3 * dr*dr*dr;
+ indenter[cdim+1] -= fatom;
+ }
}
}
@@ -340,6 +373,18 @@
r0_stop = atof(arg[iarg+4]);
istyle = CYLINDER;
iarg += 5;
+ } else if (strcmp(arg[iarg],"plane") == 0) {
+ if (iarg+4 > narg) error->all("Illegal fix indent command");
+ if (strcmp(arg[iarg+1],"x") == 0) cdim = 0;
+ else if (strcmp(arg[iarg+1],"y") == 0) cdim = 1;
+ else if (strcmp(arg[iarg+1],"z") == 0) cdim = 2;
+ else error->all("Illegal fix indent command");
+ planepos = atof(arg[iarg+2]);
+ if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1;
+ else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1;
+ else error->all("Illegal fix indent command");
+ istyle = PLANE;
+ iarg += 4;
} else if (strcmp(arg[iarg],"vel") == 0) {
if (iarg+4 > narg) error->all("Illegal fix indent command");
vx = atof(arg[iarg+1]);
diff -Naur lammps-1Oct08/src/fix_indent.h lammps-2Oct08/src/fix_indent.h
--- lammps-1Oct08/src/fix_indent.h 2008-07-29 11:12:38.000000000 -0600
+++ lammps-2Oct08/src/fix_indent.h 2008-10-01 10:01:41.000000000 -0600
@@ -34,8 +34,8 @@
private:
int istyle,scaleflag,radflag,thermo_flag,eflag_enable;
double k,k3;
- double x0,y0,z0,r0_stop,r0_start;
- int indenter_flag;
+ double x0,y0,z0,r0_stop,r0_start,planepos;
+ int indenter_flag,planeside;
double indenter[4],indenter_all[4];
int cdim;
double c1,c2;