Element

Class for handling element related data.

class qd.cae.dyna.Element

Examples

Get elements by

>>> from qd.cae.dyna import *
>>> femfile = D3plot("path/to/d3plot")
>>> element_list = femfile.get_elements()
>>> shells = femfile.get_elements(Element.shell)
>>> id = 1
>>> element = femfile.get_elementByID(Element.solid, id)

Methods

get_coords()

Get the elements coordinates (mean of nodes).

get_energy()

Get the energy of the element, if it was read with d3plot.read_states.

get_estimated_size()

Get the average element edge size of the element.

get_history_variables()

Get the loaded history variables of the element.

get_id()

Get the id of the element.

get_node_ids()

Returns

get_nodes()

Get the nodes of the element.

get_part_id()

Returns

get_plastic_strain()

Get the plastic strain of the element, if it was read with d3plot.read_states.

get_strain()

Get the strain tensor of the element, if it was read with d3plot.read_states.

get_stress()

Get the stress tensor of the element, if it was read with d3plot.read_states.

get_stress_mises()

Get the mises stress of the element, if it was read with d3plot.read_states.

get_type()

Get the type of the element.

is_rigid()

Get the status, whether the element is a rigid (flag for shells only).

type

Element types:

get_coords()

Get the elements coordinates (mean of nodes).

Returns
coordsnp.ndarray

coordinate vector (nTimesteps x 3)

Notes

Returns an empty vector, if the element has no nodes.

Examples

>>> d3plot = D3plot("path/to/d3plot")
>>> element = d3plot.get_elementByIndex(Element.shell, 1)
>>> element.get_coords().shape
(1L, 3L)
>>> # load disp
>>> d3plot.read_states("disp")
>>> element.get_coords().shape
(34L, 3L)
get_energy()

Get the energy of the element, if it was read with d3plot.read_states.

Returns
energynp.ndarray

time series of element energy

Examples

>>> element.get_energy().shape
(34L,)
get_estimated_size()

Get the average element edge size of the element.

Returns
sizefloat

average element edge size

Examples

>>> element.get_estimated_size()
2.542
get_history_variables()

Get the loaded history variables of the element.

Returns
history_varsnp.ndarray

time series of the loaded history variables

Notes

The history variable column index corresponds to the order in which the variables were loaded

Examples

>>> d3plot = D3plot("path/to/d3plot",read_states="history 1 shell max")
>>> d3plot.get_elementByID(Element.shell, 1).get_history_variables().shape
(34L, 1L)
get_id()

Get the id of the element.

Returns
idint

id of the element

Examples

>>> d3plot.get_elementByID(Element.shell, 1).get_id()
1
get_node_ids()
Returns
node_idslist of int

list of node ids belonging to the element

Examples

>>> d3plot = D3plot("path/to/d3plot")
>>> element = d3plot.get_elementByID(Element.shell, 1)
>>> element.get_node_ids()
[1, 55, 21, 33]
get_nodes()

Get the nodes of the element.

Returns
nodeslist(Node)

nodes of the element

Examples

>>> elem_nodes = element.get_nodes()
get_part_id()
Returns
part_idint

id of the part, to which the element belongs

Examples

>>> d3plot = D3plot("path/to/d3plot")
>>> part = d3plot.get_partByID(1)
>>> element = part.get_elements()[0]
>>> element.get_part_id()
1
get_plastic_strain()

Get the plastic strain of the element, if it was read with d3plot.read_states.

Returns
plastic_strainnp.ndarray

time series of plastic strain

Examples

>>> element.get_plastic_strain().shape
(34L,)
get_strain()

Get the strain tensor of the element, if it was read with d3plot.read_states. The strain vector contains the matrix components: [e_xx, e_yy, e_zz, e_xy, e_yz, e_xz]

Returns
strainnp.ndarray

time series of the strain tensor data

Examples

>>> element.get_strain().shape
(34L, 6L)
get_stress()

Get the stress tensor of the element, if it was read with d3plot.read_states. The stress vector contains the matrix components: [s_xx, s_yy, s_zz, s_xy, s_yz, s_xz]

Returns
stressnp.ndarray

time series of the stress tensor data

Examples

>>> element.get_stress().shape
(34L, 6L)
get_stress_mises()

Get the mises stress of the element, if it was read with d3plot.read_states.

Returns
stressnp.ndarray

time series of the mises stress

Examples

>>> element.get_stress_mises().shape
(34L,)
get_type()

Get the type of the element.

Returns
element_typeElement.type

Element.beam, Element.shell or Element.solid

Examples

>>> d3plot.get_elementByID(Element.beam, 1).get_type()
type.beam
>>> d3plot.get_elementByID(Element.shell, 1).get_type()
type.shell
>>> d3plot.get_elementByID(Element.solid, 1).get_type()
type.solid
>>> d3plot.get_elementByID(Element.tshell, 1).get_type()
type.tshell
is_rigid()

Get the status, whether the element is a rigid (flag for shells only). Rigid shells have no state data!

Returns
is_rigidbool

rigid status of the element

Examples

>>> d3plot = D3plot("path/to/d3plot", read_states="stress_mises max")
>>> elem1 = d3plot.get_elementByID(Element.shell, 451)
>>> elem1.is_rigid()
False
>>> elem1.get_stress_mises().shape
(34L,)
>>> elem2 = d3plot.get_elementByID(Element.shell, 9654)
>>> elem2.is_rigid()
True
>>> elem2.get_stress_mises().shape # rigid shells lack state data
(0L,)
class type
Element types:
  • Element.type.none (only used for filtering)

  • Element.type.beam

  • Element.type.shell

  • Element.type.solid

  • Element.type.tshell