A previous post showed that, when compared to a couple of brute force approaches, using the sdfResponse
command is the most computationally efficient approach to generating an earthquake response spectrum.
During an OpenSees Cafe, Dr. Silvia Mazzoni suggested taking a more intelligent approach by “batching” the brute force SDF analyses. Instead of analyzing one oscillator at a time, create all the oscillators in a single model and shake all the oscillators in a single analysis. Would this multi-threading (shown below) be faster than using the sdfResponse
approach from the previous post?
import openseespy.opensees as ops
dTn = 0.02
Tno = dTn
Tnf = 3.0
ops.wipe()
ops.model('basic','-ndm',1,'-ndf',1)
ops.timeSeries('Path',1,'-dt',0.02,'-filePath','tabasFN.txt')
ops.pattern('UniformExcitation',1,1,'-accel',1)
Tgm = 30.0
ops.node(0,0); ops.fix(0,1)
i = 0
Tn = Tno
while Tn <= Tnf:
i += 1
ops.node(i,0); ops.mass(i,1.0) # m = 1
ops.uniaxialMaterial('Elastic',i,(2*pi/Tn)**2) # k = m*omega**2
ops.element('zeroLength',i,0,i,'-mat',i,'-dir',1)
Tn += dTn
ops.recorder('EnvelopeNode','-file','dispAll.out','-nodeRange',1,i,'-dof',1,'disp')
ops.system('Diagonal')
ops.analysis('Transient')
dt = 0.02
N = int(Tgm/dt)
ops.analyze(N,dt)
The resulting model is multiple SDF oscillators connected to one base node.

Because the SDFs are uncoupled from each other, this is perhaps the only acceptable use of the Diagonal
solver outside of explicit time integration with coupled systems. Also, note that the maximum displacement of each oscillator is dumped to a single file using the -nodeRange
option to the EnvelopeNode
recorder.
I didn’t make any plots, so you’ll have to take my word for it: the sdfResponse
approach generates an elastic response spectrum about 2-3 times faster than the batched SDF approach. Note that the sdfResponse
approach was 6-8 times faster than brute force approaches from the previous posts–that is a win in and of itself. Still, the overhead of a proper finite element analysis dominates SDF analysis.
The batched SDF approach is a good idea in many situations though, particularly using nonlinear hysteretic models where the oscillators can do their thing simultaneously or if you have simple (elastic or inelastic) systems that sdfResponse
cannot handle, e.g., a two DOF SSI system. However, the drawbacks of “multi-threading” and SDF analysis are 1) the analysis cannot proceed to the next time step until all nonlinear oscillators have reached equilibrium and 2) non-convergence of one nonlinear oscillator will cause the analysis to stop for all oscillators.
That was really cool. You know, by an idea the results will be calculated so much faster, and it cause the idea to become cool.
When I read this article, suddenly I remember this video:
https://www.linkedin.com/posts/hossam-mostafa-structural-engineer_earthquakes-structuralanalysis-activity-7002932113989595138-GDsj?utm_source=share&utm_medium=member_desktop
approximately this video shows how does she thought. Great.
LikeLiked by 1 person