remove macro EWOMS_GET_PARAM

This commit is contained in:
Arne Morten Kvarving 2024-04-05 10:27:52 +02:00
parent 4d2486196f
commit 078b0e8679
51 changed files with 268 additions and 273 deletions

View File

@ -311,16 +311,16 @@ public:
eps_ = 1e-6;
temperatureLow_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemTemperatureLow);
temperatureHigh_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemTemperatureHigh);
nTemperature_ = EWOMS_GET_PARAM(TypeTag, unsigned, FluidSystemNumTemperature);
temperatureLow_ = Parameters::get<TypeTag, Properties::FluidSystemTemperatureLow>();
temperatureHigh_ = Parameters::get<TypeTag, Properties::FluidSystemTemperatureHigh>();
nTemperature_ = Parameters::get<TypeTag, Properties::FluidSystemNumTemperature>();
pressureLow_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemPressureLow);
pressureHigh_ = EWOMS_GET_PARAM(TypeTag, Scalar, FluidSystemPressureHigh);
nPressure_ = EWOMS_GET_PARAM(TypeTag, unsigned, FluidSystemNumPressure);
pressureLow_ = Parameters::get<TypeTag, Properties::FluidSystemPressureLow>();
pressureHigh_ = Parameters::get<TypeTag, Properties::FluidSystemPressureHigh>();
nPressure_ = Parameters::get<TypeTag, Properties::FluidSystemNumPressure>();
maxDepth_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxDepth);
temperature_ = EWOMS_GET_PARAM(TypeTag, Scalar, Temperature);
maxDepth_ = Parameters::get<TypeTag, Properties::MaxDepth>();
temperature_ = Parameters::get<TypeTag, Properties::Temperature>();
// initialize the tables of the fluid system
// FluidSystem::init();
@ -404,7 +404,7 @@ public:
std::string name() const
{
std::ostringstream oss;
oss << EWOMS_GET_PARAM(TypeTag, std::string, SimulationName)
oss << Parameters::get<TypeTag, Properties::SimulationName>()
<< "_" << Model::name();
if (getPropValue<TypeTag, Properties::EnableEnergy>())
oss << "_ni";

View File

@ -353,7 +353,7 @@ public:
explicit CO2PTProblem(Simulator& simulator)
: ParentType(simulator)
{
const Scalar epi_len = EWOMS_GET_PARAM(TypeTag, Scalar, EpisodeLength);
const Scalar epi_len = Parameters::get<TypeTag, Properties::EpisodeLength>();
simulator.setEpisodeLength(epi_len);
FluidSystem::init();
using CompParm = typename FluidSystem::ComponentParam;
@ -371,7 +371,7 @@ public:
void initPetrophysics()
{
temperature_ = EWOMS_GET_PARAM(TypeTag, Scalar, Temperature);
temperature_ = Parameters::get<TypeTag, Properties::Temperature>();
K_ = this->toDimMatrix_(9.869232667160131e-14);
porosity_ = 0.1;
@ -422,7 +422,7 @@ public:
std::string name() const
{
std::ostringstream oss;
oss << EWOMS_GET_PARAM(TypeTag, std::string, SimulationName);
oss << Parameters::get<TypeTag, Properties::SimulationName>();
return oss.str();
}
@ -431,7 +431,7 @@ public:
// the old one.
void endEpisode()
{
Scalar epi_len = EWOMS_GET_PARAM(TypeTag, Scalar, EpisodeLength);
Scalar epi_len = Parameters::get<TypeTag, Properties::EpisodeLength>();
this->simulator().startNextEpisode(epi_len);
}
@ -507,7 +507,7 @@ public:
{
int spatialIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
int inj = 0;
int prod = EWOMS_GET_PARAM(TypeTag, unsigned, CellsX) - 1;
int prod = Parameters::get<TypeTag, Properties::CellsX>() - 1;
if (spatialIdx == inj || spatialIdx == prod) {
return 1.0;
} else {
@ -558,7 +558,7 @@ private:
// p0 = 75e5
// T0 = 423.25
int inj = 0;
int prod = EWOMS_GET_PARAM(TypeTag, unsigned, CellsX) - 1;
int prod = Parameters::get<TypeTag, Properties::CellsX>() - 1;
int spatialIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
ComponentVector comp;
comp[0] = Evaluation::createVariable(0.5, 1);
@ -573,7 +573,7 @@ private:
sat[0] = 1.0;
sat[1] = 1.0 - sat[0];
Scalar p0 = EWOMS_GET_PARAM(TypeTag, Scalar, Initialpressure);
Scalar p0 = Parameters::get<TypeTag, Properties::Initialpressure>();
//\Note, for an AD variable, if we multiply it with 2, the derivative will also be scalced with 2,
//\Note, so we should not do it.

View File

@ -558,7 +558,7 @@ private:
auto& fs = initialFluidState_;
fs.setPressure(wettingPhaseIdx, /*pressure=*/1e5);
Scalar Sw = EWOMS_GET_PARAM(TypeTag, Scalar, InitialWaterSaturation);
Scalar Sw = Parameters::get<TypeTag, Properties::InitialWaterSaturation>();
fs.setSaturation(wettingPhaseIdx, Sw);
fs.setSaturation(nonWettingPhaseIdx, 1 - Sw);

View File

@ -240,20 +240,20 @@ public:
eps_ = 1.0e-3;
lensLowerLeft_[0] = EWOMS_GET_PARAM(TypeTag, Scalar, LensLowerLeftX);
lensLowerLeft_[0] = Parameters::get<TypeTag, Properties::LensLowerLeftX>();
if (dim > 1)
lensLowerLeft_[1] = EWOMS_GET_PARAM(TypeTag, Scalar, LensLowerLeftY);
lensLowerLeft_[1] = Parameters::get<TypeTag, Properties::LensLowerLeftY>();
if (dim > 2)
lensLowerLeft_[2] = EWOMS_GET_PARAM(TypeTag, Scalar, LensLowerLeftY);
lensLowerLeft_[2] = Parameters::get<TypeTag, Properties::LensLowerLeftY>();
lensUpperRight_[0] = EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightX);
lensUpperRight_[0] = Parameters::get<TypeTag, Properties::LensUpperRightX>();
if (dim > 1)
lensUpperRight_[1] = EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightY);
lensUpperRight_[1] = Parameters::get<TypeTag, Properties::LensUpperRightY>();
if (dim > 2)
lensUpperRight_[2] = EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightY);
lensUpperRight_[2] = Parameters::get<TypeTag, Properties::LensUpperRightY>();
intrinsicPerm_ = this->toDimMatrix_(EWOMS_GET_PARAM(TypeTag, Scalar, Permeability));
intrinsicPermLens_ = this->toDimMatrix_(EWOMS_GET_PARAM(TypeTag, Scalar, PermeabilityLens));
intrinsicPerm_ = this->toDimMatrix_(Parameters::get<TypeTag, Properties::Permeability>());
intrinsicPermLens_ = this->toDimMatrix_(Parameters::get<TypeTag, Properties::PermeabilityLens>());
}
/*!

View File

@ -321,14 +321,14 @@ public:
FluidSystem::init();
temperature_ = 273.15 + 20; // -> 20°C
lensLowerLeft_[0] = EWOMS_GET_PARAM(TypeTag, Scalar, LensLowerLeftX);
lensLowerLeft_[1] = EWOMS_GET_PARAM(TypeTag, Scalar, LensLowerLeftY);
lensUpperRight_[0] = EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightX);
lensUpperRight_[1] = EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightY);
lensLowerLeft_[0] = Parameters::get<TypeTag, Properties::LensLowerLeftX>();
lensLowerLeft_[1] = Parameters::get<TypeTag, Properties::LensLowerLeftY>();
lensUpperRight_[0] = Parameters::get<TypeTag, Properties::LensUpperRightX>();
lensUpperRight_[1] = Parameters::get<TypeTag, Properties::LensUpperRightY>();
if (dimWorld == 3) {
lensLowerLeft_[2] = EWOMS_GET_PARAM(TypeTag, Scalar, LensLowerLeftZ);
lensUpperRight_[2] = EWOMS_GET_PARAM(TypeTag, Scalar, LensUpperRightZ);
lensLowerLeft_[2] = Parameters::get<TypeTag, Properties::LensLowerLeftZ>();
lensUpperRight_[2] = Parameters::get<TypeTag, Properties::LensUpperRightZ>();
}
// residual saturations

View File

@ -262,9 +262,9 @@ public:
{
ParentType::finishInit();
temperature_ = EWOMS_GET_PARAM(TypeTag, Scalar, Temperature);
maxDepth_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxDepth);
wellWidth_ = EWOMS_GET_PARAM(TypeTag, Scalar, WellWidth);
temperature_ = Parameters::get<TypeTag, Properties::Temperature>();
maxDepth_ = Parameters::get<TypeTag, Properties::MaxDepth>();
wellWidth_ = Parameters::get<TypeTag, Properties::WellWidth>();
std::vector<std::pair<Scalar, Scalar> > Bo = {
{ 101353, 1.062 },

View File

@ -155,17 +155,17 @@ class BlackOilNewtonMethod : public GetPropType<TypeTag, Properties::DiscNewtonM
public:
BlackOilNewtonMethod(Simulator& simulator) : ParentType(simulator)
{
priVarOscilationThreshold_ = EWOMS_GET_PARAM(TypeTag, Scalar, PriVarOscilationThreshold);
dpMaxRel_ = EWOMS_GET_PARAM(TypeTag, Scalar, DpMaxRel);
dsMax_ = EWOMS_GET_PARAM(TypeTag, Scalar, DsMax);
projectSaturations_ = EWOMS_GET_PARAM(TypeTag, bool, ProjectSaturations);
maxTempChange_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaxTemperatureChange);
tempMax_ = EWOMS_GET_PARAM(TypeTag, Scalar, TemperatureMax);
tempMin_ = EWOMS_GET_PARAM(TypeTag, Scalar, TemperatureMin);
pressMax_ = EWOMS_GET_PARAM(TypeTag, Scalar, PressureMax);
pressMin_ = EWOMS_GET_PARAM(TypeTag, Scalar, PressureMin);
waterSaturationMax_ = EWOMS_GET_PARAM(TypeTag, Scalar, MaximumWaterSaturation);
waterOnlyThreshold_ = EWOMS_GET_PARAM(TypeTag, Scalar, WaterOnlyThreshold);
priVarOscilationThreshold_ = Parameters::get<TypeTag, Properties::PriVarOscilationThreshold>();
dpMaxRel_ = Parameters::get<TypeTag, Properties::DpMaxRel>();
dsMax_ = Parameters::get<TypeTag, Properties::DsMax>();
projectSaturations_ = Parameters::get<TypeTag, Properties::ProjectSaturations>();
maxTempChange_ = Parameters::get<TypeTag, Properties::MaxTemperatureChange>();
tempMax_ = Parameters::get<TypeTag, Properties::TemperatureMax>();
tempMin_ = Parameters::get<TypeTag, Properties::TemperatureMin>();
pressMax_ = Parameters::get<TypeTag, Properties::PressureMax>();
pressMin_ = Parameters::get<TypeTag, Properties::PressureMin>();
waterSaturationMax_ = Parameters::get<TypeTag, Properties::MaximumWaterSaturation>();
waterOnlyThreshold_ = Parameters::get<TypeTag, Properties::WaterOnlyThreshold>();
}
/*!

View File

@ -212,7 +212,7 @@ public:
static void init()
{
// TODO: these parameters have undocumented non-trivial dependencies
pressureScale_ = EWOMS_GET_PARAM(TypeTag, double, PressureScale);
pressureScale_ = Parameters::get<TypeTag, Properties::PressureScale>();
}
static void registerParameters()

View File

@ -1368,7 +1368,7 @@ public:
Valgrind::CheckDefined(solventPGrad);
// correct the pressure gradients by the gravitational acceleration
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity)) {
if (Parameters::get<TypeTag, Properties::EnableGravity>()) {
// estimate the gravitational acceleration at a given SCV face
// using the arithmetic mean
const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx);

View File

@ -214,7 +214,7 @@ protected:
}
// correct the pressure gradients by the gravitational acceleration
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity)) {
if (Parameters::get<TypeTag, Properties::EnableGravity>()) {
// estimate the gravitational acceleration at a given SCV face
// using the arithmetic mean
const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx);
@ -364,7 +364,7 @@ protected:
K_ = intQuantsIn.intrinsicPermeability();
// correct the pressure gradients by the gravitational acceleration
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity)) {
if (Parameters::get<TypeTag, Properties::EnableGravity>()) {
// estimate the gravitational acceleration at a given SCV face
// using the arithmetic mean
const auto& gIn = elemCtx.problem().gravity(elemCtx, i, timeIdx);

View File

@ -395,7 +395,7 @@ private:
void init_()
{
gravity_ = 0.0;
if (EWOMS_GET_PARAM(TypeTag, bool, EnableGravity))
if (Parameters::get<TypeTag, Properties::EnableGravity>())
gravity_[dimWorld-1] = -9.81;
}
};

View File

@ -132,7 +132,7 @@ public:
DiscreteFractureModel(Simulator& simulator)
: ParentType(simulator)
{
if (EWOMS_GET_PARAM(TypeTag, bool, EnableIntensiveQuantityCache)) {
if (Parameters::get<TypeTag, Properties::EnableIntensiveQuantityCache>()) {
throw std::runtime_error("The discrete fracture model does not work in conjunction "
"with intensive quantities caching");
}

View File

@ -453,10 +453,10 @@ public:
, newtonMethod_(simulator)
, localLinearizer_(ThreadManager::maxThreads())
, linearizer_(new Linearizer())
, enableGridAdaptation_( EWOMS_GET_PARAM(TypeTag, bool, EnableGridAdaptation) )
, enableIntensiveQuantityCache_(EWOMS_GET_PARAM(TypeTag, bool, EnableIntensiveQuantityCache))
, enableStorageCache_(EWOMS_GET_PARAM(TypeTag, bool, EnableStorageCache))
, enableThermodynamicHints_(EWOMS_GET_PARAM(TypeTag, bool, EnableThermodynamicHints))
, enableGridAdaptation_(Parameters::get<TypeTag, Properties::EnableGridAdaptation>() )
, enableIntensiveQuantityCache_(Parameters::get<TypeTag, Properties::EnableIntensiveQuantityCache>())
, enableStorageCache_(Parameters::get<TypeTag, Properties::EnableStorageCache>())
, enableThermodynamicHints_(Parameters::get<TypeTag, Properties::EnableThermodynamicHints>())
{
bool isEcfv = std::is_same<Discretization, EcfvDiscretization<TypeTag> >::value;
if (enableGridAdaptation_ && !isEcfv)
@ -464,7 +464,7 @@ public:
"element-centered finite volume discretization (is: "
+Dune::className<Discretization>()+")");
enableStorageCache_ = EWOMS_GET_PARAM(TypeTag, bool, EnableStorageCache);
enableStorageCache_ = Parameters::get<TypeTag, Properties::EnableStorageCache>();
PrimaryVariables::init();
size_t numDof = asImp_().numGridDof();

View File

@ -95,7 +95,7 @@ public:
{
// remember the simulator object
simulatorPtr_ = &simulator;
enableStorageCache_ = EWOMS_GET_PARAM(TypeTag, bool, EnableStorageCache);
enableStorageCache_ = Parameters::get<TypeTag, Properties::EnableStorageCache>();
stashedDofIdx_ = -1;
focusDofIdx_ = -1;
}

View File

@ -335,7 +335,7 @@ protected:
* \brief Returns the numeric difference method which is applied.
*/
static int numericDifferenceMethod_()
{ return EWOMS_GET_PARAM(TypeTag, int, NumericDifferenceMethod); }
{ return Parameters::get<TypeTag, Properties::NumericDifferenceMethod>(); }
/*!
* \brief Resize all internal attributes to the size of the

View File

@ -141,12 +141,12 @@ public:
if (enableVtkOutput_()) {
bool asyncVtkOutput =
simulator_.gridView().comm().size() == 1 &&
EWOMS_GET_PARAM(TypeTag, bool, EnableAsyncVtkOutput);
Parameters::get<TypeTag, Properties::EnableAsyncVtkOutput>();
// asynchonous VTK output currently does not work in conjunction with grid
// adaptivity because the async-IO code assumes that the grid stays
// constant. complain about that case.
bool enableGridAdaptation = EWOMS_GET_PARAM(TypeTag, bool, EnableGridAdaptation);
bool enableGridAdaptation = Parameters::get<TypeTag, Properties::EnableGridAdaptation>();
if (asyncVtkOutput && enableGridAdaptation)
throw std::runtime_error("Asynchronous VTK output currently cannot be used "
"at the same time as grid adaptivity");
@ -203,9 +203,9 @@ public:
*/
std::string outputDir() const
{
std::string outputDir = EWOMS_GET_PARAM(TypeTag, std::string, OutputDir);
std::string outputDir = Parameters::get<TypeTag, Properties::OutputDir>();
if (outputDir == "")
if (outputDir.empty())
outputDir = ".";
// TODO: replace this by std::filesystem once we require c++-2017
@ -559,14 +559,14 @@ public:
* \brief Returns the minimum allowable size of a time step.
*/
Scalar minTimeStepSize() const
{ return EWOMS_GET_PARAM(TypeTag, Scalar, MinTimeStepSize); }
{ return Parameters::get<TypeTag, Properties::MinTimeStepSize>(); }
/*!
* \brief Returns the maximum number of subsequent failures for the time integration
* before giving up.
*/
unsigned maxTimeIntegrationFailures() const
{ return EWOMS_GET_PARAM(TypeTag, unsigned, MaxTimeStepDivisions); }
{ return Parameters::get<TypeTag, Properties::MaxTimeStepDivisions>(); }
/*!
* \brief Returns if we should continue with a non-converged solution instead of
@ -574,7 +574,7 @@ public:
* step size.
*/
bool continueOnConvergenceError() const
{ return EWOMS_GET_PARAM(TypeTag, unsigned, ContinueOnConvergenceError); }
{ return Parameters::get<TypeTag, Properties::ContinueOnConvergenceError>(); }
/*!
* \brief Impose the next time step size to be used externally.
@ -592,7 +592,7 @@ public:
if (nextTimeStepSize_ > 0.0)
return nextTimeStepSize_;
Scalar dtNext = std::min(EWOMS_GET_PARAM(TypeTag, Scalar, MaxTimeStepSize),
Scalar dtNext = std::min(Parameters::get<TypeTag, Properties::MaxTimeStepSize>(),
newtonMethod().suggestTimeStepSize(simulator().timeStepSize()));
if (dtNext < simulator().maxTimeStepSize()
@ -811,7 +811,7 @@ protected:
private:
bool enableVtkOutput_() const
{ return EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput); }
{ return Parameters::get<TypeTag, Properties::EnableVtkOutput>(); }
//! Returns the implementation of the problem (i.e. static polymorphism)
Implementation& asImp_()

View File

@ -122,7 +122,7 @@ public:
: jacobian_()
{
simulatorPtr_ = 0;
separateSparseSourceTerms_ = EWOMS_GET_PARAM(TypeTag, bool, SeparateSparseSourceTerms);
separateSparseSourceTerms_ = Parameters::get<TypeTag, Properties::SeparateSparseSourceTerms>();
}
~TpfaLinearizer()

View File

@ -106,7 +106,7 @@ public:
const auto& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
const auto& problem = elemCtx.problem();
Scalar flashTolerance = EWOMS_GET_PARAM(TypeTag, Scalar, FlashTolerance);
Scalar flashTolerance = Parameters::get<TypeTag, Properties::FlashTolerance>();
// extract the total molar densities of the components
ComponentVector cTotal;

View File

@ -100,18 +100,18 @@ public:
for (unsigned i = 0; i < dimWorld; ++i)
cellRes[i] = 0;
upperRight[0] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeX);
cellRes[0] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsX);
upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
if (dimWorld > 1) {
upperRight[1] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeY);
cellRes[1] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsY);
upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
}
if (dimWorld > 2) {
upperRight[2] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeZ);
cellRes[2] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsZ);
upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
}
unsigned numRefinements = EWOMS_GET_PARAM(TypeTag, unsigned, GridGlobalRefinements);
unsigned numRefinements = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
cubeGrid_ = Dune::StructuredGridFactory<Grid>::createCubeGrid(lowerLeft, upperRight, cellRes);
cubeGrid_->globalRefine(static_cast<int>(numRefinements));

View File

@ -75,8 +75,8 @@ public:
DgfVanguard(Simulator& simulator)
: ParentType(simulator)
{
const std::string dgfFileName = EWOMS_GET_PARAM(TypeTag, std::string, GridFile);
unsigned numRefinments = EWOMS_GET_PARAM(TypeTag, unsigned, GridGlobalRefinements);
const std::string dgfFileName = Parameters::get<TypeTag, Properties::GridFile>();
unsigned numRefinments = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
{
// create DGF GridPtr from a dgf file

View File

@ -59,24 +59,24 @@ public:
*/
static void registerParameters()
{
EWOMS_REGISTER_PARAM(TypeTag, unsigned, GridGlobalRefinements,
"The number of global refinements of the grid "
"executed after it was loaded");
EWOMS_REGISTER_PARAM(TypeTag, Scalar, DomainSizeX,
"The size of the domain in x direction");
EWOMS_REGISTER_PARAM(TypeTag, unsigned, CellsX,
"The number of intervalls in x direction");
Parameters::registerParam<TypeTag, Properties::GridGlobalRefinements>
("The number of global refinements of the grid "
"executed after it was loaded");
Parameters::registerParam<TypeTag, Properties::DomainSizeX>
("The size of the domain in x direction");
Parameters::registerParam<TypeTag, Properties::CellsX>
("The number of intervalls in x direction");
if (dimWorld > 1) {
EWOMS_REGISTER_PARAM(TypeTag, Scalar, DomainSizeY,
"The size of the domain in y direction");
EWOMS_REGISTER_PARAM(TypeTag, unsigned, CellsY,
"The number of intervalls in y direction");
Parameters::registerParam<TypeTag, Properties::DomainSizeY>
("The size of the domain in y direction");
Parameters::registerParam<TypeTag, Properties::CellsY>
("The number of intervalls in y direction");
}
if (dimWorld > 2) {
EWOMS_REGISTER_PARAM(TypeTag, Scalar, DomainSizeZ,
"The size of the domain in z direction");
EWOMS_REGISTER_PARAM(TypeTag, unsigned, CellsZ,
"The number of intervalls in z direction");
Parameters::registerParam<TypeTag, Properties::DomainSizeZ>
("The size of the domain in z direction");
Parameters::registerParam<TypeTag, Properties::CellsZ>
("The number of intervalls in z direction");
}
}
@ -91,24 +91,24 @@ public:
GlobalPosition lowerLeft;
lowerLeft[0] = 0.0;
upperRight[0] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeX);
cellRes[0] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsX);
upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
if (dimWorld > 1) {
lowerLeft[1] = 0.0;
upperRight[1] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeY);
cellRes[1] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsY);
upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
}
if (dimWorld > 2) {
lowerLeft[2] = 0.0;
upperRight[2] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeZ);
cellRes[2] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsZ);
upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
cellRes[2] = Parameters::get<TypeTag, Properies::CellsZ>();
}
simplexGrid_ = Dune::StructuredGridFactory<Grid>::createSimplexGrid(lowerLeft,
upperRight,
cellRes);
unsigned numRefinments = EWOMS_GET_PARAM(TypeTag, unsigned, GridGlobalRefinements);
unsigned numRefinments = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
simplexGrid_->globalRefine(numRefinments);
this->finalizeInit_();

View File

@ -139,14 +139,14 @@ public:
Dune::FieldVector<GridScalar, dim> upperRight;
Dune::FieldVector<GridScalar, dim> lowerLeft( 0 );
upperRight[0] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeX);
upperRight[1] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeY);
upperRight[0] = Parameters::get<TypeTag, Properties::DomainSizeX>();
upperRight[1] = Parameters::get<TypeTag, Properties::DomainSizeY>();
cellRes[0] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsX);
cellRes[1] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsY);
cellRes[0] = Parameters::get<TypeTag, Properties::CellsX>();
cellRes[1] = Parameters::get<TypeTag, Properties::CellsY>();
if (dim == 3) {
upperRight[2] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeZ);
cellRes[2] = EWOMS_GET_PARAM(TypeTag, unsigned, CellsZ);
upperRight[2] = Parameters::get<TypeTag, Properties::DomainSizeZ>();
cellRes[2] = Parameters::get<TypeTag, Properties::CellsZ>();
}
std::stringstream dgffile;
@ -165,7 +165,7 @@ public:
// use DGF parser to create a grid from interval block
gridPtr_.reset( Dune::GridPtr< Grid >( dgffile ).release() );
unsigned numRefinements = EWOMS_GET_PARAM(TypeTag, unsigned, GridGlobalRefinements);
unsigned numRefinements = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
gridPtr_->globalRefine(static_cast<int>(numRefinements));
this->finalizeInit_();

