Skip to content

Commit

Permalink
revert: catenary case
Browse files Browse the repository at this point in the history
  • Loading branch information
skim0119 committed Jun 25, 2024
1 parent a036bc1 commit 1e395ab
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions examples/CatenaryCase/catenary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
from elastica import *
from elastica.typing import SystemType, SystemCollectionType, SymplecticStepperProtocol

from post_processing import (
plot_video,
Expand All @@ -12,7 +11,7 @@ class CatenarySimulator(BaseSystemCollection, Constraints, Forcing, Damping, Cal
pass


catenary_sim: SystemCollectionType = CatenarySimulator()
catenary_sim = CatenarySimulator()
final_time = 10
damping_constant = 0.3
time_step = 1e-4
Expand All @@ -38,7 +37,7 @@ class CatenarySimulator(BaseSystemCollection, Constraints, Forcing, Damping, Cal
poisson_ratio = 0.5
shear_modulus = E / (poisson_ratio + 1.0)

base_rod: SystemType = CosseratRod.straight_rod(
base_rod = CosseratRod.straight_rod(
n_elem,
start,
direction,
Expand Down Expand Up @@ -77,11 +76,11 @@ class CatenaryCallBack(CallBackBaseClass):
"""

def __init__(self, step_skip: int, callback_params: dict):
super().__init__()
CallBackBaseClass.__init__(self)
self.every = step_skip
self.callback_params = callback_params

def make_callback(self, system: SystemType, time: float, current_step: int) -> None:
def make_callback(self, system, time, current_step: int):

if current_step % self.every == 0:

Expand All @@ -94,7 +93,7 @@ def make_callback(self, system: SystemType, time: float, current_step: int) -> N
return


pp_list: dict = defaultdict(list)
pp_list = defaultdict(list)
catenary_sim.collect_diagnostics(base_rod).using(
CatenaryCallBack, step_skip=step_skip, callback_params=pp_list
)
Expand All @@ -103,7 +102,7 @@ def make_callback(self, system: SystemType, time: float, current_step: int) -> N
catenary_sim.finalize()


timestepper: SymplecticStepperProtocol = PositionVerlet()
timestepper = PositionVerlet()

integrate(timestepper, catenary_sim, final_time, total_steps)
position = np.array(pp_list["position"])
Expand Down

0 comments on commit 1e395ab

Please sign in to comment.