Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lukas Werner
waLBerla
Commits
c68d4fa8
Commit
c68d4fa8
authored
Jul 11, 2017
by
Felix Winterhalter
Browse files
Really revert leapfrog
parent
947c2f86
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pe/cr/DEM.cpp
View file @
c68d4fa8
...
...
@@ -245,23 +245,23 @@ void DEM::move( BodyID id, real_t dt )
// R * Iinv * R^T * torque
const
Vec3
wdot
(
id
->
getInvInertia
()
*
id
->
getTorque
()
);
// Updating the linear velocity
id
->
setLinearVel
(
id
->
getLinearVel
()
+
vdot
*
dt
);
// Updating the angular velocity
id
->
setAngularVel
(
id
->
getAngularVel
()
+
wdot
*
dt
);
// Calculating the translational displacement
id
->
setPosition
(
id
->
getPosition
()
+
id
->
getLinearVel
()
*
dt
);
id
->
setPosition
(
id
->
getPosition
()
+
id
->
getLinearVel
()
*
dt
+
0.5
*
vdot
*
dt
*
dt
);
// Calculating the rotation angle
const
Vec3
phi
(
id
->
getAngularVel
()
*
dt
);
const
Vec3
phi
(
id
->
getAngularVel
()
*
dt
+
0.5
*
wdot
*
dt
*
dt
);
// Calculating the new orientation
if
(
!
floatIsEqual
(
phi
.
length
(),
0
))
id
->
rotate
(
Quat
(
phi
,
phi
.
length
()
)
);
WALBERLA_ASSERT_FLOAT_EQUAL
(
id
->
getRotation
().
getDeterminant
(),
real_c
(
1
),
"Corrupted rotation matrix determinant"
);
// Updating the linear velocity
id
->
setLinearVel
(
id
->
getLinearVel
()
+
vdot
*
dt
);
// Updating the angular velocity
id
->
setAngularVel
(
id
->
getAngularVel
()
+
wdot
*
dt
);
// Setting the axis-aligned bounding box
id
->
calcBoundingBox
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment