MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AngledPeriodicBoundarySecondUnitTest.cpp File Reference

Go to the source code of this file.

Classes

class  AngledPeriodicBoundarySecondUnitTest
 

Functions

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

Function Documentation

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

Definition at line 117 of file AngledPeriodicBoundarySecondUnitTest.cpp.

References DPMBase::boundaryHandler, BaseHandler< T >::clear(), ERROR, BaseInteractable::getAngularVelocity(), BaseHandler< T >::getObject(), mathsFunc::isEqual(), logger, DPMBase::particleHandler, constants::pi, Files::setName(), DPMBase::setTimeMax(), and DPMBase::solve().

118 {
120  dpm.setName("AngledPeriodicBoundarySecondUnitTest");
121  dpm.setTimeMax(4.0 * constants::pi);
122  dpm.solve(argc, argv);
123 
125  dpm2.setName("AngledPeriodicBoundarySecondUnitTest2");
126  dpm2.boundaryHandler.clear();
127  dpm2.setTimeMax(4.0 * constants::pi);
128  dpm2.solve(argc, argv);
129 
131  dpm2.particleHandler.getObject(0)->getAngularVelocity(), 1e-10))
132  {
133  logger(ERROR, "angular velocity of the two simulations doesn't match");
134  }
135 
136  //Note:: currently the rolling spring is not conserved!!
137  return 0;
138 }
void solve()
The work horse of the code.
Definition: DPMBase.cc:1895
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
Definition: DPMBase.cc:179
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
virtual const Vec3D & getAngularVelocity() const
Returns the angular velocity of this interactable.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:26
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
const Mdouble pi
Definition: ExtendedMath.h:42
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:888
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:878
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:415
bool isEqual(Mdouble v1, Mdouble v2, double absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0...
Definition: BaseHandler.h:360