11 "We apply a torque T around the z-axis to a motionless\n"
12 "particle of inertia I for a time t using a time step dt.\n"
13 "The result is a final angular velocity omega=T/I*t\n"
14 "and rotation angle alpha=T/I*t^2/2.\n"
16 "The input/output values should be:\n"
17 " T = 0.1*pi*(0 0 1) Nm\n"
21 " omega=pi*(0 0 1) rad/s\n"
22 " alpha = pi/2*(0 0 1) rad\n");
34 P->setForce({1, 0, 0});
38 for (
Mdouble time = 0; time < timeMax; time += timeStep)
40 P->accelerate(
P->getForce() *
P->getInvMass() * timeStep);
41 P->move(
P->getVelocity() * timeStep);
43 P->getOrientation().rotateInverseInertiaTensor(
P->getInvInertia()) *
P->getTorque() * timeStep);
44 P->rotate(
P->getAngularVelocity() * timeStep);
49 " alpha= %",
P->getAngularVelocity(),
P->getOrientation().getEuler());
57 logger(
ERROR,
"angular velocity is %, but should be %",
P->getAngularVelocity(),
pi / 2);
61 logger(
ERROR,
"orientation is %, but should be %",
P->getOrientation().getEuler().Z,
pi / 2);
Array< double, 1, 3 > e(1./3., 0.5, 2.)
dominoes D
Definition: Domino.cpp:55
Species< LinearViscoelasticNormalSpecies > LinearViscoelasticSpecies
Definition: LinearViscoelasticSpecies.h:11
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:32
Definition: BaseParticle.h:33
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
Definition: Kernel/Math/Vector.h:30
#define INFO(i)
Definition: mumps_solver.h:54
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
const Mdouble pi
Definition: ExtendedMath.h:23
bool isEqual(Mdouble v1, Mdouble v2, Mdouble absError)
Compares the difference of two Mdouble with an absolute error, useful in UnitTests.
Definition: ExtendedMath.cc:230
@ S
Definition: quadtree.h:62