| 64 |  | Shape* shape; | 
| 65 |  | }; | 
| 66 |  | void registerHydrodynamicsModels(); | 
| 67 | – | void calcHydrodynamicsProp(HydrodynamicsModel* model, Shape* shape,double viscosity,  double temperature, std::ostream& os, const std::string& prefix); | 
| 67 |  |  | 
| 68 |  | int main(int argc, char* argv[]){ | 
| 69 |  | //register force fields | 
| 138 |  | integrableObject = mol->nextIntegrableObject(ii)) { | 
| 139 |  | if (uniqueStuntDoubles.find(integrableObject->getType()) ==  uniqueStuntDoubles.end()) { | 
| 140 |  |  | 
| 142 | – | SDShape tmp; | 
| 143 | – | tmp.shape = ShapeBuilder::createShape(integrableObject); | 
| 144 | – | tmp.sd = integrableObject; | 
| 145 | – | uniqueStuntDoubles.insert(std::map<std::string, SDShape>::value_type(integrableObject->getType(), tmp)); | 
| 141 |  | integrableObject->setPos(V3Zero); | 
| 142 |  | integrableObject->setA(identMat); | 
| 143 |  | if (integrableObject->isRigidBody()) { | 
| 144 |  | RigidBody* rb = static_cast<RigidBody*>(integrableObject); | 
| 145 |  | rb->updateAtoms(); | 
| 146 |  | } | 
| 147 | + |  | 
| 148 | + | SDShape tmp; | 
| 149 | + | tmp.shape = ShapeBuilder::createShape(integrableObject); | 
| 150 | + | tmp.sd = integrableObject; | 
| 151 | + | uniqueStuntDoubles.insert(std::map<std::string, SDShape>::value_type(integrableObject->getType(), tmp)); | 
| 152 | + |  | 
| 153 |  | } | 
| 154 |  | } | 
| 155 |  | } | 
| 169 |  | } else { | 
| 170 |  | model = new BeadModel(sd, info); | 
| 171 |  | } | 
| 172 | < | calcHydrodynamicsProp(model, shape, viscosity, temperature, outputDiff, prefix); | 
| 172 | > |  | 
| 173 | > | model->init(); | 
| 174 | > |  | 
| 175 | > | std::ofstream ofs; | 
| 176 | > | std::stringstream outputBeads; | 
| 177 | > | outputBeads << prefix << "_" << model->getStuntDoubleName() << ".xyz"; | 
| 178 | > | ofs.open(outputBeads.str().c_str()); | 
| 179 | > | model->writeBeads(ofs); | 
| 180 | > | ofs.close(); | 
| 181 | > |  | 
| 182 | > | //if beads option is turned on, skip the calculation | 
| 183 | > | if (!args_info.beads_flag) { | 
| 184 | > | shape->calcHydroProps(model, viscosity, temperature); | 
| 185 | > | model->writeHydroProps(outputDiff); | 
| 186 | > | } | 
| 187 | > |  | 
| 188 |  | delete model; | 
| 189 |  | } | 
| 190 |  |  | 
| 200 |  | HydrodynamicsModelFactory::getInstance()->registerHydrodynamicsModel(new HydrodynamicsModelBuilder<AnalyticalModel>("AnalyticalModel")); | 
| 201 |  |  | 
| 202 |  | } | 
| 187 | – | void calcHydrodynamicsProp(HydrodynamicsModel* model, Shape* shape,double viscosity,  double temperature, std::ostream& os, const std::string& prefix) { | 
| 203 |  |  | 
| 189 | – | shape->calcHydroProps(model, viscosity, temperature); | 
| 190 | – | model->writeHydroProps(os); | 
| 191 | – | std::ofstream ofs; | 
| 192 | – | std::stringstream outputBeads; | 
| 193 | – | outputBeads << prefix << "_" << model->getStuntDoubleName() << ".xyz"; | 
| 194 | – | ofs.open(outputBeads.str().c_str()); | 
| 195 | – | model->writeBeads(ofs); | 
| 196 | – | ofs.close(); | 
| 197 | – | } |