Convert Abaqus Cross-Section to VABS#
Problem Description#
Given a 2D beam cross-section mesh created in Abaqus (.inp format), convert it to a VABS input file for beam property homogenization using the Timoshenko beam model.
Solution#
SGIO provides two approaches: a one-step convert() call, or the explicit read() + write() pair.
import logging
import sys
from pathlib import Path
import sgio
logging.basicConfig(level=logging.INFO)
cwd = Path(__file__).resolve().parent
sys.path.insert(0, str(cwd.parent))
from _bundle_helpers import write_gmsh_bundle_sidecars
sg = sgio.convert(
str(cwd / 'sg2_airfoil.inp'), # Name of the Abaqus inp file.
str(cwd / 'sg2_airfoil.sg'), # Name of the VABS file.
'abaqus', # Format of the CS data converted from.
'vabs', # Format of the CS data converted to.
sgdim=2, # Cross-section mesh lies in a 2D plane.
model_type='bm2', # Structural model: Timoshenko.
)
# Export the converted section to a SG-on-Gmsh bundle for visualization or
# downstream bundle-based workflows.
sgio.write(
sg=sg,
filename=str(cwd / 'main.msh'),
file_format='gmsh',
format_version='4.1',
model_type='BM2',
binary=False,
)
write_gmsh_bundle_sidecars(sg, cwd)
model_type='bm2' selects the Timoshenko beam model (includes shear deformation). Use 'bm1' for the classical Euler-Bernoulli model.
Result#
A VABS input file sg2_airfoil_2.sg is written to the working directory and can be passed directly to VABS for homogenization.
File List#
run.py: Main Python script
sg2_airfoil.inp: Abaqus cross-section input file