mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
make has_energy constexpr and use if constexpr to eliminate code
This commit is contained in:
parent
268201eeb1
commit
db668e8d80
@ -69,7 +69,7 @@ namespace Opm
|
||||
OPM_THROW(std::runtime_error, "polymer is not supported by multisegment well yet");
|
||||
}
|
||||
|
||||
if (Base::has_energy) {
|
||||
if constexpr (Base::has_energy) {
|
||||
OPM_THROW(std::runtime_error, "energy is not supported by multisegment well yet");
|
||||
}
|
||||
|
||||
|
@ -722,11 +722,11 @@ namespace Opm
|
||||
well_state.wellVaporizedOilRates()[index_of_well_] += perf_vap_oil_rate;
|
||||
}
|
||||
|
||||
if (has_energy) {
|
||||
if constexpr (has_energy) {
|
||||
connectionRates[perf][contiEnergyEqIdx] = 0.0;
|
||||
}
|
||||
|
||||
if (has_energy) {
|
||||
if constexpr (has_energy) {
|
||||
|
||||
auto fs = intQuants.fluidState();
|
||||
for (unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++phaseIdx) {
|
||||
|
@ -108,7 +108,7 @@ namespace Opm
|
||||
static constexpr bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>();
|
||||
static constexpr bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>();
|
||||
static constexpr bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>();
|
||||
static const bool has_energy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
||||
static constexpr bool has_energy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
||||
static const bool has_temperature = getPropValue<TypeTag, Properties::EnableTemperature>();
|
||||
// flag for polymer molecular weight related
|
||||
static constexpr bool has_polymermw = getPropValue<TypeTag, Properties::EnablePolymerMW>();
|
||||
|
Loading…
Reference in New Issue
Block a user