Introduction
Introduction Statistics Contact Development Disclaimer Help
tfix contact removal - granular - granular dynamics simulation
git clone git://src.adamsgaard.dk/granular
Log
Files
Refs
README
LICENSE
---
commit fce305fb77886ba66ae39544d7f829048ec3da3a
parent 01f75f59b3a0ddbaacdf66d98100c45300652fbd
Author: Anders Damsgaard <[email protected]>
Date: Fri, 23 Apr 2021 06:42:11 +0200
fix contact removal
Diffstat:
M grain.c | 2 +-
M simulation.c | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/grain.c b/grain.c
t@@ -355,7 +355,7 @@ grain_register_contact(struct grain *g, size_t i, size_t j,
/* first pass: check if contact is already registered */
for (ic = 0; ic < MAXCONTACTS; ic++)
- if (g->contacts[ic].j == j) {
+ if (g->contacts[ic].active && g->contacts[ic].j == j) {
g->contacts[ic].overlap = overlap;
for (d = 0; d < 3; d++)
g->contacts[ic].centerdist[d] = centerdist[d];
diff --git a/simulation.c b/simulation.c
t@@ -139,8 +139,7 @@ sim_check_add_contact(struct simulation *sim, size_t i, si…
overlap = 0.5*(sim->grains[i].diameter + sim->grains[j].diameter)
- euclidean_norm(centerdist, 3);
- if (overlap > 0.0)
- grain_register_contact(&sim->grains[i], i, j, centerdist, over…
+ grain_register_contact(&sim->grains[i], i, j, centerdist, overlap);
}
void
t@@ -192,8 +191,7 @@ sim_resolve_interactions(struct simulation *sim)
for (i = 0; i < sim->ng; i++)
for (ic = 0; ic < MAXCONTACTS; ic++)
- if (sim->grains[i].contacts[ic].active &&
- i < sim->grains[i].contacts[ic].j)
+ if (sim->grains[i].contacts[ic].active && i < sim->gra…
grains_interact(&sim->grains[i],
&sim->grains[sim->grains[i].co…
ic, sim->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.