Skip to content

Commit

Permalink
Update data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusgh committed Oct 2, 2024
1 parent 146efe2 commit e8b4350
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 247 deletions.
3 changes: 0 additions & 3 deletions data/input_files/.gitignore

This file was deleted.

Binary file removed data/results/mat_parameters1.pdf
Binary file not shown.
Binary file removed data/results/mat_parameters2.pdf
Binary file not shown.
Binary file removed data/results/sig0_parameter.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions data/validation/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions data/vtk-notch/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions data/vtk/.gitignore

This file was deleted.

189 changes: 0 additions & 189 deletions data/vtk/postprocess_ntfa_293-800.py

This file was deleted.

12 changes: 12 additions & 0 deletions download_data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
OPTIONS="-q --show-progress"
DATASET=https://darus.uni-stuttgart.de/api/access/datafile/:persistentId\?persistentId\=doi:10.18419/darus-4509
wget $OPTIONS $DATASET/1 -O results/NTFA293K_coarse_temp_293-800.h5
wget $OPTIONS $DATASET/2 -O results/NTFA293K_fine_temp_293-800.h5
wget $OPTIONS $DATASET/3 -O ntfa/ntfa_6loadings_10samples_N12.h5
wget $OPTIONS $DATASET/4 -O ntfa/ntfa_6loadings_10samples_N18.h5
wget $OPTIONS $DATASET/5 -O ntfa/ntfa_6loadings_10samples_N24.h5
wget $OPTIONS $DATASET/7 -O results/reproduction_6loadings_100samples_N12.h5
wget $OPTIONS $DATASET/8 -O results/reproduction_6loadings_100samples_N18.h5
wget $OPTIONS $DATASET/9 -O results/reproduction_6loadings_100samples_N24.h5
wget $OPTIONS $DATASET/10 -O rve/rve_thermoplastic_6loadings_10samples.h5
wget $OPTIONS $DATASET/11 -O rve/twoscale_notch_rve.h5
12 changes: 2 additions & 10 deletions examples/material_parameters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@
"stiffness_cu = lambda x: bulk_modulus_cu(x) * IxI + 2.0 * shear_modulus_cu(x) * P2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "438cfe95",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "49cccd0a",
Expand Down Expand Up @@ -391,7 +383,7 @@
" gca1.legend(loc=\"upper left\", facecolor=(0.9, 0.9, 0.9, 0.6), edgecolor=\"black\")\n",
" gca2.legend(loc=\"center right\", facecolor=(0.9, 0.9, 0.9, 0.6), edgecolor=\"black\")\n",
" plt.tight_layout(pad=0.025)\n",
" plt.savefig(os.path.join(data_path, \"results\", f\"{fig_name}.pdf\"))\n",
" plt.savefig(os.path.join(data_path, \"figures\", f\"{fig_name}.pdf\"))\n",
" plt.show()"
]
},
Expand Down Expand Up @@ -520,7 +512,7 @@
" gca1.grid(ls=\"--\", color=\"gray\", linewidth=0.5)\n",
" gca1.legend(loc=\"upper right\", facecolor=(0.9, 0.9, 0.9, 0.6), edgecolor=\"black\")\n",
" plt.tight_layout(pad=0.025)\n",
" plt.savefig(os.path.join(data_path, \"results\", f\"{fig_name}.pdf\"))\n",
" plt.savefig(os.path.join(data_path, \"figures\", f\"{fig_name}.pdf\"))\n",
" plt.show()"
]
},
Expand Down
6 changes: 2 additions & 4 deletions examples/material_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
)
stiffness_cu = lambda x: bulk_modulus_cu(x) * IxI + 2.0 * shear_modulus_cu(x) * P2

# %%

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

Expand Down Expand Up @@ -278,7 +276,7 @@
gca1.legend(loc="upper left", facecolor=(0.9, 0.9, 0.9, 0.6), edgecolor="black")
gca2.legend(loc="center right", facecolor=(0.9, 0.9, 0.9, 0.6), edgecolor="black")
plt.tight_layout(pad=0.025)
plt.savefig(os.path.join(data_path, "results", f"{fig_name}.pdf"))
plt.savefig(os.path.join(data_path, "figures", f"{fig_name}.pdf"))
plt.show()

