OpenSees Cloud
OpenSees AMI
Getting the Digits
Original Post - 17 Nov 2024 - Michael H. Scott
Visit Structural Analysis Is Simple on Substack.
In a recent post,
I pointed out that the LobattoBeamIntegration class
uses only ten, instead of 16, significant figures for the locations and
weights of the integration points. Those six missing digits made for a
perfectly fine demonstration of how to use the isclose
function for
verification.
But, in the bigger picture, omitting six significant figures from a quadrature rule is a problem that I should fix. It’s not cool to complain or make a point about about something, then do nothing about it.
Turns out this is not the first time I had this thought. An unused
Fortran file, gaussq.f
,
in the SRC/element/forceBeamColumn
directory
will crank out locations and weights for a variety of quadrature rules
(Legendre, Chebyshev, Hermite, Jacobi, and generalized Laguerre) and for
a large number of points (greater than the current limit of 10
integration points in most frame elements).
According to the GitHub history, gaussq.f
has been with OpenSees since
2011, which is as far back as the git history goes. I have some local
copies of OpenSees source code showing the file came in to OpenSees
around 2007. But the original file is from the 1980s and is
still available on netlib
.
I never linked gaussq.f
with OpenSees because adding more Fortran code
to the Windows executable has always been a pain. But maybe now with
cmake
, such an addition will be less painful.
Anyway, in the mean time, I made
PR #1549
which used code generated by
gaussq.f
to give 16 digits for the Lobatto beam integration (and Radau
too). Now, when you run the end-loaded cantilever analyses from the
previous post
for 3-10 Lobatto points, the deflections are consistent up
to 15 significant figures.
3 0.03177931034482754
4 0.031779310344827616
5 0.031779310344827616
6 0.03177931034482762
7 0.03177931034482761
8 0.03177931034482762
9 0.03177931034482763
10 0.03177931034482759
Prior to PR #1549, you would have seen the deflections vary in the tenth significant figure.
3 0.031779310344827595
4 0.031779310424771626
5 0.03177931033115315
6 0.031779310339359615
7 0.03177931034033733
8 0.031779310338237575
9 0.03177931033909062
10 0.03177931033961607
Now you can cross the quadrature rule off your suspect list for crimes against your IDAs of reinforced concrete shear walls with regularized material properties and what not.