Model.add_elements

Model.add_elements(elements, parent=None, material=None)

Add a list of elements to the model.

Parameters:
elementslist[Element]

The elements to add.

parentElement, optional

The parent element of the elements. If None, the elements will be added directly under the root element.

materialMaterial, optional

A material to assign to the elements. Note that the material should have already been added to the model before it can be assigned.

Returns:
list[Element]

The list of elements added to the model.

Raises:
ValueError

If the parent node is not a GroupNode.

ValueError

If a material is provided that is not part of the model.