Introduction
Introduction Statistics Contact Development Disclaimer Help
tadd twist test - slidergrid - grid of elastic sliders on a frictional surface
git clone git://src.adamsgaard.dk/slidergrid
Log
Files
Refs
README
LICENSE
---
commit 476c2046fbb6ac2eef3d7a24403db6918e665dde
parent 399bec23e552877fa5063f68fed06706d4d109eb
Author: Anders Damsgaard Christensen <[email protected]>
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(-)
---
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;
+}
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.