Every C++ executable has a main() function and OpenSees.exe, the standalone Tcl executable, is no exception. You can find the main() function in SRC/tcl/tclAppInit.cpp, where nothing much happens besides calling g3TclMain(), which is defined in SRC/tcl/tclMain.cpp, home of more familiar content like the banner and copyright statement. Prior to the conveniences provided by scripting languages--running … Continue reading Main Street, OpenSees
Category: Programming
OpenSees 12345
In the early 2000s, when the Tcl interpreter was taking shape for OpenSees, Frank used a dummy tag 123456789 to determine if a load pattern had already been defined while parsing the load and sp commands. Here is the 2001 source code for TclModelBuilder.cpp--clearly written by Frank because he does not capitalize anything when he … Continue reading OpenSees 12345
How to Find a Memory Leak in OpenSees
Memory leaks plague virtually all software written in C++ or any other language that requires programmers to manage memory. OpenSees is no exception. With code written by many people with varying knowledge of C++ and very little overall QA/QC, it's fair to say OpenSees has more than its fair share of memory leaks. It's a … Continue reading How to Find a Memory Leak in OpenSees
OpenSees Tcl to Python Converter
Although Python is a more popular programming language than Tcl, I suspect Tcl remains the most used language for OpenSees. Python is gaining ground though as it appeals to newer users of OpenSees. I don't have data to back any of this up. To help the transition from Tcl to Python, OpenSeesPy was designed to … Continue reading OpenSees Tcl to Python Converter
Glulam Volume Factor
I knew nothing about wood design until I started teaching it. Although there are accommodations for LRFD, which is all I learned as a student, wood design is entirely ASD, or allowable stress design. The required stress, f, determined from structural analysis for the controlling ASD load combination, must be less than the available stress, … Continue reading Glulam Volume Factor
Section X
You can record section response in a frame element if you know the section number, or integration point, of the section whose response you would like to record. This is straightforward for distributed plasticity integration such as Lobatto or Legendre where section number 1 is at end I of the element and section number N … Continue reading Section X
No Exit
Have you ever seen OpenSees.exe vanish all of a sudden or received a "Kernel died" message when running OpenSeesPy in a Jupyter Notebook? The C++ exit() function is the likely culprit. Or a segmentation fault. But this post will focus on the exit() function. Some grepping and line counting reveals over 2,000 calls to exit() … Continue reading No Exit
Parameter Updates in the Loop
Besides visualization and writing output to files, there's some pretty useful things you can do during an OpenSees analysis. One of those things is updating model parameters. Before getting into parameter updating, it is worth showing that OpenSees analyses can be run one step at a time. Many examples online show a dynamic analysis, e.g., … Continue reading Parameter Updates in the Loop
How to Record Fiber Response
Recording the response of a single fiber in a fiber section is a common ask. You will need to use an Element recorder, but what you can record in each fiber is defined in the UniaxialMaterial::setResponse() method. The most common option is 'stressStrain', which gives the fiber stress-strain response history. After setResponse() drills down to … Continue reading How to Record Fiber Response
Polymorphic Pitfall
Polymorphism is what makes OpenSees, and other object-oriented software, flexible and extensible. With polymorphism, you can program to an interface, not an implementation. You see this approach all over OpenSees--elements don't care how materials compute stress and tangent (more here); integrators don't care how the elements form resisting force and tangent stiffness (more here); and … Continue reading Polymorphic Pitfall