Commit b3e3f9f5 authored by Timo Koch's avatar Timo Koch
Browse files

[mimetic][2p] At default to switch that throws NotImplemented

Gets rid of compiler warning about non-treated enum case.
parent 202b0506
......@@ -361,6 +361,8 @@ private:
case Sn:
sat = cellData.saturation(nPhaseIdx);
break;
default:
DUNE_THROW(Dune::NotImplemented, "Only saturation formulation Sw and Sn are implemented!");
}
Scalar error = (sat > 1.0) ? sat - 1.0 : 0.0;
......@@ -641,6 +643,8 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element&
fracFlow = -cellData.fracFlowFunc(wPhaseIdx);
break;
}
default:
DUNE_THROW(Dune::NotImplemented, "Only pressure formulation pw and pn are implemented!");
}
......@@ -669,6 +673,8 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element&
fracFlow = -cellData.fracFlowFunc(wPhaseIdx);
break;
}
default:
DUNE_THROW(Dune::NotImplemented, "Only pressure formulation pw and pn are implemented!");
}
}
else if (flux < 0. && bctype.isDirichlet(satEqIdx))
......@@ -695,6 +701,8 @@ void MimeticTwoPLocalStiffness<TypeTag>::assembleElementMatrices(const Element&
/ (krw / viscosity_[wPhaseIdx] + krn / viscosity_[nPhaseIdx]);
break;
}
default:
DUNE_THROW(Dune::NotImplemented, "Only pressure formulation pw and pn are implemented!");
}
}
......
......@@ -377,6 +377,8 @@ private:
case Sn:
sat = cellData.saturation(nPhaseIdx);
break;
default:
DUNE_THROW(Dune::NotImplemented, "Only saturation formulation Sw and Sn are implemented!");
}
Scalar error = (sat > 1.0) ? sat - 1.0 : 0.0;
......@@ -661,6 +663,8 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E
fracFlow = -cellData.fracFlowFunc(wPhaseIdx);
break;
}
default:
DUNE_THROW(Dune::NotImplemented, "Only pressure formulation pw and pn are implemented!");
}
rhs_[eIdxGlobal] -= (faceVol[idx] * fracFlow * flux);
......@@ -688,6 +692,8 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E
fracFlow = -cellData.fracFlowFunc(wPhaseIdx);
break;
}
default:
DUNE_THROW(Dune::NotImplemented, "Only pressure formulation pw and pn are implemented!");
}
}
else if (flux < 0. && bctype.isDirichlet(satEqIdx))
......@@ -714,6 +720,8 @@ void MimeticTwoPLocalStiffnessAdaptive<TypeTag>::assembleElementMatrices(const E
/ (krw / viscosity_[wPhaseIdx] + krn / viscosity_[nPhaseIdx]);
break;
}
default:
DUNE_THROW(Dune::NotImplemented, "Only pressure formulation pw and pn are implemented!");
}
}
......
......@@ -24,6 +24,8 @@
#ifndef DUMUX_MIMETICPRESSURE2P_HH
#define DUMUX_MIMETICPRESSURE2P_HH
#include <dune/common/exceptions.hh>
// dumux environment
#include <dumux/porousmediumflow/sequential/mimetic/properties.hh>
#include <dumux/porousmediumflow/sequential/cellcentered/pressure.hh>
......@@ -136,6 +138,8 @@ template<class TypeTag> class MimeticPressure2P
case sn:
sat = problem_.variables().cellData(i).saturation(nPhaseIdx);
break;
default:
DUNE_THROW(Dune::NotImplemented, "Only saturation formulation sw and sn are implemented!");
}
if (sat > 1.0)
{
......
......@@ -24,6 +24,8 @@
#ifndef DUMUX_MIMETICPRESSURE2PADAPTIVE_HH
#define DUMUX_MIMETICPRESSURE2PADAPTIVE_HH
#include <dune/common/exceptions.hh>
// dumux environment
#include <dumux/porousmediumflow/sequential/mimetic/properties.hh>
#include <dumux/porousmediumflow/sequential/cellcentered/pressure.hh>
......@@ -137,6 +139,8 @@ template<class TypeTag> class MimeticPressure2PAdaptive
case Sn:
sat = problem_.variables().cellData(i).saturation(nPhaseIdx);
break;
default:
DUNE_THROW(Dune::NotImplemented, "Only saturation formulation Sw and Sn are implemented!");
}
if (sat > 1.0)
{
......
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