mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move the NewtonVerbose parameter to Opm::Parameters
This commit is contained in:
parent
13964c96be
commit
a39ccfd4d3
@ -27,24 +27,25 @@
|
|||||||
#ifndef EWOMS_NEWTON_METHOD_HH
|
#ifndef EWOMS_NEWTON_METHOD_HH
|
||||||
#define EWOMS_NEWTON_METHOD_HH
|
#define EWOMS_NEWTON_METHOD_HH
|
||||||
|
|
||||||
#include "nullconvergencewriter.hh"
|
#include <dune/istl/istlexception.hh>
|
||||||
|
#include <dune/common/classname.hh>
|
||||||
#include "newtonmethodproperties.hh"
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
|
||||||
#include <opm/common/Exceptions.hpp>
|
#include <opm/common/Exceptions.hpp>
|
||||||
|
|
||||||
#include <opm/material/densead/Math.hpp>
|
#include <opm/material/densead/Math.hpp>
|
||||||
|
|
||||||
#include <opm/models/discretization/common/fvbaseproperties.hh>
|
#include <opm/models/discretization/common/fvbaseproperties.hh>
|
||||||
|
|
||||||
|
#include <opm/models/nonlinear/newtonmethodparameters.hh>
|
||||||
|
#include <opm/models/nonlinear/newtonmethodproperties.hh>
|
||||||
|
#include <opm/models/nonlinear/nullconvergencewriter.hh>
|
||||||
|
|
||||||
#include <opm/models/utils/timer.hh>
|
#include <opm/models/utils/timer.hh>
|
||||||
#include <opm/models/utils/timerguard.hh>
|
#include <opm/models/utils/timerguard.hh>
|
||||||
|
|
||||||
#include <opm/simulators/linalg/linalgproperties.hh>
|
#include <opm/simulators/linalg/linalgproperties.hh>
|
||||||
|
|
||||||
#include <dune/istl/istlexception.hh>
|
|
||||||
#include <dune/common/classname.hh>
|
|
||||||
#include <dune/common/parallel/mpihelper.hh>
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
@ -78,8 +79,6 @@ struct NewtonConvergenceWriter<TypeTag, TTag::NewtonMethod> { using type = NullC
|
|||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonWriteConvergence<TypeTag, TTag::NewtonMethod> { static constexpr bool value = false; };
|
struct NewtonWriteConvergence<TypeTag, TTag::NewtonMethod> { static constexpr bool value = false; };
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonVerbose<TypeTag, TTag::NewtonMethod> { static constexpr bool value = true; };
|
|
||||||
template<class TypeTag>
|
|
||||||
struct NewtonTolerance<TypeTag, TTag::NewtonMethod>
|
struct NewtonTolerance<TypeTag, TTag::NewtonMethod>
|
||||||
{
|
{
|
||||||
using type = GetPropType<TypeTag, Scalar>;
|
using type = GetPropType<TypeTag, Scalar>;
|
||||||
@ -100,6 +99,14 @@ struct NewtonMaxIterations<TypeTag, TTag::NewtonMethod> { static constexpr int v
|
|||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
template<class TypeTag>
|
||||||
|
struct NewtonVerbose<TypeTag, Properties::TTag::NewtonMethod>
|
||||||
|
{ static constexpr bool value = true; };
|
||||||
|
|
||||||
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
/*!
|
/*!
|
||||||
* \ingroup Newton
|
* \ingroup Newton
|
||||||
@ -151,7 +158,7 @@ public:
|
|||||||
{
|
{
|
||||||
LinearSolverBackend::registerParameters();
|
LinearSolverBackend::registerParameters();
|
||||||
|
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonVerbose>
|
Parameters::registerParam<TypeTag, Parameters::NewtonVerbose>
|
||||||
("Specify whether the Newton method should inform "
|
("Specify whether the Newton method should inform "
|
||||||
"the user about its progress or not");
|
"the user about its progress or not");
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonWriteConvergence>
|
Parameters::registerParam<TypeTag, Properties::NewtonWriteConvergence>
|
||||||
@ -529,7 +536,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
bool verbose_() const
|
bool verbose_() const
|
||||||
{
|
{
|
||||||
return Parameters::get<TypeTag, Properties::NewtonVerbose>() && (comm_.rank() == 0);
|
return Parameters::get<TypeTag, Parameters::NewtonVerbose>() && (comm_.rank() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
36
opm/models/nonlinear/newtonmethodparameters.hh
Normal file
36
opm/models/nonlinear/newtonmethodparameters.hh
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// -*- 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.
|
||||||
|
*/
|
||||||
|
#ifndef EWOMS_NEWTON_METHOD_PARAMETERS_HH
|
||||||
|
#define EWOMS_NEWTON_METHOD_PARAMETERS_HH
|
||||||
|
|
||||||
|
#include <opm/models/utils/propertysystem.hh>
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
//! Specifies whether the Newton method should print messages or not
|
||||||
|
template<class TypeTag, class MyTypeTag>
|
||||||
|
struct NewtonVerbose { using type = Properties::UndefinedProperty; };
|
||||||
|
|
||||||
|
} // end namespace Opm::Parameters
|
||||||
|
|
||||||
|
#endif
|
@ -20,11 +20,11 @@
|
|||||||
module for the precise wording of the license and the list of
|
module for the precise wording of the license and the list of
|
||||||
copyright holders.
|
copyright holders.
|
||||||
*/
|
*/
|
||||||
#ifndef EWOMS_NEWTON_METHOD_POPERTIES_HH
|
#ifndef EWOMS_NEWTON_METHOD_PROPERTIES_HH
|
||||||
#define EWOMS_NEWTON_METHOD_POPERTIES_HH
|
#define EWOMS_NEWTON_METHOD_PROPERTIES_HH
|
||||||
|
|
||||||
#include <opm/models/utils/propertysystem.hh>
|
#include <opm/models/utils/propertysystem.hh>
|
||||||
#include <opm/models/utils/parametersystem.hh>
|
|
||||||
namespace Opm::Properties {
|
namespace Opm::Properties {
|
||||||
|
|
||||||
//! Specifies the type of the actual Newton method
|
//! Specifies the type of the actual Newton method
|
||||||
@ -35,10 +35,6 @@ struct NewtonMethod { using type = UndefinedProperty; };
|
|||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct Linearizer { using type = UndefinedProperty; };
|
struct Linearizer { using type = UndefinedProperty; };
|
||||||
|
|
||||||
//! Specifies whether the Newton method should print messages or not
|
|
||||||
template<class TypeTag, class MyTypeTag>
|
|
||||||
struct NewtonVerbose { using type = UndefinedProperty; };
|
|
||||||
|
|
||||||
//! Specifies the type of the class which writes out the Newton convergence
|
//! Specifies the type of the class which writes out the Newton convergence
|
||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct NewtonConvergenceWriter { using type = UndefinedProperty; };
|
struct NewtonConvergenceWriter { using type = UndefinedProperty; };
|
||||||
@ -82,6 +78,6 @@ struct NewtonTargetIterations { using type = UndefinedProperty; };
|
|||||||
template<class TypeTag, class MyTypeTag>
|
template<class TypeTag, class MyTypeTag>
|
||||||
struct NewtonMaxIterations { using type = UndefinedProperty; };
|
struct NewtonMaxIterations { using type = UndefinedProperty; };
|
||||||
|
|
||||||
} // end namespace Opm::Properties
|
} // end namespace Opm::Properties
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user