Loading...
Searching...
No Matches
ScaledSatfuncCheckPoint.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 SCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
#define SCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
#include <opm/simulators/utils/satfunc/SatfuncCheckPointInterface.hpp>
#include <opm/simulators/utils/satfunc/UnscaledSatfuncCheckPoint.hpp>
#include <cstddef>
#include <functional>
#include <optional>
namespace Opm {
class EclipseState;
class EclEpsGridProperties;
template <typename Scalar>
struct EclEpsScalingPointsInfo;
} // namespace Opm
namespace Opm::Satfunc::PhaseChecks {
template <typename Scalar>
class ScaledSatfuncCheckPoint : public SatfuncCheckPointInterface<Scalar>
{
public:
using LocalToGlobal = std::function<std::size_t(const int)>;
explicit ScaledSatfuncCheckPoint(const UnscaledSatfuncCheckPoint<Scalar>& unscaled,
const EclipseState* eclipseState,
const EclEpsGridProperties* epsGridProps,
const LocalToGlobal& localToGlobal)
: unscaled_ { unscaled }
, eclipseState_ { eclipseState }
, epsGridProps_ { epsGridProps }
, localToGlobal_ { localToGlobal }
{}
std::optional<std::size_t> pointID(const int cellIdx) const override
{
return { this->localToGlobal_(cellIdx) };
}
void populateCheckPoint(const int cellIdx,
EclEpsScalingPointsInfo<Scalar>& endPoints) const override;
private:
UnscaledSatfuncCheckPoint<Scalar> unscaled_;
const EclipseState* eclipseState_{nullptr};
const EclEpsGridProperties* epsGridProps_{nullptr};
LocalToGlobal localToGlobal_{};
};
} // namespace Opm::Satfunc::PhaseChecks
#endif // SCALED_SATFUNC_CHECKPOINT_HPP_INCLUDED
Opm::Satfunc::PhaseChecks::ScaledSatfuncCheckPoint::LocalToGlobal
std::function< std::size_t(const int)> LocalToGlobal
Callback for translating active cell index to globally unique point ID.
Definition ScaledSatfuncCheckPoint.hpp:50
Opm::Satfunc::PhaseChecks::ScaledSatfuncCheckPoint::ScaledSatfuncCheckPoint
ScaledSatfuncCheckPoint(const UnscaledSatfuncCheckPoint< Scalar > &unscaled, const EclipseState *eclipseState, const EclEpsGridProperties *epsGridProps, const LocalToGlobal &localToGlobal)
Constructor.
Definition ScaledSatfuncCheckPoint.hpp:65
Opm::Satfunc::PhaseChecks::ScaledSatfuncCheckPoint::pointID
std::optional< std::size_t > pointID(const int cellIdx) const override
Compute global unique, i.e., across all MPI ranks, ID of this check for a particular cell index.
Definition ScaledSatfuncCheckPoint.hpp:81
Opm::Satfunc::PhaseChecks::ScaledSatfuncCheckPoint::populateCheckPoint
void populateCheckPoint(const int cellIdx, EclEpsScalingPointsInfo< Scalar > &endPoints) const override
Populate check point values for a particular cell.
Definition ScaledSatfuncCheckPoint.cpp:35
Opm::Satfunc::PhaseChecks::UnscaledSatfuncCheckPoint
Callbacks for defining the consistency check point of a single region.
Definition UnscaledSatfuncCheckPoint.hpp:47
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