[properties] replace remaining macro calls

This commit is contained in:
Bernd Flemisch 2020-06-10 13:07:19 +02:00
parent b809e9a4f7
commit bdb7bac3e8
65 changed files with 519 additions and 334 deletions

View File

@ -52,10 +52,10 @@ template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; }; struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
// use the flash solver adapted to the CO2 injection problem // use the flash solver adapted to the CO2 injection problem
SET_TYPE_PROP( template<class TypeTag>
Co2InjectionFlashEcfvProblem, FlashSolver, struct FlashSolver<TypeTag, TTag::Co2InjectionFlashEcfvProblem>
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>, { using type = Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>); GetPropType<TypeTag, Properties::FluidSystem>>; };
// the flash model has serious problems with the numerical // the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it, // precision. if quadruple precision math is available, we use it,

View File

@ -52,10 +52,10 @@ template<class TypeTag>
struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; }; struct LocalLinearizerSplice<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem> { using type = TTag::AutoDiffLocalLinearizer; };
// use the CO2 injection problem adapted flash solver // use the CO2 injection problem adapted flash solver
SET_TYPE_PROP( template<class TypeTag>
Co2InjectionFlashNiEcfvProblem, FlashSolver, struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiEcfvProblem>
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>, { using type = Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>); GetPropType<TypeTag, Properties::FluidSystem>>; };
// the flash model has serious problems with the numerical // the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it, // precision. if quadruple precision math is available, we use it,

View File

@ -48,10 +48,10 @@ template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem> { static constexpr bool value = true; }; struct EnableEnergy<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem> { static constexpr bool value = true; };
// use the CO2 injection problem adapted flash solver // use the CO2 injection problem adapted flash solver
SET_TYPE_PROP( template<class TypeTag>
Co2InjectionFlashNiVcfvProblem, FlashSolver, struct FlashSolver<TypeTag, TTag::Co2InjectionFlashNiVcfvProblem>
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>, { using type = Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>); GetPropType<TypeTag, Properties::FluidSystem>>; };
// the flash model has serious problems with the numerical // the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it, // precision. if quadruple precision math is available, we use it,

View File

@ -48,10 +48,10 @@ template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashVcfvProblem> { using type = TTag::VcfvDiscretization; }; struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionFlashVcfvProblem> { using type = TTag::VcfvDiscretization; };
// use the flash solver adapted to the CO2 injection problem // use the flash solver adapted to the CO2 injection problem
SET_TYPE_PROP( template<class TypeTag>
Co2InjectionFlashVcfvProblem, FlashSolver, struct FlashSolver<TypeTag, TTag::Co2InjectionFlashVcfvProblem>
Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>, { using type = Opm::Co2InjectionFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>); GetPropType<TypeTag, Properties::FluidSystem>>; };
// the flash model has serious problems with the numerical // the flash model has serious problems with the numerical
// precision. if quadruple precision math is available, we use it, // precision. if quadruple precision math is available, we use it,

View File

@ -36,11 +36,16 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(Co2InjectionImmiscibleEcfvProblem, namespace TTag {
INHERITS_FROM(ImmiscibleModel,
Co2InjectionBaseProblem)); struct Co2InjectionImmiscibleEcfvProblem
SET_TAG_PROP(Co2InjectionImmiscibleEcfvProblem, SpatialDiscretizationSplice, { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, ImmiscibleModel>; };
EcfvDiscretization);
} // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
} // namespace Opm::Properties } // namespace Opm::Properties

View File

@ -35,10 +35,14 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(Co2InjectionImmiscibleNiEcfvProblem, INHERITS_FROM(ImmiscibleModel, // Create new type tags
Co2InjectionBaseProblem)); namespace TTag {
SET_TAG_PROP(Co2InjectionImmiscibleNiEcfvProblem, SpatialDiscretizationSplice, struct Co2InjectionImmiscibleNiEcfvProblem { using InheritsFrom = std::tuple<Co2InjectionBaseProblem, ImmiscibleModel>; };
EcfvDiscretization); } // end namespace TTag
template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem>
{ using type = TTag::EcfvDiscretization; };
template<class TypeTag> template<class TypeTag>
struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem> { static constexpr bool value = true; }; struct EnableEnergy<TypeTag, TTag::Co2InjectionImmiscibleNiEcfvProblem> { static constexpr bool value = true; };

View File

@ -35,8 +35,13 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(Co2InjectionImmiscibleNiVcfvProblem, INHERITS_FROM(ImmiscibleModel, namespace TTag {
Co2InjectionBaseProblem));
struct Co2InjectionImmiscibleNiVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, ImmiscibleModel>; };
} // namespace TTag
template<class TypeTag> template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleNiVcfvProblem> { using type = TTag::VcfvDiscretization; }; struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleNiVcfvProblem> { using type = TTag::VcfvDiscretization; };

View File

@ -36,8 +36,13 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(Co2InjectionImmiscibleVcfvProblem, INHERITS_FROM(ImmiscibleModel, namespace TTag {
Co2InjectionBaseProblem));
struct Co2InjectionImmiscibleVcfvProblem
{ using InheritsFrom = std::tuple<Co2InjectionBaseProblem, ImmiscibleModel>; };
} // namespace TTag
template<class TypeTag> template<class TypeTag>
struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleVcfvProblem> { using type = TTag::VcfvDiscretization; }; struct SpatialDiscretizationSplice<TypeTag, TTag::Co2InjectionImmiscibleVcfvProblem> { using type = TTag::VcfvDiscretization; };

View File

@ -33,9 +33,12 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(PowerInjectionDarcyAdProblem, namespace TTag {
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem)); struct PowerInjectionDarcyAdProblem
{ using InheritsFrom = std::tuple<PowerInjectionBaseProblem, ImmiscibleTwoPhaseModel>; };
} // namespace TTag
template<class TypeTag> template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionDarcyAdProblem> { using type = Opm::DarcyFluxModule<TypeTag>; }; struct FluxModule<TypeTag, TTag::PowerInjectionDarcyAdProblem> { using type = Opm::DarcyFluxModule<TypeTag>; };

View File

@ -33,9 +33,12 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(PowerInjectionDarcyFdProblem, namespace TTag {
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem)); struct PowerInjectionDarcyFdProblem
{ using InheritsFrom = std::tuple<PowerInjectionBaseProblem, ImmiscibleTwoPhaseModel>; };
} // namespace TTag
template<class TypeTag> template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionDarcyFdProblem> { using type = Opm::DarcyFluxModule<TypeTag>; }; struct FluxModule<TypeTag, TTag::PowerInjectionDarcyFdProblem> { using type = Opm::DarcyFluxModule<TypeTag>; };

View File

@ -33,9 +33,12 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(PowerInjectionForchheimerAdProblem, namespace TTag {
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem)); struct PowerInjectionForchheimerAdProblem
{ using InheritsFrom = std::tuple<PowerInjectionBaseProblem, ImmiscibleTwoPhaseModel>; };
} // namespace TTag
template<class TypeTag> template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionForchheimerAdProblem> { using type = Opm::ForchheimerFluxModule<TypeTag>; }; struct FluxModule<TypeTag, TTag::PowerInjectionForchheimerAdProblem> { using type = Opm::ForchheimerFluxModule<TypeTag>; };

View File

@ -33,9 +33,12 @@
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(PowerInjectionForchheimerFdProblem, namespace TTag {
INHERITS_FROM(ImmiscibleTwoPhaseModel,
PowerInjectionBaseProblem)); struct PowerInjectionForchheimerFdProblem
{ using InheritsFrom = std::tuple<PowerInjectionBaseProblem, ImmiscibleTwoPhaseModel>; };
} // namespace TTag
template<class TypeTag> template<class TypeTag>
struct FluxModule<TypeTag, TTag::PowerInjectionForchheimerFdProblem> { using type = Opm::ForchheimerFluxModule<TypeTag>; }; struct FluxModule<TypeTag, TTag::PowerInjectionForchheimerFdProblem> { using type = Opm::ForchheimerFluxModule<TypeTag>; };

View File

@ -70,7 +70,9 @@ namespace Co2Injection {
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(Co2InjectionBaseProblem); namespace TTag {
struct Co2InjectionBaseProblem {};
}
// declare the CO2 injection problem specific property tags // declare the CO2 injection problem specific property tags
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
@ -98,8 +100,9 @@ template<class TypeTag>
struct Grid<TypeTag, TTag::Co2InjectionBaseProblem> { using type = Dune::YaspGrid<2>; }; struct Grid<TypeTag, TTag::Co2InjectionBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property // Set the problem property
SET_TYPE_PROP(Co2InjectionBaseProblem, Problem, template<class TypeTag>
Opm::Co2InjectionProblem<TypeTag>); struct Problem<TypeTag, TTag::Co2InjectionBaseProblem>
{ using type = Opm::Co2InjectionProblem<TypeTag>; };
// Set fluid configuration // Set fluid configuration
template<class TypeTag> template<class TypeTag>
@ -151,8 +154,9 @@ public:
}; };
// set the energy storage law for the solid phase // set the energy storage law for the solid phase
SET_TYPE_PROP(Co2InjectionBaseProblem, SolidEnergyLaw, template<class TypeTag>
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>); struct SolidEnergyLaw<TypeTag, TTag::Co2InjectionBaseProblem>
{ using type = Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>; };
// Use the algebraic multi-grid linear solver for this problem // Use the algebraic multi-grid linear solver for this problem
template<class TypeTag> template<class TypeTag>

View File

