General Commands > About General Commands > model.init()

model.init()
Creating and defining initial values.
Syntax
model.init().create(<tag>);
model.init(<tag>).set(<fieldname>,<expr>);
model.init(<tag>).remove(<fieldname>);
 
model.init(<tag>).varnames();
model.init(<tag>).get(<fieldname>);
Description
model.init().create(<tag>) creates a new initial value with tag <tag>.
model.init(<tag>).set(<fieldname>,<expr>) defines the expression <expr> as the initial value for the dependent variable (field variable) <fieldname>.
model.init(<tag>).remove(<fieldname>) removes the field variable <fieldname> from the initial value with tag <tag>.
model.init(<tag>).selection().named(<seltag>) assigns the initial value to the named selection <seltag>.
model.init(<tag>).selection().set(...) defines a local selection that assigns the initial value to geometric entities. For a complete list of methods available under selection(), see Selections. Only selections at a single geometry level is allowed except for ODE states which require the global selection.
model.init(<tag>).varnames() returns the names of the variables for the initial value with tag <tag> as a string array.
model.init(<tag>).get(<fieldname>) returns the initial value for the field variable <fieldname> as a string.
model.init(<tag>).selection().named() returns the named selection tag.
model.init(<tag>).selection().getType() returns domain information for the initial value with tag <tag>; see Selections for available methods.