opm-grid
Toggle main menu visibility
Loading...
Searching...
No Matches
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
26
struct
UnstructuredGrid
;
27
28
namespace
Opm
29
{
30
32
class
VelocityInterpolationInterface
33
{
34
public
:
35
virtual
~VelocityInterpolationInterface
();
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
57
class
VelocityInterpolationConstant
:
public
VelocityInterpolationInterface
58
{
59
public
:
62
explicit
VelocityInterpolationConstant
(
const
UnstructuredGrid
& grid);
63
66
void
setupFluxes
(
const
double
* flux)
override
;
67
74
void
interpolate
(
const
int
cell,
75
const
double
* x,
76
double
* v)
const override
;
77
private
:
78
const
UnstructuredGrid
& grid_;
79
const
double
* flux_;
80
};
81
82
83
84
85
90
class
VelocityInterpolationECVI
:
public
VelocityInterpolationInterface
91
{
92
public
:
95
explicit
VelocityInterpolationECVI
(
const
UnstructuredGrid
& grid);
96
99
void
setupFluxes
(
const
double
* flux)
override
;
100
107
void
interpolate
(
const
int
cell,
108
const
double
* x,
109
double
* v)
const override
;
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
Opm::VelocityInterpolationConstant::setupFluxes
void setupFluxes(const double *flux) override
Set up fluxes for interpolation.
Definition
VelocityInterpolation.cpp:50
Opm::VelocityInterpolationConstant::VelocityInterpolationConstant
VelocityInterpolationConstant(const UnstructuredGrid &grid)
Constructor.
Definition
VelocityInterpolation.cpp:43
Opm::VelocityInterpolationConstant::interpolate
void interpolate(const int cell, const double *x, double *v) const override
Interpolate velocity.
Definition
VelocityInterpolation.cpp:61
Opm::VelocityInterpolationECVI::setupFluxes
void setupFluxes(const double *flux) override
Set up fluxes for interpolation.
Definition
VelocityInterpolation.cpp:99
Opm::VelocityInterpolationECVI::VelocityInterpolationECVI
VelocityInterpolationECVI(const UnstructuredGrid &grid)
Constructor.
Definition
VelocityInterpolation.cpp:91
Opm::VelocityInterpolationECVI::interpolate
void interpolate(const int cell, const double *x, double *v) const override
Interpolate velocity.
Definition
VelocityInterpolation.cpp:168
Opm::VelocityInterpolationInterface
Abstract interface for velocity interpolation method classes.
Definition
VelocityInterpolation.hpp:33
Opm::VelocityInterpolationInterface::setupFluxes
virtual void setupFluxes(const double *flux)=0
Set up fluxes for interpolation.
Opm::VelocityInterpolationInterface::interpolate
virtual void interpolate(const int cell, const double *x, double *v) const =0
Interpolate velocity.
Opm::WachspressCoord
Class capable of computing Wachspress coordinates in 2d and 3d.
Definition
WachspressCoord.hpp:37
Opm
Holds the implementation of the CpGrid as a pimple.
Definition
CellQuadrature.cpp:68
UnstructuredGrid
Data structure for an unstructured grid, unstructured meaning that any cell may have an arbitrary num...
Definition
UnstructuredGrid.h:101
opm
grid
utility
VelocityInterpolation.hpp
Generated by
1.17.0