Loading...
Searching...
No Matches
UnscaledSatfuncCheckPoint.hpp
/*
Copyright 2024 Equinor AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UNSCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
#define UNSCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
#include <opm/simulators/utils/satfunc/SatfuncCheckPointInterface.hpp>
#include <cstddef>
#include <optional>
#include <unordered_set>
#include <vector>
namespace Opm {
template <typename Scalar>
struct EclEpsScalingPointsInfo;
} // namespace Opm
namespace Opm::satfunc {
struct RawTableEndPoints;
struct RawFunctionValues;
} // namespace Opm::satfunc
namespace Opm::Satfunc::PhaseChecks {
template <typename Scalar>
class UnscaledSatfuncCheckPoint : public SatfuncCheckPointInterface<Scalar>
{
public:
struct UnscaledEndPoints
{
const satfunc::RawTableEndPoints* rtep{nullptr};
const satfunc::RawFunctionValues* rfunc{nullptr};
};
explicit UnscaledSatfuncCheckPoint(const std::vector<int>* region,
const int regIdxOffset,
const UnscaledEndPoints& unscaledEndPoints)
: unscaledEndPoints_ { unscaledEndPoints }
, regIdxOffset_ { regIdxOffset }
, region_ { region }
{}
std::optional<std::size_t> pointID(const int cellIdx) const override;
void populateCheckPoint(const int cellIdx,
EclEpsScalingPointsInfo<Scalar>& endPoints) const override;
private:
UnscaledEndPoints unscaledEndPoints_;
int regIdxOffset_{};
const std::vector<int>* region_{nullptr};
mutable std::unordered_set<int> seen_{};
};
} // namespace Opm::Satfunc::PhaseChecks
#endif // UNSCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint::UnscaledSatfuncCheckPoint
UnscaledSatfuncCheckPoint(const std::vector< int > *region, const int regIdxOffset, const UnscaledEndPoints &unscaledEndPoints)
Constructor.
Definition UnscaledSatfuncCheckPoint.hpp:74
Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint::populateCheckPoint
void populateCheckPoint(const int cellIdx, EclEpsScalingPointsInfo< Scalar > &endPoints) const override
Populate check point values for a particular cell.
Definition UnscaledSatfuncCheckPoint.cpp:53
Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint::pointID
std::optional< std::size_t > pointID(const int cellIdx) const override
Compute locally unique, i.e., per MPI rank, ID of this check for a particular cell index.
Definition UnscaledSatfuncCheckPoint.cpp:38
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Opm::EclEpsScalingPointsInfo
Definition SatfuncCheckPointInterface.hpp:28
Opm::Satfunc::PhaseChecks::SatfuncCheckPointInterface
Callback protocol for single saturation function consistency check point.
Definition SatfuncCheckPointInterface.hpp:40
Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint::UnscaledEndPoints
Collection of saturation function end-points and function values extracted from tabulated saturation ...
Definition UnscaledSatfuncCheckPoint.hpp:52
Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint::UnscaledEndPoints::rfunc
const satfunc::RawFunctionValues * rfunc
Raw saturation function values.
Definition UnscaledSatfuncCheckPoint.hpp:61
Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint::UnscaledEndPoints::rtep
const satfunc::RawTableEndPoints * rtep
Raw table end-points.
Definition UnscaledSatfuncCheckPoint.hpp:56