--- trunk/src/math/Triangle.hpp 2008/12/05 16:20:39 1325 +++ trunk/src/math/Triangle.hpp 2012/08/31 17:29:35 1792 @@ -1,23 +1,14 @@ -/* Copyright (c) 2008 The University of Notre Dame. All Rights Reserved. +/* Copyright (c) 2008, 2010 The University of Notre Dame. All Rights Reserved. * * The University of Notre Dame grants you ("Licensee") a * non-exclusive, royalty free, license to use, modify and * 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,14 +28,23 @@ * 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). + * [4] , Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). * * * Triangle.hpp * - * Purpose: Provide basic triangle class for oopse. Hates Particle class. + * Purpose: Provide basic triangle class for OpenMD. Hates Particle class. * * Created by Charles F. Vardeman II on 29 July 2008. * @author Charles F. Vardeman II - * @version $Id: Triangle.hpp,v 1.4 2008-12-05 16:20:39 chuckv Exp $ + * @version $Id$ * */ @@ -53,18 +53,19 @@ #define MATH_FACET_HPP #include "math/Vector3.hpp" +#include "math/SquareMatrix3.hpp" #include "config.h" #include "primitives/StuntDouble.hpp" #include -namespace oopse { +namespace OpenMD { /** * @class Triangle * - * Triangle provides geometric data to oopse. Triangle includes + * Triangle provides geometric data to OpenMD. Triangle includes * information about the normal, centroid and the atoms * that belong to this triangle. */ @@ -78,6 +79,10 @@ namespace oopse { normal_ = normal; HaveNormal_ = true; } + void setUnitNormal(Vector3d normal) { + unitnormal_ = normal; + HaveUnitNormal_ = true; + } void addVertices(Vector3d P1, Vector3d P2, Vector3d P3); @@ -99,6 +104,13 @@ namespace oopse { return computeNormal(); } } + Vector3d getUnitNormal() { + if (HaveUnitNormal_) { + return unitnormal_; + } else { + return computeUnitNormal(); + } + } RealType getArea() { if(HaveArea_){ @@ -111,6 +123,7 @@ namespace oopse { RealType computeArea(); Vector3d computeNormal(); Vector3d computeCentroid(); + Vector3d computeUnitNormal(); void setCentroid(Vector3d centroid) { centroid_ = centroid; @@ -176,19 +189,22 @@ namespace oopse { RealType t2 = -a1 + b1 + c1; RealType t3 = a1 - b1 + c1; RealType t4 = a1 + b1 - c1; - RealType junk = t1*t2*t3*t4; return a1 * b1 * c1 / sqrt(t1 * t2 * t3 * t4); } + Mat3x3d computeHydrodynamicTensor(RealType viscosity); private: + Mat3x3d hydro_tensor(const Vector3d& ri, const Vector3d& rj0, const Vector3d& rj1, const Vector3d& rj2,RealType s, RealType viscosity); + /* Local Indentity of vertex atoms in pos array*/ std::vector vertexSD_; Vector3d normal_; + Vector3d unitnormal_; Vector3d centroid_; Vector3d vertices_[3]; - RealType area_; + RealType area_; RealType mass_; Vector3d facetVelocity_; //Length of triangle sides @@ -196,13 +212,14 @@ namespace oopse { RealType alpha_,beta_,gamma_; bool HaveArea_; bool HaveNormal_; + bool HaveUnitNormal_; bool HaveCentroid_; }; // End class Triangle -} //End Namespace oopse +} //end namespace OpenMD