changed: move the LinearSolverOverlapSize parameter to Opm::Parameters

This commit is contained in:
Arne Morten Kvarving 2024-07-01 14:13:14 +02:00
parent 67b10555d3
commit 321a7c7305
4 changed files with 82 additions and 38 deletions

View File

@ -0,0 +1,48 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM 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.
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
/*!
* \file
* \ingroup BlackOilModel
*
* \brief Declares the parameters for the black oil model.
*/
#ifndef EWOMS_LINALG_PARAMETERS_HH
#define EWOMS_LINALG_PARAMETERS_HH
#include <opm/models/utils/parametersystem.hh>
namespace Opm::Parameters {
/*!
* \brief The size of the algebraic overlap of the linear solver.
*
* Algebraic overlaps can be thought as being the same as the overlap
* of a grid, but it is only existant for the linear system of
* equations.
*/
template<class TypeTag, class MyTypeTag>
struct LinearSolverOverlapSize { using type = Properties::UndefinedProperty; };
} // namespace Opm::Parameters
#endif

View File

@ -46,16 +46,6 @@ struct PreconditionerWrapper { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag>
struct LinearSolverScalar { using type = UndefinedProperty; };
/*!
* \brief The size of the algebraic overlap of the linear solver.
*
* Algebraic overlaps can be thought as being the same as the overlap
* of a grid, but it is only existant for the linear system of
* equations.
*/
template<class TypeTag, class MyTypeTag>
struct LinearSolverOverlapSize { using type = UndefinedProperty; };
/*!
* \brief Maximum accepted error of the solution of the linear solver.
*/

View File

@ -27,31 +27,31 @@
#ifndef EWOMS_PARALLEL_BASE_BACKEND_HH
#define EWOMS_PARALLEL_BASE_BACKEND_HH
#include <opm/common/Exceptions.hpp>
#include "opm/simulators/linalg/linalgparameters.hh"
#include <dune/common/fvector.hh>
#include <dune/common/version.hh>
#include <opm/simulators/linalg/istlsparsematrixadapter.hh>
#include <opm/simulators/linalg/overlappingbcrsmatrix.hh>
#include <opm/simulators/linalg/overlappingblockvector.hh>
#include <opm/simulators/linalg/overlappingpreconditioner.hh>
#include <opm/simulators/linalg/overlappingscalarproduct.hh>
#include <opm/simulators/linalg/overlappingoperator.hh>
#include <opm/simulators/linalg/parallelbasebackend.hh>
#include <opm/simulators/linalg/istlpreconditionerwrappers.hh>
#include <dune/grid/io/file/vtk/vtkwriter.hh>
#include <opm/common/Exceptions.hpp>
#include <opm/models/utils/genericguard.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <opm/simulators/linalg/matrixblock.hh>
#include <opm/simulators/linalg/istlpreconditionerwrappers.hh>
#include <opm/simulators/linalg/istlsparsematrixadapter.hh>
#include <opm/simulators/linalg/linalgproperties.hh>
#include <opm/simulators/linalg/matrixblock.hh>
#include <opm/simulators/linalg/overlappingbcrsmatrix.hh>
#include <opm/simulators/linalg/overlappingblockvector.hh>
#include <opm/simulators/linalg/overlappingoperator.hh>
#include <opm/simulators/linalg/overlappingpreconditioner.hh>
#include <opm/simulators/linalg/overlappingscalarproduct.hh>
#include <dune/grid/io/file/vtk/vtkwriter.hh>
#include <dune/common/fvector.hh>
#include <dune/common/version.hh>
#include <sstream>
#include <memory>
#include <iostream>
#include <memory>
#include <sstream>
namespace Opm::Properties {
@ -156,7 +156,7 @@ public:
("The maximum allowed error between of the linear solver");
Parameters::registerParam<TypeTag, Properties::LinearSolverAbsTolerance>
("The maximum accepted error of the norm of the residual");
Parameters::registerParam<TypeTag, Properties::LinearSolverOverlapSize>
Parameters::registerParam<TypeTag, Parameters::LinearSolverOverlapSize>
("The size of the algebraic overlap for the linear solver");
Parameters::registerParam<TypeTag, Properties::LinearSolverMaxIterations>
("The maximum number of iterations of the linear solver");
@ -195,7 +195,7 @@ public:
simulator_.model().dofMapper());
// create the overlapping Jacobian matrix
unsigned overlapSize = Parameters::get<TypeTag, Properties::LinearSolverOverlapSize>();
unsigned overlapSize = Parameters::get<TypeTag, Parameters::LinearSolverOverlapSize>();
overlappingMatrix_ = new OverlappingMatrix(M.istlMatrix(),
borderListCreator.borderList(),
borderListCreator.blackList(),
@ -458,14 +458,19 @@ template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
//! set the default overlap size to 2
template<class TypeTag>
struct LinearSolverOverlapSize<TypeTag, TTag::ParallelBaseLinearSolver> { static constexpr unsigned value = 2; };
//! set the default number of maximum iterations for the linear solver
template<class TypeTag>
struct LinearSolverMaxIterations<TypeTag, TTag::ParallelBaseLinearSolver> { static constexpr int value = 1000; };
} // namespace Opm::Properties
namespace Opm::Parameters {
//! set the default overlap size to 2
template<class TypeTag>
struct LinearSolverOverlapSize<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
{ static constexpr unsigned value = 2; };
} // namespace Opm::Parameters
#endif

View File

@ -27,11 +27,12 @@
#ifndef EWOMS_PARALLEL_BICGSTAB_BACKEND_HH
#define EWOMS_PARALLEL_BICGSTAB_BACKEND_HH
#include "linalgproperties.hh"
#include "parallelbasebackend.hh"
#include "bicgstabsolver.hh"
#include "combinedcriterion.hh"
#include "istlsparsematrixadapter.hh"
#include <opm/simulators/linalg/bicgstabsolver.hh>
#include <opm/simulators/linalg/combinedcriterion.hh>
#include <opm/simulators/linalg/istlsparsematrixadapter.hh>
#include <opm/simulators/linalg/linalgparameters.hh>
#include <opm/simulators/linalg/linalgproperties.hh>
#include <opm/simulators/linalg/parallelbasebackend.hh>
#include <memory>