Segregation/segregation.cpp File Reference
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cmath>
#include "Chute.h"
#include "Boundaries/PeriodicBoundary.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <Species/LinearViscoelasticFrictionSpecies.h>

Classes

class  SegregationPeriodic
 This class does segregation problems in a periodic chute. More...
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
Todo:
TW we need a replacement for BaseParticle::calculateMaximumVelocity
239 {
240  SegregationPeriodic problem;
241 
242  // Problem parameters, name tmax and two types of particles
243  problem.setName("segregation");
244  //This should be set to 100 for full problems.
245  problem.setTimeMax(.1);
246  problem.setTimeStep(1e-4);
247  problem.setupInitialConditions();
248 
249  //solve
251  //std::cout << "Maximum allowed speed of particles: " << problem.particleHandler.getSmallestParticle()->calculateMaximumVelocity() << std::endl; // speed allowed before particles move through each other!
252  //problem.setTimeStepByParticle();
253  //This is based on the fact in general you get too much data, so prob at worst you want to turn it into a 20 at 60fps (which is its self overkill)
255  //problem.setSaveCount(helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(20*60,getTimeMax(),getTimeStep()));
256  //problem.setSaveCount(1);
257 
258  problem.autoNumber();
259 
260 
261  //This set to colouring based of size and small vectors
262  problem.setXBallsColourMode(7);
263  problem.setXBallsVectorScale(1);
264  problem.setXBallsAdditionalArguments("-v0 -solidf");
265 
266 
267  //solves the problems
268  problem.solve();
269 
270  //Make sure the restart data is upto date at the end
271  //problem.writeRestartFile();
272 }
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
void autoNumber()
The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incremen...
Definition: DPMBase.cc:539
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
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
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setXBallsVectorScale(double newVScale)
Set the scale of vectors in xballs.
Definition: DPMBase.cc:1320
void setXBallsColourMode(int newCMode)
Set the xballs output mode.
Definition: DPMBase.cc:1300
This class does segregation problems in a periodic chute.
Definition: Chute/segregation.cpp:39
void setupInitialConditions() override
Definition: Chute/segregation.cpp:66
unsigned int getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(unsigned int numberOfSaves, Mdouble timeMax, Mdouble timeStep)
Returns the correct saveCount if the total number of saves, the final time and the time step is known...
Definition: FormulaHelpers.cc:96

References DPMBase::autoNumber(), helpers::getSaveCountFromNumberOfSavesAndTimeMaxAndTimeStep(), DPMBase::getTimeMax(), DPMBase::getTimeStep(), DPMBase::setName(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), SegregationPeriodic::setupInitialConditions(), DPMBase::setXBallsAdditionalArguments(), DPMBase::setXBallsColourMode(), DPMBase::setXBallsVectorScale(), and DPMBase::solve().