mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-22 15:33:29 -06:00
Merge pull request #5576 from akva2/fix_build_no_float_no_mpi
Fix build without float simulators
This commit is contained in:
commit
f4801ec787
@ -40,11 +40,11 @@ copyright holders.
|
||||
|
||||
namespace {
|
||||
|
||||
#if FLOW_INSTANTIATE_FLOAT && HAVE_ECL_INPUT
|
||||
std::vector<std::vector<float>>
|
||||
doubleVecsToFloat(const std::vector<std::vector<double>>& input)
|
||||
template<class To, class From>
|
||||
std::vector<std::vector<To>>
|
||||
convertVecToVec(const std::vector<std::vector<From>>& input)
|
||||
{
|
||||
std::vector<std::vector<float>> output;
|
||||
std::vector<std::vector<To>> output;
|
||||
output.reserve(input.size());
|
||||
for (std::size_t i = 0; i < input.size(); ++i) {
|
||||
output.emplace_back(input[i].begin(), input[i].end());
|
||||
@ -52,7 +52,6 @@ doubleVecsToFloat(const std::vector<std::vector<double>>& input)
|
||||
|
||||
return output;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -289,7 +288,7 @@ initFromState(const EclipseState& eclState)
|
||||
if constexpr (std::is_same_v<Scalar, float>) {
|
||||
const std::vector<Scalar> tp(throughput.begin(), throughput.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);
|
||||
plymwinjTables_[tableNumber] = std::move(tablefunc);
|
||||
} else {
|
||||
@ -309,7 +308,7 @@ initFromState(const EclipseState& eclState)
|
||||
if constexpr (std::is_same_v<Scalar, float>) {
|
||||
const std::vector<Scalar> tp(throughput.begin(), throughput.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);
|
||||
skprwatTables_[tableNumber] = std::move(tablefunc);
|
||||
} else {
|
||||
@ -330,7 +329,7 @@ initFromState(const EclipseState& eclState)
|
||||
if constexpr (std::is_same_v<Scalar, float>) {
|
||||
const std::vector<Scalar> tp(throughput.begin(), throughput.end());
|
||||
const std::vector<Scalar> wv(watervelocity.begin(), watervelocity.end());
|
||||
const auto sp = doubleVecsToFloat(skinpressure);
|
||||
const auto sp = convertVecToVec<float>(skinpressure);
|
||||
SkprpolyTable tablefunc {
|
||||
refPolymerConcentration,
|
||||
TabulatedTwoDFunction(tp, wv, sp, true, false)
|
||||
|
@ -31,7 +31,6 @@
|
||||
#if HAVE_MPI
|
||||
#include <mpi.h>
|
||||
#include <dune/common/parallel/mpitraits.hh>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
|
||||
@ -134,6 +133,7 @@ struct Packer<std::vector<T>>
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
#endif
|
||||
|
||||
namespace Opm {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user