IncompPropertiesShadow_impl.hpp
Go to the documentation of this file.
1/* Copyright (c) 2013 Uni Research AS.
2 This file is licensed under the GNU General Public License v3.0 or later. */
3#ifndef OPM_INCOMPPROPERTIESSHADOW_HEADER_INCLUDED
4#error Do not include IncompPropertiesShadow_impl.hpp directly!
5#endif /* OPM_INCOMPPROPERTIESSHADOW_HEADER_INCLUDED */
6
7#include <opm/common/ErrorMacros.hpp>
8
9namespace Opm
10{
15 : prototype_ (original)
16 , shadowed_ (0)
17 , poro_ (0)
18 , perm_ (0)
19 , visc_ (0)
20 , dens_ (0)
21 , surf_ (0)
22 {
23 }
24
30 {
31 return prototype_.numDimensions();
32 }
33
35 {
36 return prototype_.numCells();
37 }
38
40 {
41 return prototype_.numPhases();
42 }
43
49 inline void IncompPropertiesShadow::relperm (const int n,
50 const double* s,
51 const int* cells,
52 double* kr,
53 double* dkrds) const
54 {
55 prototype_.relperm (n, s, cells, kr, dkrds);
56 }
57
58 inline void IncompPropertiesShadow::capPress (const int n,
59 const double* s,
60 const int* cells,
61 double* pc,
62 double* dpcds) const
63 {
64 prototype_.capPress (n, s, cells, pc, dpcds);
65 }
66
67 inline void IncompPropertiesShadow::satRange (const int n,
68 const int* cells,
69 double* smin,
70 double* smax) const
71 {
72 prototype_.satRange (n, cells, smin, smax);
73 }
74
79 inline const double* IncompPropertiesShadow::porosity () const
80 {
81 return (shadowed_ & POROSITY) ? poro_ : prototype_.porosity ();
82 }
83
84 inline const double* IncompPropertiesShadow::permeability () const
85 {
86 return (shadowed_ & PERMEABILITY) ? perm_ : prototype_.permeability ();
87 }
88
89 inline const double* IncompPropertiesShadow::viscosity () const
90 {
91 return (shadowed_ & VISCOSITY) ? visc_ : prototype_.viscosity ();
92 }
93
94 inline const double* IncompPropertiesShadow::density () const
95 {
96 return (shadowed_ & DENSITY) ? dens_ : prototype_.density ();
97 }
98
99 inline const double* IncompPropertiesShadow::surfaceDensity () const
100 {
101 return (shadowed_ & SURFACE_DENSITY) ? surf_ : prototype_.surfaceDensity ();
102 }
103
108 {
109 this->poro_ = poro;
110 shadowed_ |= POROSITY;
111 return *this;
112 }
113
115 {
116 this->perm_ = perm;
117 shadowed_ |= PERMEABILITY;
118 return *this;
119 }
120
122 {
123 this->visc_ = visc;
124 shadowed_ |= VISCOSITY;
125 return *this;
126 }
127
129 {
130 this->dens_ = dens;
131 shadowed_ |= DENSITY;
132 return *this;
133 }
134
136 {
137 this->surf_ = surf;
138 shadowed_ |= SURFACE_DENSITY;
139 return *this;
140 }
141
147 {
148 assert (prototype_.numCells() == other.numCells());
149 return usePorosity (other.porosity());
150 }
151
153 {
154 assert (prototype_.numCells() == other.numCells());
155 assert (prototype_.numDimensions() == other.numDimensions());
156 return usePermeability (other.permeability());
157 }
158
160 {
161 assert (prototype_.numPhases() == other.numPhases());
162 return useViscosity (other.viscosity());
163 }
164
166 {
167 assert (prototype_.numPhases() == other.numPhases());
168 return useDensity (other.density());
169 }
170
172 {
173 assert (prototype_.numPhases() == other.numPhases());
174 return useSurfaceDensity (other.surfaceDensity());
175 }
176
181 {
182 return usePorosity (other).usePermeability (other);
183 }
184
186 {
187 return useViscosity (other).useDensity (other).useSurfaceDensity (other);
188 }
189
191 {
192 return useRockProps (other).useFluidProps (other);
193 }
194} /* namespace Opm */
Definition: IncompPropertiesInterface.hpp:36
virtual const double * viscosity() const =0
virtual void capPress(const int n, const double *s, const int *cells, double *pc, double *dpcds) const =0
virtual int numPhases() const =0
virtual void satRange(const int n, const int *cells, double *smin, double *smax) const =0
virtual int numDimensions() const =0
virtual const double * density() const =0
virtual const double * surfaceDensity() const =0
virtual const double * porosity() const =0
virtual const double * permeability() const =0
virtual int numCells() const =0
virtual void relperm(const int n, const double *s, const int *cells, double *kr, double *dkrds) const =0
Definition: AnisotropicEikonal.hpp:44
Definition: IncompPropertiesShadow.hpp:34
virtual int numDimensions() const
Definition: IncompPropertiesShadow_impl.hpp:29
virtual int numCells() const
Definition: IncompPropertiesShadow_impl.hpp:34
IncompPropertiesShadow & useDensity(const double *dens)
Definition: IncompPropertiesShadow_impl.hpp:128
IncompPropertiesShadow & useRockAndFluidProps(const IncompPropertiesInterface &other)
Definition: IncompPropertiesShadow_impl.hpp:190
virtual void satRange(const int n, const int *cells, double *smin, double *smax) const
Definition: IncompPropertiesShadow_impl.hpp:67
virtual void capPress(const int n, const double *s, const int *cells, double *pc, double *dpcds) const
Definition: IncompPropertiesShadow_impl.hpp:58
virtual const double * density() const
Definition: IncompPropertiesShadow_impl.hpp:94
virtual const double * surfaceDensity() const
Definition: IncompPropertiesShadow_impl.hpp:99
virtual const double * permeability() const
Definition: IncompPropertiesShadow_impl.hpp:84
IncompPropertiesShadow(const IncompPropertiesInterface &original)
Definition: IncompPropertiesShadow_impl.hpp:14
IncompPropertiesShadow & useSurfaceDensity(const double *surf)
Definition: IncompPropertiesShadow_impl.hpp:135
IncompPropertiesShadow & useFluidProps(const IncompPropertiesInterface &other)
Definition: IncompPropertiesShadow_impl.hpp:185
IncompPropertiesShadow & usePorosity(const double *poro)
Definition: IncompPropertiesShadow_impl.hpp:107
IncompPropertiesShadow & usePermeability(const double *perm)
Definition: IncompPropertiesShadow_impl.hpp:114
virtual const double * porosity() const
Definition: IncompPropertiesShadow_impl.hpp:79
virtual const double * viscosity() const
Definition: IncompPropertiesShadow_impl.hpp:89
IncompPropertiesShadow & useViscosity(const double *visc)
Definition: IncompPropertiesShadow_impl.hpp:121
virtual int numPhases() const
Definition: IncompPropertiesShadow_impl.hpp:39
IncompPropertiesShadow & useRockProps(const IncompPropertiesInterface &other)
Definition: IncompPropertiesShadow_impl.hpp:180
virtual void relperm(const int n, const double *s, const int *cells, double *kr, double *dkrds) const
Definition: IncompPropertiesShadow_impl.hpp:49