View File

@ -52,11 +52,11 @@ class UnstructuredGridVanguard : public BaseVanguard<TypeTag> {
* unstructured grid simulator vanguard.
*/
static void registerParameters() {
EWOMS_REGISTER_PARAM(TypeTag, unsigned, GridGlobalRefinements,
"The number of global refinements of the grid "
"executed after it was loaded");
EWOMS_REGISTER_PARAM(TypeTag, std::string, GridFile,
"The file name of the file to load");
Parameters::registerParam<TypeTag, Properties::GridGlobalRefinements>
("The number of global refinements of the grid "
"executed after it was loaded");
Parameters::registerParam<TypeTag, Properties::GridFile>,
("The file name of the file to load");
}
/*!
@ -64,8 +64,8 @@ class UnstructuredGridVanguard : public BaseVanguard<TypeTag> {
*/
UnstructuredGridVanguard(Simulator& simulator) : ParentType(simulator){
#ifdef HAVE_OPM_GRID
const std::string gridFileName = EWOMS_GET_PARAM(TypeTag, std::string, GridFile);
unsigned numRefinments = EWOMS_GET_PARAM(TypeTag, unsigned, GridGlobalRefinements);
const std::string gridFileName = Parameters::get<TypeTag, Properties::GridFile>();
unsigned numRefinments = Parameters::get<TypeTag, Properties::GridGlobalRefinements>();
const char* c_str = gridFileName.c_str();

View File

@ -130,7 +130,7 @@ public:
*/
void allocBuffers()
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enableEnergy)
@ -152,7 +152,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enableEnergy)
@ -212,25 +212,25 @@ public:
private:
static bool rockInternalEnergyOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteRockInternalEnergy);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteRockInternalEnergy>();
return val;
}
static bool totalThermalConductivityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteTotalThermalConductivity);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteTotalThermalConductivity>();
return val;
}
static bool fluidInternalEnergiesOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFluidInternalEnergies);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFluidInternalEnergies>();
return val;
}
static bool fluidEnthalpiesOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFluidEnthalpies);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFluidEnthalpies>();
return val;
}

