Domino.cpp File Reference

Classes

struct  dominoes
 
class  multiParticleT1
 

Functions

int main (int argc, char *argv[])
 

Variables

dominoes D
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
207 {
208 
209  int NumParams = 1;
210 
211  // Get parameters passed through the command line
212  /*
213  std::vector <Mdouble> params(0);
214  for (int i = 0; i<NumParams; i++) {
215  std::string a;
216  Mdouble param = stod(helpers::readFromCommandLine(argc, argv, "-p"+std::to_string(i), a));
217  params.push_back(param);
218  std::cout<<params[i]<<std::endl;
219  }
220 */
221  multiParticleT1 problem;
222 
223  // D.S_dom = 0.2 * (2 * D.k_peb * D.S_peb) + 0.8 * (2 * D.k_peb * D.S_peb) * (params[0]/100);
224 
225  // Domino species
227 
228  // Wall species
230 
231  // Mixed
232  auto species01 = problem.speciesHandler.getMixedObject(species0, species1);
233 
234 
235 
236  species0->setDensity(1.0); // sets the species type-0 density
237  //species->setConstantRestitution(0);
238  species0->setSlidingFrictionCoefficient(0.0);
239  species0->setSlidingStiffness(5e5);
240  species0->setRollingFrictionCoefficient(0.0);
241  species0->setRollingStiffness(5e5);
242  species0->setDissipation(1.0);
243  species0->setStiffness(1e6);
244  const Mdouble collisionTime = species0->getCollisionTime(D.mass);
245 
246  species01->setSlidingFrictionCoefficient(0.2);
247  species01->setSlidingStiffness(5e5);
248  species01->setRollingFrictionCoefficient(0.1);
249  species01->setDissipation(1.0);
250  species01->setRollingStiffness(5e5);
251  species01->setStiffness(1e6);
252 
253 
254 
255  problem.setClumpDamping(5);
256  problem.setTimeStep(collisionTime / 50.0);
257 
258  // Quick demonstration
259  problem.setSaveCount(500);
260  problem.setTimeMax(10);
261 
262 
263  // For time averaging featuring equipartition - takes a while
264  // problem.setSaveCount(50000);
265  // problem.setTimeMax(100000);
266 
267  problem.removeOldFiles();
268  problem.solve();
269 
270  if ((D.started)&&(D.finished)) D.velocity = D.S_peb * (D.N_fin - D.N_ini) / (D.T2-D.T1);
271 
272  std::cout<<"DOMINO VELOCITY: "<<D.velocity<<std::endl;
273  std::cout<<"N_ini: "<<D.N_ini<<std::endl;
274  std::cout<<"N_fin: "<<D.N_fin<<std::endl;
275  std::cout<<"T1: "<<D.T1<<std::endl;
276  std::cout<<"T2: "<<D.T2<<std::endl;
277 
278  // Add velocity to log
279  std::ofstream funct("velocity.txt", std::ios_base::app | std::ios_base::out);
280  funct << D.velocity <<"\n";
281  funct.close();
282 
283 
284 
285  return 0;
286 }
dominoes D
Definition: Domino.cpp:76
double Mdouble
Definition: GeneralDefine.h:34
Species< LinearViscoelasticNormalSpecies, FrictionSpecies > LinearViscoelasticFrictionSpecies
Definition: LinearViscoelasticFrictionSpecies.h:34
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
void removeOldFiles() const
Definition: DPMBase.cc:4422
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
std::enable_if<!std::is_pointer< typename U::MixedSpeciesType >::value, typename U::MixedSpeciesType * >::type getMixedObject(const U *S, const U *T)
Definition: SpeciesHandler.h:74
Definition: Domino.cpp:80
void setClumpDamping(Mdouble damp)
Definition: Domino.cpp:95
bool finished
Definition: Domino.cpp:67
Mdouble T2
Definition: Domino.cpp:69
int N_ini
Definition: Domino.cpp:64
bool started
Definition: Domino.cpp:66
Mdouble T1
Definition: Domino.cpp:68
Mdouble S_peb
Definition: Domino.cpp:44
Mdouble velocity
Definition: Domino.cpp:70
Mdouble mass
Definition: Domino.cpp:58
int N_fin
Definition: Domino.cpp:65

References BaseHandler< T >::copyAndAddObject(), D, dominoes::finished, SpeciesHandler::getMixedObject(), dominoes::mass, dominoes::N_fin, dominoes::N_ini, DPMBase::removeOldFiles(), dominoes::S_peb, multiParticleT1::setClumpDamping(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::solve(), DPMBase::speciesHandler, dominoes::started, dominoes::T1, dominoes::T2, and dominoes::velocity.

Variable Documentation

◆ D