mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Aesthetics: Turn if-else into switch()
This commit replaces an if-else-based query of the primaryVariable_ with the equivalent switch() statement for uniformity with the rest of the implementation.
This commit is contained in:
parent
0f663dfe9f
commit
a3bc595a91
@ -417,14 +417,18 @@ namespace {
|
|||||||
|
|
||||||
if (active_[ Gas ]){
|
if (active_[ Gas ]){
|
||||||
for (int c = 0; c < nc ; c++ ) {
|
for (int c = 0; c < nc ; c++ ) {
|
||||||
if ( primalVariable_[c] == PrimalVariables::RS ) {
|
switch (primalVariable_[c]) {
|
||||||
|
case PrimalVariables::RS:
|
||||||
isRs[c] = 1;
|
isRs[c] = 1;
|
||||||
}
|
break;
|
||||||
else if ( primalVariable_[c] == PrimalVariables::RV ) {
|
|
||||||
|
case PrimalVariables::RV:
|
||||||
isRv[c] = 1;
|
isRv[c] = 1;
|
||||||
}
|
break;
|
||||||
else {
|
|
||||||
|
default:
|
||||||
isSg[c] = 1;
|
isSg[c] = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1192,15 +1196,19 @@ namespace {
|
|||||||
V isRv = V::Zero(nc,1);
|
V isRv = V::Zero(nc,1);
|
||||||
V isSg = V::Zero(nc,1);
|
V isSg = V::Zero(nc,1);
|
||||||
if (active_[Gas]) {
|
if (active_[Gas]) {
|
||||||
for (int c = 0; c < nc ; c++ ) {
|
for (int c = 0; c < nc; ++c) {
|
||||||
if ( primalVariable_[c] == PrimalVariables::RS ) {
|
switch (primalVariable_[c]) {
|
||||||
|
case PrimalVariables::RS:
|
||||||
isRs[c] = 1;
|
isRs[c] = 1;
|
||||||
}
|
break;
|
||||||
else if ( primalVariable_[c] == PrimalVariables::RV ) {
|
|
||||||
|
case PrimalVariables::RV:
|
||||||
isRv[c] = 1;
|
isRv[c] = 1;
|
||||||
}
|
break;
|
||||||
else {
|
|
||||||
|
default:
|
||||||
isSg[c] = 1;
|
isSg[c] = 1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user