20 #ifndef OPM_BLACKOILPHASES_HEADER_INCLUDED
21 #define OPM_BLACKOILPHASES_HEADER_INCLUDED
30 static const int MaxNumPhases = 3;
32 enum PhaseIndex { Aqua = 0, Liquid = 1, Vapour = 2 };
39 int phase_used[MaxNumPhases];
40 int phase_pos[MaxNumPhases];
57 bool hasFreeWater()
const {
return present(BlackoilPhases::Aqua ); }
58 bool hasFreeOil ()
const {
return present(BlackoilPhases::Liquid); }
59 bool hasFreeGas ()
const {
return present(BlackoilPhases::Vapour); }
61 void setFreeWater() { insert(BlackoilPhases::Aqua ); }
62 void setFreeOil () { insert(BlackoilPhases::Liquid); }
63 void setFreeGas () { insert(BlackoilPhases::Vapour); }
65 bool operator==(
const PhasePresence& other)
const {
return present_ == other.present_; }
66 bool operator!=(
const PhasePresence& other)
const {
return !this->operator==(other); }
69 unsigned char present_;
71 bool present(
const BlackoilPhases::PhaseIndex i)
const
73 return present_ & (1 << i);
76 void insert(
const BlackoilPhases::PhaseIndex i)
84 #endif // OPM_BLACKOILPHASES_HEADER_INCLUDED
Check or assign presence of a formed, free phase.
Definition: BlackoilPhases.hpp:50
Definition: BlackoilPhases.hpp:27
Definition: BlackoilPhases.hpp:36