model.hh 3.39 KB
Newer Older
1
2
3
4
5
6
7
// -*- 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    *
8
 *   the Free Software Foundation, either version 3 of the License, or       *
9
10
11
12
13
14
15
16
17
18
19
20
 *   (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
DUNE_NO_DEPRECATED_BEGIN
50
//! Set the default vector with size number of equations to a field vector
51
52
template<class TypeTag>
struct NumEqVector<TypeTag, TTag::ModelProperties> { using type = Dune::FieldVector<GetPropType<TypeTag, Properties::Scalar>, GetPropType<TypeTag, Properties::ModelTraits>::numEq()>; };
53
DUNE_NO_DEPRECATED_END
54

55
DUNE_NO_DEPRECATED_BEGIN
56
//! Set the default primary variable vector to a vector of size of number of equations
57
//! TODO: this needs to be adapted after release 3.4 when Properties::NumEqVector is removed.
58
59
template<class TypeTag>
struct PrimaryVariables<TypeTag, TTag::ModelProperties> { using type = GetPropType<TypeTag, Properties::NumEqVector>; };
60
DUNE_NO_DEPRECATED_END
61
62

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

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

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

} // namespace Properties
} // namespace Dumux

#endif