tadd Kelvin-Voigt parameters for twist and bending - slidergrid - grid of elast… | |
git clone git://src.adamsgaard.dk/slidergrid | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 7394876c00fe2230bb855621da3aa936ddd35baf | |
parent bbf7010bcf7ceae41f9d8bf35c2f7d1f1e66ae78 | |
Author: Anders Damsgaard Christensen <[email protected]> | |
Date: Tue, 19 Apr 2016 12:09:55 -0700 | |
add Kelvin-Voigt parameters for twist and bending | |
Diffstat: | |
M slidergrid/slider.c | 35 +++++++++++++++++------------… | |
M slidergrid/slider.h | 8 ++++++++ | |
2 files changed, 27 insertions(+), 16 deletions(-) | |
--- | |
diff --git a/slidergrid/slider.c b/slidergrid/slider.c | |
t@@ -32,6 +32,12 @@ void initialize_slider_values(slider* s) | |
s->bond_shear_kv_stiffness = 0.0; | |
s->bond_shear_kv_viscosity = 0.0; | |
+ s->bond_twist_kv_stiffness = 0.0; | |
+ s->bond_twist_kv_viscosity = 0.0; | |
+ | |
+ s->bond_bend_kv_stiffness = 0.0; | |
+ s->bond_bend_kv_viscosity = 0.0; | |
+ | |
s->damping_viscosity_linear = 0.0; | |
s->damping_viscosity_angular = 0.0; | |
s->damping_coefficient = 0.0; | |
t@@ -479,31 +485,28 @@ void bond_shear_kelvin_voigt(slider* s1, const slider s2, | |
void bond_twist_kelvin_voigt(slider* s1, const slider s2, | |
const int idx_neighbor) | |
{ | |
- // determine the bond-shear KV stiffness from the harmonic mean. | |
- const Float bond_shear_kv_stiffness = | |
- 2.*s1->bond_shear_kv_stiffness*s2.bond_shear_kv_stiffness/ | |
- (s1->bond_shear_kv_stiffness + s2.bond_shear_kv_stiffness | |
+ // determine the bond-twist KV stiffness from the harmonic mean. | |
+ const Float bond_twist_kv_stiffness = | |
+ 2.*s1->bond_twist_kv_stiffness*s2.bond_twist_kv_stiffness/ | |
+ (s1->bond_twist_kv_stiffness + s2.bond_twist_kv_stiffness | |
+ 1.0e-40); | |
- // determine the bond-shear KV viscosity from the harmonic mean. | |
- const Float bond_shear_kv_viscosity = | |
- 2.*s1->bond_shear_kv_viscosity*s2.bond_shear_kv_viscosity/ | |
- (s1->bond_shear_kv_viscosity + s2.bond_shear_kv_viscosity | |
+ // determine the bond-twist KV viscosity from the harmonic mean. | |
+ const Float bond_twist_kv_viscosity = | |
+ 2.*s1->bond_twist_kv_viscosity*s2.bond_twist_kv_viscosity/ | |
+ (s1->bond_twist_kv_viscosity + s2.bond_twist_kv_viscosity | |
+ 1.0e-40); | |
// bond-parallel Kelvin-Voigt elasticity | |
- const Float3 m_n_elastic = | |
- multiply_scalar_float3(bond_shear_kv_stiffness, | |
- s1->neighbor_relative_twist[idx_neighbor]); | |
+ const Float m_n_elastic = bond_twist_kv_stiffness | |
+ *s1->neighbor_relative_twist[idx_neighbor]; | |
// bond-parallel Kelvin-Voigt viscosity | |
- const Float3 m_n_viscous = | |
- multiply_scalar_float3(bond_shear_kv_viscosity, | |
- s1->neighbor_relative_twist_velocity[idx_neighbor]); | |
+ const Float m_n_viscous = bond_twist_kv_viscosity | |
+ *s1->neighbor_relative_twist_velocity[idx_neighbor]; | |
// bond-parallel Kelvin-Voigt moment, counteracts twisting | |
- const Float3 m_n = multiply_scalar_float3( -1.0, | |
- add_float3(m_n_elastic, m_n_viscous)); | |
+ const Float m_n = -1.0*(m_n_elastic + m_n_viscous); | |
// determine torque on slider from shear on this bond | |
/*const Float3 torque = multiply_scalar_float3( -1.0, | |
diff --git a/slidergrid/slider.h b/slidergrid/slider.h | |
t@@ -39,6 +39,14 @@ typedef struct { | |
Float bond_shear_kv_stiffness; // Hookean elastic stiffness [N/m] | |
Float bond_shear_kv_viscosity; // viscosity [N/(m*s)] | |
+ // inter-slider bond-twist Kelvin-Voigt contact model parameters | |
+ Float bond_twist_kv_stiffness; // Hookean elastic stiffness [N/m] | |
+ Float bond_twist_kv_viscosity; // viscosity [N/(m*s)] | |
+ | |
+ // inter-slider bond-bend Kelvin-Voigt contact model parameters | |
+ Float bond_bend_kv_stiffness; // Hookean elastic stiffness [N/m] | |
+ Float bond_bend_kv_viscosity; // viscosity [N/(m*s)] | |
+ | |
// Damping parameters | |
Float damping_viscosity_linear; // Linear velocity damping [N/(m/s)] | |
Float damping_viscosity_angular; // Angular velocity damping [N*m/(rad/s)] |