Loading...
Searching...
No Matches
UDQDims.hpp
/*
Copyright (c) 2021 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 OPM_UDQDIMS_HPP
#define OPM_UDQDIMS_HPP
#include <cstddef>
#include <functional>
#include <optional>
#include <vector>
namespace Opm {
class UDQConfig;
} // namespace Opm
namespace Opm {
class UDQDims
{
public:
explicit UDQDims(const UDQConfig& config,
const std::vector<int>& intehead);
static std::size_t entriesPerIUDQ() { return 3; }
static std::size_t entriesPerIUAD() { return 5; }
static std::size_t entriesPerZUDN() { return 2; }
static std::size_t entriesPerZUDL() { return 16; }
std::size_t totalNumUDQs() const;
std::size_t numIUAD() const;
std::size_t numIGPH() const;
std::size_t numIUAP() const;
std::size_t numFieldUDQs() const;
std::size_t maxNumGroups() const;
std::size_t numGroupUDQs() const;
std::size_t maxNumMsWells() const;
std::size_t maxNumSegments() const;
std::size_t numSegmentUDQs() const;
std::size_t maxNumWells() const;
std::size_t numWellUDQs() const;
[[deprecated("The data vector is not aware of categories other than field, group, or well. Use named accessors instead.")]]
const std::vector<int>& data() const
{
if (! this->dimensionData_.has_value()) {
this->collectDimensions();
}
return *this->dimensionData_;
}
private:
std::size_t totalNumUDQs_{};
std::reference_wrapper<const std::vector<int>> intehead_;
mutable std::optional<std::vector<int>> dimensionData_;
void collectDimensions() const;
std::size_t intehead(const std::vector<int>::size_type i) const;
};
} // namespace Opm
#endif // OPM_UDQDIMS_HPP
Opm::UDQConfig
Collection of all user-defined quantities in the current simulation run.
Definition UDQConfig.hpp:69
Opm::UDQDims::numFieldUDQs
std::size_t numFieldUDQs() const
Number of field level UDQs.
Definition UDQDims.cpp:67
Opm::UDQDims::numIGPH
std::size_t numIGPH() const
Number of potential group level injection phase UDAs.
Definition UDQDims.cpp:52
Opm::UDQDims::numSegmentUDQs
std::size_t numSegmentUDQs() const
Number of segment level UDQs.
Definition UDQDims.cpp:98
Opm::UDQDims::entriesPerIUDQ
static std::size_t entriesPerIUDQ()
Number of IUDQ elements per UDQ.
Definition UDQDims.hpp:52
Opm::UDQDims::numIUAD
std::size_t numIUAD() const
Total number of UDAs in run.
Definition UDQDims.cpp:47
Opm::UDQDims::entriesPerZUDL
static std::size_t entriesPerZUDL()
Number of ZUDL elments per UDQ.
Definition UDQDims.hpp:61
Opm::UDQDims::data
const std::vector< int > & data() const
Linear sequence of some array sizes.
Definition UDQDims.hpp:106
Opm::UDQDims::maxNumGroups
std::size_t maxNumGroups() const
Maximum number of groups in run, including FIELD.
Definition UDQDims.cpp:75
Opm::UDQDims::maxNumSegments
std::size_t maxNumSegments() const
Run's maximum number of segments per multi-segmented well.
Definition UDQDims.cpp:93
Opm::UDQDims::totalNumUDQs
std::size_t totalNumUDQs() const
Total number of UDQs in run of all types/categories.
Definition UDQDims.cpp:39
Opm::UDQDims::UDQDims
UDQDims(const UDQConfig &config, const std::vector< int > &intehead)
Constructor.
Definition UDQDims.cpp:33
Opm::UDQDims::maxNumMsWells
std::size_t maxNumMsWells() const
Run's maximum number of multi-segmented wells.
Definition UDQDims.cpp:88
Opm::UDQDims::numGroupUDQs
std::size_t numGroupUDQs() const
Number of group level UDQs.
Definition UDQDims.cpp:80
Opm::UDQDims::numIUAP
std::size_t numIUAP() const
Number of well/group IDs involved in UDAs.
Definition UDQDims.cpp:59
Opm::UDQDims::numWellUDQs
std::size_t numWellUDQs() const
Number of well level UDQs.
Definition UDQDims.cpp:111
Opm::UDQDims::entriesPerIUAD
static std::size_t entriesPerIUAD()
Number of IUAD elements per UDA.
Definition UDQDims.hpp:55
Opm::UDQDims::entriesPerZUDN
static std::size_t entriesPerZUDN()
Number of ZUDN elments per UDQ.
Definition UDQDims.hpp:58
Opm::UDQDims::maxNumWells
std::size_t maxNumWells() const
Run's maximum number of wells, multi-segmented or otherwise.
Definition UDQDims.cpp:106
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30