Skip to content

Commit

Permalink
Merge branch 'BHE_Meshing_Doc' into 'master'
Browse files Browse the repository at this point in the history
[Web] Tutorial of creating mesh with BHEs and enhanced notebook to web conversion

See merge request ogs/ogs!4704
  • Loading branch information
bilke committed Oct 11, 2023
2 parents 97dbae5 + 71343c1 commit abb8a73
Show file tree
Hide file tree
Showing 20 changed files with 483 additions and 139 deletions.
12 changes: 8 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:
rev: v2.2.2
hooks:
- id: codespell
exclude: 'ThirdParty/.*|Tests/Data/.*|.*\.ya?ml|.*\.bib|^web/content/imprint.md|^GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd|^Applications/FileIO/Legacy/OGSIOVer4.cpp|^scripts/cmake/CPM.cmake|Documentation/.vale/.*'
exclude: 'ThirdParty/.*|Tests/Data/.*|.*\.ya?ml|.*\.bib|^web/content/imprint.md|^GeoLib/IO/XmlIO/OpenGeoSysSTN.xsd|^Applications/FileIO/Legacy/OGSIOVer4.cpp|^scripts/cmake/CPM.cmake|Documentation/.vale/.*|.*\.ipynb|.*\.svg'
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
Expand Down Expand Up @@ -73,11 +73,15 @@ repos:
language: system
pass_filenames: false
files: \.(h|cpp)$
- repo: https://github.com/errata-ai/vale
rev: v2.24.4
hooks:
- id: vale
name: Check spelling with vale
entry: bash -c 'if command -v vale &> /dev/null; then vale sync; VALE_MIN_ALERT_LEVEL=error scripts/ci/helper/run-vale; else exit 0; fi'
name: vale sync
pass_filenames: false
language: system
args: [sync]
- id: vale
args: [--output=line, --minAlertLevel=error]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.262"
hooks:
Expand Down
6 changes: 6 additions & 0 deletions Applications/Utils/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1403,3 +1403,9 @@ AddTest(
square_1x1_geometry_bottom.vtu square_1x1_geometry_bottom.vtu 1e-16
square_1x1_geometry_top.vtu square_1x1_geometry_top.vtu 1e-16
)

if(NOT OGS_USE_PETSC)
NotebookTest(NOTEBOOKFILE ../../web/content/docs/tutorials/bhe_meshing/notebook-bhe_meshing.md
PYTHON_PACKAGES openpyxl
RUNTIME 10)
endif()
2 changes: 1 addition & 1 deletion Documentation/.vale/Vocab/ogs/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fmt
Forchheimer
Fortran
Francesco
frontmatter
[Ff]rontmatter
Galerkin
Genuchten
Geoenergy
Expand Down
2 changes: 1 addition & 1 deletion ProcessLib/LiquidFlow/Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ if(NOT OGS_USE_MPI)
OgsTest(PROJECTFILE Parabolic/LiquidFlow/SimpleSynthetics/PrimaryVariableConstraintDirichletBC/cuboid_1x1x1_hex_1000_Dirichlet_Dirichlet_3.prj)
OgsTest(PROJECTFILE Parabolic/LiquidFlow/SimpleSynthetics/FunctionParameterTest.prj)
OgsTest(PROJECTFILE Parabolic/LiquidFlow/BlockingConductingFracture/block_conduct_frac.prj)
NotebookTest(NOTEBOOKFILE Parabolic/LiquidFlow/BlockingConductingFracture/LiquidFlow.ipynb RUNTIME 6)
NotebookTest(NOTEBOOKFILE Parabolic/LiquidFlow/BlockingConductingFracture/BlockingConductingFracture.ipynb RUNTIME 6)
endif()

