git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9437 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2013-02-10 00:09:16 +00:00
parent 874a32df2e
commit 52a2ba456a
9 changed files with 31 additions and 67 deletions

View File

@ -159,7 +159,7 @@ void ComputeTempCOM::compute_vector()
remove velocity bias from atom I to leave thermal velocity
------------------------------------------------------------------------- */
void ComputeTempCOM::remove_bias(int i, double *v)
void ComputeTempCOM::remove_bias(int, double *v)
{
v[0] -= vbias[0];
v[1] -= vbias[1];
@ -189,7 +189,7 @@ void ComputeTempCOM::remove_bias_all()
assume remove_bias() was previously called
------------------------------------------------------------------------- */
void ComputeTempCOM::restore_bias(int i, double *v)
void ComputeTempCOM::restore_bias(int, double *v)
{
v[0] += vbias[0];
v[1] += vbias[1];

View File

@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
@ -40,9 +40,9 @@ class ComputeTempCOM : public Compute {
private:
int fix_dof;
double tfactor,masstotal;
double vbias[3]; // stored velocity bias for one atom
void dof_compute();
};
}

View File

@ -83,7 +83,8 @@ void ComputeTempDeform::init()
break;
}
if (i == modify->nfix && comm->me == 0)
error->warning(FLERR,"Using compute temp/deform with no fix deform defined");
error->warning(FLERR,
"Using compute temp/deform with no fix deform defined");
}
/* ---------------------------------------------------------------------- */
@ -281,6 +282,6 @@ void ComputeTempDeform::restore_bias_all()
double ComputeTempDeform::memory_usage()
{
double bytes = maxbias * sizeof(double);
double bytes = 3*maxbias * sizeof(double);
return bytes;
}

View File

@ -1,4 +1,4 @@
/* ----------------------------------------------------------------------
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, sjplimp@sandia.gov
@ -41,9 +41,6 @@ class ComputeTempDeform : public Compute {
protected:
int fix_dof;
double tfactor;
double vbias[3]; // stored velocity bias for one atom
double **vbiasall; // stored velocity bias for all atoms
int maxbias; // size of vbiasall array
virtual void dof_compute();
};

View File

@ -262,6 +262,6 @@ void ComputeTempPartial::restore_bias_all()
double ComputeTempPartial::memory_usage()
{
double bytes = maxbias * sizeof(double);
double bytes = 3*maxbias * sizeof(double);
return bytes;
}

View File

@ -140,9 +140,6 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
maxatom = 0;
bin = NULL;
maxbias = 0;
vbiasall = NULL;
}
/* ---------------------------------------------------------------------- */
@ -152,7 +149,6 @@ ComputeTempProfile::~ComputeTempProfile()
memory->destroy(vbin);
memory->destroy(binave);
memory->destroy(bin);
memory->destroy(vbiasall);
if (outflag == TENSOR) delete [] vector;
else {
memory->destroy(tbin);
@ -348,18 +344,9 @@ void ComputeTempProfile::compute_array()
void ComputeTempProfile::remove_bias(int i, double *v)
{
int ibin = bin[i];
if (xflag) {
vbias[0] = binave[ibin][ivx];
v[0] -= vbias[0];
}
if (yflag) {
vbias[1] = binave[ibin][ivy];
v[1] -= vbias[1];
}
if (zflag) {
vbias[2] = binave[ibin][ivz];
v[2] -= vbias[2];
}
if (xflag) v[0] -= binave[ibin][ivx];
if (yflag) v[1] -= binave[ibin][ivy];
if (zflag) v[2] -= binave[ibin][ivz];
}
/* ----------------------------------------------------------------------
@ -372,28 +359,13 @@ void ComputeTempProfile::remove_bias_all()
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (nlocal > maxbias) {
memory->destroy(vbiasall);
maxbias = atom->nmax;
memory->create(vbiasall,maxbias,3,"temp/profile:vbiasall");
}
int ibin;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
ibin = bin[i];
if (xflag) {
vbiasall[i][0] = binave[ibin][ivx];
v[i][0] -= vbiasall[i][0];
}
if (yflag) {
vbiasall[i][1] = binave[ibin][ivy];
v[i][1] -= vbiasall[i][1];
}
if (zflag) {
vbiasall[i][2] = binave[ibin][ivz];
v[i][2] -= vbiasall[i][2];
}
if (xflag) v[i][0] -= binave[ibin][ivx];
if (yflag) v[i][1] -= binave[ibin][ivy];
if (zflag) v[i][2] -= binave[ibin][ivz];
}
}
@ -404,9 +376,10 @@ void ComputeTempProfile::remove_bias_all()
void ComputeTempProfile::restore_bias(int i, double *v)
{
if (xflag) v[0] += vbias[0];
if (yflag) v[1] += vbias[1];
if (zflag) v[2] += vbias[2];
int ibin = bin[i];
if (xflag) v[0] += binave[ibin][ivx];
if (yflag) v[1] += binave[ibin][ivy];
if (zflag) v[2] += binave[ibin][ivz];
}
/* ----------------------------------------------------------------------
@ -420,21 +393,14 @@ void ComputeTempProfile::restore_bias_all()
int *mask = atom->mask;
int nlocal = atom->nlocal;
if (xflag) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
v[i][0] += vbiasall[i][0];
}
if (yflag) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
v[i][1] += vbiasall[i][1];
}
if (zflag) {
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
v[i][2] += vbiasall[i][2];
}
int ibin;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
ibin = bin[i];
if (xflag) v[i][0] += binave[ibin][ivx];
if (yflag) v[i][1] += binave[ibin][ivy];
if (zflag) v[i][2] += binave[ibin][ivz];
}
}
/* ----------------------------------------------------------------------
@ -563,8 +529,7 @@ void ComputeTempProfile::bin_assign()
double ComputeTempProfile::memory_usage()
{
double bytes = maxbias * sizeof(double);
bytes += maxatom * sizeof(int);
double bytes = maxatom * sizeof(int);
bytes += nbins*(ncount+1) * sizeof(double);
return bytes;
}

View File

@ -294,6 +294,6 @@ void ComputeTempRamp::restore_bias_all()
double ComputeTempRamp::memory_usage()
{
double bytes = maxbias * sizeof(double);
double bytes = 3*maxbias * sizeof(double);
return bytes;
}

View File

@ -245,6 +245,6 @@ void ComputeTempRegion::restore_bias_all()
double ComputeTempRegion::memory_usage()
{
double bytes = maxbias * sizeof(double);
double bytes = 3*maxbias * sizeof(double);
return bytes;
}

View File

@ -243,6 +243,7 @@ void Verlet::run(int n)
comm->forward_comm();
timer->stamp(TIME_COMM);
} else {
printf("RENEIGH %ld\n",ntimestep);
if (n_pre_exchange) modify->pre_exchange();
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();