tadd debug output for tangential components - 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 04efc5912ba233ff656bd21008535f71bbaa7404
(DIR) parent 1e22f447f8ca996ea6d0fbb9edff3e0af18f7591
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Thu, 14 Apr 2016 15:29:12 -0700
add debug output for tangential components
Diffstat:
M slidergrid/debug.h | 8 ++++----
M slidergrid/slider.c | 44 +++++++++++++++++++++++++++----
M tests/elasticity/Makefile | 3 +++
M tests/elasticity/shear.c | 10 ++++++----
4 files changed, 52 insertions(+), 13 deletions(-)
---
(DIR) diff --git a/slidergrid/debug.h b/slidergrid/debug.h
t@@ -6,18 +6,18 @@
//#define DEBUG_FIND_AND_BOND_TO_NEIGHBORS
// if defined, show information on the resolved inter-slider bond deformation
-//#define DEBUG_BOND_DEFORMATION
+#define DEBUG_BOND_DEFORMATION
// if defined, verbose information to stdout will be shown about the individual
// components of the sum of forces
-//#define DEBUG_SLIDER_FORCE_COMPONENTS
+#define DEBUG_SLIDER_FORCE_COMPONENTS
// if defined, verbose information to stdout will be shown before the slider
// integration
-//#define DEBUG_SLIDER_FORCE_TORQUE_AND_NEIGHBORS
+#define DEBUG_SLIDER_FORCE_TORQUE_AND_NEIGHBORS
// if defined, verbose information to stdout will be shown after the slider
// integration
-//#define DEBUG_SLIDER_KINEMATICS
+#define DEBUG_SLIDER_KINEMATICS
#endif
(DIR) diff --git a/slidergrid/slider.c b/slidergrid/slider.c
t@@ -256,6 +256,30 @@ void bond_normal_deformation(slider* s1, const slider s2,
// total relative displacement in inter-slider distance
s1->neighbor_relative_tangential_velocity[idx_neighbor] = vel_t;
+ /*
+ printf("\t------\n"
+ "tan_disp0_u = %f %f %f\n"
+ "tan_disp0 = %f %f %f\n"
+ "tan_disp = %f %f %f\n"
+ "dtan_disp = %f %f %f\n"
+ "vel_t = %f %f %f\n"
+ ,
+ tangential_displacement0_uncor.x,
+ tangential_displacement0_uncor.y,
+ tangential_displacement0_uncor.z,
+ tangential_displacement0.x,
+ tangential_displacement0.y,
+ tangential_displacement0.z,
+ tangential_displacement.x,
+ tangential_displacement.y,
+ tangential_displacement.z,
+ dtangential_displacement.x,
+ dtangential_displacement.y,
+ dtangential_displacement.z,
+ vel_t.x,
+ vel_t.y,
+ vel_t.z);
+ */
}
t@@ -264,7 +288,7 @@ 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);
}
t@@ -368,9 +392,13 @@ void bond_shear_kelvin_voigt(slider* s1, const slider s2,
s1->torque = add_float3(s1->torque, torque);
#ifdef DEBUG_SLIDER_FORCE_COMPONENTS
- 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",
+ printf(" slider_interaction KV-shear:\n"
+ "\tf_t = %f %f %f\n"
+ "\ttorque = %f %f %f\n"
+ "\tf_t_elastic = %f %f %f\n"
+ "\tf_t_viscous = %f %f %f\n"
+ "\ttan_disp = %f %f %f\n"
+ "\ttan_vel = %f %f %f\n",
f_t.x,
f_t.y,
f_t.z,
t@@ -382,7 +410,13 @@ void bond_shear_kelvin_voigt(slider* s1, const slider s2,
f_t_elastic.z,
f_t_viscous.x,
f_t_viscous.y,
- f_t_viscous.z);
+ f_t_viscous.z,
+ s1->neighbor_relative_tangential_displacement[idx_neighbor].x,
+ s1->neighbor_relative_tangential_displacement[idx_neighbor].y,
+ s1->neighbor_relative_tangential_displacement[idx_neighbor].z,
+ s1->neighbor_relative_tangential_velocity[idx_neighbor].x,
+ s1->neighbor_relative_tangential_velocity[idx_neighbor].y,
+ s1->neighbor_relative_tangential_velocity[idx_neighbor].z);
#endif
}
(DIR) diff --git a/tests/elasticity/Makefile b/tests/elasticity/Makefile
t@@ -33,3 +33,6 @@ clean:
@$(RM) $(BINS)
@$(RM) -r *-output
@$(RM) *.o
+
+clean-root:
+ make clean -C ../..
(DIR) diff --git a/tests/elasticity/shear.c b/tests/elasticity/shear.c
t@@ -12,8 +12,8 @@ simulation setup_simulation()
sim.id = "shear";
// initialize grid of sliders
- int nx = 10;
- //int nx = 2;
+ //int nx = 10;
+ int nx = 2;
int ny = 1;
int nz = 1;
sim.N = nx*ny*nz;
t@@ -39,8 +39,10 @@ simulation setup_simulation()
sim.sliders[0].vel.y = 0.1;
// set temporal parameters
- sim.time_end = 100.0;
- sim.file_interval = 1.0;
+ //sim.time_end = 100.0;
+ //sim.file_interval = 1.0;
+ sim.time_end = 1.0;
+ sim.file_interval = 1.0e-3;
return sim;
}