A Nod to Backward Compatibility

I didn’t want to do it, but I imagined an OpenSees user somewhere out there converting OpenSees Tcl scripts to OpenSeesPy–either manually line by line or using a converter script–and ending up with lines of code that look something like this:


#                           tag I J secI lpI secJ lpJ E A I transfTag
ops.element('beamWithHinges',1, 1,2,  5, lp,   5, lp, E,A,I,    3)

After running the script, they will encounter the following error message:

That’s right, we intentionally omitted beamWithHinges from OpenSeesPy because the command perpetuates the misconception that the element interior has to be elastic, defined by constants E, A, and I (and Iy, G, and J for 3D).

What I want to happen instead is for you to create a beamIntegration object then pass that to the forceBeamColumn element. Here, we create an elastic section for the element interior so that the same response is obtained as the original beamWithHinges command.


#                               tag secI lpI secJ lpJ secE
ops.beamIntegration('HingeRadau',7,   5, lp,   5, lp,  11)

#                                    tag I J transfTag beamIntTag
ops.forceBeamColumn('forceBeamColumn',1, 1,2,    3,         7)

Why the extra beamIntegration command? Because you can then go one step further and make that section on the element interior whatever section you want, including (in this example) section tag 5–the same section prescribed for the plastic hinge regions, a fiber section full of, let’s imagine, Concrete23 and Steel08.


# ops.section('Elastic',11,E,A,I)
#                                           ***


Basically, you’ll get distributed plasticity, but with prescribed integration weights at the element ends. You can’t do that with the beamWithHinges input format, but you can with the beamIntegration plus forceBeamColumn input. And you can also easily mix and match the element with other beam integration options. After all, “beam with hinges” is nothing more than a manipulation of the numerical integration in the force-based element formulation.

Still, I didn’t want to do it. But my track record with backward compatibility is not the best. So, I made pull request #932 for you to use ops.beamWithHinges(...) in OpenSeesPy. The PR was made after the release of OpenSeesPy, so the command will be available with version and later.

As far as I recall, no one has reported (at least not to me) a problem with not being able to use beamWithHinges in OpenSeesPy. I would like to attribute the non-reporting to the more flexible alternative with beamIntegration and forceBeamColumn being widely known and accepted, and not me imagining a problem that doesn’t exist. So, if you have encountered this problem, let me know in the comments section below.

One thought on “A Nod to Backward Compatibility

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.