OpenSeesPy (Linux)

3.8.0.0 · active · verified Thu Apr 16

OpenSeesPy is a Python wrapper for the OpenSees finite element analysis framework, widely used for simulating structural and geotechnical systems. The `openseespylinux` package provides a pre-compiled, optimized version of OpenSeesPy specifically for Linux environments, enabling high-performance numerical simulations without needing to compile OpenSees from source. It is currently at version 3.8.0.0 and typically updates in alignment with major OpenSees releases.

Common errors

Warnings

Install

Imports

Quickstart

This example demonstrates a basic static analysis of a simple truss element, including model definition, material/element assignment, boundary conditions, loading, analysis, and result retrieval. It's crucial to call `ops.wipe()` before defining a new model.

import openseespy.opensees as ops

# 1. Start a new model (2D, 3 DoF per node)
ops.wipe()
ops.model('basic', '-ndm', 2, '-ndf', 3)

# 2. Define a uniaxial elastic material (tag 1, E=3000)
ops.uniaxialMaterial('Elastic', 1, 3000.0)

# 3. Define nodes
ops.node(1, 0.0, 0.0)
ops.node(2, 10.0, 0.0)

# 4. Define boundary conditions (fixed at node 1)
ops.fix(1, 1, 1, 1)

# 5. Define an elastic truss element (tag 1, nodes 1-2, Area=1.0, material tag 1)
ops.element('Truss', 1, 1, 2, 1.0, 1)

# 6. Define a time series (constant) and load pattern
ops.timeSeries('Constant', 1)
ops.pattern('Plain', 1, 1)
ops.load(2, 0.0, -100.0, 0.0) # Apply 100 units downward load at node 2

# 7. Define analysis parameters
ops.integrator('LoadControl', 0.1)
ops.numberer('RCM')
ops.constraints('Plain')
ops.system('BandGeneral')
ops.algorithm('Newton')
ops.analysis('Static')

# 8. Perform analysis in 10 steps
ops.analyze(10)

# 9. Get results (Y-displacement of node 2)
disp_y = ops.nodeDisp(2, 2)
print(f"Y-displacement at node 2: {disp_y}")

# 10. End model and clear memory
ops.wipe()

view raw JSON →