FiniteElement#

class planestress.analysis.finite_elements.finite_element.FiniteElement(el_idx: int, el_tag: int, coords: npt.NDArray[np.float64], node_idxs: list[int], material: Material, orientation: bool, num_nodes: int, int_points: int)[source]#

Bases: object

Abstract base class for a plane-stress finite element.

Methods

calculate_element_stresses

Calculates various results for the finite element given nodal displacements.

element_col_indexes

Returns the column indexes fore the global stiffness matrix.

element_load_vector

Assembles the load vector for the element.

element_row_indexes

Returns the row indexes fore the global stiffness matrix.

element_stiffness_matrix

Assembles the stiffness matrix for the element.

get_polygon_coordinates

Returns a list of coordinates and indexes that define the element exterior.

get_triangulation

Returns a list of triangle indexes for the finite element.

__init__(el_idx: int, el_tag: int, coords: npt.NDArray[np.float64], node_idxs: list[int], material: Material, orientation: bool, num_nodes: int, int_points: int) None[source]#

Inits the FiniteElement class.

Parameters:
  • el_idx (int) – Element index.

  • el_tag (int) – Element mesh tag.

  • coords (npt.NDArray[np.float64]) – A numpy.ndarray of coordinates defining the element, e.g. [[x1, x2, x3], [y1, y2, y3]].

  • node_idxs (list[int]) – List of node indexes defining the element, e.g. [idx1, idx2, idx3].

  • material (Material) – Material of the element.

  • orientation (bool) – If True the element is oriented correctly, if False the element’s nodes will need reordering.

  • num_nodes (int) – Number of nodes in the finite element.

  • int_points (int) – Number of integration points used for the finite element.

element_row_indexes() list[int][source]#

Returns the row indexes fore the global stiffness matrix.

Returns:

Row indexes.

Return type:

list[int]

element_col_indexes() list[int][source]#

Returns the column indexes fore the global stiffness matrix.

Returns:

Column indexes.

Return type:

list[int]

element_stiffness_matrix() ndarray[Any, dtype[float64]][source]#

Assembles the stiffness matrix for the element.

Raises:

NotImplementedError – If this method hasn’t been implemented

Return type:

ndarray[Any, dtype[float64]]

element_load_vector(acceleration_field: tuple[float, float]) ndarray[Any, dtype[float64]][source]#

Assembles the load vector for the element.

Parameters:

acceleration_field (tuple[float, float]) – Acceleration field (a_x, a_y).

Raises:

NotImplementedError – If this method hasn’t been implemented

Return type:

ndarray[Any, dtype[float64]]

calculate_element_stresses(u: npt.NDArray[np.float64]) ElementResults[source]#

Calculates various results for the finite element given nodal displacements.

Calculates the following:

  • Stress components at the nodes (:math`sigma_{xx}`, :math`sigma_{yy}`, :math`sigma_{xy}`).

  • TODO

Parameters:

u (npt.NDArray[np.float64]) – Displacement vector for the element.

Raises:

NotImplementedError – If this method hasn’t been implemented

Return type:

ElementResults

get_polygon_coordinates() tuple[list[int], ndarray[Any, dtype[float64]]][source]#

Returns a list of coordinates and indexes that define the element exterior.

Raises:

NotImplementedError – If this method hasn’t been implemented for an element.

Return type:

tuple[list[int], ndarray[Any, dtype[float64]]]

get_triangulation() list[tuple[int, int, int]][source]#

Returns a list of triangle indexes for the finite element.

Raises:

NotImplementedError – If this method hasn’t been implemented for an element.

Return type:

list[tuple[int, int, int]]