mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: use constexpr value and ifs
to disable code compile time instead of having runtime conditionals
This commit is contained in:
parent
ba9f4c5b50
commit
e8f69223e6
@ -71,8 +71,8 @@ class EclTransmissibility
|
|||||||
using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>;
|
using ElementMapper = GetPropType<TypeTag, Properties::ElementMapper>;
|
||||||
using Intersection = typename GridView::Intersection;
|
using Intersection = typename GridView::Intersection;
|
||||||
|
|
||||||
static const bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
static constexpr bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
|
||||||
static const bool enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>();
|
static constexpr bool enableDiffusion = getPropValue<TypeTag, Properties::EnableDiffusion>();
|
||||||
|
|
||||||
// Grid and world dimension
|
// Grid and world dimension
|
||||||
enum { dimWorld = GridView::dimensionworld };
|
enum { dimWorld = GridView::dimensionworld };
|
||||||
@ -175,7 +175,7 @@ public:
|
|||||||
transBoundary_.clear();
|
transBoundary_.clear();
|
||||||
|
|
||||||
// if energy is enabled, let's do the same for the "thermal half transmissibilities"
|
// if energy is enabled, let's do the same for the "thermal half transmissibilities"
|
||||||
if (enableEnergy) {
|
if constexpr (enableEnergy) {
|
||||||
thermalHalfTrans_->clear();
|
thermalHalfTrans_->clear();
|
||||||
thermalHalfTrans_->reserve(numElements*6*1.05);
|
thermalHalfTrans_->reserve(numElements*6*1.05);
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ public:
|
|||||||
|
|
||||||
// for boundary intersections we also need to compute the thermal
|
// for boundary intersections we also need to compute the thermal
|
||||||
// half transmissibilities
|
// half transmissibilities
|
||||||
if (enableEnergy) {
|
if constexpr (enableEnergy) {
|
||||||
Scalar transBoundaryEnergyIs;
|
Scalar transBoundaryEnergyIs;
|
||||||
computeHalfDiffusivity_(transBoundaryEnergyIs,
|
computeHalfDiffusivity_(transBoundaryEnergyIs,
|
||||||
faceAreaNormal,
|
faceAreaNormal,
|
||||||
@ -382,7 +382,7 @@ public:
|
|||||||
trans_[isId_(elemIdx, outsideElemIdx)] = trans;
|
trans_[isId_(elemIdx, outsideElemIdx)] = trans;
|
||||||
|
|
||||||
// update the "thermal half transmissibility" for the intersection
|
// update the "thermal half transmissibility" for the intersection
|
||||||
if (enableEnergy) {
|
if constexpr (enableEnergy) {
|
||||||
|
|
||||||
Scalar halfDiffusivity1;
|
Scalar halfDiffusivity1;
|
||||||
Scalar halfDiffusivity2;
|
Scalar halfDiffusivity2;
|
||||||
|
Loading…
Reference in New Issue
Block a user