DGBasis.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 SINTEF ICT, Applied Mathematics.
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 3 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
20#ifndef OPM_DGBASIS_HEADER_INCLUDED
21#define OPM_DGBASIS_HEADER_INCLUDED
22
23#include <vector>
24
25struct UnstructuredGrid;
26
27namespace Opm
28{
29
32 {
33 public:
36
38 virtual int numBasisFunc() const = 0;
39
41 virtual int dimensions() const = 0;
42
44 virtual int degree() const = 0;
45
49 virtual void eval(const int cell,
50 const double* x,
51 double* f_x) const = 0;
52
58 virtual void evalGrad(const int cell,
59 const double* x,
60 double* grad_f_x) const = 0;
61
68 virtual void addConstant(const double increment,
69 double* coefficients) const = 0;
70
78 virtual void multiplyGradient(const double factor,
79 double* coefficients) const = 0;
80
87 double evalFunc(const int cell,
88 const double* coefficients,
89 const double* x) const;
90
93 virtual double functionAverage(const double* coefficients) const = 0;
94
95 private:
96 mutable std::vector<double> bvals_; // For evalFunc().
97 };
98
99
100
101
102
112 {
113 public:
117 DGBasisBoundedTotalDegree(const UnstructuredGrid& grid, const int degree);
118
121
123 virtual int numBasisFunc() const;
124
126 virtual int dimensions() const;
127
129 virtual int degree() const;
130
134 virtual void eval(const int cell,
135 const double* x,
136 double* f_x) const;
137
143 virtual void evalGrad(const int cell,
144 const double* x,
145 double* grad_f_x) const;
146
153 virtual void addConstant(const double increment,
154 double* coefficients) const;
155
163 virtual void multiplyGradient(const double factor,
164 double* coefficients) const;
165
168 virtual double functionAverage(const double* coefficients) const;
169
170 private:
171 const UnstructuredGrid& grid_;
172 const int degree_;
173 };
174
175
176
177
189 {
190 public:
194 DGBasisMultilin(const UnstructuredGrid& grid, const int degree);
195
198
200 virtual int numBasisFunc() const;
201
203 virtual int dimensions() const;
204
206 virtual int degree() const;
207
211 virtual void eval(const int cell,
212 const double* x,
213 double* f_x) const;
214
220 virtual void evalGrad(const int cell,
221 const double* x,
222 double* grad_f_x) const;
223
230 virtual void addConstant(const double increment,
231 double* coefficients) const;
232
240 virtual void multiplyGradient(const double factor,
241 double* coefficients) const;
242
245 virtual double functionAverage(const double* coefficients) const;
246
247 private:
248 const UnstructuredGrid& grid_;
249 const int degree_;
250
251 };
252
253
254
255
256} // namespace Opm
257
258
259#endif // OPM_DGBASIS_HEADER_INCLUDED
Definition: DGBasis.hpp:112
virtual int dimensions() const
The number of space dimensions.
virtual void addConstant(const double increment, double *coefficients) const
virtual double functionAverage(const double *coefficients) const
DGBasisBoundedTotalDegree(const UnstructuredGrid &grid, const int degree)
virtual void evalGrad(const int cell, const double *x, double *grad_f_x) const
virtual int degree() const
The polynomial degree of the basis functions.
virtual ~DGBasisBoundedTotalDegree()
Destructor.
virtual void multiplyGradient(const double factor, double *coefficients) const
virtual int numBasisFunc() const
The number of basis functions per cell.
virtual void eval(const int cell, const double *x, double *f_x) const
Base class for Discontinuous Galerkin bases, intended for time-of-flight computations.
Definition: DGBasis.hpp:32
virtual int dimensions() const =0
The number of space dimensions.
virtual double functionAverage(const double *coefficients) const =0
virtual void evalGrad(const int cell, const double *x, double *grad_f_x) const =0
virtual ~DGBasisInterface()
Virtual destructor.
virtual void addConstant(const double increment, double *coefficients) const =0
virtual void eval(const int cell, const double *x, double *f_x) const =0
double evalFunc(const int cell, const double *coefficients, const double *x) const
virtual void multiplyGradient(const double factor, double *coefficients) const =0
virtual int degree() const =0
The polynomial degree of the basis functions.
virtual int numBasisFunc() const =0
The number of basis functions per cell.
Definition: DGBasis.hpp:189
virtual void addConstant(const double increment, double *coefficients) const
virtual void evalGrad(const int cell, const double *x, double *grad_f_x) const
virtual int degree() const
The polynomial degree of the basis functions.
virtual double functionAverage(const double *coefficients) const
virtual void multiplyGradient(const double factor, double *coefficients) const
virtual void eval(const int cell, const double *x, double *f_x) const
virtual int numBasisFunc() const
The number of basis functions per cell.
virtual int dimensions() const
The number of space dimensions.
DGBasisMultilin(const UnstructuredGrid &grid, const int degree)
virtual ~DGBasisMultilin()
Destructor.
Definition: AnisotropicEikonal.hpp:44