diff --git a/slides/biomin.md b/slides/biomin.md index 07cd6de06a4229e293bb87bac07d16c58c3e7e5c..9d6613c07f2c01922de9de3abc3788a5686c5fa3 100644 --- a/slides/biomin.md +++ b/slides/biomin.md @@ -307,15 +307,17 @@ PermeabilityType evaluatePermeability(PermeabilityType refPerm, ## Exercise tasks +<div style="text-align: left; margin-left: 200px"> <small> -1. Get familiar with the code -2. Implement the simplified chemical reactions -3. Use source()-function to link chemistry-file to problem -4. Vary parameters, so that leakage pathway is "sealed" (porosity $<0.07$) -5. Implement new boundary condition for $\mathrm{CO_2}$-injection in lower aquifer -6. Exchange the permeability law from Kozeny-Carman to a Power Law +1. Get familiar with the code +2. Implement the simplified chemical reactions +3. Use source()-function to link chemistry-file to problem +4. Vary parameters, so that leakage pathway is "sealed" (porosity $<$ 0.07) +5. Implement new boundary condition for $\mathrm{CO_2}$-injection in lower aquifer +6. Exchange the permeability law from Kozeny-Carman to a Power Law 7. Use tabulated values for $\mathrm{CO_2}$ </small> +</div> ## Exercise diff --git a/slides/dunemodule.md b/slides/dunemodule.md index dfb87153f654a30cfc13436c0900799e479caf9e..bd476e39e225a57f07e061fa00a684616433fb81 100644 --- a/slides/dunemodule.md +++ b/slides/dunemodule.md @@ -31,6 +31,7 @@ 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: diff --git a/slides/grid.md b/slides/grid.md index 4477b84597554ec2a9153d35366907ec43644282..d797d01da812ed64dcae810888aedfa32f87c3d3 100644 --- a/slides/grid.md +++ b/slides/grid.md @@ -36,6 +36,7 @@ Implementations of the Dune grid interface using type = Dune::YaspGrid<2>; }; ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-grids/properties.hh`</span> * Include the matching grid manager header files in main file and create the grid via a grid manager instance ```cpp @@ -45,6 +46,7 @@ Implementations of the Dune grid interface GridManager<Grid> gridManager; gridManager.init(); ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/main.cc`</span> ## Create grid @@ -59,6 +61,7 @@ The grid manager looks for grid information in the runtime parameter tree UpperRight = 1 1 Cells = 10 5 ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/params.input`</span> <img src=img/params_grid.png width="200"> @@ -69,6 +72,7 @@ The grid manager looks for grid information in the runtime parameter tree [Grid] File = ./grids/heterogeneousSmall.dgf ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/io/gridmanager/test_gridmanager_dgf.input`</span> * Supported grid file formats * DGF (Dune Grid Format) @@ -82,11 +86,13 @@ constructing a `Dune::YaspGrid`: ```cpp constexpr int dim = 2; +using Yasp = Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates< + double, dim>>; std::array<int, dim> cells; cells.fill(30); -Dune::FieldVector<double, dim> lowerLeft(1.0), upperRight(2.0); -using Yasp = Dune::YaspGrid<dim, Dune::EquidistantOffsetCoordinates<double, dim>>; +Dune::FieldVector<double, dim> lowerLeft(1.1), upperRight(2.2); Yasp yasp(lowerLeft, upperRight, cells); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/geometry/test_intersectingentity_cartesiangrid.cc`</span> # Exercise ## Exercise diff --git a/slides/materialsystem.md b/slides/materialsystem.md index c7dea42b469f019768c884af35d2e95c7e3da799..29c0505d767ccc5828358560626c439e422c8a62 100644 --- a/slides/materialsystem.md +++ b/slides/materialsystem.md @@ -57,24 +57,20 @@ static Scalar gasDensity(Scalar temperature, Scalar pressure) return IdealGas::density(molarMass(), temperature, pressure); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/components/air.hh`</span> ## Example interfaces ```cpp -static Scalar gasHeatCapacity(Scalar temperature, Scalar pressure) +static Scalar gasHeatCapacity(Scalar T, Scalar pressure) { - constexpr Scalar cpVapA = 19.25; - constexpr Scalar cpVapB = 0.05213; - constexpr Scalar cpVapC = 1.197e-5; - constexpr Scalar cpVapD = -1.132e-8; - - return 1/molarMass()*( - cpVapA + temperature*( - cpVapB/2 + temperature*(cpVapC/3 + temperature*(cpVapD/4)) - ) - ); + // apply Shomate method + const auto cp = shomateMethod.heatCapacity(T); // J/(mol K) + return cp / molarMass(); // J/(kg K) } + ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/components/ch4.hh`</span> # Fluid systems @@ -109,6 +105,7 @@ static Scalar heatCapacity(const FluidState& fluidState, int phaseIdx) ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/fluidsystems/brine.hh`</span> # Binary coefficients @@ -139,7 +136,7 @@ static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure) return Daw*(pg0/pressure)*pow((temperature/T0), theta); } ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/binarycoefficients/h2o_air.hh`</span> # Solid systems @@ -267,7 +264,7 @@ _CompositionFromFugacities_ : takes all component fugacities, the temperature an ```cpp template<class TypeTag> -struct FluidSystem<TypeTag, TTag::H2OAir> +struct FluidSystem<TypeTag, TTag::DrainageProblem> { private: using Scalar = GetPropType<TypeTag, Properties::Scalar>; @@ -281,6 +278,7 @@ public: >; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porenetwork/2pnc/properties.hh`</span> # Example: From components to solid system @@ -305,7 +303,7 @@ struct SolidSystem<TypeTag, TTag::ThermoChem> >; }; ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/1pncmin/nonisothermal/properties.hh`</span> # Exercise diff --git a/slides/model.md b/slides/model.md index e7f8dfac7d81feee39748fe6721bce281219f8ab..6d30e3baf026972bca33a09c9887994e50b64d8d 100644 --- a/slides/model.md +++ b/slides/model.md @@ -99,6 +99,8 @@ class DiffusionModelLocalResidual ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> + Inherits from the `BaseLocalResidual`, which is chosen depending on the discretization scheme, here *Box scheme*. ## Storage term @@ -113,6 +115,7 @@ NumEqVector computeStorage(const Problem& problem, return storage; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Flux term @@ -142,6 +145,7 @@ NumEqVector computeFlux(const Problem& problem, } ``` </font> +<span style="font-size: 0.4em; position: relative; top: -60px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Flux term ```cpp @@ -161,6 +165,7 @@ NumEqVector computeFlux(...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Flux term ```cpp @@ -179,6 +184,7 @@ NumEqVector computeFlux(...) const return flux; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## `LocalResidual` @@ -197,6 +203,8 @@ namespace Dumux::Properties { //define all properties } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> + ## Model type tag The property type tag is an empty struct with the respective name, e.g. `DiffusionModel`. @@ -208,6 +216,7 @@ namespace Dumux::Properties::TTag { struct DiffusionModel {}; } // end namespace Dumux::Properties::TTag ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Defining model properties @@ -218,6 +227,7 @@ template<class TypeTag> struct LocalResidual<TypeTag, TTag::DiffusionModel> { using type = DiffusionModelLocalResidual<TypeTag>; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> ## Defining model properties @@ -238,6 +248,8 @@ struct ModelTraits<TypeTag, TTag::DiffusionModel> }; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/diffusion/model.hh`</span> + ## Defining model properties Further model specific properties can be set accordingly by using the model property tag, i.e. `TTag::DiffusionModel` diff --git a/slides/multidomain.md b/slides/multidomain.md index 1c58e3047616775405e628e1b094169a2dea75f8..70a9c621d6597295f8bb0e707d2c994a63b38df5 100644 --- a/slides/multidomain.md +++ b/slides/multidomain.md @@ -64,6 +64,8 @@ void pointSource(PointSource& source...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh`</span> + ## Coupling Residual / Data Transfer (2/3) ```c++ @@ -80,6 +82,7 @@ void pointSource(PointSource& source...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh`</span> ## Coupling Residual / Data Transfer (3/3) @@ -95,6 +98,8 @@ void pointSource(PointSource& source...) const ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/multidomain/embedded/2d3d/1p_1p/problem_matrix.hh`</span> + ## Coupling Residual (1/2) @@ -112,6 +117,7 @@ decltype(auto) evalCouplingResidual(Dune::index_constant<i> domainI, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> ## Coupling Residual (2/2) @@ -131,6 +137,8 @@ decltype(auto) evalCouplingResidual(...) return residual; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> + ## Coupling Stencil  @@ -151,6 +159,7 @@ const CouplingStencil<j>& couplingStencil(domainI, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> ## Coupling Stencil (2/2) @@ -167,6 +176,7 @@ const CouplingStencil<j>& couplingStencil(domainI, return emptyStencil(domainI); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/embedded/couplingmanagerbase.hh`</span> # Examples ## Embedded Fracture Model diff --git a/slides/params.md b/slides/params.md index 6b63f6ebc19de0386f037aad6ac0d8a7f3395725..a021a97b0206fadbae6deaeb9f44ee71b0dd8cae 100644 --- a/slides/params.md +++ b/slides/params.md @@ -28,6 +28,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## Initialize Parameter Tree @@ -40,6 +41,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/common/parameters/test_loggingparametertree.cc`</span> ## Initialize Parameter Tree @@ -57,6 +59,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/linear/test_parallel_amg_smoothers.cc`</span> ## Initialize Parameter Tree @@ -69,6 +72,7 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/parameters.cc`</span> ## Reading Runtime Parameters @@ -115,10 +119,12 @@ via the single parameter tree if (hasParam("GROUPNAME.PARAMNAME")) // do something with parameter ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/biomineralization/main.cc`</span> * With group prefix lookup ```cpp if (hasParamInGroup("GROUPNAME","PARAMNAME")) ``` + <span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/freeflow/rans/problem.hh`</span> ## Parameter tree logs usage @@ -132,6 +138,8 @@ int main(int argc, char** argv) return 0; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> + Reports unused parameters. Great for detecting typos in configuration file. @@ -153,6 +161,7 @@ Name = test [FreeFlow.Problem] Name = test_ff ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/params.input`</span> ## Command-line arguments diff --git a/slides/problem.md b/slides/problem.md index 18da55ee832050774c1f7a5ae4af2fafad301316..f6320c505ae5570066592040c9baffd82ac5db5f 100644 --- a/slides/problem.md +++ b/slides/problem.md @@ -102,6 +102,8 @@ struct Injection2pCC { using InheritsFrom = std::tuple<TwoP, CCTpfaModel>; }; } // end namespace Dumux::Properties::TTag ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> + ## @@ -116,6 +118,7 @@ struct Grid<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> ## @@ -130,6 +133,7 @@ struct Problem<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> The problem class `InjectionProblem2P` is discussed in one of the following sections. @@ -153,6 +157,7 @@ struct SpatialParams<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> ## @@ -172,6 +177,7 @@ struct FluidSystem<TypeTag, TTag::Injection2pCC> } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/properties2p.hh`</span> # Problem definition @@ -191,6 +197,7 @@ class InjectionProblem2P : public PorousMediumFlowProblem<TypeTag> // - scenario name (for output) } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> Inherit from base class `PorousMediumFlowProblem`, only override scenario-specific functions (static polymorphism). @@ -212,7 +219,7 @@ BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const return bcTypes; } ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> ## @@ -222,6 +229,7 @@ Dirichlet boundary condition values (only called on Dirichlet boundaries) PrimaryVariables dirichletAtPos(const GlobalPosition& globalPos) const { return initialAtPos(globalPos); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> `PrimaryVariables` is an array of primary variables (here, the size of the array is 2). @@ -235,6 +243,7 @@ PrimaryVariables dirichlet(const Element &element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> ```cpp PrimaryVariables dirichlet(const Element &element, const SubControlVolume &scv) const @@ -242,6 +251,7 @@ PrimaryVariables dirichlet(const Element &element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> ## @@ -260,6 +270,7 @@ NumEqVector neumannAtPos(const GlobalPosition& globalPos) const return values; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> `NumEqVector` is an array of equations (here, the size of the array is 2). @@ -278,6 +289,8 @@ NumEqVector neumann(const Element& element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> + ## Initial conditions: @@ -296,6 +309,7 @@ PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const return values; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> ## @@ -306,6 +320,7 @@ Source/sink terms: NumEqVector sourceAtPos(const GlobalPosition &globalPos) const { return NumEqVector(0.0); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pproblem.hh`</span> ## @@ -321,6 +336,7 @@ NumEqVector source(const Element &element, ... } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/common/fvproblem.hh`</span> # Spatial Parameters definition @@ -339,6 +355,7 @@ class InjectionSpatialParams // e.g. porosity, permeability }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> Inherit from `FVPorousMediumFlowSpatialParamsMP` where `FV`: finite volumes, `MP`: multi-phase flow. @@ -355,6 +372,7 @@ auto permeabilityAtPos(const GlobalPosition& globalPos) const return aquiferK_; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> ## @@ -369,6 +387,7 @@ Scalar porosityAtPos(const GlobalPosition& globalPos) const return aquiferPorosity_; } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> ## @@ -384,6 +403,7 @@ auto fluidMatrixInteractionAtPos(const GlobalPosition& globalPos) const return makeFluidMatrixInteraction(aquiferPcKrSwCurve_); } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> ## @@ -392,9 +412,10 @@ Set the (constant) temperature field in the domain: ```cpp Scalar temperatureAtPos(const GlobalPosition& globalPos) const { - return 273.15 + 20.0; // 20°C + return 273.15 + 30.0; // 30°C } ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/injection2pspatialparams.hh`</span> # Runtime parameters @@ -413,6 +434,7 @@ Cells = 24 16 [Problem] Name = test ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/nonisothermal/params.input`</span> See [Part I: Runtime parameters](./params.html) for details. @@ -436,6 +458,7 @@ int main(int argc, char** argv) // initialize MPI+X backends (mandatory) Dumux::initialize(argc, argv); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -445,6 +468,7 @@ Parse runtime parameters: // parse command line arguments and input file Dumux::Parameters::init(argc, argv); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> See [Part I: Runtime parameters](./params.html) for details. @@ -456,6 +480,7 @@ Define an alias for the test problem type tag using namespace Dumux; using TypeTag = Properties::TTag::Injection2pCC; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> The tag (tag alias) is used to extract types and values via the property system (details on properties in [Part II: Property system](./properties.html)). @@ -473,6 +498,7 @@ gridManager.init(); const auto& grid = gridManager.grid(); const auto& leafGridView = grid.leafGridView(); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> More details on the grid in [Part I: Grid](./grid.html). @@ -490,6 +516,7 @@ auto gridGeometry = std::make_shared<GridGeometry>(leafGridView); using Problem = GetPropType<TypeTag, Properties::Problem>; auto problem = std::make_shared<Problem>(gridGeometry); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -508,6 +535,7 @@ auto gridVariables = std::make_shared<GridVariables>(problem, gridGeometry); gridVariables->init(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -528,6 +556,7 @@ vtkWriter.addVelocityOutput( using IOFields = GetPropType<TypeTag, Properties::IOFields>; IOFields::initOutputModule(vtkWriter); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -555,6 +584,7 @@ auto r = std::make_shared<SolutionVector>(); assembler->setLinearSystem(A, r); assembler->assembleJacobianAndResidual(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-mainfile/exercise1pamain.cc`</span> ## @@ -570,6 +600,7 @@ auto linearSolver = std::make_shared<LinearSolver>( (*r) *= -1.0; // solve Ax = -r to save update and copy linearSolver->solve(*A, x, *r); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-mainfile/exercise1pamain.cc`</span> ## @@ -585,6 +616,7 @@ Solver solver(assembler, linearSolver); // assemble & solve solver.solve(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/1p/rootbenchmark/main.cc`</span> ## @@ -600,6 +632,7 @@ Solver solver(assembler, linearSolver); // linearize & solve solver.solve(x); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-mainfile/exercise1pbmain.cc`</span> ## @@ -622,6 +655,7 @@ auto assembler = std::make_shared<Assembler>( // assemble linear/non-linear problem as before // ... ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -634,6 +668,7 @@ timeLoop->start(); do { } while (!timeLoop->finished()); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -649,6 +684,7 @@ timeLoop->start(); do xOld = x; gridVariables->advanceTimeStep(); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> ## @@ -667,6 +703,7 @@ Advancing the time loop to the next step: // print final report timeLoop->finalize(leafGridView.comm()); ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/2pmain.cc`</span> # Build system (CMake) @@ -753,6 +790,7 @@ by defining a name and source file: dumux_add_test(NAME exercise_basic_2p SOURCES 2pmain.cc) ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-basic/CMakeLists.txt`</span> ## Build system @@ -772,6 +810,7 @@ dumux_add_test( test_2p.input -Problem.Name 2p_box" ) ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/CMakeLists.txt`</span> ## Build system @@ -786,6 +825,7 @@ target_compile_definitions( test_2p_incompressible_tpfa PUBLIC TYPETAG=TwoPIncompressibleTpfa ) ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/incompressible/CMakeLists.txt`</span> ## Build system diff --git a/slides/properties.md b/slides/properties.md index 73f33d0163f78f99d472b84515300f089f7800a2..2ff9276d0a12d3577058c9392b0563c1c4a4b310 100644 --- a/slides/properties.md +++ b/slides/properties.md @@ -103,6 +103,7 @@ using GOF0 = Dune::GridOperator< >; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dune-pdelab/doc/Recipes/recipe-operator-splitting.cc`</span> ## Technique 1: Traits classes @@ -122,6 +123,7 @@ struct TwoPVolumeVariablesTraits using SaturationReconstruction = SR; }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/porousmediumflow/2p/model.hh`</span> ## Technique 2: Type traits @@ -153,6 +155,7 @@ using FluidSystem = typename Traits::FluidSystem ... ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/porousmediumflow/2p/volumevariables.hh`</span> Usage: these VolumeVariables will work for various FluidSystems: @@ -332,6 +335,7 @@ struct MyOtherTypeTag } // end namespace Dumux::Properties::TTag ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-properties/properties.hh`</span> ## How to use II @@ -341,6 +345,8 @@ namespace Dumux::Properties { DUMUX_DEFINE_PROPERTY(Problem) } // end namespace Dumux::Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/common/propertysystem/test_propertysystem_aliases.cc`</span> + Usually not needed in user code because all necessary properties are already defined in [dumux/common/properties.hh](https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/common/properties.hh). @@ -357,6 +363,7 @@ struct Problem<TypeTag, TTag::MyTypeTag> } // end namespace Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux-course/exercises/exercise-properties/properties.hh`</span> ## How to use III (alternative) @@ -374,6 +381,7 @@ struct MyTypeTag { } // end namespace Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/geomechanics/hyperelastic/properties.hh`</span> ## How to use IV @@ -388,6 +396,7 @@ struct EnableBoxInterfaceSolver<TypeTag, TTag::MyTypeTag> } // end namespace Properties ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/test/porousmediumflow/2p/boxdfm/properties.hh`</span> ## How to use IV (alternative) @@ -425,7 +434,7 @@ class Problem } // end namespace Dumux ``` - +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/examples/1ptracer/problem_tracer.hh`</span> ## Summary @@ -448,16 +457,18 @@ class Problem - Use a simple template argument ```cpp -template <bool useNeummanBoundaryConditions> -class Problem +template<bool enableRegularization = isRegularized()> +Scalar pcgw(const Scalar sw, const Scalar /*dummySn*/) const { ... - if constexpr (useNeummanBoundaryConditions) - ... - else + if constexpr (enableRegularization)^ + { ... -}; + } + ... +} ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/material/fluidmatrixinteractions/3p/parkervangenuchten.hh`</span> ## Alternative 2: @@ -468,6 +479,7 @@ template<class CouplingManager> struct SupportsMultithreadedAssembly : public std::false_type {} ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/fvassembler.hh`</span> ## Alternative 2: @@ -496,6 +508,7 @@ class Assembler { } }; ``` +<span style="font-size: 0.4em; position: relative; top: -38px; color: gray;">File: `dumux/dumux/multidomain/fvassembler.hh`</span> # Exercise ## Exercise