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 
)
192 {
193  //First test Particle Particle interactions with no plastic forces so reverseable.
194  ParticleParticleInteraction ParticleParticleInteractionProblem;
195  ParticleParticleInteractionProblem.solve();
196 
197  logger(INFO,"Testing particle-particle collision for elastic adhesive forces");
198  std::vector<BaseParticle*>::iterator pIt = ParticleParticleInteractionProblem.particleHandler.begin();
199  if (!(*pIt)->getPosition().isEqualTo(Vec3D(-0.00101582359198137,0.0,0.0), 1e-7))
200  logger(FATAL,"First particle is in the wrong position. It is at %",(*pIt)->getPosition());
201  if (!(*pIt)->getVelocity().isEqualTo(Vec3D(-0.0436824,0.0,0.0) , 1e-7))
202  logger(FATAL,"First particle has the wrong velocity. It is at %",(*pIt)->getVelocity());
203  ++pIt;
204  if (!(*pIt)->getPosition().isEqualTo(Vec3D(0.00101582359198137,0.0,0.0), 1e-7))
205  logger(FATAL,"Second particle is in the wrong position. It is at %",(*pIt)->getPosition());
206  if (!(*pIt)->getVelocity().isEqualTo(Vec3D(0.0436824,0.0,0.0) , 1e-7))
207  logger(FATAL,"Second particle has the wrong velocity. It is at %",(*pIt)->getVelocity());
208 
209  //Second test Particle Particle interaction with a plastic force (non reverseable)
210  ParticleParticleInteractionWithPlasticForces ParticleParticleInteractionWithPlasticForcesProblem;
211  ParticleParticleInteractionWithPlasticForcesProblem.solve();
212 
213  logger(INFO,"Testing particle particles collision for plastic adhesive forces");
214  std::vector<BaseParticle*>::iterator pIt2 = ParticleParticleInteractionWithPlasticForcesProblem.particleHandler.begin();
215  if (!(*pIt2)->getPosition().isEqualTo(Vec3D(-0.00107858,0.0,0.0), 1e-7))
216  logger(FATAL,"First particle is in the wrong position. It is at %",(*pIt2)->getPosition());
217  if (!(*pIt2)->getVelocity().isEqualTo(Vec3D(-0.0352526,0.0,0.0) , 1e-7))
218  logger(FATAL,"First particle has the wrong velocity. It is at %",(*pIt2)->getVelocity());
219  ++pIt2;
220  if (!(*pIt2)->getPosition().isEqualTo(Vec3D(0.00107858,0.0,0.0), 1e-7))
221  logger(FATAL,"Second particle is in the wrong position. It is at %",(*pIt2)->getPosition());
222  if (!(*pIt2)->getVelocity().isEqualTo(Vec3D(0.0352526,0.0,0.0) , 1e-7))
223  logger(FATAL,"Second particle has the wrong velocity. It is at %",(*pIt2)->getVelocity());
224 
225  //Final test Particle-Wall interactions with a plastic force (non reversable)
228 
229  logger(INFO,"Testing particle-wall collision for plastic adhesive forces");
230  std::vector<BaseParticle*>::iterator pIt3 = ParticleWallInteraction.particleHandler.begin();
231  if (!(*pIt3)->getPosition().isEqualTo(Vec3D(0.00104381,0.0,0.0), 1e-7))
232  logger(FATAL,"The particle is in the wrong position. It is at %",(*pIt3)->getPosition());
233  if (!(*pIt3)->getVelocity().isEqualTo(Vec3D(0.0362122,0.0,0.0) , 1e-7))
234  logger(FATAL,"The particle has the wrong velocity. It is at %",(*pIt3)->getVelocity());
235 
236  return 0;
237 }
Array< double, 1, 3 > e(1./3., 0.5, 2.)
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:31
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:698
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
void solve()
The work horse of the code.
Definition: DPMBase.cc:4334
Definition: AdhesiveForceUnitTest.cpp:75
Definition: AdhesiveForceUnitTest.cpp:19
Definition: AdhesiveForceUnitTest.cpp:133
Definition: Kernel/Math/Vector.h:30
#define INFO(i)
Definition: mumps_solver.h:54

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