From 6a7ed0f440acdb05da9eba5fdfc6abefe106303b Mon Sep 17 00:00:00 2001 From: Ian Bell <ian.bell@nist.gov> Date: Sat, 5 Nov 2022 10:34:11 -0400 Subject: [PATCH] vdW check array lengths --- include/teqp/models/vdW.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/teqp/models/vdW.hpp b/include/teqp/models/vdW.hpp index 214444b..0096bf1 100644 --- a/include/teqp/models/vdW.hpp +++ b/include/teqp/models/vdW.hpp @@ -65,6 +65,9 @@ public: /// \note All interaction parameters are set to default value of zero and cannot currently be tuned vdWEOS(const std::valarray<NumType>& Tc_K, const std::valarray<NumType>& pc_Pa) { + if (Tc_K.size() != pc_Pa.size()){ + throw teqp::InvalidArgument("Sizes of Tc_K " + std::to_string(Tc_K.size()) + " and pc_Pa" + std::to_string(pc_Pa.size()) + " do not agree") + } ai.resize(Tc_K.size()); bi.resize(Tc_K.size()); for (auto i = 0; i < Tc_K.size(); ++i) { -- GitLab