AdhesiveForceUnitTest.cpp File Reference

Classes

class  ParticleParticleInteraction
 
class  ParticleParticleInteractionWithPlasticForces
 
class  ParticleWallInteraction
 

Functions

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

Function Documentation

◆ main()

int main ( int argc  UNUSED,
char *argv[]  UNUSED 
)
213 {
214  //First test Particle Particle interactions with no plastic forces so reverseable.
215  ParticleParticleInteraction ParticleParticleInteractionProblem;
216  ParticleParticleInteractionProblem.solve();
217 
218  logger(INFO,"Testing particle-particle collision for elastic adhesive forces");
219  std::vector<BaseParticle*>::iterator pIt = ParticleParticleInteractionProblem.particleHandler.begin();
220  if (!(*pIt)->getPosition().isEqualTo(Vec3D(-0.00101582359198137,0.0,0.0), 1e-7))
221  logger(FATAL,"First particle is in the wrong position. It is at %",(*pIt)->getPosition());
222  if (!(*pIt)->getVelocity().isEqualTo(Vec3D(-0.0436824,0.0,0.0) , 1e-7))
223  logger(FATAL,"First particle has the wrong velocity. It is at %",(*pIt)->getVelocity());
224  ++pIt;
225  if (!(*pIt)->getPosition().isEqualTo(Vec3D(0.00101582359198137,0.0,0.0), 1e-7))
226  logger(FATAL,"Second particle is in the wrong position. It is at %",(*pIt)->getPosition());
227  if (!(*pIt)->getVelocity().isEqualTo(Vec3D(0.0436824,0.0,0.0) , 1e-7))
228  logger(FATAL,"Second particle has the wrong velocity. It is at %",(*pIt)->getVelocity());
229 
230  //Second test Particle Particle interaction with a plastic force (non reverseable)
231  ParticleParticleInteractionWithPlasticForces ParticleParticleInteractionWithPlasticForcesProblem;
232  ParticleParticleInteractionWithPlasticForcesProblem.solve();
233 
234  logger(INFO,"Testing particle particles collision for plastic adhesive forces");
235  std::vector<BaseParticle*>::iterator pIt2 = ParticleParticleInteractionWithPlasticForcesProblem.particleHandler.begin();
236  if (!(*pIt2)->getPosition().isEqualTo(Vec3D(-0.00107858,0.0,0.0), 1e-7))
237  logger(FATAL,"First particle is in the wrong position. It is at %",(*pIt2)->getPosition());
238  if (!(*pIt2)->getVelocity().isEqualTo(Vec3D(-0.0352526,0.0,0.0) , 1e-7))
239  logger(FATAL,"First particle has the wrong velocity. It is at %",(*pIt2)->getVelocity());
240  ++pIt2;
241  if (!(*pIt2)->getPosition().isEqualTo(Vec3D(0.00107858,0.0,0.0), 1e-7))
242  logger(FATAL,"Second particle is in the wrong position. It is at %",(*pIt2)->getPosition());
243  if (!(*pIt2)->getVelocity().isEqualTo(Vec3D(0.0352526,0.0,0.0) , 1e-7))
244  logger(FATAL,"Second particle has the wrong velocity. It is at %",(*pIt2)->getVelocity());
245 
246  //Final test Particle-Wall interactions with a plastic force (non reversable)
249 
250  logger(INFO,"Testing particle-wall collision for plastic adhesive forces");
251  std::vector<BaseParticle*>::iterator pIt3 = ParticleWallInteraction.particleHandler.begin();
252  if (!(*pIt3)->getPosition().isEqualTo(Vec3D(0.00104381,0.0,0.0), 1e-7))
253  logger(FATAL,"The particle is in the wrong position. It is at %",(*pIt3)->getPosition());
254  if (!(*pIt3)->getVelocity().isEqualTo(Vec3D(0.0362122,0.0,0.0) , 1e-7))
255  logger(FATAL,"The particle has the wrong velocity. It is at %",(*pIt3)->getVelocity());
256 
257  return 0;
258 }
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
LL< Log::FATAL > FATAL
Definition of the different loglevels by its wrapper class LL. These are used as tags in template met...
Definition: Logger.cc:52
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:690
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
Definition: AdhesiveForceUnitTest.cpp:96
Definition: AdhesiveForceUnitTest.cpp:40
Definition: AdhesiveForceUnitTest.cpp:154
Definition: Vector.h:51

References BaseHandler< T >::begin(), FATAL, INFO, logger, DPMBase::particleHandler, and DPMBase::solve().