Loading...
Searching...
No Matches
FIPRegionStatistics.hpp
/*
Copyright 2024 Equinor ASA.
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 FIP_REGION_STATISTICS_HPP
#define FIP_REGION_STATISTICS_HPP
#include <cstddef>
#include <functional>
#include <string>
#include <string_view>
#include <vector>
namespace Opm {
class FieldPropsManager;
} // namespace Opm
namespace Opm {
class FIPRegionStatistics
{
public:
FIPRegionStatistics() = default;
explicit FIPRegionStatistics(const std::size_t declaredMaxRegID,
const FieldPropsManager& fldPropsMgr,
std::function<void(std::vector<int>&)> computeGlobalMax);
bool operator==(const FIPRegionStatistics& that) const;
static FIPRegionStatistics serializationTestObject();
int declaredMaximumRegionID() const
{
return this->minimumMaximumRegionID_;
}
const std::vector<std::string>& regionSets() const
{
return this->regionSets_;
}
int maximumRegionID(std::string_view regionSet) const;
template <typename Serializer>
void serializeOp(Serializer& serializer)
{
serializer(this->minimumMaximumRegionID_);
serializer(this->regionSets_);
serializer(this->maxRegionID_);
}
private:
int minimumMaximumRegionID_{};
std::vector<std::string> regionSets_{};
std::vector<int> maxRegionID_{};
};
} // namespace Opm
#endif // FIP_REGION_STATISTICS_HPP
Opm::FIPRegionStatistics::regionSets
const std::vector< std::string > & regionSets() const
Get list of named region sets, without the initial 'FIP' name prefix.
Definition FIPRegionStatistics.hpp:90
Opm::FIPRegionStatistics::declaredMaximumRegionID
int declaredMaximumRegionID() const
Retrieve model's declared maximum fluid-in-place region ID.
Definition FIPRegionStatistics.hpp:80
Opm::FIPRegionStatistics::FIPRegionStatistics
FIPRegionStatistics()=default
Default constructor.
Opm::FIPRegionStatistics::serializationTestObject
static FIPRegionStatistics serializationTestObject()
Serialisation test object.
Definition FIPRegionStatistics.cpp:107
Opm::FIPRegionStatistics::operator==
bool operator==(const FIPRegionStatistics &that) const
Equality predicate.
Definition FIPRegionStatistics.cpp:98
Opm::FIPRegionStatistics::serializeOp
void serializeOp(Serializer &serializer)
Serialisation operator.
Definition FIPRegionStatistics.hpp:112
Opm::FIPRegionStatistics::maximumRegionID
int maximumRegionID(std::string_view regionSet) const
Get global maximum region ID of a named region set.
Definition FIPRegionStatistics.cpp:121
Opm::FieldPropsManager
Definition FieldPropsManager.hpp:42
Opm::Serializer
Class for (de-)serializing.
Definition Serializer.hpp:94
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30