Commit ca5ea84a authored by Laurent Belcour's avatar Laurent Belcour

Parsing of the parametrization

parent 09321c27
......@@ -45,6 +45,36 @@ class params
public: // methods
//! \brief parse a string to provide a parametrization type.
static params::input parse_input(const std::string& txt)
{
if(txt == std::string("COS_TH"))
{
return params::COS_TH;
}
else if(txt == std::string("RUSIN_TH_TD"))
{
return params::RUSIN_TH_TD;
}
else
{
return params::UNKNOWN_INPUT;
}
}
//! \brief parse a string to provide a parametrization type.
static params::output parse_output(const std::string& txt)
{
if(txt == std::string("ENERGY"))
{
return params::ENERGY;
}
else
{
return params::UNKNOWN_OUTPUT;
}
}
//! \brief static function for input type convertion. This
//! function allocate the resulting vector.
static double* convert(const double* invec, params::input intype,
......
......@@ -72,6 +72,12 @@ void vertical_segment::load(const std::string& filename, const arguments& args)
linestream >> t ;
vs[current_vs] = t ; ++current_vs ;
}
else if(comment == std::string("PARAM_IN"))
{
}
else if(comment == std::string("PARAM_OUT"))
{
}
continue ;
}
else if(line.empty())
......
......@@ -20,7 +20,10 @@ vec phong_function::operator()(const vec& x) const
vec phong_function::value(const vec& x) const
{
vec res(dimY());
res = _kd + _ks * pow(x[0], _N);
for(int i=0; i<dimY(); ++i)
{
res[i] = _kd[i] + _ks[i] * std::pow(x[0], _N[i]);
}
return res;
}
......
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