Shear experiment
Shear experiment¶
Attempt to reproduce Figure 7 in [1].
[1] Holzapfel, Gerhard A., and Ray W. Ogden. “Constitutive modelling of passive myocardium: a structurally based framework for material characterization. “Philosophical Transactions of the Royal Society of London A: Mathematical, Physical and Engineering Sciences 367.1902 (2009): 3445-3475.
from __future__ import annotations
from pathlib import Path
import dolfin
import matplotlib.pyplot as plt
import numpy as np
import ufl
import typing
import pulse
from pulse.mechanicsproblem import MechanicsProblem
try:
from dolfin_adjoint import (
Constant,
DirichletBC,
Expression,
UnitCubeMesh,
interpolate,
Function,
)
except ImportError:
from dolfin import (
Constant,
DirichletBC,
interpolate,
Expression,
UnitCubeMesh,
Function,
)
class Experiment(typing.NamedTuple):
problem: MechanicsProblem
increment: typing.Callable[[float], typing.Tuple[float, float, float]]
shear_component: typing.Callable[[ufl.tensors.ComponentTensor], float]
# Create mesh
N = 2
mesh = UnitCubeMesh(N, N, N)
Create a facet fuction in order to mark the subdomains
ffun = dolfin.MeshFunction("size_t", mesh, 2)
ffun.set_all(0)
Mark subdomains
xlow = dolfin.CompiledSubDomain("near(x[0], 0) && on_boundary")
xlow_marker = 1
xlow.mark(ffun, xlow_marker)
xhigh = dolfin.CompiledSubDomain("near(x[0], 1.0) && on_boundary")
xhigh_marker = 2
xhigh.mark(ffun, xhigh_marker)
ylow = dolfin.CompiledSubDomain("near(x[1], 0) && on_boundary")
ylow_marker = 3
ylow.mark(ffun, ylow_marker)
yhigh = dolfin.CompiledSubDomain("near(x[1], 1) && on_boundary")
yhigh_marker = 4
yhigh.mark(ffun, yhigh_marker)
zlow = dolfin.CompiledSubDomain("near(x[2], 0) && on_boundary")
zlow_marker = 5
zlow.mark(ffun, zlow_marker)
zhigh = dolfin.CompiledSubDomain("near(x[2], 1) && on_boundary")
zhigh_marker = 6
zhigh.mark(ffun, zhigh_marker)
Collect the functions containing the markers
marker_functions = pulse.MarkerFunctions(ffun=ffun)
Create mictrotructure
V_f = dolfin.VectorFunctionSpace(mesh, "CG", 1)
Fibers, sheets and fiber-sheet normal
f0 = interpolate(Expression(("1.0", "0.0", "0.0"), degree=1), V_f)
s0 = interpolate(Expression(("0.0", "1.0", "0.0"), degree=1), V_f)
n0 = interpolate(Expression(("0.0", "0.0", "1.0"), degree=1), V_f)
Collect the mictrotructure
microstructure = pulse.Microstructure(f0=f0, s0=s0, n0=n0)
Create the geometry
geometry = pulse.Geometry(
mesh=mesh,
marker_functions=marker_functions,
microstructure=microstructure,
)
Use the default material parameters from the paper
material_parameters = {
"a": 0.059,
"b": 8.023,
"a_f": 18.472,
"b_f": 16.026,
"a_s": 2.481,
"b_s": 11.120,
"a_fs": 0.216,
"b_fs": 11.436,
}
Create material
material = pulse.HolzapfelOgden(parameters=material_parameters)
Make a space for controling the amount of shear displacement
X_space = dolfin.VectorFunctionSpace(mesh, "R", 0)
x = Function(X_space)
zero = Constant((0.0, 0.0, 0.0))
Make a method that will return
def create_experiment(case): # noqa: C901
if case == "fs":
def dirichlet_bc(W):
V = W if W.sub(0).num_sub_spaces() == 0 else W.sub(0)
return [
DirichletBC(V, zero, xlow),
DirichletBC(V, x, xhigh),
]
def increment(xi):
return (0, xi, 0)
def shear_component(T):
return dolfin.assemble(T[0, 1] * dolfin.dx)
elif case == "fn":
def dirichlet_bc(W):
V = W if W.sub(0).num_sub_spaces() == 0 else W.sub(0)
return [
DirichletBC(V, zero, xlow),
DirichletBC(V, x, xhigh),
]
def increment(xi):
return (0, 0, xi)
def shear_component(T):
return dolfin.assemble(T[0, 2] * dolfin.dx)
elif case == "sf":
def dirichlet_bc(W):
V = W if W.sub(0).num_sub_spaces() == 0 else W.sub(0)
return [
DirichletBC(V, zero, ylow),
DirichletBC(V, x, yhigh),
]
def increment(xi):
return (xi, 0, 0)
def shear_component(T):
return dolfin.assemble(T[1, 0] * dolfin.dx)
elif case == "sn":
def dirichlet_bc(W):
V = W if W.sub(0).num_sub_spaces() == 0 else W.sub(0)
return [
DirichletBC(V, zero, ylow),
DirichletBC(V, x, yhigh),
]
def increment(xi):
return (0, 0, xi)
def shear_component(T):
return dolfin.assemble(T[1, 2] * dolfin.dx)
elif case == "nf":
def dirichlet_bc(W):
V = W if W.sub(0).num_sub_spaces() == 0 else W.sub(0)
return [
DirichletBC(V, zero, zlow),
DirichletBC(V, x, zhigh),
]
def increment(xi):
return (xi, 0, 0)
def shear_component(T):
return dolfin.assemble(T[2, 0] * dolfin.dx)
elif case == "ns":
def dirichlet_bc(W):
V = W if W.sub(0).num_sub_spaces() == 0 else W.sub(0)
return [
DirichletBC(V, zero, zlow),
DirichletBC(V, x, zhigh),
]
def increment(xi):
return (0, xi, 0)
def shear_component(T):
return dolfin.assemble(T[2, 1] * dolfin.dx)
else:
raise ValueError(f"Unknown case {case}")
# Collect Boundary Conditions
bcs = pulse.BoundaryConditions(dirichlet=(dirichlet_bc,))
# Create problem
return Experiment(
problem=pulse.MechanicsProblem(geometry, material, bcs),
increment=increment,
shear_component=shear_component,
)
Loop over all modes and collect the stress values
modes = ["fs", "fn", "sf", "sn", "nf", "ns"]
stress: dict[str, dict[str, list[float]]] = {
"cauchy": {m: [] for m in modes},
"pk1": {m: [] for m in modes},
}
shear_values = np.linspace(0, 0.6, 10)
recompute = True
# Solve problem
results_file = Path("result.npy")
if recompute or not results_file.is_file():
for mode in modes:
x.assign(zero)
experiment = create_experiment(mode)
for shear in shear_values:
pulse.iterate.iterate(
experiment.problem,
x,
experiment.increment(shear),
reinit_each_step=True,
)
stress["cauchy"][mode].append(
experiment.shear_component(experiment.problem.ChachyStress()),
)
stress["pk1"][mode].append(
experiment.shear_component(experiment.problem.FirstPiolaStress()),
)
np.save(results_file, stress)
2022-06-05 11:34:12,401 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:34:12,403 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:34:12,404 [419] INFO pulse.iterate: Target: 0.000,0.000,0.000
2022-06-05 11:34:14,680 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:34:14,681 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:34:14,682 [419] INFO pulse.iterate: Target: 0.000,0.067,0.000
2022-06-05 11:36:10,584 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:10,586 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.067,0.000
2022-06-05 11:36:10,588 [419] INFO pulse.iterate: Target: 0.000,0.133,0.000
2022-06-05 11:36:10,767 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:10,770 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.133,0.000
2022-06-05 11:36:10,771 [419] INFO pulse.iterate: Target: 0.000,0.200,0.000
2022-06-05 11:36:10,940 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:10,942 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.200,0.000
2022-06-05 11:36:10,944 [419] INFO pulse.iterate: Target: 0.000,0.267,0.000
2022-06-05 11:36:11,125 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:11,128 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.267,0.000
2022-06-05 11:36:11,129 [419] INFO pulse.iterate: Target: 0.000,0.333,0.000
2022-06-05 11:36:11,298 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:11,300 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.333,0.000
2022-06-05 11:36:11,302 [419] INFO pulse.iterate: Target: 0.000,0.400,0.000
2022-06-05 11:36:11,482 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:11,484 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.400,0.000
2022-06-05 11:36:11,486 [419] INFO pulse.iterate: Target: 0.000,0.467,0.000
2022-06-05 11:36:11,667 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:11,669 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.467,0.000
2022-06-05 11:36:11,671 [419] INFO pulse.iterate: Target: 0.000,0.533,0.000
2022-06-05 11:36:11,872 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:11,875 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.533,0.000
2022-06-05 11:36:11,876 [419] INFO pulse.iterate: Target: 0.000,0.600,0.000
2022-06-05 11:36:12,076 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:12,078 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:12,079 [419] INFO pulse.iterate: Target: 0.000,0.000,0.000
2022-06-05 11:36:13,960 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:13,961 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:13,963 [419] INFO pulse.iterate: Target: 0.000,0.000,0.067
2022-06-05 11:36:14,144 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:14,146 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.067
2022-06-05 11:36:14,146 [419] INFO pulse.iterate: Target: 0.000,0.000,0.133
2022-06-05 11:36:14,311 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:14,313 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.133
2022-06-05 11:36:14,314 [419] INFO pulse.iterate: Target: 0.000,0.000,0.200
2022-06-05 11:36:14,481 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:14,484 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.200
2022-06-05 11:36:14,485 [419] INFO pulse.iterate: Target: 0.000,0.000,0.267
2022-06-05 11:36:14,652 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:14,654 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.267
2022-06-05 11:36:14,656 [419] INFO pulse.iterate: Target: 0.000,0.000,0.333
2022-06-05 11:36:14,824 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:14,827 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.333
2022-06-05 11:36:14,828 [419] INFO pulse.iterate: Target: 0.000,0.000,0.400
2022-06-05 11:36:14,996 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:14,998 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.400
2022-06-05 11:36:15,000 [419] INFO pulse.iterate: Target: 0.000,0.000,0.467
2022-06-05 11:36:15,179 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:15,181 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.467
2022-06-05 11:36:15,183 [419] INFO pulse.iterate: Target: 0.000,0.000,0.533
2022-06-05 11:36:15,375 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:15,377 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.533
2022-06-05 11:36:15,378 [419] INFO pulse.iterate: Target: 0.000,0.000,0.600
2022-06-05 11:36:15,577 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:15,579 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:15,581 [419] INFO pulse.iterate: Target: 0.000,0.000,0.000
2022-06-05 11:36:17,462 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:17,463 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:17,465 [419] INFO pulse.iterate: Target: 0.067,0.000,0.000
2022-06-05 11:36:17,741 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:17,742 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.067,0.000,0.000
2022-06-05 11:36:17,743 [419] INFO pulse.iterate: Target: 0.133,0.000,0.000
2022-06-05 11:36:17,952 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:17,953 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.133,0.000,0.000
2022-06-05 11:36:17,954 [419] INFO pulse.iterate: Target: 0.200,0.000,0.000
2022-06-05 11:36:18,137 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:18,140 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.200,0.000,0.000
2022-06-05 11:36:18,141 [419] INFO pulse.iterate: Target: 0.267,0.000,0.000
2022-06-05 11:36:18,311 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:18,313 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.267,0.000,0.000
2022-06-05 11:36:18,314 [419] INFO pulse.iterate: Target: 0.333,0.000,0.000
2022-06-05 11:36:18,505 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:18,507 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.333,0.000,0.000
2022-06-05 11:36:18,509 [419] INFO pulse.iterate: Target: 0.400,0.000,0.000
2022-06-05 11:36:18,707 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:18,710 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.400,0.000,0.000
2022-06-05 11:36:18,711 [419] INFO pulse.iterate: Target: 0.467,0.000,0.000
2022-06-05 11:36:18,908 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:18,911 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.467,0.000,0.000
2022-06-05 11:36:18,912 [419] INFO pulse.iterate: Target: 0.533,0.000,0.000
2022-06-05 11:36:19,124 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:19,127 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.533,0.000,0.000
2022-06-05 11:36:19,128 [419] INFO pulse.iterate: Target: 0.600,0.000,0.000
2022-06-05 11:36:19,386 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:19,388 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:19,390 [419] INFO pulse.iterate: Target: 0.000,0.000,0.000
2022-06-05 11:36:21,278 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:21,279 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:21,280 [419] INFO pulse.iterate: Target: 0.000,0.000,0.067
2022-06-05 11:36:21,504 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:21,505 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.067
2022-06-05 11:36:21,506 [419] INFO pulse.iterate: Target: 0.000,0.000,0.133
2022-06-05 11:36:21,674 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:21,675 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.133
2022-06-05 11:36:21,677 [419] INFO pulse.iterate: Target: 0.000,0.000,0.200
2022-06-05 11:36:21,847 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:21,849 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.200
2022-06-05 11:36:21,851 [419] INFO pulse.iterate: Target: 0.000,0.000,0.267
2022-06-05 11:36:22,019 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:22,021 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.267
2022-06-05 11:36:22,023 [419] INFO pulse.iterate: Target: 0.000,0.000,0.333
2022-06-05 11:36:22,205 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:22,208 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.333
2022-06-05 11:36:22,209 [419] INFO pulse.iterate: Target: 0.000,0.000,0.400
2022-06-05 11:36:22,378 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:22,381 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.400
2022-06-05 11:36:22,382 [419] INFO pulse.iterate: Target: 0.000,0.000,0.467
2022-06-05 11:36:22,551 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:22,553 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.467
2022-06-05 11:36:22,555 [419] INFO pulse.iterate: Target: 0.000,0.000,0.533
2022-06-05 11:36:22,726 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:22,728 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.533
2022-06-05 11:36:22,730 [419] INFO pulse.iterate: Target: 0.000,0.000,0.600
2022-06-05 11:36:22,922 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:22,924 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:22,926 [419] INFO pulse.iterate: Target: 0.000,0.000,0.000
2022-06-05 11:36:24,899 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:24,900 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:24,902 [419] INFO pulse.iterate: Target: 0.067,0.000,0.000
2022-06-05 11:36:25,150 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:25,151 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.067,0.000,0.000
2022-06-05 11:36:25,153 [419] INFO pulse.iterate: Target: 0.133,0.000,0.000
2022-06-05 11:36:25,336 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:25,337 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.133,0.000,0.000
2022-06-05 11:36:25,339 [419] INFO pulse.iterate: Target: 0.200,0.000,0.000
2022-06-05 11:36:25,539 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:25,541 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.200,0.000,0.000
2022-06-05 11:36:25,543 [419] INFO pulse.iterate: Target: 0.267,0.000,0.000
2022-06-05 11:36:25,752 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:25,754 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.267,0.000,0.000
2022-06-05 11:36:25,756 [419] INFO pulse.iterate: Target: 0.333,0.000,0.000
2022-06-05 11:36:25,958 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:25,960 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.333,0.000,0.000
2022-06-05 11:36:25,962 [419] INFO pulse.iterate: Target: 0.400,0.000,0.000
2022-06-05 11:36:26,149 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:26,152 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.400,0.000,0.000
2022-06-05 11:36:26,153 [419] INFO pulse.iterate: Target: 0.467,0.000,0.000
2022-06-05 11:36:26,356 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:26,359 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.467,0.000,0.000
2022-06-05 11:36:26,360 [419] INFO pulse.iterate: Target: 0.533,0.000,0.000
2022-06-05 11:36:26,554 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:26,557 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.533,0.000,0.000
2022-06-05 11:36:26,559 [419] INFO pulse.iterate: Target: 0.600,0.000,0.000
2022-06-05 11:36:26,770 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:26,772 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:26,774 [419] INFO pulse.iterate: Target: 0.000,0.000,0.000
2022-06-05 11:36:28,769 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:28,770 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.000,0.000
2022-06-05 11:36:28,772 [419] INFO pulse.iterate: Target: 0.000,0.067,0.000
2022-06-05 11:36:29,042 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:29,043 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.067,0.000
2022-06-05 11:36:29,046 [419] INFO pulse.iterate: Target: 0.000,0.133,0.000
2022-06-05 11:36:29,274 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:29,277 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.133,0.000
2022-06-05 11:36:29,277 [419] INFO pulse.iterate: Target: 0.000,0.200,0.000
2022-06-05 11:36:29,476 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:29,477 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.200,0.000
2022-06-05 11:36:29,478 [419] INFO pulse.iterate: Target: 0.000,0.267,0.000
2022-06-05 11:36:29,691 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:29,694 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.267,0.000
2022-06-05 11:36:29,695 [419] INFO pulse.iterate: Target: 0.000,0.333,0.000
2022-06-05 11:36:29,909 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:29,911 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.333,0.000
2022-06-05 11:36:29,913 [419] INFO pulse.iterate: Target: 0.000,0.400,0.000
2022-06-05 11:36:30,112 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:30,114 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.400,0.000
2022-06-05 11:36:30,116 [419] INFO pulse.iterate: Target: 0.000,0.467,0.000
2022-06-05 11:36:30,314 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:30,317 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.467,0.000
2022-06-05 11:36:30,318 [419] INFO pulse.iterate: Target: 0.000,0.533,0.000
2022-06-05 11:36:30,505 [419] INFO pulse.iterate: Iterating to target control (f_32)...
2022-06-05 11:36:30,508 [419] INFO pulse.iterate: Current control: f_32 = Current control: f_32 = 0.000,0.533,0.000
2022-06-05 11:36:30,509 [419] INFO pulse.iterate: Target: 0.000,0.600,0.000
Plot results
stress = np.load(results_file, allow_pickle=True).item()
fig, ax = plt.subplots(1, 2, sharey=True, sharex=True)
for mode, values in stress["cauchy"].items():
ax[0].plot(shear_values, stress["cauchy"][mode], label=mode)
ax[0].set_title("Cauchy Stress")
for mode, values in stress["pk1"].items():
ax[1].plot(shear_values, stress["pk1"][mode], label=mode)
ax[1].set_title("First Piola Kirchhoff Stress")
ax[0].set_ylabel("Shear stress (kPa)")
for axi in ax:
axi.set_xlabel("Amount of shear")
axi.set_ylim((0, 16))
axi.grid()
axi.legend()
plt.show()