Read VABS Homogenized Output (Beam Properties)#
Problem Description#
After running VABS homogenization, read the .K output file to extract effective beam properties such as axial stiffness, torsional stiffness, and bending stiffness for use in beam-level structural analysis.
Solution#
"""Example: Read VABS Homogenized Output (Beam Properties)
This example demonstrates how to read VABS homogenized output to obtain
the effective beam properties (stiffness matrix, mass matrix, etc.).
The example reads a VABS 4.1 output file (.K file) for a Timoshenko beam model.
"""
import logging
from pathlib import Path
import sgio
logging.basicConfig(level=logging.INFO)
cwd = Path(__file__).resolve().parent
# Define the output file path
# Note: The .K file contains homogenized beam properties
output_file = str(cwd / 'cs_box_t_vabs41.sg.K')
# Read the VABS homogenized output
# - file_format='vabs': Specifies VABS format
# - model_type='BM2': Timoshenko beam model (includes shear deformation)
model = sgio.read_output_model(
str(output_file),
file_format='vabs',
model_type='BM2'
)
# Extract beam properties using direct typed attributes
ea = model.ea # Axial stiffness
gj = model.gj # Torsional stiffness
ei22 = model.ei22 # Bending stiffness about axis 2
ei33 = model.ei33 # Bending stiffness about axis 3
# Print the extracted beam properties
print(f"Axial Stiffness (EA): {ea:.3e} N")
print(f"Torsional Stiffness (GJ): {gj:.3e} N*m^2")
print(f"Bending Stiffness about axis 2 (EI22): {ei22:.3e} N*m^2")
print(f"Bending Stiffness about axis 3 (EI33): {ei33:.3e} N*m^2")
model_type='BM2' selects the Timoshenko beam model output layout. For named
beam properties such as ea, gj, ei22, and ei33, use the direct model
attributes. Use the typed section-query methods only when you need matrix or
theory-bound quantities.
Result#
The script returns scalar beam property values that can be used directly in beam-level models.
File List#
run.py: Main Python script
cs_box_t_vabs41.sg.K: VABS homogenized beam properties output