Introduction
Introduction Statistics Contact Development Disclaimer Help
tgrain.c: resolve issues around grain fixing and rotation lock - granular - gra…
git clone git://src.adamsgaard.dk/granular
Log
Files
Refs
README
LICENSE
---
commit 01f75f59b3a0ddbaacdf66d98100c45300652fbd
parent c5d3ea04206942befe8197ee0fee4e8f49fc7ccb
Author: Anders Damsgaard <[email protected]>
Date: Fri, 23 Apr 2021 06:20:49 +0200
grain.c: resolve issues around grain fixing and rotation lock
Diffstat:
M grain.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/grain.c b/grain.c
t@@ -318,16 +318,18 @@ grain_temporal_integration_two_term_taylor(struct grain …
double moment_of_inertia = grain_moment_of_inertia(g);
for (d = 0; d < 3; d++) {
- if (!g->acc_lock[d])
- g->acc[d] = (g->force[d] + g->forceext[d]) / mass;
+ g->acc[d] = (g->force[d] + g->forceext[d]) / mass;
if (g->rotating)
g->angacc[d] = g->torque[d] / moment_of_inertia;
}
if (g->fixed)
- for (d = 0; d < 3; d++)
- g->acc[d] = 0.0;
+ for (d = 0; d < 3; d++) {
+ g->angacc[d] = 0.0;
+ if (!g->acc_lock[d])
+ g->acc[d] = 0.0;
+ }
for (d = 0; d < 3; d++) {
dx = g->vel[d] * dt + 0.5 * g->acc[d] * dt * dt;
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.