@ -60,7 +60,9 @@ namespace Opm::Properties {
// create a new type tag for the cuvette steam injection problem // create a new type tag for the cuvette steam injection problem
NEW_TYPE_TAG(CuvetteBaseProblem); namespace TTag {
struct CuvetteBaseProblem {};
}
// Set the grid type // Set the grid type
template<class TypeTag> template<class TypeTag>
@ -71,9 +73,9 @@ template<class TypeTag>
struct Problem<TypeTag, TTag::CuvetteBaseProblem> { using type = Opm::CuvetteProblem<TypeTag>; }; struct Problem<TypeTag, TTag::CuvetteBaseProblem> { using type = Opm::CuvetteProblem<TypeTag>; };
// Set the fluid system // Set the fluid system
SET_TYPE_PROP( template<class TypeTag>
CuvetteBaseProblem, FluidSystem, struct FluidSystem<TypeTag, TTag::CuvetteBaseProblem>
Opm::H2OAirMesityleneFluidSystem<GetPropType<TypeTag, Properties::Scalar>>); { using type = Opm::H2OAirMesityleneFluidSystem<GetPropType<TypeTag, Properties::Scalar>>; };
// Enable gravity // Enable gravity
template<class TypeTag> template<class TypeTag>
@ -106,8 +108,9 @@ public:
}; };
// set the energy storage law for the solid phase // set the energy storage law for the solid phase
SET_TYPE_PROP(CuvetteBaseProblem, SolidEnergyLaw, template<class TypeTag>
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>); struct SolidEnergyLaw<TypeTag, TTag::CuvetteBaseProblem>
{ using type = Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>; };
// Set the thermal conduction law // Set the thermal conduction law
template<class TypeTag> template<class TypeTag>

View File

@ -54,7 +54,11 @@ class DiffusionProblem;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(DiffusionBaseProblem); namespace TTag {
struct DiffusionBaseProblem {};
} // namespace TTag
// Set the grid implementation to be used // Set the grid implementation to be used
template<class TypeTag> template<class TypeTag>

View File

@ -71,12 +71,12 @@ struct FingerBaseProblem { using InheritsFrom = std::tuple<StructuredGridVanguar
#if HAVE_DUNE_ALUGRID #if HAVE_DUNE_ALUGRID
// use dune-alugrid if available // use dune-alugrid if available
SET_TYPE_PROP(FingerBaseProblem, template<class TypeTag>
Grid, struct Grid<TypeTag, TTag::FingerBaseProblem>
Dune::ALUGrid</*dim=*/2, { using type = Dune::ALUGrid</*dim=*/2,
/*dimWorld=*/2, /*dimWorld=*/2,
Dune::cube, Dune::cube,
Dune::nonconforming>); Dune::nonconforming>; };
#endif #endif
// declare the properties used by the finger problem // declare the properties used by the finger problem
@ -249,7 +249,7 @@ class FingerProblem : public GetPropType<TypeTag, Properties::BaseProblem>
typedef GetPropType<TypeTag, Properties::RateVector> RateVector; typedef GetPropType<TypeTag, Properties::RateVector> RateVector;
typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector; typedef GetPropType<TypeTag, Properties::BoundaryRateVector> BoundaryRateVector;
typedef typename GET_PROP(TypeTag, MaterialLaw)::ParkerLenhard ParkerLenhard; typedef typename GetProp<TypeTag, Properties::MaterialLaw>::ParkerLenhard ParkerLenhard;
typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw; typedef GetPropType<TypeTag, Properties::MaterialLaw> MaterialLaw;
typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams; typedef GetPropType<TypeTag, Properties::MaterialLawParams> MaterialLawParams;

View File

@ -74,9 +74,9 @@ struct FractureProblem { using InheritsFrom = std::tuple<DiscreteFractureModel>;
} // end namespace TTag } // end namespace TTag
// Set the grid type // Set the grid type
SET_TYPE_PROP( template<class TypeTag>
FractureProblem, Grid, struct Grid<TypeTag, TTag::FractureProblem>
Dune::ALUGrid</*dim=*/2, /*dimWorld=*/2, Dune::simplex, Dune::nonconforming>); { using type = Dune::ALUGrid</*dim=*/2, /*dimWorld=*/2, Dune::simplex, Dune::nonconforming>; };
// Set the Vanguard property // Set the Vanguard property
template<class TypeTag> template<class TypeTag>
@ -150,8 +150,9 @@ public:
}; };
// set the energy storage law for the solid phase // set the energy storage law for the solid phase
SET_TYPE_PROP(FractureProblem, SolidEnergyLaw, template<class TypeTag>
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>); struct SolidEnergyLaw<TypeTag, TTag::FractureProblem>
{ using type = Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>; };
// Disable gravity // Disable gravity
template<class TypeTag> template<class TypeTag>

View File

@ -89,8 +89,9 @@ template<class TypeTag>
struct Grid<TypeTag, TTag::GroundWaterBaseProblem> { using type = Dune::YaspGrid<2>; }; struct Grid<TypeTag, TTag::GroundWaterBaseProblem> { using type = Dune::YaspGrid<2>; };
// struct Grid<TypeTag, TTag::GroundWaterBaseProblem> { using type = Dune::SGrid<2, 2>; }; // struct Grid<TypeTag, TTag::GroundWaterBaseProblem> { using type = Dune::SGrid<2, 2>; };
SET_TYPE_PROP(GroundWaterBaseProblem, Problem, template<class TypeTag>
Opm::GroundWaterProblem<TypeTag>); struct Problem<TypeTag, TTag::GroundWaterBaseProblem>
{ using type = Opm::GroundWaterProblem<TypeTag>; };
template<class TypeTag> template<class TypeTag>
struct LensLowerLeftX<TypeTag, TTag::GroundWaterBaseProblem> struct LensLowerLeftX<TypeTag, TTag::GroundWaterBaseProblem>
@ -169,8 +170,10 @@ struct GridFile<TypeTag, TTag::GroundWaterBaseProblem> { static constexpr auto v
// ILU-0) from dune-istl // ILU-0) from dune-istl
template<class TypeTag> template<class TypeTag>
struct LinearSolverSplice<TypeTag, TTag::GroundWaterBaseProblem> { using type = TTag::ParallelIstlLinearSolver; }; struct LinearSolverSplice<TypeTag, TTag::GroundWaterBaseProblem> { using type = TTag::ParallelIstlLinearSolver; };
SET_TYPE_PROP(GroundWaterBaseProblem, LinearSolverWrapper,
Opm::Linear::SolverWrapperConjugatedGradients<TypeTag>); template<class TypeTag>
struct LinearSolverWrapper<TypeTag, TTag::GroundWaterBaseProblem>
{ using type = Opm::Linear::SolverWrapperConjugatedGradients<TypeTag>; };
} // namespace Opm::Properties } // namespace Opm::Properties

View File

@ -54,20 +54,22 @@ class InfiltrationProblem;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(InfiltrationBaseProblem); namespace TTag {
struct InfiltrationBaseProblem {};
}
// Set the grid type // Set the grid type
template<class TypeTag> template<class TypeTag>
struct Grid<TypeTag, TTag::InfiltrationBaseProblem> { using type = Dune::YaspGrid<2>; }; struct Grid<TypeTag, TTag::InfiltrationBaseProblem> { using type = Dune::YaspGrid<2>; };
// Set the problem property // Set the problem property
SET_TYPE_PROP(InfiltrationBaseProblem, Problem, template<class TypeTag>
Opm::InfiltrationProblem<TypeTag>); struct Problem<TypeTag, TTag::InfiltrationBaseProblem> { using type = Opm::InfiltrationProblem<TypeTag>; };
// Set the fluid system // Set the fluid system
SET_TYPE_PROP( template<class TypeTag>
InfiltrationBaseProblem, FluidSystem, struct FluidSystem<TypeTag, TTag::InfiltrationBaseProblem>
Opm::H2OAirMesityleneFluidSystem<GetPropType<TypeTag, Properties::Scalar>>); { using type = Opm::H2OAirMesityleneFluidSystem<GetPropType<TypeTag, Properties::Scalar>>; };
// Enable gravity? // Enable gravity?
template<class TypeTag> template<class TypeTag>
@ -116,8 +118,9 @@ struct InitialTimeStepSize<TypeTag, TTag::InfiltrationBaseProblem>
}; };
// The default DGF file to load // The default DGF file to load
SET_STRING_PROP(InfiltrationBaseProblem, GridFile, template<class TypeTag>
"./data/infiltration_50x3.dgf"); struct GridFile<TypeTag, TTag::InfiltrationBaseProblem>
{ static constexpr auto value = "./data/infiltration_50x3.dgf"; };
} // namespace Opm::Properties } // namespace Opm::Properties

View File

@ -59,7 +59,9 @@ class ObstacleProblem;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(ObstacleBaseProblem); namespace TTag {
struct ObstacleBaseProblem {};
}
// Set the grid type // Set the grid type
template<class TypeTag> template<class TypeTag>
@ -70,8 +72,9 @@ template<class TypeTag>
struct Problem<TypeTag, TTag::ObstacleBaseProblem> { using type = Opm::ObstacleProblem<TypeTag>; }; struct Problem<TypeTag, TTag::ObstacleBaseProblem> { using type = Opm::ObstacleProblem<TypeTag>; };
// Set fluid configuration // Set fluid configuration
SET_TYPE_PROP(ObstacleBaseProblem, FluidSystem, template<class TypeTag>
Opm::H2ON2FluidSystem<GetPropType<TypeTag, Properties::Scalar>>); struct FluidSystem<TypeTag, TTag::ObstacleBaseProblem>
{ using type = Opm::H2ON2FluidSystem<GetPropType<TypeTag, Properties::Scalar>>; };
// Set the material Law // Set the material Law
template<class TypeTag> template<class TypeTag>
@ -106,8 +109,9 @@ public:
}; };
// set the energy storage law for the solid phase // set the energy storage law for the solid phase
SET_TYPE_PROP(ObstacleBaseProblem, SolidEnergyLaw, template<class TypeTag>
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>); struct SolidEnergyLaw<TypeTag, TTag::ObstacleBaseProblem>
{ using type = Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>; };
// Enable gravity // Enable gravity
template<class TypeTag> template<class TypeTag>

View File

@ -47,7 +47,11 @@ class OutflowProblem;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(OutflowBaseProblem); namespace TTag {
struct OutflowBaseProblem {};
} // namespace TTag
// Set the grid type // Set the grid type
template<class TypeTag> template<class TypeTag>

View File

