ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/hydrodynamics/ApproximationModel.cpp
(Generate patch)

Comparing trunk/src/applications/hydrodynamics/ApproximationModel.cpp (file contents):
Revision 980 by tim, Thu May 25 17:02:00 2006 UTC vs.
Revision 981 by gezelter, Mon Jun 5 18:24:45 2006 UTC

# Line 72 | Line 72 | namespace oopse {
72    bool ApproximationModel::calcHydroProps(Shape* shape, RealType viscosity, RealType temperature) {
73      
74      bool ret = true;
75 <    HydroProps cr;
76 <    HydroProps cd;
75 >    HydroProp* cr;
76 >    HydroProp* cd;
77      calcHydroPropsAtCR(beads_, viscosity, temperature, cr);
78      //calcHydroPropsAtCD(beads_, viscosity, temperature, cd);
79      setCR(cr);
# Line 82 | Line 82 | namespace oopse {
82      return true;    
83    }
84    
85 <  bool ApproximationModel::calcHydroPropsAtCR(std::vector<BeadParam>& beads, RealType viscosity, RealType temperature, HydroProps& cr) {
85 >  bool ApproximationModel::calcHydroPropsAtCR(std::vector<BeadParam>& beads, RealType viscosity, RealType temperature, HydroProp* cr) {
86      
87      int nbeads = beads.size();
88      DynamicRectMatrix<RealType> B(3*nbeads, 3*nbeads);
# Line 213 | Line 213 | namespace oopse {
213      Xirtr *= OOPSEConstant::kb * temperature;
214      Xirrr *= OOPSEConstant::kb * temperature;
215      
216 +    Mat6x6d Xi, D;
217  
218 <    cr.center = ror;
219 <    cr.Xi.setSubMatrix(0, 0, Xirtt);
220 <    cr.Xi.setSubMatrix(0, 3, Xirtr);
221 <    cr.Xi.setSubMatrix(3, 0, Xirtr);
222 <    cr.Xi.setSubMatrix(3, 3, Xirrr);
223 <    cr.D.setSubMatrix(0, 0, Drtt);
224 <    cr.D.setSubMatrix(0, 3, Drrt);
225 <    cr.D.setSubMatrix(3, 0, Drtr);
226 <    cr.D.setSubMatrix(3, 3, Drrr);    
218 >    cr->setCOR(ror);
219 >
220 >    Xi.setSubMatrix(0, 0, Xirtt);
221 >    Xi.setSubMatrix(0, 3, Xirtr);
222 >    Xi.setSubMatrix(3, 0, Xirtr);
223 >    Xi.setSubMatrix(3, 3, Xirrr);
224 >
225 >    cr->setXi(Xi);
226 >
227 >    D.setSubMatrix(0, 0, Drtt);
228 >    D.setSubMatrix(0, 3, Drrt);
229 >    D.setSubMatrix(3, 0, Drtr);
230 >    D.setSubMatrix(3, 3, Drrr);    
231 >
232 >    cr->setD(D);
233      
234      std::cout << "-----------------------------------------\n";
235      std::cout << "center of resistance :" << std::endl;
# Line 248 | Line 255 | namespace oopse {
255      return true;
256   }
257    
258 <  bool ApproximationModel::calcHydroPropsAtCD(std::vector<BeadParam>& beads, RealType viscosity, RealType temperature, HydroProps& cr) {
258 >  bool ApproximationModel::calcHydroPropsAtCD(std::vector<BeadParam>& beads, RealType viscosity, RealType temperature, HydroProp* cr) {
259      
260      int nbeads = beads.size();
261      DynamicRectMatrix<RealType> B(3*nbeads, 3*nbeads);
# Line 398 | Line 405 | namespace oopse {
405      //Xid /= OOPSEConstant::energyConvert;
406      Xid *= OOPSEConstant::kb * temperature;
407  
408 <    cr.center = rod;
402 <    cr.D.setSubMatrix(0, 0, Ddtt);
403 <    cr.D.setSubMatrix(0, 3, Ddtr);
404 <    cr.D.setSubMatrix(3, 0, Ddtr);
405 <    cr.D.setSubMatrix(3, 3, Ddrr);
406 <    cr.Xi = Xid;
408 >    Mat6x6d Xi, D;
409  
410 +    cr->setCOR(rod);
411 +
412 +    cr->setXi(Xid);
413 +
414 +    D.setSubMatrix(0, 0, Ddtt);
415 +    D.setSubMatrix(0, 3, Ddtr);
416 +    D.setSubMatrix(3, 0, Ddtr);
417 +    D.setSubMatrix(3, 3, Ddrr);
418 +
419 +    cr->setD(D);
420 +
421      std::cout << "viscosity = " << viscosity << std::endl;
422      std::cout << "temperature = " << temperature << std::endl;
423      std::cout << "center of diffusion :" << std::endl;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines