Running an Analysis

The first step in running a section analysis is the creation of a Section object. This class stores the structural geometry and finite element mesh and provides methods to perform various types of sectional analyses.

class sectionproperties.analysis.section.Section(geometry: Union[Geometry, CompoundGeometry], time_info: bool = False)[source]

Class for structural cross-sections.

Stores the finite element geometry, mesh and material information and provides methods to compute the cross-section properties. The element type used in this program is the six-noded quadratic triangular element.

The constructor extracts information from the provided mesh object and creates and stores the corresponding Tri6 finite element objects.

Parameters
  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • time_info (bool) – If set to True, a detailed description of the computation and the time cost is printed to the terminal for every computation performed.

The following example creates a Section object of a 100D x 50W rectangle using a mesh size of 5:

import sectionproperties.pre.library.primitive_sections as primitive_sections
from sectionproperties.analysis.section import Section

geometry = primitive_sections.rectangular_section(d=100, b=50)
geometry.create_mesh(mesh_sizes=[5])
section = Section(geometry)
Variables
  • elements (list[Tri6]) – List of finite element objects describing the cross-section mesh

  • num_nodes (int) – Number of nodes in the finite element mesh

  • geometry (Geometry) – Cross-section geometry object used to generate the mesh

  • mesh (dict(mesh)) – Mesh dict returned by triangle

  • mesh_nodes (numpy.ndarray) – Array of node coordinates from the mesh

  • mesh_elements (numpy.ndarray) – Array of connectivities from the mesh

  • mesh_attributes (numpy.ndarray) – Array of attributes from the mesh

  • materials – List of materials

  • material_groups – List of objects containing the elements in each defined material

  • section_props (SectionProperties) – Class to store calculated section properties

Raises
  • AssertionError – If the number of materials does not equal the number of regions

  • ValueError – If geometry does not contain a mesh

Checking the Mesh Quality

Before carrying out a section analysis it is a good idea to check the quality of the finite element mesh. Some useful methods are provided to display mesh statistics and to plot the finite element mesh:

Section.display_mesh_info()[source]

Prints mesh statistics (number of nodes, elements and regions) to the command window.

The following example displays the mesh statistics for a Tee section merged from two rectangles:

import sectionproperties.pre.library.primitive_sections as primitive_sections
from sectionproperties.analysis.section import Section

rec1 = primitive_sections.rectangular_section(d=100, b=25)
rec2 = primitive_sections.rectangular_section(d=25, b=100)
rec1 = rec1.shift_section(x_offset=-12.5)
rec2 = rec2.shift_section(x_offset=-50, y_offset=100)

geometry = rec1 + rec2
geometry.create_mesh(mesh_sizes=[5, 2.5])
section = Section(geometry)
section.display_mesh_info()

>>>Mesh Statistics:
>>>--4920 nodes
>>>--2365 elements
>>>--2 regions
Section.plot_mesh(alpha=0.5, materials=True, mask=None, title='Finite Element Mesh', **kwargs)[source]

Plots the finite element mesh.

Parameters
  • alpha (float) – Transparency of the mesh outlines: \(0 \leq \alpha \leq 1\)

  • materials (bool) – If set to true shades the elements with the specified material colours

  • mask (list[bool]) – Mask array, of length num_nodes, to mask out triangles

  • title (string) – Plot title

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the mesh generated for the second example listed under the Section object definition:

import sectionproperties.pre.library.primitive_sections as primitive_sections
from sectionproperties.pre.pre import Material
from sectionproperties.analysis.section import Section

steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, density=7.85e-6,
    yield_strength=250, color='grey'
)
timber = Material(
    name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, density=6.5e-7,
    yield_strength=20, color='burlywood'
)

geom_steel = primitive_sections.rectangular_section(d=50, b=50, material=steel)
geom_timber = primitive_sections.rectangular_section(d=50, b=50, material=timber)
geometry = geom_timber.align_to(geom_steel, on="right") + geom_steel

geometry.create_mesh(mesh_sizes=[10, 5])

section = Section(geometry)
section.plot_mesh(materials=True, alpha=0.5)
../_images/composite_mesh.png

Finite element mesh generated by the above example.

Geometric Analysis

A geometric analysis calculates the area properties of the section.

Section.calculate_geometric_properties()[source]

Calculates the geometric properties of the cross-section and stores them in the SectionProperties object contained in the section_props class variable.

The following geometric section properties are calculated:

  • Cross-sectional area

  • Cross-sectional perimeter

  • Cross-sectional mass

  • Area weighted material properties, composite only \(E_{eff}\), \(G_{eff}\), \({nu}_{eff}\)

  • Modulus weighted area (axial rigidity)

  • First moments of area

  • Second moments of area about the global axis

  • Second moments of area about the centroidal axis

  • Elastic centroid

  • Centroidal section moduli

  • Radii of gyration

  • Principal axis properties

If materials are specified for the cross-section, the moments of area and section moduli are elastic modulus weighted.

The following example demonstrates the use of this method:

section = Section(geometry)
section.calculate_geometric_properties()

Plastic Analysis

A plastic analysis calculates the plastic properties of the section.

Note

A geometric analysis must be performed on the Section object before a plastic analysis is carried out.

Warning

The plastic analysis in sectionproperties assumes all materials are able to reach their yield stress defined in the material properties. Care should be taken if analysing materials or cross-sections exhibiting non-linear behaviour, e.g. reinforced concrete or non-compact steel sections.

Section.calculate_plastic_properties(verbose=False)[source]

Calculates the plastic properties of the cross-section and stores them in the SectionProperties object contained in the section_props class variable.

Parameters

verbose (bool) – If set to True, the number of iterations required for each plastic axis is printed to the terminal.

The following warping section properties are calculated:

  • Plastic centroid for bending about the centroidal and principal axes

  • Plastic section moduli for bending about the centroidal and principal axes

  • Shape factors for bending about the centroidal and principal axes

If materials are specified for the cross-section, the plastic section moduli are displayed as plastic moments (i.e \(M_p = f_y S\)) and the shape factors are not calculated.

Note that the geometric properties must be calculated before the plastic properties are calculated:

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
Raises

RuntimeError – If the geometric properties have not been calculated prior to calling this method

Warping Analysis

A warping analysis calculates the torsion and shear properties of the section.

Note

A geometric analysis must be performed on the Section object before a warping analysis is carried out.

Warning

There must be connectivity between all elements of the mesh to perform a valid warping analysis. This is a limitation of the elastic theory that this implementation is based on, as there is no way to quantify the transfer of shear and warping between two unconnected regions.

Section.calculate_warping_properties(solver_type='direct')[source]

Calculates all the warping properties of the cross-section and stores them in the SectionProperties object contained in the section_props class variable.

Parameters

solver_type (string) – Solver used for solving systems of linear equations, either using the ‘direct’ method or ‘cgs’ iterative method

The following warping section properties are calculated:

  • Torsion constant

  • Shear centre

  • Shear area

  • Warping constant

  • Monosymmetry constant

If materials are specified, the values calculated for the torsion constant, warping constant and shear area are elastic modulus weighted.

Note that the geometric properties must be calculated prior to the calculation of the warping properties:

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
Raises

RuntimeError – If the geometric properties have not been calculated prior to calling this method

Stress Analysis

A stress analysis calculates the section stresses arising from a set of forces and moments. Executing this method returns a StressResult object which stores the section stresses and provides stress plotting functions.

Note

A geometric analysis must be performed on the Section object before a stress analysis is carried out. Further, if the shear force or twisting moment is non-zero a warping analysis must also be performed.

Warning

The stress analysis in sectionproperties is linear-elastic and does not account for the yielding of materials or any non-linearities.

Section.calculate_stress(N=0, Vx=0, Vy=0, Mxx=0, Myy=0, M11=0, M22=0, Mzz=0)[source]

Calculates the cross-section stress resulting from design actions and returns a StressPost object allowing post-processing of the stress results.

Parameters
  • N (float) – Axial force

  • Vx (float) – Shear force acting in the x-direction

  • Vy (float) – Shear force acting in the y-direction

  • Mxx (float) – Bending moment about the centroidal xx-axis

  • Myy (float) – Bending moment about the centroidal yy-axis

  • M11 (float) – Bending moment about the centroidal 11-axis

  • M22 (float) – Bending moment about the centroidal 22-axis

  • Mzz (float) – Torsion moment about the centroidal zz-axis

Returns

Object for post-processing cross-section stresses

Return type

StressPost

Note that a geometric analysis must be performed prior to performing a stress analysis. Further, if the shear force or torsion is non-zero a warping analysis must also be performed:

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(N=1e3, Vy=3e3, Mxx=1e6)
Raises

RuntimeError – If a geometric and warping analysis (if required) have not been performed prior to calling this method

Calculating Frame Properties

Calculates the section properties required for a 2D or 3D frame analysis.

Note

This method is significantly faster than performing a geometric and a warping analysis and has no prerequisites.

Section.calculate_frame_properties(solver_type='direct')[source]

Calculates and returns the properties required for a frame analysis. The properties are also stored in the SectionProperties object contained in the section_props class variable.

Parameters

solver_type (string) – Solver used for solving systems of linear equations, either using the ‘direct’ method or ‘cgs’ iterative method

Returns

Cross-section properties to be used for a frame analysis (area, ixx, iyy, ixy, j, phi)

Return type

tuple(float, float, float, float, float, float)

The following section properties are calculated:

  • Cross-sectional area (area)

  • Second moments of area about the centroidal axis (ixx, iyy, ixy)

  • Torsion constant (j)

  • Principal axis angle (phi)

If materials are specified for the cross-section, the area, second moments of area and torsion constant are elastic modulus weighted.

The following example demonstrates the use of this method:

section = Section(geometry)
(area, ixx, iyy, ixy, j, phi) = section.calculate_frame_properties()