12.07.2015 Views

DOLFIN User Manual - FEniCS Project

DOLFIN User Manual - FEniCS Project

DOLFIN User Manual - FEniCS Project

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>DOLFIN</strong> <strong>User</strong> <strong>Manual</strong>Hoffman, Jansson, Logg, Wellsbeing modified. An error message is printed through the log system if thereis no parameter with the given key in the database.The following examples illustrate the use of set():set(‘‘tolerance’’, 0.01);set(‘‘number of samples’’, 10);set(‘‘solve dual problem’’, true);set(‘‘file name’’, ‘‘solution.xml’’);Note that changing the values of parameters using set() does not changethe values of already retrieved parameters; it only changes the values ofparameters in the database. Thus, the value of a parameter must be changedbefore using a component that is controlled by the parameter in question.11.3 Adding a new parameterTo add a parameter to the database, use the function add() available in thedolfin namespace:void add(std::string key, Parameter value);This function accepts two arguments: a unique key identifying the new parameterand the value of the new parameter.The following examples illustrate the use of add():add(‘‘tolerance’’, 0.01);add(‘‘number of samples’’, 10);add(‘‘solve dual problem’’, true);add(‘‘file name’’, ‘‘solution.xml’’);75

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!