Commit 3ca4a521 authored by Laurent Belcour's avatar Laurent Belcour

Currently working on the input parametrization

parent f4b15b4c
......@@ -128,11 +128,21 @@ class function
//! defined one.
virtual void setParametrization(params::input new_param)
{
if(_in_param == new_param || _in_param == params::UNKNOWN_INPUT)
//! \todo Here is something strange happening. The equality between
//! those enums is not correct for UNKNOWN_INPUT
if(_in_param == new_param)
{
return;
}
else if(_in_param == params::UNKNOWN_INPUT)
{
_in_param = new_param;
}
else
throw("A parametrization is already defined");
{
std::cout << "<<ERROR>> a parametrization is already defined: " << params::get_name(_in_param) << std::endl;
std::cout << "<<ERROR>> trying to change to: " << params::get_name(new_param) << std::endl;
}
}
//! \brief can set the output parametrization of a non-parametrized
......@@ -143,8 +153,9 @@ class function
if(_out_param == new_param || _out_param == params::UNKNOWN_OUTPUT)
_out_param = new_param;
else
throw("A parametrization is already defined");
{
std::cout << "<<ERROR>> A parametrization is already defined: " << params::get_name(_in_param) << std::endl;
}
}
protected: // function
......
......@@ -211,7 +211,7 @@ params::input params::parse_input(const std::string& txt)
}
}
std::cout << "<<ERROR>> the input parametrization in unknown" << std::endl;
std::cout << "<<INFO>> the input parametrization is UNKNOWN_INPUT" << std::endl;
return params::UNKNOWN_INPUT;
}
......@@ -223,7 +223,7 @@ std::string params::get_name(const params::input param)
return it->second.name;
}
return std::string();
return std::string("UNKNOWN_INPUT");
}
int params::dimension(params::input t)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment