diff --git a/.patches/exercise-grids/exercise-grids.patch b/.patches/exercise-grids/exercise-grids.patch index 5978d19863c313b8518d747f532fc97f5b6931f6..ece7717c365c8bbdaa0e32c601cd074e4418d691 100644 --- a/.patches/exercise-grids/exercise-grids.patch +++ b/.patches/exercise-grids/exercise-grids.patch @@ -1,6 +1,6 @@ diff -ruN exercises/exercise-grids/CMakeLists.txt exercises/solution/exercise-grids/CMakeLists.txt ---- exercises/exercise-grids/CMakeLists.txt 2024-07-08 09:06:59.589159960 +0200 -+++ exercises/solution/exercise-grids/CMakeLists.txt 2024-07-08 09:06:59.617159848 +0200 +--- exercises/exercise-grids/CMakeLists.txt 2024-02-08 11:19:46.419932806 +0100 ++++ exercises/solution/exercise-grids/CMakeLists.txt 2024-02-08 11:19:46.449932806 +0100 @@ -1,5 +1,5 @@ # the grid exercise simulation program -dumux_add_test(NAME exercise_grids @@ -8,164 +8,8 @@ diff -ruN exercises/exercise-grids/CMakeLists.txt exercises/solution/exercise-gr SOURCES main.cc) # add a symlink for each input file -diff -ruN exercises/exercise-grids/grids/grid_structured.dgf exercises/solution/exercise-grids/grids/grid_structured.dgf ---- exercises/exercise-grids/grids/grid_structured.dgf 2024-07-08 09:06:59.589159960 +0200 -+++ exercises/solution/exercise-grids/grids/grid_structured.dgf 1970-01-01 01:00:00.000000000 +0100 -@@ -1,6 +0,0 @@ --DGF --Interval --0 0 % first corner --60 40 % second corner --30 20 % cells in x and y direction --# -diff -ruN exercises/exercise-grids/grids/grid_structured.geo exercises/solution/exercise-grids/grids/grid_structured.geo ---- exercises/exercise-grids/grids/grid_structured.geo 2024-07-08 09:06:59.589159960 +0200 -+++ exercises/solution/exercise-grids/grids/grid_structured.geo 1970-01-01 01:00:00.000000000 +0100 -@@ -1,30 +0,0 @@ --X = 60; --Y = 40; --Res = 1; -- --Point(1) = {0,0,0,Res}; --Point(2) = {X,0,0,Res}; --Point(3) = {X,Y,0,Res}; --Point(4) = {0,Y,0,Res}; -- --Line(5) = {1,2}; --Line(6) = {2,3}; --Line(7) = {3,4}; --Line(8) = {4,1}; -- --Line Loop(9) = {5,6,7,8}; -- --Plane Surface(10) = 9; -- --numCellsX = 24; --numCellsY = 16; -- --Transfinite Line{5} = numCellsX + 1; --Transfinite Line{6} = numCellsY + 1; --Transfinite Line{7} = numCellsX + 1; --Transfinite Line{8} = numCellsY + 1; -- --Transfinite Surface "*"; --Recombine Surface "*"; --Transfinite Volume "*"; -- -diff -ruN exercises/exercise-grids/main.cc exercises/solution/exercise-grids/main.cc ---- exercises/exercise-grids/main.cc 2024-07-08 09:06:59.589159960 +0200 -+++ exercises/solution/exercise-grids/main.cc 2024-07-08 09:06:59.617159848 +0200 -@@ -18,7 +18,7 @@ - *****************************************************************************/ - /*! - * \file -- * \brief The main file for the two-phase porousmediumflow problem of exercise-Grids -+ * \brief The main file for the two-phase porousmediumflow problem of exercise Grids - */ - #include <config.h> - -diff -ruN exercises/exercise-grids/params.input exercises/solution/exercise-grids/params.input ---- exercises/exercise-grids/params.input 2024-07-08 09:06:59.589159960 +0200 -+++ exercises/solution/exercise-grids/params.input 2024-07-08 09:06:59.617159848 +0200 -@@ -3,13 +3,34 @@ - TEnd = 3.154e9 # in seconds, i.e ten years - - [Grid] --UpperRight = 60 40 --Cells = 24 16 -+# UpperRight = 60 40 -+# Cells = 24 16 -+ - # TODO: Task 1: Globally refine your grid -+# Refinement = 2 -+ - # TODO: Task 2: Develop even grid input parameters that can be split into zones -+# Positions0 = 0 60 -+# Positions1 = 0 40 -+# Cells0 = 24 -+# Cells1 = 16 -+# Grading0 = 1.0 -+# Grading1 = 1.0 -+ - # TODO: Task 3: Using the zoning and grading parameters, redevelop your grid to optimize your refinement in the areas that matter. -+Positions0 = 0 40 60 -+Positions1 = 0 25 30 35 40 -+Cells0 = 10 14 -+Cells1 = 10 6 6 1 -+Grading0 = 1.0 -1.25 -+Grading1 = 1.0 -1.2 1.2 1.0 -+ - # TODO: Task 4: Run your simulation the provided structured grid file ./grids/grid_structured.msh -+# File = ./grids/grid_structured.msh -+# File = ./grids/grid_structured.dgf -+ - # TODO: Task 5: Run your simulation the provided structured grid file ./grids/grid_unstructured.msh -+#File = ./grids/grid_unstructured.msh - - [Problem] - Name = grid_exercise -@@ -27,4 +48,4 @@ - Aquifer.BrooksCoreyPcEntry = 1e4 # Pa - Aquifer.BrooksCoreyLambda = 2.0 - Aquifer.Swr = 0.2 --Aquifer.Snr = 0.0 -\ Kein Zeilenumbruch am Dateiende. -+Aquifer.Snr = 0.0 -diff -ruN exercises/exercise-grids/properties.hh exercises/solution/exercise-grids/properties.hh ---- exercises/exercise-grids/properties.hh 2024-07-08 09:06:59.589159960 +0200 -+++ exercises/solution/exercise-grids/properties.hh 2024-07-08 09:06:59.617159848 +0200 -@@ -17,9 +17,9 @@ - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ - /*! -- * \file -+ * \file - * -- * \brief The properties file for exercise-grids -+ * \brief The two-phase porousmediumflow properties file for exercise-grids - */ - - #ifndef DUMUX_EX_GRIDS_PROPERTIES_HH -@@ -36,7 +36,6 @@ - #include "problem.hh" - - namespace Dumux::Properties { -- - // define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization. - // Create new type tags - namespace TTag { -@@ -44,17 +43,20 @@ - struct Injection2pCC { using InheritsFrom = std::tuple<Injection2p, CCTpfaModel>; }; - } // end namespace TTag - --// Set the grid type -+//Set the grid type -+// template<class TypeTag> -+// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; -+// TODO: Task 2: Replace the above Grid Property definition with a more flexible grid (Use Dune::TensorProductCoordinates) - template<class TypeTag> --struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; --// TODO: dumux-course-task 2 --//Replace the above Grid Property definition with a more flexible grid (Use Dune::TensorProductCoordinates) -- --// TODO: dumux-course-task 4 --// Replace the above Grid Property definition to read in a external structured grid via a .msh file (Use Dune::ALUGrid and Dune:cube) -+struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<double, 2> >; }; - --// TODO: dumux-course-task 5 --// Replace the above Grid Property definition to read in a external unstructured grid via a .msh file (Use Dune::ALUGrid and Dune::simplex) -+// TODO: Task 4: Replace the above Grid Property definition to read in a external structured grid via a .msh file (Use Dune::ALUGrid and Dune:cube) -+// template<class TypeTag> -+// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; -+ -+// TODO: Task 5: Replace the above Grid Property definition to read in a external unstructured grid via a .msh file (Use Dune::ALUGrid and Dune::simplex) -+// template<class TypeTag> -+// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>; }; - - // Set the problem property - template<class TypeTag> diff -ruN exercises/exercise-grids/README.md exercises/solution/exercise-grids/README.md ---- exercises/exercise-grids/README.md 2024-07-16 16:55:16.518073820 +0200 +--- exercises/exercise-grids/README.md 2024-07-17 09:15:52.940245274 +0200 +++ exercises/solution/exercise-grids/README.md 1970-01-01 01:00:00.000000000 +0100 @@ -1,159 +0,0 @@ -# Exercise Grids (DuMuX course) @@ -320,10 +164,169 @@ diff -ruN exercises/exercise-grids/README.md exercises/solution/exercise-grids/R -* > __Task 4__: Edit the grid properties to set up an ALUGrid made of cubes. Call one of the structured meshes via the input file. - - --## Task 5: Reading in a Unstructured Grid (*.dgf or *.msh grid files) +-## Task 5: Reading in an Unstructured Grid (*.dgf or *.msh grid files) - -An example of an unstructured grid is located in the `grid/` folder (`grid_unstructured.msh`) - -This grid is made up of triangles (simplices of dimension 2). This element type can be set in the grid properties section. - -* > __Task 5__: Change the grid property element type to include `Dune::simplex` instead of `Dune::cube`. Read in the unstructured grid via the input file and run the simulation. +diff -ruN exercises/exercise-grids/grids/grid_structured.dgf exercises/solution/exercise-grids/grids/grid_structured.dgf +--- exercises/exercise-grids/grids/grid_structured.dgf 2024-02-08 11:19:46.419932806 +0100 ++++ exercises/solution/exercise-grids/grids/grid_structured.dgf 1970-01-01 01:00:00.000000000 +0100 +@@ -1,6 +0,0 @@ +-DGF +-Interval +-0 0 % first corner +-60 40 % second corner +-30 20 % cells in x and y direction +-# +diff -ruN exercises/exercise-grids/grids/grid_structured.geo exercises/solution/exercise-grids/grids/grid_structured.geo +--- exercises/exercise-grids/grids/grid_structured.geo 2024-02-08 11:19:46.419932806 +0100 ++++ exercises/solution/exercise-grids/grids/grid_structured.geo 1970-01-01 01:00:00.000000000 +0100 +@@ -1,30 +0,0 @@ +-X = 60; +-Y = 40; +-Res = 1; +- +-Point(1) = {0,0,0,Res}; +-Point(2) = {X,0,0,Res}; +-Point(3) = {X,Y,0,Res}; +-Point(4) = {0,Y,0,Res}; +- +-Line(5) = {1,2}; +-Line(6) = {2,3}; +-Line(7) = {3,4}; +-Line(8) = {4,1}; +- +-Line Loop(9) = {5,6,7,8}; +- +-Plane Surface(10) = 9; +- +-numCellsX = 24; +-numCellsY = 16; +- +-Transfinite Line{5} = numCellsX + 1; +-Transfinite Line{6} = numCellsY + 1; +-Transfinite Line{7} = numCellsX + 1; +-Transfinite Line{8} = numCellsY + 1; +- +-Transfinite Surface "*"; +-Recombine Surface "*"; +-Transfinite Volume "*"; +- +diff -ruN exercises/exercise-grids/main.cc exercises/solution/exercise-grids/main.cc +--- exercises/exercise-grids/main.cc 2024-02-08 11:19:46.419932806 +0100 ++++ exercises/solution/exercise-grids/main.cc 2024-02-08 11:19:46.449932806 +0100 +@@ -18,7 +18,7 @@ + *****************************************************************************/ + /*! + * \file +- * \brief The main file for the two-phase porousmediumflow problem of exercise-Grids ++ * \brief The main file for the two-phase porousmediumflow problem of exercise Grids + */ + #include <config.h> + +diff -ruN exercises/exercise-grids/params.input exercises/solution/exercise-grids/params.input +--- exercises/exercise-grids/params.input 2024-07-17 09:15:52.940245274 +0200 ++++ exercises/solution/exercise-grids/params.input 2024-02-08 11:19:46.449932806 +0100 +@@ -3,13 +3,34 @@ + TEnd = 3.154e9 # in seconds, i.e ten years + + [Grid] +-UpperRight = 60 40 +-Cells = 24 16 ++# UpperRight = 60 40 ++# Cells = 24 16 ++ + # TODO: Task 1: Globally refine your grid +-# TODO: Task 2: Develop grid input parameters that can be split into zones ++# Refinement = 2 ++ ++# TODO: Task 2: Develop even grid input parameters that can be split into zones ++# Positions0 = 0 60 ++# Positions1 = 0 40 ++# Cells0 = 24 ++# Cells1 = 16 ++# Grading0 = 1.0 ++# Grading1 = 1.0 ++ + # TODO: Task 3: Using the zoning and grading parameters, redevelop your grid to optimize your refinement in the areas that matter. +-# TODO: Task 4: Run your simulation with the provided structured grid file ./grids/grid_structured.msh +-# TODO: Task 5: Run your simulation with the provided unstructured grid file ./grids/grid_unstructured.msh ++Positions0 = 0 40 60 ++Positions1 = 0 25 30 35 40 ++Cells0 = 10 14 ++Cells1 = 10 6 6 1 ++Grading0 = 1.0 -1.25 ++Grading1 = 1.0 -1.2 1.2 1.0 ++ ++# TODO: Task 4: Run your simulation the provided structured grid file ./grids/grid_structured.msh ++# File = ./grids/grid_structured.msh ++# File = ./grids/grid_structured.dgf ++ ++# TODO: Task 5: Run your simulation the provided structured grid file ./grids/grid_unstructured.msh ++#File = ./grids/grid_unstructured.msh + + [Problem] + Name = grid_exercise +@@ -27,4 +48,4 @@ + Aquifer.BrooksCoreyPcEntry = 1e4 # Pa + Aquifer.BrooksCoreyLambda = 2.0 + Aquifer.Swr = 0.2 +-Aquifer.Snr = 0.0 +\ No newline at end of file ++Aquifer.Snr = 0.0 +diff -ruN exercises/exercise-grids/properties.hh exercises/solution/exercise-grids/properties.hh +--- exercises/exercise-grids/properties.hh 2024-07-17 09:02:33.000253948 +0200 ++++ exercises/solution/exercise-grids/properties.hh 2024-02-08 11:19:46.449932806 +0100 +@@ -17,9 +17,9 @@ + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + *****************************************************************************/ + /*! +- * \file ++ * \file + * +- * \brief The properties file for exercise-grids ++ * \brief The two-phase porousmediumflow properties file for exercise-grids + */ + + #ifndef DUMUX_EX_GRIDS_PROPERTIES_HH +@@ -36,7 +36,6 @@ + #include "problem.hh" + + namespace Dumux::Properties { +- + // define the TypeTag for this problem with a cell-centered two-point flux approximation spatial discretization. + // Create new type tags + namespace TTag { +@@ -44,17 +43,20 @@ + struct Injection2pCC { using InheritsFrom = std::tuple<Injection2p, CCTpfaModel>; }; + } // end namespace TTag + +-// Set the grid type ++//Set the grid type ++// template<class TypeTag> ++// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; ++// TODO: Task 2: Replace the above Grid Property definition with a more flexible grid (Use Dune::TensorProductCoordinates) + template<class TypeTag> +-struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2>; }; +-// TODO: dumux-course-task 2 +-//Replace the above Grid Property definition with a more flexible grid (Use Dune::TensorProductCoordinates) +- +-// TODO: dumux-course-task 4 +-// Replace the above Grid Property definition to read in a external structured grid via a .msh file (Use Dune::ALUGrid and Dune:cube) ++struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::YaspGrid<2, Dune::TensorProductCoordinates<double, 2> >; }; + +-// TODO: dumux-course-task 5 +-// Replace the above Grid Property definition to read in a external unstructured grid via a .msh file (Use Dune::ALUGrid and Dune::simplex) ++// TODO: Task 4: Replace the above Grid Property definition to read in a external structured grid via a .msh file (Use Dune::ALUGrid and Dune:cube) ++// template<class TypeTag> ++// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::ALUGrid<2, 2, Dune::cube, Dune::nonconforming>; }; ++ ++// TODO: Task 5: Replace the above Grid Property definition to read in a external unstructured grid via a .msh file (Use Dune::ALUGrid and Dune::simplex) ++// template<class TypeTag> ++// struct Grid<TypeTag, TTag::Injection2p> { using type = Dune::ALUGrid<2, 2, Dune::simplex, Dune::nonconforming>; }; + + // Set the problem property + template<class TypeTag> diff --git a/exercises/exercise-grids/README.md b/exercises/exercise-grids/README.md index 1879326dc6cf169b756c852af71ae45f48076df9..ecedcd60270e00711421d01380b48a931af7fc6c 100644 --- a/exercises/exercise-grids/README.md +++ b/exercises/exercise-grids/README.md @@ -150,7 +150,7 @@ There are two external structured grid files located in the `grid/` folder (`gri * > __Task 4__: Edit the grid properties to set up an ALUGrid made of cubes. Call one of the structured meshes via the input file. -## Task 5: Reading in a Unstructured Grid (*.dgf or *.msh grid files) +## Task 5: Reading in an Unstructured Grid (*.dgf or *.msh grid files) An example of an unstructured grid is located in the `grid/` folder (`grid_unstructured.msh`) diff --git a/exercises/exercise-grids/params.input b/exercises/exercise-grids/params.input index 21d4999784843bc618bdb2c8ec359dea756bc0bb..dfff01e289245c754815b432cd93f4b1cf7d9230 100644 --- a/exercises/exercise-grids/params.input +++ b/exercises/exercise-grids/params.input @@ -6,10 +6,10 @@ TEnd = 3.154e9 # in seconds, i.e ten years UpperRight = 60 40 Cells = 24 16 # TODO: Task 1: Globally refine your grid -# TODO: Task 2: Develop even grid input parameters that can be split into zones +# TODO: Task 2: Develop grid input parameters that can be split into zones # TODO: Task 3: Using the zoning and grading parameters, redevelop your grid to optimize your refinement in the areas that matter. -# TODO: Task 4: Run your simulation the provided structured grid file ./grids/grid_structured.msh -# TODO: Task 5: Run your simulation the provided structured grid file ./grids/grid_unstructured.msh +# TODO: Task 4: Run your simulation with the provided structured grid file ./grids/grid_structured.msh +# TODO: Task 5: Run your simulation with the provided unstructured grid file ./grids/grid_unstructured.msh [Problem] Name = grid_exercise