How to Use pytest with OpenSees

Despite plentiful constitutive models and analysis options, testing and verifying OpenSees has been quite limited. At this point, going back and testing all the contributions from the last 25 years is a nearly insurmountable task. But, as the saying goes: The best time to start testing OpenSees was 25 years ago.The second best time is … Continue reading How to Use pytest with OpenSees

How to Profile an OpenSeesPy Analysis

Python has a couple of profiling libraries--pyinstrument and cProfile--for finding out where all the time goes when you run a script. But, as far as I can tell, these libraries only tell you that the ops.analyze() command is called, not what happens therein. What you really want is to drill down into the state determinations … Continue reading How to Profile an OpenSeesPy Analysis

Dangling Recorders

Because I don't perform very large or time-consuming OpenSees analyses, I use recorders rather infrequently, instead preferring commands like nodeDisp and eleResponse. An issue with node and element recorders is they can segmentation fault after the node or element to which they point is removed from a model--a common scenario for progressive collapse simulations. A … Continue reading Dangling Recorders

Is It Close Enough?

The locations and weights for Gauss-Lobatto beam integration, the de facto beam integration for force-based elements, are hard-coded in the OpenSees source code. For most cases in the LobattoBeamIntegration class, the locations and weights are written to only ten significant figures instead of 16 or more. Although I am certain that leaving six sig-figs on … Continue reading Is It Close Enough?

Set and Get Concrete23 Response

When I wrote Concrete23, I copied Concrete01 then tweaked the unloading and reloading rules. I also added a couple of bells and whistles and it was music to my ears. But I wanted to record those sounds during an analysis. Recorders in OpenSees use the setResponse and getResponse methods to identify and obtain element, section, … Continue reading Set and Get Concrete23 Response

Monte Carlo Simulation with OpenSeesMP

The parallel computing capabilities of OpenSeesSP and OpenSeesMP are easily confused. OpenSeesSP runs your script on a single processor with the other processors awaiting instructions on what to do. OpenSeesSP is ideal for assigning subdomains of a large model to each processor. The main processor, processor 0, directs traffic and solves the governing equations of … Continue reading Monte Carlo Simulation with OpenSeesMP

Is OpenSees Pythonic?

OpenSeesPy is sometimes criticized for not being "Pythonic". But what does "Pythonic" even mean? And does achieving "Pythonic" status matter? From what I gathered in this blog post, Pythonic code uses the idioms, i.e., the specific syntax and constructs, of Python. That definition is circular--an example from the post better demonstrates the meaning. If you … Continue reading Is OpenSees Pythonic?