From dcbd1c7baf1a475bf1238be98d991c5fa39fd449 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 12 Apr 2024 17:06:27 +0200 Subject: [PATCH 1/3] BlackoilWellModelGeneric: convert input data to appropriate Scalar type --- opm/simulators/wells/BlackoilWellModelGeneric.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index f78f634a0..a26e0a053 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -117,7 +117,13 @@ BlackoilWellModelGeneric(Schedule& schedule, const auto& node_pressures = eclState.getRestartNetworkPressures(); if (node_pressures.has_value()) { - this->node_pressures_ = node_pressures.value(); + if constexpr (std::is_same_v) { + this->node_pressures_ = node_pressures.value(); + } else { + for (const auto& it : node_pressures.value()) { + this->node_pressures_[it.first] = it.second; + } + } } } From bc1fd4f01c2ebc0a68d4e5dae106d64339481d72 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 12 Apr 2024 13:11:09 +0200 Subject: [PATCH 2/3] BlackoilWellModelGeneric: optionally instantiate for float BlackoilWellModelRestart: optionally instantiate for float these need to be in the same commit due to circular dependencies --- opm/simulators/wells/BlackoilWellModelGeneric.cpp | 4 ++++ opm/simulators/wells/BlackoilWellModelRestart.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index a26e0a053..c37cb75e1 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -1868,4 +1868,8 @@ updateInjFCMult(DeferredLogger& deferred_logger) template class BlackoilWellModelGeneric; +#if FLOW_INSTANTIATE_FLOAT +template class BlackoilWellModelGeneric; +#endif + } diff --git a/opm/simulators/wells/BlackoilWellModelRestart.cpp b/opm/simulators/wells/BlackoilWellModelRestart.cpp index 176387c27..498e665fb 100644 --- a/opm/simulators/wells/BlackoilWellModelRestart.cpp +++ b/opm/simulators/wells/BlackoilWellModelRestart.cpp @@ -269,4 +269,8 @@ loadRestartData(const data::Wells& rst_wells, template class BlackoilWellModelRestart; +#if FLOW_INSTANTIATE_FLOAT +template class BlackoilWellModelRestart; +#endif + } // namespace Opm From d762f2b29c9f217d755e233ddea7e69c8bdcc81f Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 12 Apr 2024 13:11:09 +0200 Subject: [PATCH 3/3] ActionHandler: optionally instantiate for float --- opm/simulators/flow/ActionHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/opm/simulators/flow/ActionHandler.cpp b/opm/simulators/flow/ActionHandler.cpp index 2bec3e5eb..0524375ef 100644 --- a/opm/simulators/flow/ActionHandler.cpp +++ b/opm/simulators/flow/ActionHandler.cpp @@ -277,4 +277,8 @@ evalUDQAssignments(const unsigned episodeIdx, template class ActionHandler; +#if FLOW_INSTANTIATE_FLOAT +template class ActionHandler; +#endif + } // namespace Opm