PeriodicClumpSelfTest.cpp File Reference

Classes

class  clumpTest
 

Functions

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

Variables

Mdouble f_min = -4
 
Mdouble f_max = 4
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
115 {
116  clumpTest problem;
118  species->setDensity(1.0); // sets the species type-0 density
119  //species->setConstantRestitution(0);
120  std::cout<<species->getConstantRestitution()<<std::endl;
121  species->setDissipation(0.0);
122  species->setStiffness(1e6);
123  const Mdouble collisionTime = species->getCollisionTime(problem.getClumpMass());
124  problem.setClumpDamping(0);
125  problem.setTimeStep(collisionTime / 50.0);
126 
127  // Quick demonstration
128  problem.setSaveCount(100);
129  problem.setTimeMax(1);
130 
131 
132 
133  problem.removeOldFiles();
134  problem.solve();
135 
136  ClumpParticle* p = dynamic_cast<ClumpParticle*>(problem.particleHandler.getLastObject());
137  Vec3D angVel = p->getAngularVelocity();
138  Vec3D known_angVel = Vec3D(-1.30004, 19.9932, 0.944699);
139 
140  Vec3D pos = p->getPosition();
141  Vec3D known_pos = Vec3D(-0.201397, -2.37542, -0.284277);
142 
143 
144  helpers::check(angVel,known_angVel,1e-4, "Angular velocity check");
145  helpers::check(pos,known_pos,1e-4, "Pebble position");
146 
147  return 0;
148 }
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
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
Definition: BaseInteractable.cc:341
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Definition: ClumpParticle.h:41
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
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
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
Definition: Vector.h:51
Definition: PeriodicClumpSelfTest.cpp:40
void setClumpDamping(Mdouble damp)
Definition: PeriodicClumpSelfTest.cpp:58
Mdouble getClumpMass()
Definition: PeriodicClumpSelfTest.cpp:62
void check(double real, double ideal, double error, std::string errorMessage)
Definition: TestHelpers.cc:37

References helpers::check(), BaseHandler< T >::copyAndAddObject(), BaseInteractable::getAngularVelocity(), clumpTest::getClumpMass(), BaseHandler< T >::getLastObject(), BaseInteractable::getPosition(), DPMBase::particleHandler, DPMBase::removeOldFiles(), clumpTest::setClumpDamping(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), DPMBase::setTimeStep(), DPMBase::solve(), and DPMBase::speciesHandler.

Variable Documentation

◆ f_max

Mdouble f_max = 4

Referenced by clumpTest::clumpTest().

◆ f_min

Mdouble f_min = -4

Referenced by clumpTest::clumpTest().