DummyGradientCalculator.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef OPM_DUMMY_GRADIENT_CALCULATOR_HPP
29#define OPM_DUMMY_GRADIENT_CALCULATOR_HPP
30
31#include <dune/common/fvector.hh>
32
33#include <opm/models/discretization/common/fvbaseproperties.hh>
34
35#include <stdexcept>
36
37namespace Opm {
48template<class TypeTag>
50{
51 using GridView = GetPropType<TypeTag, Properties::GridView>;
52 using Scalar = GetPropType<TypeTag, Properties::Scalar>;
53 using ElementContext = GetPropType<TypeTag, Properties::ElementContext>;
54
55 enum { dimWorld = GridView::dimensionworld };
56
57 using DimVector = Dune::FieldVector<Scalar, dimWorld>;
58
59public:
60 static void registerParameters()
61 { }
62
63 template <bool prepareValues = true, bool prepareGradients = true>
64 void prepare(const ElementContext&, unsigned)
65 { }
66
67 template <class QuantityCallback, class QuantityType = Scalar>
68 QuantityType calculateValue(const ElementContext&,
69 unsigned,
70 const QuantityCallback&) const
71 {
72 throw std::logic_error("Generic values are not supported by the black-oil simulator");
73 }
74
75 template <class QuantityCallback>
76 void calculateGradient(DimVector&,
77 const ElementContext&,
78 unsigned,
79 const QuantityCallback&) const
80 {
81 throw std::logic_error("Generic gradients are not supported by the black-oil simulator");
82 }
83
84 template <class QuantityCallback>
85 Scalar calculateBoundaryValue(const ElementContext&,
86 unsigned,
87 const QuantityCallback&)
88 {
89 throw std::logic_error("Generic boundary values are not supported by the black-oil simulator");
90 }
91
92 template <class QuantityCallback>
94 const ElementContext&,
95 unsigned,
96 const QuantityCallback&) const
97 {
98 throw std::logic_error("Generic boundary gradients are not supported by the black-oil simulator");
99 }
100};
101} // namespace Opm
102
103#endif // OPM_DUMMY_GRADIENT_CALCULATOR_HPP
This is a "dummy" gradient calculator which does not do anything.
Definition: DummyGradientCalculator.hpp:50
void calculateGradient(DimVector &, const ElementContext &, unsigned, const QuantityCallback &) const
Definition: DummyGradientCalculator.hpp:76
QuantityType calculateValue(const ElementContext &, unsigned, const QuantityCallback &) const
Definition: DummyGradientCalculator.hpp:68
Scalar calculateBoundaryValue(const ElementContext &, unsigned, const QuantityCallback &)
Definition: DummyGradientCalculator.hpp:85
static void registerParameters()
Definition: DummyGradientCalculator.hpp:60
void calculateBoundaryGradient(DimVector &, const ElementContext &, unsigned, const QuantityCallback &) const
Definition: DummyGradientCalculator.hpp:93
void prepare(const ElementContext &, unsigned)
Definition: DummyGradientCalculator.hpp:64
Definition: BlackoilPhases.hpp:27