Merge pull request #591 from OPM/feature/replace-propertysystem

Replace property system
This commit is contained in:
Atgeirr Flø Rasmussen 2020-05-28 12:05:11 +02:00 committed by GitHub
commit 61eb74b1d6
64 changed files with 902 additions and 1723 deletions

View File

@ -153,12 +153,9 @@ private:
public: public:
typedef Scalar type; typedef Scalar type;
static const Scalar value; static constexpr Scalar value = 1.0/(30.0*4184.0*alpha);
}; };
PROP_STATIC_CONST_MEMBER_DEFINITION_PREFIX_(BlackOilModel, BlackOilEnergyScalingFactor)
::value = 1.0/(30*4184.0*alpha);
// by default, ebos formulates the conservation equations in terms of mass not surface // by default, ebos formulates the conservation equations in terms of mass not surface
// volumes // volumes
SET_BOOL_PROP(BlackOilModel, BlackoilConserveSurfaceVolume, false); SET_BOOL_PROP(BlackOilModel, BlackoilConserveSurfaceVolume, false);

View File

@ -31,11 +31,15 @@
#include "blackoilproperties.hh" #include "blackoilproperties.hh"
#include <opm/models/utils/signum.hh> #include <opm/models/utils/signum.hh>
#include <opm/models/nonlinear/newtonmethod.hh>
#include <opm/material/common/Unused.hpp> #include <opm/material/common/Unused.hpp>
BEGIN_PROPERTIES BEGIN_PROPERTIES
template <class TypeTag, class MyTypeTag>
struct DiscNewtonMethod;
NEW_PROP_TAG(DpMaxRel); NEW_PROP_TAG(DpMaxRel);
NEW_PROP_TAG(DsMax); NEW_PROP_TAG(DsMax);
NEW_PROP_TAG(PriVarOscilationThreshold); NEW_PROP_TAG(PriVarOscilationThreshold);

View File

@ -36,14 +36,6 @@ BEGIN_PROPERTIES
//! Specifies if the simulation should write output files that are //! Specifies if the simulation should write output files that are
//! compatible with those produced by the commercial Eclipse simulator //! compatible with those produced by the commercial Eclipse simulator
NEW_PROP_TAG(EnableEclipseOutput); NEW_PROP_TAG(EnableEclipseOutput);
//! The material law for thermal conduction
NEW_PROP_TAG(ThermalConductionLaw);
//! The parameters of the material law for thermal conduction
NEW_PROP_TAG(ThermalConductionLawParams);
//! The material law for energy storage of the rock
NEW_PROP_TAG(SolidEnergyLaw);
//! The parameters for material law for energy storage of the rock
NEW_PROP_TAG(SolidEnergyLawParams);
//! Enable the ECL-blackoil extension for solvents. ("Second gas") //! Enable the ECL-blackoil extension for solvents. ("Second gas")
NEW_PROP_TAG(EnableSolvent); NEW_PROP_TAG(EnableSolvent);
//! Enable the ECL-blackoil extension for polymer. //! Enable the ECL-blackoil extension for polymer.
@ -62,11 +54,6 @@ NEW_PROP_TAG(EnableBrine);
//! in the black-oil model //! in the black-oil model
NEW_PROP_TAG(EnableTemperature); NEW_PROP_TAG(EnableTemperature);
//! Enable the ECL-blackoil extension for energy conservation
//!
//! Setting this property to true implies EnableTemperature.
NEW_PROP_TAG(EnableEnergy);
//! The relative weight of the residual of the energy equation compared to the mass //! The relative weight of the residual of the energy equation compared to the mass
//! residuals //! residuals
//! //!

View File

