<commit_before>/*
 * AbstractBackend.h
 *
 *  Created on: 20 Dec 2013
 *      Author: jowr
 */

#ifndef REFPROPMIXTUREBACKEND_H_
#define REFPROPMIXTUREBACKEND_H_

#include "AbstractState.h"

#include <vector>

namespace CoolProp {


class REFPROPMixtureBackend : public AbstractState  {
protected:
    int Ncomp;
	bool _mole_fractions_set;
	static bool _REFPROP_supported;
	std::vector<double> mole_fractions, mass_fractions;
	std::vector<double> mole_fractions_liq, mole_fractions_vap;
public:
	REFPROPMixtureBackend(){};

	/// The instantiator
	/// @param fluid_names The vector of strings of the fluid components, without file ending
	REFPROPMixtureBackend(const std::vector<std::string>& fluid_names);
	virtual ~REFPROPMixtureBackend();

    // REFPROP backend uses mole fractions
    bool using_mole_fractions(){return true;}

	/// Updating function for REFPROP
	/**
	In this function we take a pair of thermodynamic states, those defined in the input_pairs
	enumeration and update all the internal variables that we can.  REFPROP calculates
	a lot of other state variables each time you use a flash routine so we cache all the
	outputs that we can, which saves on computational time.

	@param input_pair Integer key from CoolProp::input_pairs to the two inputs that will be passed to the function
	@param value1 First input value
	@param value2 Second input value
	*/
	void update(long input_pair,
				double value1,
				double value2
				);

	/// Returns true if REFPROP is supported on this platform
	bool REFPROP_supported(void);

	/// Set the fluids in REFPROP DLL by calling the SETUPdll function
	/**
	@param fluid_names The vector of strings of the fluid components, without file ending
	*/<commit_msg>REFPROP backend can calculate molar mass<commit_after>/*
 * AbstractBackend.h
 *
 *  Created on: 20 Dec 2013
 *      Author: jowr
 */

#ifndef REFPROPMIXTUREBACKEND_H_
#define REFPROPMIXTUREBACKEND_H_

#include "AbstractState.h"

#include <vector>

namespace CoolProp {


class REFPROPMixtureBackend : public AbstractState  {
protected:
    int Ncomp;
	bool _mole_fractions_set;
	static bool _REFPROP_supported;
	std::vector<double> mole_fractions, mass_fractions;
	std::vector<double> mole_fractions_liq, mole_fractions_vap;
public:
	REFPROPMixtureBackend(){};

	/// The instantiator
	/// @param fluid_names The vector of strings of the fluid components, without file ending
	REFPROPMixtureBackend(const std::vector<std::string>& fluid_names);
	virtual ~REFPROPMixtureBackend();

    // REFPROP backend uses mole fractions
    bool using_mole_fractions(){return true;}

	/// Updating function for REFPROP
	/**
	In this function we take a pair of thermodynamic states, those defined in the input_pairs
	enumeration and update all the internal variables that we can.  REFPROP calculates
	a lot of other state variables each time you use a flash routine so we cache all the
	outputs that we can, which saves on computational time.

	@param input_pair Integer key from CoolProp::input_pairs to the two inputs that will be passed to the function
	@param value1 First input value
	@param value2 Second input value
	*/
	void update(long input_pair,
				double value1,
				double value2
				);

    long double calc_molar_mass(void){
        if (!_molar_mass){
            calc_molar_mass();
        }
        return _molar_mass.pt();
    };

	/// Returns true if REFPROP is supported on this platform
	bool REFPROP_supported(void);

	/// Set the fluids in REFPROP DLL by calling the SETUPdll function
	/**
	@param fluid_names The vector of strings of the fluid components, without file ending
	*/
{'fraction_non_alphanumeric': 0.06851595006934813, 'fraction_numerical': 0.005547850208044383, 'mean_word_length': 4.226086956521739, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '123914', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1055, 'n_words': 401}