@ -59,19 +59,21 @@ class PowerInjectionProblem;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(PowerInjectionBaseProblem); namespace TTag {
struct PowerInjectionBaseProblem {};
}
// Set the grid implementation to be used // Set the grid implementation to be used
template<class TypeTag> template<class TypeTag>
struct Grid<TypeTag, TTag::PowerInjectionBaseProblem> { using type = Dune::YaspGrid</*dim=*/1>; }; struct Grid<TypeTag, TTag::PowerInjectionBaseProblem> { using type = Dune::YaspGrid</*dim=*/1>; };
// set the Vanguard property // set the Vanguard property
SET_TYPE_PROP(PowerInjectionBaseProblem, Vanguard, template<class TypeTag>
Opm::CubeGridVanguard<TypeTag>); struct Vanguard<TypeTag, TTag::PowerInjectionBaseProblem> { using type = Opm::CubeGridVanguard<TypeTag>; };
// Set the problem property // Set the problem property
SET_TYPE_PROP(PowerInjectionBaseProblem, Problem, template<class TypeTag>
Opm::PowerInjectionProblem<TypeTag>); struct Problem<TypeTag, TTag::PowerInjectionBaseProblem> { using type = Opm::PowerInjectionProblem<TypeTag>; };
// Set the wetting phase // Set the wetting phase
template<class TypeTag> template<class TypeTag>

View File

@ -59,7 +59,11 @@ class ReservoirProblem;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(ReservoirBaseProblem); namespace TTag {
struct ReservoirBaseProblem {};
} // namespace TTag
// Maximum depth of the reservoir // Maximum depth of the reservoir
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -60,7 +60,9 @@ class WaterAirProblem;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(WaterAirBaseProblem); namespace TTag {
struct WaterAirBaseProblem {};
}
// Set the grid type // Set the grid type
template<class TypeTag> template<class TypeTag>
@ -105,13 +107,15 @@ public:
}; };
// set the energy storage law for the solid phase // set the energy storage law for the solid phase
SET_TYPE_PROP(WaterAirBaseProblem, SolidEnergyLaw, template<class TypeTag>
Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>); struct SolidEnergyLaw<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::ConstantSolidHeatCapLaw<GetPropType<TypeTag, Properties::Scalar>>; };
// Set the fluid system. in this case, we use the one which describes // Set the fluid system. in this case, we use the one which describes
// air and water // air and water
SET_TYPE_PROP(WaterAirBaseProblem, FluidSystem, template<class TypeTag>
Opm::H2OAirFluidSystem<GetPropType<TypeTag, Properties::Scalar>>); struct FluidSystem<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::H2OAirFluidSystem<GetPropType<TypeTag, Properties::Scalar>>; };
// Enable gravity // Enable gravity
template<class TypeTag> template<class TypeTag>
@ -147,15 +151,21 @@ struct GridFile<TypeTag, TTag::WaterAirBaseProblem> { static constexpr auto valu
// Use the restarted GMRES linear solver with the ILU-2 preconditioner from dune-istl // Use the restarted GMRES linear solver with the ILU-2 preconditioner from dune-istl
template<class TypeTag> template<class TypeTag>
struct LinearSolverSplice<TypeTag, TTag::WaterAirBaseProblem> { using type = TTag::ParallelIstlLinearSolver; }; struct LinearSolverSplice<TypeTag, TTag::WaterAirBaseProblem>
SET_TYPE_PROP(WaterAirBaseProblem, LinearSolverWrapper, { using type = TTag::ParallelIstlLinearSolver; };
Opm::Linear::SolverWrapperRestartedGMRes<TypeTag>);
template<class TypeTag>
struct LinearSolverWrapper<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::Linear::SolverWrapperRestartedGMRes<TypeTag>; };
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) #if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
SET_TYPE_PROP(WaterAirBaseProblem, PreconditionerWrapper, template<class TypeTag>
Opm::Linear::PreconditionerWrapperILU<TypeTag>); struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
#else #else
SET_TYPE_PROP(WaterAirBaseProblem, PreconditionerWrapper, template<class TypeTag>
Opm::Linear::PreconditionerWrapperILUn<TypeTag>); struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem>
{ using type = Opm::Linear::PreconditionerWrapperILUn<TypeTag>; };
#endif #endif
template<class TypeTag> template<class TypeTag>
struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = 2; }; struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = 2; };

View File

@ -66,12 +66,14 @@ struct Tutorial1Problem { using InheritsFrom = std::tuple<ImmiscibleTwoPhaseMode
} // end namespace TTag } // end namespace TTag
// Select the vertex centered finite volume method as spatial discretization // Select the vertex centered finite volume method as spatial discretization
SET_TAG_PROP(Tutorial1Problem, SpatialDiscretizationSplice, template<class TypeTag>
VcfvDiscretization); /*@\label{tutorial1:set-spatial-discretization}@*/ struct SpatialDiscretizationSplice<TypeTag, TTag::Tutorial1Problem>
{ using type = TTag::VcfvDiscretization; }; /*@\label{tutorial1:set-spatial-discretization}@*/
// Set the "Problem" property // Set the "Problem" property
SET_TYPE_PROP(Tutorial1Problem, Problem, template<class TypeTag>
Opm::Tutorial1Problem<TypeTag>); /*@\label{tutorial1:set-problem}@*/ struct Problem<TypeTag, TTag::Tutorial1Problem>
{ using type = Opm::Tutorial1Problem<TypeTag>; }; /*@\label{tutorial1:set-problem}@*/
// Set grid and the grid manager to be used // Set grid and the grid manager to be used
template<class TypeTag> template<class TypeTag>
@ -80,16 +82,20 @@ template<class TypeTag>
struct Vanguard<TypeTag, TTag::Tutorial1Problem> { using type = Opm::CubeGridVanguard<TypeTag>; }; /*@\label{tutorial1:set-grid-manager}@*/ struct Vanguard<TypeTag, TTag::Tutorial1Problem> { using type = Opm::CubeGridVanguard<TypeTag>; }; /*@\label{tutorial1:set-grid-manager}@*/
// Set the wetting phase /*@\label{tutorial1:2p-system-start}@*/ // Set the wetting phase /*@\label{tutorial1:2p-system-start}@*/
SET_TYPE_PROP(Tutorial1Problem, template<class TypeTag>
WettingPhase, /*@\label{tutorial1:wettingPhase}@*/ struct WettingPhase<TypeTag, TTag::Tutorial1Problem> /*@\label{tutorial1:wettingPhase}@*/
Opm::LiquidPhase<GetPropType<TypeTag, Properties::Scalar>, {
Opm::SimpleH2O<GetPropType<TypeTag, Properties::Scalar>> >); using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = Opm::LiquidPhase<Scalar, Opm::SimpleH2O<Scalar> >;
};
// Set the non-wetting phase // Set the non-wetting phase
SET_TYPE_PROP(Tutorial1Problem, template<class TypeTag>
NonwettingPhase, /*@\label{tutorial1:nonwettingPhase}@*/ struct NonwettingPhase<TypeTag, TTag::Tutorial1Problem> /*@\label{tutorial1:nonwettingPhase}@*/
Opm::LiquidPhase<GetPropType<TypeTag, Properties::Scalar>, {
Opm::LNAPL<GetPropType<TypeTag, Properties::Scalar>> >); /*@\label{tutorial1:2p-system-end}@*/ using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using type = Opm::LiquidPhase<Scalar, Opm::LNAPL<Scalar> >;
}; /*@\label{tutorial1:2p-system-end}@*/
// Set the material law // Set the material law
template<class TypeTag> template<class TypeTag>

View File

@ -68,17 +68,19 @@ class EclVanguard;
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
//! The type tag for the black-oil problems //! The type tag for the black-oil problems
NEW_TYPE_TAG(BlackOilModel, INHERITS_FROM(MultiPhaseBaseModel, struct BlackOilModel { using InheritsFrom = std::tuple<VtkComposition,
VtkBlackOil, VtkBlackOilEnergy,
VtkBlackOilSolvent, VtkBlackOilPolymer,
VtkBlackOilPolymer, VtkBlackOilSolvent,
VtkBlackOilEnergy, VtkBlackOil,
VtkComposition)); MultiPhaseBaseModel>; };
} // namespace TTag
//! Set the local residual function //! Set the local residual function
SET_TYPE_PROP(BlackOilModel, LocalResidual, template<class TypeTag>
Opm::BlackOilLocalResidual<TypeTag>); struct LocalResidual<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilLocalResidual<TypeTag>; };
//! Use the black-oil specific newton method //! Use the black-oil specific newton method
template<class TypeTag> template<class TypeTag>
@ -118,13 +120,14 @@ template<class TypeTag>
struct FluxModule<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilDarcyFluxModule<TypeTag>; }; struct FluxModule<TypeTag, TTag::BlackOilModel> { using type = Opm::BlackOilDarcyFluxModule<TypeTag>; };
//! The indices required by the model //! The indices required by the model
SET_TYPE_PROP(BlackOilModel, Indices, template<class TypeTag>
Opm::BlackOilIndices<getPropValue<TypeTag, Properties::EnableSolvent>(), struct Indices<TypeTag, TTag::BlackOilModel>
getPropValue<TypeTag, Properties::EnablePolymer>(), { using type = Opm::BlackOilIndices<getPropValue<TypeTag, Properties::EnableSolvent>(),
getPropValue<TypeTag, Properties::EnableEnergy>(), getPropValue<TypeTag, Properties::EnablePolymer>(),
getPropValue<TypeTag, Properties::EnableFoam>(), getPropValue<TypeTag, Properties::EnableEnergy>(),
getPropValue<TypeTag, Properties::EnableBrine>(), getPropValue<TypeTag, Properties::EnableFoam>(),
/*PVOffset=*/0>); getPropValue<TypeTag, Properties::EnableBrine>(),
/*PVOffset=*/0>; };
//! Set the fluid system to the black-oil fluid system by default //! Set the fluid system to the black-oil fluid system by default
template<class TypeTag> template<class TypeTag>

View File

