ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/staticProps/GofRAngle.cpp
(Generate patch)

Comparing trunk/src/applications/staticProps/GofRAngle.cpp (file contents):
Revision 1796 by gezelter, Mon Sep 10 18:38:44 2012 UTC vs.
Revision 1879 by gezelter, Sun Jun 16 15:15:42 2013 UTC

# Line 35 | Line 35
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, 24107 (2008).          
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   */
# Line 43 | Line 43
43   #include <algorithm>
44   #include <fstream>
45   #include "applications/staticProps/GofRAngle.hpp"
46 + #include "primitives/Atom.hpp"
47 + #include "types/MultipoleAdapter.hpp"
48   #include "utils/simError.h"
49  
50   namespace OpenMD {
# Line 157 | Line 159 | namespace OpenMD {
159        currentSnapshot_->wrapVector(r12);
160  
161      r12.normalize();
162 <    Vector3d dipole = sd1->getElectroFrame().getColumn(2);
163 <    dipole.normalize();    
164 <    return dot(r12, dipole);
162 >
163 >    AtomType* atype1 = static_cast<Atom*>(sd1)->getAtomType();
164 >    MultipoleAdapter ma1 = MultipoleAdapter(atype1);
165 >    Vector3d vec;
166 >    if (ma1.isDipole() )
167 >      vec = sd1->getDipole();
168 >    else
169 >      vec = sd1->getA().transpose() * V3Z;
170 >    vec.normalize();    
171 >
172 >    return dot(r12, vec);
173    }
174  
175    RealType GofROmega::evaluateAngle(StuntDouble* sd1, StuntDouble* sd2) {
176 <    Vector3d v1 = sd1->getElectroFrame().getColumn(2);
177 <    Vector3d v2 = sd2->getElectroFrame().getColumn(2);    
176 >
177 >    AtomType* atype1 = static_cast<Atom*>(sd1)->getAtomType();
178 >    AtomType* atype2 = static_cast<Atom*>(sd2)->getAtomType();
179 >
180 >    MultipoleAdapter ma1 = MultipoleAdapter(atype1);
181 >    MultipoleAdapter ma2 = MultipoleAdapter(atype2);
182 >
183 >    Vector3d v1, v2;
184 >
185 >    if (ma1.isDipole() )
186 >      v1 = sd1->getDipole();
187 >    else
188 >      v1 = sd1->getA().transpose() * V3Z;
189 >
190 >    if (ma2.isDipole() )
191 >      v2 = sd2->getDipole();
192 >    else
193 >      v2 = sd2->getA().transpose() * V3Z;
194 >
195      v1.normalize();
196      v2.normalize();
197      return dot(v1, v2);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines