Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusgh committed Oct 2, 2024
1 parent 4f670e7 commit 146efe2
Show file tree
Hide file tree
Showing 17 changed files with 66 additions and 56 deletions.
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/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/results/mat_parameters1.pdf
Binary file not shown.
Binary file modified data/results/mat_parameters2.pdf
Binary file not shown.
Binary file modified data/results/sig0_parameter.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The new $\theta$-NTFA is then validated for various thermo-mechanical loadings a

[1] S. Sharba, J. Herb, F. Fritzen, Reduced order homogenization of thermoelastic materials with strong temperature
dependence and comparison to a machine-learned model, Archive of Applied Mechanics 93 (7) (2023) 2855–2876.
doi: [10.1007/s00419-023-02411-6](https://doi.org/10.1007/s00419-023-02411-6)
doi: :ref:`https://doi.org/10.1007/s00419-023-02411-6<10.1007/s00419-023-02411-6>`

Features
^^^^^^^^
Expand Down
84 changes: 42 additions & 42 deletions examples/generate_inputs.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/generate_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

# %%
file_name = os.path.join(
data_path, "validation", "simple_3d_rve_B1-B6_16x16x16_100samples_fix.h5"
data_path, "ntfa_raw", "rve_thermoplastic_6loadings_10samples.h5"
)
group_name = "/ms_9p/dset0_sim"
suffix = "_fix16_N24_100s"
Expand Down
7 changes: 5 additions & 2 deletions examples/material_parameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
"> Felix Fritzen is funded by the German Research Foundation (DFG) --\n",
"> 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).\n",
"\n",
"This notebook contains the temperature-dependent material parameters of copper (Cu) and\n",
"fused tungsten carbide (FTC) that are used in the examples of our CMAME article.\n",
"\n",
"## Imports"
]
},
Expand Down Expand Up @@ -90,7 +93,7 @@
"id": "f719a870",
"metadata": {},
"source": [
"## Temperature-dependent material parameters of copper phase (phase no. 0)"
"## Temperature-dependent material parameters of copper (Cu) phase (phase no. 0)"
]
},
{
Expand Down Expand Up @@ -137,7 +140,7 @@
"id": "49cccd0a",
"metadata": {},
"source": [
"## Temperature-dependent material parameters of wsc phase (phase no. 1)"
"## Temperature-dependent material parameters of wsc/FTC phase (phase no. 1)"
]
},
{
Expand Down
7 changes: 5 additions & 2 deletions examples/material_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
# > Felix Fritzen is funded by the German Research Foundation (DFG) --
# > 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).
#
# This notebook contains the temperature-dependent material parameters of copper (Cu) and
# fused tungsten carbide (FTC) that are used in the examples of our CMAME article.
#
# ## Imports

# %%
Expand All @@ -44,7 +47,7 @@
P2 = I4 - P1

# %% [markdown]
# ## Temperature-dependent material parameters of copper phase (phase no. 0)
# ## Temperature-dependent material parameters of copper (Cu) phase (phase no. 0)

# %%
poisson_ratio_cu = lambda x: 3.40000e-01 * x**0
Expand Down Expand Up @@ -73,7 +76,7 @@
# %%

# %% [markdown]
# ## Temperature-dependent material parameters of wsc phase (phase no. 1)
# ## Temperature-dependent material parameters of wsc/FTC phase (phase no. 1)

# %%
poisson_ratio_wsc = lambda x: 2.80000e-01 * x**0
Expand Down
6 changes: 3 additions & 3 deletions examples/reproduce_article.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"> Felix Fritzen is funded by the German Research Foundation (DFG) --\n",
"> 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).\n",
"\n",
"This notebooks reproduces some results and plots from the examples of our CMAME article.\n",
"\n",
"## Imports:"
]
},
Expand Down Expand Up @@ -115,9 +117,7 @@
},
"outputs": [],
"source": [
"mode_fn = os.path.join(\n",
" data_path, \"ntfa_raw\", \"rve_thermoplastic_6loadings_10samples.h5\"\n",
")\n",
"mode_fn = os.path.join(data_path, \"rve\", \"rve_thermoplastic_6loadings_10samples.h5\")\n",
"A_bar = TabularInterpolation.from_h5(\n",
" mode_fn,\n",
" \"/ms_9p/dset0_ntfa/temperatures\",\n",
Expand Down
6 changes: 3 additions & 3 deletions examples/reproduce_article.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
# > Felix Fritzen is funded by the German Research Foundation (DFG) --
# > 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).
#
# This notebooks reproduces some results and plots from the examples of our CMAME article.
#
# ## Imports:

# %%
Expand Down Expand Up @@ -102,9 +104,7 @@ def rel_error(A, A_ref, r_min=None):
# - This also happens inside of the ThermoNTFA class during initialization

# %%
mode_fn = os.path.join(
data_path, "ntfa_raw", "rve_thermoplastic_6loadings_10samples.h5"
)
mode_fn = os.path.join(data_path, "rve", "rve_thermoplastic_6loadings_10samples.h5")
A_bar = TabularInterpolation.from_h5(
mode_fn,
"/ms_9p/dset0_ntfa/temperatures",
Expand Down
4 changes: 3 additions & 1 deletion examples/truncate_ntfa_modes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"> Felix Fritzen is funded by the German Research Foundation (DFG) --\n",
"> 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).\n",
"\n",
"This notebook exemplifies how the NTFA modes can be truncated after computation.\n",
"\n",
"## Imports"
]
},
Expand Down Expand Up @@ -82,7 +84,7 @@
}
],
"source": [
"fname = os.path.join(data_path, \"ntfa_raw\", \"rve_thermoplastic_6loadings_10samples.h5\")\n",
"fname = os.path.join(data_path, \"rve\", \"rve_thermoplastic_6loadings_10samples.h5\")\n",
"basename = \"/ms_9p/dset0_ntfa/\"\n",
"\n",
"F = h5py.File(fname, \"r\")\n",
Expand Down
4 changes: 3 additions & 1 deletion examples/truncate_ntfa_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# > Felix Fritzen is funded by the German Research Foundation (DFG) --
# > 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).
#
# This notebook exemplifies how the NTFA modes can be truncated after computation.
#
# ## Imports

# %%
Expand All @@ -33,7 +35,7 @@
data_path = "../data"

# %%
fname = os.path.join(data_path, "ntfa_raw", "rve_thermoplastic_6loadings_10samples.h5")
fname = os.path.join(data_path, "rve", "rve_thermoplastic_6loadings_10samples.h5")
basename = "/ms_9p/dset0_ntfa/"

F = h5py.File(fname, "r")
Expand Down

0 comments on commit 146efe2

Please sign in to comment.