ElementAdder#

class ansys.dpf.core.elements.ElementAdder#

Provides for adding new elements in a meshed region.

Parameters:
  • id (int) – ID to assign to the new element.

  • shape (str) – Shape of the element. Options are "solid", "shell", "beam" and "unknown_shape".

  • connectivity (list) – List of the node indices to connect to the new element.

Examples

Create a meshed region from scratch.

>>> import ansys.dpf.core as dpf
>>> meshed_region = dpf.MeshedRegion(num_nodes=4, num_elements=1)
>>> i=0
>>> for node in meshed_region.nodes.add_nodes(4):
...     node.id = i+1
...     node.coordinates = [float(i), float(i), 0.0]
...     i=i+1
>>> for element in meshed_region.elements.add_elements(1):
...     element.id=1
...     element.connectivity = range(0,4)
...     element.is_shell=True #or is_solid, is_beam, is_point

Overview#

is_solid

Whether the element is a solid.

is_shell

Whether the element is a shell.

is_beam

Whether the element is a beam.

is_point

Whether the element is a point.

shape

Shape of the element.

Import detail#

from ansys.dpf.core.elements import ElementAdder

Property detail#

property ElementAdder.is_solid: bool#

Whether the element is a solid.

Return type:

bool

property ElementAdder.is_shell: bool#

Whether the element is a shell.

Return type:

bool

property ElementAdder.is_beam: bool#

Whether the element is a beam.

Return type:

bool

property ElementAdder.is_point: bool#

Whether the element is a point.

Return type:

bool

property ElementAdder.shape: str#

Shape of the element.

Returns:

Shape of the element. Options are "solid", "shell", "beam" and "unknown_shape".

Return type:

str

Attribute detail#

ElementAdder.id = 0#
ElementAdder.connectivity = [0]#