diff --git a/dumux/linear/CMakeLists.txt b/dumux/linear/CMakeLists.txt index 938ef18ced7a07a6b44fbb487b4a456ff440c427..c8ce338dbc029c6e609463b284871fa8bb8ee5b3 100644 --- a/dumux/linear/CMakeLists.txt +++ b/dumux/linear/CMakeLists.txt @@ -4,7 +4,6 @@ install(FILES amgbackend.hh amgparallelhelpers.hh amgproperties.hh -impetbicgstabilu0solver.hh linearsolverproperties.hh pardisobackend.hh seqsolverbackend.hh diff --git a/dumux/linear/impetbicgstabilu0solver.hh b/dumux/linear/impetbicgstabilu0solver.hh deleted file mode 100644 index fb04c17830c142c230b845a544eddc17b1d8c927..0000000000000000000000000000000000000000 --- a/dumux/linear/impetbicgstabilu0solver.hh +++ /dev/null @@ -1,203 +0,0 @@ -// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -// vi: set et ts=4 sw=4 sts=4: -/***************************************************************************** - * See the file COPYING for full copying permissions. * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -/*! - * \file - * - * \brief Provides a linear solver for the stabilized BiCG method with - * an ILU-0 preconditioner. - */ -#ifndef DUMUX_BICGSTAB_ILU0_SOLVER_HH -#define DUMUX_BICGSTAB_ILU0_SOLVER_HH - -#include <dumux/common/propertysystem.hh> -#include <dune/istl/solvers.hh> -#include <dune/istl/preconditioners.hh> -#include <dumux/common/exceptions.hh> -#include <dumux/common/parameters.hh> - -#include <dumux/linear/elementborderlistfromgrid.hh> -#include <dumux/linear/linearsolverproperties.hh> -#include <dumux/linear/overlappingbcrsmatrix.hh> -#include <dumux/linear/overlappingblockvector.hh> -#include <dumux/linear/overlappingpreconditioner.hh> -#include <dumux/linear/overlappingscalarproduct.hh> -#include <dumux/linear/overlappingoperator.hh> - -namespace Dumux { -namespace Properties { -NEW_PROP_TAG(Problem); -NEW_PROP_TAG(PressureCoefficientMatrix); -NEW_PROP_TAG(PressureRHSVector); -NEW_PROP_TAG(SolutionTypes); -NEW_PROP_TAG(GridView); -NEW_PROP_TAG(LinearSolverVerbosity); -NEW_PROP_TAG(LinearSolverMaxIterations); -NEW_PROP_TAG(LinearSolverResidualReduction); -NEW_PROP_TAG(PreconditionerRelaxation); -} - -/*! - * \ingroup Linear - * \brief Provides a linear solver for the stabilized BiCG method with - * an ILU-0 preconditioner. - * - * This solver's intention is to be used in conjunction with cell centered finite volume (ccvf) - * methods, so it assumes that the cells are the only DOFs. - */ -template <class TypeTag> -class IMPETBiCGStabILU0Solver -{ - typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem; - typedef typename GET_PROP_TYPE(TypeTag, PressureCoefficientMatrix) Matrix; - typedef typename GET_PROP_TYPE(TypeTag, PressureRHSVector) Vector; - typedef typename GET_PROP(TypeTag, SolutionTypes) SolutionTypes; - typedef typename SolutionTypes::ElementMapper ElementMapper; - typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView; - - typedef Dumux::OverlappingBCRSMatrix<Matrix> OverlappingMatrix; - typedef typename OverlappingMatrix::Overlap Overlap; - typedef Dumux::OverlappingBlockVector<typename Vector::block_type, Overlap> OverlappingVector; - typedef Dune::SeqILU0<OverlappingMatrix, OverlappingVector, OverlappingVector> SeqPreconditioner; - //typedef Dune::SeqJac<OverlappingMatrix, OverlappingVector, OverlappingVector> SeqPreconditioner; - typedef Dumux::OverlappingPreconditioner<SeqPreconditioner, Overlap> OverlappingPreconditioner; - typedef Dumux::OverlappingScalarProduct<OverlappingVector, Overlap> OverlappingScalarProduct; - typedef Dumux::OverlappingOperator<OverlappingMatrix, OverlappingVector, OverlappingVector> OverlappingOperator; - typedef Dune::BiCGSTABSolver<OverlappingVector> Solver; - -public: - DUNE_DEPRECATED_MSG("Use ILU0BiCGSTABBackend/AMGBackend from seqsolverbackend.hh/amgbackend.hh instead") - IMPETBiCGStabILU0Solver(const Problem &problem, int overlapSize=1) - : problem_(problem) - , overlapSize_(overlapSize) - {} - - ~IMPETBiCGStabILU0Solver() - { cleanup_(); } - - /*! - * \brief Set the structure of the linear system of equations to be solved. - * - * This method allocates space an does the necessary - * communication before actually calling the solve() method. As - * long as the structure of the linear system does not change, the - * solve method can be called arbitrarily often. - */ - void setStructureMatrix(const Matrix &M) - { - cleanup_(); - prepare_(); - } - - /*! - * \brief Actually solve the linear system of equations. - * - * \return true if the residual reduction could be achieved, else false. - */ - bool solve(const Matrix &M, - Vector &x, - const Vector &b) - { - int verbosityLevel = GET_PARAM_FROM_GROUP(TypeTag, int, LinearSolver, Verbosity); - const int maxIter = GET_PARAM_FROM_GROUP(TypeTag, double, LinearSolver, MaxIterations); - const double residReduction = GET_PARAM_FROM_GROUP(TypeTag, double, LinearSolver, ResidualReduction); - const double relaxation = GET_PARAM_FROM_GROUP(TypeTag, double, LinearSolver, PreconditionerRelaxation); - - if (!overlapMatrix_) { - // make sure that the overlapping matrix and block vectors - // have been created - prepare_(M); - } - - // copy the values of the non-overlapping linear system of - // equations to the overlapping one. On ther border, we add up - // the values of all processes (using the assignAdd() methods) - overlapMatrix_->assignCopy(M); - overlapb_->assignAdd(b); - (*overlapx_) = 0.0; - - /* - overlapMatrix_->print(); - overlapb_->print(); - exit(1); - */ - - // create sequential and overlapping preconditioners - //SeqPreconditioner seqPreCond(*overlapMatrix_, 1, 1.0); - SeqPreconditioner seqPreCond(*overlapMatrix_, relaxation); - OverlappingPreconditioner preCond(seqPreCond, overlapMatrix_->overlap()); - - // create the scalar products and linear operators for ISTL - OverlappingScalarProduct scalarProd(overlapMatrix_->overlap()); - OverlappingOperator opA(*overlapMatrix_); - - // create the actual solver - Solver solver(opA, - scalarProd, - preCond, - residReduction, - maxIter , - verbosityLevel); - - // run the solver - Dune::InverseOperatorResult result; - solver.apply(*overlapx_, *overlapb_, result); - - // copy the result back to the non-overlapping vector - overlapx_->assignTo(x); - - // return the result of the solver - return result.converged; - } - -private: - void prepare_(const Matrix &M) - { - ElementBorderListFromGrid<GridView, ElementMapper> - borderListCreator(problem_.gridView(), problem_.elementMapper()); - - // create the overlapping Jacobian matrix - overlapMatrix_ = std::make_shared<OverlappingMatrix> (M, - borderListCreator.foreignBorderList(), - borderListCreator.domesticBorderList(), - overlapSize_); - - // create the overlapping vectors for the residual and the - // solution - overlapb_ = std::make_shared<OverlappingVector>(overlapMatrix_->overlap()); - overlapx_ = std::make_shared<OverlappingVector>(*overlapb_); - } - - void cleanup_() - { - overlapMatrix_.template reset<OverlappingMatrix>(0); - overlapb_.template reset<OverlappingVector>(0); - overlapx_.template reset<OverlappingVector>(0); - } - - const Problem &problem_; - - int overlapSize_; - std::shared_ptr<OverlappingMatrix> overlapMatrix_; - std::shared_ptr<OverlappingVector> overlapb_; - std::shared_ptr<OverlappingVector> overlapx_; -}; - -} // namespace Dumux - -#endif diff --git a/dumux/material/components/o2.hh b/dumux/material/components/o2.hh index a7eb173ab8c1e84007c300597b3600781a0d2a51..0511cceb926a3b8de898f5b0c8cbbbd3a59bb85f 100644 --- a/dumux/material/components/o2.hh +++ b/dumux/material/components/o2.hh @@ -94,7 +94,7 @@ public: * * R. Prydz (1972, pp. 1-4) \cite prydz1972 */ - static constexpr Scalar vaporPressure(Scalar T) + static Scalar vaporPressure(Scalar T) { if (T > criticalTemperature()) return criticalPressure(); @@ -166,7 +166,7 @@ public: * * See: R. Reid, et al. (1987, pp 154, 657, 665) \cite reid1987 */ - static constexpr Scalar gasEnthalpy(Scalar T, + static Scalar gasEnthalpy(Scalar T, Scalar pressure) { // method of Joback @@ -198,7 +198,7 @@ public: * * See: R. Reid, et al. (1987, pp 396-397, 664) \cite reid1987 */ - static constexpr Scalar gasViscosity(Scalar temperature, Scalar pressure) + static Scalar gasViscosity(Scalar temperature, Scalar pressure) { const Scalar Tc = criticalTemperature(); const Scalar Vc = 73.4; // critical specific volume [cm^3/mol] diff --git a/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh b/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh index c727bc160bee1dd4fbe8798c88c2155766dee34c..2f691010fa6ccce7e9c7ad9c28f642ab8b22cda6 100644 --- a/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh +++ b/dumux/porousmediumflow/2p2c/sequential/celldatamultiphysics.hh @@ -19,6 +19,7 @@ #ifndef DUMUX_ELEMENTDATA2P2C_MULTYPHYSICS_HH #define DUMUX_ELEMENTDATA2P2C_MULTYPHYSICS_HH +#include <dumux/material/fluidstates/pseudo1p2c.hh> #include "properties.hh" #include "celldata.hh" diff --git a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh index ccc426d9510d3b11d7cd999ebe57fd2bc006d144..810937e275222a9afe64688559e23fbeab719ff6 100644 --- a/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh +++ b/test/porousmediumflow/1p/sequential/test_diffusionproblem3d.hh @@ -51,8 +51,10 @@ NEW_TYPE_TAG(DiffusionTestProblem, INHERITS_FROM(SequentialTwoP, TestDiffusionSp // Set the grid type #if HAVE_DUNE_ALUGRID SET_TYPE_PROP(DiffusionTestProblem, Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>); -#else +#elif HAVE_UG SET_TYPE_PROP(DiffusionTestProblem, Grid, Dune::UGGrid<3>); +#else +SET_TYPE_PROP(DiffusionTestProblem, Grid, Dune::YaspGrid<3>); #endif SET_TYPE_PROP(DiffusionTestProblem, Problem, Dumux::TestDiffusion3DProblem<TypeTag>); diff --git a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh index 08cbe04e9e4251977477bd419731a4aa190b9239..165bdaf21dd6d6cb18a15c31f85ca7f2a8d6f17c 100644 --- a/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh +++ b/test/porousmediumflow/2p/sequential/test_mpfa2pproblem.hh @@ -59,7 +59,11 @@ namespace Properties NEW_TYPE_TAG(MPFATwoPTestProblem, INHERITS_FROM(Test2PSpatialParams)); // Set the grid type +#if HAVE_UG SET_TYPE_PROP(MPFATwoPTestProblem, Grid, Dune::UGGrid<2>); +#else +SET_TYPE_PROP(MPFATwoPTestProblem, Grid, Dune::YaspGrid<2>); +#endif // Set the problem property SET_TYPE_PROP(MPFATwoPTestProblem, Problem, Dumux::MPFATwoPTestProblem<TypeTag>); diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh index c1d1456f7713159d3e7b4ffa1560eae86200c4c8..902d8fcebddd92b937517365d76c21490c553b7c 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c2dproblem.hh @@ -45,7 +45,11 @@ namespace Properties NEW_TYPE_TAG(Adaptive2p2c2d, INHERITS_FROM(SequentialTwoPTwoCAdaptive,Test2P2CSpatialParams)); // Set the grid type +#if HAVE_UG SET_TYPE_PROP(Adaptive2p2c2d, Grid, Dune::UGGrid<2>); +#else +SET_TYPE_PROP(Adaptive2p2c2d, Grid, Dune::YaspGrid<3>); +#endif // Set the problem property SET_TYPE_PROP(Adaptive2p2c2d, Problem, Dumux::Adaptive2p2c2d<TTAG(Adaptive2p2c2d)>); diff --git a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh index 00f007870b5bf7360d2b42726272904804057987..0a3f5963f72b2a77e58f63fc340251d0998cf9c2 100644 --- a/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh +++ b/test/porousmediumflow/2p2c/sequential/test_adaptive2p2c3dproblem.hh @@ -44,7 +44,11 @@ namespace Properties NEW_TYPE_TAG(Adaptive2p2c3d, INHERITS_FROM(SequentialTwoPTwoCAdaptive,Test2P2CSpatialParams, MPFAProperties)); // Set the grid type +#if HAVE_UG SET_TYPE_PROP(Adaptive2p2c3d, Grid, Dune::UGGrid<3>); +#else +SET_TYPE_PROP(Adaptive2p2c3d, Grid, Dune::YaspGrid<3>); +#endif // Set the problem property SET_TYPE_PROP(Adaptive2p2c3d, Problem, Dumux::Adaptive2p2c3d<TTAG(Adaptive2p2c3d)>);