diff --git a/.readthedocs.yml b/.readthedocs.yml index 04fa9f6..b5b592e 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,22 +1,24 @@ version: 2 +# conda: +# environment: environment.yml + build: os: ubuntu-22.04 tools: python: "miniconda-latest" + nodejs: "20" apt_packages: - libglx-mesa0 - libgl1 - xvfb - jobs: - pre_build: - # Generate the Sphinx configuration for this Jupyter Book so it builds. - - "jupyter-book config sphinx book/" - -conda: - environment: environment.yml - -sphinx: - builder: html - fail_on_warning: true - configuration: book/_config.yml \ No newline at end of file + commands: + - npm install -g mystmd + # - pip install "jupyter-book>=2.0.0a0" + - conda env create --name festim-workshop-jupyter2 --file environment.yml + - mkdir -p $READTHEDOCS_OUTPUT/site + - ls + - export HOST=127.0.0.1 + - export BASE_URL=. + - conda run -n festim-workshop-jupyter2 bash -c "cd book/ && jupyter book build --html" + - cp -a book/_build/html/. "$READTHEDOCS_OUTPUT/html" && rm -r book/_build \ No newline at end of file diff --git a/book/_config.yml b/book/_config.yml deleted file mode 100644 index 3224c33..0000000 --- a/book/_config.yml +++ /dev/null @@ -1,48 +0,0 @@ -# Book settings -# Learn more at https://jupyterbook.org/customize/config.html - -title: FESTIM tutorial -author: The FESTIM community - -# Information about where the book exists on the web -repository: - url: https://github.com/festim-dev/FESTIM-workshop # Online location of your book - path_to_book: book # Optional path to your book, relative to the repository root - branch: festim2 # Which branch of the repository should be used when creating links (optional) - -logo: images/logo_light.png - -# NOTE turning this OFF while we figure out how to not override the `html` options -# sphinx: -# config: -# html_theme_options: -# logo: -# image_light: images/logo_light.png -# image_dark: images/logo_dark.svg - -# Add GitHub buttons to your book -# See https://jupyterbook.org/customize/config.html#add-a-link-to-your-repository -html: - use_issues_button: true - use_repository_button: true - use_edit_page_button: true - logo: true - -execute: - # Force re-execution of notebooks on each build. - # See https://jupyterbook.org/content/execute.html - execute_notebooks: force - timeout: -1 # Disable timeouts for executing notebooks cells - # allow_errors: true # Allow errors in notebook cells - -parse: - myst_enable_extensions: - # don't forget to list any other extensions you want enabled, - # including those that are enabled by default! - - amsmath - - dollarmath - -launch_buttons: - notebook_interface: "jupyterlab" - binderhub_url: "https://mybinder.org" - thebe: true \ No newline at end of file diff --git a/book/_toc.yml b/book/_toc.yml deleted file mode 100644 index 6cac4fa..0000000 --- a/book/_toc.yml +++ /dev/null @@ -1,39 +0,0 @@ -# Table of contents -# Learn more at https://jupyterbook.org/customize/toc.html - -format: jb-book -root: intro -parts: - - caption: Getting started - chapters: - - file: content/applications/task01 - - - caption: Meshing - chapters: - - file: content/meshes/mesh_festim - - file: content/meshes/mesh_fenics - - file: content/meshes/mesh_gmsh - - file: content/meshes/mesh_salome - - - caption: Materials - chapters: - - file: content/material/material_basics - - file: content/material/material_htm - - file: content/material/material_advanced - - - caption: Species & Reactions - chapters: - - file: content/species_reactions/species - - file: content/species_reactions/reactions - - file: content/species_reactions/surface_reactions - - - caption: Applications - chapters: - - file: content/applications/task02 - - file: content/applications/task03 - - file: content/applications/task04 - - file: content/applications/task07 - - file: content/applications/task08 - - file: content/applications/task06 - - file: content/applications/task10 - - file: content/applications/microstructure \ No newline at end of file diff --git a/book/content/species_reactions/reactions.ipynb b/book/content/species_reactions/reactions.ipynb index 0d9b934..da598c1 100644 --- a/book/content/species_reactions/reactions.ipynb +++ b/book/content/species_reactions/reactions.ipynb @@ -28,9 +28,9 @@ "\n", "We'll start with a simple reaction between species A and B forming species C at a rate $k$ and assume there is no backward reaction.\n", "\n", - "```{math}\n", + "" ] }, { @@ -224,9 +224,6 @@ "\n", "The previous example can be very easily extended to a two-way reaction:\n", "\n", - "```{math}\n", - "\\ce{A + B <-->[k][p] C}\n", - "```\n", "\n", "The governing equations for this problem are:\n", "\n", @@ -350,13 +347,9 @@ "Here we consider a reaction scheme where mobile species A and B react to form species C (immobile).\n", "Species C then reacts *on its own* to form species D.\n", "\n", - "```{math}\n", - "\\ce{A + B <-->[k_1][p_1] C}\n", - "```\n", - "\n", - "```{math}\n", + "\n", "\n", "The governing equations of this system are:\n", "\n", @@ -500,10 +493,7 @@ "\n", "\n", "Hydrogen trapping can be represented as a reaction too. Here we consider mobile hydrogen ($\\mathrm{H}$) reacting with an empty trap ($[\\ ]$) to form trapped hydrogen ($\\mathrm{[H]}$):\n", - "\n", - "```{math}\n", - "\\ce{H + [ ] <-->[k][p] [H]}\n", - "```\n" + "\n" ] }, { @@ -884,18 +874,6 @@ "\n", "Let's consider a trap with 3 occupancy levels. We have the following reaction scheme:\n", "\n", - "```{math}\n", - "\\ce{H + [ ] <-->[k][p] [1H]}\n", - "```\n", - "\n", - "```{math}\n", - "\\ce{H + [1H] <-->[k][p] [2H]}\n", - "```\n", - "\n", - "```{math}\n", - "\\ce{H + [2H] <-->[k][p] [3H]}\n", - "```\n", - "\n", "The underlying governing equations are:\n", "\n", "\\begin{align}\n", @@ -1040,13 +1018,6 @@ "\n", "Now we consider a unique trapping site that can react with two different mobile species H and D:\n", "\n", - "```{math}\n", - "\\ce{H + [\\ ] <-->[k][p] [H]}\n", - "```\n", - "\n", - "```{math}\n", - "\\ce{D + [\\ ] <-->[k][p] [D]}\n", - "```\n", "\n", "The governing equations for this problem are:\n", "\n", @@ -1203,9 +1174,7 @@ "\n", "``Reaction`` objects can have multiple products. This is useful to simulate things like isotope swapping where a mobile species reacts with a trapped species, and swap their positions:\n", "\n", - "```{math}\n", - "\\ce{H + [T] <-->[k_\\mathrm{swap}][k_\\mathrm{swap}] T + [H]}\n", - "```\n", + "\n", "\n", "In this example we consider the above reaction, with an initial condition for the trapped T concentration and mobile H diffusing in the domain, slowly swapping trapped T.\n", "\n", @@ -1352,11 +1321,7 @@ "cell_type": "markdown", "id": "e238c83e", "metadata": {}, - "source": [ - "```{math}\n", - "\\ce{A ->[\\lambda] \\emptyset}\n", - "```" - ] + "source": [] }, { "cell_type": "markdown", @@ -1468,9 +1433,7 @@ "\n", "Another use case of this type of reaction is metal interstitial atoms recombining with vacancies (both forming a Frenkel pair) and annihilate.\n", "\n", - "```{math}\n", - "\\ce{I + V ->[k] \\emptyset}\n", - "```\n", + "\n", "\n", "In this example, we define two mobile species I and V, both diffusing from one side of the 1D domain and annihilating." ] diff --git a/book/intro.md b/book/intro.md index 119f518..19b44f3 100644 --- a/book/intro.md +++ b/book/intro.md @@ -1,3 +1,25 @@ -# The FESTIM tutorial +# FESTIM-workshop -Welcome to the FESTIM tutorial! \ No newline at end of file +The FESTIM workshop is a tutorial covering many aspects of the hydrogen transport code FESTIM. +Check out the [website](https://festim-workshop.readthedocs.io). + +## Launch in Binder + +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/festim-dev/FESTIM-workshop/main) + +[Run this workshop](https://mybinder.org/v2/gh/festim-dev/FESTIM-workshop/main) in BinderHub + +## Local install + +1. Clone this repo + +``` +git clone https://github.com/festim-dev/FESTIM-workshop +``` +2. Create Conda environment (requires conda) + +``` +conda env create -f environment.yml +``` + +3. You should then be able to execute the notebooks with the ``festim-workshop`` environment \ No newline at end of file diff --git a/book/myst.yml b/book/myst.yml new file mode 100644 index 0000000..360ed6f --- /dev/null +++ b/book/myst.yml @@ -0,0 +1,49 @@ +version: 1 +project: + title: FESTIM workshop + authors: + - name: The FESTIM community + github: festim-dev/FESTIM-workshop + thebe: + binder: + repo: festim-dev/FESTIM-workshop + provider: github + url: https://mybinder.org + ref: festim2 + toc: + - file: intro.md + - title: Getting started + children: + - file: content/applications/task01.ipynb + - title: Meshing + children: + - file: content/meshes/mesh_festim.ipynb + - file: content/meshes/mesh_fenics.ipynb + - file: content/meshes/mesh_gmsh.ipynb + - file: content/meshes/mesh_salome.ipynb + - title: Materials + children: + - file: content/material/material_basics.md + - file: content/material/material_htm.md + - file: content/material/material_advanced.md + - title: Species & Reactions + children: + - file: content/species_reactions/species.ipynb + - file: content/species_reactions/reactions.ipynb + - file: content/species_reactions/surface_reactions.ipynb + - title: Applications + children: + - file: content/applications/task02.ipynb + - file: content/applications/task03.ipynb + - file: content/applications/task04.ipynb + - file: content/applications/task07.ipynb + - file: content/applications/task08.ipynb + - file: content/applications/task06.ipynb + - file: content/applications/task10.ipynb + - file: content/applications/microstructure.md +site: + options: + logo: images/logo_light.png + logo_dark: images/logo_dark.svg + folders: true + template: "https://github.com/myst-templates/book-theme/archive/de4c1e9c09c6cd12fc529c1f22e8abf8e7f35381.zip" diff --git a/environment.yml b/environment.yml index 155b7b8..1e766f3 100644 --- a/environment.yml +++ b/environment.yml @@ -1,11 +1,11 @@ -name: festim-workshop +name: festim-workshop-jupyter2 channels: - conda-forge - defaults dependencies: - - jupyter-book - jupytext # necessary to open MyST files using BinderHub https://jupyterbook.org/en/stable/interactive/launchbuttons.html#launchbuttons-binder - sphinx-tags + - nodejs - matplotlib - meshio[all] - pip>=20.1 @@ -17,6 +17,8 @@ dependencies: - shapely - scipy - pip: + - "jupyter-book>=2.0.0a0" + - "--pre" - pyparsing - h-transport-materials==0.16 - pyvista[all,trame] # trame cannot be installed on conda \ No newline at end of file