Loading...
Searching...
No Matches
AggregateUDQData.hpp
/*
Copyright (c) 2018 Statoil 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_AGGREGATE_UDQ_DATA_HPP
#define OPM_AGGREGATE_UDQ_DATA_HPP
#include <opm/output/eclipse/WindowedArray.hpp>
#include <opm/io/eclipse/PaddedOutputString.hpp>
#include <cstddef>
#include <optional>
#include <string>
#include <vector>
namespace Opm {
class Group;
class Schedule;
class UDQConfig;
class UDQDims;
class UDQInput;
class UDQState;
} // Opm
namespace Opm::RestartIO::Helpers {
class AggregateUDQData
{
public:
explicit AggregateUDQData(const UDQDims& udqDims);
void captureDeclaredUDQData(const Schedule& sched,
const std::size_t simStep,
const UDQState& udqState,
const std::vector<int>& inteHead);
const std::vector<int>& getIUDQ() const
{
return this->iUDQ_.data();
}
const std::optional<WindowedArray<int>>& getIUAD() const
{
return this->iUAD_;
}
const std::vector<EclIO::PaddedOutputString<8>>& getZUDN() const
{
return this->zUDN_.data();
}
const std::vector<EclIO::PaddedOutputString<8>>& getZUDL() const
{
return this->zUDL_.data();
}
const std::optional<WindowedArray<int>>& getIGPH() const
{
return this->iGPH_;
}
const std::optional<WindowedArray<int>>& getIUAP() const
{
return this->iUAP_;
}
const std::optional<WindowedArray<double>>& getDUDF() const
{
return this->dUDF_;
}
const std::optional<WindowedArray<double>>& getDUDG() const
{
return this->dUDG_;
}
const std::optional<WindowedArray<double>>& getDUDW() const
{
return this->dUDW_;
}
private:
WindowedArray<int> iUDQ_;
std::optional<WindowedArray<int>> iUAD_;
WindowedArray<EclIO::PaddedOutputString<8>> zUDN_;
WindowedArray<EclIO::PaddedOutputString<8>> zUDL_;
std::optional<WindowedArray<int>> iGPH_;
std::optional<WindowedArray<int>> iUAP_;
std::optional<WindowedArray<double>> dUDF_{};
std::optional<WindowedArray<double>> dUDG_{};
std::optional<WindowedArray<double>> dUDW_{};
void collectUserDefinedQuantities(const std::vector<UDQInput>& udqInput,
const std::vector<int>& inteHead);
void collectUserDefinedArguments(const Schedule& sched,
const std::size_t simStep,
const std::vector<int>& inteHead);
void collectFieldUDQValues(const std::vector<UDQInput>& udqInput,
const UDQState& udq_state,
const int expectNumFieldUDQs);
void collectGroupUDQValues(const std::vector<UDQInput>& udqInput,
const UDQState& udqState,
const std::size_t ngmax,
const std::vector<const Group*>& groups,
const int expectedNumGroupUDQs);
void collectWellUDQValues(const std::vector<UDQInput>& udqInput,
const UDQState& udqState,
const std::size_t nwmax,
const std::vector<std::string>& wells,
const int expectedNumWellUDQs);
};
} // Opm::RestartIO::Helpers
#endif // OPM_AGGREGATE_UDQ_DATA_HPP
WindowedArray.hpp
Provide facilities to simplify constructing restart vectors such as IWEL or RSEG.
Opm::RestartIO::Helpers::AggregateUDQData
Definition AggregateUDQData.hpp:44
Opm::RestartIO::Helpers::AggregateUDQData::getIUAP
const std::optional< WindowedArray< int > > & getIUAP() const
Associate well/group IDs for IUAD. Nullopt if no UDAs in use.
Definition AggregateUDQData.hpp:82
Opm::RestartIO::Helpers::AggregateUDQData::getIUAD
const std::optional< WindowedArray< int > > & getIUAD() const
Retrieve UDA descriptive data. Nullopt if no UDAs in use.
Definition AggregateUDQData.hpp:59
Opm::RestartIO::Helpers::AggregateUDQData::getIGPH
const std::optional< WindowedArray< int > > & getIGPH() const
Retrive group level injection phase UDAs.
Definition AggregateUDQData.hpp:76
Opm::RestartIO::Helpers::AggregateUDQData::getDUDW
const std::optional< WindowedArray< double > > & getDUDW() const
Retrieve values of well level UDQs. Nullopt if no such UDQs exist.
Definition AggregateUDQData.hpp:100
Opm::RestartIO::Helpers::AggregateUDQData::getDUDG
const std::optional< WindowedArray< double > > & getDUDG() const
Retrieve values of group level UDQs. Nullopt if no such UDQs exist.
Definition AggregateUDQData.hpp:94
Opm::RestartIO::Helpers::AggregateUDQData::getDUDF
const std::optional< WindowedArray< double > > & getDUDF() const
Retrieve values of field level UDQs. Nullopt if no such UDQs exist.
Definition AggregateUDQData.hpp:88
Opm::RestartIO::Helpers::WindowedArray
Provide read-only and read/write access to constantly sized portions/windows of a linearised buffer w...
Definition WindowedArray.hpp:50
Opm::RestartIO::Helpers::WindowedArray::data
const std::vector< T > & data() const
Get read-only access to full, linearised data items for all windows.
Definition WindowedArray.hpp:131
Opm::Schedule
Definition Schedule.hpp:89
Opm::UDQDims
Definition UDQDims.hpp:37
Opm::UDQState
Definition UDQState.hpp:37
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30