diff --git a/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh b/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh index 1de029a8e2ac0ffe7ed701536e113ae5d5eae050..609337fd483dbf9ffa25c1a3dfd964685e9d2475 100644 --- a/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh +++ b/dumux/porousmediumflow/1p/sequential/diffusion/problem.hh @@ -78,7 +78,7 @@ public: { spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (getParam<bool>("Problem.EnableGravity", true)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; } /*! @@ -93,7 +93,7 @@ public: { spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (getParam<bool>("Problem.EnableGravity", true)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; } /*! @@ -106,7 +106,7 @@ public: { spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (getParam<bool>("Problem.EnableGravity", true)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; } /*! @@ -120,7 +120,7 @@ public: { spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (getParam<bool>("Problem.EnableGravity", true)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; } diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh index baeb3b6b87b4ebddc0add67af32093768e865293..1e14e92f07bcbc2c23acf5500975d6de99603250 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressure.hh @@ -552,16 +552,19 @@ public: DUNE_THROW(Dune::NotImplemented, "Saturation type not supported!"); } - ErrorTermFactor_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermFactor); - ErrorTermLowerBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermLowerBound); - ErrorTermUpperBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermUpperBound); + ErrorTermFactor_ = getParam<Scalar>("Impet.ErrorTermFactor", + GET_PROP_VALUE(TypeTag, ImpetErrorTermFactor)); + ErrorTermLowerBound_ = getParam<Scalar>("Impet.ErrorTermLowerBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermLowerBound)); + ErrorTermUpperBound_ = getParam<Scalar>("Impet.ErrorTermUpperBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermUpperBound)); density_[wPhaseIdx] = 0.; density_[nPhaseIdx] = 0.; viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } private: diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh index ccebaafa6f418dba6ce5081922733d429599e0a3..4a29c9d7f00d32531c28282c41669ffdfaeb2a7f 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/velocity.hh @@ -133,7 +133,7 @@ public: viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel");; } //! For initialization diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh index 768490a1a19c51e5d92183c8f50296517f53cf6d..7ea4301a948dfc0efd4d29a1858abc0eb60526b4 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh @@ -125,9 +125,12 @@ public: const GridView& gridView, bool procBoundaryAsDirichlet = true) : problem_(problem), gridView_(gridView), maxError_(0), timeStep_(1) { - ErrorTermFactor_ = GET_PARAM(TypeTag, Scalar, ImpetErrorTermFactor); - ErrorTermLowerBound_ = GET_PARAM(TypeTag, Scalar, ImpetErrorTermLowerBound); - ErrorTermUpperBound_ = GET_PARAM(TypeTag, Scalar, ImpetErrorTermUpperBound); + ErrorTermFactor_ = getParam<Scalar>("Impet.ErrorTermFactor", + GET_PROP_VALUE(TypeTag, ImpetErrorTermFactor)); + ErrorTermLowerBound_ = getParam<Scalar>("Impet.ErrorTermLowerBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermLowerBound)); + ErrorTermUpperBound_ = getParam<Scalar>("Impet.ErrorTermUpperBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermUpperBound)); density_[wPhaseIdx] = 0.0; density_[nPhaseIdx] = 0.0; diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh index f913e2c6d42b453be91048380c5c423dbd5a24d9..bbf7bfae9aa7f49a337ad31f21bf96cf48ae0820 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh @@ -131,9 +131,12 @@ public: int size = gridView_.size(0); rhs_.resize(size , 0.); W_.resize(size); - ErrorTermFactor_ = GET_PARAM(TypeTag, Scalar, ImpetErrorTermFactor); - ErrorTermLowerBound_ = GET_PARAM(TypeTag, Scalar, ImpetErrorTermLowerBound); - ErrorTermUpperBound_ = GET_PARAM(TypeTag, Scalar, ImpetErrorTermUpperBound); + ErrorTermFactor_ = getParam<Scalar>("Impet.ErrorTermFactor", + GET_PROP_VALUE(TypeTag, ImpetErrorTermFactor)); + ErrorTermLowerBound_ = getParam<Scalar>("Impet.ErrorTermLowerBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermLowerBound)); + ErrorTermUpperBound_ = getParam<Scalar>("Impet.ErrorTermUpperBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermUpperBound)); density_[wPhaseIdx] = 0.0; density_[nPhaseIdx] = 0.0; diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh index 25f23429daab3c0321fe703d667c5285af673914..f06780a9b7d8b89732cd83406950c36945f671a8 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressure.hh @@ -27,6 +27,7 @@ */ // dumux environment #include <dumux/porousmediumflow/sequential/mimetic/properties.hh> +#include <dumux/porousmediumflow/sequential/cellcentered/pressure.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operator.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimetic.hh> @@ -445,7 +446,7 @@ public: viscosity_[wPhaseIdx] = 0.0; viscosity_[nPhaseIdx] = 0.0; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } private: @@ -467,15 +468,12 @@ void MimeticPressure2P<TypeTag>::solve() { typedef typename GET_PROP_TYPE(TypeTag, LinearSolver) Solver; - int verboseLevelSolver = GET_PARAM_FROM_GROUP(TypeTag, int, LinearSolver, Verbosity); + auto verboseLevelSolver = getParam<int>("LinearSolver.Verbosity"); if (verboseLevelSolver) std::cout << "MimeticPressure2P: solve for pressure" << std::endl; -// printmatrix(std::cout, *A_, "global stiffness matrix", "row", 11, 3); -// printvector(std::cout, f_, "right hand side", "row", 10, 1, 3); - - Solver solver(problem_); + auto solver = getSolver<Solver>(problem_); solver.solve(*A_, pressTrace_, f_); return; diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh index b79b1c712cb4af4ca09fbd8fcea6faed24b7d170..ae53957b4d3290bc0b52cabd6d318056b793cc12 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mimetic/pressureadaptive.hh @@ -27,6 +27,7 @@ */ // dumux environment #include <dumux/porousmediumflow/sequential/mimetic/properties.hh> +#include <dumux/porousmediumflow/sequential/cellcentered/pressure.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/mimetic/operatoradaptive.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/mimetic/mimeticadaptive.hh> @@ -479,12 +480,12 @@ void MimeticPressure2PAdaptive<TypeTag>::solve() { typedef typename GET_PROP_TYPE(TypeTag, LinearSolver) Solver; - int verboseLevelSolver = GET_PARAM_FROM_GROUP(TypeTag, int, LinearSolver, Verbosity); + int verboseLevelSolver = getParam<int>("LinearSolver.Verbosity"); if (verboseLevelSolver) std::cout << "MimeticPressure2PAdaptive: solve for pressure" << std::endl; - Solver solver(problem_); + auto solver = getSolver<Solver>(problem_); solver.solve(*A_, pressTrace_, f_); // printmatrix(std::cout, *A_, "global stiffness matrix", "row", 11, 3); diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh index da288fb8f74b1b0278d1f6717af5abc67debf68f..35210da97ad34363377464bd9e1540b6fc77a7c8 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressure.hh @@ -429,16 +429,19 @@ public: DUNE_THROW(Dune::NotImplemented, "Dimension not supported!"); } - ErrorTermFactor_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermFactor); - ErrorTermLowerBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermLowerBound); - ErrorTermUpperBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermUpperBound); + ErrorTermFactor_ = getParam<Scalar>("Impet.ErrorTermFactor", + GET_PROP_VALUE(TypeTag, ImpetErrorTermFactor)); + ErrorTermLowerBound_ = getParam<Scalar>("Impet.ErrorTermLowerBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermLowerBound)); + ErrorTermUpperBound_ = getParam<Scalar>("Impet.ErrorTermUpperBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermUpperBound)); density_[wPhaseIdx] = 0.; density_[nPhaseIdx] = 0.; viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } private: diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh index ba214bdd9707afeaba055ed1fe4f77fe21b95778..3adace7634242a0a1b6c8567253492119669ab3f 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dpressureadaptive.hh @@ -469,16 +469,19 @@ public: DUNE_THROW(Dune::NotImplemented, "Dimension not supported!"); } - ErrorTermFactor_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermFactor); - ErrorTermLowerBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermLowerBound); - ErrorTermUpperBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermUpperBound); + ErrorTermFactor_ = getParam<Scalar>("Impet.ErrorTermFactor", + GET_PROP_VALUE(TypeTag, ImpetErrorTermFactor)); + ErrorTermLowerBound_ = getParam<Scalar>("Impet.ErrorTermLowerBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermLowerBound)); + ErrorTermUpperBound_ = getParam<Scalar>("Impet.ErrorTermUpperBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermUpperBound)); density_[wPhaseIdx] = 0.; density_[nPhaseIdx] = 0.; viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } private: diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh index e8207c6024706361c711035b192b5228e2f18f94..773927e681c6221c87dc79e22635ae5ab4825234 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/2dvelocity.hh @@ -133,7 +133,7 @@ public: viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } //calculate velocities for flux faces of an interaction volume diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh index a182ebc847b4b65fbda9216b409dec1ef6f94e3e..c56645aaabfea18b1fdbe19ca73ecf14abf54ec6 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressure.hh @@ -485,16 +485,19 @@ public: DUNE_THROW(Dune::NotImplemented, "Dimension not supported!"); } - ErrorTermFactor_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermFactor); - ErrorTermLowerBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermLowerBound); - ErrorTermUpperBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermUpperBound); + ErrorTermFactor_ = getParam<Scalar>("Impet.ErrorTermFactor", + GET_PROP_VALUE(TypeTag, ImpetErrorTermFactor)); + ErrorTermLowerBound_ = getParam<Scalar>("Impet.ErrorTermLowerBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermLowerBound)); + ErrorTermUpperBound_ = getParam<Scalar>("Impet.ErrorTermUpperBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermUpperBound)); density_[wPhaseIdx] = 0.; density_[nPhaseIdx] = 0.; viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } private: diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh index 315b693d8d37310229a8453296131647b613cbd7..405ecaec196bd6000861c74c66a8674d980fa414 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressurevelocity.hh @@ -425,7 +425,6 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocityOnBoundary(const Int //determine saturation at the boundary -> if no saturation is known directly at the boundary use the cell saturation Scalar satW = 0; - Scalar satNw = 0; if (bcType.isDirichlet(satEqIdx)) { switch (saturationType_) @@ -433,13 +432,11 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocityOnBoundary(const Int case sw: { satW = boundValues[saturationIdx]; - satNw = 1 - boundValues[saturationIdx]; break; } case sn: { satW = 1 - boundValues[saturationIdx]; - satNw = boundValues[saturationIdx]; break; } } @@ -447,7 +444,6 @@ void FvMpfaL3dPressureVelocity2p<TypeTag>::calculateVelocityOnBoundary(const Int else { satW = cellData.saturation(wPhaseIdx); - satNw = cellData.saturation(nPhaseIdx); } Scalar pressBound = boundValues[pressureIdx]; diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh index 9562bf224d452fda3eb1c0ee0f8ca9d19c639819..f1248255327aa015550023103fb9db293895fd0b 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dvelocity.hh @@ -146,7 +146,7 @@ public: viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } //calculate velocities for flux faces of an interaction volume diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh index 4ff2ba4480bf56cc2f6f5a296a3ae272068a39b2..c4d7c1f45e48066974363b7fdb9282746ed88fd5 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressure.hh @@ -412,16 +412,19 @@ public: DUNE_THROW(Dune::NotImplemented, "Dimension not supported!"); } - ErrorTermFactor_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermFactor); - ErrorTermLowerBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermLowerBound); - ErrorTermUpperBound_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, ErrorTermUpperBound); + ErrorTermFactor_ = getParam<Scalar>("Impet.ErrorTermFactor", + GET_PROP_VALUE(TypeTag, ImpetErrorTermFactor)); + ErrorTermLowerBound_ = getParam<Scalar>("Impet.ErrorTermLowerBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermLowerBound)); + ErrorTermUpperBound_ = getParam<Scalar>("Impet.ErrorTermUpperBound", + GET_PROP_VALUE(TypeTag, ImpetErrorTermUpperBound)); density_[wPhaseIdx] = 0.; density_[nPhaseIdx] = 0.; viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } private: diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh index 5d411f3043c381767f78cd230314f933cbb341a1..2c7906f973bcae9801823b17c4a99b6ae8cb40a3 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dvelocity.hh @@ -131,7 +131,7 @@ public: viscosity_[wPhaseIdx] = 0.; viscosity_[nPhaseIdx] = 0.; - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); } //calculate velocities for all flux faces of an interaction volume diff --git a/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh b/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh index 889e088e8cdd4130c50981d554e671c030f78d05..1ce2569a00964c9c70e5a0b74fb7712d581c4ae1 100644 --- a/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh +++ b/dumux/porousmediumflow/2p/sequential/diffusion/problem.hh @@ -75,7 +75,7 @@ public: { spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; pressModel_ = std::make_shared<PressureModel>(asImp_()); @@ -92,7 +92,7 @@ public: { spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; pressModel_ = std::make_shared<PressureModel>(asImp_()); @@ -108,7 +108,7 @@ public: { spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; pressModel_ = std::make_shared<PressureModel>(asImp_()); @@ -124,7 +124,7 @@ public: { spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = -9.81; pressModel_ = std::make_shared<PressureModel>(asImp_()); diff --git a/dumux/porousmediumflow/2p/sequential/impes/problem.hh b/dumux/porousmediumflow/2p/sequential/impes/problem.hh index 3ccb3c9c0efee16d1488a09a3915ff84b564ae5b..384475e87cf857b986ebb51a2ca1f384075415a1 100644 --- a/dumux/porousmediumflow/2p/sequential/impes/problem.hh +++ b/dumux/porousmediumflow/2p/sequential/impes/problem.hh @@ -81,7 +81,7 @@ public: spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = - 9.81; } /*! @@ -97,7 +97,7 @@ public: { spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = - 9.81; } diff --git a/dumux/porousmediumflow/2p/sequential/properties.hh b/dumux/porousmediumflow/2p/sequential/properties.hh index 5af78bee53a95333c30492ef1815ad930cf653c2..241a156dc8936b4d49295bd07ab8fcc936a1b338 100644 --- a/dumux/porousmediumflow/2p/sequential/properties.hh +++ b/dumux/porousmediumflow/2p/sequential/properties.hh @@ -60,7 +60,6 @@ NEW_TYPE_TAG(SequentialTwoP, INHERITS_FROM(SequentialModel)); ////////////////////////////////////////////////////////////////// NEW_PROP_TAG( SpatialParams ); //!< The type of the spatial parameters object NEW_PROP_TAG(MaterialLaw); //!< The material law which ought to be used (extracted from the spatial parameters) -NEW_PROP_TAG( ProblemEnableGravity); //!< Returns whether gravity is considered in the problem NEW_PROP_TAG( Formulation); //!< The formulation of the model NEW_PROP_TAG( PressureFormulation); //!< The formulation of the pressure model NEW_PROP_TAG( SaturationFormulation); //!< The formulation of the saturation model @@ -137,7 +136,10 @@ SET_TYPE_PROP(SequentialTwoP, Variables, VariableClass<TypeTag>); SET_TYPE_PROP(SequentialTwoP, CellData, CellData2P<TypeTag, GET_PROP_VALUE(TypeTag, EnableCompressibility)>); //! Set default fluid system -SET_TYPE_PROP(SequentialTwoP, FluidSystem, TwoPImmiscibleFluidSystem<TypeTag>); +SET_TYPE_PROP(SequentialTwoP, FluidSystem, + FluidSystems::TwoPImmiscible<typename GET_PROP_TYPE(TypeTag, Scalar), + typename GET_PROP_TYPE(TypeTag, WettingPhase), + typename GET_PROP_TYPE(TypeTag, NonwettingPhase)>); //! Set default fluid state SET_PROP(SequentialTwoP, FluidState) @@ -158,9 +160,6 @@ SET_SCALAR_PROP(SequentialTwoP, ImpetErrorTermFactor, 0.5); SET_SCALAR_PROP(SequentialTwoP, ImpetErrorTermLowerBound, 0.1); //! Default upper threshold for evaluation of an error term SET_SCALAR_PROP(SequentialTwoP, ImpetErrorTermUpperBound, 0.9); - -// enable gravity by default -SET_BOOL_PROP(SequentialTwoP, ProblemEnableGravity, true); // \} } diff --git a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh index 1563327874a8dd490361e59f093d619ebb808b44..c4dcf281b57e4843253b19175825b59526bee633 100644 --- a/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh +++ b/dumux/porousmediumflow/2p/sequential/transport/cellcentered/saturation.hh @@ -485,7 +485,7 @@ public: gravityFlux_ = std::make_shared<GravityFlux>(problem); velocity_ = std::make_shared<Velocity>(problem); - vtkOutputLevel_ = GET_PARAM_FROM_GROUP(TypeTag, int, Vtk, OutputLevel); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); porosityThreshold_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, PorosityThreshold); } diff --git a/dumux/porousmediumflow/2p/sequential/transport/problem.hh b/dumux/porousmediumflow/2p/sequential/transport/problem.hh index 7e53bf5a88f6b7675c6727b71b23e84fec182a20..7949971f9ddfc1114ec1145663334d5191ae6acf 100644 --- a/dumux/porousmediumflow/2p/sequential/transport/problem.hh +++ b/dumux/porousmediumflow/2p/sequential/transport/problem.hh @@ -101,7 +101,7 @@ public: spatialParams_ = std::make_shared<SpatialParams>(gridView); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = - 9.81; } @@ -121,7 +121,7 @@ public: spatialParams_ = Dune::stackobject_to_shared_ptr<SpatialParams>(spatialParams); gravity_ = 0; - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) gravity_[dim - 1] = - 9.81; } diff --git a/dumux/porousmediumflow/2p2c/sequential/properties.hh b/dumux/porousmediumflow/2p2c/sequential/properties.hh index 21b5cbd9bdc263b30e89aebae3300273ae37ede2..38c547bc746e6c5b5df74ca4ba1bb2307447f7d2 100644 --- a/dumux/porousmediumflow/2p2c/sequential/properties.hh +++ b/dumux/porousmediumflow/2p2c/sequential/properties.hh @@ -66,7 +66,6 @@ NEW_TYPE_TAG(SequentialTwoPTwoC, INHERITS_FROM(Pressure, Transport, IMPET)); ////////////////////////////////////////////////////////////////// NEW_PROP_TAG( Indices ); NEW_PROP_TAG( SpatialParams ); //!< The type of the soil properties object -NEW_PROP_TAG( ProblemEnableGravity); //!< Returns whether gravity is considered in the problem NEW_PROP_TAG( PressureFormulation); //!< The formulation of the model NEW_PROP_TAG( SaturationFormulation); //!< The formulation of the model NEW_PROP_TAG( VelocityFormulation); //!< The formulation of the model @@ -145,7 +144,6 @@ SET_PROP(SequentialTwoPTwoC, TransportSolutionType) SET_BOOL_PROP(SequentialTwoPTwoC, EnableCompressibility, true); //!< Compositional models are very likely compressible SET_BOOL_PROP(SequentialTwoPTwoC, VisitFacesOnlyOnce, false); //!< Faces are regarded from both sides SET_BOOL_PROP(SequentialTwoPTwoC, EnableCapillarity, false); //!< Capillarity is enabled -SET_INT_PROP(SequentialTwoPTwoC, VtkOutputLevel,2); //!< Default verbosity for VtkOutputLevel is 2 = pretty verbose //! Restrict (no upwind) flux in transport step if direction reverses after pressure equation SET_INT_PROP(SequentialTwoPTwoC, ImpetRestrictFluxInTransport, 0); @@ -167,9 +165,6 @@ SET_BOOL_PROP(SequentialTwoPTwoC, ImpetEnableVolumeIntegral, true); //!< Regard SET_SCALAR_PROP(SequentialTwoPTwoC, ImpetErrorTermFactor, 0.5); //!< Damping factor \f$ \alpha \f$ in pressure equation SET_SCALAR_PROP(SequentialTwoPTwoC, ImpetErrorTermLowerBound, 0.2); //!< Lower bound where error is not corrected SET_SCALAR_PROP(SequentialTwoPTwoC, ImpetErrorTermUpperBound, 0.9); //!< Upper bound for regularized error damping - -// enable gravity by default -SET_BOOL_PROP(SequentialTwoPTwoC, ProblemEnableGravity, true); } /*! diff --git a/dumux/porousmediumflow/sequential/cellcentered/pressure.hh b/dumux/porousmediumflow/sequential/cellcentered/pressure.hh index 0d6aab3decc977310e7fe222dc5a4903c02e4faf..58d7d93c0f654309b0d2eddb7d0823214a778b47 100644 --- a/dumux/porousmediumflow/sequential/cellcentered/pressure.hh +++ b/dumux/porousmediumflow/sequential/cellcentered/pressure.hh @@ -516,7 +516,7 @@ void FVPressure<TypeTag>::solve() { typedef typename GET_PROP_TYPE(TypeTag, LinearSolver) Solver; - int verboseLevelSolver = getParam<int>("LinearSolver, Verbosity", 0); + int verboseLevelSolver = getParam<int>("LinearSolver.Verbosity"); if (verboseLevelSolver) std::cout << __FILE__ << ": solve for pressure" << std::endl; diff --git a/dumux/porousmediumflow/sequential/impetproblem.hh b/dumux/porousmediumflow/sequential/impetproblem.hh index 3a4273039fcec1fca4ffdbf8a39a2e193456f1b0..51d7deca5faf1fc4c4903f17a6a976e6ea08e240 100644 --- a/dumux/porousmediumflow/sequential/impetproblem.hh +++ b/dumux/porousmediumflow/sequential/impetproblem.hh @@ -132,7 +132,7 @@ public: if (adaptiveGrid) gridAdapt_ = std::make_shared<GridAdaptModel>(asImp_()); - vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel", 0); + vtkOutputLevel_ = getParam<int>("Vtk.OutputLevel"); dtVariationRestrictionFactor_ = GET_PARAM_FROM_GROUP(TypeTag, Scalar, Impet, DtVariationRestrictionFactor); maxTimeStepSize_ = getParam<Scalar>("TimeManager.MaxTimeStepSize", std::numeric_limits<Scalar>::max()); } diff --git a/dumux/porousmediumflow/sequential/pressureproperties.hh b/dumux/porousmediumflow/sequential/pressureproperties.hh index 93d2ec778f199df6be522249e10c530d5ed1b1ae..8dde3b013e0259266bb1bdb9f9f01a03f87f752d 100644 --- a/dumux/porousmediumflow/sequential/pressureproperties.hh +++ b/dumux/porousmediumflow/sequential/pressureproperties.hh @@ -94,6 +94,8 @@ public: typedef Dune::BlockVector<Dune::FieldVector<Scalar, 1> > type; }; +SET_INT_PROP(Pressure, LinearSolverBlockSize, 1); + SET_TYPE_PROP(Pressure, PressureSolutionVector, typename GET_PROP(TypeTag, SolutionTypes)::ScalarSolution); // use the stabilized BiCG solver preconditioned by the ILU-0 by default diff --git a/dumux/porousmediumflow/sequential/properties.hh b/dumux/porousmediumflow/sequential/properties.hh index 3109418243c94f361328996d5a15fb01ed8c314e..8f25c327ed8243a528e7f1b619b8dd8ef7b0ffc5 100644 --- a/dumux/porousmediumflow/sequential/properties.hh +++ b/dumux/porousmediumflow/sequential/properties.hh @@ -205,6 +205,17 @@ SET_PROP(SequentialModel, BoundaryTypes) public: typedef BoundaryTypes<numEq> type; }; + +//! do not specific any model-specific default parameters here +SET_PROP(SequentialModel, ModelDefaultParameters) +{ + static void defaultParams(Dune::ParameterTree& params, const std::string& group = "") + { + params["Vtk.OutputLevel"] = "0"; + + } +}; + } } diff --git a/test/porousmediumflow/1p/sequential/CMakeLists.txt b/test/porousmediumflow/1p/sequential/CMakeLists.txt index 1630c832a429c2f2959294d82e5facf24701007b..965cf81dcfdff5eabcb6ffd052611e12b547413b 100644 --- a/test/porousmediumflow/1p/sequential/CMakeLists.txt +++ b/test/porousmediumflow/1p/sequential/CMakeLists.txt @@ -1,29 +1,32 @@ add_input_file_links() -add_dumux_test(test_dec1p test_dec1p test_1p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_1p-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_1p-00000.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_dec1p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_1p.input") +dune_add_test(NAME test_dec1p + SOURCES test_1p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_1p-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_1p-00000.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_dec1p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_1p.input") -add_dumux_test(test_diffusion test_diffusion test_diffusion.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/diffusion-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/mimeticdiffusion-00000.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_diffusion 3") +dune_add_test(NAME test_diffusion + SOURCES test_diffusion.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/diffusion-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/mimeticdiffusion-00000.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_diffusion") -add_dumux_test(test_diffusion3d test_diffusion3d test_diffusion3d.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_diffusion3d_fv-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d_fv-00000.vtu - ${CMAKE_SOURCE_DIR}/test/references/test_diffusion3d_fvmpfal-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d_fvmpfal-00000.vtu - ${CMAKE_SOURCE_DIR}/test/references/test_diffusion3d_mimetic-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d_mimetic-00000.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_diffusion3d_reference.input") +dune_add_test(NAME test_diffusion3d + SOURCES test_diffusion3d.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_diffusion3d_fv-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d_fv-00000.vtu + ${CMAKE_SOURCE_DIR}/test/references/test_diffusion3d_fvmpfal-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d_fvmpfal-00000.vtu + ${CMAKE_SOURCE_DIR}/test/references/test_diffusion3d_mimetic-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d_mimetic-00000.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_diffusion3d -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_diffusion3d_reference.input") #install sources install(FILES diff --git a/test/porousmediumflow/1p/sequential/test_diffusion.cc b/test/porousmediumflow/1p/sequential/test_diffusion.cc index 91b1fc0d379afabeae9ee50959fa0f40784d9b88..27956cb54fcd0e969f1a602f069d41bbd8d4324f 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusion.cc +++ b/test/porousmediumflow/1p/sequential/test_diffusion.cc @@ -35,10 +35,17 @@ // the main function //////////////////////// -void usage(const char *progname) +void usage(const char *progName, const std::string &errorMsg) { - std::cout << "usage: " << progname << " #refine [delta]\n"; - exit(1); + if (errorMsg.size() > 0) { + std::string errorMessageOut = "\nUsage: "; + errorMessageOut += progName; + errorMessageOut += " #refine [delta]\n"; + errorMessageOut += errorMsg; + + std::cout << errorMessageOut + << "\n"; + } } int main(int argc, char** argv) @@ -49,18 +56,8 @@ int main(int argc, char** argv) // initialize MPI, finalize is done automatically on exit Dune::MPIHelper::instance(argc, argv); - //////////////////////////////////////////////////////////// - // parse the command line arguments - //////////////////////////////////////////////////////////// - if (argc != 2 && argc != 3) - usage(argv[0]); - - int numRefine; - std::istringstream(argv[1]) >> numRefine; - - double delta = 1e-3; - if (argc == 3) - std::istringstream(argv[2]) >> delta; + auto defaultParams = [] (Dune::ParameterTree& p) {GET_PROP(TypeTag, ModelDefaultParameters)::defaultParams(p);}; + Dumux::Parameters::init(argc, argv, defaultParams, usage); //////////////////////////////////////////////////////////// // create the grid @@ -68,6 +65,7 @@ int main(int argc, char** argv) using GridCreator = GET_PROP_TYPE(TypeTag, GridCreator); GridCreator::createGrid(); auto& grid = GridCreator::grid(); + auto numRefine = Dumux::getParam<int>("Grid.NumRefine", 0); grid.globalRefine(numRefine); //////////////////////////////////////////////////////////// @@ -77,7 +75,7 @@ int main(int argc, char** argv) bool consecutiveNumbering = true; typedef GET_PROP_TYPE(TTAG(FVVelocity2PTestProblem), Problem) FVProblem; - FVProblem fvProblem(grid.leafGridView(), delta); + FVProblem fvProblem(grid.leafGridView()); fvProblem.setName("fvdiffusion"); timer.reset(); fvProblem.init(); @@ -88,7 +86,7 @@ int main(int argc, char** argv) fvResult.evaluate(grid.leafGridView(), fvProblem, consecutiveNumbering); typedef GET_PROP_TYPE(TTAG(FVMPFAOVelocity2PTestProblem), Problem) MPFAOProblem; - MPFAOProblem mpfaProblem(grid.leafGridView(), delta); + MPFAOProblem mpfaProblem(grid.leafGridView()); mpfaProblem.setName("fvmpfaodiffusion"); timer.reset(); mpfaProblem.init(); @@ -98,7 +96,7 @@ int main(int argc, char** argv) mpfaResult.evaluate(grid.leafGridView(), mpfaProblem, consecutiveNumbering); typedef GET_PROP_TYPE(TTAG(MimeticPressure2PTestProblem), Problem) MimeticProblem; - MimeticProblem mimeticProblem(grid.leafGridView(), delta); + MimeticProblem mimeticProblem(grid.leafGridView()); mimeticProblem.setName("mimeticdiffusion"); timer.reset(); mimeticProblem.init(); diff --git a/test/porousmediumflow/1p/sequential/test_diffusion.input b/test/porousmediumflow/1p/sequential/test_diffusion.input index 05e0fbbdf4e86debb6c1cfd368e877dd00208ddd..345e3ba5c797889b741b660598be8d01e86dea73 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusion.input +++ b/test/porousmediumflow/1p/sequential/test_diffusion.input @@ -1,4 +1,11 @@ [Grid] LowerLeft = 0 0 UpperRight = 1 1 -Refinement = 3 +NumRefine = 3 + +[Problem] +#Delta = 1e-6 # [-] if this is commented in, it is used +EnableGravity = 0 + +[LinearSolver] +PreconditionerIterations = 2 diff --git a/test/porousmediumflow/1p/sequential/test_diffusion3d.cc b/test/porousmediumflow/1p/sequential/test_diffusion3d.cc index 3587552f365299d71cac090c459d9bf77dcab2a3..233d522a57d9b33333e134f1ebe42b6e949d4d72 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusion3d.cc +++ b/test/porousmediumflow/1p/sequential/test_diffusion3d.cc @@ -74,31 +74,18 @@ int start(int argc, //////////////////////////////////////////////////////////// using TypeTag = TTAG(DiffusionTestProblem); - using ParameterTree = typename GET_PROP(TypeTag, ParameterTree); - // if the user just wanted to see the help / usage message show usage and stop program - if(!ParameterParser::parseCommandLineArguments(argc, argv, ParameterTree::tree(), usage)) - { - usage(argv[0], defaultUsageMessage(argv[0])); - return 0; - } - // parse the input file into the parameter tree - // check first if the user provided an input file through the command line, if not use the default - const auto parameterFileName = ParameterTree::tree().hasKey("ParameterFile") ? GET_RUNTIME_PARAM(TypeTag, std::string, ParameterFile) : ""; - ParameterParser::parseInputFile(argc, argv, ParameterTree::tree(), parameterFileName, usage); + auto defaultParams = [] (Dune::ParameterTree& p) {GET_PROP(TypeTag, ModelDefaultParameters)::defaultParams(p);}; + Dumux::Parameters::init(argc, argv, defaultParams, usage); //////////////////////////////////////////////////////////// // get some optional parameters //////////////////////////////////////////////////////////// - const int numRefine = ParameterTree::tree().hasKey("Grid.Refinement") ? - GET_RUNTIME_PARAM(TypeTag, int, Grid.Refinement) : 0; - - std::string outputName(""); - if (ParameterTree::tree().hasKey("Problem.OutputName")) - { - outputName += "_"; - outputName += GET_RUNTIME_PARAM(TypeTag, std::string, OutputName); - } + const int numRefine = getParam<int>("Grid.NumRefine", 0); + + auto outputName = getParam<std::string>("Problem.OutputName", ""); + if (outputName.size()) + outputName.insert(0, "_"); ////////////////////////////////////////////////////////////////////// // try to create a grid (from the given grid file or the input file) @@ -131,8 +118,8 @@ int start(int argc, using FVTypeTag = TTAG(FVTestProblem); using FVProblem = GET_PROP_TYPE(FVTypeTag, Problem); - using FVParameterTree = GET_PROP(FVTypeTag, ParameterTree); - ParameterParser::parseInputFile(argc, argv, FVParameterTree::tree(), parameterFileName, usage); + auto fvDefaultParams = [] (Dune::ParameterTree& p) {GET_PROP(FVTypeTag, ModelDefaultParameters)::defaultParams(p);}; + Dumux::Parameters::init(argc, argv, fvDefaultParams, usage); std::shared_ptr<FVProblem> fvProblem = std::make_shared<FVProblem>(grid.leafGridView()); // set output name @@ -159,8 +146,8 @@ int start(int argc, using MPFALTypeTag = TTAG(FVMPFAL3DTestProblem); using MPFALProblem = GET_PROP_TYPE(MPFALTypeTag, Problem); - using MPFALParameterTree = GET_PROP(MPFALTypeTag, ParameterTree); - ParameterParser::parseInputFile(argc, argv, MPFALParameterTree::tree(), parameterFileName, usage); + auto mpfalDefaultParams = [] (Dune::ParameterTree& p) {GET_PROP(MPFALTypeTag, ModelDefaultParameters)::defaultParams(p);}; + Dumux::Parameters::init(argc, argv, mpfalDefaultParams, usage); std::shared_ptr<MPFALProblem> mpfaProblem = std::make_shared<MPFALProblem>(grid.leafGridView()); // set output name @@ -187,8 +174,8 @@ int start(int argc, using MimeticTypeTag = TTAG(MimeticTestProblem); using MimeticProblem = GET_PROP_TYPE(MimeticTypeTag, Problem); - using MimeticParameterTree = GET_PROP(MimeticTypeTag, ParameterTree); - ParameterParser::parseInputFile(argc, argv, MimeticParameterTree::tree(), parameterFileName, usage); + auto mimeticDefaultParams = [] (Dune::ParameterTree& p) {GET_PROP(MimeticTypeTag, ModelDefaultParameters)::defaultParams(p);}; + Dumux::Parameters::init(argc, argv, mimeticDefaultParams, usage); std::shared_ptr<MimeticProblem> mimeticProblem = std::make_shared<MimeticProblem>(grid.leafGridView()); // set output name diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh index 5395e23e570ae402535199905690c381f32be05c..5ae9995fc1905dd28d6cfd3254e6f53cb91a5d63 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem.hh @@ -27,7 +27,7 @@ #include <dune/grid/yaspgrid.hh> #include <dune/grid/utility/structuredgridfactory.hh> -#include <dumux/material/components/unit.hh> +#include <dumux/material/components/constant.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureproperties.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/mpfa/omethod/2dpressureproperties.hh> @@ -94,7 +94,7 @@ SET_PROP(FVVelocity2PTestProblem, WettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; // Set the non-wetting phase @@ -103,18 +103,14 @@ SET_PROP(FVVelocity2PTestProblem, NonwettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; -// Enable gravity -SET_BOOL_PROP(FVVelocity2PTestProblem, ProblemEnableGravity, false); - // set the types for the MPFA-O FV method NEW_TYPE_TAG(FVMPFAOVelocity2PTestProblem, INHERITS_FROM(FvMpfaO2dPressureTwoP, TestDiffusionSpatialParams)); //SET_TYPE_PROP(FVMPFAOVelocity2PTestProblem, LinearSolver, ILUnBiCGSTABBackend<TypeTag>); SET_TYPE_PROP(FVMPFAOVelocity2PTestProblem, LinearSolver, SSORBiCGSTABBackend<TypeTag>); -SET_INT_PROP(FVMPFAOVelocity2PTestProblem, LinearSolverPreconditionerIterations, 2); SET_TYPE_PROP(FVMPFAOVelocity2PTestProblem, Problem, TestDiffusionProblem<TypeTag>); // Set the grid type SET_TYPE_PROP(FVMPFAOVelocity2PTestProblem, Grid, Dune::YaspGrid<2>); @@ -128,7 +124,7 @@ SET_PROP(FVMPFAOVelocity2PTestProblem, WettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; // Set the non-wetting phase @@ -137,11 +133,9 @@ SET_PROP(FVMPFAOVelocity2PTestProblem, NonwettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; -// Enable gravity -SET_BOOL_PROP(FVMPFAOVelocity2PTestProblem, ProblemEnableGravity, false); // set the types for the mimetic FD method NEW_TYPE_TAG(MimeticPressure2PTestProblem, INHERITS_FROM(MimeticPressureTwoP, TestDiffusionSpatialParams)); @@ -160,7 +154,7 @@ SET_PROP(MimeticPressure2PTestProblem, WettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; // Set the non-wetting phase @@ -169,12 +163,9 @@ SET_PROP(MimeticPressure2PTestProblem, NonwettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; -// Enable gravity -SET_BOOL_PROP(MimeticPressure2PTestProblem, ProblemEnableGravity, false); - } /*! @@ -221,9 +212,11 @@ public: typedef typename SolutionTypes::PrimaryVariables PrimaryVariables; typedef typename SolutionTypes::ScalarSolution ScalarSolution; - TestDiffusionProblem(const GridView &gridView, const Scalar delta = 1.0) : - ParentType(gridView), delta_(delta), velocity_(*this) - {} + TestDiffusionProblem(const GridView &gridView) : + ParentType(gridView), velocity_(*this) + { + delta_ = getParam<Scalar>("Problem.Delta", 1e-3); + } //!for this specific problem: initialize the saturation and afterwards the model void init() diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh index cf29d0bc1c7a5f83f19ce4e029c1624c6a4ce860..dc145b3df1ae1c90fd92d28dc0cab7718a6dd0ce 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh @@ -22,7 +22,7 @@ #ifndef DUMUX_TEST_DIFFUSION_3D_PROBLEM_HH #define DUMUX_TEST_DIFFUSION_3D_PROBLEM_HH -#include <dumux/material/components/unit.hh> +#include <dumux/material/components/constant.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/cellcentered/pressureproperties.hh> #include <dumux/porousmediumflow/2p/sequential/diffusion/mpfa/lmethod/3dpressureproperties.hh> @@ -65,7 +65,7 @@ SET_PROP(DiffusionTestProblem, WettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; // Set the non-wetting phase @@ -74,7 +74,7 @@ SET_PROP(DiffusionTestProblem, NonwettingPhase) private: typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar; public: - typedef FluidSystems::LiquidPhase<Scalar, Unit<Scalar> > type; + typedef FluidSystems::LiquidPhase<Scalar, Components::Constant<1, Scalar> > type; }; #if HAVE_SUPERLU diff --git a/test/porousmediumflow/2p/sequential/CMakeLists.txt b/test/porousmediumflow/2p/sequential/CMakeLists.txt index a6fbdba7735fa8b9dbedb63288789faaff09f0bb..987d95893861dda5687c9e7954befe1a61d8801e 100644 --- a/test/porousmediumflow/2p/sequential/CMakeLists.txt +++ b/test/porousmediumflow/2p/sequential/CMakeLists.txt @@ -1,114 +1,129 @@ add_input_file_links() -add_dumux_test(test_impes test_impes test_impes.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_impes-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_impes-00008.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_impes") - -add_dumux_test(test_impesadaptive test_impesadaptive test_impesadaptive.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_2padaptive-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_2padaptive-00006.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_impesadaptive") - -add_dumux_test(test_impesadaptiverestart test_impesadaptiverestart test_impesadaptiverestart.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_2padaptive-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_2padaptive-00006.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_impesadaptiverestart") +dune_add_test(NAME test_impes + SOURCES test_impes.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_impes-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_impes-00008.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_impes") + +dune_add_test(NAME test_impesadaptive + SOURCES test_impesadaptive.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_2padaptive-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_2padaptive-00006.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_impesadaptive") + +dune_add_test(NAME test_impesadaptiverestart + SOURCES test_impesadaptiverestart.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_2padaptive-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_2padaptive-00006.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_impesadaptiverestart") # the restart test has to run after the test that produces the restart file set_tests_properties(test_impesadaptiverestart PROPERTIES DEPENDS test_impesadaptive) if(MPI_FOUND) - add_dumux_test(test_impeswithamg test_impeswithamg test_impeswithamg.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_impes-reference-parallel.vtu - ${CMAKE_CURRENT_BINARY_DIR}/s0002-p0001-test_impeswithamg-00093.vtu - --command "${MPIEXEC} -np 2 ${CMAKE_CURRENT_BINARY_DIR}/test_impeswithamg -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_impeswithamg.input -TimeManager.TEnd 7e7") + dune_add_test(NAME test_impeswithamg + SOURCES test_impeswithamg.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_impes-reference-parallel.vtu + ${CMAKE_CURRENT_BINARY_DIR}/s0002-p0001-test_impeswithamg-00093.vtu + --command "${MPIEXEC} -np 2 ${CMAKE_CURRENT_BINARY_DIR}/test_impeswithamg -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_impeswithamg.input -TimeManager.TEnd 7e7") else() - add_dumux_test(test_impeswithamg test_impeswithamg test_impeswithamg.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_impes-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_impeswithamg-00008.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_impeswithamg") + dune_add_test(NAME test_impeswithamg + SOURCES test_impeswithamg.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_impes-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_impeswithamg-00008.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_impeswithamg") endif() -add_dumux_test(test_transport test_transport test_transport.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_transport-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_transport-00005.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_transport") - -add_dumux_test(test_mpfao2p test_mpfa2p test_mpfa2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_mpfao2p-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p-00006.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_mpfa2p.input -ModelType MPFAO") - -add_dumux_test(test_mpfal2p test_mpfa2p test_mpfa2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_mpfal2p-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p-00006.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_mpfa2p.input -ModelType MPFAL") - -add_dumux_test(test_mpfal2padaptive test_mpfa2p test_mpfa2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_mpfal2padaptive-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p-00006.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_mpfa2p.input -ModelType MPFALAdaptive") - -add_dumux_test(test_3d2pfv test_3d2pfv test_3d2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pfv-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfv-00011.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfv -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pfv -ModelType FV") - -add_dumux_test(test_3d2pfvadaptive test_3d2pfvadaptive test_3d2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pfvadaptive-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfvadaptive-00011.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfvadaptive -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pfvadaptive -ModelType FVAdaptive") - -add_dumux_test(test_3d2pmimetic test_3d2pmimetic test_3d2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmimetic-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimetic-00011.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimetic -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmimetic -ModelType Mimetic") - -add_dumux_test(test_3d2pmimeticadaptive test_3d2pmimeticadaptive test_3d2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmimeticadaptive-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimeticadaptive-00011.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimeticadaptive -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmimeticadaptive -ModelType MimeticAdaptive") - -add_dumux_test(test_3d2pmpfal test_3d2pmpfal test_3d2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmpfal-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfal-00011.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfal -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmpfal -ModelType MPFAL") - -add_dumux_test(test_3d2pmpfaladaptive test_3d2pmpfaladaptive test_3d2p.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmpfaladaptive-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfaladaptive-00011.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfaladaptive -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmpfaladaptive -ModelType MPFALAdaptive") +dune_add_test(NAME test_transport + SOURCES test_transport.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_transport-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_transport-00005.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_transport") + +dune_add_test(NAME test_mpfao2p + SOURCES test_mpfa2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_mpfao2p-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p-00006.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_mpfa2p.input -ModelType MPFAO") + +dune_add_test(NAME test_mpfal2p + SOURCES test_mpfa2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_mpfal2p-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p-00006.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_mpfa2p.input -ModelType MPFAL") + +dune_add_test(NAME test_mpfal2padaptive + SOURCES test_mpfa2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_mpfal2padaptive-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p-00006.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_mpfa2p -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_mpfa2p.input -ModelType MPFALAdaptive") + +dune_add_test(NAME test_3d2pfv + SOURCES test_3d2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pfv-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfv-00011.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfv -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pfv -ModelType FV") + +dune_add_test(NAME test_3d2pfvadaptive + SOURCES test_3d2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pfvadaptive-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfvadaptive-00011.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pfvadaptive -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pfvadaptive -ModelType FVAdaptive") + +dune_add_test(NAME test_3d2pmimetic + SOURCES test_3d2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmimetic-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimetic-00011.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimetic -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmimetic -ModelType Mimetic") + +dune_add_test(NAME test_3d2pmimeticadaptive + SOURCES test_3d2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmimeticadaptive-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimeticadaptive-00011.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmimeticadaptive -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmimeticadaptive -ModelType MimeticAdaptive") + +dune_add_test(NAME test_3d2pmpfal + SOURCES test_3d2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmpfal-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfal-00011.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfal -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmpfal -ModelType MPFAL") + +dune_add_test(NAME test_3d2pmpfaladaptive + SOURCES test_3d2p.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_3d2pmpfaladaptive-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfaladaptive-00011.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_3d2pmpfaladaptive -ParameterFile ${CMAKE_CURRENT_SOURCE_DIR}/test_3d2p.input -Problem.OutputName test_3d2pmpfaladaptive -ModelType MPFALAdaptive") #install sources install(FILES diff --git a/test/porousmediumflow/2p/sequential/test_3d2p.cc b/test/porousmediumflow/2p/sequential/test_3d2p.cc index ba5e520b9374238e44e2681db25aba7480082f73..86e92948cb1bd298f50e26b994d361946f7c1bad 100644 --- a/test/porousmediumflow/2p/sequential/test_3d2p.cc +++ b/test/porousmediumflow/2p/sequential/test_3d2p.cc @@ -68,22 +68,14 @@ int main(int argc, char** argv) using namespace Dumux; try { + auto defaultParams = [] (Dune::ParameterTree& p) {GET_PROP(TTAG(ThreeDTwoPTestProblem), ModelDefaultParameters)::defaultParams(p);}; + Parameters::init(argc, argv, defaultParams, usage); - Dune::ParameterTree paramTree; - // if the user just wanted to see the help / usage message show usage and stop program - if(!ParameterParser::parseCommandLineArguments(argc, argv, paramTree, usage)) - { - usage(argv[0], defaultUsageMessage(argv[0])); - return 0; - } - - const std::string modelType(paramTree.get<std::string>("ModelType", "MPFAL")); + const auto modelType = getParam<std::string>("ModelType", "MPFAL"); if (modelType == "FV") { using ProblemTypeTag = TTAG(FVTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Standard finite volume TPFA model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -92,8 +84,6 @@ int main(int argc, char** argv) else if (modelType == "FVAdaptive") { using ProblemTypeTag = TTAG(FVAdaptiveTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Adapative finite volume TPFA model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -102,8 +92,6 @@ int main(int argc, char** argv) else if (modelType == "MPFAL") { using ProblemTypeTag = TTAG(MPFALTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Standard finite volume MPFA-L model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -112,8 +100,6 @@ int main(int argc, char** argv) else if (modelType == "MPFALAdaptive") { using ProblemTypeTag = TTAG(MPFALAdaptiveTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Adapative finite volume MPFA-L model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -123,8 +109,6 @@ int main(int argc, char** argv) else if (modelType == "Mimetic") { using ProblemTypeTag = TTAG(MimeticTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Standard mimetic finite difference model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -133,8 +117,6 @@ int main(int argc, char** argv) else if (modelType == "MimeticAdaptive") { using ProblemTypeTag = TTAG(MimeticAdaptiveTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Adaptive mimetic finite difference model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -144,8 +126,6 @@ int main(int argc, char** argv) else { using ProblemTypeTag = TTAG(MPFALTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Unknown model type " << modelType << ", default to" << std::endl; std::cout<<"Standard finite volume MPFA-L model" << std::endl; diff --git a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh index bad603a222f1323511d8f002caade0af00fc268b..619b7833a408e5e5c0b77383afb23aafa70aa63c 100644 --- a/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_3d2pproblem.hh @@ -54,7 +54,7 @@ class Test3D2PProblem; ////////// namespace Properties { -NEW_TYPE_TAG(ThreeDTwoPTestProblem, INHERITS_FROM(Test3d2pSpatialParams)); +NEW_TYPE_TAG(ThreeDTwoPTestProblem, INHERITS_FROM(SequentialModel, Test3d2pSpatialParams)); // Set the grid type #if HAVE_DUNE_ALUGRID @@ -169,7 +169,6 @@ typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; typedef Dune::FieldVector<Scalar, dim> LocalPosition; typedef typename GET_PROP_TYPE(TypeTag, GridCreator) GridCreator; -typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree; public: @@ -179,7 +178,7 @@ ParentType(timeManager, gridView), inflowEdge_(0), outflowEdge_(0) this->setGrid(GridCreator::grid()); int refinementFactor = 0; - if (ParameterTree::tree().hasKey("Grid.RefinementFactor") && !GET_PROP_VALUE(TypeTag, AdaptiveGrid)) + if (haveParam("Grid.RefinementFactor") && !GET_PROP_VALUE(TypeTag, AdaptiveGrid)) { refinementFactor = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, RefinementFactor); this->grid().globalRefine(refinementFactor); @@ -206,14 +205,14 @@ ParentType(timeManager, gridView), inflowEdge_(0), outflowEdge_(0) } int outputInterval = 0; - if (ParameterTree::tree().hasKey("Problem.OutputInterval")) + if (haveParam("Problem.OutputInterval")) { outputInterval = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, int, Problem, OutputInterval); } this->setOutputInterval(outputInterval); Scalar outputTimeInterval = 1e6; - if (ParameterTree::tree().hasKey("Problem.OutputTimeInterval")) + if (haveParam("Problem.OutputTimeInterval")) { outputTimeInterval = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, OutputTimeInterval); } @@ -232,7 +231,7 @@ ParentType(timeManager, gridView), inflowEdge_(0), outflowEdge_(0) */ std::string name() const { - if (ParameterTree::tree().hasKey("Problem.OutputName")) + if (haveParam("Problem.OutputName")) return GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Problem, OutputName); else return "test_3d2p"; diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptive.input b/test/porousmediumflow/2p/sequential/test_impesadaptive.input index eb405ebe4501d8bc89b90805229a7c1cf9b72724..9949efaa394e1612a39a89786a3c31b35a784d60 100644 --- a/test/porousmediumflow/2p/sequential/test_impesadaptive.input +++ b/test/porousmediumflow/2p/sequential/test_impesadaptive.input @@ -4,6 +4,7 @@ DtInitial = 0 # [s] [Problem] Name = test_2padaptive # name passed to the output routines +EnableGravity = 0 [Grid] Cells = 2 1 diff --git a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh index 2f61a59e981ae1f898c7e9af5fa9adc6f483e875..73589ab0382dc6f7be447295751aff150fc9de11 100644 --- a/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_impesadaptiveproblem.hh @@ -82,9 +82,6 @@ public: typedef FluidSystems::LiquidPhase<Scalar, SimpleH2O<Scalar> > type; }; -// Enable gravity -SET_BOOL_PROP(TestIMPESAdaptiveProblem, ProblemEnableGravity, false); - //SET_BOOL_PROP(TestIMPESAdaptiveProblem, EnableCompressibility, true); //SET_TYPE_PROP(TestIMPESAdaptiveProblem, EvalCflFluxFunction, EvalCflFluxCoats<TypeTag>); @@ -150,9 +147,7 @@ public: // Refine the grid provided that no restart occurs. Otherwise, an // already refined grid will be read. - typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree; - if (!(ParameterTree::tree().hasKey("Restart") - || ParameterTree::tree().hasKey("TimeManager.Restart"))) + if (!(haveParam("Restart") || haveParam("TimeManager.Restart"))) { GridCreator::grid().globalRefine(GET_PARAM_FROM_GROUP(TypeTag, int, GridAdapt, MaxLevel)); } @@ -234,7 +229,7 @@ public: values = 0; if (globalPos[0] < eps_) { - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) { Scalar pRef = referencePressureAtPos(globalPos); Scalar temp = temperatureAtPos(globalPos); diff --git a/test/porousmediumflow/2p/sequential/test_impesproblem.hh b/test/porousmediumflow/2p/sequential/test_impesproblem.hh index 5fba7a84e4e815e1f88c34c851fdcaa16853e965..62edc9bf1908942ff1bc4fe0ed9c00a5727b0029 100644 --- a/test/porousmediumflow/2p/sequential/test_impesproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_impesproblem.hh @@ -242,7 +242,7 @@ void dirichletAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) c values = 0; if (globalPos[0] < eps_) { - if (GET_PARAM_FROM_GROUP(TypeTag, bool, Problem, EnableGravity)) + if (getParam<bool>("Problem.EnableGravity")) { Scalar pRef = referencePressureAtPos(globalPos); Scalar temp = temperatureAtPos(globalPos); diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2p.cc b/test/porousmediumflow/2p/sequential/test_mpfa2p.cc index 6dea810ad3459e7a0ed5a575c01d1a9bb300d148..c7372668eff9a78b949115cc6dc3f3a334fe9d91 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2p.cc +++ b/test/porousmediumflow/2p/sequential/test_mpfa2p.cc @@ -59,22 +59,14 @@ int main(int argc, char** argv) using namespace Dumux; try { + auto defaultParams = [] (Dune::ParameterTree& p) {GET_PROP(TTAG(MPFATwoPTestProblem), ModelDefaultParameters)::defaultParams(p);}; + Parameters::init(argc, argv, defaultParams, usage); - Dune::ParameterTree paramTree; - // if the user just wanted to see the help / usage message show usage and stop program - if(!ParameterParser::parseCommandLineArguments(argc, argv, paramTree, usage)) - { - usage(argv[0], defaultUsageMessage(argv[0])); - return 0; - } - - const std::string modelType(paramTree.get<std::string>("ModelType", "MPFAL")); + const auto modelType = getParam<std::string>("ModelType", "MPFAL"); if (modelType == "FV") { using ProblemTypeTag = TTAG(FVTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Standard finite volume TPFA model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -83,8 +75,6 @@ int main(int argc, char** argv) else if (modelType == "FVAdaptive") { using ProblemTypeTag = TTAG(FVAdaptiveTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Adaptive finite volume TPFA model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -93,8 +83,6 @@ int main(int argc, char** argv) else if (modelType == "MPFAO") { using ProblemTypeTag = TTAG(MPFAOTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Standard finite volume MPFA-O model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -103,8 +91,6 @@ int main(int argc, char** argv) else if (modelType == "MPFAL") { using ProblemTypeTag = TTAG(MPFALTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Unknown model type " << modelType << ", default to" << std::endl; std::cout<<"Standard finite volume MPFA-L model" << std::endl; @@ -114,8 +100,6 @@ int main(int argc, char** argv) else if (modelType == "MPFALAdaptive") { using ProblemTypeTag = TTAG(MPFALAdaptiveTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Adaptive finite volume MPFA-L model" << std::endl; std::cout<<"##########################################" << std::endl; @@ -124,8 +108,6 @@ int main(int argc, char** argv) else { using ProblemTypeTag = TTAG(MPFAOTwoPTestProblem); - // avoid unused parameter message - GET_PROP(ProblemTypeTag, ParameterTree)::runTimeParams()["ModelType"] = modelType; std::cout<<"##########################################" << std::endl; std::cout<<"Unknown model type " << modelType << ", default to" << std::endl; std::cout<<"Standard finite volume MPFA-O model" << std::endl; diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2p.input b/test/porousmediumflow/2p/sequential/test_mpfa2p.input index bf2ed325e098cb2bd9186201b6363bf484a62f31..914ef1b114f3f0104f0274db863ad4f39fe4ef8f 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2p.input +++ b/test/porousmediumflow/2p/sequential/test_mpfa2p.input @@ -10,6 +10,7 @@ UpperRight = 20 10 ClosureType = None [Problem] +#EnableGravity = false # set in case of McWhorter or Buckley-Leverett OutputInterval =0 OutputTimeInterval = 1e4 diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh index 3ff1f29c3968615490a4e01d97aa598b140e4764..08022ba012574014cd29cc21f0dc5ca0c5cde6fd 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh @@ -56,7 +56,7 @@ class MPFATwoPTestProblem; namespace Properties { -NEW_TYPE_TAG(MPFATwoPTestProblem, INHERITS_FROM(Test2PSpatialParams)); +NEW_TYPE_TAG(MPFATwoPTestProblem, INHERITS_FROM(SequentialModel, Test2PSpatialParams)); // Set the grid type #if HAVE_UG @@ -101,13 +101,6 @@ public: SET_INT_PROP(MPFATwoPTestProblem, Formulation, SequentialTwoPCommonIndices::pnsw); #endif -#if PROBLEM == 2 -// Enable gravity -SET_BOOL_PROP(MPFATwoPTestProblem, ProblemEnableGravity, true); -#else -SET_BOOL_PROP(MPFATwoPTestProblem, ProblemEnableGravity, false); -#endif - SET_TYPE_PROP(MPFATwoPTestProblem, EvalCflFluxFunction, EvalCflFluxCoats<TypeTag>); SET_SCALAR_PROP(MPFATwoPTestProblem, ImpetCFLFactor, 1.0); SET_TYPE_PROP(MPFATwoPTestProblem, AdaptionIndicator, GridAdaptionIndicator2PLocal<TypeTag>); @@ -161,7 +154,6 @@ typedef typename GET_PROP(TypeTag, SolutionTypes) SolutionTypes; typedef typename SolutionTypes::PrimaryVariables PrimaryVariables; typedef typename GET_PROP_TYPE(TypeTag, GridCreator) GridCreator; -typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree; enum { @@ -196,7 +188,7 @@ ParentType(timeManager, gridView) this->setGrid(GridCreator::grid()); int refinementFactor = 0; - if (ParameterTree::tree().hasKey("Grid.RefinementFactor")) + if (haveParam("Grid.RefinementFactor")) { refinementFactor = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Grid, RefinementFactor); } @@ -204,7 +196,7 @@ ParentType(timeManager, gridView) this->grid().globalRefine(refinementFactor); Scalar inletWidth = 1.0; - if (ParameterTree::tree().hasKey("Problem.InletWidth")) + if (haveParam("Problem.InletWidth")) { inletWidth = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, InletWidth); } @@ -217,20 +209,20 @@ ParentType(timeManager, gridView) inletRightCoord_[0] +=0.5*inletWidth; inFlux_ = 1e-4; - if (ParameterTree::tree().hasKey("Problem.InjectionFlux")) + if (haveParam("Problem.InjectionFlux")) { inFlux_ = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, InjectionFlux); } int outputInterval = 0; - if (ParameterTree::tree().hasKey("Problem.OutputInterval")) + if (haveParam("Problem.OutputInterval")) { outputInterval = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, int, Problem, OutputInterval); } this->setOutputInterval(outputInterval); Scalar outputTimeInterval = 1e6; - if (ParameterTree::tree().hasKey("Problem.OutputTimeInterval")) + if (haveParam("Problem.OutputTimeInterval")) { outputTimeInterval = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, Problem, OutputTimeInterval); } @@ -272,7 +264,7 @@ void addOutputVtkFields() */ std::string name() const { - if (ParameterTree::tree().hasKey("Problem.OutputFileName")) + if (haveParam("Problem.OutputFileName")) return GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, std::string, Problem, OutputFileName); else return "test_mpfa2p"; diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh index 18afeb4fbf2bfccdb2da59129f0b5bb1600448ea..00cbf152cbe8ad5bf3e4d65bb66c99d9b80e6741 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh +++ b/test/porousmediumflow/2p/sequential/test_mpfa2pspatialparams.hh @@ -73,8 +73,6 @@ class Test2PSpatialParams: public FVSpatialParams<TypeTag> typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition; typedef Dune::FieldMatrix<Scalar, dim, dim> FieldMatrix; - typedef typename GET_PROP(TypeTag, ParameterTree) ParameterTree; - public: typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; typedef typename MaterialLaw::Params MaterialLawParams; @@ -157,13 +155,13 @@ public: // entry pressures function materialLawParamsBackground_.setPe(0.); - if (ParameterTree::tree().hasKey("SpatialParams.BackgroundEntryPressure")) + if (haveParam("SpatialParams.BackgroundEntryPressure")) { materialLawParamsBackground_.setPe(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, BackgroundEntryPressure)); } materialLawParamsLenses_.setPe(0.); - if (ParameterTree::tree().hasKey("SpatialParams.LenseEntryPressure")) + if (haveParam("SpatialParams.LenseEntryPressure")) { materialLawParamsLenses_.setPe(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, LenseEntryPressure)); } @@ -173,12 +171,12 @@ public: #if PROBLEM == 2 materialLawParamsBackground_.setLambda(3); - if (ParameterTree::tree().hasKey("SpatialParams.BackgroundLambda")) + if (haveParam("SpatialParams.BackgroundLambda")) { materialLawParamsBackground_.setLambda(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, BackgroundLambda)); } materialLawParamsLenses_.setLambda(2); - if (ParameterTree::tree().hasKey("SpatialParams.LenseLambda")) + if (haveParam("SpatialParams.LenseLambda")) { materialLawParamsLenses_.setLambda(GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, LenseLambda)); } @@ -201,71 +199,71 @@ public: #if PROBLEM == 2 - if (ParameterTree::tree().hasKey("SpatialParams.BackgroundPermeabilityXX")) + if (haveParam("SpatialParams.BackgroundPermeabilityXX")) { permBackground_[0][0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, BackgroundPermeabilityXX); } - if (ParameterTree::tree().hasKey("SpatialParams.BackgroundPermeabilityXY")) + if (haveParam("SpatialParams.BackgroundPermeabilityXY")) { permBackground_[0][1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, BackgroundPermeabilityXY); } - if (ParameterTree::tree().hasKey("SpatialParams.BackgroundPermeabilityYX")) + if (haveParam("SpatialParams.BackgroundPermeabilityYX")) { permBackground_[1][0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, BackgroundPermeabilityYX); } - if (ParameterTree::tree().hasKey("SpatialParams.BackgroundPermeabilityYY")) + if (haveParam("SpatialParams.BackgroundPermeabilityYY")) { permBackground_[1][1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, BackgroundPermeabilityYY); } - if (ParameterTree::tree().hasKey("SpatialParams.LensPermeabilityXX")) + if (haveParam("SpatialParams.LensPermeabilityXX")) { permLenses_[0][0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, LensPermeabilityXX); } - if (ParameterTree::tree().hasKey("SpatialParams.LensPermeabilityXY")) + if (haveParam("SpatialParams.LensPermeabilityXY")) { permLenses_[0][1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, LensPermeabilityXY); } - if (ParameterTree::tree().hasKey("SpatialParams.LensPermeabilityYX")) + if (haveParam("SpatialParams.LensPermeabilityYX")) { permLenses_[1][0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, LensPermeabilityYX); } - if (ParameterTree::tree().hasKey("SpatialParams.LensPermeabilityYY")) + if (haveParam("SpatialParams.LensPermeabilityYY")) { permLenses_[1][1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, Scalar, SpatialParams, LensPermeabilityYY); } - if (ParameterTree::tree().hasKey("SpatialParams.LensOneLowerLeft")) + if (haveParam("SpatialParams.LensOneLowerLeft")) { lensOneLowerLeft_[0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensOneLowerLeft)[0]; lensOneLowerLeft_[1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensOneLowerLeft)[1]; } - if (ParameterTree::tree().hasKey("SpatialParams.LensOneUpperRight")) + if (haveParam("SpatialParams.LensOneUpperRight")) { lensOneUpperRight_[0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensOneUpperRight)[0]; lensOneUpperRight_[1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensOneUpperRight)[1]; } - if (ParameterTree::tree().hasKey("SpatialParams.LensTwoLowerLeft")) + if (haveParam("SpatialParams.LensTwoLowerLeft")) { lensTwoLowerLeft_[0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensTwoLowerLeft)[0]; lensTwoLowerLeft_[1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensTwoLowerLeft)[1]; } - if (ParameterTree::tree().hasKey("SpatialParams.LensTwoUpperRight")) + if (haveParam("SpatialParams.LensTwoUpperRight")) { lensTwoUpperRight_[0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensTwoUpperRight)[0]; lensTwoUpperRight_[1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensTwoUpperRight)[1]; } - if (ParameterTree::tree().hasKey("SpatialParams.LensThreeLowerLeft")) + if (haveParam("SpatialParams.LensThreeLowerLeft")) { lensThreeLowerLeft_[0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensThreeLowerLeft)[0]; lensThreeLowerLeft_[1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensThreeLowerLeft)[1]; } - if (ParameterTree::tree().hasKey("SpatialParams.LensThreeUpperRight")) + if (haveParam("SpatialParams.LensThreeUpperRight")) { lensThreeUpperRight_[0] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensThreeUpperRight)[0]; lensThreeUpperRight_[1] = GET_RUNTIME_PARAM_FROM_GROUP(TypeTag, GlobalPosition, SpatialParams, LensThreeUpperRight)[1]; diff --git a/test/porousmediumflow/2p2c/sequential/CMakeLists.txt b/test/porousmediumflow/2p2c/sequential/CMakeLists.txt index f5e672f64952a73f0077a4a9574a8dab658bf941..4c1baf127cf53dc4ddf6fe24e51571d368cd013b 100644 --- a/test/porousmediumflow/2p2c/sequential/CMakeLists.txt +++ b/test/porousmediumflow/2p2c/sequential/CMakeLists.txt @@ -1,32 +1,36 @@ add_input_file_links() -add_dumux_test(test_adaptive2p2c2d test_adaptive2p2c2d test_adaptive2p2c2d.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_adaptive2p2c2d-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c2d-00007.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c2d") +dune_add_test(NAME test_adaptive2p2c2d + SOURCES test_adaptive2p2c2d.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_adaptive2p2c2d-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c2d-00007.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c2d") -add_dumux_test(test_adaptive2p2c3d test_adaptive2p2c3d test_adaptive2p2c3d.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_adaptive2p2c3d-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c3d-00011.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c3d") +dune_add_test(NAME test_adaptive2p2c3d + SOURCES test_adaptive2p2c3d.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_adaptive2p2c3d-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c3d-00011.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_adaptive2p2c3d") -add_dumux_test(test_dec2p2c test_dec2p2c test_dec2p2c.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_dec2p2c-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_dec2p2c-00020.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_dec2p2c") +dune_add_test(NAME test_dec2p2c + SOURCES test_dec2p2c.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_dec2p2c-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_dec2p2c-00020.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_dec2p2c") -add_dumux_test(test_multiphysics2p2c test_multiphysics2p2c test_multiphysics2p2c.cc - python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py - --script fuzzy - --files ${CMAKE_SOURCE_DIR}/test/references/test_multiphysics2p2c-reference.vtu - ${CMAKE_CURRENT_BINARY_DIR}/test_multiphysics2p2c-00020.vtu - --command "${CMAKE_CURRENT_BINARY_DIR}/test_multiphysics2p2c") +dune_add_test(NAME test_multiphysics2p2c + SOURCES test_multiphysics2p2c.cc + COMMAND python ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_multiphysics2p2c-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_multiphysics2p2c-00020.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_multiphysics2p2c") #install sources install(FILES diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2d.input b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2d.input index 830c1289b681a26c51be4374b8e6b7bf4756ca7b..abc921881177b2b191cecf8eadd63469460e31cf 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2d.input +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2d.input @@ -25,3 +25,5 @@ Cells = 10 10 # [-] level 0 resolution in x- and y-direction UpperRight = 10 10# [m] dimension of the grid ClosureType = None +[Vtk] +OutputLevel = 2 diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3d.input b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3d.input index 6781b6d0a5a665bd24207ab6a59359f443015e42..ea0c1f6b5b1c7877550db8160c9d3d4f9ffaeb58 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3d.input +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3d.input @@ -26,4 +26,8 @@ OutputInterval = 5 [TimeManager] TEnd= 3e3 #Simulated time -DtInitial = 500 #Initial time step +DtInitial = 500 #Initial time step + +[Vtk] +OutputLevel = 2 + diff --git a/test/porousmediumflow/2p2c/sequential/test_dec2p2c.input b/test/porousmediumflow/2p2c/sequential/test_dec2p2c.input index e3d8b7dca20c6a396cc447b9cf98f8ff8f7eb998..7802aaf11940cf2c1e3147badc5213be002522e2 100644 --- a/test/porousmediumflow/2p2c/sequential/test_dec2p2c.input +++ b/test/porousmediumflow/2p2c/sequential/test_dec2p2c.input @@ -10,3 +10,6 @@ UpperRight = 10 10 10 # [m] length, width and height of the domain [Impet] CFLFactor = 0.8 +[Vtk] +OutputLevel = 2 + diff --git a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2c.cc b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2c.cc index fd955f4651a5a7d115a09b9877c3d604cba6e363..419911c18ebf2f972408dde9cf4c710339d16b5f 100644 --- a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2c.cc +++ b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2c.cc @@ -36,7 +36,7 @@ //////////////////////// // the main function //////////////////////// -void usage(const char *progname) +void usage(const char *progname, const std::string &errorMsg = "") { std::cout << "usage: " << progname << " [--restart restartTime] tEnd firstDt\n"; exit(1); @@ -55,6 +55,9 @@ int main(int argc, char** argv) // initialize MPI, finalize is done automatically on exit Dune::MPIHelper::instance(argc, argv); + auto defaultParams = [] (Dune::ParameterTree& p) {GET_PROP(TypeTag, ModelDefaultParameters)::defaultParams(p);}; + Dumux::Parameters::init(argc, argv, defaultParams, usage); + //////////////////////////////////////////////////////////// // parse the command line arguments //////////////////////////////////////////////////////////// diff --git a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2c.input b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2c.input new file mode 100644 index 0000000000000000000000000000000000000000..a68b7055b4a4110789e4aff5746dc781f0199f0e --- /dev/null +++ b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2c.input @@ -0,0 +1,3 @@ +[Vtk] +OutputLevel = 2 + diff --git a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh index fceb88767f9ae3605550eaa5d99873a433ac4690..f4e6ec38d496f5ef882f920843d7fa1246c6838a 100644 --- a/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_multiphysics2p2cproblem.hh @@ -73,8 +73,6 @@ SET_PROP(TestMultTwoPTwoCProblem, Components) : public GET_PROP(TypeTag, Default typedef Dumux::H2O<Scalar> H2O; }; -// Enable gravity -SET_BOOL_PROP(TestMultTwoPTwoCProblem, ProblemEnableGravity, true); SET_BOOL_PROP(TestMultTwoPTwoCProblem, EnableCapillarity, true); SET_INT_PROP(TestMultTwoPTwoCProblem, BoundaryMobility, GET_PROP_TYPE(TypeTag, Indices)::satDependent); SET_SCALAR_PROP(TestMultTwoPTwoCProblem, ImpetCFLFactor, 0.8); diff --git a/tutorial/tutorial_sequential.input b/tutorial/tutorial_sequential.input index c435ae28a5e72c1b565ee0adadc6908d5f741135..8c6ea05c98edaf199ca527b4af1ad58fba2d492b 100644 --- a/tutorial/tutorial_sequential.input +++ b/tutorial/tutorial_sequential.input @@ -2,6 +2,9 @@ TEnd = 100000 # duration of the simulation [s] DtInitial = 10 # initial time step size [s] +[Problem] +EnableGravity = 0 + [Grid] UpperRight = 300 60 # x-/y-coordinate of the upper-right corner of the grid [m] Cells = 100 1 # x-/y-resolution of the grid diff --git a/tutorial/tutorialproblem_sequential.hh b/tutorial/tutorialproblem_sequential.hh index 2402a4c2dba6a22fbcc8912039beaff6e138cef4..25ce29bac9d153eabb5b61277bee61c8e4476dc6 100644 --- a/tutorial/tutorialproblem_sequential.hh +++ b/tutorial/tutorialproblem_sequential.hh @@ -83,9 +83,6 @@ public: SET_TYPE_PROP(TutorialProblemSequential, EvalCflFluxFunction, EvalCflFluxCoats<TypeTag>); /*@\label{tutorial-sequential:cflflux}@*/ SET_SCALAR_PROP(TutorialProblemSequential, ImpetCFLFactor, 0.95); /*@\label{tutorial-sequential:cflfactor}@*/ - -// Disable gravity -SET_BOOL_PROP(TutorialProblemSequential, ProblemEnableGravity, false); /*@\label{tutorial-sequential:gravity}@*/ } /*@\label{tutorial-sequential:propertysystem-end}@*/ /*! \ingroup SequentialProblems