Skip to content

Commit

Permalink
UWGeodynamics Merging
Browse files Browse the repository at this point in the history
  • Loading branch information
rbeucher committed May 24, 2022
1 parent 29f322a commit 6ec398d
Show file tree
Hide file tree
Showing 69 changed files with 135 additions and 138 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ jobs:
- name: Build dependencies
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends build-essential pkg-config python3-dev swig libxml2-dev
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends build-essential pkg-config python3-dev swig libxml2-dev cmake ninja-build
- name: Runtime dependencies
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends libxml2 libpython3.9
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends libxml2 libpython3.10
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -229,7 +229,8 @@ jobs:
- name: Run Tests
run: |
pip install pytest
python -m pytest -vvv docs/pytests
pytest -vvv docs/pytests
pytest -vvv docs/test/UWGeodynamics
conda_build:
name: Conda Build (Python ${{matrix.python-version}} ${{ matrix.os }})
Expand Down Expand Up @@ -266,3 +267,24 @@ jobs:
anaconda login --hostname github-actions-${{ matrix.os }}-$RANDOM --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }}
conda-build --channel conda-forge --user geo-down-under conda
anaconda logout
pypi:
name: Pypi Source Distribution
runs-on: ubuntu-latest
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Package for Pypi
run: |
python setup.py sdist
- name: Push to Pypi
if: github.event_name == 'release'
run: |
pip install twine
python -m twine upload dist/* -r
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ The Underworld development is led by Louis Moresi and is a collaboration between
Underworld Geodynamics High-level API
--------------------------------------

[![image](docs/UWGeodynamics/readthedocs/src/img/logos.png)](https://www.earthbyte.org/the-basin-genesis-hub)
[![image](docs/development/docs_generator/images/UWGeo/logos.png)](https://www.earthbyte.org/the-basin-genesis-hub)

![image](docs/UWGeodynamics/tutorials/images/Tutorial1.gif)
![image](docs/UWGeodynamics/readthedocs/src/img/collision_wedge.gif)
![image](docs/development/docs_generator/images/UWGeo/collision_wedge.gif)

The UWGeodynamics module (`from underworld import UWGoedynamics`) facilitates prototyping of geodynamics models using Underworld. It can be seen as a set of high-level functions within the Underworld ecosystem. It is a means to quickly get the user into Underworld modelling and assumes very little knowledge in coding. The module make some assumptions based on how the user defines the boundary conditions and the properties of the materials (rocks, phases). Its simplicity comes with a relatively more rigid workflow (compared to the classic Underworld functions). However, the user can easily break the high level objects and get back to core Underworld function at any step of model design.

Expand Down
8 changes: 5 additions & 3 deletions docs/UWGeodynamics/benchmarks/1_22_Indentor_Benchmark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@
"metadata": {},
"outputs": [],
"source": [
"from underworld.mesh import FeMesh_IndexSet\n",
"\n",
"cond1 = (Model.mesh.data[Model.top_wall.data][:, 0] < 0.0625)\n",
"cond2 = (Model.mesh.data[Model.top_wall.data][:, 0] > -0.0625)\n",
"\n",
"indices = Model.top_wall.data[cond1 * cond2]\n",
"\n",
"IndexSet = GEO.uw.mesh.FeMesh_IndexSet(Model.mesh, topologicalIndex=0, size=Model.mesh.nodesGlobal, fromObject=indices)"
"IndexSet = FeMesh_IndexSet(Model.mesh, topologicalIndex=0, size=Model.mesh.nodesGlobal, fromObject=indices)"
]
},
{
Expand Down Expand Up @@ -207,7 +209,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -221,7 +223,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down
3 changes: 0 additions & 3 deletions docs/development/docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ RUN apt-get update -qq \
python3-virtualenv \
python3-pip \
python3-numpy \
python3-numpy-dbg \
vim \
less \
git \
cmake \
gcc python3-dev \
valgrind valgrind-dbg valgrind-mpi \
gdb cgdb \
&& apt-get clean \
Expand Down
2 changes: 1 addition & 1 deletion docs/development/docker/petsc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ RUN ldconfig
# create venv now for forthcoming python packages
USER $NB_USER
RUN /usr/bin/python3 -m virtualenv --system-site-packages --python=/usr/bin/python3 ${VIRTUAL_ENV}
RUN pip3 install --no-cache-dir mpi4py
RUN pip3 install --no-cache-dir Cython git+https://github.com/mpi4py/mpi4py@3.1.0

USER root
# build petsc
Expand Down
2 changes: 2 additions & 0 deletions docs/development/docker/underworld2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
libxml2 \
libpython${PYVER}


FROM base_runtime AS build_base
# install build requirements
Expand All @@ -20,6 +21,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
pkg-config \
python3-dev \
cmake \
ninja-build \
make \
swig \
libxml2-dev \
Expand Down
10 changes: 5 additions & 5 deletions docs/development/docs_generator/UWGeoTutorials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We provide a series of docs/tutorials as Jupyter notebook:

1. `Tutorial 1 Simple Rift`_

.. image:: img/Tutorial1.gif
.. image:: images/UWGeo/Tutorial1.gif
:target: http://nbviewer.jupyter.org/github/underworldcode/underworld2/blob/master/docs/UWGeodynamics/tutorials/Tutorial_1_ThermoMechanical_Model.ipynb

[Output Data](https://www.dropbox.com/s/3gy3boh9mf9s807/Tutorial1_BGH.zip?dl=0)
Expand All @@ -17,14 +17,14 @@ We provide a series of docs/tutorials as Jupyter notebook:

3. `Tutorial 3 Sandbox Extension`_

.. image:: img/underworld.png
.. image:: images/UWGeo/underworld.png
:target: http://nbviewer.jupyter.org/github/underworldcode/underworld2/blob/master/docs/UWGeodynamics/tutorials/Tutorial_3_SandboxExtension_static_mesh.ipynb

[Output Data](https://www.dropbox.com/s/9j24v5ex1eanro2/Tutorial3_BGH.zip?dl=0)

4. `Tutorial 4 Sandbox Compression`_

.. image:: img/Tutorial4.png
.. image:: images/UWGeo/Tutorial4.png
:target: http://nbviewer.jupyter.org/github/underworldcode/underworld2/blob/master/docs/UWGeodynamics/tutorials/Tutorial_4_NumericalSandboxCompression.ipynb

[Output Data](https://www.dropbox.com/s/4wlp3cociwysz3l/Tutorial4_BGH.zip?dl=0)
Expand All @@ -43,7 +43,7 @@ We provide a series of docs/tutorials as Jupyter notebook:

9. `Tutorial 9 Passive Margins`_

.. image:: img/Tutorial_9.gif
.. image:: images/UWGeo/Tutorial_9.gif
:target: http://nbviewer.jupyter.org/github/underworldcode/underworld2/blob/master/docs/UWGeodynamics/tutorials/Tutorial_9_passive_margins.ipynb

[Output Data](https://www.dropbox.com/s/g1ocpse0mld4tiy/Tutorial9_BGH.zip?dl=0)
Expand All @@ -56,7 +56,7 @@ We provide a series of docs/tutorials as Jupyter notebook:

[Output Data](https://www.dropbox.com/s/qpzrxp9fcf35w38/Tutorial11_BGH.zip?dl=0)

.. image:: img/Tutorial11.gif
.. image:: images/UWGeo/Tutorial11.gif
:target: http://nbviewer.jupyter.org/github/underworldcode/underworld2/blob/master/docs/UWGeodynamics/tutorials/Tutorial_11_Coupling_with_Badlands.ipynb

.. _Tutorial 1 Simple Rift: http://nbviewer.jupyter.org/github/underworldcode/underworld2/blob/master/docs/UWGeodynamics/tutorials/Tutorial_1_ThermoMechanical_Model.ipynb
Expand Down
34 changes: 17 additions & 17 deletions docs/development/docs_generator/UWGeoUserGuide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ appending the method, variable or function with ``?``.
Design principles
-----------------

.. image:: /img/Design.svg
.. image:: /images/UWGeo/Design.svg


import *UWGeodynamics*
Expand Down Expand Up @@ -146,7 +146,7 @@ or simply
You can have a quick overview of all the units available by hitting tab
after the ``.`` of the u object.

.. image:: img/tabtab.gif
.. image:: images/UWGeo/tabtab.gif

Quantities can then be defined as follow:

Expand Down Expand Up @@ -314,7 +314,7 @@ MaterialRegistry object:
materials_database = GEO.MaterialRegistry()
.. image:: /img/MaterialRegistry.gif
.. image:: /images/UWGeo/MaterialRegistry.gif

.. note::

Expand All @@ -340,7 +340,7 @@ Materials are defined using the **Material** object as follow:
Typing the name of the material in an empty cell will return a table
which summarizes the property of the material:

.. image:: img/Material1.png
.. image:: images/UWGeo/Material1.png

As you can see, most of the property are undefined.

Expand Down Expand Up @@ -492,7 +492,7 @@ There are a range of available/pre-defined shapes
...
>>> Fig.show()
.. image:: /img/layers.png
.. image:: /images/UWGeo/layers.png

**Polygon**

Expand All @@ -512,7 +512,7 @@ There are a range of available/pre-defined shapes
>>> Fig.Points(Model.swarm, Model.materialField)
>>> Fig.show()
.. image:: /img/polygon.png
.. image:: /images/UWGeo/polygon.png

**Box**

Expand All @@ -531,7 +531,7 @@ There are a range of available/pre-defined shapes
>>> Fig.Points(Model.swarm, Model.materialField)
>>> Fig.show()
.. image:: /img/box.png
.. image:: /images/UWGeo/box.png

**Disk**

Expand All @@ -550,7 +550,7 @@ There are a range of available/pre-defined shapes
>>> Fig.Points(Model.swarm, Model.materialField)
>>> Fig.show()
.. image:: /img/disk.png
.. image:: /images/UWGeo/disk.png


**Sphere (3D)**
Expand Down Expand Up @@ -585,7 +585,7 @@ There are a range of available/pre-defined shapes
>>> Fig.Points(Model.swarm, Model.materialField)
>>> Fig.show()
.. image:: /img/annulus.png
.. image:: /images/UWGeo/annulus.png


**CombinedShape**
Expand All @@ -611,7 +611,7 @@ Several shapes can be combined to form a material shape:
>>> Fig.Points(Model.swarm, Model.materialField)
>>> Fig.show()
.. image:: /img/multishape.png
.. image:: /images/UWGeo/multishape.png

You can also take the intersection of some shapes:

Expand All @@ -634,7 +634,7 @@ You can also take the intersection of some shapes:
>>> Fig.Points(Model.swarm, Model.materialField)
>>> Fig.show()
.. image:: /img/multishape-1.png
.. image:: /images/UWGeo/multishape-1.png

**HalfSpace**

Expand All @@ -646,7 +646,7 @@ defined by the normal vector.

HalfSpaces can be combined to define 3D shapes / volumes.

.. image:: /img/3D_halfspaces.png
.. image:: /images/UWGeo/3D_halfspaces.png

.. code:: python
Expand Down Expand Up @@ -678,7 +678,7 @@ defined by the normal vector.
>>> viewer.window()
.. image:: /img/3D_halfspaces2.png
.. image:: /images/UWGeo/3D_halfspaces2.png

**Multiple materials**

Expand Down Expand Up @@ -770,7 +770,7 @@ activation energy, `P` the pressure, `V` the activation volume, `n` the stress e
*UWGeodynamics* provides a library of commonly used Viscous Creep Flow Laws.
These can be accessed using the `GEO.ViscousCreepRegistry`:

.. image:: /img/ViscousCreepRegistry.gif
.. image:: /images/UWGeo/ViscousCreepRegistry.gif


.. note::
Expand Down Expand Up @@ -909,7 +909,7 @@ As with Viscous Creep, we also provide a registry of commmonly used
plastic behaviors.
They can be accessed using the `GEO.PlasticityRegistry` registry.

.. image:: /img/PlasticityRegistry.gif
.. image:: /images/UWGeo/PlasticityRegistry.gif

.. note::

Expand Down Expand Up @@ -1128,7 +1128,7 @@ vertically along the side walls.
... top=[None,0.])
...
.. image:: /img/mechanicalBCs1.png
.. image:: /images/UWGeo/mechanicalBCs1.png

3D
^^
Expand Down Expand Up @@ -1182,7 +1182,7 @@ the part of the left wall below 32 kilometre. Velocity is set to be
... top=[None,0.])
...
.. image:: /img/mechanicalBCs2.png
.. image:: /images/UWGeo/mechanicalBCs2.png


Stress Conditions
Expand Down
6 changes: 3 additions & 3 deletions docs/development/docs_generator/UWGeodynamics.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Welcome to UWGeodynamics's documentation!
=========================================

.. image:: ./img/Tutorial1.gif
.. image:: ./images/UWGeo/Tutorial1.gif

.. image:: ./img/collision_wedge.gif
.. image:: ./images/UWGeo/collision_wedge.gif

.. toctree::
:hidden:
Expand Down Expand Up @@ -78,5 +78,5 @@ software can actually be useful to you.
The ressource are however limited and you should not try to run model with high resolution.
3D models can not be run in the binder.

.. image:: ./img/SandboxCompression.gif
.. image:: ./images/UWGeo/SandboxCompression.gif

0 comments on commit 6ec398d

Please sign in to comment.