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

This commit is contained in:
sjplimp 2012-03-21 14:33:49 +00:00
parent 740542f23b
commit 55fbe648f1
4 changed files with 24 additions and 31 deletions

View File

@ -557,6 +557,7 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
/* Virial Tallying variables */
int ii;
real f_scaler, fi_tmp[3], fj_tmp[3], fk_tmp[3];
real delij[3], delki[3], delkj[3];
/* Initializations */
nbr_j = &(bonds->select.bond_list[pj]);
@ -599,7 +600,10 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
if( system->pair_ptr->vflag_atom ) {
f_scaler = -(coef.C2dbo + coef.C2dDelta + coef.C3dbopi + coef.C3dbopi2);
rvec_Scale( fk_tmp, -f_scaler, nbr_k->bo_data.dBOp);
system->pair_ptr->v_tally(k, fk_tmp);
rvec_ScaledSum( delki, 1., system->my_atoms[k].x,-1., system->my_atoms[i].x );
system->pair_ptr->ev_tally_xyz(k,i,system->n,1,0.0,0.0,
fk_tmp[0],fk_tmp[1],fk_tmp[2],delki[0],delki[1],delki[2]);
}
}
@ -645,7 +649,10 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
if( system->pair_ptr->vflag_atom ) {
f_scaler = -(coef.C3dbo + coef.C3dDelta + coef.C4dbopi + coef.C4dbopi2);
rvec_Scale( fk_tmp, -f_scaler, nbr_k->bo_data.dBOp);
system->pair_ptr->v_tally(k, fk_tmp);
rvec_ScaledSum( delkj, 1., system->my_atoms[k].x,-1., system->my_atoms[j].x );
system->pair_ptr->ev_tally_xyz(k,j,system->n,1,0.0,0.0,
fk_tmp[0],fk_tmp[1],fk_tmp[2],delkj[0],delkj[1],delkj[2]);
}
}
@ -684,6 +691,11 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
rvec_ScaledAdd( fi_tmp, -f_scaler, bo_ij->dln_BOp_pi);
f_scaler = coef.C1dbopi2 ;
rvec_ScaledAdd( fi_tmp, -f_scaler, bo_ij->dln_BOp_pi2);
rvec_Scale( fi_tmp, 0.5, fi_tmp);
rvec_ScaledSum( delij, 1., system->my_atoms[i].x,-1., system->my_atoms[j].x );
system->pair_ptr->ev_tally_xyz(i,j,system->n,1,0.0,0.0,
fi_tmp[0],fi_tmp[1],fi_tmp[2],delij[0],delij[1],delij[2]);
// forces on j
f_scaler = -(coef.C1dbo + coef.C1dDelta + coef.C2dbopi + coef.C2dbopi2);
@ -694,9 +706,11 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
rvec_ScaledAdd( fj_tmp, -f_scaler, bo_ij->dln_BOp_pi);
f_scaler = -coef.C1dbopi2 ;
rvec_ScaledAdd( fj_tmp, -f_scaler, bo_ij->dln_BOp_pi2);
rvec_Scale( fj_tmp, 0.5, fj_tmp);
system->pair_ptr->v_tally(i, fi_tmp);
system->pair_ptr->v_tally(j, fj_tmp);
rvec_ScaledSum( delij, 1., system->my_atoms[j].x,-1., system->my_atoms[i].x );
system->pair_ptr->ev_tally_xyz(j,i,system->n,1,0.0,0.0,
fj_tmp[0],fj_tmp[1],fj_tmp[2],delij[0],delij[1],delij[2]);
}
}

View File

@ -47,7 +47,8 @@ ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) :
strcpy(group2,arg[3]);
jgroup = group->find(group2);
if (jgroup == -1) error->all(FLERR,"Compute group/group group ID does not exist");
if (jgroup == -1)
error->all(FLERR,"Compute group/group group ID does not exist");
jgroupbit = group->bitmask[jgroup];
vector = new double[3];
@ -80,7 +81,8 @@ void ComputeGroupGroup::init()
// recheck that group 2 has not been deleted
jgroup = group->find(group2);
if (jgroup == -1) error->all(FLERR,"Compute group/group group ID does not exist");
if (jgroup == -1)
error->all(FLERR,"Compute group/group group ID does not exist");
jgroupbit = group->bitmask[jgroup];
// need an occasional half neighbor list

View File

@ -764,28 +764,6 @@ void Pair::ev_tally_list(int n, int *list, double ecoul, double *v)
}
}
/* ----------------------------------------------------------------------
tally virial into per-atom accumulators
called by REAX/C potential, newton_pair is always on
fi is magnitude of force on atom i
------------------------------------------------------------------------- */
void Pair::v_tally(int i, double *fi)
{
double v[6];
double **x = atom->x;
v[0] = x[i][0]*fi[0];
v[1] = x[i][1]*fi[1];
v[2] = x[i][2]*fi[2];
v[3] = x[i][0]*fi[1];
v[4] = x[i][0]*fi[2];
v[5] = x[i][1]*fi[2];
vatom[i][0] += v[0]; vatom[i][1] += v[1]; vatom[i][2] += v[2];
vatom[i][3] += v[3]; vatom[i][4] += v[4]; vatom[i][5] += v[5];
}
/* ----------------------------------------------------------------------
tally virial into per-atom accumulators
called by AIREBO potential, newton_pair is always on

View File

@ -87,7 +87,6 @@ class Pair : protected Pointers {
// need to be public, so can be called by pair_style reaxc
void v_tally(int, double *);
void ev_tally(int, int, int, int, double, double, double,
double, double, double);
void ev_tally3(int, int, int, double, double,
@ -95,6 +94,8 @@ class Pair : protected Pointers {
void v_tally3(int, int, int, double *, double *, double *, double *);
void v_tally4(int, int, int, int, double *, double *, double *,
double *, double *, double *);
void ev_tally_xyz(int, int, int, int, double, double,
double, double, double, double, double, double);
// general child-class methods
@ -153,8 +154,6 @@ class Pair : protected Pointers {
virtual void ev_setup(int, int);
void ev_tally_full(int, double, double, double, double, double, double);
void ev_tally_xyz(int, int, int, int, double, double,
double, double, double, double, double, double);
void ev_tally_xyz_full(int, double, double,
double, double, double, double, double, double);
void ev_tally4(int, int, int, int, double,