tuse define for number of dimensions (ND) - granular - granular dynamics simulation
(HTM) git clone git://src.adamsgaard.dk/granular
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit a2face6a7e2d9f90a9aab186848b4c964effad27
(DIR) parent de5b411b0d19c619085a9895f352df8005eece08
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 18 Mar 2021 00:21:14 +0100
use define for number of dimensions (ND)
Diffstat:
M grain.h | 26 +++++++++++++-------------
A granular.h | 6 ++++++
2 files changed, 19 insertions(+), 13 deletions(-)
---
(DIR) diff --git a/grain.h b/grain.h
t@@ -1,21 +1,21 @@
#ifndef GRANULAR_GRAIN_
#define GRANULAR_GRAIN_
-extern size_t nd;
+#include "granular.h"
struct grain {
double radius;
- double pos[nd];
- double vel[nd];
- double acc[nd];
- double force[nd];
- double angpos[nd];
- double angvel[nd];
- double angacc[nd];
- double torque[nd];
- double disp[nd];
- double forceext[nd];
+ double pos[ND];
+ double vel[ND];
+ double acc[ND];
+ double force[ND];
+ double angpos[ND];
+ double angvel[ND];
+ double angacc[ND];
+ double torque[ND];
+ double disp[ND];
+ double forceext[ND];
double density;
size_t fixed;
size_t rotating;
t@@ -24,9 +24,9 @@ struct grain {
double poissons_ratio;
double friction_coeff;
double tensile_strength;
- size_t gridpos[nd];
+ size_t gridpos[ND];
size_t ncontacts;
- double contact_stress[nd];
+ double contact_stress[ND];
double thermal_energy;
size_t color;
};
(DIR) diff --git a/granular.h b/granular.h
t@@ -0,0 +1,6 @@
+#ifndef GRANULAR_
+#define GRANULAR_
+
+#define ND 3
+
+#endif