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

Comparing trunk/OOPSE-4/src/applications/hydrodynamics/RoughShell.cpp (file contents):
Revision 2633 by tim, Wed Mar 15 15:51:44 2006 UTC vs.
Revision 2634 by tim, Fri Mar 17 23:20:35 2006 UTC

# Line 40 | Line 40
40   */
41  
42   #include "applications/hydrodynamics/RoughShell.hpp"
43 <
43 > #include "applications/hydrodynamics/ShapeBuilder.hpp"
44 > #include "brains/SimInfo.hpp"
45   namespace oopse {
46  
47 < RoughShell::RoughShell(StuntDouble* sd, const DynamicProperty& extraParams) : HydrodynamicsModel(sd, extraParams), sdShape_(sd){
48 <    DynamicProperty::const_iterator iter = extraParams.find("Sigma");
49 <    if (iter != extraParams.end()) {
50 <        boost::any param = iter->second;
51 <        sigma_ = boost::any_cast<double>(param);
47 > RoughShell::RoughShell(StuntDouble* sd, SimInfo* info) : ApproximationModel(sd, info){
48 >    shape_=ShapeBuilder::createShape(sd);
49 >    Globals* simParams = info->getSimParams();
50 >    if (simParams->haveBeadSize()) {
51 >        sigma_ = simParams->getBeadSize();
52      }else {
53 <        std::cout << "RoughShell Model Error\n" ;
53 >
54      }
55   }
56  
# Line 75 | Line 76 | bool RoughShell::createBeads(std::vector<BeadParam>& b
76  
77   };
78   bool RoughShell::createBeads(std::vector<BeadParam>& beads) {
79 <    std::pair<Vector3d, Vector3d> boxBoundary = sdShape_.getBox();
79 >    std::pair<Vector3d, Vector3d> boxBoundary = shape_->getBox();
80      double len = boxBoundary.second[0] - boxBoundary.first[0];
81      int numLattices = static_cast<int>(len/sigma_) + 1;
82      Grid3D<BeadLattice>  grid(numLattices, numLattices, numLattices);
# Line 87 | Line 88 | bool RoughShell::createBeads(std::vector<BeadParam>& b
88                  BeadLattice& currentBead = grid(i, j, k);
89                  currentBead.origin = Vector3d(i*sigma_ + boxBoundary.first[0], j *sigma_ + boxBoundary.first[1], k*sigma_+ boxBoundary.first[2]);
90                  currentBead.radius = sigma_;
91 <                currentBead.interior = sdShape_.isInterior(grid(i, j, k).origin);                
91 >                currentBead.interior = shape_->isInterior(grid(i, j, k).origin);                
92              }
93          }
94      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines