changed double constants to MD_FLOAT constants
This commit is contained in:
parent
98583cdade
commit
d0277765c3
@ -109,6 +109,9 @@ double computeForceLJHalfNeigh(Parameter *param, Atom *atom, Neighbor *neighbor,
|
|||||||
MD_FLOAT sigma6 = param->sigma6;
|
MD_FLOAT sigma6 = param->sigma6;
|
||||||
MD_FLOAT epsilon = param->epsilon;
|
MD_FLOAT epsilon = param->epsilon;
|
||||||
#endif
|
#endif
|
||||||
|
const MD_FLOAT num1 = 1.0;
|
||||||
|
const MD_FLOAT num48 = 48.0;
|
||||||
|
const MD_FLOAT num05 = 0.5;
|
||||||
|
|
||||||
for(int i = 0; i < Nlocal; i++) {
|
for(int i = 0; i < Nlocal; i++) {
|
||||||
atom_fx(i) = 0.0;
|
atom_fx(i) = 0.0;
|
||||||
@ -157,9 +160,9 @@ double computeForceLJHalfNeigh(Parameter *param, Atom *atom, Neighbor *neighbor,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(rsq < cutforcesq) {
|
if(rsq < cutforcesq) {
|
||||||
MD_FLOAT sr2 = 1.0 / rsq;
|
MD_FLOAT sr2 = num1 / rsq;
|
||||||
MD_FLOAT sr6 = sr2 * sr2 * sr2 * sigma6;
|
MD_FLOAT sr6 = sr2 * sr2 * sr2 * sigma6;
|
||||||
MD_FLOAT force = 48.0 * sr6 * (sr6 - 0.5) * sr2 * epsilon;
|
MD_FLOAT force = num48 * sr6 * (sr6 - num05) * sr2 * epsilon;
|
||||||
fix += delx * force;
|
fix += delx * force;
|
||||||
fiy += dely * force;
|
fiy += dely * force;
|
||||||
fiz += delz * force;
|
fiz += delz * force;
|
||||||
|
Loading…
Reference in New Issue
Block a user