Dimension.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Statoil ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef DIMENSION_H
21#define DIMENSION_H
22
23#include <string>
24
25namespace Opm {
26
27 class Dimension {
28 public:
30 Dimension(double SIfactor,
31 double SIoffset = 0.0);
32
34
35 double getSIScaling() const;
36 double getSIOffset() const;
37
38 double convertRawToSi(double rawValue) const;
39 double convertSiToRaw(double siValue) const;
40
41 bool equal(const Dimension& other) const;
42 bool isCompositable() const;
43
44 bool operator==( const Dimension& ) const;
45 bool operator!=( const Dimension& ) const;
46
47 template<class Serializer>
48 void serializeOp(Serializer& serializer)
49 {
50 serializer(m_SIfactor);
51 serializer(m_SIoffset);
52 }
53
54 private:
55 double m_SIfactor;
56 double m_SIoffset;
57 };
58}
59
60
61#endif
62
Definition: Dimension.hpp:27
double convertRawToSi(double rawValue) const
bool operator!=(const Dimension &) const
double getSIOffset() const
Dimension(double SIfactor, double SIoffset=0.0)
bool operator==(const Dimension &) const
void serializeOp(Serializer &serializer)
Definition: Dimension.hpp:48
double convertSiToRaw(double siValue) const
static Dimension serializeObject()
bool equal(const Dimension &other) const
double getSIScaling() const
bool isCompositable() const
Definition: Serializer.hpp:38
Definition: A.hpp:4