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 UDQActive;
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<WindowedMatrix<double>>& getDUDS() const
{
return this->dUDS_;
}
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<WindowedMatrix<double>> dUDS_{};
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 collectSegmentUDQValues(const std::vector<UDQInput>& udqInput,
const UDQState& udqState,
const std::vector<std::string>& msWells);
void collectWellUDQValues(const std::vector<UDQInput>& udqInput,
const UDQState& udqState,
const std::size_t nwmax,
const std::vector<std::string>& wells,
const int expectedNumWellUDQs);
void collectIUAD(const UDQActive& udqActive,
const std::size_t expectNumIUAD);
void collectIUAP(const std::vector<int>& wgIndex,
const std::size_t expectNumIUAP);
void collectIGPH(const std::vector<int>& phase_vector,
const std::size_t expectNumIGPH);
};
} // Opm::RestartIO::Helpers
#endif // OPM_AGGREGATE_UDQ_DATA_HPP
WindowedArray.hpp
Provide facilities to simplify constructing restart vectors such as IWEL or RSEG.
Opm::Group
Definition Group.hpp:50
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:83
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:60
Opm::RestartIO::Helpers::AggregateUDQData::getIGPH
const std::optional< WindowedArray< int > > & getIGPH() const
Retrive group level injection phase UDAs.
Definition AggregateUDQData.hpp:77
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:107
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:95
Opm::RestartIO::Helpers::AggregateUDQData::getDUDS
const std::optional< WindowedMatrix< double > > & getDUDS() const
Retrieve values of segment level UDQs. Nullopt if no such UDQs exist.
Definition AggregateUDQData.hpp:101
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:89
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::Schedule
Definition Schedule.hpp:101
Opm::UDQActive
Internalised representation of all UDAs in a simulation run.
Definition UDQActive.hpp:50
Opm::UDQConfig
Collection of all user-defined quantities in the current simulation run.
Definition UDQConfig.hpp:69
Opm::UDQDims
Collection of UDQ and UDA related dimension queries.
Definition UDQDims.hpp:40
Opm::UDQInput
Definition UDQInput.hpp:84
Opm::UDQState
Definition UDQState.hpp:40
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30