View File

@ -134,7 +134,7 @@ public:
*/
void allocBuffers()
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enableMICP)
@ -158,7 +158,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enableMICP)
@ -223,31 +223,31 @@ public:
private:
static bool microbialConcentrationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteMicrobialConcentration);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteMicrobialConcentration>();
return val;
}
static bool oxygenConcentrationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteOxygenConcentration);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteOxygenConcentration>();
return val;
}
static bool ureaConcentrationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteUreaConcentration);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteUreaConcentration>();
return val;
}
static bool biofilmConcentrationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteBiofilmConcentration);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteBiofilmConcentration>();
return val;
}
static bool calciteConcentrationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteCalciteConcentration);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteCalciteConcentration>();
return val;
}

View File

@ -216,7 +216,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++dofIdx) {
@ -344,67 +344,67 @@ public:
private:
static bool gasDissolutionFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteGasDissolutionFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteGasDissolutionFactor>();
return val;
}
static bool oilVaporizationFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteOilVaporizationFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteOilVaporizationFactor>();
return val;
}
static bool oilFormationVolumeFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteOilFormationVolumeFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteOilFormationVolumeFactor>();
return val;
}
static bool gasFormationVolumeFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteGasFormationVolumeFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteGasFormationVolumeFactor>();
return val;
}
static bool waterFormationVolumeFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteWaterFormationVolumeFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteWaterFormationVolumeFactor>();
return val;
}
static bool oilSaturationPressureOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteOilSaturationPressure);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteOilSaturationPressure>();
return val;
}
static bool gasSaturationPressureOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteGasSaturationPressure);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteGasSaturationPressure>();
return val;
}
static bool saturatedOilGasDissolutionFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSaturatedOilGasDissolutionFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSaturatedOilGasDissolutionFactor>();
return val;
}
static bool saturatedGasOilVaporizationFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSaturatedGasOilVaporizationFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSaturatedGasOilVaporizationFactor>();
return val;
}
static bool saturationRatiosOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSaturationRatios);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSaturationRatios>();
return val;
}
static bool primaryVarsMeaningOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePrimaryVarsMeaning);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePrimaryVarsMeaning>();
return val;
}

View File

@ -143,7 +143,7 @@ public:
*/
void allocBuffers()
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enablePolymer)
@ -169,7 +169,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enablePolymer)
@ -239,37 +239,37 @@ public:
private:
static bool polymerConcentrationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePolymerConcentration);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePolymerConcentration>();
return val;
}
static bool polymerDeadPoreVolumeOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePolymerDeadPoreVolume);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePolymerDeadPoreVolume>();
return val;
}
static bool polymerRockDensityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePolymerRockDensity);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePolymerRockDensity>();
return val;
}
static bool polymerAdsorptionOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePolymerAdsorption);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePolymerAdsorption>();
return val;
}
static bool polymerViscosityCorrectionOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePolymerViscosityCorrection);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePolymerViscosityCorrection>();
return val;
}
static bool waterViscosityCorrectionOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePolymerViscosityCorrection);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePolymerViscosityCorrection>();
return val;
}

View File

@ -136,7 +136,7 @@ public:
*/
void allocBuffers()
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enableSolvent)
@ -160,7 +160,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
if (!enableSolvent)
@ -224,31 +224,31 @@ public:
private:
static bool solventSaturationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSolventSaturation);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSolventSaturation>();
return val;
}
static bool solventRswOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSolventRsw);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSolventRsw>();
return val;
}
static bool solventDensityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSolventDensity);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSolventDensity>();
return val;
}
static bool solventViscosityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSolventViscosity);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSolventViscosity>();
return val;
}
static bool solventMobilityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSolventMobility);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSolventMobility>();
return val;
}

View File

@ -170,7 +170,7 @@ public:
{
using Toolbox = MathToolbox<Evaluation>;
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {
@ -256,43 +256,43 @@ public:
private:
static bool massFracOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteMassFractions);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteMassFractions>();
return val;
}
static bool moleFracOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteMoleFractions);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteMoleFractions>();
return val;
}
static bool totalMassFracOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteTotalMassFractions);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteTotalMassFractions>();
return val;
}
static bool totalMoleFracOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteTotalMoleFractions);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteTotalMoleFractions>();
return val;
}
static bool molarityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteMolarities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteMolarities>();
return val;
}
static bool fugacityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFugacities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFugacities>();
return val;
}
static bool fugacityCoeffOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFugacityCoeffs);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFugacityCoeffs>();
return val;
}

View File

@ -138,7 +138,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {
@ -184,19 +184,19 @@ public:
private:
static bool tortuosityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteTortuosities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteTortuosities>();
return val;
}
static bool diffusionCoefficientOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteDiffusionCoefficients);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteDiffusionCoefficients>();
return val;
}
static bool effectiveDiffusionCoefficientOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteEffectiveDiffusionCoefficients);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteEffectiveDiffusionCoefficients>();
return val;
}

View File

@ -190,7 +190,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
const auto& fractureMapper = elemCtx.simulator().vanguard().fractureMapper();
@ -318,43 +318,43 @@ public:
private:
static bool saturationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFractureSaturations);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFractureSaturations>();
return val;
}
static bool mobilityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFractureMobilities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFractureMobilities>();
return val;
}
static bool relativePermeabilityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFractureRelativePermeabilities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFractureRelativePermeabilities>();
return val;
}
static bool porosityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFracturePorosity);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFracturePorosity>();
return val;
}
static bool intrinsicPermeabilityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFractureIntrinsicPermeabilities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFractureIntrinsicPermeabilities>();
return val;
}
static bool volumeFractionOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFractureVolumeFraction);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFractureVolumeFraction>();
return val;
}
static bool velocityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFractureFilterVelocities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFractureFilterVelocities>();
return val;
}

View File

@ -148,7 +148,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {
@ -194,25 +194,25 @@ public:
private:
static bool solidInternalEnergyOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSolidInternalEnergy);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSolidInternalEnergy>();
return val;
}
static bool thermalConductivityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteThermalConductivity);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteThermalConductivity>();
return val;
}
static bool enthalpyOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteEnthalpies);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteEnthalpies>();
return val;
}
static bool internalEnergyOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteInternalEnergies);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteInternalEnergies>();
return val;
}

View File

@ -238,7 +238,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
const auto& problem = elemCtx.problem();
@ -418,73 +418,73 @@ public:
private:
static bool extrusionFactorOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteExtrusionFactor);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteExtrusionFactor>();
return val;
}
static bool pressureOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePressures);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePressures>();
return val;
}
static bool densityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteDensities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteDensities>();
return val;
}
static bool saturationOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteSaturations);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteSaturations>();
return val;
}
static bool mobilityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteMobilities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteMobilities>();
return val;
}
static bool relativePermeabilityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteRelativePermeabilities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteRelativePermeabilities>();
return val;
}
static bool viscosityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteViscosities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteViscosities>();
return val;
}
static bool averageMolarMassOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteAverageMolarMasses);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteAverageMolarMasses>();
return val;
}
static bool porosityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePorosity);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePorosity>();
return val;
}
static bool intrinsicPermeabilityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteIntrinsicPermeabilities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteIntrinsicPermeabilities>();
return val;
}
static bool velocityOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteFilterVelocities);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteFilterVelocities>();
return val;
}
static bool potentialGradientOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePotentialGradients);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePotentialGradients>();
return val;
}

View File

@ -103,7 +103,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {
@ -133,7 +133,7 @@ public:
private:
static bool phasePresenceOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePhasePresence);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePhasePresence>();
return val;
}

View File

@ -122,7 +122,7 @@ public:
*/
void processElement(const ElementContext& elemCtx)
{
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
const auto& elementMapper = elemCtx.model().elementMapper();
@ -168,17 +168,17 @@ public:
private:
static bool primaryVarsOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWritePrimaryVars);
static bool val = Parameters::get<TypeTag, Properties::VtkWritePrimaryVars>();
return val;
}
static bool processRankOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteProcessRank);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteProcessRank>();
return val;
}
static bool dofIndexOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteDofIndex);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteDofIndex>();
return val;
}

View File

@ -125,7 +125,7 @@ public:
{
using Toolbox = MathToolbox<Evaluation>;
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {
@ -162,13 +162,13 @@ public:
private:
static bool LOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteLiquidMoleFractions);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteLiquidMoleFractions>();
return val;
}
static bool equilConstOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteEquilibriumConstants);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteEquilibriumConstants>();
return val;
}

View File

@ -109,7 +109,7 @@ public:
{
using Toolbox = MathToolbox<Evaluation>;
if (!EWOMS_GET_PARAM(TypeTag, bool, EnableVtkOutput))
if (!Parameters::get<TypeTag, Properties::EnableVtkOutput>())
return;
for (unsigned i = 0; i < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++i) {
@ -139,7 +139,7 @@ public:
private:
static bool temperatureOutput_()
{
static bool val = EWOMS_GET_PARAM(TypeTag, bool, VtkWriteTemperature);
static bool val = Parameters::get<TypeTag, Properties::VtkWriteTemperature>();
return val;
}

View File

@ -117,10 +117,10 @@ protected:
// make sure that the error never grows beyond the maximum
// allowed one
if (this->error_ > EWOMS_GET_PARAM(TypeTag, Scalar, NewtonMaxError))
if (this->error_ > Parameters::get<TypeTag, Properties::NewtonMaxError>())
throw Opm::NumericalProblem("Newton: Error "+std::to_string(double(this->error_))+
+ " is larger than maximum allowed error of "
+ std::to_string(double(EWOMS_GET_PARAM(TypeTag, Scalar, NewtonMaxError))));
+ std::to_string(Parameters::get<TypeTag, Properties::NewtonMaxError>()));
}
/*!

View File

@ -139,7 +139,7 @@ public:
{
lastError_ = 1e100;
error_ = 1e100;
tolerance_ = EWOMS_GET_PARAM(TypeTag, Scalar, NewtonTolerance);
tolerance_ = Parameters::get<TypeTag, Properties::NewtonTolerance>();
numIterations_ = 0;
}
@ -529,7 +529,7 @@ protected:
*/
bool verbose_() const
{
return EWOMS_GET_PARAM(TypeTag, bool, NewtonVerbose) && (comm_.rank() == 0);
return Parameters::get<TypeTag, Properties::NewtonVerbose>() && (comm_.rank() == 0);
}
/*!
@ -542,7 +542,7 @@ protected:
{
numIterations_ = 0;
if (EWOMS_GET_PARAM(TypeTag, bool, NewtonWriteConvergence))
if (Parameters::get<TypeTag, Properties::NewtonWriteConvergence>())
convergenceWriter_.beginTimeStep();
}
@ -594,7 +594,7 @@ protected:
{
const auto& constraintsMap = model().linearizer().constraintsMap();
lastError_ = error_;
Scalar newtonMaxError = EWOMS_GET_PARAM(TypeTag, Scalar, NewtonMaxError);
Scalar newtonMaxError = Parameters::get<TypeTag, Properties::NewtonMaxError>();
// calculate the error as the maximum weighted tolerance of
// the solution's residual
@ -759,7 +759,7 @@ protected:
void writeConvergence_(const SolutionVector& currentSolution,
const GlobalEqVector& solutionUpdate)
{
if (EWOMS_GET_PARAM(TypeTag, bool, NewtonWriteConvergence)) {
if (Parameters::get<TypeTag, Properties::NewtonWriteConvergence>()) {
convergenceWriter_.beginIteration();
convergenceWriter_.writeFields(currentSolution, solutionUpdate);
convergenceWriter_.endIteration();
@ -831,7 +831,7 @@ protected:
*/
void end_()
{
if (EWOMS_GET_PARAM(TypeTag, bool, NewtonWriteConvergence))
if (Parameters::get<TypeTag, Properties::NewtonWriteConvergence>())
convergenceWriter_.endTimeStep();
}
@ -853,10 +853,10 @@ protected:
// optimal number of iterations we want to achieve
int targetIterations_() const
{ return EWOMS_GET_PARAM(TypeTag, int, NewtonTargetIterations); }
{ return Parameters::get<TypeTag, Properties::NewtonTargetIterations>(); }
// maximum number of iterations we do before giving up
int maxIterations_() const
{ return EWOMS_GET_PARAM(TypeTag, int, NewtonMaxIterations); }
{ return Parameters::get<TypeTag, Properties::NewtonMaxIterations>(); }
static bool enableConstraints_()
{ return getPropValue<TypeTag, Properties::EnableConstraints>(); }

View File

