My Project
VelocityInterpolation.hpp
1/*
2 Copyright 2012 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_VELOCITYINTERPOLATION_HEADER_INCLUDED
21#define OPM_VELOCITYINTERPOLATION_HEADER_INCLUDED
22
23#include <opm/grid/utility/WachspressCoord.hpp>
24#include <vector>
25
26struct UnstructuredGrid;
27
28namespace Opm
29{
30
33 {
34 public:
36
39 virtual void setupFluxes(const double* flux) = 0;
40
47 virtual void interpolate(const int cell,
48 const double* x,
49 double* v) const = 0;
50 };
51
52
53
54
58 {
59 public:
63
66 virtual void setupFluxes(const double* flux);
67
74 virtual void interpolate(const int cell,
75 const double* x,
76 double* v) const;
77 private:
78 const UnstructuredGrid& grid_;
79 const double* flux_;
80 };
81
82
83
84
85
91 {
92 public:
95 explicit VelocityInterpolationECVI(const UnstructuredGrid& grid);
96
99 virtual void setupFluxes(const double* flux);
100
107 virtual void interpolate(const int cell,
108 const double* x,
109 double* v) const;
110 private:
111 WachspressCoord bcmethod_;
112 const UnstructuredGrid& grid_;
113 mutable std::vector<double> bary_coord_;
114 std::vector<double> corner_velocity_; // size = dim * #corners
115 };
116
117
118
119
120} // namespace Opm
121
122#endif // OPM_VELOCITYINTERPOLATION_HEADER_INCLUDED
A constant velocity approximation.
Definition: VelocityInterpolation.hpp:58
virtual void setupFluxes(const double *flux)
Set up fluxes for interpolation.
Definition: VelocityInterpolation.cpp:50
virtual void interpolate(const int cell, const double *x, double *v) const
Interpolate velocity.
Definition: VelocityInterpolation.cpp:61
VelocityInterpolationConstant(const UnstructuredGrid &grid)
Constructor.
Definition: VelocityInterpolation.cpp:43
Interpolate velocity using the extended CVI scheme: compute a corner velocity for each cell corner th...
Definition: VelocityInterpolation.hpp:91
virtual void setupFluxes(const double *flux)
Set up fluxes for interpolation.
Definition: VelocityInterpolation.cpp:99
virtual void interpolate(const int cell, const double *x, double *v) const
Interpolate velocity.
Definition: VelocityInterpolation.cpp:168
VelocityInterpolationECVI(const UnstructuredGrid &grid)
Constructor.
Definition: VelocityInterpolation.cpp:91
Abstract interface for velocity interpolation method classes.
Definition: VelocityInterpolation.hpp:33
virtual void setupFluxes(const double *flux)=0
Set up fluxes for interpolation.
virtual void interpolate(const int cell, const double *x, double *v) const =0
Interpolate velocity.
Class capable of computing Wachspress coordinates in 2d and 3d.
Definition: WachspressCoord.hpp:37
Holds the implementation of the CpGrid as a pimple.
Definition: CellQuadrature.hpp:29
Data structure for an unstructured grid, unstructured meaning that any cell may have an arbitrary num...
Definition: UnstructuredGrid.h:99