diff --git a/sources/core/params.h b/sources/core/params.h index 725fc2718428d94aaddda7861539225689c2bc2c..4dc13d221a4a003d8b68a2e0a96421a881245632 100644 --- a/sources/core/params.h +++ b/sources/core/params.h @@ -326,7 +326,8 @@ class parametrized else { std::cout << "<> an input parametrization is already defined: " << params::get_name(_in_param) << std::endl; - std::cout << "<> trying to change to: " << params::get_name(new_param) << std::endl; + std::cout << "<> changing to: " << params::get_name(new_param) << std::endl; + _in_param = new_param; } } diff --git a/sources/plugins/nonlinear_function_abc/function.cpp b/sources/plugins/nonlinear_function_abc/function.cpp index 1757323e0286d1d4f5ba5ab835c123a6321d33ff..013515545c8f5faefbca6c9f68adb688a2b4ffbb 100644 --- a/sources/plugins/nonlinear_function_abc/function.cpp +++ b/sources/plugins/nonlinear_function_abc/function.cpp @@ -143,6 +143,19 @@ void abc_function::bootstrap(const data* d, const arguments& args) _b[i] = 1.0; _c[i] = 1.0; } + + if(args.is_defined("param")) + { + setParametrization(params::parse_input(args["param"])); + } + else + { + setParametrization(params::COS_TH); + } + if(params::dimension(input_parametrization()) != 1) + { + std::cerr << "<> the parametrization specifed in the file for the ABC model is incorrect" << std::endl; + } } //! Load function specific files @@ -175,6 +188,19 @@ bool abc_function::load(std::istream& in) std::cerr << "<> parsing the stream. function name is not the next token." << std::endl; return false; } + + in >> token; + if(token.compare("#PARAM") != 0) + { + std::cerr << "<> parsing the stream. The #PARAM is not the next line defined." << std::endl; + return false; + } + in >> token; + setParametrization(params::parse_input(token)); + if(params::dimension(input_parametrization()) != 1) + { + std::cerr << "<> the parametrization specifed in the file for the ABC model is incorrect" << std::endl; + } // Parse the lobe for(int i=0; i<_nY; ++i) @@ -195,6 +221,7 @@ void abc_function::save_call(std::ostream& out, const arguments& args) const if(is_alta) { out << "#FUNC nonlinear_function_abc" << std::endl ; + out << "#PARAM " << params::get_name(input_parametrization()) << std::endl; for(int i=0; i<_nY; ++i) {