small bug fixes

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15527 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
sjplimp
2016-08-31 20:26:15 +00:00
parent e3d0a32272
commit 083ff54c0c
34 changed files with 91 additions and 66 deletions

View File

@ -14,8 +14,8 @@ make clean-all # remove entire build folder and any cached data
## Installing prerequisites
To run the documention build toolchain Python 3 and virtualenv have to be
installed. Here are instructions for common setups:
To run the documention build toolchain, Python 3 and virtualenv have
to be installed. Here are instructions for common setups:
### Ubuntu
@ -23,10 +23,16 @@ installed. Here are instructions for common setups:
sudo apt-get install python-virtualenv
```
### Fedora
### Fedora (up to version 21), Red Hat Enterprise Linux or CentOS (up to version 7.x)
```bash
sudo yum install python3-virtualenv
```
sudo yum install python-virtualenv
### Fedora (since version 22)
```bash
sudo dnf install python3-virtualenv
```
### MacOS X

View File

@ -2339,14 +2339,14 @@ velocity:</p>
<ol class="arabic simple" start="4">
<li>Total force on each molecule and ave/max across all molecules:</li>
</ol>
<pre class="literal-block">
compute cc1 all chunk/atom molecule
fix 1 all ave/chunk 1000 1 1000 cc1 fx fy fz file tmp.out
variable xave equal ave(f_1<strong>2</strong>)
variable xmax equal max(f_1<strong>2</strong>)
thermo 1000
thermo_style custom step temp v_xave v_xmax
</pre>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">chunk</span> <span class="mi">1000</span> <span class="mi">1</span> <span class="mi">1000</span> <span class="n">cc1</span> <span class="n">fx</span> <span class="n">fy</span> <span class="n">fz</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span>
<span class="n">variable</span> <span class="n">xave</span> <span class="n">equal</span> <span class="n">ave</span><span class="p">(</span><span class="n">f_1</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
<span class="n">variable</span> <span class="n">xmax</span> <span class="n">equal</span> <span class="nb">max</span><span class="p">(</span><span class="n">f_1</span><span class="p">[</span><span class="mi">2</span><span class="p">])</span>
<span class="n">thermo</span> <span class="mi">1000</span>
<span class="n">thermo_style</span> <span class="n">custom</span> <span class="n">step</span> <span class="n">temp</span> <span class="n">v_xave</span> <span class="n">v_xmax</span>
</pre></div>
</div>
<ol class="arabic simple" start="5">
<li>Histogram of cluster sizes:</li>
</ol>

View File

@ -178,11 +178,11 @@ how they are set for each atom. You can reset the image flags
<p>The simplest way to output the results of the compute omega/chunk
calculation to a file is to use the <a class="reference internal" href="fix_ave_time.html"><span class="doc">fix ave/time</span></a>
command, for example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">compute</span> <span class="n">cc1</span> <span class="nb">all</span> <span class="n">chunk</span><span class="o">/</span><span class="n">atom</span> <span class="n">molecule</span>
<span class="n">compute</span> <span class="n">myChunk</span> <span class="nb">all</span> <span class="n">omega</span><span class="o">/</span><span class="n">chunk</span> <span class="n">cc1</span>
<span class="n">fix</span> <span class="mi">1</span> <span class="nb">all</span> <span class="n">ave</span><span class="o">/</span><span class="n">time</span> <span class="mi">100</span> <span class="mi">1</span> <span class="mi">100</span> <span class="n">c_myChunk</span> <span class="n">file</span> <span class="n">tmp</span><span class="o">.</span><span class="n">out</span> <span class="n">mode</span> <span class="n">vector</span>
</pre></div>
</div>
<pre class="literal-block">
compute cc1 all chunk/atom molecule
compute myChunk all omega/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk<strong>*</strong> file tmp.out mode vector
</pre>
<p><strong>Output info:</strong></p>
<p>This compute calculates a global array where the number of rows = the
number of chunks <em>Nchunk</em> as calculated by the specified <a class="reference internal" href="compute_chunk_atom.html"><span class="doc">compute chunk/atom</span></a> command. The number of columns =

View File

@ -158,7 +158,7 @@ keyword = <em>every</em>
<p>Perform constant NVE integration to update position and velocity for
atoms constrained to a curved surface (manifold) in the group each timestep. The constraint
is handled by RATTLE <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> written out for the special case of
single-particle constraints as explained in <a class="reference internal" href="manifolds.html#paquay"><span class="std std-ref">(Paquay)</span></a>.
single-particle constraints as explained in <a class="reference internal" href="fix_nvt_manifold_rattle.html#paquay"><span class="std std-ref">(Paquay)</span></a>.
V is volume; E is energy. This way, the dynamics of particles constrained to
curved surfaces can be studied. If combined with <a class="reference internal" href="fix_langevin.html"><span class="doc">fix langevin</span></a>, this generates
Brownian motion of particles constrained to a curved surface. For a list of currently supported

View File

@ -157,7 +157,7 @@ keyword = <em>temp</em> or <em>tchain</em> or <em>every</em>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>This fix combines the RATTLE-based <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> time integrator of <a class="reference internal" href="fix_nve_manifold_rattle.html"><span class="doc">fix nve/manifold/rattle</span></a> <a class="reference internal" href="manifolds.html#paquay"><span class="std std-ref">(Paquay)</span></a> with a Nose-Hoover-chain thermostat to sample the
<p>This fix combines the RATTLE-based <a class="reference internal" href="fix_shake.html#andersen"><span class="std std-ref">(Andersen)</span></a> time integrator of <a class="reference internal" href="fix_nve_manifold_rattle.html"><span class="doc">fix nve/manifold/rattle</span></a> <a class="reference internal" href="#paquay"><span class="std std-ref">(Paquay)</span></a> with a Nose-Hoover-chain thermostat to sample the
canonical ensemble of particles constrained to a curved surface (manifold). This sampling does suffer from discretization bias of O(dt).
For a list of currently supported manifolds and their parameters, see <a class="reference internal" href="manifolds.html"><span class="doc">manifolds</span></a></p>
</div>

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ command, for example:
compute cc1 all chunk/atom molecule
compute myChunk all omega/chunk cc1
fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector :pre
fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector :pre
[Output info:]

View File

@ -438,9 +438,17 @@ c use precomputed values
rho0_2 = rho0_meam(b)*Z2*G2
endif
Gam1 = (t11av*rho11+t21av*rho21+t31av*rho31)
if (rho01 < 1.0d-14) then
Gam1 = 0.0d0
else
Gam1 = Gam1/(rho01*rho01)
endif
Gam2 = (t12av*rho12+t22av*rho22+t32av*rho32)
if (rho02 < 1.0d-14) then
Gam2 = 0.0d0
else
Gam2 = Gam2/(rho02*rho02)
endif
call G_gam(Gam1,ibar_meam(a),gsmooth_factor,G1,errorflag)
call G_gam(Gam2,ibar_meam(b),gsmooth_factor,G2,errorflag)
if (mix_ref_t.eq.1) then

View File

@ -37,8 +37,6 @@ class ComputeBodyLocal : public Compute {
int *which,*index;
int nmax;
double *vector;
double **array;
class AtomVecBody *avec;
class Body *bptr;

View File

@ -41,8 +41,6 @@ class ComputeRigidLocal : public Compute {
class FixRigidSmall *fixrigid;
int nmax;
double *vector;
double **array;
int compute_rigid(int);
void reallocate(int);

View File

@ -36,8 +36,6 @@ class ComputeSpecAtom : public Compute {
private:
int nvalues;
int nmax;
double *vector;
double **array;
double *buf;
double *vbuf;

View File

@ -1589,6 +1589,7 @@ void Atom::add_molecule(int narg, char **arg)
int Atom::find_molecule(char *id)
{
if(id == NULL) return -1;
int imol;
for (imol = 0; imol < nmolecule; imol++)
if (strcmp(id,molecules[imol]->id) == 0) return imol;
@ -1913,6 +1914,8 @@ void Atom::add_callback(int flag)
void Atom::delete_callback(const char *id, int flag)
{
if(id==NULL) return;
int ifix;
for (ifix = 0; ifix < modify->nfix; ifix++)
if (strcmp(id,modify->fix[ifix]->id) == 0) break;
@ -1968,6 +1971,8 @@ void Atom::update_callback(int ifix)
int Atom::find_custom(const char *name, int &flag)
{
if(name == NULL) return -1;
for (int i = 0; i < nivector; i++)
if (iname[i] && strcmp(iname[i],name) == 0) {
flag = 0;

View File

@ -33,8 +33,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL)
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute angle/local command");

View File

@ -37,8 +37,6 @@ class ComputeAngleLocal : public Compute {
int ncount;
int nmax;
double *vector;
double **array;
int compute_angles(int);
void reallocate(int);

View File

@ -34,7 +34,7 @@ enum{DIST,ENG,FORCE};
ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
bstyle(NULL), vector(NULL), array(NULL)
bstyle(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute bond/local command");

View File

@ -39,8 +39,6 @@ class ComputeBondLocal : public Compute {
int singleflag;
int nmax;
double *vector;
double **array;
int compute_bonds(int);
void reallocate(int);

View File

@ -57,9 +57,10 @@ ComputeChunkAtom *ComputeChunkAtom::cptr;
ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
id_fix(NULL), chunk(NULL), ichunk(NULL), exclude(NULL),
chunk_volume_vec(NULL), coord(NULL), chunkID(NULL), idregion(NULL), cfvid(NULL),
hash(NULL), varatom(NULL)
chunk_volume_vec(NULL), coord(NULL), ichunk(NULL), chunkID(NULL),
cfvid(NULL), idregion(NULL), region(NULL), cchunk(NULL), fchunk(NULL),
varatom(NULL), id_fix(NULL), fixstore(NULL), lockfix(NULL), chunk(NULL),
exclude(NULL), hash(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command");

View File

@ -279,7 +279,7 @@ void ComputeCNAAtom::compute_peratom()
for (n = 0; n < ncommon; n++) bonds[n] = 0;
nbonds = 0;
for (jj = 0; jj < ncommon; jj++) {
for (jj = 0; jj < ncommon-1; jj++) {
j = common[jj];
xtmp = x[j][0];
ytmp = x[j][1];

View File

@ -34,8 +34,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL)
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command");

View File

@ -37,8 +37,6 @@ class ComputeDihedralLocal : public Compute {
int ncount;
int nmax;
double *vector;
double **array;
int compute_dihedrals(int);
void reallocate(int);

View File

@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
id_fix(NULL), displace(NULL)
displace(NULL), id_fix(NULL)
{
if (narg != 3) error->all(FLERR,"Illegal compute displace/atom command");

View File

@ -35,8 +35,7 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */
ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL)
Compute(lmp, narg, arg)
{
if (narg < 4) error->all(FLERR,"Illegal compute improper/local command");

View File

@ -37,8 +37,6 @@ class ComputeImproperLocal : public Compute {
int ncount;
int nmax;
double *vector;
double **array;
int compute_impropers(int);
void reallocate(int);

View File

@ -28,7 +28,7 @@ using namespace LAMMPS_NS;
ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
idchunk(NULL),massproc(NULL),masstotal(NULL),com(NULL),comall(NULL),
angmom(NULL), angmomall(NULL)
inertia(NULL),inertiaall(NULL),angmom(NULL),angmomall(NULL),omega(NULL)
{
if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command");
@ -64,6 +64,9 @@ ComputeOmegaChunk::~ComputeOmegaChunk()
memory->destroy(comall);
memory->destroy(angmom);
memory->destroy(angmomall);
memory->destroy(inertia);
memory->destroy(inertiaall);
memory->destroy(omega);
}
/* ---------------------------------------------------------------------- */
@ -83,7 +86,7 @@ void ComputeOmegaChunk::init()
void ComputeOmegaChunk::compute_array()
{
int i,j,m,index;
int i,j,index;
double dx,dy,dz,massone;
double unwrap[3];

View File

@ -37,7 +37,7 @@ enum{TYPE,RADIUS};
ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
pstyle(NULL), pindex(NULL), vector(NULL), array(NULL)
pstyle(NULL), pindex(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute pair/local command");

View File

@ -41,8 +41,6 @@ class ComputePairLocal : public Compute {
int singleflag;
int nmax;
double *vector;
double **array;
class NeighList *list;

View File

@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
index(NULL), vector(NULL), array(NULL), pack_choice(NULL)
index(NULL), pack_choice(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute property/atom command");

View File

@ -36,8 +36,6 @@ class ComputePropertyAtom : public Compute {
int nvalues;
int nmax;
int *index;
double *vector;
double **array;
double *buf;
class AtomVecEllipsoid *avec_ellipsoid;
class AtomVecLine *avec_line;

View File

@ -35,7 +35,7 @@ enum{TYPE,RADIUS};
ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
vector(NULL), array(NULL), indices(NULL), pack_choice(NULL)
indices(NULL), pack_choice(NULL)
{
if (narg < 4) error->all(FLERR,"Illegal compute property/local command");

View File

@ -37,8 +37,6 @@ class ComputePropertyLocal : public Compute {
int nvalues,kindflag,cutstyle;
int nmax;
double *vector;
double **array;
double *buf;
class NeighList *list;

View File

@ -158,7 +158,7 @@ void CreateBox::command(int narg, char **arg)
iarg += 2;
} else if (strcmp(arg[iarg],"extra/special/per/atom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command");
atom->maxspecial = force->inumeric(FLERR,arg[iarg+1]);
force->special_extra = force->inumeric(FLERR,arg[iarg+1]);
iarg += 2;
} else error->all(FLERR,"Illegal create_box command");
}

View File

@ -40,7 +40,14 @@ enum{ONE,RUNNING,WINDOW};
/* ---------------------------------------------------------------------- */
FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg)
Fix(lmp, narg, arg),
nvalues(0), nrepeat(0),
which(NULL), argindex(NULL), value2index(NULL), ids(NULL),
fp(NULL), idchunk(NULL), varatom(NULL),
count_one(NULL), count_many(NULL), count_sum(NULL),
values_one(NULL), values_many(NULL), values_sum(NULL),
count_total(NULL), count_list(NULL),
values_total(NULL), values_list(NULL)
{
if (narg < 7) error->all(FLERR,"Illegal fix ave/chunk command");
@ -72,7 +79,6 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
argindex = new int[nargnew];
ids = new char*[nargnew];
value2index = new int[nargnew];
nvalues = 0;
int iarg = 0;
while (iarg < nargnew) {
@ -149,7 +155,6 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
normflag = ALL;
scaleflag = ATOM;
ave = ONE;
fp = NULL;
nwindow = 0;
biasflag = 0;
id_bias = NULL;
@ -433,7 +438,6 @@ FixAveChunk::~FixAveChunk()
if (fp && me == 0) fclose(fp);
memory->destroy(varatom);
memory->destroy(count_one);
memory->destroy(count_many);
memory->destroy(count_sum);
@ -457,6 +461,24 @@ FixAveChunk::~FixAveChunk()
}
delete [] idchunk;
which = NULL;
argindex = NULL;
ids = NULL;
value2index = NULL;
fp = NULL;
varatom = NULL;
count_one = NULL;
count_many = NULL;
count_sum = NULL;
count_total = NULL;
count_list = NULL;
values_one = NULL;
values_many = NULL;
values_sum = NULL;
values_total = NULL;
values_list = NULL;
idchunk = NULL;
cchunk = NULL;
}
/* ---------------------------------------------------------------------- */

View File

@ -911,6 +911,7 @@ void Modify::delete_fix(const char *id)
int Modify::find_fix(const char *id)
{
if(id==NULL) return -1;
int ifix;
for (ifix = 0; ifix < nfix; ifix++)
if (strcmp(id,fix[ifix]->id) == 0) break;
@ -1040,6 +1041,7 @@ void Modify::delete_compute(const char *id)
int Modify::find_compute(const char *id)
{
if(id==NULL) return -1;
int icompute;
for (icompute = 0; icompute < ncompute; icompute++)
if (strcmp(id,compute[icompute]->id) == 0) break;

View File

@ -710,6 +710,7 @@ int Variable::next(int narg, char **arg)
int Variable::find(char *name)
{
if(name==NULL) return -1;
for (int i = 0; i < nvar; i++)
if (strcmp(name,names[i]) == 0) return i;
return -1;