model.elem().create(<tag>,eltype) creates a new element of type
eltype, for example
elinterp,
elpric,
elvar,
elode, and so on.
model.elem(<tag>).set(<ftag>,value) sets the field tagged
<ftag> to
value. Examples of fields and values are,
file and
solution_interp.txt,
global and
1, and so on.
model.elem(<tag>).field().create(<ftag>,"record") creates a new field tagged
<ftag> of type record under the element tagged
<tag>.
model.elem(<tag>).field(<ftag>).set(sname,value) sets the field tagged
sname to
value. The field is located under the record field tagged
<ftag>.
model.elem(<tag>).field(<ftag>).field().create(<rtag>,"record") creates a new record field tagged
<rtag> that is a field under the record field
<ftag>.
model.elem(<tag>).field().create(<atag>,"array") creates a new array field tagged
<atag>.
model.elem(<tag>).field(<atag>).pos().create("array") adds a new element of type array to the array tagged
<atag>.
model...field(<atag>).pos(1).pos().create("string","1") adds a new array element of type string with value
1 to the first array element of the array stored in the field
<atag>.
model.elem(<tag>).src().create(<fttag>) creates a
src feature tagged
<fttag> under the element. A feature must have a domain selection.
model.elem(<tag>).src(<fttag>).selection().dim(2).set(gname) assigns all domains of dimension
2 from geometry
gname to the selection of feature
<fttag>.
This complicated example creates a constr element with two constraints (usually done with constraint features):
so the set method is often a much more convenient way to create simple fields.