Commit 5eef5a75 authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[propertysystem] replace macro SET_BOOL_PROP

parent db2ce8d0
......@@ -55,13 +55,16 @@ public:
};
//! We do not store the FVGeometry by default
SET_BOOL_PROP(FiniteVolumeModel, EnableFVGridGeometryCache, false);
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; };
//! We do not store the volume variables by default
SET_BOOL_PROP(FiniteVolumeModel, EnableGridVolumeVariablesCache, false);
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; };
//! disable flux variables data caching by default
SET_BOOL_PROP(FiniteVolumeModel, EnableGridFluxVariablesCache, false);
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::FiniteVolumeModel> { static constexpr bool value = false; };
//! Boundary types at a single degree of freedom
SET_TYPE_PROP(FiniteVolumeModel, BoundaryTypes, Dumux::BoundaryTypes<GetPropType<TypeTag, Properties::ModelTraits>::numEq()>);
......
......@@ -73,7 +73,8 @@ public:
};
//! Cache the face variables per default
SET_BOOL_PROP(StaggeredModel, EnableGridFaceVariablesCache, true);
template<class TypeTag>
struct EnableGridFaceVariablesCache<TypeTag, TTag::StaggeredModel> { static constexpr bool value = true; };
//! Set the global flux variables cache vector class
SET_PROP(StaggeredModel, GridFluxVariablesCache)
......
......@@ -141,9 +141,11 @@ public:
using type = NavierStokesNCModelTraits<dim, numComponents, useMoles, replaceCompEqIdx>;
};
SET_BOOL_PROP(NavierStokesNC, UseMoles, false); //!< Defines whether molar (true) or mass (false) density is used
template<class TypeTag>
struct UseMoles<TypeTag, TTag::NavierStokesNC> { static constexpr bool value = false; }; //!< Defines whether molar (true) or mass (false) density is used
SET_INT_PROP(NavierStokesNC, ReplaceCompEqIdx, 0); //<! Set the ReplaceCompEqIdx to 0 by default
SET_BOOL_PROP(NavierStokesNC, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default
template<class TypeTag>
struct NormalizePressure<TypeTag, TTag::NavierStokesNC> { static constexpr bool value = true; }; //!< Normalize the pressure term in the momentum balance by default
//! The local residual
SET_TYPE_PROP(NavierStokesNC, LocalResidual, FreeflowNCResidual<TypeTag>);
......
......@@ -148,7 +148,8 @@ struct NavierStokesNI { using InheritsFrom = std::tuple<NavierStokes>; };
///////////////////////////////////////////////////////////////////////////
// default property values for the isothermal single phase model
///////////////////////////////////////////////////////////////////////////
SET_BOOL_PROP(NavierStokes, NormalizePressure, true); //!< Normalize the pressure term in the momentum balance by default
template<class TypeTag>
struct NormalizePressure<TypeTag, TTag::NavierStokes> { static constexpr bool value = true; }; //!< Normalize the pressure term in the momentum balance by default
//!< states some specifics of the Navier-Stokes model
SET_PROP(NavierStokes, ModelTraits)
......
......@@ -184,7 +184,8 @@ SET_TYPE_PROP(OnePNC, EffectiveDiffusivityModel,
DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>);
//! Use mole fractions in the balance equations by default
SET_BOOL_PROP(OnePNC, UseMoles, true);
template<class TypeTag>
struct UseMoles<TypeTag, TTag::OnePNC> { static constexpr bool value = true; };
//! The local residual function
SET_TYPE_PROP(OnePNC, LocalResidual, CompositionalLocalResidual<TypeTag>);
......
......@@ -168,7 +168,8 @@ SET_PROP(TwoPOneCNI, Formulation)
{ static constexpr TwoPFormulation value = TwoPFormulation::p1s0; };
//! Do not block spurious flows by default.
SET_BOOL_PROP(TwoPOneCNI, UseBlockingOfSpuriousFlow, false);
template<class TypeTag>
struct UseBlockingOfSpuriousFlow<TypeTag, TTag::TwoPOneCNI> { static constexpr bool value = false; };
//! The specific local residual (i.e. balance equations).
SET_TYPE_PROP(TwoPOneCNI, LocalResidual, TwoPOneCLocalResidual<TypeTag>);
......
......@@ -181,7 +181,8 @@ public:
};
//! Determines whether the constraint solver is used
SET_BOOL_PROP(TwoPTwoC, UseConstraintSolver, true);
template<class TypeTag>
struct UseConstraintSolver<TypeTag, TTag::TwoPTwoC> { static constexpr bool value = true; };
//////////////////////////////////////////////////////////////////////
// Properties for the non-isothermal 2p2c model (inherited from 2pnc)
......
......@@ -262,8 +262,10 @@ SET_INT_PROP(TwoPNC, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::FluidSys
SET_PROP(TwoPNC, Formulation)
{ static constexpr auto value = TwoPFormulation::p0s1; };
SET_BOOL_PROP(TwoPNC, SetMoleFractionsForFirstPhase, true); //!< Set the primary variables mole fractions for the wetting or non-wetting phase
SET_BOOL_PROP(TwoPNC, UseMoles, true); //!< Use mole fractions in the balance equations by default
template<class TypeTag>
struct SetMoleFractionsForFirstPhase<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; }; //!< Set the primary variables mole fractions for the wetting or non-wetting phase
template<class TypeTag>
struct UseMoles<TypeTag, TTag::TwoPNC> { static constexpr bool value = true; }; //!< Use mole fractions in the balance equations by default
//! Use the model after Millington (1961) for the effective diffusivity
SET_TYPE_PROP(TwoPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>);
......
......@@ -221,7 +221,8 @@ public:
SET_TYPE_PROP(ThreePThreeC, ModelTraits, GetPropType<TypeTag, Properties::BaseModelTraits>);
//! Determines whether a constraint solver should be used explicitly
SET_BOOL_PROP(ThreePThreeC, UseConstraintSolver, false);
template<class TypeTag>
struct UseConstraintSolver<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = false; };
//! Set as default that _no_ component mass balance is replaced by the total mass balance
SET_INT_PROP(ThreePThreeC, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::ModelTraits>::numComponents());
......@@ -279,7 +280,8 @@ SET_TYPE_PROP(ThreePThreeC, EffectiveDiffusivityModel, DiffusivityMillingtonQuir
SET_TYPE_PROP(ThreePThreeC, IOFields, ThreePThreeCIOFields);
//! Use mole fractions in the balance equations by default
SET_BOOL_PROP(ThreePThreeC, UseMoles, true);
template<class TypeTag>
struct UseMoles<TypeTag, TTag::ThreePThreeC> { static constexpr bool value = true; };
//! Somerton is used as default model to compute the effective thermal heat conductivity
SET_TYPE_PROP(ThreePThreeCNI, ThermalConductivityModel, ThermalConductivitySomerton<GetPropType<TypeTag, Properties::Scalar>>);
......
......@@ -241,7 +241,8 @@ public:
};
//! Determines whether a constraint solver should be used explicitly
SET_BOOL_PROP(ThreePWaterOilNI, OnlyGasPhaseCanDisappear, true);
template<class TypeTag>
struct OnlyGasPhaseCanDisappear<TypeTag, TTag::ThreePWaterOilNI> { static constexpr bool value = true; };
//! Set the volume variables property
SET_PROP(ThreePWaterOilNI, VolumeVariables)
......@@ -265,7 +266,8 @@ SET_TYPE_PROP(ThreePWaterOilNI, EffectiveDiffusivityModel,
DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>);
// Define that mole fractions are used in the balance equations per default
SET_BOOL_PROP(ThreePWaterOilNI, UseMoles, true);
template<class TypeTag>
struct UseMoles<TypeTag, TTag::ThreePWaterOilNI> { static constexpr bool value = true; };
//! Somerton is used as default model to compute the effective thermal heat conductivity
SET_PROP(ThreePWaterOilNI, ThermalConductivityModel)
......
......@@ -291,7 +291,8 @@ public:
//! Per default, no component mass balance is replaced
SET_INT_PROP(MPNC, ReplaceCompEqIdx, GetPropType<TypeTag, Properties::FluidSystem>::numComponents);
//! Use mole fractions in the balance equations by default
SET_BOOL_PROP(MPNC, UseMoles, true);
template<class TypeTag>
struct UseMoles<TypeTag, TTag::MPNC> { static constexpr bool value = true; };
//! Use the model after Millington (1961) for the effective diffusivity
SET_TYPE_PROP(MPNC, EffectiveDiffusivityModel, DiffusivityMillingtonQuirk<GetPropType<TypeTag, Properties::Scalar>>);
//! Set the default pressure formulation to the pressure of the (most) wetting phase
......
......@@ -110,8 +110,10 @@ public:
};
//! Per default, we consider both thermal and chemical non-equilibrium
SET_BOOL_PROP(NonEquilibrium, EnableThermalNonEquilibrium, true);
SET_BOOL_PROP(NonEquilibrium, EnableChemicalNonEquilibrium, true);
template<class TypeTag>
struct EnableThermalNonEquilibrium<TypeTag, TTag::NonEquilibrium> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableChemicalNonEquilibrium<TypeTag, TTag::NonEquilibrium> { static constexpr bool value = true; };
//! Default values for the number of energy balance equations
SET_INT_PROP(NonEquilibrium, NumEnergyEqSolid, 1);
......
......@@ -69,9 +69,12 @@ SET_TYPE_PROP(PorousMediumFlow, MolecularDiffusionType, FicksLaw<TypeTag>);
SET_TYPE_PROP(PorousMediumFlow, HeatConductionType, FouriersLaw<TypeTag>);
//! By default, parameters are solution-dependent
SET_BOOL_PROP(PorousMediumFlow, SolutionDependentAdvection, true);
SET_BOOL_PROP(PorousMediumFlow, SolutionDependentMolecularDiffusion, true);
SET_BOOL_PROP(PorousMediumFlow, SolutionDependentHeatConduction, true);
template<class TypeTag>
struct SolutionDependentAdvection<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = true; };
template<class TypeTag>
struct SolutionDependentMolecularDiffusion<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = true; };
template<class TypeTag>
struct SolutionDependentHeatConduction<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = true; };
//! The default implementation of the energy balance equation for flow problems in porous media.
SET_TYPE_PROP(PorousMediumFlow, EnergyLocalResidual, Dumux::EnergyLocalResidual<TypeTag> );
......@@ -84,10 +87,12 @@ SET_TYPE_PROP(PorousMediumFlow, VelocityOutput,
//! By default, we set an empty primary variables switch
SET_TYPE_PROP(PorousMediumFlow, PrimaryVariableSwitch, NoPrimaryVariableSwitch);
SET_BOOL_PROP(PorousMediumFlow, EnableThermalNonEquilibrium, false);
template<class TypeTag>
struct EnableThermalNonEquilibrium<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = false; };
//! Per default, we disable the box interface solver
SET_BOOL_PROP(PorousMediumFlow, EnableBoxInterfaceSolver, false);
template<class TypeTag>
struct EnableBoxInterfaceSolver<TypeTag, TTag::PorousMediumFlow> { static constexpr bool value = false; };
//! per default solid state is inert
SET_PROP(PorousMediumFlow, SolidState)
......
......@@ -226,7 +226,8 @@ public:
//! The default richards model computes no diffusion in the air phase
//! Turning this on leads to the extended Richards equation (see e.g. Vanderborght et al. 2017)
SET_BOOL_PROP(Richards, EnableWaterDiffusionInAir, false);
template<class TypeTag>
struct EnableWaterDiffusionInAir<TypeTag, TTag::Richards> { static constexpr bool value = false; };
//! Use the model after Millington (1961) for the effective diffusivity
SET_TYPE_PROP(Richards, EffectiveDiffusivityModel,
......
......@@ -157,7 +157,8 @@ public:
SET_TYPE_PROP(RichardsNC, ModelTraits, GetPropType<TypeTag, Properties::BaseModelTraits>);
//! Define that per default mole fractions are used in the balance equations
SET_BOOL_PROP(RichardsNC, UseMoles, true);
template<class TypeTag>
struct UseMoles<TypeTag, TTag::RichardsNC> { static constexpr bool value = true; };
//! Use the dedicated local residual
SET_TYPE_PROP(RichardsNC, LocalResidual, CompositionalLocalResidual<TypeTag>);
......@@ -190,7 +191,8 @@ public:
//! The default richardsnc model computes no diffusion in the air phase
//! Turning this on leads to the extended Richards equation (see e.g. Vanderborght et al. 2017)
SET_BOOL_PROP(RichardsNC, EnableWaterDiffusionInAir, false);
template<class TypeTag>
struct EnableWaterDiffusionInAir<TypeTag, TTag::RichardsNC> { static constexpr bool value = false; };
/*!
*\brief The fluid system used by the model.
......
......@@ -130,7 +130,8 @@ struct Tracer { using InheritsFrom = std::tuple<PorousMediumFlow>; };
///////////////////////////////////////////////////////////////////////////
//! Define that mole fractions are used in the balance equations
SET_BOOL_PROP(Tracer, UseMoles, true);
template<class TypeTag>
struct UseMoles<TypeTag, TTag::Tracer> { static constexpr bool value = true; };
//! set the model traits
SET_PROP(Tracer, ModelTraits)
......
......@@ -133,3 +133,4 @@ catch (...)
std::cerr << "Unknown exception thrown --> Abort!" << std::endl;
return 2;
}
// find . -type f -not -path '*common/properties*' -not -path '*/sequential/*' -not -name 'test_propertysystem*.cc' -name '*.[ch][ch]' -exec sed -i 's/SET_BOOL_PROP[ ]*(\([^,]*\),[ ]*\([^,]*\),[ ]*\([^)]*\))/template<class TypeTag>\nstruct \2<TypeTag, TTag::\1> { static constexpr bool value = \3; }/g' {} \;
......@@ -61,10 +61,13 @@ SET_TYPE_PROP(AngeliTest, Grid, Dune::YaspGrid<2, Dune::EquidistantOffsetCoordin
// Set the problem property
SET_TYPE_PROP(AngeliTest, Problem, Dumux::AngeliTestProblem<TypeTag> );
SET_BOOL_PROP(AngeliTest, EnableFVGridGeometryCache, true);
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; };
SET_BOOL_PROP(AngeliTest, EnableGridFluxVariablesCache, true);
SET_BOOL_PROP(AngeliTest, EnableGridVolumeVariablesCache, true);
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::AngeliTest> { static constexpr bool value = true; };
}
......
......@@ -63,12 +63,16 @@ SET_TYPE_PROP(NavierStokesAnalytic, Grid, Dune::YaspGrid<1>);
// Set the problem property
SET_TYPE_PROP(NavierStokesAnalytic, Problem, Dumux::NavierStokesAnalyticProblem<TypeTag> );
SET_BOOL_PROP(NavierStokesAnalytic, EnableFVGridGeometryCache, true);
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; };
SET_BOOL_PROP(NavierStokesAnalytic, EnableGridFluxVariablesCache, true);
SET_BOOL_PROP(NavierStokesAnalytic, EnableGridVolumeVariablesCache, true);
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = true; };
SET_BOOL_PROP(NavierStokesAnalytic, NormalizePressure, false);
template<class TypeTag>
struct NormalizePressure<TypeTag, TTag::NavierStokesAnalytic> { static constexpr bool value = false; };
}
/*!
......
......@@ -67,10 +67,13 @@ SET_TYPE_PROP(ChannelTest, Grid, Dune::YaspGrid<2>);
// Set the problem property
SET_TYPE_PROP(ChannelTest, Problem, Dumux::ChannelTestProblem<TypeTag> );
SET_BOOL_PROP(ChannelTest, EnableFVGridGeometryCache, true);
template<class TypeTag>
struct EnableFVGridGeometryCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; };
SET_BOOL_PROP(ChannelTest, EnableGridFluxVariablesCache, true);
SET_BOOL_PROP(ChannelTest, EnableGridVolumeVariablesCache, true);
template<class TypeTag>
struct EnableGridFluxVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; };
template<class TypeTag>
struct EnableGridVolumeVariablesCache<TypeTag, TTag::ChannelTest> { static constexpr bool value = true; };
}
/*!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment