mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #617 from OPM/replace-property-macro-calls
Replace property macro calls
This commit is contained in:
@@ -115,23 +115,23 @@ class aligned_allocator {
|
||||
static_assert(detail::is_alignment_constant<Alignment>::value, "Alignment must be powers of two!");
|
||||
|
||||
public:
|
||||
typedef T value_type;
|
||||
typedef T* pointer;
|
||||
typedef const T* const_pointer;
|
||||
typedef void* void_pointer;
|
||||
typedef const void* const_void_pointer;
|
||||
typedef std::size_t size_type;
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
typedef T& reference;
|
||||
typedef const T& const_reference;
|
||||
using value_type = T;
|
||||
using pointer = T*;
|
||||
using const_pointer = const T*;
|
||||
using void_pointer = void*;
|
||||
using const_void_pointer = const void*;
|
||||
using size_type = std::size_t;
|
||||
using difference_type = std::ptrdiff_t;
|
||||
using reference = T&;
|
||||
using const_reference = const T&;
|
||||
|
||||
private:
|
||||
typedef detail::max_align<Alignment, detail::alignment_of<value_type>::value> MaxAlign;
|
||||
using MaxAlign = detail::max_align<Alignment, detail::alignment_of<value_type>::value>;
|
||||
|
||||
public:
|
||||
template<class U>
|
||||
struct rebind {
|
||||
typedef aligned_allocator<U, Alignment> other;
|
||||
using other = aligned_allocator<U, Alignment>;
|
||||
};
|
||||
|
||||
aligned_allocator()
|
||||
@@ -196,13 +196,13 @@ class aligned_allocator<void, Alignment> {
|
||||
"The specified alignment is not a power of two!");
|
||||
|
||||
public:
|
||||
typedef void value_type;
|
||||
typedef void* pointer;
|
||||
typedef const void* const_pointer;
|
||||
using value_type = void;
|
||||
using pointer = void*;
|
||||
using const_pointer = const void*;
|
||||
|
||||
template<class U>
|
||||
struct rebind {
|
||||
typedef aligned_allocator<U, Alignment> other;
|
||||
using other = aligned_allocator<U, Alignment>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
namespace Opm::Properties {
|
||||
|
||||
///////////////////////////////////
|
||||
// Type tag definitions:
|
||||
@@ -49,11 +49,14 @@ BEGIN_PROPERTIES
|
||||
// +-> ImplicitModel
|
||||
///////////////////////////////////
|
||||
|
||||
// Create new type tags
|
||||
namespace TTag {
|
||||
//! Type tag for all models.
|
||||
NEW_TYPE_TAG(NumericModel, INHERITS_FROM(ParameterSystem));
|
||||
struct NumericModel { using InheritsFrom = std::tuple<ParameterSystem>; };
|
||||
|
||||
//! Type tag for all fully coupled models.
|
||||
NEW_TYPE_TAG(ImplicitModel, INHERITS_FROM(NumericModel));
|
||||
struct ImplicitModel { using InheritsFrom = std::tuple<NumericModel>; };
|
||||
} // end namespace TTag
|
||||
|
||||
///////////////////////////////////
|
||||
// Property names which are always available:
|
||||
@@ -62,39 +65,50 @@ NEW_TYPE_TAG(ImplicitModel, INHERITS_FROM(NumericModel));
|
||||
///////////////////////////////////
|
||||
|
||||
//! Property to specify the type of scalar values.
|
||||
NEW_PROP_TAG(Scalar);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct Scalar { using type = UndefinedProperty; };
|
||||
|
||||
//! Number of equations in the system of PDEs
|
||||
NEW_PROP_TAG(NumEq);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct NumEq { using type = UndefinedProperty; };
|
||||
|
||||
//! Property which provides a Dune::ParameterTree.
|
||||
NEW_PROP_TAG(ParameterTree);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ParameterTree { using type = UndefinedProperty; };
|
||||
|
||||
//! The type of the model
|
||||
NEW_PROP_TAG(Model);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct Model { using type = UndefinedProperty; };
|
||||
|
||||
//! Property which defines the group that is queried for parameters by default
|
||||
NEW_PROP_TAG(ModelParameterGroup);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ModelParameterGroup { using type = UndefinedProperty; };
|
||||
|
||||
//! Property which provides a Vanguard (manages grids)
|
||||
NEW_PROP_TAG(Vanguard);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct Vanguard { using type = UndefinedProperty; };
|
||||
|
||||
//! The type of the DUNE grid
|
||||
NEW_PROP_TAG(Grid);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct Grid { using type = UndefinedProperty; };
|
||||
|
||||
NEW_PROP_TAG(GridView);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct GridView { using type = UndefinedProperty; };
|
||||
|
||||
#if HAVE_DUNE_FEM
|
||||
NEW_PROP_TAG(GridPart);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct GridPart { using type = UndefinedProperty; };
|
||||
#endif
|
||||
|
||||
//! Property which tells the Vanguard how often the grid should be refined
|
||||
//! after creation.
|
||||
NEW_PROP_TAG(GridGlobalRefinements);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct GridGlobalRefinements { using type = UndefinedProperty; };
|
||||
|
||||
//! Property provides the name of the file from which the additional runtime
|
||||
//! parameters should to be loaded from
|
||||
NEW_PROP_TAG(ParameterFile);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ParameterFile { using type = UndefinedProperty; };
|
||||
|
||||
/*!
|
||||
* \brief Print all properties on startup?
|
||||
@@ -102,7 +116,8 @@ NEW_PROP_TAG(ParameterFile);
|
||||
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
|
||||
* default is 2.
|
||||
*/
|
||||
NEW_PROP_TAG(PrintProperties);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct PrintProperties { using type = UndefinedProperty; };
|
||||
|
||||
/*!
|
||||
* \brief Print all parameters on startup?
|
||||
@@ -110,38 +125,52 @@ NEW_PROP_TAG(PrintProperties);
|
||||
* 0 means 'no', 1 means 'yes', 2 means 'print only to logfiles'. The
|
||||
* default is 2.
|
||||
*/
|
||||
NEW_PROP_TAG(PrintParameters);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct PrintParameters { using type = UndefinedProperty; };
|
||||
|
||||
//! The default value for the simulation's end time
|
||||
NEW_PROP_TAG(EndTime);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct EndTime { using type = UndefinedProperty; };
|
||||
|
||||
//! The default value for the simulation's initial time step size
|
||||
NEW_PROP_TAG(InitialTimeStepSize);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct InitialTimeStepSize { using type = UndefinedProperty; };
|
||||
|
||||
//! The default value for the simulation's restart time
|
||||
NEW_PROP_TAG(RestartTime);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct RestartTime { using type = UndefinedProperty; };
|
||||
|
||||
//! The name of the file with a number of forced time step lengths
|
||||
NEW_PROP_TAG(PredeterminedTimeStepsFile);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct PredeterminedTimeStepsFile { using type = UndefinedProperty; };
|
||||
|
||||
//! domain size
|
||||
NEW_PROP_TAG(DomainSizeX);
|
||||
NEW_PROP_TAG(DomainSizeY);
|
||||
NEW_PROP_TAG(DomainSizeZ);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DomainSizeX { using type = UndefinedProperty; };
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DomainSizeY { using type = UndefinedProperty; };
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct DomainSizeZ { using type = UndefinedProperty; };
|
||||
|
||||
//! grid resolution
|
||||
NEW_PROP_TAG(CellsX);
|
||||
NEW_PROP_TAG(CellsY);
|
||||
NEW_PROP_TAG(CellsZ);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct CellsX { using type = UndefinedProperty; };
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct CellsY { using type = UndefinedProperty; };
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct CellsZ { using type = UndefinedProperty; };
|
||||
|
||||
//! name of the grid file
|
||||
NEW_PROP_TAG(GridFile);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct GridFile { using type = UndefinedProperty; };
|
||||
|
||||
//! level of the grid view
|
||||
NEW_PROP_TAG(GridViewLevel);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct GridViewLevel { using type = UndefinedProperty; };
|
||||
|
||||
//! Manages the simulation time
|
||||
NEW_PROP_TAG(Simulator);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct Simulator { using type = UndefinedProperty; };
|
||||
|
||||
/*!
|
||||
* \brief The class which marks the border indices associated with the
|
||||
@@ -149,19 +178,22 @@ NEW_PROP_TAG(Simulator);
|
||||
*
|
||||
* This is required for the algebraic overlap stuff.
|
||||
*/
|
||||
NEW_PROP_TAG(BorderListCreator);
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct BorderListCreator { using type = UndefinedProperty; };
|
||||
|
||||
///////////////////////////////////
|
||||
// Values for the properties
|
||||
///////////////////////////////////
|
||||
|
||||
//! Set the default type of scalar values to double
|
||||
SET_TYPE_PROP(NumericModel, Scalar, double);
|
||||
template<class TypeTag>
|
||||
struct Scalar<TypeTag, TTag::NumericModel> { using type = double; };
|
||||
|
||||
//! Set the ParameterTree property
|
||||
SET_PROP(NumericModel, ParameterTree)
|
||||
template<class TypeTag>
|
||||
struct ParameterTree<TypeTag, TTag::NumericModel>
|
||||
{
|
||||
typedef Dune::ParameterTree type;
|
||||
using type = Dune::ParameterTree;
|
||||
|
||||
static Dune::ParameterTree& tree()
|
||||
{
|
||||
@@ -171,53 +203,78 @@ SET_PROP(NumericModel, ParameterTree)
|
||||
};
|
||||
|
||||
//! use the global group as default for the model's parameter group
|
||||
SET_STRING_PROP(NumericModel, ModelParameterGroup, "");
|
||||
template<class TypeTag>
|
||||
struct ModelParameterGroup<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
|
||||
|
||||
//! Set a value for the GridFile property
|
||||
SET_STRING_PROP(NumericModel, GridFile, "");
|
||||
template<class TypeTag>
|
||||
struct GridFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
|
||||
|
||||
#if HAVE_DUNE_FEM
|
||||
SET_PROP(NumericModel, GridPart)
|
||||
template<class TypeTag>
|
||||
struct GridPart<TypeTag, TTag::NumericModel>
|
||||
{
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
||||
typedef Dune::Fem::AdaptiveLeafGridPart<Grid> type;
|
||||
using Grid = GetPropType<TypeTag, Properties::Grid>;
|
||||
using type = Dune::Fem::AdaptiveLeafGridPart<Grid>;
|
||||
};
|
||||
|
||||
SET_TYPE_PROP(NumericModel, GridView, typename GET_PROP_TYPE(TypeTag, GridPart)::GridViewType);
|
||||
template<class TypeTag>
|
||||
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::GridPart>::GridViewType; };
|
||||
#else
|
||||
//! Use the leaf grid view by default.
|
||||
//!
|
||||
//! Except for spatial refinement, there is rarly a reason to use
|
||||
//! anything else...
|
||||
SET_TYPE_PROP(NumericModel, GridView, typename GET_PROP_TYPE(TypeTag, Grid)::LeafGridView);
|
||||
template<class TypeTag>
|
||||
struct GridView<TypeTag, TTag::NumericModel> { using type = typename GetPropType<TypeTag, Properties::Grid>::LeafGridView; };
|
||||
#endif
|
||||
|
||||
//! Set a value for the ParameterFile property
|
||||
SET_STRING_PROP(NumericModel, ParameterFile, "");
|
||||
template<class TypeTag>
|
||||
struct ParameterFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
|
||||
|
||||
//! Set the number of refinement levels of the grid to 0. This does not belong
|
||||
//! here, strictly speaking.
|
||||
SET_INT_PROP(NumericModel, GridGlobalRefinements, 0);
|
||||
template<class TypeTag>
|
||||
struct GridGlobalRefinements<TypeTag, TTag::NumericModel> { static constexpr int value = 0; };
|
||||
|
||||
//! By default, print the properties on startup
|
||||
SET_INT_PROP(NumericModel, PrintProperties, 2);
|
||||
template<class TypeTag>
|
||||
struct PrintProperties<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
|
||||
|
||||
//! By default, print the values of the run-time parameters on startup
|
||||
SET_INT_PROP(NumericModel, PrintParameters, 2);
|
||||
template<class TypeTag>
|
||||
struct PrintParameters<TypeTag, TTag::NumericModel> { static constexpr int value = 2; };
|
||||
|
||||
//! The default value for the simulation's end time
|
||||
SET_SCALAR_PROP(NumericModel, EndTime, -1e35);
|
||||
template<class TypeTag>
|
||||
struct EndTime<TypeTag, TTag::NumericModel>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = -1e35;
|
||||
};
|
||||
|
||||
//! The default value for the simulation's initial time step size
|
||||
SET_SCALAR_PROP(NumericModel, InitialTimeStepSize, -1e35);
|
||||
template<class TypeTag>
|
||||
struct InitialTimeStepSize<TypeTag, TTag::NumericModel>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = -1e35;
|
||||
};
|
||||
|
||||
//! The default value for the simulation's restart time
|
||||
SET_SCALAR_PROP(NumericModel, RestartTime, -1e35);
|
||||
template<class TypeTag>
|
||||
struct RestartTime<TypeTag, TTag::NumericModel>
|
||||
{
|
||||
using type = GetPropType<TypeTag, Scalar>;
|
||||
static constexpr type value = -1e35;
|
||||
};
|
||||
|
||||
//! By default, do not force any time steps
|
||||
SET_STRING_PROP(NumericModel, PredeterminedTimeStepsFile, "");
|
||||
template<class TypeTag>
|
||||
struct PredeterminedTimeStepsFile<TypeTag, TTag::NumericModel> { static constexpr auto value = ""; };
|
||||
|
||||
|
||||
END_PROPERTIES
|
||||
} // namespace Opm::Properties
|
||||
|
||||
#endif
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
*/
|
||||
#define EWOMS_REGISTER_PARAM(TypeTag, ParamType, ParamName, Description) \
|
||||
::Opm::Parameters::registerParam<TypeTag, ParamType>( \
|
||||
#ParamName, #ParamName, GET_PROP_VALUE(TypeTag, ParamName), Description)
|
||||
#ParamName, #ParamName, getPropValue<TypeTag, Properties::ParamName>(), Description)
|
||||
|
||||
/*!
|
||||
* \ingroup Parameter
|
||||
@@ -85,7 +85,7 @@
|
||||
* This allows to deal with unused parameters
|
||||
*/
|
||||
#define EWOMS_HIDE_PARAM(TypeTag, ParamName) \
|
||||
::Opm::Parameters::hideParam<TypeTag>(#ParamName, GET_PROP_VALUE(TypeTag, ParamName))
|
||||
::Opm::Parameters::hideParam<TypeTag>(#ParamName, getPropValue<TypeTag, Properties::ParamName>())
|
||||
|
||||
/*!
|
||||
* \ingroup Parameter
|
||||
@@ -116,12 +116,12 @@
|
||||
*/
|
||||
#define EWOMS_GET_PARAM(TypeTag, ParamType, ParamName) \
|
||||
(::Opm::Parameters::get<TypeTag, ParamType>(#ParamName, #ParamName, \
|
||||
GET_PROP_VALUE(TypeTag, ParamName)))
|
||||
getPropValue<TypeTag, Properties::ParamName>()))
|
||||
|
||||
//!\cond SKIP_THIS
|
||||
#define EWOMS_GET_PARAM_(TypeTag, ParamType, ParamName) \
|
||||
(::Opm::Parameters::get<TypeTag, ParamType>(#ParamName, #ParamName, \
|
||||
GET_PROP_VALUE(TypeTag, ParamName), \
|
||||
getPropValue<TypeTag, Properties::ParamName>(), \
|
||||
/*errorIfNotRegistered=*/false))
|
||||
|
||||
/*!
|
||||
@@ -221,19 +221,25 @@ private:
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
BEGIN_PROPERTIES
|
||||
namespace Opm::Properties {
|
||||
|
||||
namespace TTag {
|
||||
|
||||
// type tag which is supposed to spliced in or inherited from if the
|
||||
// parameter system is to be used
|
||||
NEW_TYPE_TAG(ParameterSystem);
|
||||
struct ParameterSystem {};
|
||||
|
||||
NEW_PROP_TAG(ParameterMetaData);
|
||||
} // namespace TTag
|
||||
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct ParameterMetaData { using type = UndefinedProperty; };
|
||||
|
||||
|
||||
//! Set the ParameterMetaData property
|
||||
SET_PROP(ParameterSystem, ParameterMetaData)
|
||||
template<class TypeTag>
|
||||
struct ParameterMetaData<TypeTag, TTag::ParameterSystem>
|
||||
{
|
||||
typedef Dune::ParameterTree type;
|
||||
using type = Dune::ParameterTree;
|
||||
|
||||
static Dune::ParameterTree& tree()
|
||||
{ return *storage_().tree; }
|
||||
@@ -282,7 +288,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
END_PROPERTIES
|
||||
} // namespace Opm::Properties
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -475,7 +481,7 @@ inline void getFlattenedKeyList_(std::list<std::string>& dest,
|
||||
template <class TypeTag>
|
||||
void printParamList_(std::ostream& os, const std::list<std::string>& keyList, bool printDefaults = false)
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
|
||||
const Dune::ParameterTree& tree = ParamsMeta::tree();
|
||||
|
||||
@@ -510,7 +516,7 @@ void printUsage(const std::string& helpPreamble,
|
||||
const std::string& errorMsg = "",
|
||||
std::ostream& os = std::cerr)
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
|
||||
if (errorMsg != "") {
|
||||
os << errorMsg << "\n"
|
||||
@@ -678,7 +684,7 @@ std::string parseCommandLineOptions(int argc,
|
||||
const std::string& helpPreamble = "",
|
||||
const PositionalArgumentCallback& posArgCallback = noPositionalParameters_)
|
||||
{
|
||||
Dune::ParameterTree& paramTree = GET_PROP(TypeTag, ParameterMetaData)::tree();
|
||||
Dune::ParameterTree& paramTree = GetProp<TypeTag, Properties::ParameterMetaData>::tree();
|
||||
|
||||
// handle the "--help" parameter
|
||||
if (!helpPreamble.empty()) {
|
||||
@@ -779,7 +785,7 @@ std::string parseCommandLineOptions(int argc,
|
||||
template <class TypeTag>
|
||||
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::ifstream ifs(fileName);
|
||||
@@ -846,7 +852,7 @@ void parseParameterFile(const std::string& fileName, bool overwrite = true)
|
||||
template <class TypeTag>
|
||||
void printValues(std::ostream& os = std::cout)
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
|
||||
const Dune::ParameterTree& tree = ParamsMeta::tree();
|
||||
|
||||
@@ -914,7 +920,7 @@ void printValues(std::ostream& os = std::cout)
|
||||
template <class TypeTag>
|
||||
bool printUnused(std::ostream& os = std::cout)
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
|
||||
const Dune::ParameterTree& tree = ParamsMeta::tree();
|
||||
std::list<std::string> runTimeAllKeyList;
|
||||
@@ -946,7 +952,7 @@ bool printUnused(std::ostream& os = std::cout)
|
||||
template <class TypeTag>
|
||||
class Param
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
|
||||
public:
|
||||
template <class ParamType, class PropTag>
|
||||
@@ -1021,7 +1027,7 @@ private:
|
||||
const std::string& propertyName,
|
||||
const char *paramName)
|
||||
{
|
||||
typedef std::unordered_map<std::string, Blubb> StaticData;
|
||||
using StaticData = std::unordered_map<std::string, Blubb>;
|
||||
static StaticData staticData;
|
||||
|
||||
typename StaticData::iterator it = staticData.find(paramName);
|
||||
@@ -1105,7 +1111,7 @@ void getLists(Container& usedParams, Container& unusedParams)
|
||||
usedParams.clear();
|
||||
unusedParams.clear();
|
||||
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
if (ParamsMeta::registrationOpen())
|
||||
throw std::runtime_error("Parameter lists can only retieved after _all_ of them have "
|
||||
"been registered.");
|
||||
@@ -1144,7 +1150,7 @@ bool isSet(const char *propTagName, const char *paramName, bool errorIfNotRegist
|
||||
template <class TypeTag, class ParamType>
|
||||
void registerParam(const char *paramName, const char *propertyName, const ParamType& defaultValue, const char *usageString)
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
if (!ParamsMeta::registrationOpen())
|
||||
throw std::logic_error("Parameter registration was already closed before "
|
||||
"the parameter '"+std::string(paramName)+"' was registered.");
|
||||
@@ -1178,7 +1184,7 @@ void registerParam(const char *paramName, const char *propertyName, const ParamT
|
||||
template <class TypeTag, class ParamType>
|
||||
void hideParam(const char *paramName, const ParamType&)
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
if (!ParamsMeta::registrationOpen())
|
||||
throw std::logic_error("Parameter '"+std::string(paramName)+"' declared as hidden"
|
||||
" when parameter registration was already closed.");
|
||||
@@ -1195,7 +1201,7 @@ void hideParam(const char *paramName, const ParamType&)
|
||||
template <class TypeTag>
|
||||
void endParamRegistration()
|
||||
{
|
||||
typedef typename GET_PROP(TypeTag, ParameterMetaData) ParamsMeta;
|
||||
using ParamsMeta = GetProp<TypeTag, Properties::ParameterMetaData>;
|
||||
if (!ParamsMeta::registrationOpen())
|
||||
throw std::logic_error("Parameter registration was already closed. It is only possible "
|
||||
"to close it once.");
|
||||
|
||||
@@ -47,9 +47,9 @@ namespace Opm {
|
||||
template <class GridView, class Stencil, class Data, class DofMapper>
|
||||
class PffGridVector
|
||||
{
|
||||
typedef typename GridView::template Codim<0>::Entity Element;
|
||||
using Element = typename GridView::template Codim<0>::Entity;
|
||||
|
||||
typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView> ElementMapper;
|
||||
using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
|
||||
|
||||
public:
|
||||
PffGridVector(const GridView& gridView, const DofMapper& dofMapper)
|
||||
|
||||
@@ -254,18 +254,6 @@ void printValues(std::ostream& os = std::cout)
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \ingroup Properties
|
||||
* \brief Indicates that property definitions follow
|
||||
*/
|
||||
#define BEGIN_PROPERTIES namespace Opm { namespace Properties {
|
||||
|
||||
/*!
|
||||
* \ingroup Properties
|
||||
* \brief Indicates that all properties have been specified (for now)
|
||||
*/
|
||||
#define END_PROPERTIES }}
|
||||
|
||||
} // end namespace Opm
|
||||
|
||||
// remove this after release 2020.10 to disable macros per default
|
||||
|
||||
@@ -369,10 +369,22 @@ SET_PROP_(EffTypeTagName, \
|
||||
PropTagName, \
|
||||
/*value=*/TTAG(ValueTypeTagName)) \
|
||||
{ \
|
||||
typedef TTAG(ValueTypeTagName) type; \
|
||||
using type = TTAG(ValueTypeTagName); \
|
||||
}
|
||||
|
||||
} // namespace Properties
|
||||
} // namespace Opm
|
||||
|
||||
#endif // OPM_PROPERTY_SYSTEM_HH
|
||||
/*!
|
||||
* \ingroup Properties
|
||||
* \brief Indicates that property definitions follow
|
||||
*/
|
||||
#define BEGIN_PROPERTIES namespace Opm { namespace Properties {
|
||||
|
||||
/*!
|
||||
* \ingroup Properties
|
||||
* \brief Indicates that all properties have been specified (for now)
|
||||
*/
|
||||
#define END_PROPERTIES }}
|
||||
|
||||
#endif // OPM_PROPERTY_SYSTEM_MACROS_HH
|
||||
|
||||
@@ -41,8 +41,8 @@ class QuadrialteralQuadratureGeometry
|
||||
public:
|
||||
enum { numCorners = (1 << dim) };
|
||||
|
||||
typedef Dune::FieldVector<Scalar, dim> LocalPosition;
|
||||
typedef Dune::FieldVector<Scalar, dim> GlobalPosition;
|
||||
using LocalPosition = Dune::FieldVector<Scalar, dim>;
|
||||
using GlobalPosition = Dune::FieldVector<Scalar, dim>;
|
||||
|
||||
Dune::GeometryType type() const
|
||||
{ return Dune::GeometryType(/*topologyId=*/(1 << dim) - 1, dim); }
|
||||
|
||||
@@ -89,11 +89,11 @@ namespace Opm {
|
||||
template <class TypeTag>
|
||||
class Simulator
|
||||
{
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Model) Model;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
|
||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||
using Vanguard = GetPropType<TypeTag, Properties::Vanguard>;
|
||||
using GridView = GetPropType<TypeTag, Properties::GridView>;
|
||||
using Model = GetPropType<TypeTag, Properties::Model>;
|
||||
using Problem = GetPropType<TypeTag, Properties::Problem>;
|
||||
|
||||
public:
|
||||
// do not allow to copy simulators around
|
||||
@@ -887,7 +887,7 @@ public:
|
||||
*/
|
||||
void serialize()
|
||||
{
|
||||
typedef Opm::Restart Restarter;
|
||||
using Restarter = Opm::Restart;
|
||||
Restarter res;
|
||||
res.serializeBegin(*this);
|
||||
if (gridView().comm().rank() == 0)
|
||||
@@ -973,7 +973,8 @@ private:
|
||||
};
|
||||
|
||||
namespace Properties {
|
||||
SET_TYPE_PROP(NumericModel, Simulator, Opm::Simulator<TypeTag>);
|
||||
template<class TypeTag>
|
||||
struct Simulator<TypeTag, TTag::NumericModel> { using type = Opm::Simulator<TypeTag>; };
|
||||
}
|
||||
|
||||
} // namespace Opm
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#ifndef EWOMS_START_HH
|
||||
#define EWOMS_START_HH
|
||||
|
||||
#include <opm/models/utils/propertysystemmacros.hh>
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
// the following header is not required here, but it must be included before
|
||||
// dune/common/densematrix.hh because of some c++ ideosyncrasies
|
||||
@@ -35,8 +34,6 @@
|
||||
|
||||
#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/timer.hh>
|
||||
|
||||
@@ -78,8 +75,8 @@ namespace Opm {
|
||||
template <class TypeTag>
|
||||
static inline void registerAllParameters_(bool finalizeRegistration = true)
|
||||
{
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, ThreadManager) ThreadManager;
|
||||
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
||||
using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>;
|
||||
|
||||
EWOMS_REGISTER_PARAM(TypeTag, std::string, ParameterFile,
|
||||
"An .ini file which contains a set of run-time "
|
||||
@@ -114,7 +111,7 @@ static inline int setupParameters_(int argc,
|
||||
bool allowUnused=false,
|
||||
bool handleHelp = true)
|
||||
{
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
|
||||
using Problem = GetPropType<TypeTag, Properties::Problem>;
|
||||
|
||||
// first, get the MPI rank of the current process
|
||||
int myRank = 0;
|
||||
@@ -175,8 +172,8 @@ static inline int setupParameters_(int argc,
|
||||
}
|
||||
|
||||
// make sure that no unknown parameters are encountered
|
||||
typedef std::pair<std::string, std::string> KeyValuePair;
|
||||
typedef std::list<KeyValuePair> ParamList;
|
||||
using KeyValuePair = std::pair<std::string, std::string>;
|
||||
using ParamList = std::list<KeyValuePair>;
|
||||
|
||||
ParamList usedParams;
|
||||
ParamList unusedParams;
|
||||
@@ -280,10 +277,10 @@ static inline void resetTerminal_(int signum)
|
||||
template <class TypeTag>
|
||||
static inline int start(int argc, char **argv, bool registerParams=true)
|
||||
{
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, ThreadManager) ThreadManager;
|
||||
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
|
||||
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
|
||||
using Problem = GetPropType<TypeTag, Properties::Problem>;
|
||||
using ThreadManager = GetPropType<TypeTag, Properties::ThreadManager>;
|
||||
|
||||
// set the signal handlers to reset the TTY to a well defined state on unexpected
|
||||
// program aborts
|
||||
|
||||
Reference in New Issue
Block a user