MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / is_valid_phase

Function is_valid_phase

src/DataStructures.cpp:409–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407 throw ValueError("Cannot find the short phase description.");
408}
409bool is_valid_phase(const std::string& phase_name, phases& iOutput) {
410 auto& phase_information = get_phase_information();
411 // Try to find it
412 auto it = phase_information.index_map.find(phase_name);
413 // If equal to end, not found
414 if (it != phase_information.index_map.end()) {
415 // Found, return it
416 iOutput = static_cast<phases>(it->second);
417 return true;
418 } else {
419 return false;
420 }
421}
422
423phases get_phase_index(const std::string& param_name) {
424 phases iPhase;

Callers 2

get_phase_indexFunction · 0.85
StripPhaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected