3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Files | Macros
Properties

Basic properties of all models in DuMux More...

Description

Basic properties of all models in DuMux

Files

file  grid.hh
 Defines a type tags and some fundamental grid-related properties.
 
file  common/properties/model.hh
 Defines a type tags and some fundamental properties for all models.
 
file  propertysystem.hh
 The Dumux property system, traits with inheritance.
 
file  propertysystemmacros.hh
 Provides the magic behind the DuMuX property system.
 

Macros

#define DUMUX_GET_HEAD_(Arg1, ...)   Arg1
 Define a new type tag. More...
 
#define INHERITS_FROM(...)   __VA_ARGS__
 Syntactic sugar for NEW_TYPE_TAG. More...
 
#define NEW_PROP_TAG(PTagName)
 Define a property tag. More...
 
#define SET_PROP(EffTypeTagName, PropTagName)
 Set a property for a specific type tag. More...
 
#define SET_INT_PROP(EffTypeTagName, PropTagName, ...)
 Set a property to a simple constant integer value. More...
 
#define SET_BOOL_PROP(EffTypeTagName, PropTagName, ...)
 Set a property to a simple constant boolean value. More...
 
#define SET_TYPE_PROP(EffTypeTagName, PropTagName, ...)
 Set a property which defines a type. More...
 
#define SET_SCALAR_PROP(EffTypeTagName, PropTagName, ...)
 Set a property to a simple constant scalar value. More...
 
#define SET_STRING_PROP(EffTypeTagName, PropTagName, ...)
 Set a property to a simple constant string value. More...
 

Macro Definition Documentation

◆ DUMUX_GET_HEAD_

#define DUMUX_GET_HEAD_ (   Arg1,
  ... 
)    Arg1

Define a new type tag.

A type tag can inherit the properties defined on up to five parent type tags. Examples:

// The type tag doesn't inherit any properties from other type tags
NEW_TYPE_TAG(FooTypeTag);
// BarTypeTag inherits all properties from FooTypeTag
NEW_TYPE_TAG(BarTypeTag, INHERITS_FROM(FooTypeTag));
// FooBarTypeTag inherits the properties of FooTypeTag as well as
// those of BarTypeTag. Properties defined on BarTypeTag have
// preceedence over those defined for FooTypeTag:
NEW_TYPE_TAG(FooBarTypeTag, INHERITS_FROM(FooTypeTag, BarTypeTag));
#define NEW_TYPE_TAG(...)
Definition: propertysystemmacros.hh:130
#define INHERITS_FROM(...)
Syntactic sugar for NEW_TYPE_TAG.
Definition: propertysystemmacros.hh:142

◆ INHERITS_FROM

#define INHERITS_FROM (   ...)    __VA_ARGS__

Syntactic sugar for NEW_TYPE_TAG.

See the documentation for NEW_TYPE_TAG.

◆ NEW_PROP_TAG

#define NEW_PROP_TAG (   PTagName)
Value:
template<class TypeTag, class MyTypeTag> \
struct PTagName { using type = UndefinedProperty; }; \
extern int semicolonHack_

Define a property tag.

A property tag is the unique identifier for a property. It may only be declared once in your program. There is also no hierarchy of property tags as for type tags.

Examples:

NEW_PROP_TAG(blubbPropTag);
NEW_PROP_TAG(blabbPropTag);
#define NEW_PROP_TAG(PTagName)
Define a property tag.
Definition: propertysystemmacros.hh:159

◆ SET_BOOL_PROP

#define SET_BOOL_PROP (   EffTypeTagName,
  PropTagName,
  ... 
)
Value:
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
using type = bool; \
static constexpr bool value = __VA_ARGS__; \
}
#define TTAG(TypeTagName)
Makes a type out of a type tag name.
Definition: propertysystemmacros.hh:58

Set a property to a simple constant boolean value.

The constant can be accessed by the 'value' attribute.

◆ SET_INT_PROP

#define SET_INT_PROP (   EffTypeTagName,
  PropTagName,
  ... 
)
Value:
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
using type = int; \
static constexpr int value = __VA_ARGS__; \
}

Set a property to a simple constant integer value.

The constant can be accessed by the 'value' attribute.

◆ SET_PROP

#define SET_PROP (   EffTypeTagName,
  PropTagName 
)
Value:
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)>

Set a property for a specific type tag.

After this macro, you must to specify a complete body of a class template, including the trailing semicolon. If you need to retrieve another property within the class body, you can use TypeTag as the argument for the type tag for the GET_PROP macro.

Example:

SET_PROP(FooTypeTag, blubbPropTag)
{
static int value = 10;
static int calculate(int arg)
{ calculateInternal_(arg); }
private:
// retrieve the blabbProp property for the real TypeTag the
// property is defined on. Note that blabbProb does not need to
// be defined on FooTypeTag, but can also be defined for some
// derived type tag.
using blabb = typename GET_PROP(TypeTag, blabbProp);
static int calculateInternal_(int arg)
{ return arg * blabb::value; };
#define GET_PROP(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:281
#define SET_PROP(EffTypeTagName, PropTagName)
Set a property for a specific type tag.
Definition: propertysystemmacros.hh:194

};

◆ SET_SCALAR_PROP

#define SET_SCALAR_PROP (   EffTypeTagName,
  PropTagName,
  ... 
)
Value:
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
public: \
using type = Scalar; \
static const Scalar value; \
}; \
template <class TypeTag> \
const typename PropTagName<TypeTag, TTAG(EffTypeTagName)>::type \
PropTagName<TypeTag, TTAG(EffTypeTagName)>::value(__VA_ARGS__)
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149

Set a property to a simple constant scalar value.

The constant can be accessed by the 'value' attribute. In order to use this macro, the property tag "Scalar" needs to be defined for the real type tag.

◆ SET_STRING_PROP

#define SET_STRING_PROP (   EffTypeTagName,
  PropTagName,
  ... 
)
Value:
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
public: \
using type = std::string; \
static const std::string value; \
}; \
template <class TypeTag> \
const typename PropTagName<TypeTag, TTAG(EffTypeTagName)>::type \
PropTagName<TypeTag, TTAG(EffTypeTagName)>::value(__VA_ARGS__)

Set a property to a simple constant string value.

The constant can be accessed by the 'value' attribute and is of type std::string.

◆ SET_TYPE_PROP

#define SET_TYPE_PROP (   EffTypeTagName,
  PropTagName,
  ... 
)
Value:
template <class TypeTag> \
struct PropTagName<TypeTag, TTAG(EffTypeTagName)> \
{ \
using type = __VA_ARGS__; \
}

Set a property which defines a type.

The type can be accessed by the 'type' attribute.