--- trunk/src/applications/staticProps/BondOrderParameter.hpp 2006/06/27 16:19:28 994 +++ trunk/src/applications/staticProps/BondOrderParameter.hpp 2012/08/22 02:28:28 1782 @@ -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,41 +28,102 @@ * 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). + * [4] , Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). * + * Created by J. Daniel Gezelter on 09/26/06 + * @author J. Daniel Gezelter + * @version $Id$ + * */ -#ifndef APPLICATIONS_STATICPROPS_P2ORDERPARAMETER_HPP -#define APPLICATIONS_STATICPROPS_P2ORDERPARAMETER_HPP + +#ifndef APPLICATIONS_STATICPROPS_BONDORDERPARAMETER_HPP +#define APPLICATIONS_STATICPROPS_BONDORDERPARAMETER_HPP #include "selection/SelectionEvaluator.hpp" #include "selection/SelectionManager.hpp" #include "applications/staticProps/StaticAnalyser.hpp" +#include "math/Vector3.hpp" +#include "math/SphericalHarmonic.hpp" -namespace oopse { +namespace OpenMD { - class P2OrderParameter : public StaticAnalyser{ - public: - P2OrderParameter(SimInfo* info, const std::string& filename, const std::string& sele1, const std::string& sele2); - virtual void process(); + /** + * @class BondOrderParameter + * @brief Bond Order Parameter + * + * Computes orientational bond order parameters as outlined in: + * + * "Bond-orientaional order in liquids and glasses," by + * P. J. Steinhart, D. R. Nelson, and M. Ronchetti, + * Phys. Rev. B, 28, 784 (1983). + * + * A somewhat more useful reference which has formulae for these order + * parameters for individual atoms is: + * + * "Numerical calculation of the rate of crystal nucleation in a + * Lennard-Jones system at moderate undercooling," by + * Pieter Rein ten Wolde, Maria J. Ruiz-Montero, and Daan Frenkel, + * J. Chem. Phys. 104, pp. 9932-9947 (1996). + * + * Note that this version uses a single cutoff radius to decide + * membership in the list of neighbors, and does not have use a + * distance-dependent weighting as used in the second reference above. + * + * The selection script can be utilized to look at specific types of + * central atoms. A dynamic selector can also be utilized. By default, + * this class computes the Q_{l} and \hat{W}_{l} parameters up to l = 12. + * The completed configurational averages of these values as + * well as the distributions of atomic q_{l} and \hat{w}_{l} values + * are then placed in .boq and .bow files. + */ + class BondOrderParameter : public StaticAnalyser{ + public: + BondOrderParameter(SimInfo* info, const std::string& filename, + const std::string& sele, double rCut, int nbins); + + virtual ~BondOrderParameter(); + virtual void process(); + + private: + virtual void initalizeHistogram(); + virtual void collectHistogram(std::vector q, + std::vector what); + void writeOrderParameter(std::vector Q, + std::vector What); - private: - - struct OrderParam{ - RealType p2; - Vector3d director; - RealType angle; - }; - void writeP2(); - - Snapshot* currentSnapshot_; - - std::string selectionScript1_; - std::string selectionScript2_; - SelectionManager seleMan1_; - SelectionManager seleMan2_; - SelectionEvaluator evaluator1_; - SelectionEvaluator evaluator2_; - std::vector > sdPairs_; /**< each pair is used to define a vector, vector = first - second */ - std::vector orderParams_; + Snapshot* currentSnapshot_; + std::string selectionScript_; + SelectionManager seleMan_; + SelectionEvaluator evaluator_; - }; + RealType rCut_; + static const int lMax_ = 12; + int frameCounter_; + int nBins_; + + std::map,int> m2Min; + std::map,int> m2Max; + std::map,std::vector > w3j; + + RealType MinQ_; + RealType MaxQ_; + RealType deltaQ_; + std::vector Qcount_; + std::map,int> Q_histogram_; + + RealType MinW_; + RealType MaxW_; + RealType deltaW_; + std::vector Wcount_; + std::map,int> W_histogram_; + }; } #endif