mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move the LinearSolverOverlapSize parameter to Opm::Parameters
This commit is contained in:
parent
67b10555d3
commit
321a7c7305
48
opm/simulators/linalg/linalgparameters.hh
Normal file
48
opm/simulators/linalg/linalgparameters.hh
Normal 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
|
@ -46,16 +46,6 @@ struct PreconditionerWrapper { using type = UndefinedProperty; };
|
|||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct LinearSolverScalar { using type = UndefinedProperty; };
|
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.
|
* \brief Maximum accepted error of the solution of the linear solver.
|
||||||
*/
|
*/
|
||||||
|
@ -27,31 +27,31 @@
|
|||||||
#ifndef EWOMS_PARALLEL_BASE_BACKEND_HH
|
#ifndef EWOMS_PARALLEL_BASE_BACKEND_HH
|
||||||
#define 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 <dune/grid/io/file/vtk/vtkwriter.hh>
|
||||||
#include <opm/simulators/linalg/overlappingbcrsmatrix.hh>
|
|
||||||
#include <opm/simulators/linalg/overlappingblockvector.hh>
|
#include <opm/common/Exceptions.hpp>
|
||||||
#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 <opm/models/utils/genericguard.hh>
|
#include <opm/models/utils/genericguard.hh>
|
||||||
#include <opm/models/utils/propertysystem.hh>
|
#include <opm/models/utils/propertysystem.hh>
|
||||||
#include <opm/models/utils/parametersystem.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/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 <iostream>
|
||||||
|
#include <memory>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace Opm::Properties {
|
namespace Opm::Properties {
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ public:
|
|||||||
("The maximum allowed error between of the linear solver");
|
("The maximum allowed error between of the linear solver");
|
||||||
Parameters::registerParam<TypeTag, Properties::LinearSolverAbsTolerance>
|
Parameters::registerParam<TypeTag, Properties::LinearSolverAbsTolerance>
|
||||||
("The maximum accepted error of the norm of the residual");
|
("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");
|
("The size of the algebraic overlap for the linear solver");
|
||||||
Parameters::registerParam<TypeTag, Properties::LinearSolverMaxIterations>
|
Parameters::registerParam<TypeTag, Properties::LinearSolverMaxIterations>
|
||||||
("The maximum number of iterations of the linear solver");
|
("The maximum number of iterations of the linear solver");
|
||||||
@ -195,7 +195,7 @@ public:
|
|||||||
simulator_.model().dofMapper());
|
simulator_.model().dofMapper());
|
||||||
|
|
||||||
// create the overlapping Jacobian matrix
|
// create the overlapping Jacobian matrix
|
||||||
unsigned overlapSize = Parameters::get<TypeTag, Properties::LinearSolverOverlapSize>();
|
unsigned overlapSize = Parameters::get<TypeTag, Parameters::LinearSolverOverlapSize>();
|
||||||
overlappingMatrix_ = new OverlappingMatrix(M.istlMatrix(),
|
overlappingMatrix_ = new OverlappingMatrix(M.istlMatrix(),
|
||||||
borderListCreator.borderList(),
|
borderListCreator.borderList(),
|
||||||
borderListCreator.blackList(),
|
borderListCreator.blackList(),
|
||||||
@ -458,14 +458,19 @@ template<class TypeTag>
|
|||||||
struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
|
struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
|
||||||
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
|
{ 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
|
//! set the default number of maximum iterations for the linear solver
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct LinearSolverMaxIterations<TypeTag, TTag::ParallelBaseLinearSolver> { static constexpr int value = 1000; };
|
struct LinearSolverMaxIterations<TypeTag, TTag::ParallelBaseLinearSolver> { static constexpr int value = 1000; };
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // 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
|
#endif
|
||||||
|
@ -27,11 +27,12 @@
|
|||||||
#ifndef EWOMS_PARALLEL_BICGSTAB_BACKEND_HH
|
#ifndef EWOMS_PARALLEL_BICGSTAB_BACKEND_HH
|
||||||
#define EWOMS_PARALLEL_BICGSTAB_BACKEND_HH
|
#define EWOMS_PARALLEL_BICGSTAB_BACKEND_HH
|
||||||
|
|
||||||
#include "linalgproperties.hh"
|
#include <opm/simulators/linalg/bicgstabsolver.hh>
|
||||||
#include "parallelbasebackend.hh"
|
#include <opm/simulators/linalg/combinedcriterion.hh>
|
||||||
#include "bicgstabsolver.hh"
|
#include <opm/simulators/linalg/istlsparsematrixadapter.hh>
|
||||||
#include "combinedcriterion.hh"
|
#include <opm/simulators/linalg/linalgparameters.hh>
|
||||||
#include "istlsparsematrixadapter.hh"
|
#include <opm/simulators/linalg/linalgproperties.hh>
|
||||||
|
#include <opm/simulators/linalg/parallelbasebackend.hh>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user