Skip to content
Snippets Groups Projects
Commit 9e81ef0e authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

Merge branch 'fix/linker-error-brine' into 'master'

[material][brineair] Use switch instead of static constexpr array

See merge request !1124
parents ad76e9e3 072b9f24
No related branches found
No related tags found
1 merge request!1124[material][brineair] Use switch instead of static constexpr array
......@@ -117,11 +117,18 @@ private:
{
using FluidSystem = Brine;
static constexpr int phaseIdx(int brinePhaseIdx) { return liquidPhaseIdx; }
static constexpr int compIdx(int brineCompIdx) { return compMap[brineCompIdx]; }
private:
static constexpr std::array<int, Brine::numComponents> compMap{ {H2OIdx, NaClIdx} };
static constexpr int phaseIdx(int brinePhaseIdx) { return liquidPhaseIdx; }
static constexpr int compIdx(int brineCompIdx)
{
switch (brineCompIdx)
{
assert(brineCompIdx == Brine::H2OIdx || brineCompIdx == Brine::NaClIdx);
case Brine::H2OIdx: return H2OIdx;
case Brine::NaClIdx: return NaClIdx;
default: return 0; // this will never be reached, only needed to suppress compiler warning
}
}
};
template<class FluidState>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment