refac: parallel connection for new damping style
@@ -20,7 +20,7 @@ from examples.JointCases.joint_cases_postprocessing import (
class ParallelConnection(
- BaseSystemCollection, Constraints, Connections, Forcing, CallBacks
+ BaseSystemCollection, Constraints, Connections, Forcing, Damping, CallBacks
):
pass
@@ -36,7 +36,6 @@ base_length = 0.2
base_radius = 0.007
base_area = np.pi * base_radius ** 2
density = 1750
-nu = 4e-2
E = 3e4
poisson_ratio = 0.5
shear_modulus = E / (poisson_ratio + 1.0)
@@ -53,7 +52,7 @@ rod_one = CosseratRod.straight_rod(
base_length,
base_radius,
density,
- nu,
+ 0.0, # internal damping constant, deprecated in v0.3.0
E,
shear_modulus=shear_modulus,
)
@@ -67,7 +66,7 @@ rod_two = CosseratRod.straight_rod(
base_length,
base_radius,
density,
- nu,
+ 0.0, # internal damping constant, deprecated in v0.3.0
E,
shear_modulus=shear_modulus,
)
@@ -133,6 +132,21 @@ for i in range(n_elem):
) # k=kg/s2 nu=kg/s 1e-2
+# add damping
+damping_constant = 4e-2
+dt = 1e-5
+parallel_connection_sim.dampen(rod_one).using(
+ ExponentialDamper,
+ damping_constant=damping_constant,
+ time_step=dt,
+)
+parallel_connection_sim.dampen(rod_two).using(
+ ExponentialDamper,
+ damping_constant=damping_constant,
+ time_step=dt,
+)
+
+
class ParallelConnecitonCallback(CallBackBaseClass):
"""
Call back function for parallel connection
@@ -169,7 +183,6 @@ timestepper = PositionVerlet()
final_time = 5.0
dl = base_length / n_elem
-dt = 1e-5
total_steps = int(final_time / dt)
print("Total steps", total_steps)
integrate(timestepper, parallel_connection_sim, final_time, total_steps)