@ -42,12 +42,6 @@
#include <cmath> #include <cmath>
BEGIN_PROPERTIES
NEW_PROP_TAG(MaterialLaw);
END_PROPERTIES
namespace Opm { namespace Opm {
template <class TypeTag> template <class TypeTag>

View File

@ -37,12 +37,6 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
BEGIN_PROPERTIES
NEW_PROP_TAG(Indices);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -40,17 +40,6 @@
#include <string> #include <string>
BEGIN_PROPERTIES
NEW_PROP_TAG(Indices);
NEW_PROP_TAG(EnableEnergy);
NEW_PROP_TAG(ThermalConductionLaw);
NEW_PROP_TAG(ThermalConductionLawParams);
NEW_PROP_TAG(SolidEnergyLaw);
NEW_PROP_TAG(SolidEnergyLawParams);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!
* \ingroup Energy * \ingroup Energy

View File

@ -43,12 +43,6 @@
#include <cmath> #include <cmath>
BEGIN_PROPERTIES
NEW_PROP_TAG(MaterialLaw);
END_PROPERTIES
namespace Opm { namespace Opm {
template <class TypeTag> template <class TypeTag>
class ForchheimerIntensiveQuantities; class ForchheimerIntensiveQuantities;

View File

@ -36,6 +36,8 @@
#include <opm/models/common/flux.hh> #include <opm/models/common/flux.hh>
#include <opm/models/discretization/vcfv/vcfvdiscretization.hh> #include <opm/models/discretization/vcfv/vcfvdiscretization.hh>
#include <opm/models/io/vtkmultiphasemodule.hh>
#include <opm/models/io/vtktemperaturemodule.hh>
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp> #include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp> #include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>

View File

@ -41,15 +41,6 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
BEGIN_PROPERTIES
NEW_PROP_TAG(SolidEnergyLawParams);
NEW_PROP_TAG(ThermalConductionLawParams);
NEW_PROP_TAG(EnableGravity);
NEW_PROP_TAG(FluxModule);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -30,9 +30,7 @@
#ifndef EWOMS_MULTI_PHASE_BASE_PROPERTIES_HH #ifndef EWOMS_MULTI_PHASE_BASE_PROPERTIES_HH
#define EWOMS_MULTI_PHASE_BASE_PROPERTIES_HH #define EWOMS_MULTI_PHASE_BASE_PROPERTIES_HH
#include <opm/models/discretization/common/fvbaseproperties.hh> #include <opm/models/utils/basicproperties.hh>
#include <opm/models/io/vtkmultiphasemodule.hh>
#include <opm/models/io/vtktemperaturemodule.hh>
BEGIN_PROPERTIES BEGIN_PROPERTIES
@ -61,8 +59,12 @@ NEW_PROP_TAG(FluidSystem);
//! Specifies the relation used for velocity //! Specifies the relation used for velocity
NEW_PROP_TAG(FluxModule); NEW_PROP_TAG(FluxModule);
//! Specify whether energy should be considered as a conservation quantity or not
NEW_PROP_TAG(EnableEnergy);
//! Returns whether gravity is considered in the problem //! Returns whether gravity is considered in the problem
NEW_PROP_TAG(EnableGravity); NEW_PROP_TAG(EnableGravity);
//! Enable diffusive fluxes?
NEW_PROP_TAG(EnableDiffusion);
END_PROPERTIES END_PROPERTIES

View File

@ -39,14 +39,6 @@
#include <dune/common/fvector.hh> #include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
BEGIN_PROPERTIES
NEW_PROP_TAG(ThermalConductionLawParams);
NEW_PROP_TAG(EnableGravity);
NEW_PROP_TAG(FluxModule);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -38,14 +38,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(AuxModule); NEW_TYPE_TAG(AuxModule);
// declare the properties required by the for the ecl grid manager
NEW_PROP_TAG(Grid);
NEW_PROP_TAG(GridView);
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(DofMapper);
NEW_PROP_TAG(GlobalEqVector);
NEW_PROP_TAG(SparseMatrixAdapter);
END_PROPERTIES END_PROPERTIES
namespace Opm { namespace Opm {

View File

@ -51,18 +51,6 @@ BEGIN_PROPERTIES
// declare the property tags required for the finite differences local linearizer // declare the property tags required for the finite differences local linearizer
NEW_TYPE_TAG(AutoDiffLocalLinearizer); NEW_TYPE_TAG(AutoDiffLocalLinearizer);
NEW_PROP_TAG(LocalLinearizer);
NEW_PROP_TAG(Evaluation);
NEW_PROP_TAG(LocalResidual);
NEW_PROP_TAG(Simulator);
NEW_PROP_TAG(Problem);
NEW_PROP_TAG(Model);
NEW_PROP_TAG(PrimaryVariables);
NEW_PROP_TAG(ElementContext);
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Evaluation);
NEW_PROP_TAG(GridView);
// set the properties to be spliced in // set the properties to be spliced in
SET_TYPE_PROP(AutoDiffLocalLinearizer, LocalLinearizer, SET_TYPE_PROP(AutoDiffLocalLinearizer, LocalLinearizer,

View File

@ -31,12 +31,6 @@
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
#include <opm/material/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
BEGIN_PROPERTIES
NEW_PROP_TAG(PrimaryVariables);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -54,6 +54,7 @@
#include <opm/models/utils/alignedallocator.hh> #include <opm/models/utils/alignedallocator.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/models/io/vtkprimaryvarsmodule.hh>
#include <opm/simulators/linalg/matrixblock.hh> #include <opm/simulators/linalg/matrixblock.hh>
#include <opm/material/common/MathToolbox.hpp> #include <opm/material/common/MathToolbox.hpp>

View File

@ -30,6 +30,8 @@
#include "fvbaseproperties.hh" #include "fvbaseproperties.hh"
#include <opm/models/common/multiphasebaseproperties.hh>
#include <opm/material/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
#include <opm/material/common/Unused.hpp> #include <opm/material/common/Unused.hpp>

View File

@ -30,6 +30,7 @@
#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/models/discretization/common/fvbaseproperties.hh>
#include <opm/material/common/MathToolbox.hpp> #include <opm/material/common/MathToolbox.hpp>
#include <opm/material/common/Valgrind.hpp> #include <opm/material/common/Valgrind.hpp>
@ -54,21 +55,8 @@ BEGIN_PROPERTIES
// declare the property tags required for the finite differences local linearizer // declare the property tags required for the finite differences local linearizer
NEW_TYPE_TAG(FiniteDifferenceLocalLinearizer); NEW_TYPE_TAG(FiniteDifferenceLocalLinearizer);
NEW_PROP_TAG(LocalLinearizer);
NEW_PROP_TAG(Evaluation);
NEW_PROP_TAG(NumericDifferenceMethod); NEW_PROP_TAG(NumericDifferenceMethod);
NEW_PROP_TAG(BaseEpsilon); NEW_PROP_TAG(BaseEpsilon);
NEW_PROP_TAG(SparseMatrixAdapter);
NEW_PROP_TAG(LocalResidual);
NEW_PROP_TAG(Simulator);
NEW_PROP_TAG(Problem);
NEW_PROP_TAG(Model);
NEW_PROP_TAG(PrimaryVariables);
NEW_PROP_TAG(ElementContext);
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Evaluation);
NEW_PROP_TAG(GridView);
NEW_PROP_TAG(NumEq);
// set the properties to be spliced in // set the properties to be spliced in
SET_TYPE_PROP(FiniteDifferenceLocalLinearizer, LocalLinearizer, SET_TYPE_PROP(FiniteDifferenceLocalLinearizer, LocalLinearizer,

View File

@ -37,11 +37,14 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
// forward declaration of the required property tags // forward declaration of the required property tags
NEW_PROP_TAG(GridView); template<class TypeTag, class MyTypeTag>
NEW_PROP_TAG(NewtonMethod); struct SolutionVector;
NEW_PROP_TAG(SolutionVector); template<class TypeTag, class MyTypeTag>
NEW_PROP_TAG(GlobalEqVector); struct GlobalEqVector;
NEW_PROP_TAG(VtkOutputFormat); template<class TypeTag, class MyTypeTag>
struct NewtonMethod;
template<class TypeTag, class MyTypeTag>
struct VtkOutputFormat;
END_PROPERTIES END_PROPERTIES
//! \endcond //! \endcond

View File

@ -47,25 +47,9 @@ BEGIN_PROPERTIES
//! create a type tag for the Newton method of the finite-volume discretization //! create a type tag for the Newton method of the finite-volume discretization
NEW_TYPE_TAG(FvBaseNewtonMethod, INHERITS_FROM(NewtonMethod)); NEW_TYPE_TAG(FvBaseNewtonMethod, INHERITS_FROM(NewtonMethod));
//! The class dealing with the balance equations
NEW_PROP_TAG(Model);
//! The class storing primary variables plus pseudo primary variables
NEW_PROP_TAG(PrimaryVariables);
//! The class storing values of conservation equations (e.g., a "naked" primary varible
//! vector)
NEW_PROP_TAG(EqVector);
//! The number of balance equations.
NEW_PROP_TAG(NumEq);
//! The discretization specific part of he implementing the Newton algorithm //! The discretization specific part of he implementing the Newton algorithm
NEW_PROP_TAG(DiscNewtonMethod); NEW_PROP_TAG(DiscNewtonMethod);
//! The class implementing the Newton algorithm
NEW_PROP_TAG(NewtonMethod);
// set default values // set default values
SET_TYPE_PROP(FvBaseNewtonMethod, DiscNewtonMethod, SET_TYPE_PROP(FvBaseNewtonMethod, DiscNewtonMethod,
Opm::FvBaseNewtonMethod<TypeTag>); Opm::FvBaseNewtonMethod<TypeTag>);

View File

@ -45,6 +45,13 @@
#include <sys/stat.h> #include <sys/stat.h>
BEGIN_PROPERTIES
template <class TypeTag, class MyTypeTag>
struct NewtonMethod;
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -30,16 +30,18 @@
#ifndef EWOMS_FV_BASE_PROPERTIES_HH #ifndef EWOMS_FV_BASE_PROPERTIES_HH
#define EWOMS_FV_BASE_PROPERTIES_HH #define EWOMS_FV_BASE_PROPERTIES_HH
#include "fvbasenewtonmethod.hh"
#include "fvbaseproperties.hh"
#include "fvbasefdlocallinearizer.hh"
#include <opm/models/utils/basicproperties.hh> #include <opm/models/utils/basicproperties.hh>
#include <opm/models/io/vtkprimaryvarsmodule.hh> #include <opm/models/io/dgfvanguard.hh>
#include <opm/simulators/linalg/parallelbicgstabbackend.hh> #include <opm/simulators/linalg/parallelbicgstabbackend.hh>
BEGIN_PROPERTIES BEGIN_PROPERTIES
namespace TTag {
struct FvBaseNewtonMethod;
struct VtkPrimaryVars;
struct FiniteDifferenceLocalLinearizer;
}
//! The type tag for models based on the finite volume schemes //! The type tag for models based on the finite volume schemes
NEW_TYPE_TAG(FvBaseDiscretization, NEW_TYPE_TAG(FvBaseDiscretization,
INHERITS_FROM(ImplicitModel, INHERITS_FROM(ImplicitModel,
@ -49,11 +51,7 @@ NEW_TYPE_TAG(FvBaseDiscretization,
//! set the splices for the finite volume discretizations //! set the splices for the finite volume discretizations
NEW_PROP_TAG(LinearSolverSplice); NEW_PROP_TAG(LinearSolverSplice);
NEW_PROP_TAG(ParallelBiCGStabLinearSolver);
NEW_PROP_TAG(LocalLinearizerSplice); NEW_PROP_TAG(LocalLinearizerSplice);
NEW_PROP_TAG(FiniteDifferenceLocalLinearizer);
SET_SPLICES(FvBaseDiscretization, LinearSolverSplice, LocalLinearizerSplice); SET_SPLICES(FvBaseDiscretization, LinearSolverSplice, LocalLinearizerSplice);
//! use a parallel BiCGStab linear solver by default //! use a parallel BiCGStab linear solver by default
@ -72,11 +70,6 @@ SET_TAG_PROP(FvBaseDiscretization, LocalLinearizerSplice, FiniteDifferenceLocalL
*/ */
NEW_PROP_TAG(Evaluation); NEW_PROP_TAG(Evaluation);
//! The type of the DUNE grid
NEW_PROP_TAG(Grid);
//! The type of the grid view
NEW_PROP_TAG(GridView);
//! The class describing the stencil of the spatial discretization //! The class describing the stencil of the spatial discretization
NEW_PROP_TAG(Stencil); NEW_PROP_TAG(Stencil);
@ -87,10 +80,6 @@ NEW_PROP_TAG(DiscreteFunctionSpace);
NEW_PROP_TAG(Problem); NEW_PROP_TAG(Problem);
//! The type of the base class for all problems which use this model //! The type of the base class for all problems which use this model
NEW_PROP_TAG(BaseProblem); NEW_PROP_TAG(BaseProblem);
//! The type of the model
NEW_PROP_TAG(Model);
//! Number of equations in the system of PDEs
NEW_PROP_TAG(NumEq);
//! The type of the spatial discretization used by the model //! The type of the spatial discretization used by the model
NEW_PROP_TAG(Discretization); NEW_PROP_TAG(Discretization);
@ -106,15 +95,11 @@ NEW_PROP_TAG(LinearizeNonLocalElements);
//! Linearizes the global non-linear system of equations //! Linearizes the global non-linear system of equations
NEW_PROP_TAG(BaseLinearizer); NEW_PROP_TAG(BaseLinearizer);
//! The class that allows to manipulate sparse matrices
NEW_PROP_TAG(SparseMatrixAdapter);
//! A vector of holding a quantity for each equation (usually at a given spatial location) //! A vector of holding a quantity for each equation (usually at a given spatial location)
NEW_PROP_TAG(EqVector); NEW_PROP_TAG(EqVector);
//! A vector of holding a quantity for each equation for each DOF of an element //! A vector of holding a quantity for each equation for each DOF of an element
NEW_PROP_TAG(ElementEqVector); NEW_PROP_TAG(ElementEqVector);
//! Vector containing a quantity of for equation for each DOF of the whole grid
NEW_PROP_TAG(GlobalEqVector);
//! Vector containing volumetric or areal rates of quantities //! Vector containing volumetric or areal rates of quantities
NEW_PROP_TAG(RateVector); NEW_PROP_TAG(RateVector);
@ -170,9 +155,6 @@ NEW_PROP_TAG(UseLinearizationLock);
// high-level simulation control // high-level simulation control
//! Manages the simulation time
NEW_PROP_TAG(Simulator);
/*! /*!
* \brief Switch to enable or disable grid adaptation * \brief Switch to enable or disable grid adaptation
* *
@ -292,14 +274,6 @@ NEW_PROP_TAG(ElementMapper);
*/ */
NEW_PROP_TAG(DofMapper); NEW_PROP_TAG(DofMapper);
/*!
* \brief The class which marks the border indices associated with the
* degrees of freedom on a process boundary.
*
* This is required for the algebraic overlap stuff.
*/
NEW_PROP_TAG(BorderListCreator);
/*! /*!
* \brief The history size required by the time discretization * \brief The history size required by the time discretization
*/ */
@ -319,6 +293,8 @@ NEW_PROP_TAG(UseVolumetricResidual);
//! Specify if experimental features should be enabled or not. //! Specify if experimental features should be enabled or not.
NEW_PROP_TAG(EnableExperiments); NEW_PROP_TAG(EnableExperiments);
SET_TYPE_PROP(NumericModel, Vanguard, Opm::DgfVanguard<TypeTag>);
END_PROPERTIES END_PROPERTIES
#endif #endif

View File

@ -37,23 +37,11 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
//! Provides the thermodynamic relations
NEW_PROP_TAG(FluidSystem);
//! The type of the flash constraint solver //! The type of the flash constraint solver
NEW_PROP_TAG(FlashSolver); NEW_PROP_TAG(FlashSolver);
//! The maximum accepted error of the flash solver //! The maximum accepted error of the flash solver
NEW_PROP_TAG(FlashTolerance); NEW_PROP_TAG(FlashTolerance);
//! The thermal conduction law which ought to be used
NEW_PROP_TAG(ThermalConductionLaw);
//! The parameters of the thermal conduction law
NEW_PROP_TAG(ThermalConductionLawParams);
//! Specifies whether energy should be considered as a conservation quantity or not
NEW_PROP_TAG(EnableEnergy);
//! Enable diffusive fluxes?
NEW_PROP_TAG(EnableDiffusion);
END_PROPERTIES END_PROPERTIES
#endif #endif

View File

@ -35,24 +35,16 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
//!The fluid systems including the information about the phases
NEW_PROP_TAG(FluidSystem);
//! Specify whether energy should be considered as a conservation quantity or not
NEW_PROP_TAG(EnableEnergy);
// these properties only make sense for the ImmiscibleTwoPhase type tag // these properties only make sense for the ImmiscibleTwoPhase type tag
//! The wetting phase for two-phase models //! The wetting phase for two-phase models
NEW_PROP_TAG(WettingPhase); NEW_PROP_TAG(WettingPhase);
//! The non-wetting phase for two-phase models //! The non-wetting phase for two-phase models
NEW_PROP_TAG(NonwettingPhase); NEW_PROP_TAG(NonwettingPhase);
// these properties only make sense for the ImmiscibleSinglePhase type tag // these properties only make sense for the ImmiscibleSinglePhase type tag
//! The fluid used by the model //! The fluid used by the model
NEW_PROP_TAG(Fluid); NEW_PROP_TAG(Fluid);
END_PROPERTIES END_PROPERTIES
#endif #endif

View File

@ -31,6 +31,9 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/basicproperties.hh>
#include <opm/models/common/multiphasebaseproperties.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <opm/material/common/Exceptions.hpp> #include <opm/material/common/Exceptions.hpp>
@ -46,19 +49,8 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
// forward definition of property tags template <class TypeTag, class MyTypeTag>
NEW_PROP_TAG(NumPhases); struct FluidSystem;
NEW_PROP_TAG(NumComponents);
NEW_PROP_TAG(NumEq);
NEW_PROP_TAG(Model);
NEW_PROP_TAG(Simulator);
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Evaluation);
NEW_PROP_TAG(GridView);
NEW_PROP_TAG(ElementContext);
NEW_PROP_TAG(FluidSystem);
NEW_PROP_TAG(DiscBaseOutputModule);
END_PROPERTIES END_PROPERTIES

View File

@ -27,7 +27,7 @@
#ifndef EWOMS_BASE_VANGUARD_HH #ifndef EWOMS_BASE_VANGUARD_HH
#define EWOMS_BASE_VANGUARD_HH #define EWOMS_BASE_VANGUARD_HH
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/basicproperties.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
@ -39,19 +39,6 @@
#include <type_traits> #include <type_traits>
#include <memory> #include <memory>
BEGIN_PROPERTIES
NEW_PROP_TAG(Grid);
NEW_PROP_TAG(Vanguard);
NEW_PROP_TAG(GridView);
NEW_PROP_TAG(GridPart);
NEW_PROP_TAG(GridViewLevel);
NEW_PROP_TAG(GridFile);
NEW_PROP_TAG(GridGlobalRefinements);
NEW_PROP_TAG(Simulator);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -38,23 +38,6 @@
#include <memory> #include <memory>
BEGIN_PROPERTIES
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Grid);
NEW_PROP_TAG(DomainSizeX);
NEW_PROP_TAG(DomainSizeY);
NEW_PROP_TAG(DomainSizeZ);
NEW_PROP_TAG(CellsX);
NEW_PROP_TAG(CellsY);
NEW_PROP_TAG(CellsZ);
NEW_PROP_TAG(GridGlobalRefinements);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -39,17 +39,6 @@
#include <type_traits> #include <type_traits>
#include <string> #include <string>
BEGIN_PROPERTIES
NEW_PROP_TAG(Grid);
NEW_PROP_TAG(GridFile);
NEW_PROP_TAG(Vanguard);
NEW_PROP_TAG(GridGlobalRefinements);
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Simulator);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -36,23 +36,6 @@
#include <memory> #include <memory>
BEGIN_PROPERTIES
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Grid);
NEW_PROP_TAG(DomainSizeX);
NEW_PROP_TAG(DomainSizeY);
NEW_PROP_TAG(DomainSizeZ);
NEW_PROP_TAG(CellsX);
NEW_PROP_TAG(CellsY);
NEW_PROP_TAG(CellsZ);
NEW_PROP_TAG(GridGlobalRefinements);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!
* \brief Provides a simulator vanguard which a creates regular grid made of simplices. * \brief Provides a simulator vanguard which a creates regular grid made of simplices.

View File

@ -56,20 +56,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(StructuredGridVanguard); NEW_TYPE_TAG(StructuredGridVanguard);
// declare the properties required by the for the structured grid simulator vanguard
NEW_PROP_TAG(Grid);
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(DomainSizeX);
NEW_PROP_TAG(DomainSizeY);
NEW_PROP_TAG(DomainSizeZ);
NEW_PROP_TAG(CellsX);
NEW_PROP_TAG(CellsY);
NEW_PROP_TAG(CellsZ);
NEW_PROP_TAG(GridGlobalRefinements);
// GRIDDIM is only set by the finger problem // GRIDDIM is only set by the finger problem
#ifndef GRIDDIM #ifndef GRIDDIM
static const int dim = 2; static const int dim = 2;

View File

@ -50,8 +50,6 @@ NEW_PROP_TAG(VtkWriteRockInternalEnergy);
NEW_PROP_TAG(VtkWriteTotalThermalConductivity); NEW_PROP_TAG(VtkWriteTotalThermalConductivity);
NEW_PROP_TAG(VtkWriteFluidInternalEnergies); NEW_PROP_TAG(VtkWriteFluidInternalEnergies);
NEW_PROP_TAG(VtkWriteFluidEnthalpies); NEW_PROP_TAG(VtkWriteFluidEnthalpies);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
// set default values for what quantities to output // set default values for what quantities to output
SET_BOOL_PROP(VtkBlackOilEnergy, VtkWriteRockInternalEnergy, true); SET_BOOL_PROP(VtkBlackOilEnergy, VtkWriteRockInternalEnergy, true);

View File

@ -46,8 +46,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(VtkBlackOil); NEW_TYPE_TAG(VtkBlackOil);
// create the property tags needed for the multi phase module // create the property tags needed for the multi phase module
NEW_PROP_TAG(EnableVtkOutput);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(VtkWriteGasDissolutionFactor); NEW_PROP_TAG(VtkWriteGasDissolutionFactor);
NEW_PROP_TAG(VtkWriteOilVaporizationFactor); NEW_PROP_TAG(VtkWriteOilVaporizationFactor);
NEW_PROP_TAG(VtkWriteOilFormationVolumeFactor); NEW_PROP_TAG(VtkWriteOilFormationVolumeFactor);

View File

@ -46,8 +46,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(VtkBlackOilPolymer); NEW_TYPE_TAG(VtkBlackOilPolymer);
// create the property tags needed for the polymer output module // create the property tags needed for the polymer output module
NEW_PROP_TAG(EnablePolymer);
NEW_PROP_TAG(EnableVtkOutput);
NEW_PROP_TAG(VtkWritePolymerConcentration); NEW_PROP_TAG(VtkWritePolymerConcentration);
NEW_PROP_TAG(VtkWritePolymerDeadPoreVolume); NEW_PROP_TAG(VtkWritePolymerDeadPoreVolume);
NEW_PROP_TAG(VtkWritePolymerAdsorption); NEW_PROP_TAG(VtkWritePolymerAdsorption);

View File

@ -46,8 +46,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(VtkBlackOilSolvent); NEW_TYPE_TAG(VtkBlackOilSolvent);
// create the property tags needed for the solvent output module // create the property tags needed for the solvent output module
NEW_PROP_TAG(EnableSolvent);
NEW_PROP_TAG(EnableVtkOutput);
NEW_PROP_TAG(VtkWriteSolventSaturation); NEW_PROP_TAG(VtkWriteSolventSaturation);
NEW_PROP_TAG(VtkWriteSolventDensity); NEW_PROP_TAG(VtkWriteSolventDensity);
NEW_PROP_TAG(VtkWriteSolventViscosity); NEW_PROP_TAG(VtkWriteSolventViscosity);

View File

@ -48,8 +48,6 @@ NEW_PROP_TAG(VtkWriteTotalMoleFractions);
NEW_PROP_TAG(VtkWriteMolarities); NEW_PROP_TAG(VtkWriteMolarities);
NEW_PROP_TAG(VtkWriteFugacities); NEW_PROP_TAG(VtkWriteFugacities);
NEW_PROP_TAG(VtkWriteFugacityCoeffs); NEW_PROP_TAG(VtkWriteFugacityCoeffs);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
// set default values for what quantities to output // set default values for what quantities to output
SET_BOOL_PROP(VtkComposition, VtkWriteMassFractions, false); SET_BOOL_PROP(VtkComposition, VtkWriteMassFractions, false);

View File

@ -47,8 +47,6 @@ NEW_TYPE_TAG(VtkDiffusion);
NEW_PROP_TAG(VtkWriteTortuosities); NEW_PROP_TAG(VtkWriteTortuosities);
NEW_PROP_TAG(VtkWriteDiffusionCoefficients); NEW_PROP_TAG(VtkWriteDiffusionCoefficients);
NEW_PROP_TAG(VtkWriteEffectiveDiffusionCoefficients); NEW_PROP_TAG(VtkWriteEffectiveDiffusionCoefficients);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
// set default values for what quantities to output // set default values for what quantities to output
SET_BOOL_PROP(VtkDiffusion, VtkWriteTortuosities, false); SET_BOOL_PROP(VtkDiffusion, VtkWriteTortuosities, false);

View File

@ -45,7 +45,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(VtkDiscreteFracture); NEW_TYPE_TAG(VtkDiscreteFracture);
// create the property tags needed for the multi phase module // create the property tags needed for the multi phase module
NEW_PROP_TAG(Vanguard);
NEW_PROP_TAG(VtkWriteFractureSaturations); NEW_PROP_TAG(VtkWriteFractureSaturations);
NEW_PROP_TAG(VtkWriteFractureMobilities); NEW_PROP_TAG(VtkWriteFractureMobilities);
NEW_PROP_TAG(VtkWriteFractureRelativePermeabilities); NEW_PROP_TAG(VtkWriteFractureRelativePermeabilities);
@ -53,9 +52,6 @@ NEW_PROP_TAG(VtkWriteFracturePorosity);
NEW_PROP_TAG(VtkWriteFractureIntrinsicPermeabilities); NEW_PROP_TAG(VtkWriteFractureIntrinsicPermeabilities);
NEW_PROP_TAG(VtkWriteFractureFilterVelocities); NEW_PROP_TAG(VtkWriteFractureFilterVelocities);
NEW_PROP_TAG(VtkWriteFractureVolumeFraction); NEW_PROP_TAG(VtkWriteFractureVolumeFraction);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
NEW_PROP_TAG(DiscBaseOutputModule);
// set default values for what quantities to output // set default values for what quantities to output
SET_BOOL_PROP(VtkDiscreteFracture, VtkWriteFractureSaturations, true); SET_BOOL_PROP(VtkDiscreteFracture, VtkWriteFractureSaturations, true);

View File

@ -45,8 +45,6 @@ NEW_PROP_TAG(VtkWriteSolidInternalEnergy);
NEW_PROP_TAG(VtkWriteThermalConductivity); NEW_PROP_TAG(VtkWriteThermalConductivity);
NEW_PROP_TAG(VtkWriteInternalEnergies); NEW_PROP_TAG(VtkWriteInternalEnergies);
NEW_PROP_TAG(VtkWriteEnthalpies); NEW_PROP_TAG(VtkWriteEnthalpies);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
// set default values for what quantities to output // set default values for what quantities to output
SET_BOOL_PROP(VtkEnergy, VtkWriteSolidInternalEnergy, false); SET_BOOL_PROP(VtkEnergy, VtkWriteSolidInternalEnergy, false);

View File

@ -58,8 +58,6 @@ NEW_PROP_TAG(VtkWritePorosity);
NEW_PROP_TAG(VtkWriteIntrinsicPermeabilities); NEW_PROP_TAG(VtkWriteIntrinsicPermeabilities);
NEW_PROP_TAG(VtkWritePotentialGradients); NEW_PROP_TAG(VtkWritePotentialGradients);
NEW_PROP_TAG(VtkWriteFilterVelocities); NEW_PROP_TAG(VtkWriteFilterVelocities);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
// set default values for what quantities to output // set default values for what quantities to output
SET_BOOL_PROP(VtkMultiPhase, VtkWriteExtrusionFactor, false); SET_BOOL_PROP(VtkMultiPhase, VtkWriteExtrusionFactor, false);

View File

@ -40,8 +40,6 @@ NEW_TYPE_TAG(VtkPhasePresence);
// create the property tags needed for the primary variables module // create the property tags needed for the primary variables module
NEW_PROP_TAG(VtkWritePhasePresence); NEW_PROP_TAG(VtkWritePhasePresence);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
SET_BOOL_PROP(VtkPhasePresence, VtkWritePhasePresence, false); SET_BOOL_PROP(VtkPhasePresence, VtkWritePhasePresence, false);

View File

@ -36,15 +36,12 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
// create new type tag for the VTK primary variables output // create new type tag for the VTK primary variables output
NEW_PROP_TAG(EnableVtkOutput);
NEW_TYPE_TAG(VtkPrimaryVars); NEW_TYPE_TAG(VtkPrimaryVars);
// create the property tags needed for the primary variables module // create the property tags needed for the primary variables module
NEW_PROP_TAG(VtkWritePrimaryVars); NEW_PROP_TAG(VtkWritePrimaryVars);
NEW_PROP_TAG(VtkWriteProcessRank); NEW_PROP_TAG(VtkWriteProcessRank);
NEW_PROP_TAG(VtkWriteDofIndex); NEW_PROP_TAG(VtkWriteDofIndex);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
SET_BOOL_PROP(VtkPrimaryVars, VtkWritePrimaryVars, false); SET_BOOL_PROP(VtkPrimaryVars, VtkWritePrimaryVars, false);
SET_BOOL_PROP(VtkPrimaryVars, VtkWriteProcessRank, false); SET_BOOL_PROP(VtkPrimaryVars, VtkWriteProcessRank, false);

View File

@ -42,8 +42,6 @@ NEW_TYPE_TAG(VtkTemperature);
// create the property tags needed for the temperature module // create the property tags needed for the temperature module
NEW_PROP_TAG(VtkWriteTemperature); NEW_PROP_TAG(VtkWriteTemperature);
NEW_PROP_TAG(VtkOutputFormat);
NEW_PROP_TAG(EnableVtkOutput);
// set default values for what quantities to output // set default values for what quantities to output
SET_BOOL_PROP(VtkTemperature, VtkWriteTemperature, true); SET_BOOL_PROP(VtkTemperature, VtkWriteTemperature, true);

View File

@ -30,11 +30,20 @@
#include "ncpproperties.hh" #include "ncpproperties.hh"
#include <opm/models/nonlinear/newtonmethod.hh>
#include <opm/material/common/Unused.hpp> #include <opm/material/common/Unused.hpp>
#include <opm/material/common/Exceptions.hpp> #include <opm/material/common/Exceptions.hpp>
#include <algorithm> #include <algorithm>
BEGIN_PROPERTIES
template <class TypeTag, class MyTypeTag>
struct DiscNewtonMethod;
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -37,12 +37,6 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
//! Enable the energy equation?
NEW_PROP_TAG(EnableEnergy);
//! Enable diffusive fluxes?
NEW_PROP_TAG(EnableDiffusion);
//! The unmodified weight for the pressure primary variable //! The unmodified weight for the pressure primary variable
NEW_PROP_TAG(NcpPressureBaseWeight); NEW_PROP_TAG(NcpPressureBaseWeight);
//! The weight for the saturation primary variables //! The weight for the saturation primary variables

View File

@ -33,6 +33,7 @@
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.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/material/densead/Math.hpp> #include <opm/material/densead/Math.hpp>
#include <opm/material/common/Unused.hpp> #include <opm/material/common/Unused.hpp>
@ -65,48 +66,12 @@ BEGIN_PROPERTIES
//! are attached //! are attached
NEW_TYPE_TAG(NewtonMethod); NEW_TYPE_TAG(NewtonMethod);
//! The simulation management class of the simulation
NEW_PROP_TAG(Simulator);
//! The physical model which we would like to solve
NEW_PROP_TAG(Problem);
//! The model describing the PDEs for the conservation quantities
NEW_PROP_TAG(Model);
//! The type of scalar values
NEW_PROP_TAG(Scalar);
//! Specifies the type of the actual Newton method //! Specifies the type of the actual Newton method
NEW_PROP_TAG(NewtonMethod); NEW_PROP_TAG(NewtonMethod);
//! Specifies the type of a solution
NEW_PROP_TAG(SolutionVector);
//! Specifies the type of a solution for a single degee of freedom
NEW_PROP_TAG(PrimaryVariables);
//! Specifies whether the problem to be simulated exhibits contraint degrees of freedom
NEW_PROP_TAG(EnableConstraints);
//! Specifies the type of objects which specify constraints for a single degee of freedom
NEW_PROP_TAG(Constraints);
//! Vector containing a quantity of for equation on the whole grid
NEW_PROP_TAG(GlobalEqVector);
//! Vector containing a quantity of for equation for a single degee of freedom
NEW_PROP_TAG(EqVector);
//! The class which linearizes the non-linear system of equations //! The class which linearizes the non-linear system of equations
NEW_PROP_TAG(Linearizer); NEW_PROP_TAG(Linearizer);
//! Specifies the type of a global Jacobian matrix
NEW_PROP_TAG(SparseMatrixAdapter);
//! Specifies the type of the linear solver to be used
NEW_PROP_TAG(LinearSolverBackend);
//! Specifies whether the Newton method should print messages or not //! Specifies whether the Newton method should print messages or not
NEW_PROP_TAG(NewtonVerbose); NEW_PROP_TAG(NewtonVerbose);

View File

@ -34,10 +34,8 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
NEW_PROP_TAG(NewtonMethod); template <class TypeTag, class MyTypeTag>
struct NewtonMethod;
NEW_PROP_TAG(SolutionVector);
NEW_PROP_TAG(GlobalEqVector);
END_PROPERTIES END_PROPERTIES

View File

@ -38,12 +38,6 @@
#include <dune/common/version.hh> #include <dune/common/version.hh>
BEGIN_PROPERTIES
NEW_PROP_TAG(ThreadsPerProcess);
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -30,6 +30,15 @@
#include "pvsproperties.hh" #include "pvsproperties.hh"
#include <opm/models/nonlinear/newtonmethod.hh>
BEGIN_PROPERTIES
template <class TypeTag, class MyTypeTag>
struct DiscNewtonMethod;
END_PROPERTIES
namespace Opm { namespace Opm {
/*! /*!

View File

@ -40,11 +40,6 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
//! Specifies whether energy is considered as a conservation quantity or not
NEW_PROP_TAG(EnableEnergy);
//! Enable diffusive fluxes?
NEW_PROP_TAG(EnableDiffusion);
//! The verbosity of the model (0 -> do not print anything, 2 -> spam stdout a lot) //! The verbosity of the model (0 -> do not print anything, 2 -> spam stdout a lot)
NEW_PROP_TAG(PvsVerbosity); NEW_PROP_TAG(PvsVerbosity);
//! The basis value for the weight of the pressure primary variable //! The basis value for the weight of the pressure primary variable

View File

@ -34,9 +34,6 @@
// \{ // \{
BEGIN_PROPERTIES BEGIN_PROPERTIES
//! The fluid system used for the problem
NEW_PROP_TAG(FluidSystem);
//! The fluid used as the wetting phase (by default, we set the fluid //! The fluid used as the wetting phase (by default, we set the fluid
//! system to the immiscible one, which requires this property.) //! system to the immiscible one, which requires this property.)
NEW_PROP_TAG(WettingFluid); NEW_PROP_TAG(WettingFluid);

View File

@ -32,7 +32,6 @@
#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/models/io/dgfvanguard.hh>
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
#include <dune/fem/gridpart/adaptiveleafgridpart.hh> #include <dune/fem/gridpart/adaptiveleafgridpart.hh>
@ -65,15 +64,24 @@ NEW_TYPE_TAG(ImplicitModel, INHERITS_FROM(NumericModel));
//! Property to specify the type of scalar values. //! Property to specify the type of scalar values.
NEW_PROP_TAG(Scalar); NEW_PROP_TAG(Scalar);
//! Number of equations in the system of PDEs
NEW_PROP_TAG(NumEq);
//! Property which provides a Dune::ParameterTree. //! Property which provides a Dune::ParameterTree.
NEW_PROP_TAG(ParameterTree); NEW_PROP_TAG(ParameterTree);
//! The type of the model
NEW_PROP_TAG(Model);
//! Property which defines the group that is queried for parameters by default //! Property which defines the group that is queried for parameters by default
NEW_PROP_TAG(ModelParameterGroup); NEW_PROP_TAG(ModelParameterGroup);
//! Property which provides a Vanguard (manages grids) //! Property which provides a Vanguard (manages grids)
NEW_PROP_TAG(Vanguard); NEW_PROP_TAG(Vanguard);
//! The type of the DUNE grid
NEW_PROP_TAG(Grid);
NEW_PROP_TAG(GridView); NEW_PROP_TAG(GridView);
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
@ -116,6 +124,33 @@ NEW_PROP_TAG(RestartTime);
//! The name of the file with a number of forced time step lengths //! The name of the file with a number of forced time step lengths
NEW_PROP_TAG(PredeterminedTimeStepsFile); NEW_PROP_TAG(PredeterminedTimeStepsFile);
//! domain size
NEW_PROP_TAG(DomainSizeX);
NEW_PROP_TAG(DomainSizeY);
NEW_PROP_TAG(DomainSizeZ);
//! grid resolution
NEW_PROP_TAG(CellsX);
NEW_PROP_TAG(CellsY);
NEW_PROP_TAG(CellsZ);
//! name of the grid file
NEW_PROP_TAG(GridFile);
//! level of the grid view
NEW_PROP_TAG(GridViewLevel);
//! Manages the simulation time
NEW_PROP_TAG(Simulator);
/*!
* \brief The class which marks the border indices associated with the
* degrees of freedom on a process boundary.
*
* This is required for the algebraic overlap stuff.
*/
NEW_PROP_TAG(BorderListCreator);
/////////////////////////////////// ///////////////////////////////////
// Values for the properties // Values for the properties
/////////////////////////////////// ///////////////////////////////////
@ -138,9 +173,6 @@ SET_PROP(NumericModel, ParameterTree)
//! use the global group as default for the model's parameter group //! use the global group as default for the model's parameter group
SET_STRING_PROP(NumericModel, ModelParameterGroup, ""); SET_STRING_PROP(NumericModel, ModelParameterGroup, "");
//! Use the DgfVanguard by default
SET_TYPE_PROP(NumericModel, Vanguard, Opm::DgfVanguard<TypeTag>);
//! Set a value for the GridFile property //! Set a value for the GridFile property
SET_STRING_PROP(NumericModel, GridFile, ""); SET_STRING_PROP(NumericModel, GridFile, "");

View File

@ -74,8 +74,8 @@
* \endcode * \endcode
*/ */
#define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description) \ #define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description) \
::Opm::Parameters::registerParam<TypeTag, ParamType, PTAG(ParamName)>( \ ::Opm::Parameters::registerParam<TypeTag, ParamType>( \
#ParamName, #ParamName, Description) #ParamName, #ParamName, GET_PROP_VALUE(TypeTag, ParamName), Description)
/*! /*!
* \ingroup Parameter * \ingroup Parameter
@ -85,7 +85,7 @@
* This allows to deal with unused parameters * This allows to deal with unused parameters
*/ */
#define EWOMS_HIDE_PARAM(TypeTag, ParamName) \ #define EWOMS_HIDE_PARAM(TypeTag, ParamName) \
::Opm::Parameters::hideParam<TypeTag, PTAG(ParamName)>(#ParamName) ::Opm::Parameters::hideParam<TypeTag>(#ParamName, GET_PROP_VALUE(TypeTag, ParamName))
/*! /*!
* \ingroup Parameter * \ingroup Parameter
@ -115,14 +115,14 @@
* \endcode * \endcode
*/ */
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName) \ #define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName) \
(::Opm::Parameters::get<TypeTag, ParamType, PTAG(ParamName)>(#ParamName, \ (::Opm::Parameters::get<TypeTag, ParamType>(#ParamName, #ParamName, \
#ParamName)) GET_PROP_VALUE(TypeTag, ParamName)))
//!\cond SKIP_THIS //!\cond SKIP_THIS
#define EWOMS_GET_PARAM_(TypeTag, ParamType, ParamName) \ #define EWOMS_GET_PARAM_(TypeTag, ParamType, ParamName) \
(::Opm::Parameters::get<TypeTag, ParamType, PTAG(ParamName)>( \ (::Opm::Parameters::get<TypeTag, ParamType>(#ParamName, #ParamName, \
#ParamName, #ParamName, \ GET_PROP_VALUE(TypeTag, ParamName), \
/*errorIfNotRegistered=*/false)) /*errorIfNotRegistered=*/false))
/*! /*!
* \ingroup Parameter * \ingroup Parameter
@ -148,8 +148,7 @@
* If the parameter in question has not been registered, this throws an exception. * If the parameter in question has not been registered, this throws an exception.
*/ */
#define EWOMS_PARAM_IS_SET(TypeTag, ParamType, ParamName) \ #define EWOMS_PARAM_IS_SET(TypeTag, ParamType, ParamName) \
(::Opm::Parameters::isSet<TypeTag, ParamType, PTAG(ParamName)>(#ParamName, \ (::Opm::Parameters::isSet<TypeTag, ParamType>(#ParamName, #ParamName))
#ParamName))
namespace Opm { namespace Opm {
namespace Parameters { namespace Parameters {
@ -180,6 +179,11 @@ template <class TypeTag, class ParamType, class PropTag>
const ParamType get(const char *propTagName, const ParamType get(const char *propTagName,
const char *paramName, const char *paramName,
bool errorIfNotRegistered = true); bool errorIfNotRegistered = true);
template <class TypeTag, class ParamType>
const ParamType get(const char *propTagName,
const char *paramName,
const ParamType& defaultValue,
bool errorIfNotRegistered = true);
class ParamRegFinalizerBase_ class ParamRegFinalizerBase_
{ {
@ -189,12 +193,13 @@ public:
virtual void retrieve() = 0; virtual void retrieve() = 0;
}; };
template <class TypeTag, class ParamType, class PropTag> template <class TypeTag, class ParamType>
class ParamRegFinalizer_ : public ParamRegFinalizerBase_ class ParamRegFinalizer_ : public ParamRegFinalizerBase_
{ {
public: public:
ParamRegFinalizer_(const std::string& paramName) ParamRegFinalizer_(const std::string& paramName, const ParamType& defaultValue)
: paramName_(paramName) : paramName_(paramName)
, defaultValue_(defaultValue)
{} {}
virtual void retrieve() override virtual void retrieve() override
@ -202,13 +207,15 @@ public:
// retrieve the parameter once to make sure that its value does // retrieve the parameter once to make sure that its value does
// not contain a syntax error. // not contain a syntax error.
ParamType __attribute__((unused)) dummy = ParamType __attribute__((unused)) dummy =
get<TypeTag, ParamType, PropTag>(/*propTagName=*/paramName_.data(), get<TypeTag, ParamType>(/*propTagName=*/paramName_.data(),
paramName_.data(), paramName_.data(),
/*errorIfNotRegistered=*/true); defaultValue_,
/*errorIfNotRegistered=*/true);
} }
private: private:
std::string paramName_; std::string paramName_;
ParamType defaultValue_;
}; };
} // namespace Parameters } // namespace Parameters
@ -943,21 +950,28 @@ class Param
public: public:
template <class ParamType, class PropTag> template <class ParamType, class PropTag>
static const ParamType get(const char *propTagName, static ParamType get(const char *propTagName,
const char *paramName, const char *paramName,
bool errorIfNotRegistered = true) bool errorIfNotRegistered = true)
{ {
return retrieve_<ParamType, PropTag>(propTagName, return retrieve_<ParamType>(propTagName, paramName, getPropValue<TypeTag, PropTag>(), errorIfNotRegistered);
paramName,
errorIfNotRegistered);
} }
template <class ParamType>
static ParamType get(const char *propTagName,
const char *paramName,
const ParamType& defaultValue,
bool errorIfNotRegistered = true)
{
return retrieve_<ParamType>(propTagName, paramName, defaultValue, errorIfNotRegistered);
}
static void clear() static void clear()
{ {
ParamsMeta::clear(); ParamsMeta::clear();
} }
template <class ParamType, class PropTag> template <class ParamType>
static bool isSet(const char *propTagName OPM_OPTIM_UNUSED, static bool isSet(const char *propTagName OPM_OPTIM_UNUSED,
const char *paramName OPM_OPTIM_UNUSED, const char *paramName OPM_OPTIM_UNUSED,
bool errorIfNotRegistered = true) bool errorIfNotRegistered = true)
@ -1035,10 +1049,11 @@ private:
} }
} }
template <class ParamType, class PropTag> template <class ParamType>
static const ParamType retrieve_(const char OPM_OPTIM_UNUSED *propTagName, static ParamType retrieve_(const char OPM_OPTIM_UNUSED *propTagName,
const char *paramName, const char *paramName,
bool errorIfNotRegistered = true) const ParamType& defaultValue,
bool errorIfNotRegistered = true)
{ {
#ifndef NDEBUG #ifndef NDEBUG
// make sure that the parameter is used consistently. since // make sure that the parameter is used consistently. since
@ -1066,8 +1081,7 @@ private:
std::string canonicalName(paramName); std::string canonicalName(paramName);
// retrieve actual parameter from the parameter tree // retrieve actual parameter from the parameter tree
const ParamType defaultValue = GET_PROP_VALUE_(TypeTag, PropTag); return ParamsMeta::tree().template get<ParamType>(canonicalName, defaultValue);
return ParamsMeta::tree().template get<ParamType>(canonicalName, defaultValue );
} }
}; };
@ -1079,6 +1093,12 @@ const ParamType get(const char *propTagName, const char *paramName, bool errorIf
errorIfNotRegistered); errorIfNotRegistered);
} }
template <class TypeTag, class ParamType>
const ParamType get(const char *propTagName, const char *paramName, const ParamType& defaultValue, bool errorIfNotRegistered)
{
return Param<TypeTag>::template get<ParamType>(propTagName, paramName, defaultValue, errorIfNotRegistered);
}
template <class TypeTag, class Container> template <class TypeTag, class Container>
void getLists(Container& usedParams, Container& unusedParams) void getLists(Container& usedParams, Container& unusedParams)
{ {
@ -1113,16 +1133,16 @@ void reset()
return Param<TypeTag>::clear(); return Param<TypeTag>::clear();
} }
template <class TypeTag, class ParamType, class PropTag> template <class TypeTag, class ParamType>
bool isSet(const char *propTagName, const char *paramName, bool errorIfNotRegistered = true) bool isSet(const char *propTagName, const char *paramName, bool errorIfNotRegistered = true)
{ {
return Param<TypeTag>::template isSet<ParamType, PropTag>(propTagName, return Param<TypeTag>::template isSet<ParamType>(propTagName,
paramName, paramName,
errorIfNotRegistered); errorIfNotRegistered);
} }
template <class TypeTag, class ParamType, class PropTag> template <class TypeTag, class ParamType>
void registerParam(const char *paramName, const char *propertyName, const char *usageString) void registerParam(const char *paramName, const char *propertyName, const ParamType& defaultValue, const char *usageString)
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
if (!ParamsMeta::registrationOpen()) if (!ParamsMeta::registrationOpen())
@ -1130,7 +1150,7 @@ void registerParam(const char *paramName, const char *propertyName, const char *
"the parameter '"+std::string(paramName)+"' was registered."); "the parameter '"+std::string(paramName)+"' was registered.");
ParamsMeta::registrationFinalizers().emplace_back( ParamsMeta::registrationFinalizers().emplace_back(
new ParamRegFinalizer_<TypeTag, ParamType, PropTag>(paramName)); new ParamRegFinalizer_<TypeTag, ParamType>(paramName, defaultValue));
ParamInfo paramInfo; ParamInfo paramInfo;
paramInfo.paramName = paramName; paramInfo.paramName = paramName;
@ -1140,7 +1160,7 @@ void registerParam(const char *paramName, const char *propertyName, const char *
paramInfo.propertyName = propertyName; paramInfo.propertyName = propertyName;
paramInfo.usageString = usageString; paramInfo.usageString = usageString;
std::ostringstream oss; std::ostringstream oss;
oss << GET_PROP_VALUE_(TypeTag, PropTag); oss << defaultValue;
paramInfo.compileTimeValue = oss.str(); paramInfo.compileTimeValue = oss.str();
paramInfo.isHidden = false; paramInfo.isHidden = false;
if (ParamsMeta::registry().find(paramName) != ParamsMeta::registry().end()) { if (ParamsMeta::registry().find(paramName) != ParamsMeta::registry().end()) {
@ -1155,13 +1175,9 @@ void registerParam(const char *paramName, const char *propertyName, const char *
ParamsMeta::mutableRegistry()[paramName] = paramInfo; ParamsMeta::mutableRegistry()[paramName] = paramInfo;
} }
template <class TypeTag, class PropTag> template <class TypeTag, class ParamType>
void hideParam(const char *paramName) void hideParam(const char *paramName, const ParamType& defaultValue)
{ {
// make sure that a property with the parameter name exists. we cannot check if a
// parameter exists at compile time, so this will only be caught at runtime
static const auto defaultValue OPM_UNUSED = GET_PROP_VALUE_(TypeTag, PropTag);
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
if (!ParamsMeta::registrationOpen()) if (!ParamsMeta::registrationOpen())
throw std::logic_error("Parameter '"+std::string(paramName)+"' declared as hidden" throw std::logic_error("Parameter '"+std::string(paramName)+"' declared as hidden"

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,378 @@
// -*- 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 3 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 *
* MERCHANTBILITY 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
* \ingroup Properties
* \brief Provides the magic behind the DuMuX property system.
*
* Properties allow to associate arbitrary data types to
* identifiers. A property is always defined on a pair (TypeTag,
* PropertyTag) where TypeTag is the identifier for the object the
* property is defined for and PropertyTag is an unique identifier of
* the property.
*
* Type tags are hierarchic and inherit properties defined on their
* ancesters. At each level, properties defined on lower levels can be
* overwritten or even made undefined. It is also possible to define
* defaults for properties if it makes sense.
*
* Properties may make use other properties for the respective type
* tag and these properties can also be defined on an arbitrary level
* of the hierarchy.
*/
#ifndef OPM_PROPERTY_SYSTEM_MACROS_HH
#define OPM_PROPERTY_SYSTEM_MACROS_HH
#warning "Property macros are deprecated and will be removed after release 2021.04. \
If you are not using property macros you can disable this warning by \
setting OPM_ENABLE_OLD_PROPERTY_MACROS to 0 (false) when configuring OPM. \
OPM_ENABLE_OLD_PROPERTY_MACROS defaults to 1 (true) until release 2020.10. \
After release 2020.10 it will default to 0 (false) so you will have to manually \
enable property macros in order to use them."
#include <opm/models/utils/propertysystem.hh>
namespace Opm {
namespace Properties {
namespace TTag {}
/*!
* \brief Makes a type out of a type tag name
*/
#define TTAG(TypeTagName) ::Opm::Properties::TTag::TypeTagName
/*!
* \brief Makes a type out of a property tag name
*/
//#define PTAG(PropTagName) PropTagName
/*!
* \brief Makes a type out of a property tag name
*/
#define PTAG_(PropTagName) ::Opm::Properties::PropTagName
// in the old property system the order in inherit_from was the other way around
// this flips the order of a tuple to restore old behaviour when using the macro.
// when you are using non-macro version make sure to flip the order.
template<class Tuple, class IndexSequence>
struct ReverseTupleImpl;
template<class Tuple, size_t... I>
struct ReverseTupleImpl<Tuple, std::index_sequence<I...>>
{
using type = std::tuple<std::tuple_element_t<sizeof...(I) - 1 - I, Tuple>...>;
};
// revert tuple argument order
template<class Tuple>
using ReverseTuple = typename ReverseTupleImpl<Tuple, std::make_index_sequence<std::tuple_size<Tuple>::value>>::type;
// a temporary hack to make the macro still work, we set using InheritsFrom = void,
// which gets picked up by the new property as non inheritance, this can be removed
// once all macros are gone
namespace Detail {
template<class TypeTagTuple>
struct GetTypeTagInheritance;
template<class OneTypeTag>
struct GetTypeTagInheritance<std::tuple<OneTypeTag>>
{
using type = void;
};
template<class FirstTypeTag, class ...OtherTypeTags>
struct GetTypeTagInheritance<std::tuple<FirstTypeTag, OtherTypeTags...>>
{
// reverse order to restore old behaviour
using type = ReverseTuple<std::tuple<OtherTypeTags...>>;
};
} // end namespace Detail
/*!
* \ingroup Properties
* \brief Define a new type tag.
*
* A type tag can inherit the properties defined on up to five parent
* type tags. Examples:
*
* \code
* // The type tag doesn't inherit any properties from other type tags
* NEW_TYPE_TAG(FooTypeTag);
*
* // BarTypeTag inherits all properties from FooTypeTag
* NEW_TYPE_TAG(BarTypeTag, INHERITS_FROM(FooTypeTag));
*
* // FooBarTypeTag inherits the properties of FooTypeTag as well as
* // those of BarTypeTag. Properties defined on BarTypeTag have
* // preceedence over those defined for FooTypeTag:
* NEW_TYPE_TAG(FooBarTypeTag, INHERITS_FROM(FooTypeTag, BarTypeTag));
* \endcode
*/
#define OPM_GET_HEAD_(Arg1, ...) Arg1
#define NEW_TYPE_TAG(...) \
namespace TTag { \
struct OPM_GET_HEAD_(__VA_ARGS__) \
{ using InheritsFrom = Detail::GetTypeTagInheritance<std::tuple<__VA_ARGS__>>::type; }; \
} extern int semicolonHack_
/*!
* \ingroup Properties
* \brief Syntactic sugar for NEW_TYPE_TAG.
*
* See the documentation for NEW_TYPE_TAG.
*/
#define INHERITS_FROM(...) __VA_ARGS__
/*!
* \ingroup Properties
* \brief Define a property tag.
*
* A property tag is the unique identifier for a property. It may only
* be declared once in your program. There is also no hierarchy of
* property tags as for type tags.
*
* Examples:
*
* \code
* NEW_PROP_TAG(blubbPropTag);
* NEW_PROP_TAG(blabbPropTag);
* \endcode
*/
#define NEW_PROP_TAG(PTagName) \
template<class TypeTag, class MyTypeTag> \
struct PTagName { using type = UndefinedProperty; }; \
extern int semicolonHack_
/*!
* \ingroup Properties
* \brief Set a property for a specific type tag.
*
* After this macro, you must to specify a complete body of a class
* template, including the trailing semicolon. If you need to retrieve
* another property within the class body, you can use TypeTag as the
* argument for the type tag for the GET_PROP macro.
*
* Example:
*
* \code
* SET_PROP(FooTypeTag, blubbPropTag)
* {
* static int value = 10;
* static int calculate(int arg)
* { calculateInternal_(arg); }
*
* private:
* // retrieve the blabbProp property for the real TypeTag the
* // property is defined on. Note that blabbProb does not need to
* // be defined on FooTypeTag, but can also be defined for some
* // derived type tag.
* using blabb = typename GET_PROP(TypeTag, blabbProp);
*
* static int calculateInternal_(int arg)
* { return arg * blabb::value; };
* \endcode
* };
*/
#define SET_PROP(EffTypeTagName, PropTagName) \
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)>
/*!
* \ingroup Properties
* \brief Set a property to a simple constant integer value.
*
* The constant can be accessed by the 'value' attribute.
*/
#define SET_INT_PROP(EffTypeTagName, PropTagName, /*Value*/...) \
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
using type = int; \
static constexpr int value = __VA_ARGS__; \
}
/*!
* \ingroup Properties
* \brief Set a property to a simple constant boolean value.
*
* The constant can be accessed by the 'value' attribute.
*/
#define SET_BOOL_PROP(EffTypeTagName, PropTagName, /*Value*/...) \
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
using type = bool; \
static constexpr bool value = __VA_ARGS__; \
}
/*!
* \ingroup Properties
* \brief Set a property which defines a type.
*
* The type can be accessed by the 'type' attribute.
*/
#define SET_TYPE_PROP(EffTypeTagName, PropTagName, /*Value*/...) \
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
using type = __VA_ARGS__; \
}
template <class TypeTag, class MyTypeTag>
struct Scalar;
/*!
* \ingroup Properties
* \brief Set a property to a simple constant scalar value.
*
* The constant can be accessed by the 'value' attribute. In order to
* use this macro, the property tag "Scalar" needs to be defined for
* the real type tag.
*/
#define SET_SCALAR_PROP(EffTypeTagName, PropTagName, ...) \
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
using Scalar = Opm::GetPropType<TypeTag, Scalar>; \
public: \
using type = Scalar; \
static const Scalar value; \
}; \
template <class TypeTag> \
const typename PropTagName<TypeTag, TTAG(EffTypeTagName)>::type \
PropTagName<TypeTag, TTAG(EffTypeTagName)>::value(__VA_ARGS__)
/*!
* \ingroup Properties
* \brief Set a property to a simple constant string value.
*
* The constant can be accessed by the 'value' attribute and is of
* type std::string.
*/
#define SET_STRING_PROP(EffTypeTagName, PropTagName, ...) \
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
public: \
using type = std::string; \
static const std::string value; \
}; \
template <class TypeTag> \
const typename PropTagName<TypeTag, TTAG(EffTypeTagName)>::type \
PropTagName<TypeTag, TTAG(EffTypeTagName)>::value(__VA_ARGS__)
// getters
#define GET_PROP(TypeTag, PropTagName) ::Opm::Properties::Detail::GetPropImpl<TypeTag, PTAG_(PropTagName)>::type
#define GET_PROP_VALUE(TypeTag, PropTagName) ::Opm::Properties::Detail::GetPropImpl<TypeTag, PTAG_(PropTagName)>::type::value
#define GET_PROP_TYPE(TypeTag, PropTagName) ::Opm::Properties::Detail::GetPropImpl<TypeTag, PTAG_(PropTagName)>::type::type
/*!
* \ingroup Properties
* \brief Define splices for a given type tag.
*
* Splices can be seen as children which can be overridden lower in
* the hierarchy. It can thus be seen as a "deferred inheritance"
* mechanism. Example:
*
* \code
* // First, define type tags for two different linear solvers:
* // BiCGStab and SuperLU. The first needs the "MaxIterations"
* // property, the second defines the "UsePivoting" property.
* NEW_TYPE_TAG(BiCGStabSolver);
* NEW_PROP_TAG(MaxIterations);
* SET_INT_PROP(BiCGStabSolver, MaxIterations, 100);
*
* NEW_TYPE_TAG(SuperLUSolver);
* NEW_PROP_TAG(UsePivoting);
* SET_BOOL_PROP(SuperLUSolver, UsePivoting, true);
*
* // The model type tag defines the splice 'LinearSolver' and sets it
* // to the 'BiCGStabSolver' type tag.
* NEW_TYPE_TAG(ModelTypeTag);
* NEW_PROP_TAG(LinearSolver);
* SET_SPLICES(ModelTypeTag, LinearSolver);
* SET_TAG_PROP(ModelTypeTag, LinearSolver, BiCGStabSolver);
*
* // The problem type tag is derived from the model type tag, but uses
* // the SuperLU solver. Since this is done using a splice, all properties
* // defined for the "SuperLUSolver" are inherited and the ones for the
* // BiCGStabSolver type tag are undefined
* NEW_TYPE_TAG(ProblemTypeTag, INHERITS_FROM(ModelTypeTag));
* SET_TAG_PROP(ProblemTypeTag, LinearSolver, SuperLUSolver);
* \endcode
*/
#define SET_ONE_SPLICE(TypeTagName, SpliceName) \
template<class TypeTag> \
struct Splices<TypeTag, TTag::TypeTagName> \
{ \
using type = std::tuple<GetSplicePropType<TypeTag, TTag::TypeTagName, Properties::SpliceName>>; \
}; \
extern int semicolonHack_
#define SET_TWO_SPLICES(TypeTagName, SpliceName1, SpliceName2) \
template<class TypeTag> \
struct Splices<TypeTag, TTag::TypeTagName> \
{ \
using type = std::tuple<GetSplicePropType<TypeTag, TTag::TypeTagName, Properties::SpliceName1>, \
GetSplicePropType<TypeTag, TTag::TypeTagName, Properties::SpliceName2>>; \
}; \
extern int semicolonHack_
#define SET_THREE_SPLICES(TypeTagName, SpliceName1, SpliceName2, SpliceName3) \
template<class TypeTag> \
struct Splices<TypeTag, TTag::TypeTagName> \
{ \
using type = std::tuple<GetSplicePropType<TypeTag, TTag::TypeTagName, Properties::SpliceName1>, \
GetSplicePropType<TypeTag, TTag::TypeTagName, Properties::SpliceName2>, \
GetSplicePropType<TypeTag, TTag::TypeTagName, Properties::SpliceName3>>; \
}; \
extern int semicolonHack_
// From https://stackoverflow.com/questions/11761703/overloading-macro-on-number-of-arguments
#define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME
#define SET_SPLICES(...) GET_MACRO(__VA_ARGS__, SET_THREE_SPLICES, SET_TWO_SPLICES, SET_ONE_SPLICE)(__VA_ARGS__)
#define SET_PROP_(EffTypeTagName, PropKind, PropTagName, ...) \
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)>
/*!
* \ingroup Properties
* \brief Define a property containing a type tag.
*
* This is convenient for splices.
*/
#define SET_TAG_PROP(EffTypeTagName, PropTagName, ValueTypeTagName) \
SET_PROP_(EffTypeTagName, \
/*kind=*/"tag ", \
PropTagName, \
/*value=*/TTAG(ValueTypeTagName)) \
{ \
typedef TTAG(ValueTypeTagName) type; \
}
} // namespace Properties
} // namespace Opm
#endif // OPM_PROPERTY_SYSTEM_HH

View File

@ -35,6 +35,7 @@
#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/models/parallel/mpiutil.hh> #include <opm/models/parallel/mpiutil.hh>
#include <opm/models/discretization/common/fvbaseproperties.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
#include <dune/common/parallel/mpihelper.hh> #include <dune/common/parallel/mpihelper.hh>
@ -46,20 +47,6 @@
#include <string> #include <string>
#include <memory> #include <memory>
BEGIN_PROPERTIES
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Vanguard);
NEW_PROP_TAG(GridView);
NEW_PROP_TAG(Model);
NEW_PROP_TAG(Problem);
NEW_PROP_TAG(EndTime);
NEW_PROP_TAG(RestartTime);
NEW_PROP_TAG(InitialTimeStepSize);
NEW_PROP_TAG(PredeterminedTimeStepsFile);
END_PROPERTIES
#define EWOMS_CATCH_PARALLEL_EXCEPTIONS_FATAL(code) \ #define EWOMS_CATCH_PARALLEL_EXCEPTIONS_FATAL(code) \
{ \ { \
const auto& comm = Dune::MPIHelper::getCollectiveCommunication(); \ const auto& comm = Dune::MPIHelper::getCollectiveCommunication(); \
@ -984,6 +971,11 @@ private:
bool finished_; bool finished_;
bool verbose_; bool verbose_;
}; };
namespace Properties {
SET_TYPE_PROP(NumericModel, Simulator, Opm::Simulator<TypeTag>);
}
} // namespace Opm } // namespace Opm
#endif #endif

View File

@ -27,6 +27,7 @@
#ifndef EWOMS_START_HH #ifndef EWOMS_START_HH
#define EWOMS_START_HH #define EWOMS_START_HH
#include <opm/models/utils/propertysystemmacros.hh>
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
// the following header is not required here, but it must be included before // the following header is not required here, but it must be included before
// dune/common/densematrix.hh because of some c++ ideosyncrasies // dune/common/densematrix.hh because of some c++ ideosyncrasies
@ -68,19 +69,6 @@
#include <mpi.h> #include <mpi.h>
#endif #endif
BEGIN_PROPERTIES
// forward declaration of property tags
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(Simulator);
NEW_PROP_TAG(ThreadManager);
NEW_PROP_TAG(PrintProperties);
NEW_PROP_TAG(PrintParameters);
NEW_PROP_TAG(ParameterFile);
NEW_PROP_TAG(Problem);
END_PROPERTIES
//! \cond SKIP_THIS //! \cond SKIP_THIS
namespace Opm { namespace Opm {

View File

@ -45,20 +45,12 @@
#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/linalgproperties.hh>
#include <dune/istl/preconditioners.hh> #include <dune/istl/preconditioners.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
BEGIN_PROPERTIES
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(SparseMatrixAdapter);
NEW_PROP_TAG(OverlappingMatrix);
NEW_PROP_TAG(OverlappingVector);
NEW_PROP_TAG(PreconditionerOrder);
NEW_PROP_TAG(PreconditionerRelaxation);
END_PROPERTIES
namespace Opm { namespace Opm {
namespace Linear { namespace Linear {
#define EWOMS_WRAP_ISTL_PRECONDITIONER(PREC_NAME, ISTL_PREC_TYPE) \ #define EWOMS_WRAP_ISTL_PRECONDITIONER(PREC_NAME, ISTL_PREC_TYPE) \

View File

@ -45,22 +45,10 @@
#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/linalgproperties.hh>
#include <dune/istl/solvers.hh> #include <dune/istl/solvers.hh>
BEGIN_PROPERTIES
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(SparseMatrixAdapter);
NEW_PROP_TAG(OverlappingMatrix);
NEW_PROP_TAG(OverlappingVector);
NEW_PROP_TAG(GMResRestart);
NEW_PROP_TAG(LinearSolverTolerance);
NEW_PROP_TAG(LinearSolverMaxIterations);
NEW_PROP_TAG(LinearSolverVerbosity);
END_PROPERTIES
namespace Opm { namespace Opm {
namespace Linear { namespace Linear {

View File

@ -0,0 +1,103 @@
// -*- 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 properties required by the black oil model.
*/
#ifndef EWOMS_LINALG_PROPERTIES_HH
#define EWOMS_LINALG_PROPERTIES_HH
#include <opm/models/utils/basicproperties.hh>
BEGIN_PROPERTIES
//! The type of the linear solver to be used
NEW_PROP_TAG(LinearSolverBackend);
//! the preconditioner used by the linear solver
NEW_PROP_TAG(PreconditionerWrapper);
//! The floating point type used internally by the linear solver
NEW_PROP_TAG(LinearSolverScalar);
/*!
* \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.
*/
NEW_PROP_TAG(LinearSolverOverlapSize);
/*!
* \brief Maximum accepted error of the solution of the linear solver.
*/
NEW_PROP_TAG(LinearSolverTolerance);
/*!
* \brief Maximum accepted error of the norm of the residual.
*/
NEW_PROP_TAG(LinearSolverAbsTolerance);
/*!
* \brief Specifies the verbosity of the linear solver
*
* By default it is 0, i.e. it doesn't print anything. Setting this
* property to 1 prints aggregated convergence rates, 2 prints the
* convergence rate of every iteration of the scheme.
*/
NEW_PROP_TAG(LinearSolverVerbosity);
//! Maximum number of iterations eyecuted by the linear solver
NEW_PROP_TAG(LinearSolverMaxIterations);
//! The order of the sequential preconditioner
NEW_PROP_TAG(PreconditionerOrder);
//! The relaxation factor of the preconditioner
NEW_PROP_TAG(PreconditionerRelaxation);
//! number of iterations between solver restarts for the GMRES solver
NEW_PROP_TAG(GMResRestart);
//! The class that allows to manipulate sparse matrices
NEW_PROP_TAG(SparseMatrixAdapter);
//! Vector containing a quantity of for equation for each DOF of the whole grid
NEW_PROP_TAG(GlobalEqVector);
NEW_PROP_TAG(AmgCoarsenTarget);
NEW_PROP_TAG(LinearSolverMaxError);
NEW_PROP_TAG(LinearSolverWrapper);
NEW_PROP_TAG(Overlap);
NEW_PROP_TAG(OverlappingLinearOperator);
NEW_PROP_TAG(OverlappingMatrix);
NEW_PROP_TAG(OverlappingScalarProduct);
NEW_PROP_TAG(OverlappingVector);
END_PROPERTIES
#endif

View File

@ -27,6 +27,7 @@
#ifndef EWOMS_PARALLEL_AMG_BACKEND_HH #ifndef EWOMS_PARALLEL_AMG_BACKEND_HH
#define EWOMS_PARALLEL_AMG_BACKEND_HH #define EWOMS_PARALLEL_AMG_BACKEND_HH
#include "linalgproperties.hh"
#include "parallelbasebackend.hh" #include "parallelbasebackend.hh"
#include "bicgstabsolver.hh" #include "bicgstabsolver.hh"
#include "combinedcriterion.hh" #include "combinedcriterion.hh"
@ -51,9 +52,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(ParallelAmgLinearSolver, INHERITS_FROM(ParallelBaseLinearSolver)); NEW_TYPE_TAG(ParallelAmgLinearSolver, INHERITS_FROM(ParallelBaseLinearSolver));
NEW_PROP_TAG(AmgCoarsenTarget);
NEW_PROP_TAG(LinearSolverMaxError);
//! The target number of DOFs per processor for the parallel algebraic //! The target number of DOFs per processor for the parallel algebraic
//! multi-grid solver //! multi-grid solver
SET_INT_PROP(ParallelAmgLinearSolver, AmgCoarsenTarget, 5000); SET_INT_PROP(ParallelAmgLinearSolver, AmgCoarsenTarget, 5000);

View File

@ -40,6 +40,7 @@
#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/matrixblock.hh>
#include <opm/simulators/linalg/linalgproperties.hh>
#include <dune/grid/io/file/vtk/vtkwriter.hh> #include <dune/grid/io/file/vtk/vtkwriter.hh>
@ -53,69 +54,6 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
NEW_TYPE_TAG(ParallelBaseLinearSolver); NEW_TYPE_TAG(ParallelBaseLinearSolver);
// forward declaration of the required property tags
NEW_PROP_TAG(Simulator);
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(NumEq);
NEW_PROP_TAG(SparseMatrixAdapter);
NEW_PROP_TAG(GlobalEqVector);
NEW_PROP_TAG(VertexMapper);
NEW_PROP_TAG(GridView);
NEW_PROP_TAG(BorderListCreator);
NEW_PROP_TAG(Overlap);
NEW_PROP_TAG(OverlappingVector);
NEW_PROP_TAG(OverlappingMatrix);
NEW_PROP_TAG(OverlappingScalarProduct);
NEW_PROP_TAG(OverlappingLinearOperator);
//! The type of the linear solver to be used
NEW_PROP_TAG(LinearSolverBackend);
//! the preconditioner used by the linear solver
NEW_PROP_TAG(PreconditionerWrapper);
//! The floating point type used internally by the linear solver
NEW_PROP_TAG(LinearSolverScalar);
/*!
* \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.
*/
NEW_PROP_TAG(LinearSolverOverlapSize);
/*!
* \brief Maximum accepted error of the solution of the linear solver.
*/
NEW_PROP_TAG(LinearSolverTolerance);
/*!
* \brief Maximum accepted error of the norm of the residual.
*/
NEW_PROP_TAG(LinearSolverAbsTolerance);
/*!
* \brief Specifies the verbosity of the linear solver
*
* By default it is 0, i.e. it doesn't print anything. Setting this
* property to 1 prints aggregated convergence rates, 2 prints the
* convergence rate of every iteration of the scheme.
*/
NEW_PROP_TAG(LinearSolverVerbosity);
//! Maximum number of iterations eyecuted by the linear solver
NEW_PROP_TAG(LinearSolverMaxIterations);
//! The order of the sequential preconditioner
NEW_PROP_TAG(PreconditionerOrder);
//! The relaxation factor of the preconditioner
NEW_PROP_TAG(PreconditionerRelaxation);
//! Set the type of a global jacobian matrix for linear solvers that are based on //! Set the type of a global jacobian matrix for linear solvers that are based on
//! dune-istl. //! dune-istl.
SET_PROP(ParallelBaseLinearSolver, SparseMatrixAdapter) SET_PROP(ParallelBaseLinearSolver, SparseMatrixAdapter)

View File

@ -27,6 +27,7 @@
#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 "parallelbasebackend.hh" #include "parallelbasebackend.hh"
#include "bicgstabsolver.hh" #include "bicgstabsolver.hh"
#include "combinedcriterion.hh" #include "combinedcriterion.hh"
@ -44,8 +45,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(ParallelBiCGStabLinearSolver, INHERITS_FROM(ParallelBaseLinearSolver)); NEW_TYPE_TAG(ParallelBiCGStabLinearSolver, INHERITS_FROM(ParallelBaseLinearSolver));
NEW_PROP_TAG(LinearSolverMaxError);
SET_TYPE_PROP(ParallelBiCGStabLinearSolver, SET_TYPE_PROP(ParallelBiCGStabLinearSolver,
LinearSolverBackend, LinearSolverBackend,
Opm::Linear::ParallelBiCGStabSolverBackend<TypeTag>); Opm::Linear::ParallelBiCGStabSolverBackend<TypeTag>);

View File

@ -27,6 +27,7 @@
#ifndef EWOMS_PARALLEL_ISTL_BACKEND_HH #ifndef EWOMS_PARALLEL_ISTL_BACKEND_HH
#define EWOMS_PARALLEL_ISTL_BACKEND_HH #define EWOMS_PARALLEL_ISTL_BACKEND_HH
#include "linalgproperties.hh"
#include "parallelbasebackend.hh" #include "parallelbasebackend.hh"
#include "istlsolverwrappers.hh" #include "istlsolverwrappers.hh"
#include "istlsparsematrixadapter.hh" #include "istlsparsematrixadapter.hh"
@ -37,12 +38,6 @@ BEGIN_PROPERTIES
NEW_TYPE_TAG(ParallelIstlLinearSolver, INHERITS_FROM(ParallelBaseLinearSolver)); NEW_TYPE_TAG(ParallelIstlLinearSolver, INHERITS_FROM(ParallelBaseLinearSolver));
NEW_PROP_TAG(LinearSolverWrapper);
NEW_PROP_TAG(SparseMatrixAdapter);
//! number of iterations between solver restarts for the GMRES solver
NEW_PROP_TAG(GMResRestart);
END_PROPERTIES END_PROPERTIES
namespace Opm { namespace Opm {

View File

@ -31,6 +31,7 @@
#include <opm/models/linear/istlsparsematrixbackend.hh> #include <opm/models/linear/istlsparsematrixbackend.hh>
#include <opm/models/utils/parametersystem.hh> #include <opm/models/utils/parametersystem.hh>
#include <opm/simulators/linalg/linalgproperties.hh>
#include <opm/material/common/Unused.hpp> #include <opm/material/common/Unused.hpp>
@ -40,14 +41,6 @@
BEGIN_PROPERTIES BEGIN_PROPERTIES
// forward declaration of the required property tags
NEW_PROP_TAG(Scalar);
NEW_PROP_TAG(NumEq);
NEW_PROP_TAG(Simulator);
NEW_PROP_TAG(SparseMatrixAdapter);
NEW_PROP_TAG(GlobalEqVector);
NEW_PROP_TAG(LinearSolverVerbosity);
NEW_PROP_TAG(LinearSolverBackend);
NEW_TYPE_TAG(SuperLULinearSolver); NEW_TYPE_TAG(SuperLULinearSolver);
END_PROPERTIES END_PROPERTIES

View File

@ -32,6 +32,7 @@
#include "config.h" #include "config.h"
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/propertysystemmacros.hh>
#include <iostream> #include <iostream>
@ -120,10 +121,6 @@ SET_INT_PROP(Pickup, Payload, 5);
SET_INT_PROP(HummerH1, TopSpeed, GET_PROP_VALUE(TTAG(Pickup), TopSpeed)); SET_INT_PROP(HummerH1, TopSpeed, GET_PROP_VALUE(TTAG(Pickup), TopSpeed));
///////////////////
// Unmount the canon from the Hummer
UNSET_PROP(HummerH1, CanonCaliber);
END_PROPERTIES END_PROPERTIES
@ -176,23 +173,6 @@ int main()
std::cout << "(HummerH1, GasUsage) = " << GET_PROP_VALUE(TTAG(HummerH1), GasUsage) << "\n"; std::cout << "(HummerH1, GasUsage) = " << GET_PROP_VALUE(TTAG(HummerH1), GasUsage) << "\n";
std::cout << "(HummerH1, Payload) = " << GET_PROP_VALUE(TTAG(HummerH1), Payload) << "\n"; std::cout << "(HummerH1, Payload) = " << GET_PROP_VALUE(TTAG(HummerH1), Payload) << "\n";
std::cout << "(HummerH1, AutomaticTransmission) = " << GET_PROP_VALUE(TTAG(HummerH1), AutomaticTransmission) << "\n"; std::cout << "(HummerH1, AutomaticTransmission) = " << GET_PROP_VALUE(TTAG(HummerH1), AutomaticTransmission) << "\n";
// CanonCaliber is explcitly unset for the Hummer -> this would not compile:
// std::cout << "(HummerH1, CanonCaliber) = " << GET_PROP_VALUE(TTAG(HummerH1), CanonCaliber) << "\n";
std::cout << "\n";
std::cout << "---------------------------------------\n";
std::cout << "-- Diagnostic messages\n";
std::cout << "---------------------------------------\n";
std::cout << "---- All properties for Sedan ---\n";
Opm::Properties::printValues<TTAG(Sedan)>();
std::cout << "---- Message for (HummerH1, CanonCaliber) ---\n"
<< PROP_DIAGNOSTIC(TTAG(HummerH1), CanonCaliber);
std::cout << "---- Message for (HummerH1, GasUsage) ---\n"
<< PROP_DIAGNOSTIC(TTAG(HummerH1), GasUsage);
std::cout << "---- Message for (HummerH1, AutomaticTransmission) ---\n"
<< PROP_DIAGNOSTIC(TTAG(HummerH1), AutomaticTransmission);
return 0; return 0;
} }