# %% [markdown]
Expand Down Expand Up @@ -372,7 +370,7 @@ def my_sig_y(
gca1.grid(ls="--", color="gray", linewidth=0.5)
gca1.legend(loc="upper right", facecolor=(0.9, 0.9, 0.9, 0.6), edgecolor="black")
plt.tight_layout(pad=0.025)
plt.savefig(os.path.join(data_path, "results", f"{fig_name}.pdf"))
plt.savefig(os.path.join(data_path, "figures", f"{fig_name}.pdf"))
plt.show()

# %%
26 changes: 12 additions & 14 deletions examples/reproduce_article.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,26 +170,14 @@
"id": "2fa3edb7-cffc-4c02-8f7b-5c0cc8241a05",
"metadata": {},
"source": [
"## Mode study\n",
"\n",
"## Training reproduction tests\n",
"\n",
"## Analysis of the training directions of the temperature range\n",
"Analysis of the training directions of the temperature range\n",
"\n",
"### Load data from hdf5 files\n",
"- compare efficiency of the interpolation over the temperature\n",
"- show select stress-strain curves\n",
"- results are generated based on `generate_inputs.py` and external C/C++ UMAT\n",
"\n",
"### Analysis of the training directions of the temperature range\n",
"\n",
"First figure: comparison of $\\theta$-NTFA and FEM for training scenarios\n",
"\n",
"loadcases: 0, 2, 5\n",
"\n",
"temperatures: 0, 3, 9 (0, 33, -1)\n",
"\n",
"N_modes: 12, 18, 24"
"- results are generated based on `generate_inputs.py` and external C/C++ UMAT"
]
},
{
Expand Down Expand Up @@ -270,6 +258,16 @@
"id": "8221681f-2959-46eb-97a3-a1b6e72c5dc6",
"metadata": {},
"source": [
"### Analysis of the training directions of the temperature range\n",
"\n",
"First figure: comparison of $\\theta$-NTFA and FEM for training scenarios\n",
"\n",
"loadcases: 0, 2, 5\n",
"\n",
"temperatures: 0, 3, 9 (0, 33, -1)\n",
"\n",
"N_modes: 12, 18, 24\n",
"\n",
"### Relative error in sig_bar for 300K, 633.3K and 1300 K"
]
},
Expand Down
24 changes: 11 additions & 13 deletions examples/reproduce_article.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,26 +152,14 @@ def rel_error(A, A_ref, r_min=None):
A.dim = A.data.shape

# %% [markdown]
# ## Mode study
#
# ## Training reproduction tests
#
# ## Analysis of the training directions of the temperature range
# Analysis of the training directions of the temperature range
#
# ### Load data from hdf5 files
# - compare efficiency of the interpolation over the temperature
# - show select stress-strain curves
# - results are generated based on `generate_inputs.py` and external C/C++ UMAT
#
# ### Analysis of the training directions of the temperature range
#
# First figure: comparison of $\theta$-NTFA and FEM for training scenarios
#
# loadcases: 0, 2, 5
#
# temperatures: 0, 3, 9 (0, 33, -1)
#
# N_modes: 12, 18, 24

# %%
data_sig_ntfa = np.zeros((3, 3, 3, 11, 6))
Expand Down Expand Up @@ -227,6 +215,16 @@ def rel_error(A, A_ref, r_min=None):
data_sig_fans[2, 2, i, :, :] = fans_sig[-1, 5, :, :]

# %% [markdown]
# ### Analysis of the training directions of the temperature range
#
# First figure: comparison of $\theta$-NTFA and FEM for training scenarios
#
# loadcases: 0, 2, 5
#
# temperatures: 0, 3, 9 (0, 33, -1)
#
# N_modes: 12, 18, 24
#
# ### Relative error in sig_bar for 300K, 633.3K and 1300 K

# %%
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"

[project]
name = "thermontfa"
version = "0.0.1"
description = ""
version = "0.1.0"
description = "This repository contains a material routine written in Python for the thermo-elasto-plastic Nonuniform Transformation Field Analysis (ThermoNTFA)"
authors = [
{name="Felix Fritzen", email="[email protected]"},
{name="Julius Herb", email="[email protected]"},
Expand Down

0 comments on commit e8b4350

Please sign in to comment.