A Little Secret About OpenSees Tcl

Putting load and fiber commands inside braces {} preceded by pattern and section commands, respectively, was a conscious choice in the early days of G3/OpenSees. The intent was to enforce the same scoping rules that Tcl uses for procedures, loops, and conditional statements; however, the braces and scoping were totally unnecessary.

We scrapped the scoping requirement (but kept backward compatibility for Tcl) when we generalized the interpreters to accommodate Python and whatever is the next scripting language that beckons to OpenSees. As a result, you don’t see load and fiber commands indented in OpenSees Python scripts. These commands simply refer back to the last defined pattern and section commands.

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 )

Google photo

You are commenting using your Google 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.