mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Add get_phase_index function back
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -347,16 +347,22 @@ bool is_valid_phase(const std::string &phase_name, phases &iOutput)
|
||||
}
|
||||
}
|
||||
|
||||
int get_parameter_index(const std::string ¶m_name)
|
||||
phases get_phase_index(const std::string ¶m_name)
|
||||
{
|
||||
phases iPhase;
|
||||
if (is_valid_phase(param_name, iPhase)){
|
||||
return iPhase;
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("Your input name [%s] is not valid in get_phase_index (names are case sensitive)",param_name.c_str()));
|
||||
}
|
||||
}
|
||||
parameters get_parameter_index(const std::string ¶m_name)
|
||||
{
|
||||
parameters iOutput;
|
||||
phases iPhase;
|
||||
if (is_valid_parameter(param_name, iOutput)){
|
||||
return iOutput;
|
||||
}
|
||||
else if (is_valid_phase(param_name, iPhase)){
|
||||
return iPhase;
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("Your input name [%s] is not valid in get_parameter_index (names are case sensitive)",param_name.c_str()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user