fixed: building without float simulators

pointy hat is all mine
This commit is contained in:
Arne Morten Kvarving 2024-09-04 12:50:22 +02:00
parent da1e7b1114
commit c4871367e8

View File

@ -40,11 +40,11 @@ copyright holders.
namespace { namespace {
#if FLOW_INSTANTIATE_FLOAT && HAVE_ECL_INPUT template<class To, class From>
std::vector<std::vector<float>> std::vector<std::vector<To>>
doubleVecsToFloat(const std::vector<std::vector<double>>& input) convertVecToVec(const std::vector<std::vector<From>>& input)
{ {
std::vector<std::vector<float>> output; std::vector<std::vector<To>> output;
output.reserve(input.size()); output.reserve(input.size());
for (std::size_t i = 0; i < input.size(); ++i) { for (std::size_t i = 0; i < input.size(); ++i) {
output.emplace_back(input[i].begin(), input[i].end()); output.emplace_back(input[i].begin(), input[i].end());
@ -52,7 +52,6 @@ doubleVecsToFloat(const std::vector<std::vector<double>>& input)
return output; return output;
} }
#endif
} }
@ -289,7 +288,7 @@ initFromState(const EclipseState& eclState)
if constexpr (std::is_same_v<Scalar, float>) { if constexpr (std::is_same_v<Scalar, float>) {
const std::vector<Scalar> tp(throughput.begin(), throughput.end()); const std::vector<Scalar> tp(throughput.begin(), throughput.end());
const std::vector<Scalar> wv(watervelocity.begin(), watervelocity.end()); const std::vector<Scalar> wv(watervelocity.begin(), watervelocity.end());
const auto mw = doubleVecsToFloat(molecularweight); const auto mw = convertVecToVec<float>(molecularweight);
TabulatedTwoDFunction tablefunc(tp, wv, mw, true, false); TabulatedTwoDFunction tablefunc(tp, wv, mw, true, false);
plymwinjTables_[tableNumber] = std::move(tablefunc); plymwinjTables_[tableNumber] = std::move(tablefunc);
} else { } else {
@ -309,7 +308,7 @@ initFromState(const EclipseState& eclState)
if constexpr (std::is_same_v<Scalar, float>) { if constexpr (std::is_same_v<Scalar, float>) {
const std::vector<Scalar> tp(throughput.begin(), throughput.end()); const std::vector<Scalar> tp(throughput.begin(), throughput.end());
const std::vector<Scalar> wv(watervelocity.begin(), watervelocity.end()); const std::vector<Scalar> wv(watervelocity.begin(), watervelocity.end());
const auto sp = doubleVecsToFloat(skinpressure); const auto sp = convertVecToVec<float>(skinpressure);
TabulatedTwoDFunction tablefunc(tp, wv, sp, true, false); TabulatedTwoDFunction tablefunc(tp, wv, sp, true, false);
skprwatTables_[tableNumber] = std::move(tablefunc); skprwatTables_[tableNumber] = std::move(tablefunc);
} else { } else {
@ -330,7 +329,7 @@ initFromState(const EclipseState& eclState)
if constexpr (std::is_same_v<Scalar, float>) { if constexpr (std::is_same_v<Scalar, float>) {
const std::vector<Scalar> tp(throughput.begin(), throughput.end()); const std::vector<Scalar> tp(throughput.begin(), throughput.end());
const std::vector<Scalar> wv(watervelocity.begin(), watervelocity.end()); const std::vector<Scalar> wv(watervelocity.begin(), watervelocity.end());
const auto sp = doubleVecsToFloat(skinpressure); const auto sp = convertVecToVec<float>(skinpressure);
SkprpolyTable tablefunc { SkprpolyTable tablefunc {
refPolymerConcentration, refPolymerConcentration,
TabulatedTwoDFunction(tp, wv, sp, true, false) TabulatedTwoDFunction(tp, wv, sp, true, false)