mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
fixed: output is supposed to use move semantics
This commit is contained in:
parent
a88901c97c
commit
57099a433c
@ -410,9 +410,9 @@ void GenericOutputBlackoilModule<FluidSystem>::
|
|||||||
assignToSolution(data::Solution& sol)
|
assignToSolution(data::Solution& sol)
|
||||||
{
|
{
|
||||||
using DataEntry =
|
using DataEntry =
|
||||||
std::tuple<std::string, UnitSystem::measure, const std::vector<Scalar>&>;
|
std::tuple<std::string, UnitSystem::measure, std::vector<Scalar>&>;
|
||||||
|
|
||||||
auto doInsert = [&sol](const DataEntry& entry,
|
auto doInsert = [&sol](DataEntry& entry,
|
||||||
const data::TargetType target)
|
const data::TargetType target)
|
||||||
{
|
{
|
||||||
if (std::get<2>(entry).empty()) {
|
if (std::get<2>(entry).empty()) {
|
||||||
@ -426,13 +426,16 @@ assignToSolution(data::Solution& sol)
|
|||||||
};
|
};
|
||||||
|
|
||||||
// if index not specified, we treat it as valid (>= 0)
|
// if index not specified, we treat it as valid (>= 0)
|
||||||
auto addEntry = [](std::vector<DataEntry>& container, const std::string& name, UnitSystem::measure measure, const auto& flowArray, int index = 1) {
|
auto addEntry = [](std::vector<DataEntry>& container,
|
||||||
|
const std::string& name,
|
||||||
|
UnitSystem::measure measure,
|
||||||
|
auto& flowArray, int index = 1)
|
||||||
|
{
|
||||||
if (index >= 0) { // Only add if index is valid
|
if (index >= 0) { // Only add if index is valid
|
||||||
container.emplace_back(name, measure, flowArray);
|
container.emplace_back(name, measure, flowArray);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
std::vector<DataEntry> baseSolutionVector;
|
std::vector<DataEntry> baseSolutionVector;
|
||||||
addEntry(baseSolutionVector, "1OVERBG", UnitSystem::measure::gas_inverse_formation_volume_factor, invB_[gasPhaseIdx], gasPhaseIdx);
|
addEntry(baseSolutionVector, "1OVERBG", UnitSystem::measure::gas_inverse_formation_volume_factor, invB_[gasPhaseIdx], gasPhaseIdx);
|
||||||
addEntry(baseSolutionVector, "1OVERBO", UnitSystem::measure::oil_inverse_formation_volume_factor, invB_[oilPhaseIdx], oilPhaseIdx);
|
addEntry(baseSolutionVector, "1OVERBO", UnitSystem::measure::oil_inverse_formation_volume_factor, invB_[oilPhaseIdx], oilPhaseIdx);
|
||||||
@ -510,7 +513,7 @@ assignToSolution(data::Solution& sol)
|
|||||||
addEntry(flowsSolutionVector, "FLRWATJ-", UnitSystem::measure::rate, flores_[FaceDir::ToIntersectionIndex(Dir::YMinus)][waterCompIdx], waterCompIdx);
|
addEntry(flowsSolutionVector, "FLRWATJ-", UnitSystem::measure::rate, flores_[FaceDir::ToIntersectionIndex(Dir::YMinus)][waterCompIdx], waterCompIdx);
|
||||||
addEntry(flowsSolutionVector, "FLRWATK-", UnitSystem::measure::rate, flores_[FaceDir::ToIntersectionIndex(Dir::ZMinus)][waterCompIdx], waterCompIdx);
|
addEntry(flowsSolutionVector, "FLRWATK-", UnitSystem::measure::rate, flores_[FaceDir::ToIntersectionIndex(Dir::ZMinus)][waterCompIdx], waterCompIdx);
|
||||||
|
|
||||||
const auto extendedSolutionArrays = std::array {
|
auto extendedSolutionArrays = std::array {
|
||||||
DataEntry{"BIOFILM", UnitSystem::measure::identity, cBiofilm_},
|
DataEntry{"BIOFILM", UnitSystem::measure::identity, cBiofilm_},
|
||||||
DataEntry{"CALCITE", UnitSystem::measure::identity, cCalcite_},
|
DataEntry{"CALCITE", UnitSystem::measure::identity, cCalcite_},
|
||||||
DataEntry{"DRSDTCON", UnitSystem::measure::gas_oil_ratio_rate, drsdtcon_},
|
DataEntry{"DRSDTCON", UnitSystem::measure::gas_oil_ratio_rate, drsdtcon_},
|
||||||
@ -562,22 +565,22 @@ assignToSolution(data::Solution& sol)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& array: compositionalEntries) {
|
for (auto& array: compositionalEntries) {
|
||||||
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& array : baseSolutionVector) {
|
for (auto& array : baseSolutionVector) {
|
||||||
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->enableFlows_) {
|
if (this->enableFlows_) {
|
||||||
for (const auto& array : flowsSolutionVector) {
|
for (auto& array : flowsSolutionVector) {
|
||||||
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
doInsert(array, data::TargetType::RESTART_SOLUTION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& array : extendedSolutionArrays) {
|
for (auto& array : extendedSolutionArrays) {
|
||||||
doInsert(array, data::TargetType::RESTART_OPM_EXTENDED);
|
doInsert(array, data::TargetType::RESTART_OPM_EXTENDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user