ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/nonbonded/Electrostatic.hpp
Revision: 1993
Committed: Tue Apr 29 17:32:31 2014 UTC (11 years, 3 months ago) by gezelter
File size: 8469 byte(s)
Log Message:
Added sitePotentials for the Choi et al. potential-frequency maps for nitriles

File Contents

# Content
1 /*
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 * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).
39 * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010).
40 * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41 */
42
43 #ifndef NONBONDED_ELECTROSTATIC_HPP
44 #define NONBONDED_ELECTROSTATIC_HPP
45
46 #include "nonbonded/NonBondedInteraction.hpp"
47 #include "types/AtomType.hpp"
48 #include "brains/ForceField.hpp"
49 #include "math/SquareMatrix3.hpp"
50 #include "math/CubicSpline.hpp"
51 #include "brains/SimInfo.hpp"
52 #include "flucq/FluctuatingChargeForces.hpp"
53
54 namespace OpenMD {
55
56 struct ElectrostaticAtomData {
57 bool is_Charge;
58 bool is_Dipole;
59 bool is_Quadrupole;
60 bool is_Fluctuating;
61 bool has_MultipleMinima;
62 RealType fixedCharge;
63 RealType hardness;
64 RealType electronegativity;
65 int slaterN;
66 RealType slaterZeta;
67 RealType curvature;
68 RealType coupling;
69 vector<pair<int, RealType> > diabats;
70 Vector3d dipole;
71 Mat3x3d quadrupole;
72 };
73
74 enum ElectrostaticSummationMethod{
75 esm_HARD,
76 esm_SWITCHING_FUNCTION,
77 esm_SHIFTED_POTENTIAL,
78 esm_SHIFTED_FORCE,
79 esm_TAYLOR_SHIFTED,
80 esm_REACTION_FIELD,
81 esm_EWALD_FULL,
82 esm_EWALD_PME, /**< PME Ewald methods aren't supported yet */
83 esm_EWALD_SPME /**< SPME Ewald methods aren't supported yet */
84 };
85
86 enum ElectrostaticScreeningMethod{
87 UNDAMPED,
88 DAMPED
89 };
90
91 class Electrostatic : public ElectrostaticInteraction {
92
93 public:
94 Electrostatic();
95 void setForceField(ForceField *ff);
96 void setSimulatedAtomTypes(set<AtomType*> &simtypes);
97 void setSimInfo(SimInfo* info) {info_ = info;};
98 void addType(AtomType* atomType);
99 virtual void calcForce(InteractionData &idat);
100 virtual void calcSelfCorrection(SelfData &sdat);
101 virtual string getName() {return name_;}
102 virtual RealType getSuggestedCutoffRadius(pair<AtomType*, AtomType*> atypes);
103 void setCutoffRadius( RealType rCut );
104 void setElectrostaticSummationMethod( ElectrostaticSummationMethod esm );
105 void setElectrostaticScreeningMethod( ElectrostaticScreeningMethod sm );
106 void setDampingAlpha( RealType alpha );
107 void setReactionFieldDielectric( RealType dielectric );
108 void ReciprocalSpaceSum(RealType &pot);
109
110 private:
111 void initialize();
112 string name_;
113 bool initialized_;
114 bool haveCutoffRadius_;
115 bool haveDampingAlpha_;
116 bool haveDielectric_;
117 bool haveElectroSplines_;
118
119 int nElectro_;
120 int nFlucq_;
121
122 set<int> Etypes; /**< The set of AtomType idents that are Electrostatic types */
123 vector<int> Etids; /**< The mapping from AtomType ident -> Electrostatic ident */
124 set<int> FQtypes; /**< The set of AtomType idents that are fluctuating types */
125 vector<int> FQtids; /**< The mapping from AtomType ident -> fluctuating ident */
126 vector<ElectrostaticAtomData> ElectrostaticMap; /**< data about Electrostatic types */
127 vector<vector<CubicSpline*> > Jij; /**< Coulomb integral for two fq types */
128
129
130 SimInfo* info_;
131 ForceField* forceField_;
132 FluctuatingChargeForces* flucQ_;
133 set<AtomType*> simTypes_;
134 RealType cutoffRadius_;
135 RealType pre11_;
136 RealType pre12_;
137 RealType pre22_;
138 RealType pre14_;
139 RealType pre24_;
140 RealType pre44_;
141 RealType v01, v11, v21, v22, v31, v32, v41, v42, v43;
142 RealType dv01, dv11, dv21, dv22, dv31, dv32, dv41, dv42, dv43;
143 RealType v01or, v11or, v21or, v22or, v31or, v32or, v41or, v42or, v43or;
144 RealType chargeToC_;
145 RealType angstromToM_;
146 RealType debyeToCm_;
147 int np_;
148 ElectrostaticSummationMethod summationMethod_;
149 ElectrostaticScreeningMethod screeningMethod_;
150 map<string, ElectrostaticSummationMethod> summationMap_;
151 map<string, ElectrostaticScreeningMethod> screeningMap_;
152 RealType dampingAlpha_;
153 RealType dielectric_;
154 RealType preRF_;
155 RealType selfMult1_;
156 RealType selfMult2_;
157 RealType selfMult4_;
158
159 CubicSpline* v01s;
160 CubicSpline* v11s;
161 CubicSpline* v21s;
162 CubicSpline* v22s;
163 CubicSpline* v31s;
164 CubicSpline* v32s;
165 CubicSpline* v41s;
166 CubicSpline* v42s;
167 CubicSpline* v43s;
168
169 ElectrostaticAtomData data1;
170 ElectrostaticAtomData data2;
171 RealType C_a, C_b; // Charges
172 Vector3d D_a, D_b; // Dipoles (space-fixed)
173 Mat3x3d Q_a, Q_b; // Quadrupoles (space-fixed)
174
175 RealType ri; // Distance utility scalar
176 RealType rdDa, rdDb; // Dipole utility scalars
177 Vector3d rxDa, rxDb; // Dipole utility vectors
178 RealType rdQar, rdQbr, trQa, trQb; // Quadrupole utility scalars
179 Vector3d Qar, Qbr, rQa, rQb, rxQar, rxQbr; // Quadrupole utility vectors
180 RealType pref;
181
182 RealType DadDb, trQaQb, DadQbr, DbdQar; // Cross-interaction scalars
183 RealType rQaQbr;
184 Vector3d DaxDb, DadQb, DbdQa, DaxQbr, DbxQar; // Cross-interaction vectors
185 Vector3d rQaQb, QaQbr, QaxQb, rQaxQbr;
186 Mat3x3d QaQb; // Cross-interaction matrices
187
188 RealType U; // Potential
189 Vector3d F; // Force
190 Vector3d Ta; // Torque on site a
191 Vector3d Tb; // Torque on site b
192 Vector3d Ea; // Electric field at site a
193 Vector3d Eb; // Electric field at site b
194 RealType Pa; // Site potential at site a
195 RealType Pb; // Site potential at site b
196 RealType dUdCa; // fluctuating charge force at site a
197 RealType dUdCb; // fluctuating charge force at site a
198
199 // Indirect interactions mediated by the reaction field.
200 RealType indirect_Pot; // Potential
201 Vector3d indirect_F; // Force
202 Vector3d indirect_Ta; // Torque on site a
203 Vector3d indirect_Tb; // Torque on site b
204
205 // Excluded potential that is still computed for fluctuating charges
206 RealType excluded_Pot;
207
208 RealType rfContrib, coulInt, dJdr;
209
210 // spline for coulomb integral
211 CubicSpline* J;
212 Vector3d rhat;
213
214 // logicals
215
216 bool a_is_Charge;
217 bool a_is_Dipole;
218 bool a_is_Quadrupole;
219 bool a_is_Fluctuating;
220
221 bool b_is_Charge;
222 bool b_is_Dipole;
223 bool b_is_Quadrupole;
224 bool b_is_Fluctuating;
225
226
227 /*
228 CubicSpline* dv01s;
229 CubicSpline* dv11s;
230 CubicSpline* dv21s;
231 CubicSpline* dv22s;
232 CubicSpline* dv31s;
233 CubicSpline* dv32s;
234 CubicSpline* dv41s;
235 CubicSpline* dv42s;
236 CubicSpline* dv43s;
237 */
238 };
239 }
240
241
242 #endif

Properties

Name Value
svn:eol-style native