mirror of
				https://github.com/OPM/opm-simulators.git
				synced 2025-02-25 18:55:30 -06:00 
			
		
		
		
	changed: make has_solvent and has_zFraction constexpr
and use if constexpr to eliminate some code
This commit is contained in:
		@@ -107,8 +107,8 @@ namespace Opm
 | 
			
		||||
        typedef Dune::BlockVector<VectorBlockType> BVector;
 | 
			
		||||
        typedef DenseAd::Evaluation<double, /*size=*/numEq> Eval;
 | 
			
		||||
 | 
			
		||||
        static const bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>();
 | 
			
		||||
        static const bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>();
 | 
			
		||||
        static constexpr bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>();
 | 
			
		||||
        static constexpr bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>();
 | 
			
		||||
        static const bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>();
 | 
			
		||||
        static const bool has_energy = getPropValue<TypeTag, Properties::EnableEnergy>();
 | 
			
		||||
        static const bool has_temperature = getPropValue<TypeTag, Properties::EnableTemperature>();
 | 
			
		||||
 
 | 
			
		||||
@@ -97,10 +97,12 @@ namespace Opm
 | 
			
		||||
 | 
			
		||||
        wsolvent_ = 0.0;
 | 
			
		||||
 | 
			
		||||
        if ((has_solvent || has_zFraction) && well.isInjector()) {
 | 
			
		||||
            auto injectorType = well_ecl_.injectorType();
 | 
			
		||||
            if (injectorType == InjectorType::GAS) {
 | 
			
		||||
                wsolvent_ = well_ecl_.getSolventFraction();
 | 
			
		||||
        if constexpr (has_solvent || has_zFraction) {
 | 
			
		||||
            if (well.isInjector()) {
 | 
			
		||||
                auto injectorType = well_ecl_.injectorType();
 | 
			
		||||
                if (injectorType == InjectorType::GAS) {
 | 
			
		||||
                    wsolvent_ = well_ecl_.getSolventFraction();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user