--- trunk/src/math/Triangle.hpp 2009/05/13 22:27:29 1344 +++ trunk/src/math/Triangle.hpp 2010/01/15 20:46:49 1404 @@ -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] Vardeman & Gezelter, in progress (2009). * + * * 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.5 2009-05-13 22:27:29 gezelter Exp $ + * @version $Id: Triangle.hpp,v 1.6 2009-11-25 20:02:01 gezelter Exp $ * */ @@ -60,12 +60,12 @@ #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. */ @@ -79,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); @@ -100,6 +104,13 @@ namespace oopse { return computeNormal(); } } + Vector3d getUnitNormal() { + if (HaveUnitNormal_) { + return unitnormal_; + } else { + return computeUnitNormal(); + } + } RealType getArea() { if(HaveArea_){ @@ -112,6 +123,7 @@ namespace oopse { RealType computeArea(); Vector3d computeNormal(); Vector3d computeCentroid(); + Vector3d computeUnitNormal(); void setCentroid(Vector3d centroid) { centroid_ = centroid; @@ -190,9 +202,10 @@ namespace oopse { /* 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,13 +213,14 @@ namespace oopse { RealType alpha_,beta_,gamma_; bool HaveArea_; bool HaveNormal_; + bool HaveUnitNormal_; bool HaveCentroid_; }; // End class Triangle -} //End Namespace oopse +} //end namespace OpenMD