Finite Element Analysis¶
FiniteElementAnalysis¶
- class
feastruct.fea.fea.FiniteElementAnalysis(nodes, elements, nfa)[source]¶Parent class for a finite element analysis.
Establishes a template for each different type of finite element analysis, e.g. frame, membrane, plate etc. and provides a number of generic methods which are useful for all types of analyses.
Variables:
- nodes (list[
Node]) – Nodes used in the finite element analysis- elements (list[
FiniteElement]) – Elements used in the finite element analysis- nfa (list[bool]) – Node freedom arrangement
__init__(nodes, elements, nfa)[source]¶Inits the FiniteElementAnalysis class.
Parameters:
- nodes (list[
Node]) – List of nodes with which to initialise the class- elements (list[
FiniteElement]) – List of elements with which to initialise the class- nfa (list[bool]) – Node freedom arrangement
create_element(element)[source]¶Creates a finite element and adds it to the Fea object.
Creates and returns a
FiniteElementobject ands adds it to theFeaobject.
Parameters: element ( FiniteElement) – Element to be added to the analysis objectReturns: Element object Return type: FiniteElement
FiniteElement¶
- class
feastruct.fea.fea.FiniteElement(nodes, material, efs)[source]¶Parent class for a finite element.
Establishes a template for each different type of finite element, e.g. frame element, membrane element, plate element etc. and provides a number of generic methods which are useful for all types of elements.
Variables:
- nodes (list[
Node]) – List of node objects that define the geometry of the finite element- material (
Material) – Material object for the element- efs (list[bool]) – Element freedom signature
- f_int (list[
ForceVector]) – List of internal force vector results stored for each analysis case
apply_nfa()[source]¶Applies the element freedom signature to all nodes in the element to generate a node freedom allocation.
get_buckling_results(analysis_case, buckling_mode=0)[source]¶Returns the eigenvalue corresponding to the buckling analysis defined by the analysis_case and the buckling_mode. Also returns an array of eigenvector values corresponding to each degree of freedom in the finite element.
Parameters:
- analysis_case (
AnalysisCase) – Analysis case relating to the buckling analysis- buckling_mode (int) – Buckling mode number
Returns: Eigenvalue and eigenvectors (w, v). A tuple containing the eigenvalue w and an (n_nodes x n_dof) array of eigenvector values v.
Return type: tuple(float,
numpy.ndarray)
get_dofs()[source]¶Finds and returns a list of DoF objects corresponding to the degrees of freedom of the finite element.
Returns: A list of DoF objects, with a length of (n_nodes x n_dof) Return type: list[list[ DoF]]
get_fint(analysis_case)[source]¶Returns the internal force vector relating to an
AnalysisCase.
Parameters: analysis_case ( AnalysisCase) – Analysis case relating to the internal force vectorReturns: Internal force vector Return type: numpy.ndarrayRaises: Exception – If the force vector cannot be found for the analysis_case
get_frequency_results(analysis_case, frequency_mode=0)[source]¶Returns the eigenvalue corresponding to the frequency analysis defined by the analysis_case and the frequency_mode. Also returns an array of eigenvector values corresponding to each degree of freedom in the finite element.
Parameters:
- analysis_case (
AnalysisCase) – Analysis case relating to the frequency analysis- frequency_mode (int) – Frequency mode number
Returns: Eigenvalue and eigenvectors (w, v). A tuple containing the eigenvalue w and an (n_nodes x n_dof) array of eigenvector values v.
Return type: tuple(float,
numpy.ndarray)
get_gdof_nums()[source]¶Returns an array of global degree of freedom numbers corresponding to the degrees of freedom of the finite element.
Returns: A integer array of global degrees of freedom, with a length of (1 x n), where n is n_nodes x n_dof Return type: numpy.ndarray
get_geometric_stiff_matrix(analysis_case)[source]¶Placeholder for the get_geometric_stiff_matrix method.
Gets the geometric stiffness matrix for a FiniteElement.
Parameters: analysis_case ( AnalysisCase) – Analysis case from which to extract the axial forceReturns: Element geometric stiffness matrix Return type: numpy.ndarray
get_internal_actions(analysis_case)[source]¶Returns the internal actions for a FiniteElement.
Parameters: analysis_case ( AnalysisCase) – Analysis caseReturns: An array containing the internal actions for the element Return type: numpy.ndarray
get_mass_matrix()[source]¶Placeholder for the get_mass_matrix method.
Gets the mass matrix for a for a FiniteElement.
Returns: Element mass matrix Return type: numpy.ndarray
get_ndof()[source]¶Returns the number of active degrees of freedom for the element.
Returns: Number of active degrees of freedom for the element Return type: int
get_nodal_displacements(analysis_case)[source]¶Returns an array of the nodal displacements for each degree of freedom in the finite element for the analysis_case.
Parameters: analysis_case ( AnalysisCase) – Analysis case relating to the displacementReturns: An (n_nodes x n_dof) array of degree of freedom displacements Return type: numpy.ndarray
get_node_coords()[source]¶Returns a NumPy array of the cartesian coordinates defining the geometry of the finite element.
Returns: An (n x 3) array of node coordinates, where n is the number of nodes for the given finite element Return type: numpy.ndarray
get_shape_function(xi)[source]¶Placeholder for the get_shape_function method.
Returns the value of the shape functions at xi.
Parameters: xi (float) – Position along the element Returns: Value of the shape functions at xi Return type: numpy.ndarray
get_stiffness_matrix()[source]¶Placeholder for the get_stiffness_matrix method.
Gets the stiffness matrix for a FiniteElement.
Returns: 6 x 6 element stiffness matrix Return type: numpy.ndarray
save_fint(f, analysis_case)[source]¶Adds an internal force vector result to the
FiniteElement.
Parameters:
- f (
numpy.ndarray) – Internal force vector- analysis_case (
AnalysisCase) – Analysis case relating to the internal force vector
ForceVector¶
- class
feastruct.fea.fea.ForceVector(f, analysis_case)[source]¶Class for storing a force vector for a finite element.
Variables:
- f – Force vector (n x 1), where n is the number of dofs within the element
- analysis_case (
AnalysisCase) – Analysis case relating to the displacementVartype:
numpy.ndarray
__init__(f, analysis_case)[source]¶Inits the ForceVector class.
Variables: f – Force vector (n x 1), where n is the number of dofs within the element Vartype: numpy.ndarrayParameters: analysis_case ( AnalysisCase) – Analysis case relating to the displacement