Aquiferxxx: some modernization

- typedef -> using
- use constexpr
This commit is contained in:
Arne Morten Kvarving 2022-08-10 14:27:34 +02:00
parent e73d3368e0
commit 66b4f1edb7
4 changed files with 18 additions and 16 deletions

View File

@ -37,7 +37,7 @@ template <typename TypeTag>
class AquiferCarterTracy : public AquiferInterface<TypeTag> class AquiferCarterTracy : public AquiferInterface<TypeTag>
{ {
public: public:
typedef AquiferInterface<TypeTag> Base; using Base = AquiferInterface<TypeTag>;
using typename Base::BlackoilIndices; using typename Base::BlackoilIndices;
using typename Base::ElementContext; using typename Base::ElementContext;
@ -236,6 +236,7 @@ protected:
return this->aquct_data_.datum_depth; return this->aquct_data_.datum_depth;
} }
}; // class AquiferCarterTracy }; // class AquiferCarterTracy
} // namespace Opm } // namespace Opm
#endif #endif

View File

@ -37,7 +37,7 @@ class AquiferFetkovich : public AquiferInterface<TypeTag>
{ {
public: public:
typedef AquiferInterface<TypeTag> Base; using Base = AquiferInterface<TypeTag>;
using typename Base::BlackoilIndices; using typename Base::BlackoilIndices;
using typename Base::ElementContext; using typename Base::ElementContext;
@ -171,5 +171,7 @@ protected:
return this->aqufetp_data_.datum_depth; return this->aqufetp_data_.datum_depth;
} }
}; // Class AquiferFetkovich }; // Class AquiferFetkovich
} // namespace Opm } // namespace Opm
#endif #endif

View File

@ -62,21 +62,20 @@ public:
enum { enableEvaporation = getPropValue<TypeTag, Properties::EnableEvaporation>() }; enum { enableEvaporation = getPropValue<TypeTag, Properties::EnableEvaporation>() };
enum { enableSaltPrecipitation = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>() }; enum { enableSaltPrecipitation = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>() };
static const int numEq = BlackoilIndices::numEq; static constexpr int numEq = BlackoilIndices::numEq;
typedef double Scalar; using Scalar = double;
typedef DenseAd::Evaluation<double, /*size=*/numEq> Eval; using Eval = DenseAd::Evaluation<double, /*size=*/numEq>;
typedef BlackOilFluidState<Eval, using FluidState = BlackOilFluidState<Eval,
FluidSystem, FluidSystem,
enableTemperature, enableTemperature,
enableEnergy, enableEnergy,
BlackoilIndices::gasEnabled, BlackoilIndices::gasEnabled,
enableEvaporation, enableEvaporation,
enableBrine, enableBrine,
enableSaltPrecipitation, enableSaltPrecipitation,
BlackoilIndices::numPhases> BlackoilIndices::numPhases>;
FluidState;
// Constructor // Constructor
AquiferInterface(int aqID, AquiferInterface(int aqID,

View File

@ -50,7 +50,7 @@ public:
enum { dimWorld = GridView::dimensionworld }; enum { dimWorld = GridView::dimensionworld };
enum { numPhases = FluidSystem::numPhases }; enum { numPhases = FluidSystem::numPhases };
static const int numEq = BlackoilIndices::numEq; static constexpr int numEq = BlackoilIndices::numEq;
using Eval = DenseAd::Evaluation<double, numEq>; using Eval = DenseAd::Evaluation<double, numEq>;
using Toolbox = MathToolbox<Eval>; using Toolbox = MathToolbox<Eval>;