diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05a832f..7ea352e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,12 +63,17 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Install pandoc + #uses: docker://pandoc/core:2.9 + run: | + sudo apt update + sudo apt install pandoc -y - name: Install thermontfa run: pip install .[dev] - name: Build documentation run: | cd docs - make html + TZ=UTC make html - name: Upload artifacts uses: actions/upload-artifact@v4 with: diff --git a/docs/conf.py b/docs/conf.py index 04e7f02..b86e240 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,10 +24,10 @@ "sphinx.ext.autosectionlabel", "nbsphinx", "sphinx_gallery.load_style", - "nbsphinx_link", ] myst_enable_extensions = ["dollarmath", "amsmath"] nbsphinx_allow_errors = True +autodoc_member_order = "bysource" templates_path = ["_templates"] exclude_patterns = ["build", "Thumbs.db", ".DS_Store"] diff --git a/docs/examples.rst b/docs/examples.rst index ae37f5b..8e87d84 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -2,10 +2,10 @@ Examples -------- .. nbgallery:: - examples/material_parameters.nblink - examples/truncate_ntfa_modes.nblink - examples/paper_plots.nblink - examples/generate_inputs.nblink - examples/generate_plots.nblink - examples/NTFA_thermo_paper.nblink - examples/thermoNTFA_example.nblink + examples/material_parameters + examples/truncate_ntfa_modes + examples/paper_plots + examples/generate_inputs + examples/generate_plots + examples/NTFA_thermo_paper + examples/thermoNTFA_example diff --git a/docs/index.rst b/docs/index.rst index 914b817..5a08d62 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,10 +14,10 @@ TODO: abstract :maxdepth: 2 :caption: Contents: - Workflow - Installation - ThermoNTFA Documentation - Examples + workflow + installation + api + examples MarkdownLinks/license MarkdownLinks/citation MarkdownLinks/changelog diff --git a/examples/paper_plots.ipynb b/examples/paper_plots.ipynb index 42f4a92..ca95188 100644 --- a/examples/paper_plots.ipynb +++ b/examples/paper_plots.ipynb @@ -25,11 +25,7 @@ "> Felix Fritzen is funded by the German Research Foundation (DFG) --\n", "> 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1).\n", "\n", - "## Mode study\n", - "## Training reproduction tests\n", - "## Random loading\n", - "## Stress-driven simulation\n", - "## Twoscale simulation" + "## Imports:" ] }, { @@ -80,6 +76,18 @@ " )" ] }, + { + "cell_type": "markdown", + "id": "bd108d2a", + "metadata": {}, + "source": [ + "## Mode study\n", + "## Training reproduction tests\n", + "## Random loading\n", + "## Stress-driven simulation\n", + "## Twoscale simulation" + ] + }, { "cell_type": "markdown", "id": "9ef6456e", @@ -785,6 +793,18 @@ " GG.create_dataset(\"xi\", data=xi)" ] }, + { + "cell_type": "markdown", + "id": "46edb92e", + "metadata": {}, + "source": [ + "1. set the stress to 0\n", + "2. ramp the temperature from 293K\n", + "3. check for q >= q_crit_0, q_crit_1, ...\n", + " e.g. q_crit_0 = 0.002 (i.e. 0.2%)\n", + "4. draw the results of theta" + ] + }, { "cell_type": "code", "execution_count": null, @@ -794,12 +814,6 @@ }, "outputs": [], "source": [ - "# 1. set the stress to 0\n", - "# 2. ramp the temperature from 293K\n", - "# 3. check for q >= q_crit_0, q_crit_1, ...\n", - "# e.g. q_crit_0 = 0.002 (i.e. 0.2%)\n", - "# draw the results of theta\n", - "\n", "n_ramp = 1300 - 293 + 1\n", "with h5py.File(\"ms9p_thermal_rampup.h5\", \"w\") as F:\n", " eps_idx = None\n", diff --git a/examples/paper_plots.py b/examples/paper_plots.py index 2212afd..e871541 100644 --- a/examples/paper_plots.py +++ b/examples/paper_plots.py @@ -35,11 +35,7 @@ # > Felix Fritzen is funded by the German Research Foundation (DFG) -- # > 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1). # -# ## Mode study -# ## Training reproduction tests -# ## Random loading -# ## Stress-driven simulation -# ## Twoscale simulation +# ## Imports: # %% import os @@ -83,6 +79,13 @@ def rel_error(A, A_ref, r_min=None): ) +# %% [markdown] +# ## Mode study +# ## Training reproduction tests +# ## Random loading +# ## Stress-driven simulation +# ## Twoscale simulation + # %% [markdown] # **Load the NTFA data** @@ -612,13 +615,14 @@ def rel_error(A, A_ref, r_min=None): GG.create_dataset("xi", data=xi) -# %% Figuring when palsticity kicks in using the mixed UMAT +# %% [markdown] # 1. set the stress to 0 # 2. ramp the temperature from 293K # 3. check for q >= q_crit_0, q_crit_1, ... # e.g. q_crit_0 = 0.002 (i.e. 0.2%) -# draw the results of theta +# 4. draw the results of theta +# %% Figuring when palsticity kicks in using the mixed UMAT n_ramp = 1300 - 293 + 1 with h5py.File("ms9p_thermal_rampup.h5", "w") as F: eps_idx = None diff --git a/pyproject.toml b/pyproject.toml index 718bac4..5556448 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,13 +28,15 @@ dependencies = [ [project.optional-dependencies] dev = [ - 'jupytext~=1.16.1', - 'jupyterlab~=4.1.8', - 'pre_commit~=3.7.0', - 'pytest', + 'jupyterlab~=4.2.0', + 'jupytext~=1.16.2', + 'pre-commit~=3.7.1', + 'pytest~=8.2.0', 'sphinx', - 'myst_parser', - 'sphinx_rtd_theme' + 'myst-parser~=3.0.1', + 'nbsphinx~=0.9.4', + 'sphinx-gallery~=0.16.0', + 'sphinx-rtd-theme~=2.0.0' ] [tool.flake8] diff --git a/thermontfa/tabular_interpolation.py b/thermontfa/tabular_interpolation.py index 7b77f42..7340345 100644 --- a/thermontfa/tabular_interpolation.py +++ b/thermontfa/tabular_interpolation.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ -Tabular interpolation for the NTFA +Tabular interpolation for the thermo-mechanical NTFA (c) 2024, Felix Fritzen , diff --git a/thermontfa/thermoNTFA.py b/thermontfa/thermoNTFA.py index 7f04860..190c03a 100644 --- a/thermontfa/thermoNTFA.py +++ b/thermontfa/thermoNTFA.py @@ -22,7 +22,7 @@ 390740016 (EXC-2075); 406068690 (FR2702/8-1); 517847245 (FR2702/10-1). """ -from typing import Callable, Optional, Tuple +from typing import Callable, Optional, Tuple, List import h5py import numpy as np @@ -39,6 +39,17 @@ class ThermoMechNTFA: """ # TODO: Document properties + file_name: str + group_name: str + sig_y: Callable[[float, float, bool], float] + tol: float + verbose: bool = False + A_bar: TabularInterpolation + C_bar: TabularInterpolation + D_xi: TabularInterpolation + tau_theta: TabularInterpolation + tau_xi: TabularInterpolation + sig_phases: List def __init__( self,