fluxvariablescaching.hh 2.67 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
Simon Scholz's avatar
Simon Scholz committed
21
 * \ingroup Flux
22
23
24
25
26
 * \brief Classes related to flux variables caching
 */
#ifndef DUMUX_DISCRETIZATION_FLUXVAR_CACHING_HH
#define DUMUX_DISCRETIZATION_FLUXVAR_CACHING_HH

27
namespace Dumux {
28
namespace FluxVariablesCaching {
29
30

//! The empty filler class corresponding to EmptyCache
31
struct EmptyCacheFiller
32
{
33
34
35
36
37
38
39
    EmptyCacheFiller() = default;

    template<class Problem>
    EmptyCacheFiller(const Problem& p) {}

    static constexpr bool isSolDependent = false; // the cache is empty

40
41
42
    template<typename... Args>
    static void fill(Args&&... args) {}
};
43

44
//! An empty flux variables cache
45
46
47
48
49
template<class S>
struct EmptyCache
{
    //! export type used for scalar values
    using Scalar = S;
50
51
52

    template<typename... Args>
    void update(Args&&... args) {}
53
};
54
55

#ifndef DOXYGEN // hide the empty caches from doxygen
56
// an empty cache filler
57
// \note Never use the _EmptyCache directly as it lead to ambiguous definitions
58
59
struct _EmptyCache
{ using Filler = EmptyCacheFiller; };
60
61
#endif // DOXYGEN

62
/*!
Melanie Lipp's avatar
Melanie Lipp committed
63
 * \ingroup Flux
64
 * \brief Empty caches to use in a constitutive flux law/process, e.g. Darcy's law
65
 */
66
67
68
struct EmptyAdvectionCache : public _EmptyCache {};
struct EmptyDiffusionCache : public _EmptyCache {};
struct EmptyHeatConductionCache : public _EmptyCache {};
69

70
71
72
73
} // end namespace FluxVariablesCaching
} // end namespace Dumux

#endif