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.
One thought on “A Little Secret About OpenSees Tcl”