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

Function AbstractState_get_phase_envelope_data

src/CoolPropLib.cpp:913–939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

911}
912
913EXPORT_CODE void CONVENTION AbstractState_get_phase_envelope_data(const long handle, const long length, double* T, double* p, double* rhomolar_vap,
914 double* rhomolar_liq, double* x, double* y, long* errcode, char* message_buffer,
915 const long buffer_length) {
916 *errcode = 0;
917 fpu_reset_guard guard;
918 try {
919 shared_ptr<CoolProp::AbstractState>& AS = handle_manager.get(handle);
920 CoolProp::PhaseEnvelopeData pe = AS->get_phase_envelope_data();
921 if (pe.T.size() > static_cast<std::size_t>(length)) {
922 throw CoolProp::ValueError(format("Length of phase envelope vectors [%d] is greater than allocated buffer length [%d]",
923 static_cast<int>(pe.T.size()), static_cast<int>(length)));
924 }
925 std::size_t N = pe.x.size();
926 for (std::size_t i = 0; i < pe.T.size(); i++) {
927 *(T + i) = pe.T[i];
928 *(p + i) = pe.p[i];
929 *(rhomolar_vap + i) = pe.rhomolar_vap[i];
930 *(rhomolar_liq + i) = pe.rhomolar_liq[i];
931 for (std::size_t j = 0; j < N; ++j) {
932 *(x + i * N + j) = pe.x[j][i];
933 *(y + i * N + j) = pe.y[j][i];
934 }
935 }
936 } catch (...) {
937 HandleException(errcode, message_buffer, buffer_length);
938 }
939}
940
941EXPORT_CODE void CONVENTION AbstractState_get_phase_envelope_data_checkedMemory(const long handle, const long length, const long maxComponents,
942 double* T, double* p, double* rhomolar_vap, double* rhomolar_liq,

Callers

nothing calls this directly

Calls 4

HandleExceptionFunction · 0.85
formatFunction · 0.70
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected