--- trunk/src/applications/hydrodynamics/ApproximationModel.cpp 2008/11/24 22:01:56 1322 +++ trunk/src/applications/hydrodynamics/ApproximationModel.cpp 2012/08/31 21:16:10 1793 @@ -6,19 +6,10 @@ * redistribute this software in source and binary code form, provided * that the following conditions are met: * - * 1. Acknowledgement of the program authors must be made in any - * publication of scientific results based in part on use of the - * program. An acceptable form of acknowledgement is citation of - * the article in which the program was described (Matthew - * A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher - * J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented - * Parallel Simulation Engine for Molecular Dynamics," - * J. Comput. Chem. 26, pp. 252-271 (2005)) - * - * 2. Redistributions of source code must retain the above copyright + * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - * 3. Redistributions in binary form must reproduce the above copyright + * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. @@ -37,19 +28,29 @@ * arising out of the use of or inability to use software, even if the * University of Notre Dame has been advised of the possibility of * such damages. + * + * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your + * research, please cite the appropriate papers when you publish your + * work. Good starting points are: + * + * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). + * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #include "applications/hydrodynamics/ApproximationModel.hpp" #include "math/LU.hpp" #include "math/DynamicRectMatrix.hpp" #include "math/SquareMatrix3.hpp" -#include "utils/OOPSEConstant.hpp" +#include "utils/PhysicalConstants.hpp" #include "hydrodynamics/Sphere.hpp" #include "hydrodynamics/Ellipsoid.hpp" #include "applications/hydrodynamics/CompositeShape.hpp" #include "math/LU.hpp" #include "utils/simError.h" -namespace oopse { +namespace OpenMD { /** * Reference: * Beatriz Carrasco and Jose Gracia de la Torre, Hydrodynamic Properties of Rigid Particles: @@ -71,7 +72,6 @@ namespace oopse { bool ApproximationModel::calcHydroProps(Shape* shape, RealType viscosity, RealType temperature) { - bool ret = true; HydroProp* cr = new HydroProp(); HydroProp* cd = new HydroProp(); calcHydroPropsAtCR(beads_, viscosity, temperature, cr); @@ -83,7 +83,7 @@ namespace oopse { bool ApproximationModel::calcHydroPropsAtCR(std::vector& beads, RealType viscosity, RealType temperature, HydroProp* cr) { - int nbeads = beads.size(); + unsigned int nbeads = beads.size(); DynamicRectMatrix B(3*nbeads, 3*nbeads); DynamicRectMatrix C(3*nbeads, 3*nbeads); Mat3x3d I; @@ -120,7 +120,7 @@ namespace oopse { //prepare U Matrix relative to arbitrary origin O(0.0, 0.0, 0.0) std::vector U; - for (int i = 0; i < nbeads; ++i) { + for (unsigned int i = 0; i < nbeads; ++i) { Mat3x3d currU; currU.setupSkewMat(beads[i].pos); U.push_back(currU); @@ -151,11 +151,11 @@ namespace oopse { } // add the volume correction - Xiorr += (6.0 * viscosity * volume) * I; + Xiorr += (RealType(6.0) * viscosity * volume) * I; - Xiott *= OOPSEConstant::viscoConvert; - Xiotr *= OOPSEConstant::viscoConvert; - Xiorr *= OOPSEConstant::viscoConvert; + Xiott *= PhysicalConstants::viscoConvert; + Xiotr *= PhysicalConstants::viscoConvert; + Xiorr *= PhysicalConstants::viscoConvert; Mat3x3d tmp; Mat3x3d tmpInv; @@ -203,14 +203,14 @@ namespace oopse { Dr6x6.getSubMatrix(0, 3, Drrt); Dr6x6.getSubMatrix(3, 0, Drtr); Dr6x6.getSubMatrix(3, 3, Drrr); - RealType kt = OOPSEConstant::kb * temperature ; // in kcal mol^-1 + RealType kt = PhysicalConstants::kb * temperature ; // in kcal mol^-1 Drtt *= kt; Drrt *= kt; Drtr *= kt; Drrr *= kt; - //Xirtt *= OOPSEConstant::kb * temperature; - //Xirtr *= OOPSEConstant::kb * temperature; - //Xirrr *= OOPSEConstant::kb * temperature; + //Xirtt *= PhysicalConstants::kb * temperature; + //Xirtr *= PhysicalConstants::kb * temperature; + //Xirrr *= PhysicalConstants::kb * temperature; Mat6x6d Xi, D; @@ -256,7 +256,7 @@ namespace oopse { bool ApproximationModel::calcHydroPropsAtCD(std::vector& beads, RealType viscosity, RealType temperature, HydroProp* cd) { - int nbeads = beads.size(); + unsigned int nbeads = beads.size(); DynamicRectMatrix B(3*nbeads, 3*nbeads); DynamicRectMatrix C(3*nbeads, 3*nbeads); Mat3x3d I; @@ -293,7 +293,7 @@ namespace oopse { //prepare U Matrix relative to arbitrary origin O(0.0, 0.0, 0.0) std::vector U; - for (int i = 0; i < nbeads; ++i) { + for (unsigned int i = 0; i < nbeads; ++i) { Mat3x3d currU; currU.setupSkewMat(beads[i].pos); U.push_back(currU); @@ -323,13 +323,13 @@ namespace oopse { } } // add the volume correction here: - Xirr += (6.0 * viscosity * volume) * I; + Xirr += (RealType(6.0) * viscosity * volume) * I; - Xitt *= OOPSEConstant::viscoConvert; - Xitr *= OOPSEConstant::viscoConvert; - Xirr *= OOPSEConstant::viscoConvert; + Xitt *= PhysicalConstants::viscoConvert; + Xitr *= PhysicalConstants::viscoConvert; + Xirr *= PhysicalConstants::viscoConvert; - RealType kt = OOPSEConstant::kb * temperature; // in kcal mol^-1 + RealType kt = PhysicalConstants::kb * temperature; // in kcal mol^-1 Mat3x3d Dott; //translational diffusion tensor at arbitrary origin O Mat3x3d Dorr; //rotational diffusion tensor at arbitrary origin O @@ -402,8 +402,8 @@ namespace oopse { //Xidtt in units of kcal*fs*mol^-1*Ang^-2 - //Xid /= OOPSEConstant::energyConvert; - Xid *= OOPSEConstant::kb * temperature; + //Xid /= PhysicalConstants::energyConvert; + Xid *= PhysicalConstants::kb * temperature; Mat6x6d Xi, D;