@ -59,7 +59,11 @@ struct MultiPhaseBaseModel { using InheritsFrom = std::tuple<VtkTemperature, Vtk
} // end namespace TTag } // end namespace TTag
//! Specify the splices of the MultiPhaseBaseModel type tag //! Specify the splices of the MultiPhaseBaseModel type tag
SET_SPLICES(MultiPhaseBaseModel, SpatialDiscretizationSplice); template<class TypeTag>
struct Splices<TypeTag, TTag::MultiPhaseBaseModel>
{
using type = std::tuple<GetSplicePropType<TypeTag, TTag::MultiPhaseBaseModel, Properties::SpatialDiscretizationSplice>>;
};
//! Set the default spatial discretization //! Set the default spatial discretization
//! //!
@ -104,32 +108,32 @@ public:
* \brief Set the property for the material parameters by extracting * \brief Set the property for the material parameters by extracting
* it from the material law. * it from the material law.
*/ */
SET_TYPE_PROP(MultiPhaseBaseModel, template<class TypeTag>
MaterialLawParams, struct MaterialLawParams<TypeTag, TTag::MultiPhaseBaseModel>
typename GetPropType<TypeTag, Properties::MaterialLaw>::Params); { using type = typename GetPropType<TypeTag, Properties::MaterialLaw>::Params; };
//! set the energy storage law for the solid to the one which assumes zero heat capacity //! set the energy storage law for the solid to the one which assumes zero heat capacity
//! by default //! by default
SET_TYPE_PROP(MultiPhaseBaseModel, template<class TypeTag>
SolidEnergyLaw, struct SolidEnergyLaw<TypeTag, TTag::MultiPhaseBaseModel>
Opm::NullSolidEnergyLaw<GetPropType<TypeTag, Properties::Scalar>>); { using type = Opm::NullSolidEnergyLaw<GetPropType<TypeTag, Properties::Scalar>>; };
//! extract the type of the parameter objects for the solid energy storage law from the //! extract the type of the parameter objects for the solid energy storage law from the
//! law itself //! law itself
SET_TYPE_PROP(MultiPhaseBaseModel, template<class TypeTag>
SolidEnergyLawParams, struct SolidEnergyLawParams<TypeTag, TTag::MultiPhaseBaseModel>
typename GetPropType<TypeTag, Properties::SolidEnergyLaw>::Params); { using type = typename GetPropType<TypeTag, Properties::SolidEnergyLaw>::Params; };
//! set the thermal conduction law to a dummy one by default //! set the thermal conduction law to a dummy one by default
SET_TYPE_PROP(MultiPhaseBaseModel, template<class TypeTag>
ThermalConductionLaw, struct ThermalConductionLaw<TypeTag, TTag::MultiPhaseBaseModel>
Opm::NullThermalConductionLaw<GetPropType<TypeTag, Properties::Scalar>>); { using type = Opm::NullThermalConductionLaw<GetPropType<TypeTag, Properties::Scalar>>; };
//! extract the type of the parameter objects for the thermal conduction law from the law //! extract the type of the parameter objects for the thermal conduction law from the law
//! itself //! itself
SET_TYPE_PROP(MultiPhaseBaseModel, template<class TypeTag>
ThermalConductionLawParams, struct ThermalConductionLawParams<TypeTag, TTag::MultiPhaseBaseModel>
typename GetPropType<TypeTag, Properties::ThermalConductionLaw>::Params); { using type = typename GetPropType<TypeTag, Properties::ThermalConductionLaw>::Params; };
//! disable gravity by default //! disable gravity by default
template<class TypeTag> template<class TypeTag>

View File

