upscale.hpp
Go to the documentation of this file.
1#ifndef OPM_VERTEQ_UPSCALE_HPP_INCLUDED
2#define OPM_VERTEQ_UPSCALE_HPP_INCLUDED
3
4// Copyright (C) 2013 Uni Research AS
5// This file is licensed under the GNU General Public License v3.0
6
7#include <utility> // pair
8
9#ifndef OPM_VERTEQ_VISIBILITY_HPP_INCLUDED
11#endif /* OPM_VERTEQ_VISIBILITY_HPP_INCLUDED */
12
13#ifndef OPM_VERTEQ_TOPSURF_HPP_INCLUDED
15#endif /* OPM_VERTEQ_TOPSURF_HPP_INCLUDED */
16
17#ifndef OPM_VERTEQ_RUNLEN_HPP_INCLUDED
19#endif /* OPM_VERTEQ_RUNLEN_HPP_INCLUDED */
20
21namespace Opm {
22
34struct Elevation : private std::pair <int, double> {
43 Elevation (int aBlock, double aFraction)
44 : std::pair <int, double> (aBlock, aFraction) {
45 }
46
52 int block () const { return this->first; }
53
60 double fraction () const { return this->second; }
61
70 bool operator< (const Elevation& rhs) const;
71};
72
85 VertEqUpscaler (const TopSurf& topSurf)
86 : ts (topSurf) {
87 }
88
112 void gather (int col, double* buf, const double* data, int stride, int offset) const;
113
131 void wgt_dpt (int col, const double* val, rlw_double& res) const;
132
147 double dpt_avg (int col, const double* val) const;
148
164 double sum (int col, const double* val) const;
165
171 int num_rows (int col) const;
172
177 Elevation bottom (int col) const;
178
196 double eval (int col, const rlw_double& dpt, const Elevation zeta) const;
197
221 Elevation find (int col, const double* dpt, const double target) const;
222
223protected:
224 const TopSurf& ts;
225};
226
237double snapToRange (const double value,
238 const double lo,
239 const double hi);
240
241} // namespace Opm
242
243#endif // OPM_VERTEQ_UPSCALE_HPP_INCLUDED
Definition: runlen.hpp:60
Definition: opmfwd.hpp:15
double snapToRange(const double value, const double lo, const double hi)
Definition: upscale.hpp:34
Elevation(int aBlock, double aFraction)
Definition: upscale.hpp:43
bool operator<(const Elevation &rhs) const
int block() const
Definition: upscale.hpp:52
double fraction() const
Definition: upscale.hpp:60
Definition: topsurf.hpp:27
Definition: upscale.hpp:78
const TopSurf & ts
Definition: upscale.hpp:224
void gather(int col, double *buf, const double *data, int stride, int offset) const
Elevation bottom(int col) const
void wgt_dpt(int col, const double *val, rlw_double &res) const
double dpt_avg(int col, const double *val) const
int num_rows(int col) const
double sum(int col, const double *val) const
Elevation find(int col, const double *dpt, const double target) const
VertEqUpscaler(const TopSurf &topSurf)
Definition: upscale.hpp:85
double eval(int col, const rlw_double &dpt, const Elevation zeta) const