The document outlines a procedure for matrix multiplication involving stiffness matrices in a finite element analysis context. It details the calculation of local and global stiffness matrices, as well as the assignment of degrees of freedom indices for nodes. Additionally, it addresses the application of boundary conditions to the system by fixing degrees of freedom based on support types.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views1 page
GRASP Python (58)
The document outlines a procedure for matrix multiplication involving stiffness matrices in a finite element analysis context. It details the calculation of local and global stiffness matrices, as well as the assignment of degrees of freedom indices for nodes. Additionally, it addresses the application of boundary conditions to the system by fixing degrees of freedom based on support types.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
' First multiply k_local * T
Dim i As Integer, j As Integer, k As Integer
For i = 1 To 6 For j = 1 To 6 temp(i, j) = 0 For k = 1 To 6 temp(i, j) = temp(i, j) + k_local(i, k) * T(k, j) Next k Next j Next i
' Then multiply T' * (k_local * T)
For i = 1 To 6 For j = 1 To 6 k_global_elem(i, j) = 0 For k = 1 To 6 k_global_elem(i, j) = k_global_elem(i, j) + T(k, i) * temp(k, j) Next k Next j Next i
For i = 1 To 6 For j = 1 To 6 K_global(dof_indices(i), dof_indices(j)) = K_global(dof_indices(i), dof_indices(j)) + k_global_elem(i, j) Next j Next i Next elemId
' Apply boundary conditions
Dim fixed_dofs() As Integer ReDim fixed_dofs(1 To totalDof) ' Will be resized later Dim num_fixed As Integer num_fixed = 0
Dim nodeId As Integer
For nodeId = 1 To nodes.Count On Error Resume Next Dim s As Support Set s = supports("S" & nodeId) If Not s Is Nothing Then Select Case s.supportType Case "fixed" ' Fix all DOFs fixed_dofs(num_fixed + 1) = 3 * (nodeId - 1) + 1 ' ux