Improve error message for invalid udq_cast()
This commit is contained in:
parent
0f28d7c199
commit
82afbf070c
@ -19,6 +19,7 @@
|
|||||||
#include <fnmatch.h>
|
#include <fnmatch.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <fmt/format.h>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp>
|
||||||
|
|
||||||
@ -485,8 +486,10 @@ UDQSet udq_cast(const UDQSet& lhs, const UDQSet& rhs)
|
|||||||
{
|
{
|
||||||
if (lhs.size() != rhs.size()) {
|
if (lhs.size() != rhs.size()) {
|
||||||
if (lhs.var_type() != UDQVarType::SCALAR) {
|
if (lhs.var_type() != UDQVarType::SCALAR) {
|
||||||
printf("s1: %ld s2: %ld \n", lhs.size(), rhs.size());
|
auto msg = fmt::format("Type/size mismatch when combining UDQs {}(size={}, type={}) and {}(size={}, type={})",
|
||||||
throw std::logic_error("Type/size mismatch");
|
lhs.name(), lhs.size(), lhs.var_type(),
|
||||||
|
rhs.name(), rhs.size(), rhs.var_type());
|
||||||
|
throw std::logic_error(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rhs.var_type() == UDQVarType::WELL_VAR)
|
if (rhs.var_type() == UDQVarType::WELL_VAR)
|
||||||
|
Loading…
Reference in New Issue
Block a user