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

Comparing branches/development/src/integrators/LDForceManager.cpp (file contents):
Revision 1465 by chuckv, Fri Jul 9 23:08:25 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   #include <fstream>
43   #include <iostream>
# Line 46 | Line 47
47   #include "hydrodynamics/Sphere.hpp"
48   #include "hydrodynamics/Ellipsoid.hpp"
49   #include "utils/ElementsTable.hpp"
50 + #include "types/LennardJonesAdapter.hpp"
51 + #include "types/GayBerneAdapter.hpp"
52  
53   namespace OpenMD {
54  
# Line 156 | Line 159 | namespace OpenMD {
159            if (integrableObject->isAtom()){
160              Atom* atom = static_cast<Atom*>(integrableObject);
161              AtomType* atomType = atom->getAtomType();
162 <            if (atomType->isGayBerne()) {
163 <              DirectionalAtomType* dAtomType = dynamic_cast<DirectionalAtomType*>(atomType);              
164 <              GenericData* data = dAtomType->getPropertyByName("GayBerne");
165 <              if (data != NULL) {
166 <                GayBerneParamGenericData* gayBerneData = dynamic_cast<GayBerneParamGenericData*>(data);
164 <                
165 <                if (gayBerneData != NULL) {  
166 <                  GayBerneParam gayBerneParam = gayBerneData->getData();
167 <                  currShape = new Ellipsoid(V3Zero,
168 <                                            gayBerneParam.GB_l / 2.0,
169 <                                            gayBerneParam.GB_d / 2.0,
170 <                                            Mat3x3d::identity());
171 <                } else {
172 <                  sprintf( painCave.errMsg,
173 <                           "Can not cast GenericData to GayBerneParam\n");
174 <                  painCave.severity = OPENMD_ERROR;
175 <                  painCave.isFatal = 1;
176 <                  simError();  
177 <                }
178 <              } else {
179 <                sprintf( painCave.errMsg, "Can not find Parameters for GayBerne\n");
180 <                painCave.severity = OPENMD_ERROR;
181 <                painCave.isFatal = 1;
182 <                simError();    
183 <              }
162 >            GayBerneAdapter gba = GayBerneAdapter(atomType);
163 >            if (gba.isGayBerne()) {
164 >              currShape = new Ellipsoid(V3Zero, gba.getL() / 2.0,
165 >                                        gba.getD() / 2.0,
166 >                                        Mat3x3d::identity());
167              } else {
168 <              if (atomType->isLennardJones()){
169 <                GenericData* data = atomType->getPropertyByName("LennardJones");
170 <                if (data != NULL) {
188 <                  LJParamGenericData* ljData = dynamic_cast<LJParamGenericData*>(data);
189 <                  if (ljData != NULL) {
190 <                    LJParam ljParam = ljData->getData();
191 <                    currShape = new Sphere(atom->getPos(), ljParam.sigma/2.0);
192 <                  } else {
193 <                    sprintf( painCave.errMsg,
194 <                             "Can not cast GenericData to LJParam\n");
195 <                    painCave.severity = OPENMD_ERROR;
196 <                    painCave.isFatal = 1;
197 <                    simError();          
198 <                  }      
199 <                }
168 >              LennardJonesAdapter lja = LennardJonesAdapter(atomType);
169 >              if (lja.isLennardJones()){
170 >                currShape = new Sphere(atom->getPos(), lja.getSigma()/2.0);
171                } else {
172                  int aNum = etab.GetAtomicNum((atom->getType()).c_str());
173                  if (aNum != 0) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines