ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/Thermo.cpp
(Generate patch)

Comparing branches/development/src/brains/Thermo.cpp (file contents):
Revision 1503 by gezelter, Sat Oct 2 19:54:41 2010 UTC vs.
Revision 1710 by gezelter, Fri May 18 21:44:02 2012 UTC

# Line 36 | Line 36
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).          
39 < * [4]  Vardeman & Gezelter, in progress (2009).                        
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   #include <math.h>
# Line 50 | Line 51
51   #include "primitives/Molecule.hpp"
52   #include "utils/simError.h"
53   #include "utils/PhysicalConstants.hpp"
54 + #include "types/MultipoleAdapter.hpp"
55  
56   namespace OpenMD {
57  
# Line 208 | Line 210 | namespace OpenMD {
210  
211      RealType volume = this->getVolume();
212      Snapshot* curSnapshot = info_->getSnapshotManager()->getCurrentSnapshot();
213 <    Mat3x3d tau = curSnapshot->statData.getTau();
213 >    Mat3x3d tau = curSnapshot->getTau();
214  
215      pressureTensor =  (p_global + PhysicalConstants::energyConvert* tau)/volume;
216      
# Line 363 | Line 365 | namespace OpenMD {
365            }
366          }
367          
368 <        if (atom->isDipole() ) {
368 >        MultipoleAdapter ma = MultipoleAdapter(atom->getAtomType());
369 >        if (ma.isDipole() ) {
370            Vector3d u_i = atom->getElectroFrame().getColumn(2);
371 <          GenericData* data = dynamic_cast<DirectionalAtomType*>(atom->getAtomType())->getPropertyByName("Dipole");
372 <          if (data != NULL) {
373 <            moment = (dynamic_cast<DoubleGenericData*>(data))->getData();
371 <            
372 <            moment *= debyeToCm;
373 <            dipoleVector += u_i * moment;
374 <          }
371 >          moment = ma.getDipoleMoment();
372 >          moment *= debyeToCm;
373 >          dipoleVector += u_i * moment;
374          }
375        }
376      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines