Skip to content
Snippets Groups Projects
dunemodule.md 1.98 KiB
Newer Older
---
title: Making my own Dune-Module
---

# Custom Dune-Module

## My own workspace?

We all want to implement our own models and create our own test cases.

But where?

## The Dune/Dumux Suite
IvBu's avatar
IvBu committed
<img src=img/dependenciesCore.png width="100%">
IvBu's avatar
IvBu committed
## The Dune/Dumux Suite
<img src=img/dependenciesOptional.png width="100%">

## The Dune/Dumux Suite
<img src=img/dependenciesMyModule.png width="100%">
IvBu's avatar
IvBu committed
## How are these modules linked?
Modules are linked via the `dune.module` file, which states dependencies and suggests optional modules.

```ini
Module: dumux-appl
Version: 1.0
Maintainer: user@dumux.de
# Required build dependencies
Depends: dumux dune-alugrid dune-foamgrid dune-uggrid
# Optional build dependencies
#Suggests:
```
<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dune.module`</span>
## Creating a new dune module
Start the script `duneproject` to initiate creating a new module:
./dune-common/bin/duneproject
IvBu's avatar
IvBu committed
## How are these modules built?
Configuring and compiling the stack of modules is done via the script `dunecontrol`:
IvBu's avatar
IvBu committed

```bash
./dune-common/bin/dunecontrol --opts=dumux/cmake.opts all
## Adding test cases to an `appl` folder

IvBu's avatar
IvBu committed
- Adjust the
    - source (.cc) file,
    - input parameter file,
    - problem file,
    - properties file,
    - (spatialparams file).
- Adjust the `CMakeLists.txt` file.
- Reconfigure your module.
IvBu's avatar
IvBu committed
## Pushing an existing folder to an empty git repository

```bash
cd my-module-folder
git config --global user.name "FIRST_NAME LAST_NAME"
git config --global user.email "YOUR_EMAIL_ADDRESS"
IvBu's avatar
IvBu committed
git init --initial-branch=main
git remote add origin https://git.iws.uni-stuttgart.de/Namespace/my-module.git
git add .
git commit -m "Initial commit"
git push -u origin main
```
IvBu's avatar
IvBu committed
## [Exercises](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-course/tree/master/exercises/exercise-dunemodule):

- Create a new module with the duneproject script
- Run dune control
- Create an appl folder
- Upload to a git repository