Section Analysis

The openseestools.SectionAnalysis class provides methods for inspecting OpenSees fiber sections.

class openseestools.SectionAnalysis(sectionFactory: Callable[[], int], scratchPath=None, analysisID=0)

Analyze a fiber section.

Parameters:
  • sectionFactory (() -> int) – Function that creates the section to be analyzed when called with no arguments, and returns the tag of the section. Note that the analysis is 3D and 6DOF, so a GJ value must be provided for fiber sections.

  • scratchPath (path_like, optional) – Path to the scratch directory. If None, uses the system temporary directory. (default: None)

  • analysisID (optional) – Unique ID for the analysis. (default: 0)

getDiscretization() SectionDiscretization

Get the discretization for the section.

Note that the discretization is cached; this cache is purged when changing sectionFactory.

plotDiscretization(ax=None, plotAs2d=False)

Plot a representation of the discretized section.

Parameters:
  • ax (optional) – Matplotlib axes to plot on. If None, a new pyplot figure is created.

  • plotAs2d (bool, optional) – If True, the x-axis becomes the fiber number instead of the Z-axis dimension. (default: False)

Returns:

Matplotlib axes that were plotted.

Return type:

ax

printMaterialInfo(file=None, tablefmt='presto', floatfmt='g')

Print the material information for the section.

Parameters:
  • file (optional) – Open file-like descriptor to print to. (default: None)

  • tablefmt (str, optional) – Table format to use. See tabulate.tabulate_formats for options. (default: ‘presto’)

  • floatfmt (str, optional) – Format to use for floating point numbers. (default: ‘g’)

property sectionFactory

Function that creates the section to be analyzed when called with no arguments, and returns the tag of the section.

Example

>>> from openseestools import SectionAnalysis, fourFiberSectionGJ
>>> def createSection():
...     ops.uniaxialMaterial('Elastic', 1, 29000.0)
...     fourFiberSectionGJ(1, 1, area=10.0, Iy=144.0, Iz=94.0, GJ=11000.0)
>>> SA = SectionAnalysis(createSection)
>>> SA.printMaterialInfo()
   Material |   # Fibers |   Area |      Iz |   Iy
------------+------------+--------+---------+------
          1 |          4 |     10 | 93.9999 |  144
------------+------------+--------+---------+------
      Total |          4 |     10 | 93.9999 |  144