Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusgh committed May 27, 2024
1 parent cecaa19 commit a9f5dea
Show file tree
Hide file tree
Showing 34 changed files with 489 additions and 1,198 deletions.
1 change: 0 additions & 1 deletion data/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.h5
!.gitignore

1 change: 0 additions & 1 deletion data/figures/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.h5
!.gitignore

Binary file modified data/figures/notchtest_fine_sigeq_ntfa.pdf
Binary file not shown.
Binary file modified data/figures/notchtest_fine_sigyy_ntfa.pdf
Binary file not shown.
Binary file modified data/figures/random_loading.pdf
Binary file not shown.
Binary file modified data/figures/rel_err_sig_10s.pdf
Binary file not shown.
Binary file modified data/figures/rel_err_sig_ftc_10s.pdf
Binary file not shown.
Binary file modified data/figures/rel_error_uniaxial_T1050.pdf
Binary file not shown.
Binary file modified data/figures/rel_error_uniaxial_T1300.pdf
Binary file not shown.
Binary file modified data/figures/rel_error_uniaxial_T300.pdf
Binary file not shown.
Binary file modified data/figures/rel_error_uniaxial_T550.pdf
Binary file not shown.
Binary file modified data/figures/rel_error_uniaxial_T800.pdf
Binary file not shown.
Binary file modified data/figures/surface_plots_err_sig_sig_ftc.pdf
Binary file not shown.
Binary file modified data/figures/training_reproduction.pdf
Binary file not shown.
Binary file modified data/figures/twoscale_loading.pdf
Binary file not shown.
Binary file modified data/figures/twoscale_loading2.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion data/input_files/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.h5
*.inp
!.gitignore

1 change: 0 additions & 1 deletion data/loadcases/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.h5
*.inp
!.gitignore

1 change: 0 additions & 1 deletion data/results/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.h5
!.gitignore

Binary file added data/results/rel_error_uniaxial_T1050.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/results/rel_error_uniaxial_T1300.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/results/rel_error_uniaxial_T300.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/results/rel_error_uniaxial_T550.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/results/rel_error_uniaxial_T800.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion data/validation/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*.h5
!.gitignore

39 changes: 22 additions & 17 deletions examples/NTFA_thermo_paper.ipynb

Large diffs are not rendered by default.

29 changes: 17 additions & 12 deletions examples/NTFA_thermo_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,13 @@

import h5py
import matplotlib.pyplot as plt
import matplotlib
import numpy as np

colors = ["#004191", "#00BEFF", "tab:orange", "tab:red", "tab:olive", "tab:green", "tab:brown", "tab:pink", "tab:gray", "tab:cyan", "tab:purple", "tab:blue"]
markers = ['o', 'd', 's', '+', '^', 'x', 'p', '*', 'v', '1', 'P', '.']
matplotlib.rcParams['axes.prop_cycle'] = matplotlib.cycler(color=colors)

data_path = "../data"

# %% [markdown]
Expand All @@ -49,30 +54,30 @@
labels = False
for f, T in zip((force), (temp)):
t = np.linspace(0, 2, f.size)
ax.plot(t, f, "-s", ms=4, label="tensile force", color="blue")
ax.plot(t, f, "-s", ms=4, label="tensile force", color=colors[0])
if labels:
ax.plot(1.0, f[np.where(t == 1.0)], "o", color="black", ms=6)
else:
ax2 = ax.twinx()
nhalf = int((t.size + 1) / 2)
# ax.plot(1.0, f[np.where(t==1.0)], 'o', color='black', ms=6, label='start unloading', zorder=4)
ax.fill_between(
t[:nhalf], f[:nhalf], np.zeros(nhalf), color="blue", alpha=0.2, zorder=2
t[:nhalf], f[:nhalf], np.zeros(nhalf), color=colors[0], alpha=0.2, zorder=2
)
ax.fill_between(
t[(nhalf - 1) :],
f[(nhalf - 1) :],
np.zeros(f.size - nhalf + 1),
color="red",
color=colors[1],
alpha=0.2,
zorder=2,
)
ax2.plot(t, T, "-s", ms=4, color="red", zorder=4, label="temperature")
ax2.plot(t, T, "-s", ms=4, color=colors[1], zorder=4, label="temperature")
ax.set_xlabel("time [s]")
ax.set_ylabel("force [kN]")
ax2.set_ylabel("temperature [K]")
ax.text(0.4, 2, "tensile loading", color="blue", bbox=dict(facecolor="white"))
ax.text(1.1, 2, "force unloading", color="red", bbox=dict(facecolor="white"))
ax.text(0.4, 2, "tensile loading", color=colors[0], bbox=dict(facecolor="white"))
ax.text(1.1, 2, "force unloading", color=colors[1], bbox=dict(facecolor="white"))
ax.grid(zorder=1)
ax.legend(loc=(0.65, 0.825))
ax2.legend(loc=(0.65, 0.7))
Expand All @@ -87,12 +92,12 @@
# %%
fig, ax = plt.subplots(1, 1, dpi=dpi)
ax.plot((1.0, 1.0), (-0.05, 1.05), "--", color="gray", lw=2, zorder=4)
ax.fill_between((0.0, 1.0), (0.0, 1.0), (0.0, 0.0), color="blue", alpha=0.2, zorder=2)
ax.fill_between((1.0, 2.0), (1.0, 0.0), (0.0, 0.0), color="red", alpha=0.2, zorder=2)
ax.plot((0.0, 1.0), (0.0, 1.0), color="blue", lw=2, zorder=1)
ax.plot((1.0, 2.0), (1.0, 0.0), "--", color="red", lw=2, zorder=1)
ax.text(0.4, 0.1, "tensile loading", color="blue", bbox=dict(facecolor="white"))
ax.text(1.1, 0.1, "force unloading", color="red", bbox=dict(facecolor="white"))
ax.fill_between((0.0, 1.0), (0.0, 1.0), (0.0, 0.0), color=colors[0], alpha=0.2, zorder=2)
ax.fill_between((1.0, 2.0), (1.0, 0.0), (0.0, 0.0), color=colors[1], alpha=0.2, zorder=2)
ax.plot((0.0, 1.0), (0.0, 1.0), color=colors[0], lw=2, zorder=1)
ax.plot((1.0, 2.0), (1.0, 0.0), "--", color=colors[1], lw=2, zorder=1)
ax.text(0.4, 0.1, "tensile loading", color=colors[0], bbox=dict(facecolor="white"))
ax.text(1.1, 0.1, "force unloading", color=colors[1], bbox=dict(facecolor="white"))
ax.set_xlabel("time [s]")
ax.set_ylabel(r"rel. stretch $u/u_\mathrm{max}$ and force $F/F_\mathrm{max}$ [-]")
ax.grid(zorder=3)
Expand Down
142 changes: 9 additions & 133 deletions examples/generate_plots.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/material_parameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
"version": "3.11.6"
}
},
"nbformat": 4,
Expand Down
737 changes: 212 additions & 525 deletions examples/paper_plots.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit a9f5dea

Please sign in to comment.