ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/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 992 by chrisfen, Wed Jun 21 18:28:27 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 +                          double halfLen = gayBerneParam.GB_l/2.0;
259 +                          c1[2] = -halfLen;
260 +              c2[2] = -halfLen /2;
261 +              c3[2] = halfLen/2;
262 +              c4[2] = halfLen;
263 +                
264 +            }
265 +            
266 +              else {
267 +                    sprintf( painCave.errMsg,
268 +                           "Can not cast GenericData to GayBerneParam\n");
269 +                    painCave.severity = OOPSE_ERROR;
270 +                    painCave.isFatal = 1;
271 +                    simError();          
272 +        }            
273 +    }
274 +
275  
276      data = datom->getPropertyByName("ATOMDATA");
277      if(data != NULL){
# Line 509 | Line 536 | namespace oopse {
536        return;
537  
538      pos = datom->getPos();
539 <    u = datom->getElectroFrame().getColumn(2);
540 <
539 >    if (datom->getAtomType()->isGayBerne()) {
540 >        u = datom->getA().transpose()*V3Z;        
541 >    } else if (datom->getAtomType()->isMultipole()) {
542 >        u = datom->getElectroFrame().getColumn(2);
543 >    }
544      atomData = new AtomData;
545      atomData->setID("ATOMDATA");
546      atomInfo = new AtomInfo;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines