From e10b95b29ca157b6a2299f76360e16a91416996b Mon Sep 17 00:00:00 2001 From: Ian Bell <ian.bell@nist.gov> Date: Fri, 4 Nov 2022 18:03:35 -0400 Subject: [PATCH] Fix snippets --- interface/CPP/test_teqpcpp.cpp | 8 -------- src/sat_Z_accuracy.cpp | 4 ++++ src/teqp_profile.cpp | 2 +- src/test_LennardJones.cpp | 5 +++-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/interface/CPP/test_teqpcpp.cpp b/interface/CPP/test_teqpcpp.cpp index c5f5063..cccc85f 100644 --- a/interface/CPP/test_teqpcpp.cpp +++ b/interface/CPP/test_teqpcpp.cpp @@ -23,7 +23,6 @@ int main() { }}; //std::cout << j.dump(2); auto am = teqp::cppinterface::make_model(j); - auto am2 = teqp::cppinterface::make_vdW1(2, 3); auto z = (Eigen::ArrayXd(2) << 0.5, 0.5).finished(); double Ar01 = am->get_Arxy(0, 1, 300, 3, z); @@ -45,11 +44,4 @@ int main() { const auto& p = std::get<teqp::multifluid_t>(am->get_model()); std::cout << p.get_meta() << std::endl; - try{ - std::cout << am->get_m() << std::endl; - } - catch(std::exception&e){ - std::cout << e.what() << std::endl; - std::cout << "This fails, as it should because the model is not a PCSAFT one" << std::endl; - } } diff --git a/src/sat_Z_accuracy.cpp b/src/sat_Z_accuracy.cpp index 7c479a6..3d0fa50 100644 --- a/src/sat_Z_accuracy.cpp +++ b/src/sat_Z_accuracy.cpp @@ -10,6 +10,10 @@ #undef REFPROP_FUNCTION_MODIFIER #undef REFPROP_IMPLEMENTATION +#if !defined(TEQP_MULTIPRECISION_ENABLED) +#error "TEQP_MULTIPRECISION_ENABLED must be turned on" +#endif + #include <iostream> #include <valarray> diff --git a/src/teqp_profile.cpp b/src/teqp_profile.cpp index e50cbad..2aaa490 100644 --- a/src/teqp_profile.cpp +++ b/src/teqp_profile.cpp @@ -60,7 +60,7 @@ int main() { for (auto j = 0; j < N; ++j) { x1 += j * 1e-10; //auto f_Ar01 = [&x1, &x2, &c](auto& model) { using tdx = TDXDerivatives<decltype(model), decltype(x1), decltype(c)>; return tdx::get_Ar02(model, x1, x2, c); }; - auto v = mc.caller(4, [&x1, &x2, &c](auto& model) { using tdx = TDXDerivatives<decltype(model), decltype(x1), decltype(c)>; return tdx::get_Ar0n<3>(model, x1, x2, c); }); + auto v = mc.caller(4, [&x1, &x2, &c](auto& model) { using tdx = TDXDerivatives<decltype(model), decltype(x1), decltype(c)>; return tdx::template get_Ar0n<3>(model, x1, x2, c); }); //std::cout << v << std::endl; } } diff --git a/src/test_LennardJones.cpp b/src/test_LennardJones.cpp index 2c9648a..ff252a5 100644 --- a/src/test_LennardJones.cpp +++ b/src/test_LennardJones.cpp @@ -104,7 +104,8 @@ int main() { auto m = teqp::build_model(j); for (auto& el : data) { - auto [T, rho, p, ur, cvr, w, a] = el; // I + auto [T_, rho_, p, ur, cvr, w, a] = el; + double T = T_, rho = rho_; // It is not possible to capture tuple-unpacked variables auto NT = 0, ND = 0; @@ -148,4 +149,4 @@ int main() { std::cout << "ur: " << urcalc << ", " << ur << std::endl; std::cout << "cvr: " << cvrcalc << ", " << cvr << std::endl; } -} \ No newline at end of file +} -- GitLab