Quad4#

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

Bases: FiniteElement

Class for a four-noded linear quadrilateral element.

Methods

b_matrix_jacobian

Calculates the B matrix and jacobian at an isoparametric point for a Quad4.

calculate_element_stresses

Calculates various results for a Quad4 element given nodal displacements.

element_col_indexes

Returns the column indexes fore the global stiffness matrix.

element_load_vector

Assembles the load vector for a Quad4 element.

element_row_indexes

Returns the row indexes fore the global stiffness matrix.

element_stiffness_matrix

Assembles the stiffness matrix for a Quad4 element.

extrapolate_gauss_points_to_nodes

Returns the extrapolation matrix for a Quad4 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 a Quad4 element.

shape_functions

Returns the shape functions at a point for a Quad4 element.

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

Inits the Quad4 class.

Parameters:
  • el_idx (int) – Element index.

  • el_tag (int) – Element mesh tag.

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

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

  • material (Material) – Material of the element.

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

static shape_functions(iso_coords: tuple[float, float]) ndarray[Any, dtype[float64]][source]#

Returns the shape functions at a point for a Quad4 element.

Parameters:

iso_coords (tuple[float, float]) – Location of the point in isoparametric coordinates.

Returns:

The values of the shape functions [N1, N2, N3, N4].

Return type:

ndarray[Any, dtype[float64]]

static b_matrix_jacobian(iso_coords: tuple[float, float], coords: tuple[float, ...]) tuple[npt.NDArray[np.float64], float][source]#

Calculates the B matrix and jacobian at an isoparametric point for a Quad4.

Parameters:
  • iso_coords (tuple[float, float]) – Location of the point in isoparametric coordinates.

  • coords (tuple[float, ...]) – Flattened list of coordinates.

Raises:

RuntimeError – If the jacobian is less than zero.

Returns:

Derivatives of the shape function (B matrix) and value of the jacobian, (b_mat, j).

Return type:

tuple[npt.NDArray[np.float64], float]

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

Assembles the stiffness matrix for a Quad4 element.

Returns:

Element stiffness matrix.

Return type:

ndarray[Any, dtype[float64]]

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

Assembles the load vector for a Quad4 element.

Parameters:

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

Returns:

Element load vector.

Return type:

ndarray[Any, dtype[float64]]

calculate_element_stresses(u: ndarray[Any, dtype[float64]]) ElementResults[source]#

Calculates various results for a Quad4 element given nodal displacements.

Calculates the following:

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

  • TODO

Parameters:

u (ndarray[Any, dtype[float64]]) – Displacement vector for the element.

Returns:

Element results object.

Return type:

ElementResults

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

Returns the extrapolation matrix for a Quad4 element.

Returns:

Extrapolation matrix.

Return type:

ndarray[Any, dtype[float64]]

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

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

Returns:

List of node indexes and exterior coordinates

Return type:

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

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

Returns a list of triangle indexes for a Quad4 element.

Returns:

List of triangle indexes.

Return type:

list[tuple[int, int, int]]

element_col_indexes() list[int]#

Returns the column indexes fore the global stiffness matrix.

Returns:

Column indexes.

Return type:

list[int]

element_row_indexes() list[int]#

Returns the row indexes fore the global stiffness matrix.

Returns:

Row indexes.

Return type:

list[int]