ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/nonbonded/Electrostatic.hpp
Revision: 1877
Committed: Thu Jun 6 15:43:35 2013 UTC (12 years, 1 month ago) by gezelter
File size: 5700 byte(s)
Log Message:
New electrostatic method, starting to do some performance tuning.

File Contents

# User Rev Content
1 gezelter 1502 /*
2     * Copyright (c) 2009 The University of Notre Dame. All Rights Reserved.
3     *
4     * The University of Notre Dame grants you ("Licensee") a
5     * non-exclusive, royalty free, license to use, modify and
6     * redistribute this software in source and binary code form, provided
7     * that the following conditions are met:
8     *
9     * 1. Redistributions of source code must retain the above copyright
10     * notice, this list of conditions and the following disclaimer.
11     *
12     * 2. Redistributions in binary form must reproduce the above copyright
13     * notice, this list of conditions and the following disclaimer in the
14     * documentation and/or other materials provided with the
15     * distribution.
16     *
17     * This software is provided "AS IS," without a warranty of any
18     * kind. All express or implied conditions, representations and
19     * warranties, including any implied warranty of merchantability,
20     * fitness for a particular purpose or non-infringement, are hereby
21     * excluded. The University of Notre Dame and its licensors shall not
22     * be liable for any damages suffered by licensee as a result of
23     * using, modifying or distributing the software or its
24     * derivatives. In no event will the University of Notre Dame or its
25     * licensors be liable for any lost revenue, profit or data, or for
26     * direct, indirect, special, consequential, incidental or punitive
27     * damages, however caused and regardless of the theory of liability,
28     * arising out of the use of or inability to use software, even if the
29     * University of Notre Dame has been advised of the possibility of
30     * such damages.
31     *
32     * SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your
33     * research, please cite the appropriate papers when you publish your
34     * work. Good starting points are:
35     *
36     * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).
37     * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).
38 gezelter 1850 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
39 gezelter 1665 * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010).
40     * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41 gezelter 1502 */
42    
43     #ifndef NONBONDED_ELECTROSTATIC_HPP
44     #define NONBONDED_ELECTROSTATIC_HPP
45    
46     #include "nonbonded/NonBondedInteraction.hpp"
47     #include "types/AtomType.hpp"
48 gezelter 1725 #include "brains/ForceField.hpp"
49 gezelter 1502 #include "math/SquareMatrix3.hpp"
50     #include "math/CubicSpline.hpp"
51 gezelter 1584 #include "brains/SimInfo.hpp"
52 gezelter 1502
53     namespace OpenMD {
54    
55     struct ElectrostaticAtomData {
56     bool is_Charge;
57     bool is_Dipole;
58     bool is_Quadrupole;
59 gezelter 1718 bool is_Fluctuating;
60     RealType fixedCharge;
61     RealType hardness;
62     RealType electronegativity;
63 gezelter 1767 int slaterN;
64 gezelter 1718 RealType slaterZeta;
65 gezelter 1787 Vector3d dipole;
66     Mat3x3d quadrupole;
67 gezelter 1502 };
68 gezelter 1718
69 gezelter 1502 enum ElectrostaticSummationMethod{
70 gezelter 1528 esm_HARD,
71     esm_SWITCHING_FUNCTION,
72     esm_SHIFTED_POTENTIAL,
73     esm_SHIFTED_FORCE,
74 gezelter 1877 esm_TAYLOR_SHIFTED,
75 gezelter 1528 esm_REACTION_FIELD,
76     esm_EWALD_FULL, /**< Ewald methods aren't supported yet */
77     esm_EWALD_PME, /**< Ewald methods aren't supported yet */
78     esm_EWALD_SPME /**< Ewald methods aren't supported yet */
79 gezelter 1502 };
80    
81     enum ElectrostaticScreeningMethod{
82     UNDAMPED,
83     DAMPED
84     };
85    
86     class Electrostatic : public ElectrostaticInteraction {
87    
88     public:
89     Electrostatic();
90     void setForceField(ForceField *ff) {forceField_ = ff;};
91 gezelter 1584 void setSimInfo(SimInfo* info) {info_ = info;};
92 gezelter 1502 void addType(AtomType* atomType);
93 gezelter 1536 virtual void calcForce(InteractionData &idat);
94 gezelter 1545 virtual void calcSelfCorrection(SelfData &sdat);
95 gezelter 1502 virtual string getName() {return name_;}
96 gezelter 1545 virtual RealType getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes);
97 gezelter 1584 void setCutoffRadius( RealType rCut );
98 gezelter 1502 void setElectrostaticSummationMethod( ElectrostaticSummationMethod esm );
99     void setElectrostaticScreeningMethod( ElectrostaticScreeningMethod sm );
100     void setDampingAlpha( RealType alpha );
101     void setReactionFieldDielectric( RealType dielectric );
102    
103     private:
104     void initialize();
105     string name_;
106     bool initialized_;
107 gezelter 1528 bool haveCutoffRadius_;
108 gezelter 1502 bool haveDampingAlpha_;
109     bool haveDielectric_;
110 gezelter 1787 bool haveElectroSplines_;
111 gezelter 1502 std::map<int, AtomType*> ElectrostaticList;
112     std::map<AtomType*, ElectrostaticAtomData> ElectrostaticMap;
113 gezelter 1721 map<pair<AtomType*, AtomType*>, CubicSpline*> Jij; /** coulomb integral */
114 gezelter 1584 SimInfo* info_;
115 gezelter 1502 ForceField* forceField_;
116 gezelter 1528 RealType cutoffRadius_;
117 gezelter 1502 RealType pre11_;
118     RealType pre12_;
119     RealType pre22_;
120     RealType pre14_;
121 gezelter 1787 RealType pre24_;
122     RealType pre44_;
123 gezelter 1877 RealType v01, v11, v21, v22, v31, v32, v41, v42, v43;
124     RealType dv01, dv11, dv21, dv22, dv31, dv32, dv41, dv42, dv43;
125     RealType v01or, v11or, v21or, v22or, v31or, v32or, v41or, v42or, v43or;
126 gezelter 1502 RealType chargeToC_;
127     RealType angstromToM_;
128     RealType debyeToCm_;
129     int np_;
130     ElectrostaticSummationMethod summationMethod_;
131     ElectrostaticScreeningMethod screeningMethod_;
132 gezelter 1528 map<string, ElectrostaticSummationMethod> summationMap_;
133     map<string, ElectrostaticScreeningMethod> screeningMap_;
134 gezelter 1502 RealType dampingAlpha_;
135     RealType dielectric_;
136     RealType preRF_;
137 gezelter 1787 RealType selfMult_;
138    
139     CubicSpline* v01s;
140     CubicSpline* v11s;
141     CubicSpline* v21s;
142     CubicSpline* v22s;
143     CubicSpline* v31s;
144     CubicSpline* v32s;
145     CubicSpline* v41s;
146     CubicSpline* v42s;
147     CubicSpline* v43s;
148 gezelter 1877
149     /*
150     CubicSpline* dv01s;
151     CubicSpline* dv11s;
152     CubicSpline* dv21s;
153     CubicSpline* dv22s;
154     CubicSpline* dv31s;
155     CubicSpline* dv32s;
156     CubicSpline* dv41s;
157     CubicSpline* dv42s;
158     CubicSpline* dv43s;
159     */
160 gezelter 1502 };
161     }
162    
163    
164     #endif

Properties

Name Value
svn:eol-style native