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 ## Installing prerequisites
To run the documention build toolchain Python 3 and virtualenv have to be To run the documention build toolchain, Python 3 and virtualenv have
installed. Here are instructions for common setups: to be installed. Here are instructions for common setups:
### Ubuntu ### Ubuntu
@ -23,10 +23,16 @@ installed. Here are instructions for common setups:
sudo apt-get install python-virtualenv 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 ### MacOS X

View File

@ -2339,14 +2339,14 @@ velocity:</p>
<ol class="arabic simple" start="4"> <ol class="arabic simple" start="4">
<li>Total force on each molecule and ave/max across all molecules:</li> <li>Total force on each molecule and ave/max across all molecules:</li>
</ol> </ol>
<pre class="literal-block"> <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>
compute cc1 all chunk/atom molecule <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>
fix 1 all ave/chunk 1000 1 1000 cc1 fx fy fz file tmp.out <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>
variable xave equal ave(f_1<strong>2</strong>) <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>
variable xmax equal max(f_1<strong>2</strong>) <span class="n">thermo</span> <span class="mi">1000</span>
thermo 1000 <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>
thermo_style custom step temp v_xave v_xmax </pre></div>
</pre> </div>
<ol class="arabic simple" start="5"> <ol class="arabic simple" start="5">
<li>Histogram of cluster sizes:</li> <li>Histogram of cluster sizes:</li>
</ol> </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 <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> 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> 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> <pre class="literal-block">
<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> compute cc1 all chunk/atom molecule
<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> compute myChunk all omega/chunk cc1
</pre></div> fix 1 all ave/time 100 1 100 c_myChunk<strong>*</strong> file tmp.out mode vector
</div> </pre>
<p><strong>Output info:</strong></p> <p><strong>Output info:</strong></p>
<p>This compute calculates a global array where the number of rows = the <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 = 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 <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 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 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 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 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 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>
<div class="section" id="description"> <div class="section" id="description">
<h2>Description</h2> <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). 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> 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> </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 cc1 all chunk/atom molecule
compute myChunk all omega/chunk cc1 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:] [Output info:]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -57,9 +57,10 @@ ComputeChunkAtom *ComputeChunkAtom::cptr;
ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg), Compute(lmp, narg, arg),
id_fix(NULL), chunk(NULL), ichunk(NULL), exclude(NULL), chunk_volume_vec(NULL), coord(NULL), ichunk(NULL), chunkID(NULL),
chunk_volume_vec(NULL), coord(NULL), chunkID(NULL), idregion(NULL), cfvid(NULL), cfvid(NULL), idregion(NULL), region(NULL), cchunk(NULL), fchunk(NULL),
hash(NULL), varatom(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"); 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; for (n = 0; n < ncommon; n++) bonds[n] = 0;
nbonds = 0; nbonds = 0;
for (jj = 0; jj < ncommon; jj++) { for (jj = 0; jj < ncommon-1; jj++) {
j = common[jj]; j = common[jj];
xtmp = x[j][0]; xtmp = x[j][0];
ytmp = x[j][1]; ytmp = x[j][1];

View File

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

View File

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

View File

@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, 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"); 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) : ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg), Compute(lmp, narg, arg)
vector(NULL), array(NULL)
{ {
if (narg < 4) error->all(FLERR,"Illegal compute improper/local command"); if (narg < 4) error->all(FLERR,"Illegal compute improper/local command");

View File

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

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, 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"); if (narg < 4) error->all(FLERR,"Illegal compute property/atom command");

View File

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

View File

@ -35,7 +35,7 @@ enum{TYPE,RADIUS};
ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, 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"); 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 nvalues,kindflag,cutstyle;
int nmax; int nmax;
double *vector;
double **array;
double *buf; double *buf;
class NeighList *list; class NeighList *list;

View File

@ -158,7 +158,7 @@ void CreateBox::command(int narg, char **arg)
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg],"extra/special/per/atom") == 0) { } else if (strcmp(arg[iarg],"extra/special/per/atom") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); 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; iarg += 2;
} else error->all(FLERR,"Illegal create_box command"); } 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) : 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"); 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]; argindex = new int[nargnew];
ids = new char*[nargnew]; ids = new char*[nargnew];
value2index = new int[nargnew]; value2index = new int[nargnew];
nvalues = 0;
int iarg = 0; int iarg = 0;
while (iarg < nargnew) { while (iarg < nargnew) {
@ -149,7 +155,6 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) :
normflag = ALL; normflag = ALL;
scaleflag = ATOM; scaleflag = ATOM;
ave = ONE; ave = ONE;
fp = NULL;
nwindow = 0; nwindow = 0;
biasflag = 0; biasflag = 0;
id_bias = NULL; id_bias = NULL;
@ -433,7 +438,6 @@ FixAveChunk::~FixAveChunk()
if (fp && me == 0) fclose(fp); if (fp && me == 0) fclose(fp);
memory->destroy(varatom); memory->destroy(varatom);
memory->destroy(count_one); memory->destroy(count_one);
memory->destroy(count_many); memory->destroy(count_many);
memory->destroy(count_sum); memory->destroy(count_sum);
@ -457,6 +461,24 @@ FixAveChunk::~FixAveChunk()
} }
delete [] idchunk; 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) int Modify::find_fix(const char *id)
{ {
if(id==NULL) return -1;
int ifix; int ifix;
for (ifix = 0; ifix < nfix; ifix++) for (ifix = 0; ifix < nfix; ifix++)
if (strcmp(id,fix[ifix]->id) == 0) break; 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) int Modify::find_compute(const char *id)
{ {
if(id==NULL) return -1;
int icompute; int icompute;
for (icompute = 0; icompute < ncompute; icompute++) for (icompute = 0; icompute < ncompute; icompute++)
if (strcmp(id,compute[icompute]->id) == 0) break; 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) int Variable::find(char *name)
{ {
if(name==NULL) return -1;
for (int i = 0; i < nvar; i++) for (int i = 0; i < nvar; i++)
if (strcmp(name,names[i]) == 0) return i; if (strcmp(name,names[i]) == 0) return i;
return -1; return -1;