Basic OpenSeesPy#

This page walks through an example of using veux with openseespy.

import openseespy.opensees as ops
import veux

# set model builder
ops.model('basic', '-ndm', 2, '-ndf', 2)

# create nodes
ops.node(1,   0.0,  0.0)
ops.node(2, 144.0,  0.0)
ops.node(3, 168.0,  0.0)
ops.node(4,  72.0, 96.0)

# set boundary condition
ops.fix(1, 1, 1)
ops.fix(2, 1, 1)
ops.fix(3, 1, 1)

# define materials
ops.uniaxialMaterial("Elastic", 1, 3000.0)

# define elements
ops.element("Truss", 1, 1,4, 10.0,1)
ops.element("Truss", 2, 2,4,  5.0,1)
ops.element("Truss", 3, 3,4,  5.0,1)

# create TimeSeries
ops.timeSeries("Linear", 1)

# create a plain load pattern
ops.pattern("Plain", 1, 1)

# Create the nodal load - command: load nodeID xForce yForce
ops.load(4, 100.0, -50.0)

#
# Analysis
#

# create SOE
ops.system("BandSPD")

# set the DOF number
ops.numberer("RCM")

# create constraint handler
ops.constraints("Plain")

# create integrator
ops.integrator("LoadControl", 1.0)

# create algorithm
ops.algorithm("Linear")

# create analysis object
ops.analysis("Static")

# perform the analysis
ops.analyze(1)
0

Now we render the model by passing the ops model to veux.render

veux.render(ops)