UnscaledSatfuncCheckPoint.hpp
Go to the documentation of this file.
1/*
2 Copyright 2024 Equinor AS
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 UNSCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
21#define UNSCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
22
24
25#include <cstddef>
26#include <optional>
27#include <unordered_set>
28#include <vector>
29
30namespace Opm {
31 template <typename Scalar>
32 struct EclEpsScalingPointsInfo;
33} // namespace Opm
34
35namespace Opm::satfunc {
36 struct RawTableEndPoints;
37 struct RawFunctionValues;
38} // namespace Opm::satfunc
39
41
45 template <typename Scalar>
47 {
48 public:
52 {
56 const satfunc::RawTableEndPoints* rtep{nullptr};
57
61 const satfunc::RawFunctionValues* rfunc{nullptr};
62 };
63
74 explicit UnscaledSatfuncCheckPoint(const std::vector<int>* region,
75 const int regIdxOffset,
76 const UnscaledEndPoints& unscaledEndPoints)
77 : unscaledEndPoints_ { unscaledEndPoints }
78 , regIdxOffset_ { regIdxOffset }
79 , region_ { region }
80 {}
81
93 std::optional<std::size_t> pointID(const int cellIdx) const override;
94
100 void populateCheckPoint(const int cellIdx,
101 EclEpsScalingPointsInfo<Scalar>& endPoints) const override;
102
103 private:
107 UnscaledEndPoints unscaledEndPoints_;
108
111 int regIdxOffset_{};
112
114 const std::vector<int>* region_{nullptr};
115
117 mutable std::unordered_set<int> seen_{};
118 };
119
120} // namespace Opm::Satfunc::PhaseChecks
121
122#endif // UNSCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
Definition: UnscaledSatfuncCheckPoint.hpp:47
UnscaledSatfuncCheckPoint(const std::vector< int > *region, const int regIdxOffset, const UnscaledEndPoints &unscaledEndPoints)
Definition: UnscaledSatfuncCheckPoint.hpp:74
void populateCheckPoint(const int cellIdx, EclEpsScalingPointsInfo< Scalar > &endPoints) const override
std::optional< std::size_t > pointID(const int cellIdx) const override
Definition: GasPhaseConsistencyChecks.hpp:29
Definition: UnscaledSatfuncCheckPoint.hpp:35
Definition: blackoilboundaryratevector.hh:39
Definition: SatfuncCheckPointInterface.hpp:28
Definition: SatfuncCheckPointInterface.hpp:40
const satfunc::RawFunctionValues * rfunc
Definition: UnscaledSatfuncCheckPoint.hpp:61
const satfunc::RawTableEndPoints * rtep
Definition: UnscaledSatfuncCheckPoint.hpp:56