BrooksCoreyParams.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) 2008-2013 by Andreas Lauser
5  Copyright (C) 2011 by Holger Class
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 2 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
26 #ifndef OPM_BROOKS_COREY_PARAMS_HPP
27 #define OPM_BROOKS_COREY_PARAMS_HPP
28 
30 
31 #include <cassert>
32 
33 namespace Opm {
34 
43 template <class TraitsT>
45 {
46  typedef typename TraitsT::Scalar Scalar;
47 
48 public:
49  typedef TraitsT Traits;
50 
52  {
54 #ifndef NDEBUG
55  finalized_ = false;
56 #endif
57  }
58 
60  : entryPressure_(entryPressure), lambda_(lambda)
61  {
62  finalize();
63  }
64 
69  void finalize()
70  {
71 #ifndef NDEBUG
72  finalized_ = true;
73 #endif
74  }
75 
79  Scalar entryPressure() const
80  { assertFinalized_(); return entryPressure_; }
81 
85  void setEntryPressure(Scalar v)
86  { entryPressure_ = v; }
87 
88 
92  Scalar lambda() const
93  { assertFinalized_(); return lambda_; }
94 
98  void setLambda(Scalar v)
99  { lambda_ = v; }
100 
101 private:
102 #ifndef NDEBUG
103  void assertFinalized_() const
104  { assert(finalized_); }
105 
106  bool finalized_;
107 #else
108  void assertFinalized_() const
109  { }
110 #endif
111 
112  Scalar entryPressure_;
113  Scalar lambda_;
114 };
115 } // namespace Opm
116 
117 #endif
void SetUndefined(const T &value OPM_UNUSED)
Make the memory on which an object resides undefined in valgrind runs.
Definition: Valgrind.hpp:138
void setEntryPressure(Scalar v)
Set the entry pressure [Pa].
Definition: BrooksCoreyParams.hpp:85
Definition: Air_Mesitylene.hpp:31
BrooksCoreyParams(Scalar entryPressure, Scalar lambda)
Definition: BrooksCoreyParams.hpp:59
Scalar lambda() const
Returns the lambda shape parameter.
Definition: BrooksCoreyParams.hpp:92
Some templates to wrap the valgrind client request macros.
TraitsT Traits
Definition: BrooksCoreyParams.hpp:49
void setLambda(Scalar v)
Set the lambda shape parameter.
Definition: BrooksCoreyParams.hpp:98
void finalize()
Calculate all dependent quantities once the independent quantities of the parameter object have been ...
Definition: BrooksCoreyParams.hpp:69
Specification of the material parameters for the Brooks-Corey constitutive relations.
Definition: BrooksCoreyParams.hpp:44
BrooksCoreyParams()
Definition: BrooksCoreyParams.hpp:51
Scalar entryPressure() const
Returns the entry pressure [Pa].
Definition: BrooksCoreyParams.hpp:79