Loading...
Searching...
No Matches
VelocityInterpolation.hpp
/*
Copyright 2012 SINTEF ICT, Applied Mathematics.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_VELOCITYINTERPOLATION_HEADER_INCLUDED
#define OPM_VELOCITYINTERPOLATION_HEADER_INCLUDED
#include <opm/grid/utility/WachspressCoord.hpp>
#include <vector>
struct UnstructuredGrid;
namespace Opm
{
class VelocityInterpolationInterface
{
public:
virtual ~VelocityInterpolationInterface();
virtual void setupFluxes(const double* flux) = 0;
virtual void interpolate(const int cell,
const double* x,
double* v) const = 0;
};
class VelocityInterpolationConstant : public VelocityInterpolationInterface
{
public:
explicit VelocityInterpolationConstant(const UnstructuredGrid& grid);
void setupFluxes(const double* flux) override;
void interpolate(const int cell,
const double* x,
double* v) const override;
private:
const UnstructuredGrid& grid_;
const double* flux_;
};
class VelocityInterpolationECVI : public VelocityInterpolationInterface
{
public:
explicit VelocityInterpolationECVI(const UnstructuredGrid& grid);
void setupFluxes(const double* flux) override;
void interpolate(const int cell,
const double* x,
double* v) const override;
private:
WachspressCoord bcmethod_;
const UnstructuredGrid& grid_;
mutable std::vector<double> bary_coord_;
std::vector<double> corner_velocity_; // size = dim * #corners
};
} // namespace Opm
#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