--- trunk/src/applications/hydrodynamics/ApproximationModel.cpp 2006/03/21 15:33:04 910 +++ trunk/src/applications/hydrodynamics/ApproximationModel.cpp 2006/05/10 01:44:48 954 @@ -48,6 +48,7 @@ #include "applications/hydrodynamics/Ellipsoid.hpp" #include "applications/hydrodynamics/CompositeShape.hpp" #include "math/LU.hpp" +#include "utils/simError.h" namespace oopse { /** * Reference: @@ -57,25 +58,7 @@ ApproximationModel::ApproximationModel(StuntDouble* sd */ ApproximationModel::ApproximationModel(StuntDouble* sd, SimInfo* info): HydrodynamicsModel(sd, info){ -/* - DynamicProperty::const_iterator iter; - iter = extraParams.find("Viscosity"); - if (iter != extraParams.end()) { - boost::any param = iter->second; - viscosity = boost::any_cast(param); - }else { - std::cout << "ApproximationModel Error\n" ; - } - - iter = extraParams.find("Temperature"); - if (iter != extraParams.end()) { - boost::any param = iter->second; - temperature = boost::any_cast(param); - }else { - std::cout << "ApproximationModel Error\n" ; - } -*/ } bool ApproximationModel::calcHydroProps(Spheric* spheric, double viscosity, double temperature) { @@ -89,18 +72,22 @@ bool ApproximationModel::calcHydroProps(CompositeShape return internalCalcHydroProps(static_cast(compositeShape), viscosity, temperature); } - -bool ApproximationModel::internalCalcHydroProps(Shape* shape, double viscosity, double temperature) { +void ApproximationModel::init() { if (!createBeads(beads_)) { - std::cout << "can not create beads" << std::endl; - return false; + sprintf(painCave.errMsg, "ApproximationModel::init() : Can not create beads\n"); + painCave.isFatal = 1; + simError(); } +} + +bool ApproximationModel::internalCalcHydroProps(Shape* shape, double viscosity, double temperature) { + bool ret = true; HydroProps cr; HydroProps cd; calcHydroPropsAtCR(beads_, viscosity, temperature, cr); - calcHydroPropsAtCD(beads_, viscosity, temperature, cd); + //calcHydroPropsAtCD(beads_, viscosity, temperature, cd); setCR(cr); setCD(cd); @@ -169,7 +156,8 @@ bool ApproximationModel::calcHydroPropsAtCR(std::vecto Xiott += Cij; Xiotr += U[i] * Cij; - Xiorr += -U[i] * Cij * U[j] + (6 * viscosity * volume) * I; + //Xiorr += -U[i] * Cij * U[j] + (6 * viscosity * volume) * I; + Xiorr += -U[i] * Cij * U[j]; } } @@ -332,7 +320,8 @@ bool ApproximationModel::calcHydroPropsAtCD(std::vecto Xitt += Cij; Xitr += U[i] * Cij; - Xirr += -U[i] * Cij * U[j] + (6 * viscosity * volume) * I; + //Xirr += -U[i] * Cij * U[j] + (6 * viscosity * volume) * I; + Xirr += -U[i] * Cij * U[j]; } } @@ -460,7 +449,7 @@ bool ApproximationModel::calcHydroPropsAtCD(std::vecto } -/* + void ApproximationModel::writeBeads(std::ostream& os) { std::vector::iterator iter; os << beads_.size() << std::endl; @@ -470,7 +459,7 @@ void ApproximationModel::writeBeads(std::ostream& os) } } -*/ + }