From 0bc3b8fa9154eeb0e6fd93dccd37ea4a4034bafe Mon Sep 17 00:00:00 2001 From: Hamza Oukili <hamza.oukili@iws.uni-stuttgart.de> Date: Tue, 16 Jul 2024 06:59:30 +0000 Subject: [PATCH] [exercise][dunemodule] update Readme and Exercise patch --- .../exercise-dunemodule.patch | 31 ++++++++++++------- exercises/exercise-dunemodule/README.md | 26 ++++++++++------ 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/.patches/exercise-dunemodule/exercise-dunemodule.patch b/.patches/exercise-dunemodule/exercise-dunemodule.patch index 900223cc..f2ded273 100644 --- a/.patches/exercise-dunemodule/exercise-dunemodule.patch +++ b/.patches/exercise-dunemodule/exercise-dunemodule.patch @@ -1,7 +1,7 @@ diff -ruN exercises/exercise-dunemodule/README.md exercises/solution/exercise-dunemodule/README.md ---- exercises/exercise-dunemodule/README.md 2024-05-21 14:15:07.145554774 +0200 +--- exercises/exercise-dunemodule/README.md 2024-07-15 15:50:06.499877396 +0200 +++ exercises/solution/exercise-dunemodule/README.md 1970-01-01 01:00:00.000000000 +0100 -@@ -1,108 +0,0 @@ +@@ -1,114 +0,0 @@ -# Exercise New Dune Module (DuMuX course) - -This exercise describes how to create a new DuMuX module @@ -11,7 +11,6 @@ diff -ruN exercises/exercise-dunemodule/README.md exercises/solution/exercise-du -workflow to develop code on top of DuMuX. - -### Task 1: Create new dune module --<hr> - -* Execute the following command (bash environment) in the top-folder, i.e. above the dumux folder - @@ -25,21 +24,18 @@ diff -ruN exercises/exercise-dunemodule/README.md exercises/solution/exercise-du - * a version at your choice (the version of your project, not of dumux.) - * your email address - --<br><br><br> +- -### Task 2: Rerun dunecontrol to configure your new project --<hr> - -The following command will configure your new module - -```bash --./dune-common/bin/dunecontrol --opts=<opts file> --only=dumux-example all +-./dune-common/bin/dunecontrol --opts=dumux/cmake.opts --only=<module-name> all -``` - --You need to run this command in the folder with content dumux, dumux-course, dune-common, dune-geometry, dune-grid, dune-istl, etc. `<opts file>` needs to be replaced (please replace the angle brackets also) by an options file, e.g., by `./dumux/cmake.opts`. Have a look at the comments in this file to see how you can adapt it to your needs. +-You need to run this command in the folder with content dumux, dumux-course, dune-common, dune-geometry, dune-grid, dune-istl, etc. `<module-name>` needs to be replaced (please replace the angle brackets also) by the name of the module, e.g., by `dumux-example`. - --<br><br><br> -### Task 3: Create a new test case within your new DuMuX module --<hr> - -* Create a new folder (in your module folder), e.g., `appl` - @@ -81,9 +77,9 @@ diff -ruN exercises/exercise-dunemodule/README.md exercises/solution/exercise-du -./test_1p_compressible_stationary_tpfa params.input -``` - --<br><br><br> +- -### Task 4: Create a new GitLab project --<hr> +- - -* Login with your username and password at https://git.iws.uni-stuttgart.de/ - @@ -96,17 +92,28 @@ diff -ruN exercises/exercise-dunemodule/README.md exercises/solution/exercise-du - -* Then choose to **Create blank project**. - --* Specify your project name, untick the box *Initialize repository with a README* and click the **Create project** button. +-* Specify your project name, e.g., <module-name>, untick the box *Initialize repository with a README* and click the **Create project** button. - -* Follow the given instructions for an *existing folder*. - -Hint: if you have not done so already, be sure to inform your computer of your git account with the following commands: -```bash +-cd <module-name> -git config --global user.name "FIRST_NAME LAST_NAME" -git config --global user.email "YOUR_EMAIL_ADDRESS" +-git init --initial-branch=main +-git remote add origin https://git.iws.uni-stuttgart.de/<Namespace>/<module-name>.git -``` - -**Important**: Before executing the `git add .` command, you should add your cmake build folder to `.gitignore`. -The easiest way to do so is to copy the `.gitignore` file from the dumux module into your module path. If everything -worked, executing `git status` should not show `build-cmake` anymore. Never put your executables or other build files -under version control. Only source files (`*.hh`, `*.cc`, `*.input`, `CMakeLists.txt`) should be under version control. +- +-Then you can commit and push your new module to your repository: +-```bash +-git add . +-git commit -m "Initial commit" +-git push -u origin main +-``` +\ No newline at end of file diff --git a/exercises/exercise-dunemodule/README.md b/exercises/exercise-dunemodule/README.md index a4099d79..3db9496c 100644 --- a/exercises/exercise-dunemodule/README.md +++ b/exercises/exercise-dunemodule/README.md @@ -7,7 +7,6 @@ This is the suggested workflow to develop code on top of DuMuX. ### Task 1: Create new dune module -<hr> * Execute the following command (bash environment) in the top-folder, i.e. above the dumux folder @@ -21,21 +20,18 @@ workflow to develop code on top of DuMuX. * a version at your choice (the version of your project, not of dumux.) * your email address -<br><br><br> + ### Task 2: Rerun dunecontrol to configure your new project -<hr> The following command will configure your new module ```bash -./dune-common/bin/dunecontrol --opts=<opts file> --only=dumux-example all +./dune-common/bin/dunecontrol --opts=dumux/cmake.opts --only=<module-name> all ``` -You need to run this command in the folder with content dumux, dumux-course, dune-common, dune-geometry, dune-grid, dune-istl, etc. `<opts file>` needs to be replaced (please replace the angle brackets also) by an options file, e.g., by `./dumux/cmake.opts`. Have a look at the comments in this file to see how you can adapt it to your needs. +You need to run this command in the folder with content dumux, dumux-course, dune-common, dune-geometry, dune-grid, dune-istl, etc. `<module-name>` needs to be replaced (please replace the angle brackets also) by the name of the module, e.g., by `dumux-example`. -<br><br><br> ### Task 3: Create a new test case within your new DuMuX module -<hr> * Create a new folder (in your module folder), e.g., `appl` @@ -77,9 +73,9 @@ cd appl ./test_1p_compressible_stationary_tpfa params.input ``` -<br><br><br> + ### Task 4: Create a new GitLab project -<hr> + * Login with your username and password at https://git.iws.uni-stuttgart.de/ @@ -92,17 +88,27 @@ your own project. * Then choose to **Create blank project**. -* Specify your project name, untick the box *Initialize repository with a README* and click the **Create project** button. +* Specify your project name, e.g., <module-name>, untick the box *Initialize repository with a README* and click the **Create project** button. * Follow the given instructions for an *existing folder*. Hint: if you have not done so already, be sure to inform your computer of your git account with the following commands: ```bash +cd <module-name> git config --global user.name "FIRST_NAME LAST_NAME" git config --global user.email "YOUR_EMAIL_ADDRESS" +git init --initial-branch=main +git remote add origin https://git.iws.uni-stuttgart.de/<Namespace>/<module-name>.git ``` **Important**: Before executing the `git add .` command, you should add your cmake build folder to `.gitignore`. The easiest way to do so is to copy the `.gitignore` file from the dumux module into your module path. If everything worked, executing `git status` should not show `build-cmake` anymore. Never put your executables or other build files under version control. Only source files (`*.hh`, `*.cc`, `*.input`, `CMakeLists.txt`) should be under version control. + +Then you can commit and push your new module to your repository: +```bash +git add . +git commit -m "Initial commit" +git push -u origin main +``` \ No newline at end of file -- GitLab