Skip to content

Commit

Permalink
BBO: reproduced
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Sep 8, 2023
1 parent b9e7d6c commit 260bd52
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/Bagirov_Bartman_Ochal_2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def potential_normal_direction(u_nu: float) -> float:
if u_nu < 1 * mm:
return k10 * u_nu ** 2 + k11 * u_nu
if u_nu < 2 * mm:
return k20 * u_nu ** 2 + k21 * u_nu + 4.0
return k20 * u_nu ** 2 + k21 * u_nu + 4
return 16

@staticmethod
Expand Down Expand Up @@ -95,7 +95,7 @@ def friction_bound(u_nu: float) -> float:
def main(save: bool = False):
setup = StaticSetup(mesh_type="cross")

for method in ("Powell", "BFGS", "qsm")[2:]:
for method in ("Powell", "BFGS", "CG", "qsm"):
for force in np.arange(25e3 * kN, 26e3 * kN + 1, 1e3 * kN) * surface:
def outer_forces(x, t=None):
if x[1] >= 0.0099:
Expand Down
6 changes: 6 additions & 0 deletions examples/Sofonea_Ochal_Bartman_2023.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ def zero_relaxation(t=None):
setup.relaxation = examples[name]["relaxation"]

runner = QuasistaticRelaxation(setup, solving_method="schur")
bid = runner.body.mesh.contact_boundary[:, 0]
eid = runner.body.mesh.contact_boundary[:, 1]
bx = runner.body.mesh.initial_nodes[bid][:, 0]
ex = runner.body.mesh.initial_nodes[eid][:, 0]
length = np.max(ex - bx)
print(length)

states = runner.solve(
n_steps=examples[name]["n_steps"],
Expand Down

0 comments on commit 260bd52

Please sign in to comment.