forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8207 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
978a99e098
commit
611e614170
|
@ -13,6 +13,8 @@ atc atomistic-to-continuum methods, USER-ATC package
|
|||
from Reese Jones, Jeremy Templeton, Jon Zimmerman (Sandia)
|
||||
awpmd antisymmetrized wave packet molecular dynamics, AWPMD package
|
||||
from Ilya Valuev (JIHT RAS)
|
||||
colvars collective variable module (Metadynamics, ABF and more)
|
||||
from Giacomo Fiorin and Jerome Henin (ICMS, Temple U)
|
||||
cuda NVIDIA GPU routines, USER-CUDA package
|
||||
from Christian Trott (U Tech Ilmenau)
|
||||
gpu graphical processor (GPU) routines, GPU package
|
||||
|
|
|
@ -1223,7 +1223,8 @@ inline void colvar::spin_angle::wrap (colvarvalue &x) const
|
|||
inline cvm::real colvar::TYPE::dist2 (colvarvalue const &x1, \
|
||||
colvarvalue const &x2) const \
|
||||
{ \
|
||||
return std::pow (x1.real_value - x2.real_value, int (2)); \
|
||||
const cvm::real tmp = x1.real_value - x2.real_value; \
|
||||
return tmp*tmp; \
|
||||
} \
|
||||
\
|
||||
inline colvarvalue colvar::TYPE::dist2_lgrad (colvarvalue const &x1, \
|
||||
|
|
|
@ -636,13 +636,17 @@ inline cvm::real colvarvalue::dist2 (colvarvalue const &x2) const
|
|||
colvarvalue::check_types (*this, x2);
|
||||
|
||||
switch (this->value_type) {
|
||||
case colvarvalue::type_scalar:
|
||||
return std::pow (this->real_value - x2.real_value, int (2));
|
||||
case colvarvalue::type_scalar: {
|
||||
const cvm::real tmp = this->real_value - x2.real_value;
|
||||
return tmp*tmp;
|
||||
}
|
||||
case colvarvalue::type_vector:
|
||||
return (this->rvector_value - x2.rvector_value).norm2();
|
||||
case colvarvalue::type_unitvector:
|
||||
case colvarvalue::type_unitvector: {
|
||||
// angle between (*this) and x2 is the distance
|
||||
return std::pow (std::acos (this->rvector_value * x2.rvector_value), int (2));
|
||||
const cvm::real tmp = std::acos (this->rvector_value * x2.rvector_value);
|
||||
return tmp*tmp;
|
||||
}
|
||||
case colvarvalue::type_quaternion:
|
||||
// angle between (*this) and x2 is the distance, the quaternion
|
||||
// object has it implemented internally
|
||||
|
|
Loading…
Reference in New Issue