@ -51,9 +51,9 @@ class DiscreteFractureModel;
namespace Opm::Properties { namespace Opm::Properties {
//! The generic type tag for problems using the immiscible multi-phase model
// Create new type tags // Create new type tags
namespace TTag { namespace TTag {
//! The generic type tag for problems using the immiscible multi-phase model
struct DiscreteFractureModel { using InheritsFrom = std::tuple<VtkDiscreteFracture, ImmiscibleTwoPhaseModel>; }; struct DiscreteFractureModel { using InheritsFrom = std::tuple<VtkDiscreteFracture, ImmiscibleTwoPhaseModel>; };
} // end namespace TTag } // end namespace TTag
@ -71,19 +71,23 @@ struct LocalResidual<TypeTag, TTag::DiscreteFractureModel> { using type = Opm::D
// The type of the base base class for actual problems. // The type of the base base class for actual problems.
// TODO!? // TODO!?
//SET_TYPE_PROP(DiscreteFractureModel BaseProblem, DiscreteFractureBaseProblem<TypeTag>); // template<class TypeTag>
// struct BaseProblem<TypeTag, TTag::DiscreteFractureModel> { using type = DiscreteFractureBaseProblem<TypeTag>; };
//! the PrimaryVariables property //! the PrimaryVariables property
SET_TYPE_PROP(DiscreteFractureModel, PrimaryVariables, template<class TypeTag>
Opm::DiscreteFracturePrimaryVariables<TypeTag>); struct PrimaryVariables<TypeTag, TTag::DiscreteFractureModel>
{ using type = Opm::DiscreteFracturePrimaryVariables<TypeTag>; };
//! the IntensiveQuantities property //! the IntensiveQuantities property
SET_TYPE_PROP(DiscreteFractureModel, IntensiveQuantities, template<class TypeTag>
Opm::DiscreteFractureIntensiveQuantities<TypeTag>); struct IntensiveQuantities<TypeTag, TTag::DiscreteFractureModel>
{ using type = Opm::DiscreteFractureIntensiveQuantities<TypeTag>; };
//! the ExtensiveQuantities property //! the ExtensiveQuantities property
SET_TYPE_PROP(DiscreteFractureModel, ExtensiveQuantities, template<class TypeTag>
Opm::DiscreteFractureExtensiveQuantities<TypeTag>); struct ExtensiveQuantities<TypeTag, TTag::DiscreteFractureModel>
{ using type = Opm::DiscreteFractureExtensiveQuantities<TypeTag>; };
//! For the discrete fracture model, we need to use two-point flux approximation or it //! For the discrete fracture model, we need to use two-point flux approximation or it
//! will converge very poorly //! will converge very poorly

View File

@ -34,11 +34,11 @@
#include <set> #include <set>
#include <vector> #include <vector>
namespace Opm::Properties { namespace Opm::Properties::Tag {
NEW_TYPE_TAG(AuxModule); struct AuxModule {};
} // namespace Opm::Properties } // namespace Opm::Properties::TTag
namespace Opm { namespace Opm {

View File

@ -49,12 +49,15 @@ class FvBaseAdLocalLinearizer;
namespace Opm::Properties { namespace Opm::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);
namespace TTag {
struct AutoDiffLocalLinearizer {};
} // namespace TTag
// set the properties to be spliced in // set the properties to be spliced in
SET_TYPE_PROP(AutoDiffLocalLinearizer, LocalLinearizer, template<class TypeTag>
Opm::FvBaseAdLocalLinearizer<TypeTag>); struct LocalLinearizer<TypeTag, TTag::AutoDiffLocalLinearizer>
{ using type = Opm::FvBaseAdLocalLinearizer<TypeTag>; };
//! Set the function evaluation w.r.t. the primary variables //! Set the function evaluation w.r.t. the primary variables
template<class TypeTag> template<class TypeTag>

View File

@ -93,12 +93,14 @@ template<class TypeTag>
struct Simulator<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::Simulator<TypeTag>; }; struct Simulator<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::Simulator<TypeTag>; };
//! Mapper for the grid view's vertices. //! Mapper for the grid view's vertices.
SET_TYPE_PROP(FvBaseDiscretization, VertexMapper, template<class TypeTag>
Dune::MultipleCodimMultipleGeomTypeMapper<GetPropType<TypeTag, Properties::GridView>>); struct VertexMapper<TypeTag, TTag::FvBaseDiscretization>
{ using type = Dune::MultipleCodimMultipleGeomTypeMapper<GetPropType<TypeTag, Properties::GridView>>; };
//! Mapper for the grid view's elements. //! Mapper for the grid view's elements.
SET_TYPE_PROP(FvBaseDiscretization, ElementMapper, template<class TypeTag>
Dune::MultipleCodimMultipleGeomTypeMapper<GetPropType<TypeTag, Properties::GridView>>); struct ElementMapper<TypeTag, TTag::FvBaseDiscretization>
{ using type = Dune::MultipleCodimMultipleGeomTypeMapper<GetPropType<TypeTag, Properties::GridView>>; };
//! marks the border indices (required for the algebraic overlap stuff) //! marks the border indices (required for the algebraic overlap stuff)
template<class TypeTag> template<class TypeTag>
@ -137,23 +139,26 @@ struct ContinueOnConvergenceError<TypeTag, TTag::FvBaseDiscretization> { static
/*! /*!
* \brief A vector of quanties, each for one equation. * \brief A vector of quanties, each for one equation.
*/ */
SET_TYPE_PROP(FvBaseDiscretization, EqVector, template<class TypeTag>
Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, struct EqVector<TypeTag, TTag::FvBaseDiscretization>
getPropValue<TypeTag, Properties::NumEq>()>); { using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>,
getPropValue<TypeTag, Properties::NumEq>()>; };
/*! /*!
* \brief A vector for mass/energy rates. * \brief A vector for mass/energy rates.
* *
* E.g. Neumann fluxes or source terms * E.g. Neumann fluxes or source terms
*/ */
SET_TYPE_PROP(FvBaseDiscretization, RateVector, template<class TypeTag>
GetPropType<TypeTag, Properties::EqVector>); struct RateVector<TypeTag, TTag::FvBaseDiscretization>
{ using type = GetPropType<TypeTag, Properties::EqVector>; };
/*! /*!
* \brief Type of object for specifying boundary conditions. * \brief Type of object for specifying boundary conditions.
*/ */
SET_TYPE_PROP(FvBaseDiscretization, BoundaryRateVector, template<class TypeTag>
GetPropType<TypeTag, Properties::RateVector>); struct BoundaryRateVector<TypeTag, TTag::FvBaseDiscretization>
{ using type = GetPropType<TypeTag, Properties::RateVector>; };
/*! /*!
* \brief The class which represents constraints. * \brief The class which represents constraints.
@ -164,14 +169,16 @@ struct Constraints<TypeTag, TTag::FvBaseDiscretization> { using type = Opm::FvBa
/*! /*!
* \brief The type for storing a residual for an element. * \brief The type for storing a residual for an element.
*/ */
SET_TYPE_PROP(FvBaseDiscretization, ElementEqVector, template<class TypeTag>
Dune::BlockVector<GetPropType<TypeTag, Properties::EqVector>>); struct ElementEqVector<TypeTag, TTag::FvBaseDiscretization>
{ using type = Dune::BlockVector<GetPropType<TypeTag, Properties::EqVector>>; };
/*! /*!
* \brief The type for storing a residual for the whole grid. * \brief The type for storing a residual for the whole grid.
*/ */
SET_TYPE_PROP(FvBaseDiscretization, GlobalEqVector, template<class TypeTag>
Dune::BlockVector<GetPropType<TypeTag, Properties::EqVector>>); struct GlobalEqVector<TypeTag, TTag::FvBaseDiscretization>
{ using type = Dune::BlockVector<GetPropType<TypeTag, Properties::EqVector>>; };
/*! /*!
* \brief An object representing a local set of primary variables. * \brief An object representing a local set of primary variables.
@ -182,8 +189,9 @@ struct PrimaryVariables<TypeTag, TTag::FvBaseDiscretization> { using type = Opm:
/*! /*!
* \brief The type of a solution for the whole grid at a fixed time. * \brief The type of a solution for the whole grid at a fixed time.
*/ */
SET_TYPE_PROP(FvBaseDiscretization, SolutionVector, template<class TypeTag>
Dune::BlockVector<GetPropType<TypeTag, Properties::PrimaryVariables>>); struct SolutionVector<TypeTag, TTag::FvBaseDiscretization>
{ using type = Dune::BlockVector<GetPropType<TypeTag, Properties::PrimaryVariables>>; };
/*! /*!
* \brief The class representing intensive quantities. * \brief The class representing intensive quantities.

View File

@ -53,7 +53,10 @@ class FvBaseFdLocalLinearizer;
namespace Opm::Properties { namespace Opm::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);
namespace TTag {
struct FiniteDifferenceLocalLinearizer {};
} // namespace TTag
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct NumericDifferenceMethod { using type = UndefinedProperty; }; struct NumericDifferenceMethod { using type = UndefinedProperty; };
@ -61,11 +64,13 @@ template<class TypeTag, class MyTypeTag>
struct BaseEpsilon { using type = UndefinedProperty; }; struct BaseEpsilon { using type = UndefinedProperty; };
// set the properties to be spliced in // set the properties to be spliced in
SET_TYPE_PROP(FiniteDifferenceLocalLinearizer, LocalLinearizer, template<class TypeTag>
Opm::FvBaseFdLocalLinearizer<TypeTag>); struct LocalLinearizer<TypeTag, TTag::FiniteDifferenceLocalLinearizer>
{ using type = Opm::FvBaseFdLocalLinearizer<TypeTag>; };
SET_TYPE_PROP(FiniteDifferenceLocalLinearizer, Evaluation, template<class TypeTag>
GetPropType<TypeTag, Properties::Scalar>); struct Evaluation<TypeTag, TTag::FiniteDifferenceLocalLinearizer>
{ using type = GetPropType<TypeTag, Properties::Scalar>; };
/*! /*!
* \brief Specify which kind of method should be used to numerically * \brief Specify which kind of method should be used to numerically
@ -78,9 +83,12 @@ template<class TypeTag>
struct NumericDifferenceMethod<TypeTag, TTag::FiniteDifferenceLocalLinearizer> { static constexpr int value = +1; }; struct NumericDifferenceMethod<TypeTag, TTag::FiniteDifferenceLocalLinearizer> { static constexpr int value = +1; };
//! The base epsilon value for finite difference calculations //! The base epsilon value for finite difference calculations
SET_SCALAR_PROP(FiniteDifferenceLocalLinearizer, template<class TypeTag>
BaseEpsilon, struct BaseEpsilon<TypeTag, TTag::FiniteDifferenceLocalLinearizer>
std::max<Scalar>(0.9123e-10, std::numeric_limits<Scalar>::epsilon()*1.23e3)); {
using type = GetPropType<TypeTag, Properties::Scalar>;
static constexpr type value = std::max<type>(0.9123e-10, std::numeric_limits<type>::epsilon()*1.23e3);
};
} // namespace Opm::Properties } // namespace Opm::Properties

View File

@ -55,12 +55,17 @@ template<class TypeTag, class MyTypeTag>
struct DiscNewtonMethod { using type = UndefinedProperty; }; struct DiscNewtonMethod { using type = UndefinedProperty; };
// set default values // set default values
SET_TYPE_PROP(FvBaseNewtonMethod, DiscNewtonMethod, template<class TypeTag>
Opm::FvBaseNewtonMethod<TypeTag>); struct DiscNewtonMethod<TypeTag, TTag::FvBaseNewtonMethod>
SET_TYPE_PROP(FvBaseNewtonMethod, NewtonMethod, { using type = Opm::FvBaseNewtonMethod<TypeTag>; };
GetPropType<TypeTag, Properties::DiscNewtonMethod>);
SET_TYPE_PROP(FvBaseNewtonMethod, NewtonConvergenceWriter, template<class TypeTag>
Opm::FvBaseNewtonConvergenceWriter<TypeTag>); struct NewtonMethod<TypeTag, TTag::FvBaseNewtonMethod>
{ using type = GetPropType<TypeTag, Properties::DiscNewtonMethod>; };
template<class TypeTag>
struct NewtonConvergenceWriter<TypeTag, TTag::FvBaseNewtonMethod>
{ using type = Opm::FvBaseNewtonConvergenceWriter<TypeTag>; };
} // namespace Opm::Properties } // namespace Opm::Properties

View File

@ -42,11 +42,13 @@ struct VtkPrimaryVars;
struct FiniteDifferenceLocalLinearizer; struct FiniteDifferenceLocalLinearizer;
} }
namespace TTag {
//! 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, struct FvBaseDiscretization
INHERITS_FROM(ImplicitModel, { using InheritsFrom = std::tuple<VtkPrimaryVars, FvBaseNewtonMethod, ImplicitModel>; };
FvBaseNewtonMethod,
VtkPrimaryVars)); } // namespace TTag
//! set the splices for the finite volume discretizations //! set the splices for the finite volume discretizations
@ -54,7 +56,12 @@ template<class TypeTag, class MyTypeTag>
struct LinearSolverSplice { using type = UndefinedProperty; }; struct LinearSolverSplice { using type = UndefinedProperty; };
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct LocalLinearizerSplice { using type = UndefinedProperty; }; struct LocalLinearizerSplice { using type = UndefinedProperty; };
SET_SPLICES(FvBaseDiscretization, LinearSolverSplice, LocalLinearizerSplice); template<class TypeTag>
struct Splices<TypeTag, TTag::FvBaseDiscretization>
{
using type = std::tuple<GetSplicePropType<TypeTag, TTag::FvBaseDiscretization, Properties::LinearSolverSplice>,
GetSplicePropType<TypeTag, TTag::FvBaseDiscretization, Properties::LocalLinearizerSplice>>;
};
//! use a parallel BiCGStab linear solver by default //! use a parallel BiCGStab linear solver by default
template<class TypeTag> template<class TypeTag>

View File

@ -72,12 +72,14 @@ struct Discretization<TypeTag, TTag::EcfvDiscretization> { using type = Opm::Ecf
//! The base class for the output modules (decides whether to write //! The base class for the output modules (decides whether to write
//! element or vertex based fields) //! element or vertex based fields)
SET_TYPE_PROP(EcfvDiscretization, DiscBaseOutputModule, template<class TypeTag>
Opm::EcfvBaseOutputModule<TypeTag>); struct DiscBaseOutputModule<TypeTag, TTag::EcfvDiscretization>
{ using type = Opm::EcfvBaseOutputModule<TypeTag>; };
//! The class to create grid communication handles //! The class to create grid communication handles
SET_TYPE_PROP(EcfvDiscretization, GridCommHandleFactory, template<class TypeTag>
Opm::EcfvGridCommHandleFactory<TypeTag>); struct GridCommHandleFactory<TypeTag, TTag::EcfvDiscretization>
{ using type = Opm::EcfvGridCommHandleFactory<TypeTag>; };
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
//! Set the DiscreteFunctionSpace //! Set the DiscreteFunctionSpace

View File

@ -74,16 +74,19 @@ struct Discretization<TypeTag, TTag::VcfvDiscretization> { using type = Opm::Vcf
//! The base class for the output modules (decides whether to write //! The base class for the output modules (decides whether to write
//! element or vertex based fields) //! element or vertex based fields)
SET_TYPE_PROP(VcfvDiscretization, DiscBaseOutputModule, template<class TypeTag>
Opm::VcfvBaseOutputModule<TypeTag>); struct DiscBaseOutputModule<TypeTag, TTag::VcfvDiscretization>
{ using type = Opm::VcfvBaseOutputModule<TypeTag>; };
//! Calculates the gradient of any quantity given the index of a flux approximation point //! Calculates the gradient of any quantity given the index of a flux approximation point
SET_TYPE_PROP(VcfvDiscretization, GradientCalculator, template<class TypeTag>
Opm::P1FeGradientCalculator<TypeTag>); struct GradientCalculator<TypeTag, TTag::VcfvDiscretization>
{ using type = Opm::P1FeGradientCalculator<TypeTag>; };
//! The class to create grid communication handles //! The class to create grid communication handles
SET_TYPE_PROP(VcfvDiscretization, GridCommHandleFactory, template<class TypeTag>
Opm::VcfvGridCommHandleFactory<TypeTag>); struct GridCommHandleFactory<TypeTag, TTag::VcfvDiscretization>
{ using type = Opm::VcfvGridCommHandleFactory<TypeTag>; };
//! Use two-point gradients by default for the vertex centered finite volume scheme. //! Use two-point gradients by default for the vertex centered finite volume scheme.
template<class TypeTag> template<class TypeTag>

View File

@ -58,20 +58,23 @@ class FlashModel;
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
//! The type tag for the isothermal single phase problems //! The type tag for the isothermal single phase problems
NEW_TYPE_TAG(FlashModel, INHERITS_FROM(MultiPhaseBaseModel, struct FlashModel { using InheritsFrom = std::tuple<VtkDiffusion,
VtkComposition, VtkEnergy,
VtkEnergy, VtkComposition,
VtkDiffusion)); MultiPhaseBaseModel>; };
} // namespace TTag
//! Use the FlashLocalResidual function for the flash model //! Use the FlashLocalResidual function for the flash model
SET_TYPE_PROP(FlashModel, LocalResidual, template<class TypeTag>
Opm::FlashLocalResidual<TypeTag>); struct LocalResidual<TypeTag, TTag::FlashModel> { using type = Opm::FlashLocalResidual<TypeTag>; };
//! Use the NCP flash solver by default //! Use the NCP flash solver by default
SET_TYPE_PROP(FlashModel, FlashSolver, template<class TypeTag>
Opm::NcpFlash<GetPropType<TypeTag, Properties::Scalar>, struct FlashSolver<TypeTag, TTag::FlashModel>
GetPropType<TypeTag, Properties::FluidSystem>>); { using type = Opm::NcpFlash<GetPropType<TypeTag, Properties::Scalar>,
GetPropType<TypeTag, Properties::FluidSystem>>; };
//! Let the flash solver choose its tolerance by default //! Let the flash solver choose its tolerance by default
template<class TypeTag> template<class TypeTag>

View File

@ -70,8 +70,8 @@ struct ImmiscibleTwoPhaseModel { using InheritsFrom = std::tuple<ImmiscibleModel
} // end namespace TTag } // end namespace TTag
//! Use the immiscible multi-phase local jacobian operator for the immiscible multi-phase model //! Use the immiscible multi-phase local jacobian operator for the immiscible multi-phase model
SET_TYPE_PROP(ImmiscibleModel, LocalResidual, template<class TypeTag>
Opm::ImmiscibleLocalResidual<TypeTag>); struct LocalResidual<TypeTag, TTag::ImmiscibleModel> { using type = Opm::ImmiscibleLocalResidual<TypeTag>; };
//! the Model property //! the Model property
template<class TypeTag> template<class TypeTag>

View File

@ -54,7 +54,11 @@ class StructuredGridVanguard;
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(StructuredGridVanguard); namespace TTag {
struct StructuredGridVanguard {};
} // namespace TTag
// GRIDDIM is only set by the finger problem // GRIDDIM is only set by the finger problem
#ifndef GRIDDIM #ifndef GRIDDIM

View File

@ -42,8 +42,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK multi-phase output // create new type tag for the VTK multi-phase output
NEW_TYPE_TAG(VtkBlackOilEnergy); struct VtkBlackOilEnergy {};
} // namespace TTag
// create the property tags needed for the energy module // create the property tags needed for the energy module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -42,8 +42,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK multi-phase output // create new type tag for the VTK multi-phase output
NEW_TYPE_TAG(VtkBlackOil); struct VtkBlackOil {};
} // namespace TTag
// create the property tags needed for the multi phase module // create the property tags needed for the multi phase module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -42,8 +42,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK multi-phase output // create new type tag for the VTK multi-phase output
NEW_TYPE_TAG(VtkBlackOilPolymer); struct VtkBlackOilPolymer {};
} // namespace TTag
// create the property tags needed for the polymer output module // create the property tags needed for the polymer output module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -42,8 +42,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK multi-phase output // create new type tag for the VTK multi-phase output
NEW_TYPE_TAG(VtkBlackOilSolvent); struct VtkBlackOilSolvent {};
} // namespace TTag
// create the property tags needed for the solvent output module // create the property tags needed for the solvent output module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -37,8 +37,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK composition output // create new type tag for the VTK composition output
NEW_TYPE_TAG(VtkComposition); struct VtkComposition {};
} // namespace TTag
// create the property tags needed for the composition module // create the property tags needed for the composition module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -39,9 +39,13 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK output of the quantities for molecular // create new type tag for the VTK output of the quantities for molecular
// diffusion // diffusion
NEW_TYPE_TAG(VtkDiffusion); struct VtkDiffusion {};
} // namespace TTag
// create the property tags needed for the diffusion module // create the property tags needed for the diffusion module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -41,8 +41,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK multi-phase output // create new type tag for the VTK multi-phase output
NEW_TYPE_TAG(VtkDiscreteFracture); struct VtkDiscreteFracture {};
} // namespace TTag
// create the property tags needed for the multi phase module // create the property tags needed for the multi phase module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -37,8 +37,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK energy output // create new type tag for the VTK energy output
NEW_TYPE_TAG(VtkEnergy); struct VtkEnergy {};
} // namespace TTag
// create the property tags needed for the energy module // create the property tags needed for the energy module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -42,8 +42,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK multi-phase output // create new type tag for the VTK multi-phase output
NEW_TYPE_TAG(VtkMultiPhase); struct VtkMultiPhase {};
} // namespace TTag
// create the property tags needed for the multi phase module // create the property tags needed for the multi phase module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -35,8 +35,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK primary variables output // create new type tag for the VTK primary variables output
NEW_TYPE_TAG(VtkPhasePresence); struct VtkPhasePresence {};
} // namespace TTag
// create the property tags needed for the primary variables module // create the property tags needed for the primary variables module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -35,8 +35,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK primary variables output // create new type tag for the VTK primary variables output
NEW_TYPE_TAG(VtkPrimaryVars); struct VtkPrimaryVars {};
} // namespace TTag
// create the property tags needed for the primary variables module // create the property tags needed for the primary variables module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -37,8 +37,12 @@
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// create new type tag for the VTK temperature output // create new type tag for the VTK temperature output
NEW_TYPE_TAG(VtkTemperature); struct VtkTemperature {};
} // namespace TTag
// create the property tags needed for the temperature module // create the property tags needed for the temperature module
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -64,18 +64,19 @@ class NcpModel;
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
/*! /*!
* \brief Define the type tag for the compositional NCP model. * \brief Define the type tag for the compositional NCP model.
*/ */
NEW_TYPE_TAG(NcpModel, INHERITS_FROM(MultiPhaseBaseModel, struct NcpModel { using InheritsFrom = std::tuple<VtkDiffusion,
VtkComposition, VtkEnergy,
VtkEnergy, VtkComposition,
VtkDiffusion)); MultiPhaseBaseModel>; };
} // namespace TTag
//! Use the Ncp local jacobian operator for the compositional NCP model //! Use the Ncp local jacobian operator for the compositional NCP model
SET_TYPE_PROP(NcpModel, template<class TypeTag>
LocalResidual, struct LocalResidual<TypeTag, TTag::NcpModel> { using type = Opm::NcpLocalResidual<TypeTag>; };
Opm::NcpLocalResidual<TypeTag>);
//! Use the Ncp specific newton method for the compositional NCP model //! Use the Ncp specific newton method for the compositional NCP model
template<class TypeTag> template<class TypeTag>

View File

@ -62,9 +62,13 @@ namespace Opm {
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
//! The type tag on which the default properties for the Newton method //! The type tag on which the default properties for the Newton method
//! are attached //! are attached
NEW_TYPE_TAG(NewtonMethod); struct NewtonMethod {};
} // namespace TTag
//! Specifies the type of the actual Newton method //! Specifies the type of the actual Newton method
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>

View File

@ -63,17 +63,18 @@ class PvsModel;
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
//! The type tag for the isothermal single phase problems //! The type tag for the isothermal single phase problems
NEW_TYPE_TAG(PvsModel, INHERITS_FROM(MultiPhaseBaseModel, struct PvsModel { using InheritsFrom = std::tuple<VtkDiffusion,
VtkPhasePresence, VtkEnergy,
VtkComposition, VtkComposition,
VtkEnergy, VtkPhasePresence,
VtkDiffusion)); MultiPhaseBaseModel>; };
} // namespace TTag
//! Use the PVS local jacobian operator for the PVS model //! Use the PVS local jacobian operator for the PVS model
SET_TYPE_PROP(PvsModel, template<class TypeTag>
LocalResidual, struct LocalResidual<TypeTag, TTag::PvsModel> { using type = Opm::PvsLocalResidual<TypeTag>; };
Opm::PvsLocalResidual<TypeTag>);
//! Use the PVS specific newton method for the PVS model //! Use the PVS specific newton method for the PVS model
template<class TypeTag> template<class TypeTag>

View File

@ -89,9 +89,8 @@ template<class TypeTag>
struct GasComponentIndex<TypeTag, TTag::Richards> { static constexpr int value = 1 - getPropValue<TypeTag, Properties::LiquidComponentIndex>(); }; struct GasComponentIndex<TypeTag, TTag::Richards> { static constexpr int value = 1 - getPropValue<TypeTag, Properties::LiquidComponentIndex>(); };
//! The local residual operator //! The local residual operator
SET_TYPE_PROP(Richards, template<class TypeTag>
LocalResidual, struct LocalResidual<TypeTag, TTag::Richards> { using type = Opm::RichardsLocalResidual<TypeTag>; };
Opm::RichardsLocalResidual<TypeTag>);
//! The global model used //! The global model used
template<class TypeTag> template<class TypeTag>

View File

@ -223,9 +223,13 @@ private:
namespace Opm::Properties { namespace Opm::Properties {
namespace TTag {
// type tag which is supposed to spliced in or inherited from if the // type tag which is supposed to spliced in or inherited from if the
// parameter system is to be used // parameter system is to be used
NEW_TYPE_TAG(ParameterSystem); struct ParameterSystem {};
} // namespace TTag
template<class TypeTag, class MyTypeTag> template<class TypeTag, class MyTypeTag>
struct ParameterMetaData { using type = UndefinedProperty; }; struct ParameterMetaData { using type = UndefinedProperty; };
@ -477,7 +481,7 @@ inline void getFlattenedKeyList_(std::list<std::string>& dest,
template <class TypeTag> template <class TypeTag>
void printParamList_(std::ostream& os, const std::list<std::string>& keyList, bool printDefaults = false) void printParamList_(std::ostream& os, const std::list<std::string>& keyList, bool printDefaults = false)
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
const Dune::ParameterTree& tree = ParamsMeta::tree(); const Dune::ParameterTree& tree = ParamsMeta::tree();
@ -512,7 +516,7 @@ void printUsage(const std::string& helpPreamble,
const std::string& errorMsg = "", const std::string& errorMsg = "",
std::ostream& os = std::cerr) std::ostream& os = std::cerr)
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
if (errorMsg != "") { if (errorMsg != "") {
os << errorMsg << "\n" os << errorMsg << "\n"
@ -680,7 +684,7 @@ std::string parseCommandLineOptions(int argc,
const std::string& helpPreamble = "", const std::string& helpPreamble = "",
const PositionalArgumentCallback& posArgCallback = noPositionalParameters_) const PositionalArgumentCallback& posArgCallback = noPositionalParameters_)
{ {
Dune::ParameterTree& paramTree = GET_PROP(TypeTag, ParameterMetaData)::tree(); Dune::ParameterTree& paramTree = GetProp<TypeTag, Properties::ParameterMetaData>::tree();
// handle the "--help" parameter // handle the "--help" parameter
if (!helpPreamble.empty()) { if (!helpPreamble.empty()) {
@ -781,7 +785,7 @@ std::string parseCommandLineOptions(int argc,
template <class TypeTag> template <class TypeTag>
void parseParameterFile(const std::string& fileName, bool overwrite = true) void parseParameterFile(const std::string& fileName, bool overwrite = true)
{ {
Dune::ParameterTree& paramTree = GET_PROP(TypeTag, ParameterMetaData)::tree(); Dune::ParameterTree& paramTree = GetProp<TypeTag, Properties::ParameterMetaData>::tree();
std::set<std::string> seenKeys; std::set<std::string> seenKeys;
std::ifstream ifs(fileName); std::ifstream ifs(fileName);
@ -848,7 +852,7 @@ void parseParameterFile(const std::string& fileName, bool overwrite = true)
template <class TypeTag> template <class TypeTag>
void printValues(std::ostream& os = std::cout) void printValues(std::ostream& os = std::cout)
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
const Dune::ParameterTree& tree = ParamsMeta::tree(); const Dune::ParameterTree& tree = ParamsMeta::tree();
@ -916,7 +920,7 @@ void printValues(std::ostream& os = std::cout)
template <class TypeTag> template <class TypeTag>
bool printUnused(std::ostream& os = std::cout) bool printUnused(std::ostream& os = std::cout)
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
const Dune::ParameterTree& tree = ParamsMeta::tree(); const Dune::ParameterTree& tree = ParamsMeta::tree();
std::list<std::string> runTimeAllKeyList; std::list<std::string> runTimeAllKeyList;
@ -948,7 +952,7 @@ bool printUnused(std::ostream& os = std::cout)
template <class TypeTag> template <class TypeTag>
class Param class Param
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
public: public:
template <class ParamType, class PropTag> template <class ParamType, class PropTag>
@ -1107,7 +1111,7 @@ void getLists(Container& usedParams, Container& unusedParams)
usedParams.clear(); usedParams.clear();
unusedParams.clear(); unusedParams.clear();
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
if (ParamsMeta::registrationOpen()) if (ParamsMeta::registrationOpen())
throw std::runtime_error("Parameter lists can only retieved after _all_ of them have " throw std::runtime_error("Parameter lists can only retieved after _all_ of them have "
"been registered."); "been registered.");
@ -1146,7 +1150,7 @@ bool isSet(const char *propTagName, const char *paramName, bool errorIfNotRegist
template <class TypeTag, class ParamType> template <class TypeTag, class ParamType>
void registerParam(const char *paramName, const char *propertyName, const ParamType& defaultValue, 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 GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
if (!ParamsMeta::registrationOpen()) if (!ParamsMeta::registrationOpen())
throw std::logic_error("Parameter registration was already closed before " throw std::logic_error("Parameter registration was already closed before "
"the parameter '"+std::string(paramName)+"' was registered."); "the parameter '"+std::string(paramName)+"' was registered.");
@ -1180,7 +1184,7 @@ void registerParam(const char *paramName, const char *propertyName, const ParamT
template <class TypeTag, class ParamType> template <class TypeTag, class ParamType>
void hideParam(const char *paramName, const ParamType& defaultValue) void hideParam(const char *paramName, const ParamType& defaultValue)
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::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"
" when parameter registration was already closed."); " when parameter registration was already closed.");
@ -1197,7 +1201,7 @@ void hideParam(const char *paramName, const ParamType& defaultValue)
template <class TypeTag> template <class TypeTag>
void endParamRegistration() void endParamRegistration()
{ {
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta; typedef GetProp<TypeTag, Properties::ParameterMetaData> ParamsMeta;
if (!ParamsMeta::registrationOpen()) if (!ParamsMeta::registrationOpen())
throw std::logic_error("Parameter registration was already closed. It is only possible " throw std::logic_error("Parameter registration was already closed. It is only possible "
"to close it once."); "to close it once.");

View File

@ -27,7 +27,6 @@
#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
@ -35,8 +34,6 @@
#include "parametersystem.hh" #include "parametersystem.hh"
#include <opm/models/utils/parametersystem.hh>
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/simulator.hh> #include <opm/models/utils/simulator.hh>
#include <opm/models/utils/timer.hh> #include <opm/models/utils/timer.hh>

View File

@ -28,8 +28,9 @@
* In conjunction with a suitable solver backend, preconditioner wrappers work by * In conjunction with a suitable solver backend, preconditioner wrappers work by
* specifying the "PreconditionerWrapper" property: * specifying the "PreconditionerWrapper" property:
* \code * \code
* SET_TYPE_PROP(YourTypeTag, PreconditionerWrapper, * template<class TypeTag>
* Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>); * struct PreconditionerWrapper<TypeTag, TTag::YourTypeTag>
* { using type = Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>; };
* \endcode * \endcode
* *
* Where the choices possible for '\c $PRECONDITIONER' are: * Where the choices possible for '\c $PRECONDITIONER' are:

View File

@ -28,8 +28,9 @@
* In conjunction with a suitable solver backend, solver wrappers work by specifying the * In conjunction with a suitable solver backend, solver wrappers work by specifying the
* "SolverWrapper" property: * "SolverWrapper" property:
* \code * \code
* SET_TYPE_PROP(YourTypeTag, LinearSolverWrapper, * template<class TypeTag>
* Opm::Linear::SolverWrapper$SOLVER<TypeTag>); * struct LinearSolverWrapper<TypeTag, TTag::YourTypeTag>
* { using type = Opm::Linear::SolverWrapper$SOLVER<TypeTag>; };
* \endcode * \endcode
* *
* The possible choices for '\c $SOLVER' are: * The possible choices for '\c $SOLVER' are:
@ -49,9 +50,7 @@
#include <dune/istl/solvers.hh> #include <dune/istl/solvers.hh>
namespace Opm { namespace Opm::Linear {
namespace Linear {
/*! /*!
* \brief Macro to create a wrapper around an ISTL solver * \brief Macro to create a wrapper around an ISTL solver
@ -61,10 +60,8 @@ namespace Linear {
class SolverWrapper##SOLVER_NAME \ class SolverWrapper##SOLVER_NAME \
{ \ { \
typedef GetPropType<TypeTag, Properties::Scalar> Scalar; \ typedef GetPropType<TypeTag, Properties::Scalar> Scalar; \
typedef typename GET_PROP_TYPE(TypeTag, \ typedef GetPropType<TypeTag, Properties::OverlappingMatrix> OverlappingMatrix; \
OverlappingMatrix) OverlappingMatrix; \ typedef GetPropType<TypeTag, Properties::OverlappingVector> OverlappingVector; \
typedef typename GET_PROP_TYPE(TypeTag, \
OverlappingVector) OverlappingVector; \
\ \
public: \ public: \
typedef ISTL_SOLVER_NAME<OverlappingVector> RawSolver; \ typedef ISTL_SOLVER_NAME<OverlappingVector> RawSolver; \
@ -163,6 +160,6 @@ private:
#undef EWOMS_WRAP_ISTL_SOLVER #undef EWOMS_WRAP_ISTL_SOLVER
}} // namespace Linear, Opm } // namespace Opm::Linear
#endif #endif

View File

@ -42,11 +42,10 @@
#include <iostream> #include <iostream>
namespace Opm { namespace Opm::Linear {
namespace Linear {
template <class TypeTag> template <class TypeTag>
class ParallelAmgBackend; class ParallelAmgBackend;
}} } // namespace Opm::Linear
namespace Opm::Properties { namespace Opm::Properties {
@ -67,8 +66,9 @@ struct LinearSolverMaxError<TypeTag, TTag::ParallelAmgLinearSolver>
static constexpr type value = 1e7; static constexpr type value = 1e7;
}; };
SET_TYPE_PROP(ParallelAmgLinearSolver, LinearSolverBackend, template<class TypeTag>
Opm::Linear::ParallelAmgBackend<TypeTag>); struct LinearSolverBackend<TypeTag, TTag::ParallelAmgLinearSolver>
{ using type = Opm::Linear::ParallelAmgBackend<TypeTag>; };
} // namespace Opm::Properties } // namespace Opm::Properties

View File

@ -52,7 +52,10 @@
#include <iostream> #include <iostream>
namespace Opm::Properties { namespace Opm::Properties {
NEW_TYPE_TAG(ParallelBaseLinearSolver);
namespace TTag {
struct ParallelBaseLinearSolver {};
}
//! 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.
@ -80,8 +83,9 @@ namespace Linear {
* This class provides access to all preconditioners offered by dune-istl using the * This class provides access to all preconditioners offered by dune-istl using the
* PreconditionerWrapper property: * PreconditionerWrapper property:
* \code * \code
* SET_TYPE_PROP(YourTypeTag, PreconditionerWrapper, * template<class TypeTag>
* Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>); * struct PreconditionerWrapper<TypeTag, TTag::YourTypeTag>
* { using type = Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>; };
* \endcode * \endcode
* *
* Where the choices possible for '\c $PRECONDITIONER' are: * Where the choices possible for '\c $PRECONDITIONER' are:
@ -405,9 +409,9 @@ struct PreconditionerOrder<TypeTag, TTag::ParallelBaseLinearSolver> { static con
//! by default use the same kind of floating point values for the linearization and for //! by default use the same kind of floating point values for the linearization and for
//! the linear solve //! the linear solve
SET_TYPE_PROP(ParallelBaseLinearSolver, template<class TypeTag>
LinearSolverScalar, struct LinearSolverScalar<TypeTag, TTag::ParallelBaseLinearSolver>
GetPropType<TypeTag, Properties::Scalar>); { using type = GetPropType<TypeTag, Properties::Scalar>; };
template<class TypeTag> template<class TypeTag>
struct OverlappingMatrix<TypeTag, TTag::ParallelBaseLinearSolver> struct OverlappingMatrix<TypeTag, TTag::ParallelBaseLinearSolver>
@ -422,9 +426,9 @@ public:
typedef Opm::Linear::OverlappingBCRSMatrix<NonOverlappingMatrix> type; typedef Opm::Linear::OverlappingBCRSMatrix<NonOverlappingMatrix> type;
}; };
SET_TYPE_PROP(ParallelBaseLinearSolver, template<class TypeTag>
Overlap, struct Overlap<TypeTag, TTag::ParallelBaseLinearSolver>
typename GetPropType<TypeTag, Properties::OverlappingMatrix>::Overlap); { using type = typename GetPropType<TypeTag, Properties::OverlappingMatrix>::Overlap; };
template<class TypeTag> template<class TypeTag>
struct OverlappingVector<TypeTag, TTag::ParallelBaseLinearSolver> struct OverlappingVector<TypeTag, TTag::ParallelBaseLinearSolver>
@ -454,13 +458,13 @@ struct OverlappingLinearOperator<TypeTag, TTag::ParallelBaseLinearSolver>
}; };
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) #if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
SET_TYPE_PROP(ParallelBaseLinearSolver, template<class TypeTag>
PreconditionerWrapper, struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
Opm::Linear::PreconditionerWrapperILU<TypeTag>); { using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
#else #else
SET_TYPE_PROP(ParallelBaseLinearSolver, template<class TypeTag>
PreconditionerWrapper, struct PreconditionerWrapper<TypeTag, TTag::ParallelBaseLinearSolver>
Opm::Linear::PreconditionerWrapperILU0<TypeTag>); { using type = Opm::Linear::PreconditionerWrapperILU0<TypeTag>; };
#endif #endif
//! set the default overlap size to 2 //! set the default overlap size to 2

View File

@ -35,11 +35,10 @@
#include <memory> #include <memory>
namespace Opm { namespace Opm::Linear {
namespace Linear {
template <class TypeTag> template <class TypeTag>
class ParallelBiCGStabSolverBackend; class ParallelBiCGStabSolverBackend;
}} // namespace Linear, Opm } // namespace Opm::Linear
namespace Opm::Properties { namespace Opm::Properties {
@ -48,9 +47,9 @@ namespace TTag {
struct ParallelBiCGStabLinearSolver { using InheritsFrom = std::tuple<ParallelBaseLinearSolver>; }; struct ParallelBiCGStabLinearSolver { using InheritsFrom = std::tuple<ParallelBaseLinearSolver>; };
} // end namespace TTag } // end namespace TTag
SET_TYPE_PROP(ParallelBiCGStabLinearSolver, template<class TypeTag>
LinearSolverBackend, struct LinearSolverBackend<TypeTag, TTag::ParallelBiCGStabLinearSolver>
Opm::Linear::ParallelBiCGStabSolverBackend<TypeTag>); { using type = Opm::Linear::ParallelBiCGStabSolverBackend<TypeTag>; };
template<class TypeTag> template<class TypeTag>
struct LinearSolverMaxError<TypeTag, TTag::ParallelBiCGStabLinearSolver> struct LinearSolverMaxError<TypeTag, TTag::ParallelBiCGStabLinearSolver>
@ -71,8 +70,9 @@ namespace Linear {
* Chosing the preconditioner works by setting the "PreconditionerWrapper" property: * Chosing the preconditioner works by setting the "PreconditionerWrapper" property:
* *
* \code * \code
* SET_TYPE_PROP(YourTypeTag, PreconditionerWrapper, * template<class TypeTag>
* Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>); * struct PreconditionerWrapper<TypeTag, TTag::YourTypeTag>
* { using type = Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>; };
* \endcode * \endcode
* *
* Where the choices possible for '\c $PRECONDITIONER' are: * Where the choices possible for '\c $PRECONDITIONER' are:

View File

@ -34,17 +34,14 @@
#include <dune/common/version.hh> #include <dune/common/version.hh>
namespace Opm::Properties { namespace Opm::Properties::TTag {
// Create new type tags // Create new type tag
namespace TTag {
struct ParallelIstlLinearSolver { using InheritsFrom = std::tuple<ParallelBaseLinearSolver>; }; struct ParallelIstlLinearSolver { using InheritsFrom = std::tuple<ParallelBaseLinearSolver>; };
} // end namespace TTag
} // namespace Opm::Properties } // namespace Opm::Properties::TTag
namespace Opm { namespace Opm::Linear {
namespace Linear {
/*! /*!
* \ingroup Linear * \ingroup Linear
* *
@ -52,8 +49,9 @@ namespace Linear {
* *
* To set the linear solver, use * To set the linear solver, use
* \code * \code
* SET_TYPE_PROP(YourTypeTag, LinearSolverWrapper, * template<class TypeTag>
* Opm::Linear::SolverWrapper$SOLVER<TypeTag>); * struct LinearSolverWrapper<TypeTag, TTag::YourTypeTag>
* { using type = Opm::Linear::SolverWrapper$SOLVER<TypeTag>; };
* \endcode * \endcode
* *
* The possible choices for '\c $SOLVER' are: * The possible choices for '\c $SOLVER' are:
@ -66,8 +64,9 @@ namespace Linear {
* *
* Chosing the preconditioner works in an analogous way: * Chosing the preconditioner works in an analogous way:
* \code * \code
* SET_TYPE_PROP(YourTypeTag, PreconditionerWrapper, * template<class TypeTag>
* Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>); * struct PreconditionerWrapper<TypeTag, TTag::YourTypeTag>
* { using type = Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>; };
* \endcode * \endcode
* *
* Where the choices possible for '\c $PRECONDITIONER' are: * Where the choices possible for '\c $PRECONDITIONER' are:
@ -141,26 +140,26 @@ protected:
LinearSolverWrapper solverWrapper_; LinearSolverWrapper solverWrapper_;
}; };
}} // namespace Linear, Opm } // namespace Opm::Linear
namespace Opm::Properties { namespace Opm::Properties {
SET_TYPE_PROP(ParallelIstlLinearSolver, template<class TypeTag>
LinearSolverBackend, struct LinearSolverBackend<TypeTag, TTag::ParallelIstlLinearSolver>
Opm::Linear::ParallelIstlSolverBackend<TypeTag>); { using type = Opm::Linear::ParallelIstlSolverBackend<TypeTag>; };
SET_TYPE_PROP(ParallelIstlLinearSolver, template<class TypeTag>
LinearSolverWrapper, struct LinearSolverWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
Opm::Linear::SolverWrapperBiCGStab<TypeTag>); { using type = Opm::Linear::SolverWrapperBiCGStab<TypeTag>; };
#if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7) #if DUNE_VERSION_NEWER(DUNE_ISTL, 2,7)
SET_TYPE_PROP(ParallelIstlLinearSolver, template<class TypeTag>
PreconditionerWrapper, struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
Opm::Linear::PreconditionerWrapperILU<TypeTag>); { using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
#else #else
SET_TYPE_PROP(ParallelIstlLinearSolver, template<class TypeTag>
PreconditionerWrapper, struct PreconditionerWrapper<TypeTag, TTag::ParallelIstlLinearSolver>
Opm::Linear::PreconditionerWrapperILU0<TypeTag>); { using type = Opm::Linear::PreconditionerWrapperILU0<TypeTag>; };
#endif #endif
//! set the GMRes restart parameter to 10 by default //! set the GMRes restart parameter to 10 by default

View File

@ -39,11 +39,9 @@
#include <dune/common/fmatrix.hh> #include <dune/common/fmatrix.hh>
#include <dune/common/version.hh> #include <dune/common/version.hh>
namespace Opm::Properties { namespace Opm::Properties::TTag {
struct SuperLULinearSolver {};
NEW_TYPE_TAG(SuperLULinearSolver); } // namespace Opm::Properties::TTag
} // namespace Opm::Properties
namespace Opm { namespace Opm {
namespace Linear { namespace Linear {
@ -176,8 +174,8 @@ namespace Opm::Properties {
template<class TypeTag> template<class TypeTag>
struct LinearSolverVerbosity<TypeTag, TTag::SuperLULinearSolver> { static constexpr int value = 0; }; struct LinearSolverVerbosity<TypeTag, TTag::SuperLULinearSolver> { static constexpr int value = 0; };
SET_TYPE_PROP(SuperLULinearSolver, LinearSolverBackend, template<class TypeTag>
Opm::Linear::SuperLUBackend<TypeTag>); struct LinearSolverBackend<TypeTag, TTag::SuperLULinearSolver> { using type = Opm::Linear::SuperLUBackend<TypeTag>; };
} // namespace Opm::Properties } // namespace Opm::Properties

View File

@ -32,7 +32,6 @@
#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>