0% found this document useful (0 votes)
2 views1 page

GRASP Python (59)

The document outlines the process of defining fixed degrees of freedom (DOFs) for different types of boundary conditions in a structural analysis. It includes cases for 'fixed', 'pinned', 'roller_x', 'roller_y', and 'spring', detailing how each condition modifies the global stiffness matrix and the fixed DOFs array. Additionally, it describes the creation of a list of free DOFs by identifying which DOFs are not fixed.

Uploaded by

Le Fondateur
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
2 views1 page

GRASP Python (59)

The document outlines the process of defining fixed degrees of freedom (DOFs) for different types of boundary conditions in a structural analysis. It includes cases for 'fixed', 'pinned', 'roller_x', 'roller_y', and 'spring', detailing how each condition modifies the global stiffness matrix and the fixed DOFs array. Additionally, it describes the creation of a list of free DOFs by identifying which DOFs are not fixed.

Uploaded by

Le Fondateur
Copyright
© © All Rights Reserved
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

fixed_dofs(num_fixed + 2) = 3 * (nodeId - 1) + 2 ' uy

fixed_dofs(num_fixed + 3) = 3 * (nodeId - 1) + 3 ' θz


num_fixed = num_fixed + 3
Case "pinned"
' Fix translations only
fixed_dofs(num_fixed + 1) = 3 * (nodeId - 1) + 1 ' ux
fixed_dofs(num_fixed + 2) = 3 * (nodeId - 1) + 2 ' uy
num_fixed = num_fixed + 2
Case "roller_x"
' Fix y translation only (roller in x direction)
fixed_dofs(num_fixed + 1) = 3 * (nodeId - 1) + 2 ' uy
num_fixed = num_fixed + 1
Case "roller_y"
' Fix x translation only (roller in y direction)
fixed_dofs(num_fixed + 1) = 3 * (nodeId - 1) + 1 ' ux
num_fixed = num_fixed + 1
Case "spring"
' Add spring stiffness to diagonal terms
K_global(3 * (nodeId - 1) + 1, 3 * (nodeId - 1) + 1) =
K_global(3 * (nodeId - 1) + 1, 3 * (nodeId - 1) + 1) + s.kx
K_global(3 * (nodeId - 1) + 2, 3 * (nodeId - 1) + 2) =
K_global(3 * (nodeId - 1) + 2, 3 * (nodeId - 1) + 2) + s.ky
K_global(3 * (nodeId - 1) + 3, 3 * (nodeId - 1) + 3) =
K_global(3 * (nodeId - 1) + 3, 3 * (nodeId - 1) + 3) + s.ktheta
End Select
End If
On Error GoTo 0
Next nodeId

' Resize fixed_dofs array


ReDim Preserve fixed_dofs(1 To num_fixed)

' Create list of free DOFs


Dim free_dofs() As Integer
ReDim free_dofs(1 To totalDof - num_fixed)
Dim free_count As Integer
free_count = 0

For i = 1 To totalDof
Dim is_fixed As Boolean
is_fixed = False

For j = 1 To num_fixed
If i = fixed_dofs(j) Then
is_fixed = True
Exit For
End If
Next j

If Not is_fixed Then


free_count = free_count + 1
free_dofs(free_count) = i
End If
Next i

' Create reduced stiffness matrix


Dim K_reduced() As Double

P a g e 45 | 62

You might also like