From c9ad1f7e596d377e3a41369036dda950a6239096 Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Fri, 26 Dec 2014 01:45:03 -0500 Subject: [PATCH] Removed unneeded overloads of PropsSI function, leaving only PropsSI and PropsSImulti Signed-off-by: Ian Bell --- include/CoolProp.h | 34 ---------------------------- src/CoolProp.cpp | 56 ---------------------------------------------- 2 files changed, 90 deletions(-) diff --git a/include/CoolProp.h b/include/CoolProp.h index f8ab14f3..e22bfca0 100644 --- a/include/CoolProp.h +++ b/include/CoolProp.h @@ -33,25 +33,6 @@ You might want to start by looking at CoolProp.h /// @param Prop2 The second state variable value /// @param FluidName The fluid name double PropsSI(const std::string &Output, const std::string &Name1, double Prop1, const std::string &Name2, double Prop2, const std::string &FluidName); - /// Return a value that depends on the thermodynamic state - /// @param Output The output parameter, one of "T","D","H",etc. - /// @param Name1 The first state variable name, one of "T","D","H",etc. - /// @param Prop1 The first state variable value - /// @param Name2 The second state variable name, one of "T","D","H",etc. - /// @param Prop2 The second state variable value - /// @param FluidName The fluid name - /// @param z The mole or mass fractions depending on the requirements of the backend - double PropsSI(const std::string &Output, const std::string &Name1, double Prop1, const std::string &Name2, double Prop2, const std::string &FluidName, const std::vector &z); - /// Return a value that depends on the thermodynamic state - /// @param Output The output parameter, one of "T","D","H",etc. - /// @param Name1 The first state variable name, one of "T","D","H",etc. - /// @param Prop1 The first state variable value - /// @param Name2 The second state variable name, one of "T","D","H",etc. - /// @param Prop2 The second state variable value - /// @param FluidName The fluid name, or names seperated by '&' if a mixture - /// @param z The mole or mass fractions depending on the requirements of the backend - std::vector PropsSI(const std::string &Output, const std::string &Name1, const std::vector &Prop1, const std::string &Name2, const std::vector Prop2, const std::string &FluidName, const std::vector &z); - /** * @brief Get a matrix of outputs for a given input. Can handle both vector inputs as well as a vector of output strings @@ -72,21 +53,6 @@ You might want to start by looking at CoolProp.h const std::string &backend, const std::string &fluid, const std::vector &fractions); - - /// Return a value that depends on the thermodynamic state - /// @param Output The output parameter, one of "T","D","H",etc. - /// @param Name1 The first state variable name, one of "T","D","H",etc. - /// @param Prop1 The first state variable value - /// @param Name2 The second state variable name, one of "T","D","H",etc. - /// @param Prop2 The second state variable value - /// @param FluidName The fluid name - std::vector PropsSI(const std::string &Output, const std::string &Name1, const std::vector &Prop1, const std::string &Name2, const std::vector Prop2, const std::string &FluidName); - - /** - \overload - \sa PropsSI(std::string &Output, std::string &Name1, double Prop1, std::string &Name2, double Prop2, std::string &FluidName, const std::vector &x); - */ - double PropsSI(const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *FluidName, const std::vector &x); /// Get the debug level /// @returns level The level of the verbosity for the debugging output (0-10) 0: no debgging output diff --git a/src/CoolProp.cpp b/src/CoolProp.cpp index 5942d93d..7e467942 100644 --- a/src/CoolProp.cpp +++ b/src/CoolProp.cpp @@ -352,38 +352,6 @@ std::vector > PropsSImulti(const std::vector &O #endif return std::vector >(); } - -double PropsSI(const std::string &Output, const std::string &Name1, double Prop1, const std::string &Name2, double Prop2, const std::string &Ref, const std::vector &z) -{ - #if !defined(NO_ERROR_CATCHING) - try{ - #endif - // Fractions are already provided, we just need to parse the Ref string - std::string backend, fluid; - std::vector fractions; - extract_backend(Ref, backend, fluid); - - std::vector > IO = PropsSImulti(strsplit(Output,'&'), Name1, std::vector(1, Prop1), Name2, std::vector(1, Prop2), backend, fluid, z); - if (IO.size()!= 1 || IO[0].size() != 1){ throw ValueError(format("output should be 1x1; error was %s", get_global_param_string("errstring").c_str())); } - - double val = IO[0][0]; - return val; - - #if !defined(NO_ERROR_CATCHING) - } - catch(const std::exception& e){ - set_error_string(e.what() + format(" : PropsSI(\"%s\",\"%s\",%0.10g,\"%s\",%0.10g,\"%s\")",Output.c_str(),Name1.c_str(), Prop1, Name2.c_str(), Prop2, Ref.c_str())); - #if defined (PROPSSI_ERROR_STDOUT) - std::cout << e.what() << std::endl; - #endif - if (get_debug_level() > 1){std::cout << e.what() << std::endl;} - return _HUGE; - } - catch(...){ - return _HUGE; - } - #endif -} double PropsSI(const std::string &Output, const std::string &Name1, double Prop1, const std::string &Name2, double Prop2, const std::string &Ref) { std::string backend, fluid; std::vector fractions(1, 1.0); @@ -425,25 +393,6 @@ double PropsSI(const std::string &Output, const std::string &Name1, double Prop1 } #endif } -std::vector PropsSI(const std::string &Output, const std::string &Name1, const std::vector &Prop1, const std::string &Name2, const std::vector Prop2, const std::string &FluidName) -{ - return PropsSI(Output, Name1, Prop1, Name2, Prop2, FluidName, std::vector(1,1)); -} -std::vector PropsSI(const std::string &Output, const std::string &Name1, const std::vector &Prop1, const std::string &Name2, const std::vector Prop2, const std::string &Ref, const std::vector &z) -{ - std::vector out(Prop1.size(), _HUGE); - if (Prop1.size() != Prop2.size()) - { - throw ValueError(format("Sizes of Prop1 [%d] and Prop2 [%d] to PropsSI are not the same", Prop1.size(), Prop2.size())); - } - // Do the setup - // Get the outputs - for (std::size_t i = 0; i < Prop1.size(); ++i) - { - out[i] = PropsSI(Output,Name1,Prop1[i],Name2,Prop2[i],Ref,z); - } - return out; -} #if defined(ENABLE_CATCH) TEST_CASE("Check inputs to PropsSI","[PropsSI]") { @@ -522,11 +471,6 @@ TEST_CASE("Check inputs to PropsSI","[PropsSI]") }; }; #endif -double PropsSI(const char *Output, const char *Name1, double Prop1, const char *Name2, double Prop2, const char *FluidName, const std::vector &x) -{ - std::string _Output = Output, _Name1 = Name1, _Name2 = Name2, _FluidName = FluidName; - return PropsSI(_Output,_Name1,Prop1,_Name2,Prop2,_FluidName, x); -} /**************************************************** * Props1SI *