--- trunk/src/applications/hydrodynamics/HydrodynamicsModel.cpp 2006/05/24 18:31:12 972 +++ trunk/src/applications/hydrodynamics/HydrodynamicsModel.cpp 2009/11/25 20:02:06 1390 @@ -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,6 +28,15 @@ * 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] Vardeman & Gezelter, in progress (2009). */ #include "applications/hydrodynamics/HydrodynamicsModel.hpp" #include "hydrodynamics/Shape.hpp" @@ -44,110 +44,130 @@ #include "hydrodynamics/Ellipsoid.hpp" #include "applications/hydrodynamics/CompositeShape.hpp" -namespace oopse { +namespace OpenMD { bool HydrodynamicsModel::calcHydroProps(Shape* shape, RealType viscosity, RealType temperature) { return false; } void HydrodynamicsModel::writeHydroProps(std::ostream& os) { + + Vector3d center; + Mat6x6d Xi, D; - os << sd_->getType() << "\t"; //center of resistance - os << cr_.center[0] << "\t" << cr_.center[1] << "\t" << cr_.center[2] << "\t"; + + center = cr_->getCOR(); + + os << center[0] << "\t" << center[1] << "\t" << center[2] << "\t"; //resistance tensor at center of resistance //translation - os << cr_.Xi(0, 0) << "\t" << cr_.Xi(0, 1) << "\t" << cr_.Xi(0, 2) << "\t" - << cr_.Xi(1, 0) << "\t" << cr_.Xi(1, 1) << "\t" << cr_.Xi(1, 2) << "\t" - << cr_.Xi(2, 0) << "\t" << cr_.Xi(2, 1) << "\t" << cr_.Xi(2, 2) << "\t"; + + Xi = cr_->getXi(); + + os << Xi(0, 0) << "\t" << Xi(0, 1) << "\t" << Xi(0, 2) << "\t" + << Xi(1, 0) << "\t" << Xi(1, 1) << "\t" << Xi(1, 2) << "\t" + << Xi(2, 0) << "\t" << Xi(2, 1) << "\t" << Xi(2, 2) << "\t"; //rotation-translation - os << cr_.Xi(0, 3) << "\t" << cr_.Xi(0, 4) << "\t" << cr_.Xi(0, 5) << "\t" - << cr_.Xi(1, 3) << "\t" << cr_.Xi(1, 4) << "\t" << cr_.Xi(1, 5) << "\t" - << cr_.Xi(2, 3) << "\t" << cr_.Xi(2, 4) << "\t" << cr_.Xi(2, 5) << "\t"; + os << Xi(0, 3) << "\t" << Xi(0, 4) << "\t" << Xi(0, 5) << "\t" + << Xi(1, 3) << "\t" << Xi(1, 4) << "\t" << Xi(1, 5) << "\t" + << Xi(2, 3) << "\t" << Xi(2, 4) << "\t" << Xi(2, 5) << "\t"; //translation-rotation - os << cr_.Xi(3, 0) << "\t" << cr_.Xi(3, 1) << "\t" << cr_.Xi(3, 2) << "\t" - << cr_.Xi(4, 0) << "\t" << cr_.Xi(4, 1) << "\t" << cr_.Xi(4, 2) << "\t" - << cr_.Xi(5, 0) << "\t" << cr_.Xi(5, 1) << "\t" << cr_.Xi(5, 2) << "\t"; + os << Xi(3, 0) << "\t" << Xi(3, 1) << "\t" << Xi(3, 2) << "\t" + << Xi(4, 0) << "\t" << Xi(4, 1) << "\t" << Xi(4, 2) << "\t" + << Xi(5, 0) << "\t" << Xi(5, 1) << "\t" << Xi(5, 2) << "\t"; //rotation - os << cr_.Xi(3, 3) << "\t" << cr_.Xi(3, 4) << "\t" << cr_.Xi(3, 5) << "\t" - << cr_.Xi(4, 3) << "\t" << cr_.Xi(4, 4) << "\t" << cr_.Xi(4, 5) << "\t" - << cr_.Xi(5, 3) << "\t" << cr_.Xi(5, 4) << "\t" << cr_.Xi(5, 5) << "\t"; + os << Xi(3, 3) << "\t" << Xi(3, 4) << "\t" << Xi(3, 5) << "\t" + << Xi(4, 3) << "\t" << Xi(4, 4) << "\t" << Xi(4, 5) << "\t" + << Xi(5, 3) << "\t" << Xi(5, 4) << "\t" << Xi(5, 5) << "\t"; //diffusion tensor at center of resistance //translation - os << cr_.D(0, 0) << "\t" << cr_.D(0, 1) << "\t" << cr_.D(0, 2) << "\t" - << cr_.D(1, 0) << "\t" << cr_.D(1, 1) << "\t" << cr_.D(1, 2) << "\t" - << cr_.D(2, 0) << "\t" << cr_.D(2, 1) << "\t" << cr_.D(2, 2) << "\t"; + + D = cr_->getD(); + + os << D(0, 0) << "\t" << D(0, 1) << "\t" << D(0, 2) << "\t" + << D(1, 0) << "\t" << D(1, 1) << "\t" << D(1, 2) << "\t" + << D(2, 0) << "\t" << D(2, 1) << "\t" << D(2, 2) << "\t"; //rotation-translation - os << cr_.D(0, 3) << "\t" << cr_.D(0, 4) << "\t" << cr_.D(0, 5) << "\t" - << cr_.D(1, 3) << "\t" << cr_.D(1, 4) << "\t" << cr_.D(1, 5) << "\t" - << cr_.D(2, 3) << "\t" << cr_.D(2, 4) << "\t" << cr_.D(2, 5) << "\t"; + os << D(0, 3) << "\t" << D(0, 4) << "\t" << D(0, 5) << "\t" + << D(1, 3) << "\t" << D(1, 4) << "\t" << D(1, 5) << "\t" + << D(2, 3) << "\t" << D(2, 4) << "\t" << D(2, 5) << "\t"; //translation-rotation - os << cr_.D(3, 0) << "\t" << cr_.D(3, 1) << "\t" << cr_.D(3, 2) << "\t" - << cr_.D(4, 0) << "\t" << cr_.D(4, 1) << "\t" << cr_.D(4, 2) << "\t" - << cr_.D(5, 0) << "\t" << cr_.D(5, 1) << "\t" << cr_.D(5, 2) << "\t"; + os << D(3, 0) << "\t" << D(3, 1) << "\t" << D(3, 2) << "\t" + << D(4, 0) << "\t" << D(4, 1) << "\t" << D(4, 2) << "\t" + << D(5, 0) << "\t" << D(5, 1) << "\t" << D(5, 2) << "\t"; //rotation - os << cr_.D(3, 3) << "\t" << cr_.D(3, 4) << "\t" << cr_.D(3, 5) << "\t" - << cr_.D(4, 3) << "\t" << cr_.D(4, 4) << "\t" << cr_.D(4, 5) << "\t" - << cr_.D(5, 3) << "\t" << cr_.D(5, 4) << "\t" << cr_.D(5, 5) << "\t"; + os << D(3, 3) << "\t" << D(3, 4) << "\t" << D(3, 5) << "\t" + << D(4, 3) << "\t" << D(4, 4) << "\t" << D(4, 5) << "\t" + << D(5, 3) << "\t" << D(5, 4) << "\t" << D(5, 5) << "\t"; //--------------------------------------------------------------------- //center of diffusion - os << cd_.center[0] << "\t" << cd_.center[1] << "\t" << cd_.center[2] << "\t"; + + center = cd_->getCOR(); + + os << center[0] << "\t" << center[1] << "\t" << center[2] << "\t"; //resistance tensor at center of diffusion //translation - os << cd_.Xi(0, 0) << "\t" << cd_.Xi(0, 1) << "\t" << cd_.Xi(0, 2) << "\t" - << cd_.Xi(1, 0) << "\t" << cd_.Xi(1, 1) << "\t" << cd_.Xi(1, 2) << "\t" - << cd_.Xi(2, 0) << "\t" << cd_.Xi(2, 1) << "\t" << cd_.Xi(2, 2) << "\t"; + + Xi = cd_->getXi(); + + os << Xi(0, 0) << "\t" << Xi(0, 1) << "\t" << Xi(0, 2) << "\t" + << Xi(1, 0) << "\t" << Xi(1, 1) << "\t" << Xi(1, 2) << "\t" + << Xi(2, 0) << "\t" << Xi(2, 1) << "\t" << Xi(2, 2) << "\t"; //rotation-translation - os << cd_.Xi(0, 3) << "\t" << cd_.Xi(0, 4) << "\t" << cd_.Xi(0, 5) << "\t" - << cd_.Xi(1, 3) << "\t" << cd_.Xi(1, 4) << "\t" << cd_.Xi(1, 5) << "\t" - << cd_.Xi(2, 3) << "\t" << cd_.Xi(2, 4) << "\t" << cd_.Xi(2, 5) << "\t"; + os << Xi(0, 3) << "\t" << Xi(0, 4) << "\t" << Xi(0, 5) << "\t" + << Xi(1, 3) << "\t" << Xi(1, 4) << "\t" << Xi(1, 5) << "\t" + << Xi(2, 3) << "\t" << Xi(2, 4) << "\t" << Xi(2, 5) << "\t"; //translation-rotation - os << cd_.Xi(3, 0) << "\t" << cd_.Xi(3, 1) << "\t" << cd_.Xi(3, 2) << "\t" - << cd_.Xi(4, 0) << "\t" << cd_.Xi(4, 1) << "\t" << cd_.Xi(4, 2) << "\t" - << cd_.Xi(5, 0) << "\t" << cd_.Xi(5, 1) << "\t" << cd_.Xi(5, 2) << "\t"; + os << Xi(3, 0) << "\t" << Xi(3, 1) << "\t" << Xi(3, 2) << "\t" + << Xi(4, 0) << "\t" << Xi(4, 1) << "\t" << Xi(4, 2) << "\t" + << Xi(5, 0) << "\t" << Xi(5, 1) << "\t" << Xi(5, 2) << "\t"; //rotation - os << cd_.Xi(3, 3) << "\t" << cd_.Xi(3, 4) << "\t" << cd_.Xi(3, 5) << "\t" - << cd_.Xi(4, 3) << "\t" << cd_.Xi(4, 4) << "\t" << cd_.Xi(4, 5) << "\t" - << cd_.Xi(5, 3) << "\t" << cd_.Xi(5, 4) << "\t" << cd_.Xi(5, 5) << "\t"; + os << Xi(3, 3) << "\t" << Xi(3, 4) << "\t" << Xi(3, 5) << "\t" + << Xi(4, 3) << "\t" << Xi(4, 4) << "\t" << Xi(4, 5) << "\t" + << Xi(5, 3) << "\t" << Xi(5, 4) << "\t" << Xi(5, 5) << "\t"; //diffusion tensor at center of diffusion //translation - os << cd_.D(0, 0) << "\t" << cd_.D(0, 1) << "\t" << cd_.D(0, 2) << "\t" - << cd_.D(1, 0) << "\t" << cd_.D(1, 1) << "\t" << cd_.D(1, 2) << "\t" - << cd_.D(2, 0) << "\t" << cd_.D(2, 1) << "\t" << cd_.D(2, 2) << "\t"; + + D = cd_->getD(); + + os << D(0, 0) << "\t" << D(0, 1) << "\t" << D(0, 2) << "\t" + << D(1, 0) << "\t" << D(1, 1) << "\t" << D(1, 2) << "\t" + << D(2, 0) << "\t" << D(2, 1) << "\t" << D(2, 2) << "\t"; //rotation-translation - os << cd_.D(0, 3) << "\t" << cd_.D(0, 4) << "\t" << cd_.D(0, 5) << "\t" - << cd_.D(1, 3) << "\t" << cd_.D(1, 4) << "\t" << cd_.D(1, 5) << "\t" - << cd_.D(2, 3) << "\t" << cd_.D(2, 4) << "\t" << cd_.D(2, 5) << "\t"; + os << D(0, 3) << "\t" << D(0, 4) << "\t" << D(0, 5) << "\t" + << D(1, 3) << "\t" << D(1, 4) << "\t" << D(1, 5) << "\t" + << D(2, 3) << "\t" << D(2, 4) << "\t" << D(2, 5) << "\t"; //translation-rotation - os << cd_.D(3, 0) << "\t" << cd_.D(3, 1) << "\t" << cd_.D(3, 2) << "\t" - << cd_.D(4, 0) << "\t" << cd_.D(4, 1) << "\t" << cd_.D(4, 2) << "\t" - << cd_.D(5, 0) << "\t" << cd_.D(5, 1) << "\t" << cd_.D(5, 2) << "\t"; + os << D(3, 0) << "\t" << D(3, 1) << "\t" << D(3, 2) << "\t" + << D(4, 0) << "\t" << D(4, 1) << "\t" << D(4, 2) << "\t" + << D(5, 0) << "\t" << D(5, 1) << "\t" << D(5, 2) << "\t"; //rotation - os << cd_.D(3, 3) << "\t" << cd_.D(3, 4) << "\t" << cd_.D(3, 5) << "\t" - << cd_.D(4, 3) << "\t" << cd_.D(4, 4) << "\t" << cd_.D(4, 5) << "\t" - << cd_.D(5, 3) << "\t" << cd_.D(5, 4) << "\t" << cd_.D(5, 5) << "\n"; + os << D(3, 3) << "\t" << D(3, 4) << "\t" << D(3, 5) << "\t" + << D(4, 3) << "\t" << D(4, 4) << "\t" << D(4, 5) << "\t" + << D(5, 3) << "\t" << D(5, 4) << "\t" << D(5, 5) << "\n"; }