Model.add_element

Model.add_element(element, parent=None, material=None)

Add an element to the model.

Parameters:
elementElement

The element to add.

parentElement, optional

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

materialMaterial, optional

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

Returns:
Element

The element 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.