--- trunk/src/math/Triangle.hpp 2009/11/25 20:02:06 1390 +++ trunk/src/math/Triangle.hpp 2013/06/16 15:15:42 1879 @@ -1,4 +1,4 @@ -/* 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 @@ -34,17 +34,17 @@ * * [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). + * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (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 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.6 2009-11-25 20:02:01 gezelter Exp $ + * @version $Id$ * */ @@ -79,6 +79,10 @@ namespace OpenMD { normal_ = normal; HaveNormal_ = true; } + void setUnitNormal(Vector3d normal) { + unitnormal_ = normal; + HaveUnitNormal_ = true; + } void addVertices(Vector3d P1, Vector3d P2, Vector3d P3); @@ -100,6 +104,13 @@ namespace OpenMD { return computeNormal(); } } + Vector3d getUnitNormal() { + if (HaveUnitNormal_) { + return unitnormal_; + } else { + return computeUnitNormal(); + } + } RealType getArea() { if(HaveArea_){ @@ -112,6 +123,7 @@ namespace OpenMD { RealType computeArea(); Vector3d computeNormal(); Vector3d computeCentroid(); + Vector3d computeUnitNormal(); void setCentroid(Vector3d centroid) { centroid_ = centroid; @@ -177,7 +189,6 @@ namespace OpenMD { 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); } @@ -190,9 +201,10 @@ namespace OpenMD { /* 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 @@ -200,6 +212,7 @@ namespace OpenMD { RealType alpha_,beta_,gamma_; bool HaveArea_; bool HaveNormal_; + bool HaveUnitNormal_; bool HaveCentroid_; }; // End class Triangle