tadd twist test - slidergrid - grid of elastic sliders on a frictional surface
(HTM) git clone git://src.adamsgaard.dk/slidergrid
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 476c2046fbb6ac2eef3d7a24403db6918e665dde
(DIR) parent 399bec23e552877fa5063f68fed06706d4d109eb
(HTM) Author: Anders Damsgaard Christensen <adc@geo.au.dk>
Date: Tue, 19 Apr 2016 16:08:17 -0700
add twist test
Diffstat:
A tests/elasticity/twist.c | 48 +++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/tests/elasticity/twist.c b/tests/elasticity/twist.c
t@@ -0,0 +1,48 @@
+#include "../../slidergrid/simulation.h"
+#include "../../slidergrid/grid.h"
+#include "../../slidergrid/slider.h"
+
+#include <stdio.h>
+
+// test a regular, 2d, orthogonal grid of sliders
+simulation setup_simulation()
+{
+ // create empty simulation structure with default values
+ simulation sim = create_simulation();
+ sim.id = "twist";
+
+ // initialize grid of sliders
+ //int nx = 20;
+ int nx = 2;
+ int ny = 1;
+ int nz = 1;
+ sim.N = nx*ny*nz;
+ sim.sliders = create_regular_slider_grid(nx, ny, nz, 1.0, 1.0, 1.0);
+
+ sim.bond_length_limit = 1.5;
+
+ // set slider masses and moments of inertia
+ int i;
+ for (i=0; i<sim.N; i++) {
+
+ // set default values
+ initialize_slider_values(&sim.sliders[i]);
+
+ // set custom values for certain parameters
+ sim.sliders[i].mass = 10.0;
+ sim.sliders[i].moment_of_inertia = 1.0e3;
+ sim.sliders[i].bond_parallel_kv_stiffness = 1.0e4;
+ sim.sliders[i].bond_shear_kv_stiffness = 1.0e5;
+ sim.sliders[i].bond_twist_kv_stiffness = 1.0e5;
+ }
+
+ sim.sliders[0].angvel.x = 1.0e1;
+
+ // set temporal parameters
+ //sim.time_end = 100.0;
+ //sim.file_interval = 1.0;
+ sim.time_end = 1.0;
+ sim.file_interval = 1.0e-3;
+
+ return sim;
+}