tadd missing contact.c - granular - granular dynamics simulation
git clone git://src.adamsgaard.dk/granular
Log
Files
Refs
README
LICENSE
---
commit cfa3bfe54ace36af3da7e87c548cebbd38549eb2
parent 8d4e5dd081797027aaa0e8b0b344ec02009f2499
Author: Anders Damsgaard 
Date:   Thu,  8 Apr 2021 22:42:45 +0200

add missing contact.c

Diffstat:
  A contact.c                           |      32 +++++++++++++++++++++++++++++++

1 file changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/contact.c b/contact.c
t@@ -0,0 +1,32 @@
+#include 
+#include "contact.h"
+
+void
+contact_defaults(struct contact *c)
+{
+        int d;
+
+        c->active = 0;
+        c->i = c->j = 0;
+        c->age = NAN;
+        c->overlap = NAN;
+        for (d = 0; d < 3; d++) {
+                c->centerdist[d] = NAN;
+                c->tandisp[d] = NAN;
+                c->stress[d] = NAN;
+        }
+}
+
+void
+contact_new(struct contact *c, size_t i, size_t j)
+{
+        int d;
+
+        c->active = 1;
+        c->i = i;
+        c->j = j;
+        c->age = 0.0;
+        for (d = 0; d < 3; d++) {
+                c->tandisp[d] = 0.0;
+        }
+}