@ -78,7 +78,7 @@ public:
{
if (queryCommandLineParameter)
{
numThreads_ = EWOMS_GET_PARAM(TypeTag, int, ThreadsPerProcess);
numThreads_ = Parameters::get<TypeTag, Properties::ThreadsPerProcess>();
// some safety checks. This is pretty ugly macro-magic, but so what?
#if !defined(_OPENMP)

View File

@ -107,9 +107,9 @@ public:
const auto& priVars = elemCtx.primaryVars(dofIdx, timeIdx);
const auto& problem = elemCtx.problem();
const Scalar flashTolerance = EWOMS_GET_PARAM(TypeTag, Scalar, FlashTolerance);
const int flashVerbosity = EWOMS_GET_PARAM(TypeTag, int, FlashVerbosity);
const std::string flashTwoPhaseMethod = EWOMS_GET_PARAM(TypeTag, std::string, FlashTwoPhaseMethod);
const Scalar flashTolerance = Parameters::get<TypeTag, Properties::FlashTolerance>();
const int flashVerbosity = Parameters::get<TypeTag, Properties::FlashVerbosity>();
const std::string flashTwoPhaseMethod = Parameters::get<TypeTag, Properties::FlashTwoPhaseMethod>();
// extract the total molar densities of the components
ComponentVector z(0.);

View File

@ -275,7 +275,7 @@ public:
PvsModel(Simulator& simulator)
: ParentType(simulator)
{
verbosity_ = EWOMS_GET_PARAM(TypeTag, int, PvsVerbosity);
verbosity_ = Parameters::get<TypeTag, Properties::PvsVerbosity>();
numSwitched_ = 0;
}

View File

@ -56,24 +56,6 @@
#include <unistd.h>
#include <sys/ioctl.h>
/*!
* \ingroup Parameter
*
* \brief Retrieve a runtime parameter.
*
* The default value is specified via the property system.
*
* Example:
*
* \code
* // Retrieves scalar value UpwindWeight, default
* // is taken from the property UpwindWeight
* EWOMS_GET_PARAM(TypeTag, Scalar, UpwindWeight);
* \endcode
*/
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName) \
(::Opm::Parameters::get<TypeTag, Properties::ParamName>())
namespace Opm {
namespace Parameters {
@ -96,7 +78,21 @@ struct ParamInfo
}
};
// forward declaration
/*!
* \ingroup Parameter
*
* \brief Retrieve a runtime parameter.
*
* The default value is specified via the property system.
*
* Example:
*
* \code
* // Retrieves value UpwindWeight, default
* // is taken from the property UpwindWeight
* ::Opm::Parameters::get<TypeTag, Properties::UpwindWeight>();
* \endcode
*/
template <class TypeTag, template<class,class> class Property>
auto get(bool errorIfNotRegistered = true);

View File

@ -129,11 +129,11 @@ public:
timeStepIdx_ = 0;
startTime_ = 0.0;
time_ = 0.0;
endTime_ = EWOMS_GET_PARAM(TypeTag, Scalar, EndTime);
timeStepSize_ = EWOMS_GET_PARAM(TypeTag, Scalar, InitialTimeStepSize);
endTime_ = Parameters::get<TypeTag, Properties::EndTime>();
timeStepSize_ = Parameters::get<TypeTag, Properties::InitialTimeStepSize>();
assert(timeStepSize_ > 0);
const std::string& predetTimeStepFile =
EWOMS_GET_PARAM(TypeTag, std::string, PredeterminedTimeStepsFile);
Parameters::get<TypeTag, Properties::PredeterminedTimeStepsFile>();
if (!predetTimeStepFile.empty()) {
std::ifstream is(predetTimeStepFile);
while (!is.eof()) {
@ -649,7 +649,7 @@ public:
TimerGuard writeTimerGuard(writeTimer_);
setupTimer_.start();
Scalar restartTime = EWOMS_GET_PARAM(TypeTag, Scalar, RestartTime);
Scalar restartTime = Parameters::get<TypeTag, Properties::RestartTime>();
if (restartTime > -1e30) {
// try to restart a previous simulation
time_ = restartTime;

View File

@ -318,7 +318,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
#endif
// read the initial time step and the end time
Scalar endTime = EWOMS_GET_PARAM(TypeTag, Scalar, EndTime);
Scalar endTime = Parameters::get<TypeTag, Properties::EndTime>();
if (endTime < -1e50) {
if (myRank == 0)
Parameters::printUsage<TypeTag>(argv[0],
@ -326,7 +326,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
return 1;
}
Scalar initialTimeStepSize = EWOMS_GET_PARAM(TypeTag, Scalar, InitialTimeStepSize);
Scalar initialTimeStepSize = Parameters::get<TypeTag, Properties::InitialTimeStepSize>();
if (initialTimeStepSize < -1e50) {
if (myRank == 0)
Parameters::printUsage<TypeTag>(argv[0],
@ -354,7 +354,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
}
// print the parameters if requested
int printParams = EWOMS_GET_PARAM(TypeTag, int, PrintParameters);
int printParams = Parameters::get<TypeTag, Properties::PrintParameters>();
if (myRank == 0) {
std::string endParametersSeparator("# [end of parameters]\n");
if (printParams) {
@ -378,7 +378,7 @@ static inline int start(int argc, char **argv, bool registerParams=true)
}
// print the properties if requested
int printProps = EWOMS_GET_PARAM(TypeTag, int, PrintProperties);
int printProps = Parameters::get<TypeTag, Properties::PrintProperties>();
if (printProps && myRank == 0) {
if (printProps == 1 || !isatty(fileno(stdout)))
Properties::printValues<TypeTag>(std::cout);

View File

@ -80,8 +80,8 @@ namespace Linear {
\
void prepare(IstlMatrix& matrix) \
{ \
int order = EWOMS_GET_PARAM(TypeTag, int, PreconditionerOrder); \
Scalar relaxationFactor = EWOMS_GET_PARAM(TypeTag, Scalar, PreconditionerRelaxation); \
int order = Parameters::get<TypeTag, Properties::PreconditionerOrder>(); \
Scalar relaxationFactor = Parameters::get<TypeTag, Properties::PreconditionerRelaxation>(); \
seqPreCond_ = new SequentialPreconditioner(matrix, order, \
relaxationFactor); \
} \
@ -122,7 +122,7 @@ namespace Linear {
void prepare(OverlappingMatrix& matrix) \
{ \
Scalar relaxationFactor = \
EWOMS_GET_PARAM(TypeTag, Scalar, PreconditionerRelaxation); \
Parameters::get<TypeTag, Properties::PreconditionerRelaxation>(); \
seqPreCond_ = new SequentialPreconditioner(matrix, \
relaxationFactor); \
} \
@ -168,7 +168,7 @@ public:
void prepare(OverlappingMatrix& matrix)
{
Scalar relaxationFactor = EWOMS_GET_PARAM(TypeTag, Scalar, PreconditionerRelaxation);
Scalar relaxationFactor = Parameters::get<TypeTag, Properties::PreconditionerRelaxation>();
// create the sequential preconditioner.
seqPreCond_ = new SequentialPreconditioner(matrix, relaxationFactor);

View File

@ -77,13 +77,12 @@ namespace Opm::Linear {
ScalarProduct& parScalarProduct, \
Preconditioner& parPreCond) \
{ \
Scalar tolerance = EWOMS_GET_PARAM(TypeTag, Scalar, \
LinearSolverTolerance); \
int maxIter = EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIterations);\
Scalar tolerance = Parameters::get<TypeTag, Properties::LinearSolverTolerance>(); \
int maxIter = Parameters::get<TypeTag, Properties::LinearSolverMaxIterations>();\
\
int verbosity = 0; \
if (parOperator.overlap().myRank() == 0) \
verbosity = EWOMS_GET_PARAM(TypeTag, int, LinearSolverVerbosity); \
verbosity = Parameters::get<TypeTag, Properties::LinearSolverVerbosity>(); \
solver_ = std::make_shared<RawSolver>(parOperator, parScalarProduct, \
parPreCond, tolerance, maxIter, \
verbosity); \
@ -133,13 +132,13 @@ public:
ScalarProduct& parScalarProduct,
Preconditioner& parPreCond)
{
Scalar tolerance = EWOMS_GET_PARAM(TypeTag, Scalar, LinearSolverTolerance);
int maxIter = EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIterations);
Scalar tolerance = Parameters::get<TypeTag, Properties::LinearSolverTolerance>();
int maxIter = Parameters::get<TypeTag, Properties::LinearSolverMaxIterations>();
int verbosity = 0;
if (parOperator.overlap().myRank() == 0)
verbosity = EWOMS_GET_PARAM(TypeTag, int, LinearSolverVerbosity);
int restartAfter = EWOMS_GET_PARAM(TypeTag, int, GMResRestart);
verbosity = Parameters::get<TypeTag, Properties::LinearSolverVerbosity>();
int restartAfter = Parameters::get<TypeTag, Properties::GMResRestart>();
solver_ = std::make_shared<RawSolver>(parOperator,
parScalarProduct,
parPreCond,

View File

@ -193,24 +193,24 @@ protected:
const auto& gridView = this->simulator_.gridView();
using CCC = CombinedCriterion<OverlappingVector, decltype(gridView.comm())>;
Scalar linearSolverTolerance = EWOMS_GET_PARAM(TypeTag, Scalar, LinearSolverTolerance);
Scalar linearSolverAbsTolerance = EWOMS_GET_PARAM(TypeTag, Scalar, LinearSolverAbsTolerance);
Scalar linearSolverTolerance = Parameters::get<TypeTag, Properties::LinearSolverTolerance>();
Scalar linearSolverAbsTolerance = Parameters::get<TypeTag, Properties::LinearSolverAbsTolerance>();
if(linearSolverAbsTolerance < 0.0)
linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance()/100.0;
convCrit_.reset(new CCC(gridView.comm(),
/*residualReductionTolerance=*/linearSolverTolerance,
/*absoluteResidualTolerance=*/linearSolverAbsTolerance,
EWOMS_GET_PARAM(TypeTag, Scalar, LinearSolverMaxError)));
Parameters::get<TypeTag, Properties::LinearSolverMaxError>()));
auto bicgstabSolver =
std::make_shared<RawLinearSolver>(parPreCond, *convCrit_, parScalarProduct);
int verbosity = 0;
if (parOperator.overlap().myRank() == 0)
verbosity = EWOMS_GET_PARAM(TypeTag, int, LinearSolverVerbosity);
verbosity = Parameters::get<TypeTag, Properties::LinearSolverVerbosity>();
bicgstabSolver->setVerbosity(verbosity);
bicgstabSolver->setMaxIterations(EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIterations));
bicgstabSolver->setMaxIterations(Parameters::get<TypeTag, Properties::LinearSolverMaxIterations>());
bicgstabSolver->setLinearOperator(&parOperator);
bicgstabSolver->setRhs(this->overlappingb_);
@ -274,7 +274,7 @@ protected:
int verbosity = 0;
if (this->simulator_.vanguard().gridView().comm().rank() == 0)
verbosity = EWOMS_GET_PARAM(TypeTag, int, LinearSolverVerbosity);
verbosity = Parameters::get<TypeTag, Properties::LinearSolverVerbosity>();
using SmootherArgs = typename Dune::Amg::SmootherTraits<ParallelSmoother>::Arguments;
@ -289,7 +289,7 @@ protected:
// Dune::Amg::FirstDiagonal>>
using CoarsenCriterion = Dune::Amg::
CoarsenCriterion<Dune::Amg::SymmetricCriterion<IstlMatrix, Dune::Amg::FrobeniusNorm> >;
int coarsenTarget = EWOMS_GET_PARAM(TypeTag, int, AmgCoarsenTarget);
int coarsenTarget = Parameters::get<TypeTag, Properties::AmgCoarsenTarget>();
CoarsenCriterion coarsenCriterion(/*maxLevel=*/15, coarsenTarget);
coarsenCriterion.setDefaultValuesAnisotropic(GridView::dimension,
/*aggregateSizePerDim=*/3);

View File

@ -195,7 +195,7 @@ public:
simulator_.model().dofMapper());
// create the overlapping Jacobian matrix
unsigned overlapSize = EWOMS_GET_PARAM(TypeTag, unsigned, LinearSolverOverlapSize);
unsigned overlapSize = Parameters::get<TypeTag, Properties::LinearSolverOverlapSize>();
overlappingMatrix_ = new OverlappingMatrix(M.istlMatrix(),
borderListCreator.borderList(),
borderListCreator.blackList(),

View File

@ -136,24 +136,24 @@ protected:
const auto& gridView = this->simulator_.gridView();
using CCC = CombinedCriterion<OverlappingVector, decltype(gridView.comm())>;
Scalar linearSolverTolerance = EWOMS_GET_PARAM(TypeTag, Scalar, LinearSolverTolerance);
Scalar linearSolverAbsTolerance = EWOMS_GET_PARAM(TypeTag, Scalar, LinearSolverAbsTolerance);
Scalar linearSolverTolerance = Parameters::get<TypeTag, Properties::LinearSolverTolerance>();
Scalar linearSolverAbsTolerance = Parameters::get<TypeTag, Properties::LinearSolverAbsTolerance>();
if(linearSolverAbsTolerance < 0.0)
linearSolverAbsTolerance = this->simulator_.model().newtonMethod().tolerance() / 100.0;
convCrit_.reset(new CCC(gridView.comm(),
/*residualReductionTolerance=*/linearSolverTolerance,
/*absoluteResidualTolerance=*/linearSolverAbsTolerance,
EWOMS_GET_PARAM(TypeTag, Scalar, LinearSolverMaxError)));
Parameters::get<TypeTag, Properties::LinearSolverMaxError>()));
auto bicgstabSolver =
std::make_shared<RawLinearSolver>(parPreCond, *convCrit_, parScalarProduct);
int verbosity = 0;
if (parOperator.overlap().myRank() == 0)
verbosity = EWOMS_GET_PARAM(TypeTag, int, LinearSolverVerbosity);
verbosity = Parameters::get<TypeTag, Properties::LinearSolverVerbosity>();
bicgstabSolver->setVerbosity(verbosity);
bicgstabSolver->setMaxIterations(EWOMS_GET_PARAM(TypeTag, int, LinearSolverMaxIterations));
bicgstabSolver->setMaxIterations(Parameters::get<TypeTag, Properties::LinearSolverMaxIterations>());
bicgstabSolver->setLinearOperator(&parOperator);
bicgstabSolver->setRhs(this->overlappingb_);

View File

@ -69,8 +69,8 @@ public:
static void registerParameters()
{
EWOMS_REGISTER_PARAM(TypeTag, int, LinearSolverVerbosity,
"The verbosity level of the linear solver");
Parameters::registerParam<TypeTag, Properties::LinearSolverVerbosity>
("The verbosity level of the linear solver");
}
/*!
@ -110,7 +110,7 @@ public:
{
Vector bTmp(b);
int verbosity = EWOMS_GET_PARAM(TypeTag, int, LinearSolverVerbosity);
int verbosity = Parameters::get<TypeTag, Properties::LinearSolverVerbosity>();
Dune::InverseOperatorResult result;
Dune::SuperLU<Matrix> solver(A, verbosity > 0);
solver.apply(x, bTmp, result);