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:
objectAbstract base class for a plane-stress finite element.
Methods
Calculates the B matrix and jacobian at an isoparametric point.
Assembles the load vector for the element.
Assembles the stiffness matrix for the element.
Gaussian weights and locations for
n_pointGaussian integration.Calculates various results for the finite element given nodal displacements.
Returns a list of triangle indices for the finite element.
Converts a point in isoparametric coordinates to global coordinates.
Returns the values of the isoparametric coordinates at the nodes.
Returns the shape functions at a point.
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.ndarrayof 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_pointGaussian integration.- Parameters:
n_points (int) – Number of gauss points.
- Raises:
NotImplementedError – If this method hasn’t been implemented for an element.
- Return type:
- static shape_functions(iso_coords: tuple[float, float, float]) ndarray[Any, dtype[float64]][source]#
Returns the shape functions at a point.
- 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.
- iso_to_global(iso_coords: tuple[float, float, float]) tuple[float, float][source]#
Converts a point in isoparametric coordinates to global coordinates.
- 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:
- 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.
- element_stiffness_matrix() ndarray[Any, dtype[float64]][source]#
Assembles the stiffness matrix for the element.
- element_load_vector() ndarray[Any, dtype[float64]][source]#
Assembles the load vector for the element.
- 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