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

This commit is contained in:
sjplimp
2008-08-01 14:58:22 +00:00
parent 6dad21f7aa
commit 3c3bc8a0f8
4 changed files with 43 additions and 10 deletions

View File

@ -94,6 +94,7 @@ int FixSpringSelf::setmask()
{
int mask = 0;
mask |= POST_FORCE;
mask |= THERMO_ENERGY;
mask |= POST_FORCE_RESPA;
mask |= MIN_POST_FORCE;
return mask;
@ -122,6 +123,13 @@ void FixSpringSelf::setup(int vflag)
/* ---------------------------------------------------------------------- */
void FixSpringSelf::min_setup(int vflag)
{
post_force(vflag);
}
/* ---------------------------------------------------------------------- */
void FixSpringSelf::post_force(int vflag)
{
double **x = atom->x;
@ -135,7 +143,7 @@ void FixSpringSelf::post_force(int vflag)
double zprd = domain->zprd;
int xbox,ybox,zbox;
double dx,dy,dz;
double espring = 0.0;
espring = 0.0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
@ -150,6 +158,8 @@ void FixSpringSelf::post_force(int vflag)
f[i][2] -= k*dz;
espring += k * (dx*dx + dy*dy + dz*dz);
}
espring *= 0.5;
}
/* ---------------------------------------------------------------------- */
@ -165,7 +175,6 @@ void FixSpringSelf::post_force_respa(int vflag, int ilevel, int iloop)
double FixSpringSelf::compute_scalar()
{
espring *= 0.5;
double all;
MPI_Allreduce(&espring,&all,1,MPI_DOUBLE,MPI_SUM,world);
return all;