| t@@ -41,7 +41,7 @@ void initialize_slider_values(slider* s)
for (i=0; ineighbors[i] = -1;
s->neighbor_distance[i] = zeroes_float3();
- s->neighbor_relative_distance_displacement[i] = zeroes_float3();
+ s->neighbor_relative_distance_displacement[i] = 0.0;
s->neighbor_relative_distance_velocity[i] = zeroes_float3();
s->neighbor_relative_tangential_displacement[i] = zeroes_float3();
s->neighbor_relative_tangential_velocity[i] = zeroes_float3();
t@@ -143,6 +143,17 @@ void bond_parallel_deformation(slider* s1, const slider s2,
// unit vector pointing from neighbor (s2) to slider s1
const Float3 n = divide_float3_scalar(dist, dist_norm);
+#ifdef DEBUG_BOND_DEFORMATION
+ printf("\tdist = %f %f %f\n\tdist_norm = %f\n\tn = %f %f %f\n",
+ dist.x,
+ dist.y,
+ dist.z,
+ dist_norm,
+ n.x,
+ n.y,
+ n.z);
+#endif
+
// relative contact interface velocity w/o rolling
const Float3 vel_linear = subtract_float3(s1->vel, s2.vel);
t@@ -165,12 +176,11 @@ void bond_parallel_deformation(slider* s1, const slider s2,
// total relative displacement in inter-slider distance
if (iteration == 0)
- s1->neighbor_relative_distance_displacement[idx_neighbor] = ddist;
- else
s1->neighbor_relative_distance_displacement[idx_neighbor] =
- add_float3(
- s1->neighbor_relative_distance_displacement[idx_neighbor],
- ddist);
+ dot_float3(n, ddist);
+ else
+ s1->neighbor_relative_distance_displacement[idx_neighbor] +=
+ dot_float3(n, ddist);
// total relative displacement in inter-slider distance
s1->neighbor_relative_distance_velocity[idx_neighbor] =
t@@ -254,13 +264,17 @@ void bond_deformation(slider* s1, const slider s2,
const int idx_neighbor, const int iteration, const Float dt)
{
bond_parallel_deformation(s1, s2, idx_neighbor, iteration);
- bond_normal_deformation(s1, s2, idx_neighbor, iteration, dt);
+ //bond_normal_deformation(s1, s2, idx_neighbor, iteration, dt);
}
void bond_parallel_kelvin_voigt(slider* s1, const slider s2,
const int idx_neighbor)
{
+ // unit vector pointing from neighbor (s2) to slider s1
+ const Float3 n = divide_float3_scalar(s1->neighbor_distance[idx_neighbor],
+ norm_float3(s1->neighbor_distance[idx_neighbor]));
+
// determine the bond-parallel KV stiffness from the harmonic mean.
// differs from Potyondy & Stack 2004, eq. 6.
const Float bond_parallel_kv_stiffness =
t@@ -276,8 +290,9 @@ void bond_parallel_kelvin_voigt(slider* s1, const slider s2,
// bond-parallel Kelvin-Voigt elasticity
const Float3 f_n_elastic =
- multiply_scalar_float3(bond_parallel_kv_stiffness,
- s1->neighbor_relative_distance_displacement[idx_neighbor]);
+ multiply_scalar_float3(bond_parallel_kv_stiffness *
+ s1->neighbor_relative_distance_displacement[idx_neighbor],
+ n);
// bond-parallel Kelvin-Voigt viscosity
const Float3 f_n_viscous =
t@@ -292,8 +307,12 @@ void bond_parallel_kelvin_voigt(slider* s1, const slider s2,
s1->force = add_float3(s1->force, f_n);
#ifdef DEBUG_SLIDER_FORCE_COMPONENTS
- printf("slider_interaction KV-parallel: f_n = %f %f %f, "
- "f_n_elastic = %f %f %f, f_n_viscous = %f %f %f\n",
+ printf(" slider_interaction KV-parallel:\n"
+ "\tn = %f %f %f\n\tf_n = %f %f %f\n\t"
+ "f_n_elastic = %f %f %f\n\tf_n_viscous = %f %f %f\n",
+ n.x,
+ n.y,
+ n.z,
f_n.x,
f_n.y,
f_n.z,
t@@ -354,8 +373,9 @@ void bond_shear_kelvin_voigt(slider* s1, const slider s2,
f_t)));*/
#ifdef DEBUG_SLIDER_FORCE_COMPONENTS
- printf("slider_interaction KV-shear: f_t = %f %f %f, torque = %f %f %f, "
- "f_t_elastic = %f %f %f, f_t_viscous = %f %f %f\n",
+ printf(" slider_interaction KV-shear:\n\tf_t = %f %f %f\n"
+ "\ttorque = %f %f %f\n\t"
+ "f_t_elastic = %f %f %f\n\tf_t_viscous = %f %f %f\n",
f_t.x,
f_t.y,
f_t.z,
t@@ -376,7 +396,7 @@ void bond_shear_kelvin_voigt(slider* s1, const slider s2,
void slider_interaction(slider* s1, const slider s2, const int idx_neighbor)
{
bond_parallel_kelvin_voigt(s1, s2, idx_neighbor);
- //bond_shear_kelvin_voigt(s1, s2, idx_neighbor);
+ bond_shear_kelvin_voigt(s1, s2, idx_neighbor);
}
t@@ -391,32 +411,21 @@ void slider_neighbor_interaction(
int idx_neighbor;
for (idx_neighbor=0; idx_neighborforce.x = 0.;
- s->force.y = 0.;
- s->force.z = 0.;
- s->torque.x = 0.;
- s->torque.y = 0.;
- s->torque.z = 0.;*/
-
if (s->neighbors[idx_neighbor] != -1) {
+#ifdef DEBUG_BOND_DEFORMATION
+ printf("%p = %d:\n", s, idx_neighbor);
+#endif
bond_deformation(
s, sliders[s->neighbors[idx_neighbor]],
idx_neighbor, iteration, dt);
#ifdef DEBUG_BOND_DEFORMATION
- int j;
- for (j=0; jneighbor_relative_distance_displacement[idx_neighbor].x,
- s->neighbor_relative_distance_displacement[idx_neighbor].y,
- s->neighbor_relative_distance_displacement[idx_neighbor].z,
+ s->neighbor_relative_distance_displacement[idx_neighbor],
s->neighbor_relative_distance_velocity[idx_neighbor].x,
s->neighbor_relative_distance_velocity[idx_neighbor].y,
s->neighbor_relative_distance_velocity[idx_neighbor].z, |