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

Comparing trunk/src/visitors/AtomVisitor.cpp (file contents):
Revision 954 by tim, Wed May 10 01:44:48 2006 UTC vs.
Revision 989 by tim, Sat Jun 17 17:02:33 2006 UTC

# Line 241 | Line 241 | namespace oopse {
241      AtomData* atomData;
242      GenericData* data;
243      bool haveAtomData;
244 <
244 >    AtomType* atomType;
245      //if atom is not SSD atom, just skip it
246 <    if(!isLinearAtom(datom->getType()))
246 >    if(!isLinearAtom(datom->getType()) || !datom->getAtomType()->isGayBerne())
247        return;
248  
249 +    //setup GayBerne type in fortran side
250 +    data = datom->getAtomType()->getPropertyByName("GayBerne");
251 +    if (data != NULL) {
252 +       GayBerneParamGenericData* gayBerneData = dynamic_cast<GayBerneParamGenericData*>(data);
253 +
254 +       if (gayBerneData != NULL) {
255 +           GayBerneParam gayBerneParam = gayBerneData->getData();
256 +
257 +                                          double halfLen = gayBerneParam.GB_sigma * gayBerneParam.GB_l2b_ratio/2.0;
258 +                                                        c1[2] = -halfLen;
259 +              c2[2] = -halfLen /2;
260 +              c3[2] = halfLen/2;
261 +              c4[2] = halfLen;
262 +                
263 +            }
264 +            
265 +              else {
266 +                    sprintf( painCave.errMsg,
267 +                           "Can not cast GenericData to GayBerneParam\n");
268 +                    painCave.severity = OOPSE_ERROR;
269 +                    painCave.isFatal = 1;
270 +                    simError();          
271 +        }            
272 +    }
273 +
274 +
275      data = datom->getPropertyByName("ATOMDATA");
276      if(data != NULL){
277        atomData = dynamic_cast<AtomData*>(data);  
# Line 509 | Line 535 | namespace oopse {
535        return;
536  
537      pos = datom->getPos();
538 <    u = datom->getElectroFrame().getColumn(2);
539 <
538 >    if (datom->getAtomType()->isGayBerne()) {
539 >        u = datom->getA().transpose()*V3Z;        
540 >    } else if (datom->getAtomType()->isMultipole()) {
541 >        u = datom->getElectroFrame().getColumn(2);
542 >    }
543      atomData = new AtomData;
544      atomData->setID("ATOMDATA");
545      atomInfo = new AtomInfo;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines