Merge branch 'lammps-icms' into cle-orig

This commit is contained in:
Axel Kohlmeyer
2014-07-25 07:08:58 -04:00
19 changed files with 322 additions and 47 deletions

View File

@ -1,7 +1,7 @@
<HTML>
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="11 Jul 2014 version">
<META NAME="docnumber" CONTENT="22 Jul 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -22,7 +22,7 @@
<CENTER><H3>LAMMPS-ICMS Documentation
</H3></CENTER>
<CENTER><H4>11 Jul 2014 version
<CENTER><H4>22 Jul 2014 version
</H4></CENTER>
<H4>Version info:
</H4>

View File

@ -1,6 +1,6 @@
<HEAD>
<TITLE>LAMMPS-ICMS Users Manual</TITLE>
<META NAME="docnumber" CONTENT="11 Jul 2014 version">
<META NAME="docnumber" CONTENT="22 Jul 2014 version">
<META NAME="author" CONTENT="http://lammps.sandia.gov - Sandia National Laboratories">
<META NAME="copyright" CONTENT="Copyright (2003) Sandia Corporation. This software and manual is distributed under the GNU General Public License.">
</HEAD>
@ -18,7 +18,7 @@
<H1></H1>
LAMMPS-ICMS Documentation :c,h3
11 Jul 2014 version :c,h4
22 Jul 2014 version :c,h4
Version info: :h4

View File

@ -21,7 +21,7 @@
<LI>input = one or more atom attributes
<PRE> possible attributes = id, mol, type, mass,
<PRE> possible attributes = id, mol, proc, type, mass,
x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
vx, vy, vz, fx, fy, fz,
q, mux, muy, muz, mu,
@ -41,6 +41,7 @@
</PRE>
<PRE> id = atom ID
mol = molecule ID
proc = ID of processor that owns atom
type = atom type
mass = atom mass
x,y,z = unscaled atom coordinates
@ -104,8 +105,8 @@ variable</A> commands.
<P>The list of possible attributes is the same as that used by the <A HREF = "dump.html">dump
custom</A> command, which describes their meaning, with some
additional quantities that are only defined for certain <A HREF = "atom_style.html">atom
styles</A>. Basically, this list gives your input script
access to any per-atom quantity stored by LAMMPS.
styles</A>. Basically, this augmented list gives an
input script access to any per-atom quantity stored by LAMMPS.
</P>
<P>The values are stored in a per-atom vector or array as discussed
below. Zeroes are stored for atoms not in the specified group or for

View File

@ -15,7 +15,7 @@ compute ID group-ID property/atom input1 input2 ... :pre
ID, group-ID are documented in "compute"_compute.html command :ulb,l
property/atom = style name of this compute command :l
input = one or more atom attributes :l
possible attributes = id, mol, type, mass,
possible attributes = id, mol, proc, type, mass,
x, y, z, xs, ys, zs, xu, yu, zu, ix, iy, iz,
vx, vy, vz, fx, fy, fz,
q, mux, muy, muz, mu,
@ -34,6 +34,7 @@ input = one or more atom attributes :l
i_name, d_name :pre
id = atom ID
mol = molecule ID
proc = ID of processor that owns atom
type = atom type
mass = atom mass
x,y,z = unscaled atom coordinates
@ -96,8 +97,8 @@ variable"_variable.html commands.
The list of possible attributes is the same as that used by the "dump
custom"_dump.html command, which describes their meaning, with some
additional quantities that are only defined for certain "atom
styles"_atom_style.html. Basically, this list gives your input script
access to any per-atom quantity stored by LAMMPS.
styles"_atom_style.html. Basically, this augmented list gives an
input script access to any per-atom quantity stored by LAMMPS.
The values are stored in a per-atom vector or array as discussed
below. Zeroes are stored for atoms not in the specified group or for

View File

@ -68,6 +68,7 @@
</PRE>
<PRE> id = atom ID
mol = molecule ID
proc = ID of processor that owns atom
type = atom type
element = name of atom element, as defined by <A HREF = "dump_modify.html">dump_modify</A> command
mass = atom mass
@ -459,17 +460,18 @@ dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_1[3] c_2[1] c_2[2]
<P>This section explains the atom attributes that can be specified as
part of the <I>custom</I> and <I>cfg</I> styles.
</P>
<P>The <I>id</I>, <I>mol</I>, <I>type</I>, <I>element</I>, <I>mass</I>, <I>vx</I>, <I>vy</I>, <I>vz</I>, <I>fx</I>, <I>fy</I>,
<I>fz</I>, <I>q</I> attributes are self-explanatory.
<P>The <I>id</I>, <I>mol</I>, <I>proc</I>, <I>type</I>, <I>element</I>, <I>mass</I>, <I>vx</I>, <I>vy</I>, <I>vz</I>,
<I>fx</I>, <I>fy</I>, <I>fz</I>, <I>q</I> attributes are self-explanatory.
</P>
<P><I>Id</I> is the atom ID. <I>Mol</I> is the molecule ID, included in the data
file for molecular systems. <I>Type</I> is the atom type. <I>Element</I> is
typically the chemical name of an element, which you must assign to
each type via the <A HREF = "dump_modify.html">dump_modify element</A> command.
More generally, it can be any string you wish to associated with an
atom type. <I>Mass</I> is the atom mass. <I>Vx</I>, <I>vy</I>, <I>vz</I>, <I>fx</I>, <I>fy</I>,
<I>fz</I>, and <I>q</I> are components of atom velocity and force and atomic
charge.
file for molecular systems. <I>Proc</I> is the ID of the processor (0 to
Nprocs-1) that currently owns the atom. <I>Type</I> is the atom type.
<I>Element</I> is typically the chemical name of an element, which you must
assign to each type via the <A HREF = "dump_modify.html">dump_modify element</A>
command. More generally, it can be any string you wish to associated
with an atom type. <I>Mass</I> is the atom mass. <I>Vx</I>, <I>vy</I>, <I>vz</I>, <I>fx</I>,
<I>fy</I>, <I>fz</I>, and <I>q</I> are components of atom velocity and force and
atomic charge.
</P>
<P>There are several options for outputting atom coordinates. The <I>x</I>,
<I>y</I>, <I>z</I> attributes write atom coordinates "unscaled", in the

View File

@ -55,6 +55,7 @@ args = list of arguments for a particular style :l
id = atom ID
mol = molecule ID
proc = ID of processor that owns atom
type = atom type
element = name of atom element, as defined by "dump_modify"_dump_modify.html command
mass = atom mass
@ -76,7 +77,9 @@ args = list of arguments for a particular style :l
c_ID\[N\] = Nth column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID\[N\] = Nth column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre
v_name = per-atom vector calculated by an atom-style variable with name
d_name = per-atom floating point vector with name managed by fix property/atom
i_name = per-atom integer vector with name managed by fix property/atom :pre
:ule
[Examples:]
@ -444,17 +447,18 @@ dump 1 all local 1000 tmp.dump index c_1\[1\] c_1\[2\] c_1\[3\] c_2\[1\] c_2\[2\
This section explains the atom attributes that can be specified as
part of the {custom} and {cfg} styles.
The {id}, {mol}, {type}, {element}, {mass}, {vx}, {vy}, {vz}, {fx}, {fy},
{fz}, {q} attributes are self-explanatory.
The {id}, {mol}, {proc}, {type}, {element}, {mass}, {vx}, {vy}, {vz},
{fx}, {fy}, {fz}, {q} attributes are self-explanatory.
{Id} is the atom ID. {Mol} is the molecule ID, included in the data
file for molecular systems. {Type} is the atom type. {Element} is
typically the chemical name of an element, which you must assign to
each type via the "dump_modify element"_dump_modify.html command.
More generally, it can be any string you wish to associated with an
atom type. {Mass} is the atom mass. {Vx}, {vy}, {vz}, {fx}, {fy},
{fz}, and {q} are components of atom velocity and force and atomic
charge.
file for molecular systems. {Proc} is the ID of the processor (0 to
Nprocs-1) that currently owns the atom. {Type} is the atom type.
{Element} is typically the chemical name of an element, which you must
assign to each type via the "dump_modify element"_dump_modify.html
command. More generally, it can be any string you wish to associated
with an atom type. {Mass} is the atom mass. {Vx}, {vy}, {vz}, {fx},
{fy}, {fz}, and {q} are components of atom velocity and force and
atomic charge.
There are several options for outputting atom coordinates. The {x},
{y}, {z} attributes write atom coordinates "unscaled", in the
@ -547,6 +551,10 @@ invoke other computes, fixes, or variables when they are evaluated, so
this is a very general means of creating quantities to output to a
dump file.
The {d_name} and {i_name} attributes allow to output custom per atom
floating point or integer properties that are managed by
"fix property/atom"_fix_property_atom.html.
See "Section_modify"_Section_modify.html of the manual for information
on how to add new compute and fix styles to LAMMPS to calculate
per-atom quantities which could then be output into dump files.

View File

@ -21,8 +21,9 @@ input = one or more atom attributes :l
vx, vy, vz, fx, fy, fz,
q, mux, muy, muz,
radius, omegax, omegay, omegaz,
angmomx, angmomy, angmomz, tqx, tqy, tqz
c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name :pre
angmomx, angmomy, angmomz, tqx, tqy, tqz,
c_ID, c_ID\[N\], f_ID, f_ID\[N\], v_name,
d_name, i_name :pre
id = atom ID
mol = molecule ID
@ -44,7 +45,9 @@ input = one or more atom attributes :l
c_ID\[I\] = Ith column of per-atom array calculated by a compute with ID
f_ID = per-atom vector calculated by a fix with ID
f_ID\[I\] = Ith column of per-atom array calculated by a fix with ID
v_name = per-atom vector calculated by an atom-style variable with name :pre
v_name = per-atom vector calculated by an atom-style variable with name
d_name = per-atom floating point vector managed by fix property/atom
i_name = per-atom integer vector managed by fix property/atom :pre
zero or more keyword/value pairs may be appended :l
keyword = {com} :l
@ -120,7 +123,8 @@ minimization"_minimize.html.
[Related commands:]
"dump custom"_dump.html, "compute
property/atom"_compute_property_atom.html, "variable"_variable.html
property/atom"_compute_property_atom.html,
"fix property/atom"_fix_property_atom.html, "variable"_variable.html
[Default:]

View File

@ -29,7 +29,7 @@ molecule CO2 co2.txt
<P>Define a molecule template that can be used as part of other LAMMPS
commands, typically to define a collection of particles as a bonded
molecule or a rigid body. Commands that currently use molecule
templates (or will in the future) include:
templates include:
</P>
<UL><LI><A HREF = "fix_deposit.html">fix deposit</A>
<LI><A HREF = "fix_pour.html">fix pour</A>
@ -116,6 +116,12 @@ internally.
<LI><I>Special Bond Counts, Special Bonds</I> = special neighbor info
<LI><I>Shake Flags, Shake Atoms, Shake Bond Types</I> = SHAKE info
</UL>
<P>If a Bonds section is specified then the Special Bond Counts and
Special Bonds sections must be also, since the latter is needed for
LAMMPS to properly exclude or weight bonded pairwise interactions
between bonded atoms. See the <A HREF = "special_bonds.html">special_bonds</A>
command for more details.
</P>
<P>IMPORTANT NOTE: Whether a section is required depends on how the
molecule template is used by other LAMMPS commands. For example, to
add a molecule via the <A HREF = "fix_deposit.html">fix deposit</A> command, the

View File

@ -26,7 +26,7 @@ molecule CO2 co2.txt :pre
Define a molecule template that can be used as part of other LAMMPS
commands, typically to define a collection of particles as a bonded
molecule or a rigid body. Commands that currently use molecule
templates (or will in the future) include:
templates include:
"fix deposit"_fix_deposit.html
"fix pour"_fix_pour.html
@ -113,6 +113,12 @@ These are the allowed section keywords for the body of the file.
{Special Bond Counts, Special Bonds} = special neighbor info
{Shake Flags, Shake Atoms, Shake Bond Types} = SHAKE info :ul
If a Bonds section is specified then the Special Bond Counts and
Special Bonds sections must be also, since the latter is needed for
LAMMPS to properly exclude or weight bonded pairwise interactions
between bonded atoms. See the "special_bonds"_special_bonds.html
command for more details.
IMPORTANT NOTE: Whether a section is required depends on how the
molecule template is used by other LAMMPS commands. For example, to
add a molecule via the "fix deposit"_fix_deposit.html command, the

View File

@ -146,15 +146,21 @@ void quest_callback(void *ptr, bigint ntimestep,
double boxyhi = *((double *) lammps_extract_global(info->lmp,"boxyhi"));
double boxzlo = *((double *) lammps_extract_global(info->lmp,"boxzlo"));
double boxzhi = *((double *) lammps_extract_global(info->lmp,"boxzhi"));
double boxxy = *((double *) lammps_extract_global(info->lmp,"xy"));
double boxxz = *((double *) lammps_extract_global(info->lmp,"xz"));
double boxyz = *((double *) lammps_extract_global(info->lmp,"yz"));
double xprd = (boxxhi-boxxlo)/ANGSTROM_per_BOHR;
double yprd = (boxyhi-boxylo)/ANGSTROM_per_BOHR;
double zprd = (boxzhi-boxzlo)/ANGSTROM_per_BOHR;
double xy = boxxy/ANGSTROM_per_BOHR;
double xz = boxxz/ANGSTROM_per_BOHR;
double yz = boxyz/ANGSTROM_per_BOHR;
if (info->me == 0) {
sprintf(boxlines[0],"%g %g %g\n",xprd,0.0,0.0);
sprintf(boxlines[1],"%g %g %g\n",0.0,yprd,0.0);
sprintf(boxlines[2],"%g %g %g\n",0.0,0.0,zprd);
sprintf(boxlines[1],"%g %g %g\n",xy,yprd,0.0);
sprintf(boxlines[2],"%g %g %g\n",xz,yz,zprd);
}
// xlines = x for atoms on each proc converted to text lines

View File

@ -211,6 +211,11 @@ void PPPM::init()
error->all(FLERR,"KSpace style is incompatible with Pair style");
cutoff = *p_cutoff;
// a TIP4P pair style requires a matching long-range solver
if (!tip4pflag && force->pair->tip4pflag)
error->all(FLERR,"Using a TIP4P pair style without a "
"compatible kspace style");
// if kspace is TIP4P, extract TIP4P params from pair style
// bond/angle are not yet init(), so insure equilibrium request is valid

View File

@ -23,6 +23,7 @@
#include "atom_vec_body.h"
#include "update.h"
#include "domain.h"
#include "comm.h"
#include "memory.h"
#include "error.h"
@ -57,6 +58,8 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Compute property/atom for "
"atom property that isn't allocated");
pack_choice[i] = &ComputePropertyAtom::pack_molecule;
} else if (strcmp(arg[iarg],"proc") == 0) {
pack_choice[i] = &ComputePropertyAtom::pack_proc;
} else if (strcmp(arg[iarg],"type") == 0) {
pack_choice[i] = &ComputePropertyAtom::pack_type;
} else if (strcmp(arg[iarg],"mass") == 0) {
@ -455,6 +458,21 @@ void ComputePropertyAtom::pack_molecule(int n)
/* ---------------------------------------------------------------------- */
void ComputePropertyAtom::pack_proc(int n)
{
int *mask = atom->mask;
int nlocal = atom->nlocal;
int me = comm->me;
for (int i = 0; i < nlocal; i++) {
if (mask[i] & groupbit) buf[n] = me;
else buf[n] = 0.0;
n += nvalues;
}
}
/* ---------------------------------------------------------------------- */
void ComputePropertyAtom::pack_type(int n)
{
int *type = atom->type;

View File

@ -49,6 +49,7 @@ class ComputePropertyAtom : public Compute {
void pack_id(int);
void pack_molecule(int);
void pack_proc(int);
void pack_type(int);
void pack_mass(int);

View File

@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
// customize by adding keyword
// also customize compute_atom_property.cpp
enum{ID,MOL,TYPE,ELEMENT,MASS,
enum{ID,MOL,PROC,TYPE,ELEMENT,MASS,
X,Y,Z,XS,YS,ZS,XSTRI,YSTRI,ZSTRI,XU,YU,ZU,XUTRI,YUTRI,ZUTRI,
XSU,YSU,ZSU,XSUTRI,YSUTRI,ZSUTRI,
IX,IY,IZ,
@ -42,7 +42,7 @@ enum{ID,MOL,TYPE,ELEMENT,MASS,
Q,MUX,MUY,MUZ,MU,RADIUS,DIAMETER,
OMEGAX,OMEGAY,OMEGAZ,ANGMOMX,ANGMOMY,ANGMOMZ,
TQX,TQY,TQZ,
COMPUTE,FIX,VARIABLE};
COMPUTE,FIX,VARIABLE,INAME,DNAME};
enum{LT,LE,GT,GE,EQ,NEQ};
enum{INT,DOUBLE,STRING,BIGINT}; // same as in DumpCFG
@ -94,6 +94,10 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :
variable = NULL;
vbuf = NULL;
ncustom = 0;
id_custom = NULL;
flag_custom = NULL;
// process attributes
// ioptional = start of additional optional args
// only dump image and dump movie styles process optional args
@ -172,6 +176,10 @@ DumpCustom::~DumpCustom()
for (int i = 0; i < nvariable; i++) memory->destroy(vbuf[i]);
delete [] vbuf;
for (int i = 0; i < ncustom; i++) delete [] id_custom[i];
memory->sfree(id_custom);
delete [] flag_custom;
memory->destroy(choose);
memory->destroy(dchoose);
memory->destroy(clist);
@ -269,6 +277,13 @@ void DumpCustom::init_style()
variable[i] = ivariable;
}
int icustom;
for (int i = 0; i < ncustom; i++) {
icustom = atom->find_custom(id_custom[i],flag_custom[i]);
if (icustom < 0)
error->all(FLERR,"Could not find custom per-atom property ID");
}
// set index and check validity of region
if (iregion >= 0) {
@ -451,6 +466,10 @@ int DumpCustom::count()
for (i = 0; i < nlocal; i++) dchoose[i] = molecule[i];
ptr = dchoose;
nstride = 1;
} else if (thresh_array[ithresh] == PROC) {
for (i = 0; i < nlocal; i++) dchoose[i] = me;
ptr = dchoose;
nstride = 1;
} else if (thresh_array[ithresh] == TYPE) {
int *type = atom->type;
for (i = 0; i < nlocal; i++) dchoose[i] = type[i];
@ -828,6 +847,24 @@ int DumpCustom::count()
i = nfield + ithresh;
ptr = vbuf[field2index[i]];
nstride = 1;
} else if (thresh_array[ithresh] == DNAME) {
int iwhich,tmp;
i = nfield + ithresh;
iwhich = atom->find_custom(id_custom[field2index[i]],tmp);
ptr = atom->dvector[iwhich];
nstride = 1;
} else if (thresh_array[ithresh] == INAME) {
int iwhich,tmp;
i = nfield + ithresh;
iwhich = atom->find_custom(id_custom[field2index[i]],tmp);
int *ivector = atom->ivector[iwhich];
for (i = 0; i < nlocal; i++)
dchoose[i] = ivector[i];
ptr = dchoose;
nstride = 1;
}
// unselect atoms that don't meet threshhold criterion
@ -978,6 +1015,9 @@ int DumpCustom::parse_fields(int narg, char **arg)
error->all(FLERR,"Dumping an atom property that isn't allocated");
pack_choice[i] = &DumpCustom::pack_molecule;
vtype[i] = INT;
} else if (strcmp(arg[iarg],"proc") == 0) {
pack_choice[i] = &DumpCustom::pack_proc;
vtype[i] = INT;
} else if (strcmp(arg[iarg],"type") == 0) {
pack_choice[i] = &DumpCustom::pack_type;
vtype[i] = INT;
@ -1234,6 +1274,50 @@ int DumpCustom::parse_fields(int narg, char **arg)
field2index[i] = add_variable(suffix);
delete [] suffix;
// custom per-atom floating point value = d_ID
} else if (strncmp(arg[iarg],"d_",2) == 0) {
pack_choice[i] = &DumpCustom::pack_custom;
vtype[i] = DOUBLE;
int n = strlen(arg[iarg]);
char *suffix = new char[n];
strcpy(suffix,&arg[iarg][2]);
argindex[i] = 0;
int tmp = -1;
n = atom->find_custom(suffix,tmp);
if (n < 0)
error->all(FLERR,"Could not find custom per-atom property ID");
if (tmp != 1)
error->all(FLERR,"Custom per-atom property ID is not floating point");
field2index[i] = add_custom(suffix,1);
delete [] suffix;
// custom per-atom integer value = i_ID
} else if (strncmp(arg[iarg],"i_",2) == 0) {
pack_choice[i] = &DumpCustom::pack_custom;
vtype[i] = INT;
int n = strlen(arg[iarg]);
char *suffix = new char[n];
strcpy(suffix,&arg[iarg][2]);
argindex[i] = 0;
int tmp = -1;
n = atom->find_custom(suffix,tmp);
if (n < 0)
error->all(FLERR,"Could not find custom per-atom property ID");
if (tmp != 0)
error->all(FLERR,"Custom per-atom property ID is not integer");
field2index[i] = add_custom(suffix,0);
delete [] suffix;
} else return iarg;
}
@ -1319,6 +1403,34 @@ int DumpCustom::add_variable(char *id)
return nvariable-1;
}
/* ----------------------------------------------------------------------
add custom atom property to list used by dump
return index of where this property is in list
if already in list, do not add, just return index, else add to list
------------------------------------------------------------------------- */
int DumpCustom::add_custom(char *id, int flag)
{
int icustom;
for (icustom = 0; icustom < ncustom; icustom++)
if ((strcmp(id,id_custom[icustom]) == 0)
&& (flag == flag_custom[icustom])) break;
if (icustom < ncustom) return icustom;
id_custom = (char **)
memory->srealloc(id_custom,(ncustom+1)*sizeof(char *),"dump:id_custom");
flag_custom = (int *)
memory->srealloc(flag_custom,(ncustom+1)*sizeof(int),"dump:flag_custom");
int n = strlen(id) + 1;
id_custom[ncustom] = new char[n];
strcpy(id_custom[ncustom],id);
flag_custom[ncustom] = flag;
ncustom++;
return ncustom-1;
}
/* ---------------------------------------------------------------------- */
int DumpCustom::modify_param(int narg, char **arg)
@ -1384,6 +1496,7 @@ int DumpCustom::modify_param(int narg, char **arg)
if (strcmp(arg[1],"id") == 0) thresh_array[nthresh] = ID;
else if (strcmp(arg[1],"mol") == 0) thresh_array[nthresh] = MOL;
else if (strcmp(arg[1],"proc") == 0) thresh_array[nthresh] = PROC;
else if (strcmp(arg[1],"type") == 0) thresh_array[nthresh] = TYPE;
else if (strcmp(arg[1],"mass") == 0) thresh_array[nthresh] = MASS;
@ -1558,6 +1671,48 @@ int DumpCustom::modify_param(int narg, char **arg)
field2index[nfield+nthresh] = add_variable(suffix);
delete [] suffix;
// custom per atom floating point value = d_ID
// must grow field2index and argindex arrays, since access is beyond nfield
} else if (strncmp(arg[1],"d_",2) == 0) {
thresh_array[nthresh] = DNAME;
memory->grow(field2index,nfield+nthresh+1,"dump:field2index");
memory->grow(argindex,nfield+nthresh+1,"dump:argindex");
int n = strlen(arg[1]);
char *suffix = new char[n];
strcpy(suffix,&arg[1][2]);
argindex[nfield+nthresh] = 0;
int tmp = -1;
n = atom->find_custom(suffix,tmp);
if ((n < 0) || (tmp != 1))
error->all(FLERR,"Could not find dump modify "
"custom atom floating point property ID");
field2index[nfield+nthresh] = add_custom(suffix,1);
delete [] suffix;
// custom per atom integer value = i_ID
// must grow field2index and argindex arrays, since access is beyond nfield
} else if (strncmp(arg[1],"i_",2) == 0) {
thresh_array[nthresh] = INAME;
memory->grow(field2index,nfield+nthresh+1,"dump:field2index");
memory->grow(argindex,nfield+nthresh+1,"dump:argindex");
int n = strlen(arg[1]);
char *suffix = new char[n];
strcpy(suffix,&arg[1][2]);
argindex[nfield+nthresh] = 0;
int tmp = -1;
n = atom->find_custom(suffix,tmp);
if ((n < 0) || (tmp != 0))
error->all(FLERR,"Could not find dump modify "
"custom atom integer property ID");
field2index[nfield+nthresh] = add_custom(suffix,0);
delete [] suffix;
} else error->all(FLERR,"Invalid dump_modify threshhold operator");
// set operation type of threshhold
@ -1653,6 +1808,34 @@ void DumpCustom::pack_variable(int n)
}
}
/* ---------------------------------------------------------------------- */
void DumpCustom::pack_custom(int n)
{
int index = field2index[n];
if (flag_custom[index] == 0) { // integer
int iwhich,tmp;
iwhich = atom->find_custom(id_custom[index],tmp);
int *ivector = atom->ivector[iwhich];
for (int i = 0; i < nchoose; i++) {
buf[n] = ivector[clist[i]];
n += size_one;
}
} else if (flag_custom[index] == 1) { // double
int iwhich,tmp;
iwhich = atom->find_custom(id_custom[index],tmp);
double *dvector = atom->dvector[iwhich];
for (int i = 0; i < nchoose; i++) {
buf[n] = dvector[clist[i]];
n += size_one;
}
}
}
/* ----------------------------------------------------------------------
one method for every attribute dump custom can output
the atom property is packed into buf starting at n with stride size_one
@ -1683,6 +1866,16 @@ void DumpCustom::pack_molecule(int n)
/* ---------------------------------------------------------------------- */
void DumpCustom::pack_proc(int n)
{
for (int i = 0; i < nchoose; i++) {
buf[n] = me;
n += size_one;
}
}
/* ---------------------------------------------------------------------- */
void DumpCustom::pack_type(int n)
{
int *type = atom->type;

View File

@ -69,6 +69,10 @@ class DumpCustom : public Dump {
int *variable; // list of indices for the Variables
double **vbuf; // local storage for variable evaluation
int ncustom; // # of custom atom properties
char **id_custom; // their names
int *flag_custom; // their data type
int ntypes; // # of atom types
char **typenames; // array of element names for each type
@ -86,6 +90,7 @@ class DumpCustom : public Dump {
int add_compute(char *);
int add_fix(char *);
int add_variable(char *);
int add_custom(char *, int);
virtual int modify_param(int, char **);
typedef void (DumpCustom::*FnPtrHeader)(bigint);
@ -114,9 +119,11 @@ class DumpCustom : public Dump {
void pack_compute(int);
void pack_fix(int);
void pack_variable(int);
void pack_custom(int);
void pack_id(int);
void pack_molecule(int);
void pack_proc(int);
void pack_type(int);
void pack_mass(int);

View File

@ -135,6 +135,9 @@ void *lammps_extract_global(void *ptr, char *name)
if (strcmp(name,"boxyhi") == 0) return (void *) &lmp->domain->boxhi[1];
if (strcmp(name,"boxzlo") == 0) return (void *) &lmp->domain->boxlo[2];
if (strcmp(name,"boxzhi") == 0) return (void *) &lmp->domain->boxhi[2];
if (strcmp(name,"xy") == 0) return (void *) &lmp->domain->xy;
if (strcmp(name,"xz") == 0) return (void *) &lmp->domain->xz;
if (strcmp(name,"yz") == 0) return (void *) &lmp->domain->yz;
if (strcmp(name,"natoms") == 0) return (void *) &lmp->atom->natoms;
if (strcmp(name,"nlocal") == 0) return (void *) &lmp->atom->nlocal;
return NULL;

View File

@ -447,6 +447,8 @@ void Molecule::read(int flag)
error->all(FLERR,"Molecule file needs both Special Bond sections");
if (specialflag && !bondflag)
error->all(FLERR,"Molecule file has special flags but no bonds");
if (!specialflag && bondflag)
error->all(FLERR,"Molecule file has bonds but no special flags");
if ((shakeflagflag || shakeatomflag || shaketypeflag) && !shakeflag)
error->all(FLERR,"Molecule file shake info is incomplete");

View File

@ -19,6 +19,7 @@
#include "style_integrate.h"
#include "style_minimize.h"
#include "neighbor.h"
#include "neigh_list.h"
#include "force.h"
#include "modify.h"
#include "fix.h"
@ -395,13 +396,6 @@ void Update::reset_timestep(int narg, char **arg)
/* ----------------------------------------------------------------------
reset timestep
set atimestep to new timestep, so future update_time() calls will be correct
trigger reset of timestep for output and for fixes that require it
do not allow any timestep-dependent fixes to be defined
reset eflag/vflag global so nothing will think eng/virial are current
reset invoked flags of computes,
so nothing will think they are current between runs
clear timestep list of computes that store future invocation times
called from rerun command and input script (indirectly)
------------------------------------------------------------------------- */
@ -411,8 +405,14 @@ void Update::reset_timestep(bigint newstep)
if (ntimestep < 0) error->all(FLERR,"Timestep must be >= 0");
if (ntimestep > MAXBIGINT) error->all(FLERR,"Too big a timestep");
// set atimestep to new timestep
// so future update_time() calls will be correct
atimestep = ntimestep;
// trigger reset of timestep for output and for fixes that require it
// do not allow any timestep-dependent fixes to be defined
output->reset_timestep(ntimestep);
for (int i = 0; i < modify->nfix; i++) {
@ -422,8 +422,13 @@ void Update::reset_timestep(bigint newstep)
modify->fix[i]->reset_timestep(ntimestep);
}
// reset eflag/vflag global so no commands will think eng/virial are current
eflag_global = vflag_global = -1;
// reset invoked flags of computes,
// so no commands will think they are current between runs
for (int i = 0; i < modify->ncompute; i++) {
modify->compute[i]->invoked_scalar = -1;
modify->compute[i]->invoked_vector = -1;
@ -432,9 +437,16 @@ void Update::reset_timestep(bigint newstep)
modify->compute[i]->invoked_local = -1;
}
// clear timestep list of computes that store future invocation times
for (int i = 0; i < modify->ncompute; i++)
if (modify->compute[i]->timeflag) modify->compute[i]->clearstep();
// set last_build of all neigh lists to -1 to force rebuild
for (int i = 0; i < neighbor->nlist; i++)
neighbor->lists[i]->last_build = -1;
// NOTE: 7Jun12, adding rerun command, don't think this is required
//for (int i = 0; i < domain->nregion; i++)

View File

@ -1 +1 @@
#define LAMMPS_VERSION "11 Jul 2014"
#define LAMMPS_VERSION "22 Jul 2014"