ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/hydrodynamics/ShapeBuilder.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/hydrodynamics/ShapeBuilder.cpp (file contents):
Revision 2634 by tim, Fri Mar 17 23:20:35 2006 UTC vs.
Revision 2646 by tim, Tue Mar 21 00:26:55 2006 UTC

# Line 47 | Line 47 | Shape* ShapeBuilder::createShape(StuntDouble* sd) {
47   Shape* ShapeBuilder::createShape(StuntDouble* sd) {
48      Shape* currShape = NULL;
49              if (sd->isDirectionalAtom()) {
50 <              currShape = internalCreateShape(static_cast<Atom*>(sd));
50 >              currShape = internalCreateShape(static_cast<DirectionalAtom*>(sd));
51              } else if (sd->isAtom()) {
52 <                currShape = internalCreateShape(static_cast<DirectionalAtom*>(sd));
52 >                currShape = internalCreateShape(static_cast<Atom*>(sd));
53              } else if (sd->isRigidBody()) {
54                  currShape = internalCreateShape(static_cast<RigidBody*>(sd));
55              }
# Line 97 | Line 97 | Shape* ShapeBuilder::internalCreateShape(DirectionalAt
97  
98              if (gayBerneData != NULL) {  
99                  GayBerneParam gayBerneParam = gayBerneData->getData();
100 <                currShape = new Ellipsoid(datom->getPos(), gayBerneParam.GB_sigma, gayBerneParam.GB_l2b_ratio, datom->getA());
100 >                currShape = new Ellipsoid(datom->getPos(), gayBerneParam.GB_sigma/2.0, gayBerneParam.GB_l2b_ratio*gayBerneParam.GB_sigma/2.0, datom->getA());
101              } else {
102                  sprintf( painCave.errMsg,
103                         "Can not cast GenericData to GayBerneParam\n");
# Line 111 | Line 111 | Shape* ShapeBuilder::internalCreateShape(DirectionalAt
111            painCave.isFatal = 1;
112            simError();    
113          }            
114 +    }else if (atomType->isLennardJones()){
115 +        GenericData* data = atomType->getPropertyByName("LennardJones");
116 +        if (data != NULL) {
117 +            LJParamGenericData* ljData = dynamic_cast<LJParamGenericData*>(data);
118 +
119 +            if (ljData != NULL) {
120 +                LJParam ljParam = ljData->getData();
121 +                currShape = new Spheric(datom->getPos(), ljParam.sigma/2.0);
122 +        } else {
123 +            sprintf( painCave.errMsg,
124 +            "Can not cast GenericData to LJParam\n");
125 +            painCave.severity = OOPSE_ERROR;
126 +            painCave.isFatal = 1;
127 +            simError();          
128 +            }      
129 +        }
130 +
131      }
132      return currShape;
133   }
# Line 122 | Line 139 | Shape* ShapeBuilder::internalCreateShape(RigidBody* rb
139          for (atom = rb->beginAtom(ai); atom != NULL; atom = rb->nextAtom(ai)) {
140              Shape* currShape = NULL;
141              if (atom->isDirectionalAtom()){
142 <                currShape = internalCreateShape(static_cast<Atom*>(atom));
142 >                currShape = internalCreateShape(static_cast<DirectionalAtom*>(atom));
143              }else if (atom->isAtom()){
144 <                currShape =  internalCreateShape(static_cast<DirectionalAtom*>(atom));
144 >                currShape =  internalCreateShape(static_cast<Atom*>(atom));
145              }
146              if (currShape != NULL)
147                  compositeShape->addShape(currShape);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines