diff --git a/opm/simulators/flow/EclGenericWriter.cpp b/opm/simulators/flow/EclGenericWriter.cpp index bc5e6307e..5543f3a2b 100644 --- a/opm/simulators/flow/EclGenericWriter.cpp +++ b/opm/simulators/flow/EclGenericWriter.cpp @@ -40,42 +40,70 @@ namespace Opm { -template class EclGenericWriter>, - Dune::MultipleCodimMultipleGeomTypeMapper>>, - double>; +#define INSTANTIATE_TYPE(T) \ + template class EclGenericWriter>, \ + Dune::MultipleCodimMultipleGeomTypeMapper< \ + Dune::GridView< \ + Dune::DefaultLeafGridViewTraits>>, \ + T>; + +INSTANTIATE_TYPE(double) + +#if FLOW_INSTANTIATE_FLOAT +INSTANTIATE_TYPE(float) +#endif #if HAVE_DUNE_FEM #if DUNE_VERSION_GTE(DUNE_FEM, 2, 9) using GV = Dune::Fem::AdaptiveLeafGridPart; -template class EclGenericWriter, - double>; +#define INSTANTIATE_FEM_TYPE(T) \ +template class EclGenericWriter, \ + T>; #else -template class EclGenericWriter>>, Dune::MultipleCodimMultipleGeomTypeMapper>>>, - double>; -template class EclGenericWriter>, - Dune::MultipleCodimMultipleGeomTypeMapper< - Dune::Fem::GridPart2GridViewImpl< - Dune::Fem::AdaptiveLeafGridPart< - Dune::CpGrid, - Dune::PartitionIteratorType(4), - false>>>, - double>; +#define INSTANTIATE_FEM_TYPE(T) \ + template class EclGenericWriter>>, \ + Dune::MultipleCodimMultipleGeomTypeMapper< \ + Dune::GridView< \ + Dune::Fem::GridPart2GridViewTraits< \ + Dune::Fem::AdaptiveLeafGridPart< \ + Dune::CpGrid, \ + Dune::PartitionIteratorType(4), false>>>>, \ + T>; \ + template class EclGenericWriter>, \ + Dune::MultipleCodimMultipleGeomTypeMapper< \ + Dune::Fem::GridPart2GridViewImpl< \ + Dune::Fem::AdaptiveLeafGridPart< \ + Dune::CpGrid, \ + Dune::PartitionIteratorType(4), \ + false>>>, \ + T>; #endif -#endif // HAVE_DUNE_FEM*/ + +INSTANTIATE_FEM_TYPE(double) + +#if FLOW_INSTANTIATE_FLOAT +INSTANTIATE_FEM_TYPE(float) +#endif + +#endif // HAVE_DUNE_FEM } // namespace Opm diff --git a/opm/simulators/flow/GenericOutputBlackoilModule.cpp b/opm/simulators/flow/GenericOutputBlackoilModule.cpp index 949033eea..f57fe9a7b 100644 --- a/opm/simulators/flow/GenericOutputBlackoilModule.cpp +++ b/opm/simulators/flow/GenericOutputBlackoilModule.cpp @@ -768,7 +768,7 @@ setRestart(const data::Solution& sol, if (!rswSol_.empty()) { if (sol.has("RSWSOL")) - rswSol_[elemIdx] = sol.data("RSWSOL")[globalDofIndex]; + rswSol_[elemIdx] = sol.data("RSWSOL")[globalDofIndex]; } @@ -1660,6 +1660,15 @@ assignGlobalFieldsToSolution(data::Solution& sol) } } -template class GenericOutputBlackoilModule>; +template using FS = BlackOilFluidSystem; + +#define INSTANTIATE_TYPE(T) \ + template class GenericOutputBlackoilModule>; + +INSTANTIATE_TYPE(double) + +#if FLOW_INSTANTIATE_FLOAT +INSTANTIATE_TYPE(float) +#endif } // namespace Opm diff --git a/opm/simulators/flow/NonlinearSolver.cpp b/opm/simulators/flow/NonlinearSolver.cpp index 0cc63d2ff..f592eb584 100644 --- a/opm/simulators/flow/NonlinearSolver.cpp +++ b/opm/simulators/flow/NonlinearSolver.cpp @@ -123,22 +123,26 @@ void registerNonlinearParameters() template using BV = Dune::BlockVector>; -#define INSTANTIATE(T,Size) \ - template void stabilizeNonlinearUpdate,T>(BV&, BV&, \ - const T, NonlinearRelaxType); +#define INSTANTIATE(T,Size) \ + template void stabilizeNonlinearUpdate(BV&, BV&, \ + const T, NonlinearRelaxType); -#define INSTANTIATE_TYPE(T) \ - template void detectOscillations(const std::vector>&, \ - const int, const int, const T, const int, \ - bool&, bool&); \ - template void registerNonlinearParameters(); \ - INSTANTIATE(T,1) \ - INSTANTIATE(T,2) \ - INSTANTIATE(T,3) \ - INSTANTIATE(T,4) \ - INSTANTIATE(T,5) \ +#define INSTANTIATE_TYPE(T) \ + template void detectOscillations(const std::vector>&, \ + const int, const int, const T, \ + const int, bool&, bool&); \ + template void registerNonlinearParameters(); \ + INSTANTIATE(T,1) \ + INSTANTIATE(T,2) \ + INSTANTIATE(T,3) \ + INSTANTIATE(T,4) \ + INSTANTIATE(T,5) \ INSTANTIATE(T,6) INSTANTIATE_TYPE(double) +#if FLOW_INSTANTIATE_FLOAT +INSTANTIATE_TYPE(float) +#endif + } // namespace Opm::detail diff --git a/opm/simulators/flow/OutputBlackoilModule.hpp b/opm/simulators/flow/OutputBlackoilModule.hpp index 555540a8d..a3956e74c 100644 --- a/opm/simulators/flow/OutputBlackoilModule.hpp +++ b/opm/simulators/flow/OutputBlackoilModule.hpp @@ -1775,7 +1775,7 @@ private: this->fip_[Inplace::Phase::CO2MassInGasPhaseMaximumTrapped][globalDofIdx] = imMobileMassGas; } if (!this->fip_[Inplace::Phase::CO2MassInGasPhaseMaximumUnTrapped].empty()) { - const Scalar mobileMassGas = massGas * std::max(0.0, sg - trappedGasSaturation); + const Scalar mobileMassGas = massGas * std::max(Scalar{0.0}, sg - trappedGasSaturation); this->fip_[Inplace::Phase::CO2MassInGasPhaseMaximumUnTrapped][globalDofIdx] = mobileMassGas; } } @@ -1793,7 +1793,7 @@ private: this->fip_[Inplace::Phase::CO2MassInGasPhaseEffectiveTrapped][globalDofIdx] = imMobileMassGas; } if (!this->fip_[Inplace::Phase::CO2MassInGasPhaseEffectiveUnTrapped].empty()) { - const Scalar mobileMassGas = massGas * std::max(0.0, sg - trappedGasSaturation); + const Scalar mobileMassGas = massGas * std::max(Scalar{0.0}, sg - trappedGasSaturation); this->fip_[Inplace::Phase::CO2MassInGasPhaseEffectiveUnTrapped][globalDofIdx] = mobileMassGas; } }