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

Method calc_range

src/CoolPropPlot.cpp:239–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239void Isoline::calc_range(std::vector<double>& xvals, std::vector<double>& yvals) {
240 if (key_ == CoolProp::iQ) {
241 calc_sat_range(static_cast<int>(xvals.size()));
242 } else {
243 int ipos = 0, xpos = 0, ypos = 0, pair = 0;
244 update_pair(ipos, xpos, ypos, pair);
245
246 std::vector<double> ivals(xvals.size(), value);
247 std::vector<int> order = {ipos, xpos, ypos};
248 std::vector<CoolProp::parameters> idxs(3);
249 idxs[ipos] = key_;
250 idxs[xpos] = xkey_;
251 idxs[ypos] = ykey_;
252 std::vector<std::vector<double>> vals(3);
253 vals[ipos] = ivals;
254 vals[xpos] = xvals;
255 vals[ypos] = yvals;
256
257 for (size_t i = 0; i < vals[2].size(); ++i) {
258 try {
259 state_->update((CoolProp::input_pairs)pair, vals[0][i], vals[1][i]);
260 vals[2][i] = state_->keyed_output(idxs[2]);
261 } catch (...) {
262 vals[2][i] = Detail::NaN;
263 }
264 }
265
266 for (size_t i = 0; i < idxs.size(); ++i) {
267 if (idxs[i] == xkey_) x = vals[i];
268 if (idxs[i] == ykey_) y = vals[i];
269 }
270 }
271}
272
273PropertyPlot::PropertyPlot(const std::string& fluid_name, CoolProp::parameters ykey, CoolProp::parameters xkey, TPLimits tp_limits)
274 : xkey_(xkey), ykey_(ykey) {

Callers 1

calc_isolinesMethod · 0.45

Calls 3

keyed_outputMethod · 0.80
sizeMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected