| 911 | } |
| 912 | |
| 913 | EXPORT_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 | |
| 941 | EXPORT_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, |
nothing calls this directly
no test coverage detected