EclEpsTwoPhaseLawParams.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  Copyright (C) 2015 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
25 #ifndef OPM_ECL_EPS_TWO_PHASE_LAW_PARAMS_HPP
26 #define OPM_ECL_EPS_TWO_PHASE_LAW_PARAMS_HPP
27 
28 #include "EclEpsConfig.hpp"
29 #include "EclEpsScalingPoints.hpp"
30 
31 #if HAVE_OPM_PARSER
32 #include <opm/parser/eclipse/Deck/Deck.hpp>
33 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
34 #endif
35 
36 #include <string>
37 #include <memory>
38 #include <cassert>
39 #include <algorithm>
40 
41 namespace Opm {
48 template <class EffLawT>
50 {
51  typedef typename EffLawT::Params EffLawParams;
52  typedef typename EffLawParams::Traits::Scalar Scalar;
53 
54 public:
55  typedef typename EffLawParams::Traits Traits;
57 
59  {
60 #ifndef NDEBUG
61  finalized_ = false;
62 #endif
63  }
64 
69  void finalize()
70  {
71 #ifndef NDEBUG
72  assert(config_);
73  if (config_->enableSatScaling()) {
74  assert(unscaledPoints_);
75  }
76  assert(effectiveLawParams_);
77 
78  finalized_ = true;
79 #endif
80  }
81 
85  void setConfig(std::shared_ptr<EclEpsConfig> value)
86  { config_ = value; }
87 
91  const EclEpsConfig& config() const
92  { return *config_; }
93 
97  void setUnscaledPoints(std::shared_ptr<ScalingPoints> value)
98  { unscaledPoints_ = value; }
99 
103  const ScalingPoints& unscaledPoints() const
104  { return *unscaledPoints_; }
105 
109  void setScaledPoints(std::shared_ptr<ScalingPoints> value)
110  { scaledPoints_ = *value; }
111 
115  const ScalingPoints& scaledPoints() const
116  { return scaledPoints_; }
117 
121  ScalingPoints& scaledPoints()
122  { return scaledPoints_; }
123 
127  void setEffectiveLawParams(std::shared_ptr<EffLawParams> value)
128  { effectiveLawParams_ = value; }
129 
133  const EffLawParams& effectiveLawParams() const
134  { return *effectiveLawParams_; }
135 
136 private:
137 
138 #ifndef NDEBUG
139  void assertFinalized_() const
140  { assert(finalized_); }
141 
142  bool finalized_;
143 #else
144  void assertFinalized_() const
145  { }
146 #endif
147 
148  std::shared_ptr<EffLawParams> effectiveLawParams_;
149 
150  std::shared_ptr<EclEpsConfig> config_;
151  std::shared_ptr<ScalingPoints> unscaledPoints_;
152  ScalingPoints scaledPoints_;
153 };
154 
155 } // namespace Opm
156 
157 #endif
const EclEpsConfig & config() const
Returns the endpoint scaling configuration object.
Definition: EclEpsTwoPhaseLawParams.hpp:91
A default implementation of the parameters for the material law adapter class which implements ECL en...
Definition: EclEpsTwoPhaseLawParams.hpp:49
EffLawParams::Traits Traits
Definition: EclEpsTwoPhaseLawParams.hpp:55
Definition: Air_Mesitylene.hpp:31
Represents the points on the X and Y axis to be scaled if endpoint scaling is used.
Definition: EclEpsScalingPoints.hpp:497
void setScaledPoints(std::shared_ptr< ScalingPoints > value)
Set the scaling points which are seen by the physical model.
Definition: EclEpsTwoPhaseLawParams.hpp:109
const ScalingPoints & scaledPoints() const
Returns the scaling points which are seen by the physical model.
Definition: EclEpsTwoPhaseLawParams.hpp:115
void setEffectiveLawParams(std::shared_ptr< EffLawParams > value)
Sets the parameter object for the effective/nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:127
void setUnscaledPoints(std::shared_ptr< ScalingPoints > value)
Set the scaling points which are seen by the nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:97
Opm::EclEpsScalingPoints< Scalar > ScalingPoints
Definition: EclEpsTwoPhaseLawParams.hpp:56
void setConfig(std::shared_ptr< EclEpsConfig > value)
Set the endpoint scaling configuration object.
Definition: EclEpsTwoPhaseLawParams.hpp:85
const EffLawParams & effectiveLawParams() const
Returns the parameter object for the effective/nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:133
Specifies the configuration used by the endpoint scaling code.
Definition: EclEpsConfig.hpp:54
const ScalingPoints & unscaledPoints() const
Returns the scaling points which are seen by the nested material law.
Definition: EclEpsTwoPhaseLawParams.hpp:103
Specifies the configuration used by the endpoint scaling code.
void finalize()
Calculate all dependent quantities once the independent quantities of the parameter object have been ...
Definition: EclEpsTwoPhaseLawParams.hpp:69
ScalingPoints & scaledPoints()
Returns the scaling points which are seen by the physical model.
Definition: EclEpsTwoPhaseLawParams.hpp:121
EclEpsTwoPhaseLawParams()
Definition: EclEpsTwoPhaseLawParams.hpp:58