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

This commit is contained in:
sjplimp 2013-02-08 17:38:26 +00:00
parent 3adb315c9e
commit 744e2093fd
4 changed files with 8 additions and 5 deletions

View File

@ -41,7 +41,7 @@ class Bond : protected Pointers {
virtual double equilibrium_distance(int) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;
virtual double single(int, double, int, int) = 0;
virtual double single(int, double, int, int, double &) = 0;
virtual double memory_usage();
virtual unsigned int data_mask() {return datamask;}

View File

@ -335,10 +335,12 @@ void BondHybrid::read_restart(FILE *fp)
/* ---------------------------------------------------------------------- */
double BondHybrid::single(int type, double rsq, int i, int j)
double BondHybrid::single(int type, double rsq, int i, int j,
double &fforce)
{
if (map[type] < 0) error->one(FLERR,"Invoked bond single on bond style none");
return styles[map[type]]->single(type,rsq,i,j);
return styles[map[type]]->single(type,rsq,i,j,fforce);
}
/* ----------------------------------------------------------------------

View File

@ -42,7 +42,7 @@ class BondHybrid : public Bond {
double equilibrium_distance(int);
void write_restart(FILE *);
void read_restart(FILE *);
double single(int, double, int, int);
double single(int, double, int, int, double &);
double memory_usage();
private:

View File

@ -135,6 +135,7 @@ int ComputeBondLocal::compute_bonds(int flag)
Bond *bond = force->bond;
m = n = 0;
double fforce; // unused
for (atom1 = 0; atom1 < nlocal; atom1++) {
if (!(mask[atom1] & groupbit)) continue;
for (i = 0; i < num_bond[atom1]; i++) {
@ -152,7 +153,7 @@ int ComputeBondLocal::compute_bonds(int flag)
if (dflag >= 0) dbuf[n] = sqrt(rsq);
if (eflag >= 0) {
if (bond_type[atom1][i] > 0)
ebuf[n] = bond->single(bond_type[atom1][i],rsq,atom1,atom2);
ebuf[n] = bond->single(bond_type[atom1][i],rsq,atom1,atom2,fforce);
else ebuf[n] = 0.0;
}
n += nvalues;