FiniteElement#

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

Bases: object

Abstract base class for a plane-stress finite element.

Methods

b_matrix_jacobian

Calculates the B matrix and jacobian at an isoparametric point.

element_load_vector

Assembles the load vector for the element.

element_stiffness_matrix

Assembles the stiffness matrix for the element.

gauss_points

Gaussian weights and locations for n_point Gaussian integration.

get_element_results

Calculates various results for the finite element given nodal displacements.

get_triangulation

Returns a list of triangle indices for the finite element.

iso_to_global

Converts a point in isoparametric coordinates to global coordinates.

nodal_isoparametric_coordinates

Returns the values of the isoparametric coordinates at the nodes.

shape_functions

Returns the shape functions at a point.

shape_functions_derivatives

Returns the derivatives of the shape functions at a point.

__init__(el_idx: int, el_tag: int, coords: npt.NDArray[np.float64], node_idxs: list[int], material: Material, 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.

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

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

gauss_points(n_points: int) ndarray[Any, dtype[float64]][source]#

Gaussian weights and locations for n_point Gaussian integration.

Parameters:

n_points (int) – Number of gauss points.

Raises:

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

Return type:

ndarray[Any, dtype[float64]]

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

Returns the shape functions at a point.

Parameters:

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

Raises:

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

Return type:

ndarray[Any, dtype[float64]]

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

Returns the derivatives of the shape functions at a point.

Parameters:

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

Raises:

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

Return type:

ndarray[Any, dtype[float64]]

iso_to_global(iso_coords: tuple[float, float, float]) tuple[float, float][source]#

Converts a point in isoparametric coordinates to global coordinates.

Parameters:

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

Returns:

Location of the point in global coordinates (x, y).

Return type:

tuple[float, float]

static nodal_isoparametric_coordinates() ndarray[Any, dtype[float64]][source]#

Returns the values of the isoparametric coordinates at the nodes.

Raises:

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

Return type:

ndarray[Any, dtype[float64]]

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

Calculates the B matrix and jacobian at an isoparametric point.

Parameters:

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

Raises:

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

Return type:

tuple[ndarray[Any, dtype[float64]], float]

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

Assembles the stiffness matrix for the element.

Returns:

Element stiffness matrix.

Return type:

ndarray[Any, dtype[float64]]

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

Assembles the load vector for the element.

Returns:

Element load vector.

Return type:

ndarray[Any, dtype[float64]]

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

Calculates various results for the finite element given nodal displacements.

Calculates the following:

  • Stresses at nodes

  • TODO

Parameters:

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

Returns:

ElementResults object.

Return type:

ElementResults

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

Returns a list of triangle indices for the finite element.

Raises:

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

Return type:

list[tuple[int, int, int]]