# inclined mesh
Expand Down
26 changes: 15 additions & 11 deletions Tests/Data/Elliptic/cube_1x1x1_SteadyStateDiffusion/ssd-cube.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,24 @@
"author = \"Lars Bilke\"\n",
"web_subsection = \"elliptic\"\n",
"draft = true\n",
"<!--eofm-->"
"<!--eofm-->\n"
]
},
{
"cell_type": "markdown",
"id": "35326dbe",
"metadata": {},
"source": [
"This notebook is just for testing and does not show up on the web page because `draft = true` in the metadata."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "59877add-6b0e-4ee4-9bca-301ea5c23f6d",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"import os\n",
Expand All @@ -41,7 +51,9 @@
"cell_type": "code",
"execution_count": 14,
"id": "6c5503b0-ba41-4273-b19a-0fafdb717bb0",
"metadata": {},
"metadata": {
"lines_to_next_cell": 2
},
"outputs": [],
"source": [
"resolution = \"2e4\"\n",
Expand Down Expand Up @@ -78,14 +90,6 @@
"plotter.add_mesh(mesh, scalars=\"v\") # pressure\n",
"plotter.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "651a2d8c-52d8-448c-ab63-30f95ad70f3d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
26 changes: 6 additions & 20 deletions Tests/Data/Mechanics/Linear/DiscWithHole/Linear_Disc_with_hole.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
---
jupyter:
jupytext:
text_representation:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.14.5
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

<!-- #raw -->
+++
title = "Linear elasticity: disc with hole"
date = "2022-04-27"
author = "Linda Günther, Sophia Einspänner, Robert Habel, Christoph Lehmann and Thomas Nagel"
web_subsection = "small-deformations"
<!--eofm-->
<!-- #endraw -->
+++

|<div style="width:330px"><img src="https://www.ufz.de/static/custom/weblayout/DefaultInternetLayout/img/logos/ufz_transparent_de_blue.png" width="300"/></div>|<div style="width:330px"><img src="https://discourse.opengeosys.org/uploads/default/original/1X/a288c27cc8f73e6830ad98b8729637a260ce3490.png" width="300"/></div>|<div style="width:330px"><img src="https://tubaf.org/_nuxt/img/logo_de.c04ca6f.svg" width="300"/></div>|

|<div style="width:330px"><img src="https://www.ufz.de/static/custom/weblayout/DefaultInternetLayout/img/logos/ufz_transparent_de_blue.png" width="300"/></div>|<div style="width:330px"><img src="https://discourse.opengeosys.org/uploads/default/original/1X/a288c27cc8f73e6830ad98b8729637a260ce3490.png" width="300"/></div>|<div style="width:330px"><img src="https://upload.wikimedia.org/wikipedia/commons/e/e8/TUBAF_Logo.svg" width="300"/></div>|
|---|---|--:|

In this benchmark example we consider a linear elastic small deformation problem. More specifically, a plate with a central hole that is put under tension on its top boundary is simulated. By exploiting symmetries, below we evaluate this problem just for the top right quarter of this disc.
Expand Down Expand Up @@ -119,7 +105,7 @@ def kirsch_sig_rt(sig, r, theta, a):

### Stress distribution along the $x$-axis ($\theta= -90°$, orthogonal to the load)

At larger distances from the hole the stresses are approximately distibuted as if the plate had no hole ($\sigma_{rr} \equiv \sigma_{xx} \approx 0$, $\sigma_{r\theta} \equiv \sigma_{xy} = 0$, $\sigma_{\theta\theta} \equiv \sigma_{yy} = 10\,\text{kPa}$).
At larger distances from the hole the stresses are approximately distributed as if the plate had no hole ($\sigma_{rr} \equiv \sigma_{xx} \approx 0$, $\sigma_{r\theta} \equiv \sigma_{xy} = 0$, $\sigma_{\theta\theta} \equiv \sigma_{yy} = 10\,\text{kPa}$).
As the hole is approached, the tangential stress increases until it reaches its maximum value directly at the contour.
Interestingly, that value is three times as high as the applied traction. It can be concluded that the hole leads to a **threefold stress concentration**.

Expand Down Expand Up @@ -244,7 +230,7 @@ $$

For the simulation of the numerical model, some assumptions have to be made:

* The analytical solution is stricty correct only for an infinitely extended plate.
* The analytical solution is strictly correct only for an infinitely extended plate.
This requirement can only be approximated in the numerical method. The dimensions of the considered plate must be much larger than the hole. With a hole diameter of $4\, \text{cm}$ and a size of $20\times20\, \text{cm}$ the plate can be considered as infinitely extended. Indeed, a general rule implied that the range of borders should be about five times the size of the cavity.
* For numerical simulations, it is necessary to specify the mesh resolution with which the model is calculated. A finer mesh provides more detailed gradients but takes more time for calculation, whereas a coarser mesh yields less accurate values, but in a shorter time.
* Another assumption that enables us to work with a two-dimensional plate model is the plain strain condition. That means that deformations only occur in one plane.
Expand Down
99 changes: 79 additions & 20 deletions Tests/Data/Notebooks/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,22 @@ def save_to_website(exec_notebook_file, web_path):
output_path = "docs/benchmarks"
notebook = nbformat.read(exec_notebook_file, as_version=4)
first_cell = notebook.cells[0]
if first_cell.cell_type == "raw":
if is_jupytext:
if "Tests/Data" not in exec_notebook_file:
output_path = str(Path(exec_notebook_file).parent.parent)
else:
lines = first_cell.source.splitlines()
toml_begin = lines.index("+++")
toml_end = max(loc for loc, val in enumerate(lines) if val == "+++")
toml_lines = lines[toml_begin + 1 : toml_end]
parsed_frontmatter = toml.loads("\n".join(toml_lines))
output_path = (
Path(build_dir)
/ Path("web/content")
/ Path(output_path)
/ Path(parsed_frontmatter["web_subsection"])
)
elif first_cell.cell_type == "raw":
lines = first_cell.source.splitlines()
last_line = lines[-1]
if "<!--eofm-->" not in last_line:
Expand All @@ -34,6 +49,7 @@ def save_to_website(exec_notebook_file, web_path):
"'web_subsection'!"
)
output_path = os.path.join(output_path, parsed_frontmatter["web_subsection"])
output_path = Path(build_dir) / (Path("web/content") / Path(output_path))
else:
print(
f"Warning: {exec_notebook_file} does not contain a RAW cell as its first "
Expand Down Expand Up @@ -85,11 +101,14 @@ def save_to_website(exec_notebook_file, web_path):
if "OGS_DATA_DIR" not in os.environ:
os.environ["OGS_DATA_DIR"] = os.path.join(ogs_source_path, "Tests/Data")
os.makedirs(args.out, exist_ok=True)
build_dir = Path(args.out).parent.parent
success = True

for notebook_file_path in args.notebooks:
notebook_success = True
convert_notebook_file = notebook_file_path
is_jupytext = False
if Path(notebook_file_path).suffix in [".md", ".py"]:
is_jupytext = True
notebook_file_path_relative = (
Path(notebook_file_path).absolute().relative_to(ogs_source_path)
)
Expand All @@ -105,13 +124,17 @@ def save_to_website(exec_notebook_file, web_path):
os.makedirs(notebook_output_path, exist_ok=True)
os.environ["OGS_TESTRUNNER_OUT_DIR"] = notebook_output_path
notebook_filename = os.path.basename(notebook_file_path)
convert_notebook_file = os.path.join(
notebook_output_path, Path(notebook_filename).stem
)
convert_notebook_file = notebook_output_path
if not is_jupytext:
convert_notebook_file = os.path.join(
convert_notebook_file, Path(notebook_filename).stem
)
convert_notebook_file += ".ipynb"

if Path(notebook_file_path).suffix == ".md":
if is_jupytext:
nb = jupytext.read(notebook_file_path)
convert_notebook_file = convert_notebook_file.replace("notebook-", "")
jupytext.write(nb, convert_notebook_file)
else:
with open(notebook_file_path, mode="r", encoding="utf-8") as f:
nb = nbformat.read(f, as_version=4)
Expand Down Expand Up @@ -154,27 +177,63 @@ def save_to_website(exec_notebook_file, web_path):
if "CI_MERGE_REQUEST_SOURCE_PROJECT_URL" in os.environ:
repo = os.environ["CI_MERGE_REQUEST_SOURCE_PROJECT_URL"]
branch = os.environ["CI_MERGE_REQUEST_SOURCE_BRANCH_NAME"]

# Modify metadata
meta_cell = nb["cells"][0]
if is_jupytext:
if meta_cell.source.startswith("---"):
print(
f"Error: {notebook_filename} frontmatter is not in TOML format! Use +++ delimitiers!"
)
success = False
meta_cell.source = meta_cell.source.replace(
"+++\n", "+++\nnotebook = true\n", 1
)
else:
meta_cell.source = f"notebook = true\n{meta_cell.source}"

# Insert Jupyter header with notebook source and binderhub link
binder_link = f"https://mybinder.org/v2/gh/bilke/binder-ogs-requirements/master?urlpath=git-pull%3Frepo={repo}%26urlpath=lab/tree/ogs/{notebook_file_path_relative}%26branch={branch}"
text = f"""
<div class="note">
<p style="margin-top: 0; margin-bottom: 0;">
<img style="margin-top: 0; margin-bottom: 0; height: 2em;" class="inline-block mr-2 no-fancybox"
src="https://upload.wikimedia.org/wikipedia/commons/3/38/Jupyter_logo.svg" alt="">
This page is based on a Jupyter notebook.
<a href="{repo}/-/blob/{branch}/{notebook_file_path_relative}"><img src="https://img.shields.io/static/v1?label=Source:&message={notebook_filename}&color=brightgreen" class="no-fancybox"
style="display: inline; margin-top: 0; margin-bottom: 0; margin-left: 1em;" /></a>
<a href="{binder_link}">
<img class="no-fancybox" style="display: inline; margin-top: 0; margin-bottom: 0; margin-left: 1em;"
src="https://img.shields.io/static/v1?label=&message=Launch notebook&color=5c5c5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.source = f"notebook = true\n{meta_cell.source}"
nb["cells"].insert(1, nbformat.v4.new_markdown_cell(text))
This page is based on a Jupyter notebook."""
if is_jupytext:
download_file_name = (
Path(convert_notebook_file)
.rename(Path(convert_notebook_file).with_suffix(".ipynb"))
.name
)
text += f"""
<a href="./{download_file_name}" download="{download_file_name}"><img class="no-fancybox" style="display: inline; margin-top: 0; margin-bottom: 0; margin-left: 1em;" src="https://img.shields.io/static/v1?label=Download:&message={download_file_name}&color=blue" /></a>"""
text += f"""
<a href="{repo}/-/blob/{branch}/{notebook_file_path_relative}"><img src="https://img.shields.io/static/v1?label=Source:&message={notebook_filename}&color=brightgreen" class="no-fancybox"
style="display: inline; margin-top: 0; margin-bottom: 0; margin-left: 1em;" /></a>
<a href="{binder_link}">
<img class="no-fancybox" style="display: inline; margin-top: 0; margin-bottom: 0; margin-left: 1em;"
src="https://img.shields.io/static/v1?label=&message=Launch notebook&color=5c5c5c&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAB3RJTUUH4gsEADkvyr8GjAAABQZJREFUSMeVlnlsVFUUh7/7ZukwpQxdoK2yGGgqYFKMQkyDUVBZJECQEERZVLQEa4iKiggiFjfqbkADhVSgEVkETVSiJBATsEIRja1RoCwuU5gC7Qww03Zm3rzrH/dOfJSZUm4y6Xt9957vnnN/55wruI7RVjMNQAA3AiX6bxw4BTQAQQDvnF1pbYjrAAEUAmXADGAQ0AOQwCWgHqgGdgCRdNBrAm2wW4A1wN2ACZwG/gbcQBFwg/Z2I/AS0JoKanQzmoXAamA0cBx4EhgDTAYmAvcArwNhYD6wHHDbNts9D20LlgMrgWPAXKAO/j8rPc8A5uiNAUwH9tjnddfDAn1mFkJWyoRR58hsv8K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sEK2o47Ju0i2MysAt1xxkLtOpwpwzpFd4+sOHXKHDAIa16YNTJrJzS3x9ZVdvoy+WbecNTLfUCs7Xd/aQr3umGy0rgshIhQ8pNhpSmIeVzTZm9pnjNuLDLXT97gKdRKXUWXUvt3qUNqX1oYz2Bj1H3mXPABh22JlRnuBl4DHWPAVgKfAjIzkDntYB6hIHFKPXO0gbLUQp0oO49Xv1eCXySCtYtDzt56kU159moQulDqfEccAD4FDgEJFLBrgtog4I6r36oG0IC1d0DqNZEOhjAfzgw6LulUF3CAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE4LTExLTA0VDAwOjU3OjQ3LTA0OjAwLtN9UwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOC0xMS0wNFQwMDo1Nzo0Ny0wNDowMF+Oxe8AAAAASUVORK5CYII=" />
</a>"""
text += f"""</p></div>\n\n"""

for cell in nb["cells"]:
# Check frontmatter has its own cell
if (
cell.cell_type == "markdown"
and cell.source.startswith("+++")
and not cell.source.endswith("+++")
):
print(
f"Error: {notebook_filename} notebook metadata is not a separate cell (in markdown: separate by two newlines)!"
)
success = False
# Get first regular markdown cell
if cell.cell_type == "markdown" and not cell.source.startswith("+++"):
first_markdown_cell = cell
break

first_markdown_cell.source = text + first_markdown_cell.source
nbformat.write(nb, f)

# 5. Symlink images or figures subfolder
Expand Down
40 changes: 0 additions & 40 deletions scripts/ci/helper/run-vale

This file was deleted.

Loading

0 comments on commit abb8a73

Please sign in to comment.