I know I'm not the only one who enjoys converting between scripting languages or between structural analysis programs. I've had fun writing bespoke Tcl middleware between OpenSees and MATLAB, but now OpenSeesPy makes all of that obsolete. But, let's say you have an OpenSees Tcl script that you'd like to run in OpenSeesPy. There's a … Continue reading Tcl as a Front End for Python
Category: Programming
Wipe Out!
I am often reminded that what seems basic to me is not so obvious to others who use OpenSees. For example, the wipe command. What it does--and what it does not do--can be confusing. The wipe command clears out the entire OpenSees model domain (nodes, elements, materials, loads, etc.) and analysis options (algorithm, system, etc.). … Continue reading Wipe Out!
How Many Clicks Does It Take?
Coding single degree of freedom (SDF) response in order to generate earthquake response spectra is a rite of passage in earthquake engineering research and education. I wrote my first response spectrum in MATLAB. Nowadays, people are likely to use Python. To generate response spectra in OpenSees, you can create a simple one-dimensional model of SDF … Continue reading How Many Clicks Does It Take?
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. section Fiber 1 { patch ... layer ... fiber ... } pattern Plain 1 Linear { load ... eleLoad ... sp ... } The intent was to enforce the same … Continue reading A Little Secret About OpenSees Tcl
Compiling OpenSees
In the early days of G3/OpenSees, I was in change of compiling the Windows version using Visual C++, part of Visual Studio. Frank maintained the Linux version. Pretty soon after arriving in Eastchester, I switched to compiling OpenSees on Linux and periodically compiled in Visual Studio--only when I absolutely had to do so. Visual Studio … Continue reading Compiling OpenSees
Moving and Influential
OpenSees is probably not the first, or second, software you think of when you need to generate influence lines or perform moving load analysis, e.g., across bridge girders. However, Tcl and Python scripting capabilities make OpenSees ideal for this type of analysis. To keep things to the point, I'll show an influence line analysis for … Continue reading Moving and Influential
Brace Your Tcl Code
I show Python code for most examples here on the blog, but I am frequently reminded that a majority of OpenSees users write their scripts in Tcl. Because everything's a string, there's a lot of cool stuff you can do with Tcl expressions. However, simple math expressions can take a relatively long time to execute. … Continue reading Brace Your Tcl Code
PSA: OpenSees Commands Are Case Sensitive
I recently had a conversation with an experienced OpenSees user who asked why distributed loads were not working on their elastic beam-column model. I initially thought something must have changed in GitHub, but was relieved when I looked at their input file and saw the following: pattern Plain 2 Linear { eleLoad -ele 10020001 -type … Continue reading PSA: OpenSees Commands Are Case Sensitive
Don’t Forget to Take a Selfie
If you've programmed your own UniaxialMaterial in OpenSees, you were likely hyper-focused on correct implementation of the constructor and the methods for state determination, getStress and commitState. Rightfully so. But there are a couple UniaxialMaterial methods, and a code addition elsewhere, that are critically important when using the database command to save/restore your model or … Continue reading Don’t Forget to Take a Selfie
OpenSeesPy Is Not Terrible for the Environment
This tweet made the rounds in late September, early October. Those new to OpenSeesPy, or unaware of how it works, might have been alarmed. I'm here to reassure you that OpenSeesPy is not a huge CO2 producer like native Python code. https://twitter.com/R_Trotta/status/1309457430267523072 OpenSeesPy is C++ code that calls the Python C/C++ API so that you … Continue reading OpenSeesPy Is Not Terrible for the Environment
