Merge branch 'small' into integration

Conflicts:
	src/compute_omega_chunk.cpp
This commit is contained in:
Steve Plimpton
2016-08-31 13:58:12 -06:00
29 changed files with 74 additions and 49 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

@ -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)
Gam1 = Gam1/(rho01*rho01)
if (rho01 < 1.0d-14) then
Gam1 = 0.0d0
else
Gam1 = Gam1/(rho01*rho01)
endif
Gam2 = (t12av*rho12+t22av*rho22+t32av*rho32)
Gam2 = Gam2/(rho02*rho02)
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

@ -27,8 +27,8 @@ 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)
idchunk(NULL),massproc(NULL),masstotal(NULL),com(NULL),comall(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);
}
/* ---------------------------------------------------------------------- */

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;