mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
use constexpr instead of anonymous enums
c++-20 warns for arithmetics using enums
This commit is contained in:
@@ -212,8 +212,8 @@ class Co2InjectionProblem : public GetPropType<TypeTag, Properties::BaseProblem>
|
||||
enum { liquidPhaseIdx = FluidSystem::liquidPhaseIdx };
|
||||
enum { CO2Idx = FluidSystem::CO2Idx };
|
||||
enum { BrineIdx = FluidSystem::BrineIdx };
|
||||
enum { conti0EqIdx = Indices::conti0EqIdx };
|
||||
enum { contiCO2EqIdx = conti0EqIdx + CO2Idx };
|
||||
static constexpr int conti0EqIdx = Indices::conti0EqIdx;
|
||||
static constexpr int contiCO2EqIdx = conti0EqIdx + CO2Idx;
|
||||
|
||||
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
|
||||
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
|
||||
|
@@ -45,7 +45,7 @@ class FlashIndices
|
||||
: public EnergyIndices<PVOffset + getPropValue<TypeTag, Properties::NumComponents>(),
|
||||
getPropValue<TypeTag, Properties::EnableEnergy>()>
|
||||
{
|
||||
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
|
||||
static constexpr int numComponents = getPropValue<TypeTag, Properties::NumComponents>();
|
||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||
using EnergyIndices = Opm::EnergyIndices<PVOffset + numComponents, enableEnergy>;
|
||||
|
||||
|
@@ -43,7 +43,7 @@ struct ImmiscibleIndices
|
||||
: public EnergyIndices<PVOffset + getPropValue<TypeTag, Properties::NumPhases>(),
|
||||
getPropValue<TypeTag, Properties::EnableEnergy>()>
|
||||
{
|
||||
enum { numPhases = getPropValue<TypeTag, Properties::NumPhases>() };
|
||||
static constexpr int numPhases = getPropValue<TypeTag, Properties::NumPhases>();
|
||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||
using EnergyIndices = Opm::EnergyIndices<PVOffset + numPhases, enableEnergy>;
|
||||
|
||||
|
@@ -48,8 +48,8 @@ struct NcpIndices
|
||||
{
|
||||
private:
|
||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||
enum { numPhases = FluidSystem::numPhases };
|
||||
enum { numComponents = FluidSystem::numComponents };
|
||||
static constexpr int numPhases = FluidSystem::numPhases;
|
||||
static constexpr int numComponents = FluidSystem::numComponents;
|
||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||
|
||||
using EnergyIndices = Opm::EnergyIndices<PVOffset + numComponents + numPhases, enableEnergy>;
|
||||
|
@@ -232,13 +232,13 @@ class NcpModel
|
||||
using FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>;
|
||||
using Indices = GetPropType<TypeTag, Properties::Indices>;
|
||||
|
||||
enum { numPhases = FluidSystem::numPhases };
|
||||
enum { numComponents = FluidSystem::numComponents };
|
||||
enum { fugacity0Idx = Indices::fugacity0Idx };
|
||||
static constexpr int numPhases = FluidSystem::numPhases;
|
||||
static constexpr int numComponents = FluidSystem::numComponents;
|
||||
static constexpr int fugacity0Idx = Indices::fugacity0Idx;
|
||||
enum { pressure0Idx = Indices::pressure0Idx };
|
||||
enum { saturation0Idx = Indices::saturation0Idx };
|
||||
enum { conti0EqIdx = Indices::conti0EqIdx };
|
||||
enum { ncp0EqIdx = Indices::ncp0EqIdx };
|
||||
static constexpr int conti0EqIdx = Indices::conti0EqIdx;
|
||||
static constexpr int ncp0EqIdx = Indices::ncp0EqIdx;
|
||||
enum { enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>() };
|
||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||
|
||||
|
@@ -46,7 +46,7 @@ class FlashIndices
|
||||
: public EnergyIndices<PVOffset + getPropValue<TypeTag, Properties::NumComponents>(),
|
||||
getPropValue<TypeTag, Properties::EnableEnergy>()>
|
||||
{
|
||||
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
|
||||
static constexpr int numComponents = getPropValue<TypeTag, Properties::NumComponents>();
|
||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||
using EnergyIndices = Opm::EnergyIndices<PVOffset + numComponents, enableEnergy>;
|
||||
|
||||
|
@@ -46,7 +46,7 @@ class PvsIndices
|
||||
: public EnergyIndices<PVOffset + getPropValue<TypeTag, Properties::NumComponents>(),
|
||||
getPropValue<TypeTag, Properties::EnableEnergy>()>
|
||||
{
|
||||
enum { numComponents = getPropValue<TypeTag, Properties::NumComponents>() };
|
||||
static constexpr int numComponents = getPropValue<TypeTag, Properties::NumComponents>();
|
||||
enum { enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>() };
|
||||
using EnergyIndices = Opm::EnergyIndices<PVOffset + numComponents, enableEnergy>;
|
||||
|
||||
|
Reference in New Issue
Block a user