Commit bf6ffb91 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Use static constexpr for improved compiler optimization

parent 2980cb66
......@@ -75,7 +75,7 @@ public:
const auto diffusiveFluxes = MolecularDiffusionType::flux(problem, element, fvGeometry, elemVolVars, scvf);
auto referenceSystemFormulation = MolecularDiffusionType::referenceSystemFormulation();
static constexpr auto referenceSystemFormulation = MolecularDiffusionType::referenceSystemFormulation();
for (int compIdx = 0; compIdx < numComponents; ++compIdx)
{
......
......@@ -135,7 +135,7 @@ public:
{
FluxVariables fluxVars;
fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
static constexpr auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
// get upwind weights into local scope
NumEqVector flux(0.0);
......
......@@ -171,7 +171,7 @@ public:
EnergyLocalResidual::heatConductionFlux(flux, fluxVars);
// diffusive fluxes
auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
static constexpr auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
const auto diffusionFluxesWPhase = fluxVars.molecularDiffusionFlux(wPhaseIdx);
Scalar jNW = diffusionFluxesWPhase[nCompIdx];
// check for the reference system and adapt units of the diffusive flux accordingly.
......
......@@ -143,7 +143,7 @@ public:
{
FluxVariables fluxVars;
fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
static constexpr auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
// get upwind weights into local scope
NumEqVector flux(0.0);
......
......@@ -126,7 +126,7 @@ public:
NumEqVector flux(0.0);
const auto diffusiveFluxes = fluxVars.molecularDiffusionFlux(phaseIdx);
auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
static constexpr auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
// formulation with mole balances
if (useMoles)
{
......@@ -248,7 +248,7 @@ public:
const auto advDerivIJ = volFlux*rho(outsideVolVars)*outsideWeight;
// diffusive term
const auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
static constexpr auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
const auto& fluxCache = elemFluxVarsCache[scvf];
const Scalar rhoInside = massOrMolarDensity(insideVolVars, referenceSystemFormulation, phaseIdx);
const Scalar rhoOutside = massOrMolarDensity(outsideVolVars, referenceSystemFormulation, phaseIdx);
......@@ -307,7 +307,7 @@ public:
const auto advDerivIJ = volFlux*rho(outsideVolVars)*outsideWeight;
// diffusive term
auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
static constexpr auto referenceSystemFormulation = FluxVariables::MolecularDiffusionType::referenceSystemFormulation();
using DiffusionType = GetPropType<T, Properties::MolecularDiffusionType>;
const auto ti = DiffusionType::calculateTransmissibilities(problem,
element,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment