Sign inSign up

ggciag/mandyoc

By ggciag

•Updated 2 months ago

MANDYOC is a finite element code to simulate thermochemical convection of the Earth's mantle

Image
0

1.0K

ggciag/mandyoc repository overview

⁠MANDYOC

License

⁠Quick reference

⁠Supported tags

  • latest

⁠About

MANDYOC is short for MANtle DYnamics simulatOr Code. It is a numerical code written on top of the PETSc⁠ library and it simulates thermochemical convection of the Earth’s mantle.

⁠How to use this image

First, pull the latest image

docker pull ggciag/mandyoc

Then, create a directory with the simulation input files. For this example, let's assume the directory name is mytest.

It's necessary to create a script to run the simulation inside mytest directory. Let's assume this script file name is run.sh.

In this image, both mandyoc executable and mpiexec are configured in PATH. Hence, in this script, we can reference mpiexec and mandyoc directly, like:

#!/bin/sh

mpiexec -n NP mandyoc

where NP is the number of processors to use.

To run the simulation and retain the simulation data, we map mytest directory to a directory inside the container. Let's assume the directory inside the container is called simulation.

Then, we can start the simulation inside the container calling the script run.sh:

docker run --rm -it --user $(id -u):$(id -g) --volume $(pwd)/mytest:/simulation --workdir /simulation ggciag/mandyoc:latest bash run.sh
⁠Practical example

This example illustrates how to run an example provided in the MANDYOC repository.

First, clone the MANDYOC repository or download the last released version⁠.

git clone https://github.com/ggciag/mandyoc.git

For this example, let's take the Crameri2012_case2 example.

Copy this example directory to a new location.

cp -r mandyoc/examples/Crameri2012_case2 .

Then, you will need to run the create_input_and_plot.ipynb jupyter notebook to create the input files required to set up this simulation.

After executing the steps in this notebook, you will have two input files: param.txt and interfaces.txt.

Create a run.sh script in this directory:

#!/bin/sh

mpiexec -n NP mandyoc

Remember to change NP to the desired number of processors, for example, 2.

Finally, run the simulation in a Docker container:

docker run --rm -it --user $(id -u):$(id -g) --volume $(pwd)/Crameri2012_case2:/simulation --workdir /simulation ggciag/mandyoc:latest bash run.sh

Since we mapped the local Crameri2012_case2 directory to a volume inside the container, all output files will be written in that directory and will be persisted in local disk. In the above command, the option --user $(id -u):$(id -g) deals with file permissions.

Now, you can go back to the create_input_and_plot.ipynb jupyter notebook and continue the steps to plot the results.

⁠License

View license information⁠ for the software contained in this image.

As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc, from the base distribution, along with any direct or indirect dependencies of the primary software being contained).

As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Tag summary

Content type

Image

Digest

sha256:003134302…

Size

1007.8 MB

Last updated

2 months ago

docker pull ggciag/mandyoc