model.hh 3.48 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
 *   See the file COPYING for full copying permissions.                      *
 *                                                                           *
 *   This program is free software: you can redistribute it and/or modify    *
 *   it under the terms of the GNU General Public License as published by    *
 *   the Free Software Foundation, either version 2 of the License, or       *
 *   (at your option) any later version.                                     *
 *                                                                           *
 *   This program is distributed in the hope that it will be useful,         *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
 *   GNU General Public License for more details.                            *
 *                                                                           *
 *   You should have received a copy of the GNU General Public License       *
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
 *****************************************************************************/
/*!
 * \file
21
22
 * \ingroup Properties
 * \brief Defines a type tags and some fundamental properties for all models
23
 */
Timo Koch's avatar
Timo Koch committed
24
25
#ifndef DUMUX_MODEL_PROPERTIES_HH
#define DUMUX_MODEL_PROPERTIES_HH
26

27
#include <dune/common/fvector.hh>
28
#include <dune/common/deprecated.hh>
29

30
#include <dumux/common/properties.hh>
Timo Koch's avatar
Timo Koch committed
31
#include <dumux/common/balanceequationopts.hh>
32
#include <dumux/io/defaultiofields.hh>
33

Timo Koch's avatar
Timo Koch committed
34
// Forward declaration
35
namespace Dune { class ParameterTree; }
36

37
38
39
namespace Dumux {
namespace Properties {

40
//! Type tag for numeric models.
41
42
43
namespace TTag {
struct ModelProperties {};
}
44
45

//! Set the default type of scalar values to double
46
47
template<class TypeTag>
struct Scalar<TypeTag, TTag::ModelProperties> { using type = double; };
48

49
//! Set the default vector with size number of equations to a field vector
50
51
template<class TypeTag>
struct NumEqVector<TypeTag, TTag::ModelProperties> { using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; };
52
53

//! Set the default primary variable vector to a vector of size of number of equations
54
55
template<class TypeTag>
struct PrimaryVariables<TypeTag, TTag::ModelProperties> { using type = GetPropType<TypeTag, Properties::NumEqVector>; };
56
57

//! do not specific any model-specific default parameters here
58
59
template<class TypeTag>
struct ModelDefaultParameters<TypeTag, TTag::ModelProperties>
60
61
62
63
{
    static void defaultParams(Dune::ParameterTree& tree, const std::string& group = "") { }
};

64
//! \todo this property is deprecated use IOFields instead!
65
66
67
template<class TypeTag>
struct VtkOutputFields<TypeTag, TTag::ModelProperties> {
    using type DUNE_DEPRECATED_MSG("This property is deprecated use property IOFields instead") = GetPropType<TypeTag, Properties::IOFields>;
68
69
70
};

//! Set the default to an implementation throwing a NotImplemented error
71
72
template<class TypeTag>
struct IOFields<TypeTag, TTag::ModelProperties> { using type = DefaultIOFields; };
73
74

//! Set the default class for the balance equation options
75
76
template<class TypeTag>
struct BalanceEqOpts<TypeTag, TTag::ModelProperties> { using type = BalanceEquationOptions<TypeTag>; };
77
78
79
80
81

} // namespace Properties
} // namespace Dumux

#endif