deleteSolidPhasefromPhases

This commit is contained in:
Cintia Goncalves Machado
2020-06-19 13:31:33 +02:00
parent 6ab09afb0c
commit 784abc7069
2 changed files with 7 additions and 12 deletions

View File

@@ -40,12 +40,11 @@ enum class Phase {
ENERGY = 5,
POLYMW = 6,
FOAM = 7,
BRINE = 8,
PRECSALT = 9
BRINE = 8
// If you add more entries to this enum, remember to update NUM_PHASES_IN_ENUM below.
};
constexpr int NUM_PHASES_IN_ENUM = static_cast<int>(Phase::PRECSALT) + 1; // Used to get correct size of the bitset in class Phases.
constexpr int NUM_PHASES_IN_ENUM = static_cast<int>(Phase::BRINE) + 1; // Used to get correct size of the bitset in class Phases.
Phase get_phase( const std::string& );
std::ostream& operator<<( std::ostream&, const Phase& );
@@ -54,7 +53,7 @@ class Phases {
public:
Phases() noexcept = default;
Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false,
bool polymw = false, bool foam = false, bool brine = false, bool precsalt = false ) noexcept;
bool polymw = false, bool foam = false, bool brine = false ) noexcept;
static Phases serializeObject();

View File

@@ -38,8 +38,7 @@ Phase get_phase( const std::string& str ) {
if( str == "POLYMW" ) return Phase::POLYMW;
if( str == "FOAM" ) return Phase::FOAM;
if( str == "BRINE" ) return Phase::BRINE;
if( str == "PRECSALT" ) return Phase::PRECSALT;
throw std::invalid_argument( "Unknown phase '" + str + "'" );
}
@@ -54,7 +53,6 @@ std::ostream& operator<<( std::ostream& stream, const Phase& p ) {
case Phase::POLYMW: return stream << "POLYMW";
case Phase::FOAM: return stream << "FOAM";
case Phase::BRINE: return stream << "BRINE";
case Phase::PRECSALT: return stream << "PRECSALT";
}
@@ -63,7 +61,7 @@ std::ostream& operator<<( std::ostream& stream, const Phase& p ) {
using un = std::underlying_type< Phase >::type;
Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, bool polymw, bool foam, bool brine, bool precsalt) noexcept :
Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, bool polymw, bool foam, bool brine) noexcept :
bits( (oil ? (1 << static_cast< un >( Phase::OIL ) ) : 0) |
(gas ? (1 << static_cast< un >( Phase::GAS ) ) : 0) |
(wat ? (1 << static_cast< un >( Phase::WATER ) ) : 0) |
@@ -72,8 +70,7 @@ Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, b
(energy ? (1 << static_cast< un >( Phase::ENERGY ) ) : 0) |
(polymw ? (1 << static_cast< un >( Phase::POLYMW ) ) : 0) |
(foam ? (1 << static_cast< un >( Phase::FOAM ) ) : 0) |
(brine ? (1 << static_cast< un >( Phase::BRINE ) ) : 0) |
(precsalt ? (1 << static_cast< un >( Phase::PRECSALT ) ) : 0) )
(brine ? (1 << static_cast< un >( Phase::BRINE ) ) : 0) )
{}
@@ -306,8 +303,7 @@ Runspec::Runspec( const Deck& deck ) :
deck.hasKeyword( "THERMAL" ),
deck.hasKeyword( "POLYMW" ),
deck.hasKeyword( "FOAM" ),
deck.hasKeyword( "BRINE" ),
deck.hasKeyword( "PRECSALT" ) ) ),
deck.hasKeyword( "BRINE" ) ) ),
m_tabdims( deck ),
endscale( deck ),
welldims( deck ),