set default parameters

16 views
Skip to first unread message

topolo...@gmail.com

unread,
Oct 5, 2017, 11:39:50 AM10/5/17
to deal.II User Group
Hi everyone,

I am working on a application of dealii, and here is the question:

I want to use ParameterHandler::set() function to overwrite the parameters read from .prm files or just set these parameters. Some types of parameters can be done in this way like double&, bool& cause dealii has already developed these method:

void set (const std::string &entry_name, const std::string &new_value)
 
void set (const std::string &entry_name, const char *new_value)
 
void set (const std::string &entry_name, const long int &new_value)
 
void set (const std::string &entry_name, const double &new_value)
 
void set (const std::string &entry_name, const bool &new_value)

But, for parameter type as patterns::list(), how can I set the value of it? Because there is no ParameterHandler::set() to set parameter which has a type of patterns::list().

If you guys know how to solve this question, please tell me, thank you very much.

Wei

Wolfgang Bangerth

unread,
Oct 5, 2017, 11:44:21 AM10/5/17
to dea...@googlegroups.com
On 10/05/2017 09:39 AM, topolo...@gmail.com wrote:
>
> But, for parameter type as patterns::list(), how can I set the value of
> it? Because there is no ParameterHandler::set() to set parameter which
> has a type of patterns::list().
>
> If you guys know how to solve this question, please tell me, thank you
> very much.

You'll have to set the value as a std::string. This is how it's stored
internally anyway.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
Reply all
Reply to author
Forward
0 new messages