pycufsm.solve.analysis_p ======================== .. py:module:: pycufsm.solve.analysis_p Functions --------- .. autoapisummary:: pycufsm.solve.analysis_p.m_sort pycufsm.solve.analysis_p.constr_BC_flag pycufsm.solve.analysis_p.elem_prop pycufsm.solve.analysis_p.k_kg_global pycufsm.solve.analysis_p.k_kg_local pycufsm.solve.analysis_p.kglobal_transv pycufsm.solve.analysis_p.klocal_transv pycufsm.solve.analysis_p.calc_km_mp pycufsm.solve.analysis_p.calc_kf_mp pycufsm.solve.analysis_p.calc_gm_mp pycufsm.solve.analysis_p.calc_gf_mp pycufsm.solve.analysis_p.bc_i1_5 pycufsm.solve.analysis_p.trans pycufsm.solve.analysis_p.assemble pycufsm.solve.analysis_p.assemble_single pycufsm.solve.analysis_p.spring_klocal pycufsm.solve.analysis_p.bc_i1_5_atpoint pycufsm.solve.analysis_p.spring_assemble pycufsm.solve.analysis_p.ym_at_ys pycufsm.solve.analysis_p.ymprime_at_ys Module Contents --------------- .. py:function:: m_sort(m_all: numpy.ndarray) -> numpy.ndarray Cleans up longitudinal terms by removing any zero terms, removing any duplicates, and sorting Args: m_all (np.ndarray): list of all longitudinal terms for each half-wavelength Returns: m_all (np.ndarray): cleaned list of all longitudinal terms for each half-wavelength .. py:function:: constr_BC_flag(nodes: numpy.ndarray, constraints: numpy.ndarray) -> int this subroutine is to determine flags for user constraints and internal (at node) B.C.'s Args: nodes (np.ndarray): [node# x y dof_x dof_y dof_z dof_r stress] n_nodes x 8 constraints (np.ndarray): [node# e dof_e coeff node# k dof_k] e=dof to be eliminated k=kept dof dofe_node = coeff*dofk_nodek Returns: BC_flag (int): 1 if there are user constraints or node fixities 0 if there is no user constraints and node fixities Z. Li, June 2010 .. py:function:: elem_prop(nodes: numpy.ndarray, elements: numpy.ndarray) -> numpy.ndarray creates a matrix of element properties for each element (width and slope) Args: nodes (np.ndarray): standard nodes array elements (np.ndarray): standard elements array Returns: el_props (np.ndarray): [id, width, alpha] .. py:function:: k_kg_global(nodes: numpy.ndarray, elements: numpy.ndarray, el_props: numpy.ndarray, props: numpy.ndarray, length: float, B_C: str, m_a: numpy.ndarray) -> Tuple[numpy.ndarray, numpy.ndarray] Generates element stiffness matrix (K_global) in global coordinates Generate geometric stiffness matrix (Kg_global) in global coordinates Args: nodes (np.ndarray): elements (np.ndarray): el_props (np.ndarray): props (np.ndarray): length (np.ndarray): B_C (str): m_a (np.ndarray): Returns: K_global (np.ndarray): global stiffness matrix Kg_global (np.ndarray): global geometric stiffness matrix B Smith, May 2023 .. py:function:: k_kg_local(E_x: float, E_y: float, nu_x: float, nu_y: float, G_bulk: float, thick: float, length: float, Ty_1: float, Ty_2: float, b_strip: float, B_C: str, m_a: numpy.ndarray) -> Tuple[numpy.ndarray, numpy.ndarray] Generate element stiffness matrix (k_local) in local coordinates Generate geometric stiffness matrix (kg_local) in local coordinates Args: E_x (float): material property E_y (float): material property nu_x (float): material property nu_y (float): material property G_bulk (float): material property thick (float): thickness of the strip (element) length (np.ndarray): length of the strip in longitudinal direction Ty_1 (float): node stresses Ty_2 (float): node stresses b_strip (float): width of the strip in transverse direction B_C (str): ['S-S'] a string specifying boundary conditions to be analyzed: 'S-S' simply-pimply supported boundary condition at loaded edges 'C-C' clamped-clamped boundary condition at loaded edges 'S-C' simply-clamped supported boundary condition at loaded edges 'C-F' clamped-free supported boundary condition at loaded edges 'C-G' clamped-gcdef np.ndarray[np.double_t, ndim=2] uided supported boundary condition at loaded edges m_a (np.ndarray): longitudinal terms (or half-wave numbers) for this length Returns: k_local (np.ndarray): local stiffness matrix, a total_m x total_m matrix of 8 by 8 submatrices. k_local=[k_mp]total_m x total_m block matrix each k_mp is the 8 x 8 submatrix in the DOF order [u1 v1 u2 v2 w1 theta1 w2 theta2]' kg_local (np.ndarray): local geometric stiffness matrix, a total_m x total_m matrix of 8 by 8 submatrices. kg_local=[kg_mp]total_m x total_m block matrix each kg_mp is the 8 x 8 submatrix in the DOF order [u1 v1 u2 v2 w1 theta1 Z. Li June 2008 modified by Z. Li, Aug. 09, 2009 modified by Z. Li, June 2010 klocal and kglocal merged by B Smith, May 2023 .. py:function:: kglobal_transv(nodes: numpy.ndarray, elements: numpy.ndarray, props: numpy.ndarray, m_i: float, length: float, B_C: str, el_props: numpy.ndarray) -> numpy.ndarray this routine creates the global stiffness matrix for planar displacements basically the same way as in the main program, however: only one half-wave number m_i is considered, only w, teta terms are considered, plus E_y = nu_x = nu_y = 0 is assumed plus the longitudinal displacements. DOFs are explicitly eliminated the multiplication by 'length' (member length) is not done here, must be done outside of this routine Args: nodes (np.ndarray): standard parameter elements (np.ndarray): standard parameter props (np.ndarray): standard parameter m_i (float): number of half-wavelengths length (float): half-wavelength B_C (str): boundary condition el_props (np.ndarray): element propertise Returns: k_global_transv (np.ndarray): global stiffness matrix S. Adany, Feb 08, 2004 Z. Li, Jul 10, 2009 .. py:function:: klocal_transv(E_x: float, E_y: float, nu_x: float, nu_y: float, G_bulk: float, thick: float, length: float, b_strip: float, m_i: float, B_C: str) -> numpy.ndarray this routine creates the local stiffness matrix for bending terms basically the same way as in the main program, however: only for single half-wave number m_i membrane strains practically zero, (membrane moduli are enlarged) for bending, only transverse terms are considered, (practically: only keeps the I_1 term, set I_2 through I_5 to be zero) also different from the main program, here only involves one single longitudinal term m_i. Args: E_x (float): material property E_y (float): material property nu_x (float): material property nu_y (float): material property G_bulk (float): material property thick (float): element thickness length (float): element length b_strip (float): element widget m_i (float): number of half-wavelengths B_C (str): boundary condition Returns: np.ndarray: _description_ Z. Li, Jul 10, 2009 .. py:function:: calc_km_mp(E_1: float, E_2: float, c_1: float, c_2: float, b_strip: float, G_bulk: float, nu_x: float, thick: float, I_1: float, I_2: float, I_3: float, I_4: float, I_5: float) -> numpy.ndarray Calculate the membrane stiffness sub-matrix, used in the assembly of local stiffness matrices Args: E_1 (float): _description_ E_2 (float): _description_ c_1 (float): _description_ c_2 (float): _description_ b_strip (float): _description_ G_bulk (float): _description_ nu_x (float): _description_ thick (float): _description_ I_1 (float): _description_ I_2 (float): _description_ I_3 (float): _description_ I_4 (float): _description_ I_5 (float): _description_ Returns: km_mp (np.ndarray): membrane stiffness sub-matrix Z. Li June 2008 modified by Z. Li, Aug. 09, 2009 modified by Z. Li, June 2010 Pulled out of klocal() function by B Smith, May 2023 .. py:function:: calc_kf_mp(d_x: float, d_y: float, d_1: float, d_xy: float, b_strip: float, I_1: float, I_2: float, I_3: float, I_4: float, I_5: float) -> numpy.ndarray Calculate the flexural stiffness sub-matrix, used in the assembly of local stiffness matrices Args: d_x (float): _description_ d_y (float): _description_ d_1 (float): _description_ d_xy (float): _description_ b_strip (float): _description_ I_1 (float): _description_ I_2 (float): _description_ I_3 (float): _description_ I_4 (float): _description_ I_5 (float): _description_ Returns: np.ndarray: _description_ Z. Li June 2008 modified by Z. Li, Aug. 09, 2009 modified by Z. Li, June 2010 Pulled out of klocal() function by B Smith, May 2023 .. py:function:: calc_gm_mp(u_i: float, u_j: float, b_strip: float, length: float, Ty_1: float, Ty_2: float, I_4: float, I_5: float) -> numpy.ndarray Calculate the membrane geometric stiffness sub-matrix, used in the assembly of local geometric stiffness matrices Args: u_i (float): _description_ u_j (float): _description_ b_strip (float): _description_ length (float): _description_ Ty_1 (float): _description_ Ty_2 (float): _description_ I_4 (float): _description_ I_5 (float): _description_ Returns: np.ndarray: _description_ Z. Li June 2008 modified by Z. Li, Aug. 09, 2009 modified by Z. Li, June 2010 Pulled out of kglocal() function by B Smith, May 2023 .. py:function:: calc_gf_mp(Ty_1: float, Ty_2: float, b_strip: float, I_5: float) -> numpy.ndarray Calculate the flexural geometric stiffness sub-matrix, used in the assembly of local geometric stiffness matrices Args: Ty_1 (float): _description_ Ty_2 (float): _description_ b_strip (float): _description_ I_5 (float): _description_ Returns: np.ndarray: _description_ Z. Li June 2008 modified by Z. Li, Aug. 09, 2009 modified by Z. Li, June 2010 Pulled out of kglocal() function by B Smith, May 2023 .. py:function:: bc_i1_5(B_C: str, m_i: float, m_j: float, length: float) -> list Calculate the 5 undetermined parameters I_1,I_2,I_3,I_4,I_5 for local elastic and geometric stiffness matrices. Args: B_C (str): a string specifying boundary conditions to be analysed: 'S-S' simply-pimply supported boundary condition at loaded edges 'C-C' clamped-clamped boundary condition at loaded edges 'S-C' simply-clamped supported boundary condition at loaded edges 'C-F' clamped-free supported boundary condition at loaded edges 'C-G' clamped-guided supported boundary condition at loaded edges m_i (float): number of half-wavelengths for node i m_j (float): number of half-wavelengths for node j length (float): length of element Returns: I_1 though 5 (list): 5 undetermined parameters I_1,I_2,I_3,I_4,I_5 calculation of I_1 is the integration of y_m*Yn from 0 to length calculation of I_2 is the integration of y_m''*Yn from 0 to length calculation of I_3 is the integration of y_m*Yn'' from 0 to length calculation of I_3 is the integration of y_m*Yn'' from 0 to length calculation of I_4 is the integration of y_m''*Yn'' from 0 to length calculation of I_5 is the integration of y_m'*Yn' from 0 to length .. py:function:: trans(alpha: float, total_m: int) -> numpy.ndarray Transform local stiffness into global stiffness Args: alpha (float): element angle total_m (int): number of half-wavelengths Returns: gamma (np.ndarray): transformation matrix Zhanjie 2008 modified by Z. Li, Aug. 09, 2009 .. py:function:: assemble(K_global: numpy.ndarray, Kg_global: numpy.ndarray, k_local: numpy.ndarray, kg_local: numpy.ndarray, node_i: int, node_j: int, n_nodes: int, m_a: numpy.ndarray) -> Tuple[numpy.ndarray, numpy.ndarray] Add the element contribution to the global stiffness matrix Args: K_global (np.ndarray): global elastic stiffness matrix Kg_global (np.ndarray): global geometric stiffness matrix k_local (np.ndarray): local elastic stiffness matrix. Each submatrix is similar to the one used in original CUFSM for single longitudinal term m in the DOF order [u1 v1...un vn w1 01...wn 0n]m'. kg_local (np.ndarray): local geometric stiffness matrix. Each submatrix is similar to the one used in original CUFSM for single longitudinal term m in the DOF order [u1 v1...un vn w1 01...wn 0n]m'. node_i (int): node number node_j (int): node number n_nodes (int): total number of nodes in section m_a (np.ndarray): numbers of half-wavelengths Returns: K_global (np.ndarray): global elastic stiffness matrix Kg_global (np.ndarray): global geometric stiffness matrix Z. Li, June 2008 modified by Z. Li, Aug. 09, 2009 Z. Li, June 2010 .. py:function:: assemble_single(K_global: numpy.ndarray, k_local: numpy.ndarray, node_i: int, node_j: int, n_nodes: int) -> numpy.ndarray this routine adds the element contribution to the global stiffness matrix basically it does the same as routine 'assemble', however: it does not care about Kg_global (geom stiff matrix) only involves single half-wave number m_i Args: K_global (np.ndarray): global elastic stiffness matrix k_local (np.ndarray): local elastic stiffness matrix node_i (int): node number node_j (int): node number n_nodes (int): total number of nodes in section Returns: _type_: _description_ S. Adany, Feb 06, 2004 Z. Li, Jul 10, 2009 .. py:function:: spring_klocal(k_u: float, k_v: float, k_w: float, k_q: float, length: float, B_C: str, m_a: numpy.ndarray, discrete: int, y_s: float) -> numpy.ndarray Generate spring stiffness matrix (k_local) in local coordinates, modified from klocal Args: k_u (float): spring stiffness values k_v (float): spring stiffness values k_w (float): spring stiffness values k_q (float): spring stiffness values length (float): length of the strip in longitudinal direction B_C (str): ['S-S'] a string specifying boundary conditions to be analyzed: 'S-S' simply-pimply supported boundary condition at loaded edges 'C-C' clamped-clamped boundary condition at loaded edges 'S-C' simply-clamped supported boundary condition at loaded edges 'C-F' clamped-free supported boundary condition at loaded edges 'C-G' clamped-guided supported boundary condition at loaded edges m_a (np.ndarray): longitudinal terms (or half-wave numbers) for this length discrete (int): discrete == 1 if discrete spring y_s (float): location of discrete spring Returns: klocal (np.ndarray): local stiffness matrix, a total_m x total_m matrix of 8 by 8 submatrices. k_local=[k_mp]total_m x total_m block matrix each k_mp is the 8 x 8 submatrix in the DOF order [u1 v1 u2 v2 w1 theta1 w2 theta2]' BWS DEC 2015 .. py:function:: bc_i1_5_atpoint(B_C: str, m_i: float, m_j: float, length: float, y_s: float) -> Tuple[float, float] Calculate the value of the longitudinal shape functions for discrete springs Args: B_C (str): a string specifying boundary conditions to be analyzed: 'S-S' simply-pimply supported boundary condition at loaded edges 'C-C' clamped-clamped boundary condition at loaded edges 'S-C' simply-clamped supported boundary condition at loaded edges 'C-F' clamped-free supported boundary condition at loaded edges 'C-G' clamped-guided supported boundary condition at loaded edges m_i (float): number of half-wavelengths m_j (float): number of half-wavelengths length (float): length of element y_s (float): location of discrete spring Returns: I_1 (float): calculation of I_1 is the value of y_m(y/L)*Yn(y/L) I_5 (float): calculation of I_5 is the value of y_m'(y/L)*Yn'(y/L)_description_ .. py:function:: spring_assemble(K_global: numpy.ndarray, k_local: numpy.ndarray, node_i: int, node_j: int, n_nodes: int, m_a: numpy.ndarray) -> numpy.ndarray Add the (spring) contribution to the global stiffness matrix Args: K_global (np.ndarray): global elastic stiffness matrix total_m x total_m submatrices. Each submatrix is similar to the one used in original CUFSM for single longitudinal term m in the DOF order [u1 v1...un vn w1 01...wn 0n]m'. k_local (np.ndarray): local elastic stiffness matrix node_i (int): node number node_j (int): node number n_nodes (int): total number of nodes m_a (np.ndarray): number of half-wavelengths Returns: K_global (np.ndarray): global elastic stiffness matrix Z. Li, June 2008 modified by Z. Li, Aug. 09, 2009 Z. Li, June 2010 adapted for springs BWS Dec 2015 .. py:function:: ym_at_ys(B_C: str, m_i: float, y_s: float, length: float) -> float Longitudinal shape function values could be called in lots of places, but now (2015) is hardcoded by Zhanjie in several places in the interface written in 2015 because wanted it for a new idea on discrete springs Args: B_C (str): boundary condition m_i (float): number of half-wavelengths y_s (float): location of discrete spring length (float): element length Returns: y_m (float): longitudinal shape function value BWS in 2015 .. py:function:: ymprime_at_ys(B_C: str, m_i: float, y_s: float, length: float) -> float First Derivative of Longitudinal shape function values could be called in lots of places, but now (2015) is hardcoded by Zhanjie in several places in the interface written in 2015 because wanted it for a new idea on discrete springs Args: B_C (str): boundary condition m_i (float): number of half-wavelengths y_s (float): location of discrete spring length (float): element length Returns: y_m_prime (float): first derivative of longitudinal shape function BWS in 2015