sectionproperties

Documentation

sectionproperties is a python package for the analysis of arbitrary cross-sections using the finite element method written by Robbie van Leeuwen. sectionproperties can be used to determine section properties to be used in structural design and visualise cross-sectional stresses resulting from combinations of applied forces and bending moments.

A list of the current features of the package and implementation goals for future releases can be found in the README file on github.

Installation

These instructions will get you a copy of sectionproperties up and running on your local machine. You will need a working copy of python 3.8, 3.9 or 3.10 on your machine.

Installing sectionproperties

sectionproperties uses shapely to prepare the cross-section geometry and triangle to efficiently generate a conforming triangular mesh in order to perform a finite element analysis of the structural cross-section.

sectionproperties and all of its dependencies can be installed through the python package index:

pip install sectionproperties

Note that dependencies required for importing from rhino files are not included by default. To obtain these dependencies, install using the rhino option:

pip install sectionproperties[rhino]

Testing the Installation

Python pytest modules are located in the sectionproperties.tests package. To see if your installation is working correctly, install pytest and run the following test:

pytest --pyargs sectionproperties

Structure of an Analysis

The process of performing a cross-section analysis with sectionproperties can be broken down into three stages:

  1. Pre-Processor: The input geometry and finite element mesh is created.

  2. Solver: The cross-section properties are determined.

  3. Post-Processor: The results are presented in a number of different formats.

Creating a Geometry and Mesh

The dimensions and shape of the cross-section to be analysed define the geometry of the cross-section. The Section Library provides a number of functions to easily generate either commonly used structural sections. Alternatively, arbitrary cross-sections can be built from a list of user-defined points, see Geometry from points, facets, holes, and control points.

The final stage in the pre-processor involves generating a finite element mesh of the geometry that the solver can use to calculate the cross-section properties. This can easily be performed using the create_mesh() method that all Geometry objects have access to.

The following example creates a geometry object with a circular cross-section. The diameter of the circle is 50 and 64 points are used to discretise the circumference of the circle. A finite element mesh is generated with a maximum triangular area of 2.5:

import sectionproperties.pre.library.primitive_sections as primitive_sections

geometry = primitive_sections.circular_section(d=50, n=64)
geometry.create_mesh(mesh_sizes=[2.5])
_images/circle_mesh.png

Finite element mesh generated by the above example.

If you are analysing a composite section, or would like to include material properties in your model, material properties can be created using the Material class. The following example creates a steel material object:

from sectionproperties.pre.pre import Material

steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, density=7.85e-6,
                 yield_strength=500, color='grey')

Refer to Creating Geometries, Meshes, and Material Properties for a more detailed explanation of the pre-processing stage.

Running an Analysis

The solver operates on a Section object and can perform four different analysis types:

  • Geometric Analysis: calculates area properties.

  • Plastic Analysis: calculates plastic properties.

  • Warping Analysis: calculates torsion and shear properties.

  • Stress Analysis: calculates cross-section stresses.

The geometric analysis can be performed individually. However in order to perform a warping or plastic analysis, a geometric analysis must first be performed. Further, in order to carry out a stress analysis, both a geometric and warping analysis must have already been executed. The program will display a helpful error if you try to run any of these analyses without first performing the prerequisite analyses.

The following example performs a geometric and warping analysis on the circular cross-section defined in the previous section with steel used as the material property:

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


steel = Material(name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, density=7.85e-6,
                 yield_strength=500, color='grey')
geometry = primitive_sections.circular_section(d=50, n=64, material=steel)
geometry.create_mesh(mesh_sizes=[2.5])  # Adds the mesh to the geometry

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

Refer to Running an Analysis for a more detailed explanation of the solver stage.

Viewing the Results

Once an analysis has been performed, a number of methods belonging to the Section object can be called to present the cross-section results in a number of different formats. For example the cross-section properties can be printed to the terminal, a plot of the centroids displayed and the cross-section stresses visualised in a contour plot.

The following example analyses a 200 PFC section. The cross-section properties are printed to the terminal and a plot of the centroids is displayed:

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

geometry = steel_sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
geometry.create_mesh(mesh_sizes=[2.5])  # Adds the mesh to the geometry

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

section.plot_centroids()
section.display_results()
_images/pfc_centroids.png

Plot of the elastic centroid and shear centre for the above example generated by plot_centroids()

Output generated by the display_results() method:

Section Properties:
A       = 2.919699e+03
Perim.  = 6.776201e+02
Qx      = 2.919699e+05
Qy      = 7.122414e+04
cx      = 2.439434e+01
cy      = 1.000000e+02
Ixx_g   = 4.831277e+07
Iyy_g   = 3.392871e+06
Ixy_g   = 7.122414e+06
Ixx_c   = 1.911578e+07
Iyy_c   = 1.655405e+06
Ixy_c   = -6.519258e-09
Zxx+    = 1.911578e+05
Zxx-    = 1.911578e+05
Zyy+    = 3.271186e+04
Zyy-    = 6.786020e+04
rx      = 8.091461e+01
ry      = 2.381130e+01
phi     = 0.000000e+00
I11_c   = 1.911578e+07
I22_c   = 1.655405e+06
Z11+    = 1.911578e+05
Z11-    = 1.911578e+05
Z22+    = 3.271186e+04
Z22-    = 6.786020e+04
r11     = 8.091461e+01
r22     = 2.381130e+01
J       = 1.011522e+05
Iw      = 1.039437e+10
x_se    = -2.505109e+01
y_se    = 1.000000e+02
x_st    = -2.505109e+01
y_st    = 1.000000e+02
x1_se   = -4.944543e+01
y2_se   = 4.905074e-06
A_sx    = 9.468851e+02
A_sy    = 1.106943e+03
A_s11   = 9.468854e+02
A_s22   = 1.106943e+03
betax+  = 1.671593e-05
betax-  = -1.671593e-05
betay+  = -2.013448e+02
betay-  = 2.013448e+02
beta11+ = 1.671593e-05
beta11- = -1.671593e-05
beta22+ = -2.013448e+02
beta22- = 2.013448e+02
x_pc    = 1.425046e+01
y_pc    = 1.000000e+02
Sxx     = 2.210956e+05
Syy     = 5.895923e+04
SF_xx+  = 1.156613e+00
SF_xx-  = 1.156613e+00
SF_yy+  = 1.802381e+00
SF_yy-  = 8.688337e-01
x11_pc  = 1.425046e+01
y22_pc  = 1.000000e+02
S11     = 2.210956e+05
S22     = 5.895923e+04
SF_11+  = 1.156613e+00
SF_11-  = 1.156613e+00
SF_22+  = 1.802381e+00
SF_22-  = 8.688337e-01

Refer to Viewing the Results for a more detailed explanation of the post-processing stage.

Creating Geometries, Meshes, and Material Properties

Before performing a cross-section analysis, the geometry of the cross-section and a finite element mesh must be created. Optionally, material properties can be applied to different regions of the cross-section. If materials are not applied, then a default material is used to report the geometric properties.

Section Geometry

New in v2.0.0 - There are two types of geometry objects in sectionproperties:

  • The Geometry class, for section geometries with a single, contiguous region

  • The CompoundGeometry class, comprised of two or more Geometry objects

Geometry Class

class sectionproperties.pre.geometry.Geometry(geom: Polygon, material: pre.Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), control_points: Optional[Union[Point, List[float, float]]] = None, tol=12)[source]

Class for defining the geometry of a contiguous section of a single material.

Provides an interface for the user to specify the geometry defining a section. A method is provided for generating a triangular mesh, transforming the section (e.g. translation, rotation, perimeter offset, mirroring), aligning the geometry to another geometry, and designating stress recovery points.

Variables
  • geom (shapely.geometry.Polygon) – a Polygon object that defines the geometry

  • material (Optional[Material]) – Optional, a Material to associate with this geometry

  • control_point – Optional, an (x, y) coordinate within the geometry that represents a pre-assigned control point (aka, a region identification point) to be used instead of the automatically assigned control point generated with shapely.geometry.Polygon.representative_point().

  • tol – Optional, default is 12. Number of decimal places to round the geometry vertices to. A lower value may reduce accuracy of geometry but increases precision when aligning geometries to each other.

A Geometry is instantiated with two arguments:

  1. A shapely.geometry.Polygon object

  2. An optional Material object

Note

If a Material is not given, then the default material is assigned to the Geometry.material attribute. The default material has an elastic modulus of 1, a Poisson’s ratio of 0 and a yield strength of 1.

CompoundGeometry Class

class sectionproperties.pre.geometry.CompoundGeometry(geoms: Union[MultiPolygon, List[Geometry]])[source]

Class for defining a geometry of multiple distinct regions, each potentially having different material properties.

CompoundGeometry instances are composed of multiple Geometry objects. As with Geometry objects, CompoundGeometry objects have methods for generating a triangular mesh over all geometries, transforming the collection of geometries as though they were one (e.g. translation, rotation, and mirroring), and aligning the CompoundGeometry to another Geometry (or to another CompoundGeometry).

CompoundGeometry objects can be created directly between two or more Geometry objects by using the + operator.

Variables

geoms (Union[shapely.geometry.MultiPolygon, List[Geometry]]) – either a list of Geometry objects or a shapely.geometry.MultiPolygon instance.

A CompoundGeometry is instantiated with one argument which can be one of two types:

  1. A list of Geometry objects; or

  2. A shapely.geometry.MultiPolygon

Note

A CompoundGeometry does not have a .material attribute and therefore, a Material cannot be assigned to a CompoundGeometry directly. Since a CompoundGeometry is simply a combination of Geometry objects, the Material(s) should be assigned to the individual Geometry objects that comprise the CompoundGeometry. CompoundGeometry objects created from a shapely.geometry.MultiPolygon will have its constituent Geometry objects assigned the default material.

Defining Material Properties

Materials are defined in sectionproperties by creating a Material object:

class sectionproperties.pre.pre.Material(name: str, elastic_modulus: float, poissons_ratio: float, yield_strength: float, density: float, color: str)[source]

Class for structural materials.

Provides a way of storing material properties related to a specific material. The color can be a multitude of different formats, refer to https://matplotlib.org/api/colors_api.html and https://matplotlib.org/examples/color/named_colors.html for more information.

Parameters
  • name (string) – Material name

  • elastic_modulus (float) – Material modulus of elasticity

  • poissons_ratio (float) – Material Poisson’s ratio

  • yield_strength (float) – Material yield strength

  • density (float) – Material density (mass per unit volume)

  • color (matplotlib.colors) – Material color for rendering

Variables
  • name (string) – Material name

  • elastic_modulus (float) – Material modulus of elasticity

  • poissons_ratio (float) – Material Poisson’s ratio

  • shear_modulus (float) – Material shear modulus, derived from the elastic modulus and Poisson’s ratio assuming an isotropic material

  • density (float) – Material density (mass per unit volume)

  • yield_strength (float) – Material yield strength

  • color (matplotlib.colors) – Material color for rendering

The following example creates materials for concrete, steel and timber:

from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, density=2.4e-6,
        yield_strength=32, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, density=7.85e-6,
        yield_strength=500, color='grey'
)
timber = Material(
    name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, density=6.5e-7,
        yield_strength=20, color='burlywood'
)

Each Geometry contains its own material definition, which is stored in the .material attribute. A geometry’s material may be altered at any time by simply assigning a new Material to the .material attribute.

Warning

To understand how material properties affect the results reported by sectionproperties, see How Material Properties Affect Results.

Creating Section Geometries

In addition to creating geometries directly from shapely.geometry.Polygon and/or shapely.geometry.MultiPolygon objects, there are other ways to create geometries for analysis:

  1. From lists of points, facets, hole regions, and control regions

  2. From .dxf files

  3. From .3dm files

  4. From Rhino encodings

  5. Using transformation methods on existing geometries and/or by applying set operations (e.g. |, +, -, &, ^)

  6. From sectionproperties’s section library

For the first two approaches, an optional .material parameter can be passed containing a Material (or list of Material objects) to associate with the newly created geometry(ies). The material attribute can be altered afterward in a Geometry object at any time by simply assigning a different Material to the .material attribute.

Geometry from points, facets, holes, and control points

In sectionproperties v1.x.x, geometries were created by specifying lists of points, facets, holes, and control_points. This functionality has been preserved in v2.0.0 by using the from_points() class method.

sectionproperties.pre.geometry.Geometry.from_points(points: List[List[float]], facets: List[List[int]], control_points: List[List[float]], holes: Optional[List[List[float]]] = None, material: Optional[Material] = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'))

An interface for the creation of Geometry objects through the definition of points, facets, and holes.

Variables
  • points (list[list[float, float]]) – List of points (x, y) defining the vertices of the section geometry. If facets are not provided, it is a assumed the that the list of points are ordered around the perimeter, either clockwise or anti-clockwise.

  • facets (list[list[int, int]]) – A list of (start, end) indexes of vertices defining the edges of the section geoemtry. Can be used to define both external and internal perimeters of holes. Facets are assumed to be described in the order of exterior perimeter, interior perimeter 1, interior perimeter 2, etc.

  • control_points – An (x, y) coordinate that describes the distinct, contiguous, region of a single material within the geometry. Must be entered as a list of coordinates, e.g. [[0.5, 3.2]] Exactly one point is required for each geometry with a distinct material. If there are multiple distinct regions, then use CompoundGeometry.from_points()

  • holes (list[list[float, float]]) – Optional. A list of points (x, y) that define interior regions as being holes or voids. The point can be located anywhere within the hole region. Only one point is required per hole region.

  • material – Optional. A Material object that is to be assigned. If not given, then the DEFAULT_MATERIAL will be used.

For simple geometries (i.e. single-region shapes without holes), if the points are an ordered sequence of coordinates, only the points argument is required (facets, holes, and control_points are optional). If the geometry has holes, then all arguments are required.

If the geometry has multiple regions, then the from_points() class method must be used.

sectionproperties.pre.geometry.CompoundGeometry.from_points(points: List[List[float]], facets: List[List[int]], control_points: List[List[float]], holes: Optional[List[List[float]]] = None, materials: Optional[List[Material]] = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'))

An interface for the creation of CompoundGeometry objects through the definition of points, facets, holes, and control_points. Geometries created through this method are expected to be non-ambiguous meaning that no “overlapping” geometries exists and that nodal connectivity is maintained (e.g. there are no nodes “overlapping” with facets without nodal connectivity).

Variables
  • points (list[list[float]]) – List of points (x, y) defining the vertices of the section geometry. If facets are not provided, it is a assumed the that the list of points are ordered around the perimeter, either clockwise or anti-clockwise

  • facets (list[list[int]]) – A list of (start, end) indexes of vertices defining the edges of the section geoemtry. Can be used to define both external and internal perimeters of holes. Facets are assumed to be described in the order of exterior perimeter, interior perimeter 1, interior perimeter 2, etc.

  • control_points (list[list[float]]) – Optional. A list of points (x, y) that define non-interior regions as being distinct, contiguous, and having one material. The point can be located anywhere within region. Only one point is permitted per region. The order of control_points must be given in the same order as the order that polygons are created by ‘facets’. If not given, then points will be assigned automatically using shapely.geometry.Polygon.representative_point()

  • holes (list[list[float]]) – Optional. A list of points (x, y) that define interior regions as being holes or voids. The point can be located anywhere within the hole region. Only one point is required per hole region.

  • materials (list[Material]) – Optional. A list of Material objects that are to be assigned, in order, to the regions defined by the given control_points. If not given, then the DEFAULT_MATERIAL will be used for each region.

See Creating Custom Geometry for an example of this implementation.

Geometry from .dxf Files

Geometries can now be created from .dxf files using the sectionproperties.pre.geometry.Geometry.from_dxf() method. The returned geometry will either be a Geometry or CompoundGeometry object depending on the geometry in the file (i.e. the number of contiguous regions).

sectionproperties.pre.geometry.Geometry.from_dxf(dxf_filepath: Union[str, Path]) Union[Geometry, CompoundGeometry]

An interface for the creation of Geometry objects from CAD .dxf files.

Variables

dxf_filepath (Union[str, pathlib.Path]) – A path-like object for the dxf file

sectionproperties.pre.geometry.CompoundGeometry.from_dxf(dxf_filepath: Union[str, Path]) Union[Geometry, CompoundGeometry]

An interface for the creation of Geometry objects from CAD .dxf files.

Variables

dxf_filepath (Union[str, pathlib.Path]) – A path-like object for the dxf file

Geometry from Rhino

Geometries can now be created from .3dm files and BREP encodings. Various limitations and assumptions need to be acknowledged:

  • sectional analysis is based in 2d and Rhino is a 3d environment.

  • the recognised Rhino geometries are limited to planer-single-surfaced BREPs.

  • Rhino uses NURBS for surface boundaries and sectionproperties uses piecewise linear boundaries.

  • a search plane is defined.

See the keyword arguments below that are used to search and simplify the Rhino geometry.

Rhino files are read via the class methods sectionproperties.pre.geometry.Geometry.from_3dm() and sectionproperties.pre.geometry.CompoundGeometry.from_3dm(). Each class method returns the respective objects.

sectionproperties.pre.geometry.Geometry.from_3dm(filepath: Union[str, Path], **kwargs) Geometry

Class method to create a Geometry from the objects in a Rhino .3dm file.

Parameters
  • filepath (Union[str, pathlib.Path]) – File path to the rhino .3dm file.

  • kwargs – See below.

Raises

RuntimeError – A RuntimeError is raised if two or more polygons are found. This is dependent on the keyword arguments. Try adjusting the keyword arguments if this error is raised.

Returns

A Geometry object.

Return type

Geometry

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

sectionproperties.pre.geometry.CompoundGeometry.from_3dm(filepath: Union[str, Path], **kwargs) CompoundGeometry

Class method to create a CompoundGeometry from the objects in a Rhino 3dm file.

Parameters
  • filepath (Union[str, pathlib.Path]) – File path to the rhino .3dm file.

  • kwargs – See below.

Returns

A CompoundGeometry object.

Return type

CompoundGeometry

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

Geometry objects can also be created from encodings of Rhino BREP.

sectionproperties.pre.geometry.Geometry.from_rhino_encoding(r3dm_brep: str, **kwargs) Geometry

Load an encoded single surface planer brep.

Parameters
  • r3dm_brep (str) – A Rhino3dm.Brep encoded as a string.

  • kwargs – See below.

Returns

A Geometry object found in the encoded string.

Return type

Geometry

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

More advanced filtering can be achieved by working with the Shapely geometries directly. These can be accessed by load_3dm() and load_rhino_brep_encoding().

sectionproperties.pre.rhino.load_3dm(r3dm_filepath: Union[Path, str], **kwargs) List[Polygon][source]

Load a Rhino .3dm file and import the single surface planer breps.

Parameters
  • r3dm_filepath (pathlib.Path or string) – File path to the rhino .3dm file.

  • kwargs – See below.

Raises

RuntimeError – A RuntimeError is raised if no polygons are found in the file. This is dependent on the keyword arguments. Try adjusting the keyword arguments if this error is raised.

Returns

List of Polygons found in the file.

Return type

List[shapely.geometry.Polygon]

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

sectionproperties.pre.rhino.load_brep_encoding(brep: str, **kwargs) Polygon[source]

Load an encoded single surface planer brep.

Parameters
  • brep (str) – Rhino3dm.Brep encoded as a string.

  • kwargs – See below.

Raises

RuntimeError – A RuntimeError is raised if no polygons are found in the encoding. This is dependent on the keyword arguments. Try adjusting the keyword arguments if this error is raised.

Returns

The Polygons found in the encoding string.

Return type

shapely.geometry.Polygon

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

Note

Dependencies for importing files from rhino are not included by default. To obtain the required dependencies install sectionproperties with the rhino option:

pip install sectionproperties[rhino]

Combining Geometries Using Set Operations

Both Geometry and CompoundGeometry objects can be manipulated using Python’s set operators:

  • | Bitwise OR - Performs a union on the two geometries

  • - Bitwise DIFFERENCE - Performs a subtraction, subtracting the second geometry from the first

  • & Bitwise AND - Performs an intersection operation, returning the regions of geometry common to both

  • ^ Bitwise XOR - Performs a symmetric difference operation, returning the regions of geometry that are not overlapping

  • + Addition - Combines two geometries into a CompoundGeometry

See Advanced Geometry Creation for an example using set operations.

sectionproperties Section Library

See Creating Section Geometries from the Section Library.

Manipulating Geometries

Each geometry instance is able to be manipulated in 2D space for the purpose of creating novel, custom section geometries that the user may require.

Note

Operations on geometries are non-destructive. For each operation, a new geometry object is returned.

This gives sectionproperties geoemtries a fluent API meaning that transformation methods can be chained together. Please see Advanced Geometry Creation for examples.

Aligning

sectionproperties.pre.geometry.Geometry.align_center(self, align_to: Optional[Union[Geometry, Tuple[float, float]]] = None)

Returns a new Geometry object, translated in both x and y, so that the the new object’s centroid will be aligned with the centroid of the object in ‘align_to’. If ‘align_to’ is an x, y coordinate, then the centroid will be aligned to the coordinate. If ‘align_to’ is None then the new object will be aligned with its centroid at the origin.

Parameters

align_to (Optional[Union[Geometry, Tuple[float, float]]]) – Another Geometry to align to or None (default is None)

Returns

Geometry object translated to new alignment

Return type

Geometry

sectionproperties.pre.geometry.Geometry.align_to(self, other: Union[Geometry, Tuple[float, float]], on: str, inner: bool = False) Geometry

Returns a new Geometry object, representing ‘self’ translated so that is aligned ‘on’ one of the outer bounding box edges of ‘other’.

If ‘other’ is a tuple representing an (x,y) coordinate, then the new Geometry object will represent ‘self’ translated so that it is aligned ‘on’ that side of the point.

Parameters
  • other (Union[Geometry, Tuple[float, float]]) – Either another Geometry or a tuple representing an (x,y) coordinate point that ‘self’ should align to.

  • on – A str of either “left”, “right”, “bottom”, or “top” indicating which side of ‘other’ that self should be aligned to.

  • inner (bool) – Default False. If True, align ‘self’ to ‘other’ in such a way that ‘self’ is aligned to the “inside” of ‘other’. In other words, align ‘self’ to ‘other’ on the specified edge so they overlap.

Returns

Geometry object translated to alignment location

Return type

Geometry

Mirroring

sectionproperties.pre.geometry.Geometry.mirror_section(self, axis: str = 'x', mirror_point: Union[List[float], str] = 'center')

Mirrors the geometry about a point on either the x or y-axis.

Parameters
  • axis (string) – Axis about which to mirror the geometry, ‘x’ or ‘y’

  • mirror_point (Union[list[float, float], str]) – Point about which to mirror the geometry (x, y). If no point is provided, mirrors the geometry about the centroid of the shape’s bounding box. Default = ‘center’.

Returns

New Geometry-object mirrored on ‘axis’ about ‘mirror_point’

Return type

Geometry

The following example mirrors a 200PFC section about the y-axis and the point (0, 0):

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = steel_sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
new_geometry = geometry.mirror_section(axis='y', mirror_point=[0, 0])

Rotating

sectionproperties.pre.geometry.Geometry.rotate_section(self, angle: float, rot_point: Union[List[float], str] = 'center', use_radians: bool = False)

Rotates the geometry and specified angle about a point. If the rotation point is not provided, rotates the section about the center of the geometry’s bounding box.

Parameters
  • angle (float) – Angle (degrees by default) by which to rotate the section. A positive angle leads to a counter-clockwise rotation.

  • rot_point (list[float, float]) – Optional. Point (x, y) about which to rotate the section. If not provided, will rotate about the center of the geometry’s bounding box. Default = ‘center’.

  • use_radians – Boolean to indicate whether ‘angle’ is in degrees or radians. If True, ‘angle’ is interpreted as radians.

Returns

New Geometry-object rotated by ‘angle’ about ‘rot_point’

Return type

Geometry

The following example rotates a 200UB25 section clockwise by 30 degrees:

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
new_geometry = geometry.rotate_section(angle=-30)

Shifting

sectionproperties.pre.geometry.Geometry.shift_points(self, point_idxs: Union[int, List[int]], dx: float = 0, dy: float = 0, abs_x: Optional[float] = None, abs_y: Optional[float] = None) Geometry

Translates one (or many points) in the geometry by either a relative amount or to a new absolute location. Returns a new Geometry representing the original with the selected point(s) shifted to the new location.

Points are identified by their index, their relative location within the points list found in self.points. You can call self.plot_geometry(labels="points") to see a plot with the points labeled to find the appropriate point indexes.

Parameters
  • point_idxs (Union[int, List[int]]) – An integer representing an index location or a list of integer index locations.

  • dx (float) – The number of units in the x-direction to shift the point(s) by

  • dy (float) – The number of units in the y-direction to shift the point(s) by

  • abs_x (Optional[float]) – Absolute x-coordinate in coordinate system to shift the point(s) to. If abs_x is provided, dx is ignored. If providing a list to point_idxs, all points will be moved to this absolute location.

  • abs_y (Optional[float]) – Absolute y-coordinate in coordinate system to shift the point(s) to. If abs_y is provided, dy is ignored. If providing a list to point_idxs, all points will be moved to this absolute location.

Returns

Geometry object with selected points translated to the new location.

Return type

Geometry

The following example expands the sides of a rectangle, one point at a time, to make it a square:

import sectionproperties.pre.library.primitive_sections as primitive_sections

geometry = primitive_sections.rectangular_section(d=200, b=150)

# Using relative shifting
one_pt_shifted_geom = geometry.shift_points(point_idxs=1, dx=50)

# Using absolute relocation
both_pts_shift_geom = one_pt_shift_geom.shift_points(point_idxs=2, abs_x=200)
sectionproperties.pre.geometry.Geometry.shift_section(self, x_offset=0.0, y_offset=0.0)

Returns a new Geometry object translated by ‘x_offset’ and ‘y_offset’.

Parameters
  • x_offset (float) – Distance in x-direction by which to shift the geometry.

  • y_offset (float) – Distance in y-direction by which to shift the geometry.

Returns

New Geometry-object shifted by ‘x_offset’ and ‘y_offset’

Return type

Geometry

Splitting

sectionproperties.pre.geometry.Geometry.split_section(self, point_i: Tuple[float, float], point_j: Optional[Tuple[float, float]] = None, vector: Union[Tuple[float, float], None, ndarray] = None) Tuple[List[Geometry], List[Geometry]]

Splits, or bisects, the geometry about a line, as defined by two points on the line or by one point on the line and a vector. Either point_j or vector must be given. If point_j is given, vector is ignored.

Returns a tuple of two lists each containing new Geometry instances representing the “top” and “bottom” portions, respectively, of the bisected geometry.

If the line is a vertical line then the “right” and “left” portions, respectively, are returned.

Parameters
  • point_i (Tuple[float, float]) – A tuple of (x, y) coordinates to define a first point on the line

  • point_j (Tuple[float, float]) – Optional. A tuple of (x, y) coordinates to define a second point on the line

  • vector (Union[Tuple[float, float], numpy.ndarray]) – Optional. A tuple or numpy ndarray of (x, y) components to define the line direction.

Returns

A tuple of lists containing Geometry objects that are bisected about the line defined by the two given points. The first item in the tuple represents the geometries on the “top” of the line (or to the “right” of the line, if vertical) and the second item represents the geometries to the “bottom” of the line (or to the “left” of the line, if vertical).

Return type

Tuple[List[Geometry], List[Geometry]]

The following example splits a 200PFC section about the y-axis:

import sectionproperties.pre.library.steel_sections as steel_sections
from shapely import LineString

geometry = steel_sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
right_geom, left_geom = geometry.split_section((0, 0), (0, 1))

Offsetting the Perimeter

sectionproperties.pre.geometry.Geometry.offset_perimeter(self, amount: float = 0, where: str = 'exterior', resolution: float = 12)

Dilates or erodes the section perimeter by a discrete amount.

Parameters
  • amount (float) – Distance to offset the section by. A -ve value “erodes” the section. A +ve value “dilates” the section.

  • where (str) – One of either “exterior”, “interior”, or “all” to specify which edges of the geometry to offset. If geometry has no interiors, then this parameter has no effect. Default is “exterior”.

  • resolution (float) – Number of segments used to approximate a quarter circle around a point

Returns

Geometry object translated to new alignment

Return type

Geometry

The following example erodes a 200PFC section by 2 mm:

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
new_geometry = geometry.offset_perimeter(amount=-2)
sectionproperties.pre.geometry.CompoundGeometry.offset_perimeter(self, amount: float = 0, where='exterior', resolution: float = 12)

Dilates or erodes the perimeter of a CompoundGeometry object by a discrete amount.

Parameters
  • amount (float) – Distance to offset the section by. A -ve value “erodes” the section. A +ve value “dilates” the section.

  • where (str) – One of either “exterior”, “interior”, or “all” to specify which edges of the geometry to offset. If geometry has no interiors, then this parameter has no effect. Default is “exterior”.

  • resolution (float) – Number of segments used to approximate a quarter circle around a point

Returns

Geometry object translated to new alignment

Return type

Geometry

The following example erodes a 200UB25 with a 12 plate stiffener section by 2 mm:

import sectionproperties.pre.library.steel_sections as steel_sections
import sectionproperties.pre.library.primitive_sections as primitive_sections

geometry_1 = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
geometry_2 = primitive_sections.rectangular_section(d=12, b=133)
compound = geometry_2.align_center(geometry_1).align_to(geometry_1, on="top") + geometry_1
new_geometry = compound.offset_perimeter(amount=-2)

Note

If performing a positive offset on a CompoundGeometry with multiple materials, ensure that the materials propagate as desired by performing a .plot_mesh() prior to performing any analysis.

Visualising the Geometry

Visualisation of geometry objects is best performed in the Jupyter computing environment, however, most visualisation can also be done in any environment which supports display of matplotlib plots.

There are generally two ways to visualise geometry objects:

  1. In the Jupyter computing environment, geometry objects utilise their underlying shapely.geometry.Polygon object’s _repr_svg_ method to show the geometry as it’s own representation.

  2. By using the plot_geometry() method

Geometry.plot_geometry(labels=['control_points'], title='Cross-Section Geometry', cp=True, legend=True, **kwargs)[source]

Plots the geometry defined by the input section.

Parameters
  • labels (list[str]) – A list of str which indicate which labels to plot. Can be one or a combination of “points”, “facets”, “control_points”, or an empty list to indicate no labels. Default is [“control_points”]

  • title (string) – Plot title

  • cp (bool) – If set to True, plots the control points

  • legend (bool) – If set to True, plots the legend

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example creates a CHS discretised with 64 points, with a diameter of 48 and thickness of 3.2, and plots the geometry:

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = steel_sections.circular_hollow_section(d=48, t=3.2, n=64)
geometry.plot_geometry()
_images/chs_geometry.png

Geometry generated by the above example.

Note

You can also use .plot_geometry() with CompoundGeometry objects

Generating a Mesh

A finite element mesh is required to perform a cross-section analysis. After a geometry has been created, a finite element mesh can then be created for the geometry by using the create_mesh() method:

Geometry.create_mesh(mesh_sizes: Union[float, List[float]], coarse: bool = False)[source]

Creates a quadratic triangular mesh from the Geometry object.

Parameters
  • mesh_sizes (Union[float, List[float]]) – A float describing the maximum mesh element area to be used within the Geometry-object finite-element mesh.

  • coarse (bool) – If set to True, will create a coarse mesh (no area or quality constraints)

Returns

Geometry-object with mesh data stored in .mesh attribute. Returned Geometry-object is self, not a new instance.

Return type

Geometry

The following example creates a circular cross-section with a diameter of 50 with 64 points, and generates a mesh with a maximum triangular area of 2.5:

import sectionproperties.pre.library.primitive_sections as primitive_sections

geometry = primitive_sections.circular_section(d=50, n=64)
geometry = geometry.create_mesh(mesh_sizes=2.5)
_images/circle_mesh.png

Mesh generated from the above geometry.

Warning

The length of mesh_sizes must match the number of regions in the geometry object.

Once the mesh has been created, it is stored within the geometry object and the geometry object can then be passed to Section for analysis.

Please see Running an Analysis for further information on performing analyses.

Creating Section Geometries from the Section Library

In order to make your life easier, there are a number of built-in functions that generate typical structural cross-sections, resulting in Geometry objects. These typical cross-sections reside in the sectionproperties.pre.library module.

Primitive Sections Library

Rectangular Section

sectionproperties.pre.library.primitive_sections.rectangular_section(b: float, d: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a rectangular section with the bottom left corner at the origin (0, 0), with depth d and width b.

Parameters
  • d (float) – Depth (y) of the rectangle

  • b (float) – Width (x) of the rectangle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a rectangular cross-section with a depth of 100 and width of 50, and generates a mesh with a maximum triangular area of 5:

from sectionproperties.pre.library.primitive_sections import rectangular_section

geometry = rectangular_section(d=100, b=50)
geometry.create_mesh(mesh_sizes=[5])
_images/rectangle_geometry.png

Rectangular section geometry.

_images/rectangle_mesh.png

Mesh generated from the above geometry.

Circular Section

sectionproperties.pre.library.primitive_sections.circular_section(d: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a solid circle centered at the origin (0, 0) with diameter d and using n points to construct the circle.

Parameters
  • d (float) – Diameter of the circle

  • n (int) – Number of points discretising the circle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a circular geometry with a diameter of 50 with 64 points, and generates a mesh with a maximum triangular area of 2.5:

from sectionproperties.pre.library.primitive_sections import circular_section

geometry = circular_section(d=50, n=64)
geometry.create_mesh(mesh_sizes=[2.5])
_images/circle_geometry.png

Circular section geometry.

_images/circle_mesh.png

Mesh generated from the above geometry.

Circular Section By Area

sectionproperties.pre.library.primitive_sections.circular_section_by_area(area: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a solid circle centered at the origin (0, 0) defined by its area, using n points to construct the circle.

Parameters
  • area (float) – Area of the circle

  • n (int) – Number of points discretising the circle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a circular geometry with an area of 200 with 32 points, and generates a mesh with a maximum triangular area of 5:

from sectionproperties.pre.library.primitive_sections import circular_section_by_area

geometry = circular_section_by_area(area=310, n=32)
geometry.create_mesh(mesh_sizes=[5])
_images/circle_area_geometry.png

Circular section by area geometry.

_images/circle_area_mesh.png

Mesh generated from the above geometry.

Elliptical Section

sectionproperties.pre.library.primitive_sections.elliptical_section(d_y: float, d_x: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a solid ellipse centered at the origin (0, 0) with vertical diameter d_y and horizontal diameter d_x, using n points to construct the ellipse.

Parameters
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • d_x (float) – Diameter of the ellipse in the x-dimension

  • n (int) – Number of points discretising the ellipse

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an elliptical cross-section with a vertical diameter of 25 and horizontal diameter of 50, with 40 points, and generates a mesh with a maximum triangular area of 1.0:

from sectionproperties.pre.library.primitive_sections import elliptical_section

geometry = elliptical_section(d_y=25, d_x=50, n=40)
geometry.create_mesh(mesh_sizes=[1.0])
_images/ellipse_geometry.png

Elliptical section geometry.

_images/ellipse_mesh.png

Mesh generated from the above geometry.

Triangular Section

sectionproperties.pre.library.primitive_sections.triangular_section(b: float, h: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a right angled triangle with points (0, 0), (b, 0), (0, h).

Parameters
  • b (float) – Base length of triangle

  • h (float) – Height of triangle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a triangular cross-section with a base width of 10 and height of 10, and generates a mesh with a maximum triangular area of 0.5:

from sectionproperties.pre.library.primitive_sections import triangular_section

geometry = triangular_section(b=10, h=10)
geometry.create_mesh(mesh_sizes=[0.5])
_images/triangle_geometry.png

Triangular section geometry.

_images/triangle_mesh.png

Mesh generated from the above geometry.

Triangular Radius Section

sectionproperties.pre.library.primitive_sections.triangular_radius_section(b: float, n_r: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a right angled isosceles triangle with points (0, 0), (b, 0), (0, h) and a concave radius on the hypotenuse.

Parameters
  • b (float) – Base length of triangle

  • n_r (int) – Number of points discretising the radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a triangular radius cross-section with a base width of 6, using n_r points to construct the radius, and generates a mesh with a maximum triangular area of 0.5:

from sectionproperties.pre.library.primitive_sections import triangular_radius_section

geometry = triangular_radius_section(b=6, n_r=16)
geometry.create_mesh(mesh_sizes=[0.5])
_images/triangle_radius_geometry.png

Triangular radius section geometry.

_images/triangle_radius_mesh.png

Mesh generated from the above geometry.

Cruciform Section

sectionproperties.pre.library.primitive_sections.cruciform_section(d: float, b: float, t: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a cruciform section centered at the origin (0, 0), with depth d, width b, thickness t and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the cruciform section

  • b (float) – Width of the cruciform section

  • t (float) – Thickness of the cruciform section

  • r (float) – Root radius of the cruciform section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a cruciform section with a depth of 250, a width of 175, a thickness of 12 and a root radius of 16, using 16 points to discretise the radius. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.primitive_sections import cruciform_section

geometry = cruciform_section(d=250, b=175, t=12, r=16, n_r=16)
geometry.create_mesh(mesh_sizes=[5.0])
_images/cruciform_geometry.png

Cruciform section geometry.

_images/cruciform_mesh.png

Mesh generated from the above geometry.

Steel Sections Library

Circular Hollow Section (CHS)

sectionproperties.pre.library.steel_sections.circular_hollow_section(d: float, t: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a circular hollow section (CHS) centered at the origin (0, 0), with diameter d and thickness t, using n points to construct the inner and outer circles.

Parameters
  • d (float) – Outer diameter of the CHS

  • t (float) – Thickness of the CHS

  • n (int) – Number of points discretising the inner and outer circles

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a CHS discretised with 64 points, with a diameter of 48 and thickness of 3.2, and generates a mesh with a maximum triangular area of 1.0:

from sectionproperties.pre.library.steel_sections import circular_hollow_section

geometry = circular_hollow_section(d=48, t=3.2, n=64)
geometry.create_mesh(mesh_sizes=[1.0])
_images/chs_geometry.png

CHS geometry.

_images/chs_mesh.png

Mesh generated from the above geometry.

Elliptical Hollow Section (EHS)

sectionproperties.pre.library.steel_sections.elliptical_hollow_section(d_y: float, d_x: float, t: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs an elliptical hollow section (EHS) centered at the origin (0, 0), with outer vertical diameter d_y, outer horizontal diameter d_x, and thickness t, using n points to construct the inner and outer ellipses.

Parameters
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • d_x (float) – Diameter of the ellipse in the x-dimension

  • t (float) – Thickness of the EHS

  • n (int) – Number of points discretising the inner and outer ellipses

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a EHS discretised with 30 points, with a outer vertical diameter of 25, outer horizontal diameter of 50, and thickness of 2.0, and generates a mesh with a maximum triangular area of 0.5:

from sectionproperties.pre.library.steel_sections import elliptical_hollow_section

geometry = elliptical_hollow_section(d_y=25, d_x=50, t=2.0, n=64)
geometry.create_mesh(mesh_sizes=[0.5])
_images/ehs_geometry.png

EHS geometry.

_images/ehs_mesh.png

Mesh generated from the above geometry.

Rectangular Hollow Section (RHS)

sectionproperties.pre.library.steel_sections.rectangular_hollow_section(b: float, d: float, t: float, r_out: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a rectangular hollow section (RHS) centered at (b/2, d/2), with depth d, width b, thickness t and outer radius r_out, using n_r points to construct the inner and outer radii. If the outer radius is less than the thickness of the RHS, the inner radius is set to zero.

Parameters
  • d (float) – Depth of the RHS

  • b (float) – Width of the RHS

  • t (float) – Thickness of the RHS

  • r_out (float) – Outer radius of the RHS

  • n_r (int) – Number of points discretising the inner and outer radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an RHS with a depth of 100, a width of 50, a thickness of 6 and an outer radius of 9, using 8 points to discretise the inner and outer radii. A mesh is generated with a maximum triangular area of 2.0:

from sectionproperties.pre.library.steel_sections import rectangular_hollow_section

geometry = rectangular_hollow_section(d=100, b=50, t=6, r_out=9, n_r=8)
geometry.create_mesh(mesh_sizes=[2.0])
_images/rhs_geometry.png

RHS geometry.

_images/rhs_mesh.png

Mesh generated from the above geometry.

Polygon Hollow Section

sectionproperties.pre.library.steel_sections.polygon_hollow_section(d: float, t: float, n_sides: int, r_in: float = 0, n_r: int = 1, rot: float = 0, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a regular hollow polygon section centered at (0, 0), with a pitch circle diameter of bounding polygon d, thickness t, number of sides n_sides and an optional inner radius r_in, using n_r points to construct the inner and outer radii (if radii is specified).

Parameters
  • d (float) – Pitch circle diameter of the outer bounding polygon (i.e. diameter of circle that passes through all vertices of the outer polygon)

  • t (float) – Thickness of the polygon section wall

  • r_in (float) – Inner radius of the polygon corners. By default, if not specified, a polygon with no corner radii is generated.

  • n_r (int) – Number of points discretising the inner and outer radii, ignored if no inner radii is specified

  • rot (float) – Initial counterclockwise rotation in degrees. By default bottom face is aligned with x axis.

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

Raises

Exception – Number of sides in polygon must be greater than or equal to 3

The following example creates an Octagonal section (8 sides) with a diameter of 200, a thickness of 6 and an inner radius of 20, using 12 points to discretise the inner and outer radii. A mesh is generated with a maximum triangular area of 5:

from sectionproperties.pre.library.steel_sections import polygon_hollow_section

geometry = polygon_hollow_section(d=200, t=6, n_sides=8, r_in=20, n_r=12)
geometry.create_mesh(mesh_sizes=[5])
_images/polygon_geometry.png

Octagonal section geometry.

_images/polygon_mesh.png

Mesh generated from the above geometry.

I Section

sectionproperties.pre.library.steel_sections.i_section(d: float, b: float, t_f: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs an I Section centered at (b/2, d/2), with depth d, width b, flange thickness t_f, web thickness t_w, and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the I Section

  • b (float) – Width of the I Section

  • t_f (float) – Flange thickness of the I Section

  • t_w (float) – Web thickness of the I Section

  • r (float) – Root radius of the I Section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an I Section with a depth of 203, a width of 133, a flange thickness of 7.8, a web thickness of 5.8 and a root radius of 8.9, using 16 points to discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

from sectionproperties.pre.library.steel_sections import i_section

geometry = i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16)
geometry.create_mesh(mesh_sizes=[3.0])
_images/isection_geometry.png

I Section geometry.

_images/isection_mesh.png

Mesh generated from the above geometry.

Monosymmetric I Section

sectionproperties.pre.library.steel_sections.mono_i_section(d: float, b_t: float, b_b: float, t_ft: float, t_fb: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a monosymmetric I Section centered at (max(b_t, b_b)/2, d/2), with depth d, top flange width b_t, bottom flange width b_b, top flange thickness t_ft, top flange thickness t_fb, web thickness t_w, and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the I Section

  • b_t (float) – Top flange width

  • b_b (float) – Bottom flange width

  • t_ft (float) – Top flange thickness of the I Section

  • t_fb (float) – Bottom flange thickness of the I Section

  • t_w (float) – Web thickness of the I Section

  • r (float) – Root radius of the I Section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a monosymmetric I Section with a depth of 200, a top flange width of 50, a top flange thickness of 12, a bottom flange width of 130, a bottom flange thickness of 8, a web thickness of 6 and a root radius of 8, using 16 points to discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

from sectionproperties.pre.library.steel_sections import mono_i_section

geometry = mono_i_section(
    d=200, b_t=50, b_b=130, t_ft=12, t_fb=8, t_w=6, r=8, n_r=16
)
geometry.create_mesh(mesh_sizes=[3.0])
_images/monoisection_geometry.png

I Section geometry.

_images/monoisection_mesh.png

Mesh generated from the above geometry.

Tapered Flange I Section

sectionproperties.pre.library.steel_sections.tapered_flange_i_section(d: float, b: float, t_f: float, t_w: float, r_r: float, r_f: float, alpha: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Tapered Flange I Section centered at (b/2, d/2), with depth d, width b, mid-flange thickness t_f, web thickness t_w, root radius r_r, flange radius r_f and flange angle alpha, using n_r points to construct the radii.

Parameters
  • d (float) – Depth of the Tapered Flange I Section

  • b (float) – Width of the Tapered Flange I Section

  • t_f (float) – Mid-flange thickness of the Tapered Flange I Section (measured at the point equidistant from the face of the web to the edge of the flange)

  • t_w (float) – Web thickness of the Tapered Flange I Section

  • r_r (float) – Root radius of the Tapered Flange I Section

  • r_f (float) – Flange radius of the Tapered Flange I Section

  • alpha (float) – Flange angle of the Tapered Flange I Section (degrees)

  • n_r (int) – Number of points discretising the radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a Tapered Flange I Section with a depth of 588, a width of 191, a mid-flange thickness of 27.2, a web thickness of 15.2, a root radius of 17.8, a flange radius of 8.9 and a flange angle of 8°, using 16 points to discretise the radii. A mesh is generated with a maximum triangular area of 20.0:

from sectionproperties.pre.library.steel_sections import tapered_flange_i_section

geometry = tapered_flange_i_section(
    d=588, b=191, t_f=27.2, t_w=15.2, r_r=17.8, r_f=8.9, alpha=8, n_r=16
)
geometry.create_mesh(mesh_sizes=[20.0])
_images/taperedisection_geometry.png

I Section geometry.

_images/taperedisection_mesh.png

Mesh generated from the above geometry.

Parallel Flange Channel (PFC) Section

sectionproperties.pre.library.steel_sections.channel_section(d: float, b: float, t_f: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a parallel-flange channel (PFC) section with the bottom left corner at the origin (0, 0), with depth d, width b, flange thickness t_f, web thickness t_w and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the PFC section

  • b (float) – Width of the PFC section

  • t_f (float) – Flange thickness of the PFC section

  • t_w (float) – Web thickness of the PFC section

  • r (float) – Root radius of the PFC section

  • n_r (int) – Number of points discretising the root radius

  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a PFC section with a depth of 250, a width of 90, a flange thickness of 15, a web thickness of 8 and a root radius of 12, using 8 points to discretise the root radius. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.steel_sections import channel_section

geometry = channel_section(d=250, b=90, t_f=15, t_w=8, r=12, n_r=8)
geometry.create_mesh(mesh_sizes=[5.0])
_images/pfc_geometry.png

PFC geometry.

_images/pfc_mesh.png

Mesh generated from the above geometry.

Tapered Flange Channel Section

sectionproperties.pre.library.steel_sections.tapered_flange_channel(d: float, b: float, t_f: float, t_w: float, r_r: float, r_f: float, alpha: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Tapered Flange Channel section with the bottom left corner at the origin (0, 0), with depth d, width b, mid-flange thickness t_f, web thickness t_w, root radius r_r, flange radius r_f and flange angle alpha, using n_r points to construct the radii.

Parameters
  • d (float) – Depth of the Tapered Flange Channel section

  • b (float) – Width of the Tapered Flange Channel section

  • t_f (float) – Mid-flange thickness of the Tapered Flange Channel section (measured at the point equidistant from the face of the web to the edge of the flange)

  • t_w (float) – Web thickness of the Tapered Flange Channel section

  • r_r (float) – Root radius of the Tapered Flange Channel section

  • r_f (float) – Flange radius of the Tapered Flange Channel section

  • alpha (float) – Flange angle of the Tapered Flange Channel section (degrees)

  • n_r (int) – Number of points discretising the radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a Tapered Flange Channel section with a depth of 10, a width of 3.5, a mid-flange thickness of 0.575, a web thickness of 0.475, a root radius of 0.575, a flange radius of 0.4 and a flange angle of 8°, using 16 points to discretise the radii. A mesh is generated with a maximum triangular area of 0.02:

from sectionproperties.pre.library.steel_sections import tapered_flange_channel

geometry = tapered_flange_channel(
    d=10, b=3.5, t_f=0.575, t_w=0.475, r_r=0.575, r_f=0.4, alpha=8, n_r=16
)
geometry.create_mesh(mesh_sizes=[0.02])
_images/taperedchannel_geometry.png

Tapered flange channel geometry.

_images/taperedchannel_mesh.png

Mesh generated from the above geometry.

Tee Section

sectionproperties.pre.library.steel_sections.tee_section(d: float, b: float, t_f: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Tee section with the top left corner at (0, d), with depth d, width b, flange thickness t_f, web thickness t_w and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the Tee section

  • b (float) – Width of the Tee section

  • t_f (float) – Flange thickness of the Tee section

  • t_w (float) – Web thickness of the Tee section

  • r (float) – Root radius of the Tee section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a Tee section with a depth of 200, a width of 100, a flange thickness of 12, a web thickness of 6 and a root radius of 8, using 8 points to discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

from sectionproperties.pre.library.steel_sections import tee_section

geometry = tee_section(d=200, b=100, t_f=12, t_w=6, r=8, n_r=8)
geometry.create_mesh(mesh_sizes=[3.0])
_images/tee_geometry.png

Tee section geometry.

_images/tee_mesh.png

Mesh generated from the above geometry.

Angle Section

sectionproperties.pre.library.steel_sections.angle_section(d: float, b: float, t: float, r_r: float, r_t: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs an angle section with the bottom left corner at the origin (0, 0), with depth d, width b, thickness t, root radius r_r and toe radius r_t, using n_r points to construct the radii.

Parameters
  • d (float) – Depth of the angle section

  • b (float) – Width of the angle section

  • t (float) – Thickness of the angle section

  • r_r (float) – Root radius of the angle section

  • r_t (float) – Toe radius of the angle section

  • n_r (int) – Number of points discretising the radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an angle section with a depth of 150, a width of 100, a thickness of 8, a root radius of 12 and a toe radius of 5, using 16 points to discretise the radii. A mesh is generated with a maximum triangular area of 2.0:

from sectionproperties.pre.library.steel_sections import angle_section

geometry = angle_section(d=150, b=100, t=8, r_r=12, r_t=5, n_r=16)
geometry.create_mesh(mesh_sizes=[2.0])
_images/angle_geometry.png

Angle section geometry.

_images/angle_mesh.png

Cee Section

sectionproperties.pre.library.steel_sections.cee_section(d: float, b: float, l: float, t: float, r_out: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Cee section (typical of cold-formed steel) with the bottom left corner at the origin (0, 0), with depth d, width b, lip l, thickness t and outer radius r_out, using n_r points to construct the radius. If the outer radius is less than the thickness of the Cee Section, the inner radius is set to zero.

Parameters
  • d (float) – Depth of the Cee section

  • b (float) – Width of the Cee section

  • l (float) – Lip of the Cee section

  • t (float) – Thickness of the Cee section

  • r_out (float) – Outer radius of the Cee section

  • n_r (int) – Number of points discretising the outer radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

Raises

Exception – Lip length must be greater than the outer radius

The following example creates a Cee section with a depth of 125, a width of 50, a lip of 30, a thickness of 1.5 and an outer radius of 6, using 8 points to discretise the radius. A mesh is generated with a maximum triangular area of 0.25:

from sectionproperties.pre.library.steel_sections import cee_section

geometry = cee_section(d=125, b=50, l=30, t=1.5, r_out=6, n_r=8)
geometry.create_mesh(mesh_sizes=[0.25])
_images/cee_geometry.png

Cee section geometry.

_images/cee_mesh.png

Zed Section

sectionproperties.pre.library.steel_sections.zed_section(d: float, b_l: float, b_r: float, l: float, t: float, r_out: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a zed section with the bottom left corner at the origin (0, 0), with depth d, left flange width b_l, right flange width b_r, lip l, thickness t and outer radius r_out, using n_r points to construct the radius. If the outer radius is less than the thickness of the Zed Section, the inner radius is set to zero.

Parameters
  • d (float) – Depth of the zed section

  • b_l (float) – Left flange width of the Zed section

  • b_r (float) – Right flange width of the Zed section

  • l (float) – Lip of the Zed section

  • t (float) – Thickness of the Zed section

  • r_out (float) – Outer radius of the Zed section

  • n_r (int) – Number of points discretising the outer radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a zed section with a depth of 100, a left flange width of 40, a right flange width of 50, a lip of 20, a thickness of 1.2 and an outer radius of 5, using 8 points to discretise the radius. A mesh is generated with a maximum triangular area of 0.15:

from sectionproperties.pre.library.steel_sections import zed_section

geometry = zed_section(d=100, b_l=40, b_r=50, l=20, t=1.2, r_out=5, n_r=8)
geometry.create_mesh(mesh_sizes=[0.15])
_images/zed_geometry.png

zed section geometry.

_images/zed_mesh.png

Box Girder Section

sectionproperties.pre.library.steel_sections.box_girder_section(d: float, b_t: float, b_b: float, t_ft: float, t_fb: float, t_w: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'))[source]

Constructs a box girder section centered at at (max(b_t, b_b)/2, d/2), with depth d, top width b_t, bottom width b_b, top flange thickness t_ft, bottom flange thickness t_fb and web thickness t_w.

Parameters
  • d (float) – Depth of the Box Girder section

  • b_t (float) – Top width of the Box Girder section

  • b_b (float) – Bottom width of the Box Girder section

  • t_ft (float) – Top flange thickness of the Box Girder section

  • t_fb (float) – Bottom flange thickness of the Box Girder section

  • t_w (float) – Web thickness of the Box Girder section

The following example creates a Box Girder section with a depth of 1200, a top width of 1200, a bottom width of 400, a top flange thickness of 16, a bottom flange thickness of 12 and a web thickness of 8. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.steel_sections import box_girder_section

geometry = box_girder_section(d=1200, b_t=1200, b_b=400, t_ft=100, t_fb=80, t_w=50)
geometry.create_mesh(mesh_sizes=[200.0])
_images/box_girder_geometry.png

Box Girder geometry.

_images/box_girder_mesh.png

Mesh generated from the above geometry.

Bulb Section

sectionproperties.pre.library.steel_sections.bulb_section(d: float, b: float, t: float, r: float, n_r: int, d_b: Optional[float] = None, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a bulb section with the bottom left corner at the point (-t / 2, 0), with depth d, bulb depth d_b, bulb width b, web thickness t and radius r, using n_r points to construct the radius.

Parameters
  • d (float) – Depth of the section

  • b (float) – Bulb width

  • t (float) – Web thickness

  • r (float) – Bulb radius

  • d_b (float) – Depth of the bulb (automatically calculated for standard sections, if provided the section may have sharp edges)

  • n_r (int) – Number of points discretising the radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a bulb section with a depth of 240, a width of 34, a web thickness of 12 and a bulb radius of 16, using 16 points to discretise the radius. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.steel_sections import bulb_section

geometry = bulb_section(d=240, b=34, t=12, r=10, n_r=16)
geometry.create_mesh(mesh_sizes=[5.0])
_images/bulb_geometry.png

Bulb section geometry.

_images/bulb_mesh.png

Mesh generated from the above geometry.

Concrete Sections Library

Concrete Rectangular Section

sectionproperties.pre.library.concrete_sections.concrete_rectangular_section(b: float, d: float, dia_top: float, n_top: int, dia_bot: float, n_bot: int, n_circle: int, cover: float, dia_side: Optional[float] = None, n_side: int = 0, area_top: Optional[float] = None, area_bot: Optional[float] = None, area_side: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) CompoundGeometry[source]

Constructs a concrete rectangular section of width b and depth d, with n_top top steel bars of diameter dia_top, n_bot bottom steel bars of diameter dia_bot, n_side left & right side steel bars of diameter dia_side discretised with n_circle points with equal side and top/bottom cover to the steel.

Parameters
  • b (float) – Concrete section width

  • d (float) – Concrete section depth

  • dia_top (float) – Diameter of the top steel reinforcing bars

  • n_top (int) – Number of top steel reinforcing bars

  • dia_bot (float) – Diameter of the bottom steel reinforcing bars

  • n_bot (int) – Number of bottom steel reinforcing bars

  • n_circle (int) – Number of points discretising the steel reinforcing bars

  • cover (float) – Side and bottom cover to the steel reinforcing bars

  • dia_side (float) – If provided, diameter of the side steel reinforcing bars

  • n_side (int) – If provided, number of side bars either side of the section

  • area_top (float) – If provided, constructs top reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • area_bot (float) – If provided, constructs bottom reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • area_side (float) – If provided, constructs side reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • conc_mat – Material to associate with the concrete

  • steel_mat – Material to associate with the steel

Raises

ValueError – If the number of bars is not greater than or equal to 2 in an active layer

The following example creates a 600D x 300W concrete beam with 3N20 bottom steel reinforcing bars and 30 mm cover:

from sectionproperties.pre.library.concrete_sections import concrete_rectangular_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_rectangular_section(
    b=300, d=600, dia_top=20, n_top=0, dia_bot=20, n_bot=3, n_circle=24, cover=30,
    conc_mat=concrete, steel_mat=steel
)
geometry.create_mesh(mesh_sizes=[500])
_images/concrete_rectangular_section_geometry.png

Concrete rectangular section geometry.

_images/concrete_rectangular_section_mesh.png

Mesh generated from the above geometry.

Concrete Column Section

sectionproperties.pre.library.concrete_sections.concrete_column_section(b: float, d: float, cover: float, n_bars_b: int, n_bars_d: int, dia_bar: float, bar_area: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), filled: bool = False, n_circle: int = 4) CompoundGeometry[source]

Constructs a concrete rectangular section of width b and depth d, with steel bar reinforcing organized as an n_bars_b by n_bars_d array, discretised with n_circle points with equal sides and top/bottom cover to the steel which is taken as the clear cover (edge of bar to edge of concrete).

Parameters
  • b (float) – Concrete section width, parallel to the x-axis

  • d (float) – Concrete section depth, parallel to the y-axis

  • cover (float) – Clear cover, calculated as distance from edge of reinforcing bar to edge of section.

  • n_bars_b (int) – Number of bars placed across the width of the section, minimum 2.

  • n_bars_d (int) – Number of bars placed across the depth of the section, minimum 2.

  • dia_bar (float) – Diameter of reinforcing bars. Used for calculating bar placement and, optionally, for calculating the bar area for section capacity calculations.

  • bar_area (float) – Area of reinforcing bars. Used for section capacity calculations. If not provided, then dia_bar will be used to calculate the bar area.

  • conc_mat (sectionproperties.pre.pre.Material) – Material to associate with the concrete

  • steel_mat (sectionproperties.pre.pre.Material) – Material to associate with the reinforcing steel

  • filled (bool) – When True, will populate the concrete section with an equally spaced 2D array of reinforcing bars numbering ‘n_bars_b’ by ‘n_bars_d’. When False, only the bars around the perimeter of the array will be present.

  • n_circle (int) – The number of points used to discretize the circle of the reinforcing bars. The bars themselves will have an exact area of ‘bar_area’ regardless of the number of points used in the circle. Useful for making the reinforcing bars look more circular when plotting the concrete section.

Raises

ValueError – If the number of bars in either ‘n_bars_b’ or ‘n_bars_d’ is not greater than or equal to 2.

The following example creates a 600D x 300W concrete column with 25 mm diameter reinforcing bars each with 500 mm**2 area and 35 mm cover in a 3x6 array without the interior bars being filled:

from sectionproperties.pre.library.concrete_sections import concrete_column_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_column_section(
    b=300, d=600, dia_bar=25, bar_area=500, cover=35, n_bars_b=3, n_bars_d=6,
    conc_mat=concrete, steel_mat=steel, filled=False, n_circle=4
)
geometry.create_mesh(mesh_sizes=[500])

Concrete Tee Section

sectionproperties.pre.library.concrete_sections.concrete_tee_section(b: float, d: float, b_f: float, d_f: float, dia_top: float, n_top: int, dia_bot: float, n_bot: int, n_circle: int, cover: float, area_top: Optional[float] = None, area_bot: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) CompoundGeometry[source]

Constructs a concrete tee section of width b, depth d, flange width b_f and flange depth d_f, with n_top top steel bars of diameter dia_top, n_bot bottom steel bars of diameter dia_bot, discretised with n_circle points with equal side and top/bottom cover to the steel.

Parameters
  • b (float) – Concrete section width

  • d (float) – Concrete section depth

  • b_f (float) – Concrete section flange width

  • d_f (float) – Concrete section flange depth

  • dia_top (float) – Diameter of the top steel reinforcing bars

  • n_top (int) – Number of top steel reinforcing bars

  • dia_bot (float) – Diameter of the bottom steel reinforcing bars

  • n_bot (int) – Number of bottom steel reinforcing bars

  • n_circle (int) – Number of points discretising the steel reinforcing bars

  • cover (float) – Side and bottom cover to the steel reinforcing bars

  • area_top (float) – If provided, constructs top reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • area_bot (float) – If provided, constructs bottom reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • conc_mat – Material to associatewith the concrete

  • steel_mat – Material toassociate with the steel

Raises

ValueErorr – If the number of bars is not greater than or equal to 2 in an active layer

The following example creates a 900D x 450W concrete beam with a 1200W x 250D flange, with 5N24 steel reinforcing bars and 30 mm cover:

from sectionproperties.pre.library.concrete_sections import concrete_tee_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_tee_section(
    b=450, d=900, b_f=1200, d_f=250, dia_top=24, n_top=0, dia_bot=24, n_bot=5,
    n_circle=24, cover=30, conc_mat=concrete, steel_mat=steel
)
geometry.create_mesh(mesh_sizes=[500])
_images/concrete_tee_section_geometry.png

Concrete tee section geometry.

_images/concrete_tee_section_mesh.png

Mesh generated from the above geometry.

Concrete Circular Section

sectionproperties.pre.library.concrete_sections.concrete_circular_section(d: float, n: int, dia: float, n_bar: int, n_circle: int, cover: float, area_conc: Optional[float] = None, area_bar: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) CompoundGeometry[source]

Constructs a concrete circular section of diameter d discretised with n points, with n_bar steel bars of diameter dia, discretised with n_circle points with equal side and bottom cover to the steel.

Parameters
  • d (float) – Concrete diameter

  • n (float) – Number of points discretising the concrete section

  • dia (float) – Diameter of the steel reinforcing bars

  • n_bar (int) – Number of steel reinforcing bars

  • n_circle (int) – Number of points discretising the steel reinforcing bars

  • cover (float) – Side and bottom cover to the steel reinforcing bars

  • area_conc (float) – If provided, constructs the concrete based on its area rather than diameter (prevents the underestimation of concrete area due to circle discretisation)

  • area_bar (float) – If provided, constructs reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to

  • conc_mat – Material to associate with the concrete

  • steel_mat – Material to associate with the steel

Raises

ValueErorr – If the number of bars is not greater than or equal to 2

The following example creates a 450DIA concrete column with with 6N20 steel reinforcing bars and 45 mm cover:

from sectionproperties.pre.library.concrete_sections import concrete_circular_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_circular_section(
    d=450, n=64, dia=20, n_bar=6, n_circle=24, cover=45, conc_mat=concrete, steel_mat=steel
)
geometry.create_mesh(mesh_sizes=[500])
_images/concrete_circular_section_geometry.png

Concrete circular section geometry.

_images/concrete_circular_section_mesh.png

Mesh generated from the above geometry.

Add Bar

sectionproperties.pre.library.concrete_sections.add_bar(geometry: Union[Geometry, CompoundGeometry], area: float, material: Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), x: float, y: float, n: int = 4) CompoundGeometry[source]

Adds a reinforcing bar to a sectionproperties geometry.

Bars are discretised by four points by default.

Parameters
  • geometry – Reinforced concrete geometry to which the new bar will be added

  • area – Bar cross-sectional area

  • material – Material object for the bar

  • x – x-position of the bar

  • y – y-position of the bar

  • n – Number of points to discretise the bar circle

Returns

Reinforced concrete geometry with added bar

Bridge Sections Library

Super Tee Girder Section

sectionproperties.pre.library.bridge_sections.super_t_girder_section(girder_type: int, girder_subtype: int = 2, w: float = 2100, t_w: Optional[float] = None, t_f: float = 75, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Super T Girder section to AS5100.5.

Parameters
  • girder_type (int) – Type of Super T (1 to 5)

  • girder_subtype (int) – Era Super T (1: pre-2001, 2:contemporary)

  • w (float) – Overall width of top flange

  • t_w (float) – Web thickness of the Super-T section (defaults to those of AS5100.5 Tb D3(B))

  • t_f (float) – Thickness of top flange (VIC (default) = 75 mm; NSW = 90 mm)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a T5 Super-T section with a 180 mm overlay slab and assigns the different material properties:

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

Dslab, w, t_f = 180, 2100, 75

precast = Material(
    name="65 MPa",
    elastic_modulus=37.4e3,
    poissons_ratio=0.2,
    yield_strength=65,
    density=2.4e-6,
    color="grey",
)
insitu = Material(
    name="40 MPa",
    elastic_modulus=32.8e3,
    poissons_ratio=0.2,
    yield_strength=40,
    density=2.4e-6,
    color="lightgrey",
)

super_t = bridge_sections.super_t_girder_section(girder_type=5, w=w, material=precast)
slab = primitive_sections.rectangular_section(
    d=Dslab, b=w, material=insitu
).shift_section(-w / 2, t_f)

geom = super_t + slab
geom.plot_geometry()
geom.create_mesh(mesh_sizes=[500])

sec = Section(geom)
sec.plot_mesh()

sec.calculate_geometric_properties()
sec.calculate_warping_properties()
sec.display_results(fmt=".3f")

Note that the properties are reported as modulus weighted properties (e.g. E.A) and can be normalized to the reference material by dividing by that elastic modulus:

A_65 = section.get_ea() / precast.elastic_modulus

The reported section centroids are already weighted.

_images/super_tee.png

Super Tee Girder.

I Girder Section

sectionproperties.pre.library.bridge_sections.i_girder_section(girder_type: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a precast I girder section to AS5100.5.

Parameters
  • girder_type (int) – Type of I Girder (1 to 4)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

As an example, replicate the table shown in AS5100.5 Fig. D1(A):

import pandas as pd
import sectionproperties.pre.library.bridge_sections as bridge_sections
from sectionproperties.analysis.section import Section

df = pd.DataFrame(columns=["Ag", "Zt", "Zb", "I", "dy", "th"])

for i in range(4):
    geom = bridge_sections.i_girder_section(girder_type=i + 1)
    dims = bridge_sections.get_i_girder_dims(girder_type=i + 1)
    d = sum(dims[-5:])
    geom.create_mesh(mesh_sizes=[200])
    geom.plot_geometry()
    sec = Section(geom)
    sec.plot_mesh()
    sec.calculate_geometric_properties()
    sec.calculate_warping_properties()

    A = sec.get_area()
    th = A / (sec.get_perimeter() / 2)

    df.loc[i] = [
        A,
        *(sec.get_z()[:2]),
        sec.get_ic()[0],
        d + sec.get_c()[1],
        th,
    ]

print(df)

Note that the section depth is obtained by summing the heights from the section dictionary in get_i_girder_dims().

_images/i_girder.png

I Girder.

Nastran Sections Library

See nastran_sections Module.

Advanced Geometry Creation

The below tutorial was created to demonstrate the creation of valid geometries for section analysis by combining multiple shapes.

Some key points to remember:

  1. Geometries of two different materials should not overlap (can create unpredictable results)

  2. If two geometries of the same materials are overlapping, then you should perform a union on the two sections

  3. Two different section geometries that share a common edge (facet) should also share the same nodes (do not leave “floating” nodes along common edges)

These are general points to remember for any finite element analysis.

Note

sectionproperties will not prevent the creation of these ambiguous sections. The flexibility of the new pre-processing engine (shapely) allows for a wide variety of intermediate modelling steps but the user must ensure that the final model is one that is appropriate for analysis.

Creating Merged Sections

For this example, we will create a custom section out of two similar “I” sections:

import sectionproperties.pre.library.steel_sections as steel_sections
import sectionproperties.analysis.section as cross_section

i_sec1 = steel_sections.i_section(d=250, b=150, t_f=13, t_w=10, r=12, n_r=12)
i_sec2 = i_sec1.rotate_section(45)
_images/i_sec1.png
_images/i_sec2.png

Assign a unique material to each geometry:

from sectionproperties.pre.pre import Material

mat1 = Material("Material_1", 200e3, 0.3, 100, 400, "red")
mat2 = Material("Material_2", 150e3, 0.2, 100, 200, "blue")  # Just some differing properties

i_sec1.material = mat1
i_sec2.material = mat2

Now, we can use the + operator to naively combine these two sections into a CompoundGeometry. Note, the two different materials:

i_sec1 + i_sec2
_images/basic_compound.png

When we plot the geometry, we will see that even though we have two materials, we only have one control point for both geometries:

(i_sec1 + i_sec2).plot_geometry()
_images/basic_compound_plot.png

If we went a few steps further by creating a mesh and then plotting that mesh as part of an analysis section, we would see the unpredictable result of the mesh:

cross_section.Section((i_sec1 + i_sec2).create_mesh([10])).plot_mesh()
_images/basic_combined_mesh_error.png

Preventing Ambiguity

To prevent ambiguity between geometries and their analytical regions, there are a few options we can take. We can perform a simple union operation but that will lose the material information for one of our sections: whichever section comes first in the operation will have it’s information preserved. In this example, we will use | (union) with i_sec2 taking precedence by being the first object in the operation:

i_sec2 | i_sec1
_images/basic_union.png

However, this is unsatisfactory as a solution. We want this section to more aptly represent a real section that might be created by cutting and welding two sections together.

Lets say we want the upright “I” section to be our main section and the diagonal section will be added on to it.

It is sometimes possible to do this in a quick operation, one which does not create nodes in common at the intersection points. Here, we will simply “slice” i_sec2 with i_sec1 and add it to i_sec1. This will create “floating nodes” along the common edges of i_sec2 and i_sec1 because the nodes are not a part of i_sec1:

(i_sec2 - i_sec1) + i_sec1
_images/combined_section_lucky.png
_images/combined_section_lucky_plot.png

Sometimes, we can get away with this as in this example. We can see in the plot that there are five distinct regions indicated with five control points.

When we are “unlucky”, sometimes gaps can be created (due to floating point errors) where the two sections meet and a proper hole might not be detected, resulting in an incorrect section.

Creating Nodes in Common

It is best practice to first create nodes in common on both sections and then combine them. For this, an extra step is required:

cut_2_from_1 = (i_sec1 - i_sec2)  # locates intersection nodes
sec_1_nodes_added = cut_2_from_1 | i_sec1

# This can also be done in one line
sec_1_nodes_added = (i_sec1 - i_sec2) | i_sec1

Now, when we use .plot_geometry(), we can see the additional nodes added to “section 1”:

sec_1_nodes_added.plot_geometry()
_images/sec1_nodes_added.png

The additional nodes from the cut portion are now merged as part of the “section 1” geometry.

At this point, we can use our “section 1 with additional nodes” to create our complete geometry:

analysis_geom = (i_sec2 - i_sec1) + sec_1_nodes_added
analysis_geom.plot_geometry()
_images/combined_section_common_nodes.png

And when we create our mesh and analysis section:

analysis_geom.create_mesh([10])
analysis_sec = cross_section.Section(analysis_geom)
analysis_sec.plot_mesh()
_images/complete_combined_mesh.png

We can see that the mesh represents how we expect the section to be.

Another example

Here, we will simply combine two squares with the default material:

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

s1 = primitive_sections.rectangular_section(1,1)
s2 = primitive_sections.rectangular_section(0.5,0.5).shift_section(1,0.25)
geometry = s1 + s2
geometry
_images/two_squares_basic.png

From the shapely vector representation, we can see that the squares are shaded red. This indicates an “invalid” geometry from shapely’s perspective because there are two polygons that share an edge. For this geometry, the intention is to have two squares that are connected on one side and so the red shading provided by the shapely representation tells us that we are getting what we expect.

Now, say this is not our final geometry and we actually want to have it rotated by 30 degrees:

geometry = geometry.rotate_section(30)
_images/two_squares_basic_rotated.png

Here, we can see that the shapely representation is now showing as green indicating a “valid” shapely geometry. Even though it is now valid for shapely, because it is green we know that these two polygons no longer share an edge because there is a miniscule separation between them as a result of a floating point error.

When we try to mesh this geometry, we will actually cause a crash with triangle, the meshing tool used behind-the-scenes by sectionproperties:

geometry.create_mesh(mesh_sizes=[0.2, 0.1]) # This may crash the kernel

The crash occurs because the distance between the two polygons is so small, even though they are separated and the space between them will not be meshed. The same crash would occur if the polygons were overlapping by this same small distance.

If we plot the geometry, you can see that each of the two squares has only four nodes and four facets and their relationship is only incidental. If their edges happen to perfectly align, they will be considered as one continuous section. If their edges do not perfectly align, they will be considered as discontinuous.

_images/two_squares_basic_rotated_plot.png

To remedy this, take the same approach as in the preceding example by creating intermediate nodes where the two polygons intersect by using set operations. If we subtract s2 from s1 then we will have the larger square with intermediate nodes created:

(s1 - s2).plot_geometry(labels=['points'])
_images/two_squares_large_square_int_points.png

Now, if we build the compound geometry up from this larger square with the intermediate points, then our section will work.:

geometry_fixed = (s1 - s2) + s2
geometry_fixed_rotated = geometry_fixed.rotate_section(angle=30)
geometry_rot.create_mesh(mesh_sizes=[0.2, 0.1])
geometry_rot.plot_geometry(labels=["points", "facets"])
section = Section(geometry_rot)
section.display_mesh_info()
_images/two_squares_fixed_plot.png

Another example (but with nested geometries)

This example demonstrates creating nested geometries using two different approaches. These approaches reflect the differences between how shapely (geometry pre-processor) “perceives” geometry and how Triangle (meshing tool) “perceives” geometry and how the modeller might adapt their input style depending on the situation.

The nested geometry we are trying to create looks as follows:

_images/nested_compound.png

In creating this geometry consider the following:

  • shapely has a concept of “z-ordering” where it is possible for one geometry to be “over” another geometry and for an overlap section to exist. When a hole is created in a polygon, it is only local to that polygon.

_images/shapely_z_order.png
  • Triangle does not have a concept of “z-ordering” so there is only a single plane which may have regions of different materials (specified with control points). When a hole is created in the plane, it “punches” through “all” polygons in the plane.

_images/triangle_no_z_order.png

To create the nested geometry using shapely, the code would be as follows:

mat1 = Material(name="Material 1", elastic_modulus=100, poissons_ratio=0.3, yield_strength=10, density=1e-6, color="yellow")
mat2 = Material(name="Material 2", elastic_modulus=100, poissons_ratio=0.3, yield_strength=10, density=1e-6, color="orange")
mat3 = Material(name="Material 3", elastic_modulus=100, poissons_ratio=0.3, yield_strength=10, density=1e-6, color="red")

sq1 = sections.rectangular_section(100, 100, material=mat1).align_center()
sq2 = sections.rectangular_section(75, 75, material=mat2).align_center()
sq3 = sections.rectangular_section(50, 50, material=mat3).align_center()
hole = sections.rectangular_section(25, 25).align_center()

compound = (
    (sq1 - sq2) # Create a big square with a medium hole in it and stack it over...
    + (sq2 - sq3) # ... a medium square with a medium-small hole in it and stack it over...
    + (sq3 - hole) # ...a medium-small square with a small hole in it.
)
compound
_images/nested_compound_via_shapely.png

To create the nested geometry using the Triangle interface, the code would be as follows:

points = [ # Points for four squares are created
    [-50.0, 50.0], # Square 1
    [50.0, 50.0],
    [50.0, -50.0],
    [-50.0, -50.0],
    [37.5, -37.5], # Square 2
    [37.5, 37.5],
    [-37.5, 37.5],
    [-37.5, -37.5],
    [25.0, -25.0], # Square 3
    [25.0, 25.0],
    [-25.0, 25.0],
    [-25.0, -25.0],
    [12.5, -12.5], # Square 4 (hole)
    [12.5, 12.5],
    [-12.5, 12.5],
    [-12.5, -12.5],
]

facets = [ # Facets trace each of the four squares
    [0, 1], # Square 1
    [1, 2],
    [2, 3],
    [3, 0],
    [4, 5], # Square 2
    [5, 6],
    [6, 7],
    [7, 4],
    [8, 9], # Square 3
    [9, 10],
    [10, 11],
    [11, 8],
    [12, 13], # Square 4 (hole)
    [13, 14],
    [14, 15],
    [15, 12],
]

control_points = [[-43.75, 0.0], [-31.25, 0.0], [-18.75, 0.0]] # Three squares
holes = [[0, 0]]

nested_compound = CompoundGeometry.from_points(
    points=points, facets=facets, control_points=control_points, holes=holes
)
nested_compound
_images/nested_compound_via_triangle.png

Notice how the shapely representation shows the squares overlapping each other instead of the squares fitting into the “hole below”.

Is one of these methods better than the other? Not necessarily. The shapely approach is suitable for manually creating the geometry whereas the Triangle approach is suitable for reading in serialized data from a file, for example.

And, for either case, when the compound geometry is meshed, we see this:

_images/nested_compound.png

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()

Viewing the Results

Printing a List of the Section Properties

A list of section properties that have been calculated by various analyses can be printed to the terminal using the display_results() method that belongs to every Section object.

Section.display_results(fmt='8.6e')[source]

Prints the results that have been calculated to the terminal.

Parameters

fmt (string) – Number formatting string

The following example displays the geometric section properties for a 100D x 50W rectangle with three digits after the decimal point:

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)
section.calculate_geometric_properties()

section.display_results(fmt='.3f')

Getting Specific Section Properties

Alternatively, there are a number of methods that can be called on the Section object to return a specific section property:

Section Area

Section.get_area()[source]
Returns

Cross-section area

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
area = section.get_area()

Section Perimeter

Section.get_perimeter()[source]
Returns

Cross-section perimeter

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
perimeter = section.get_perimeter()

Section Mass

Section.get_mass()[source]
Returns

Cross-section mass

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
perimeter = section.get_mass()

Axial Rigidity

If material properties have been specified, returns the axial rigidity of the section.

Section.get_ea()[source]
Returns

Modulus weighted area (axial rigidity)

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
ea = section.get_ea()

First Moments of Area

Section.get_q()[source]
Returns

First moments of area about the global axis (qx, qy)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(qx, qy) = section.get_q()

Second Moments of Area

Section.get_ig()[source]
Returns

Second moments of area about the global axis (ixx_g, iyy_g, ixy_g)

Return type

tuple(float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(ixx_g, iyy_g, ixy_g) = section.get_ig()
Section.get_ic()[source]
Returns

Second moments of area centroidal axis (ixx_c, iyy_c, ixy_c)

Return type

tuple(float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(ixx_c, iyy_c, ixy_c) = section.get_ic()
Section.get_ip()[source]
Returns

Second moments of area about the principal axis (i11_c, i22_c)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(i11_c, i22_c) = section.get_ip()

Elastic Centroid

Section.get_c()[source]
Returns

Elastic centroid (cx, cy)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(cx, cy) = section.get_c()

Section Moduli

Section.get_z()[source]
Returns

Elastic section moduli about the centroidal axis with respect to the top and bottom fibres (zxx_plus, zxx_minus, zyy_plus, zyy_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(zxx_plus, zxx_minus, zyy_plus, zyy_minus) = section.get_z()
Section.get_zp()[source]
Returns

Elastic section moduli about the principal axis with respect to the top and bottom fibres (z11_plus, z11_minus, z22_plus, z22_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(z11_plus, z11_minus, z22_plus, z22_minus) = section.get_zp()

Radii of Gyration

Section.get_rc()[source]
Returns

Radii of gyration about the centroidal axis (rx, ry)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(rx, ry) = section.get_rc()
Section.get_rp()[source]
Returns

Radii of gyration about the principal axis (r11, r22)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(r11, r22) = section.get_rp()

Principal Axis Angle

Section.get_phi()[source]
Returns

Principal bending axis angle

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
phi = section.get_phi()

Effective Material Properties

Section.get_e_eff()[source]
Returns

Effective elastic modulus based on area

Return type

float

section = Section(geometry)
section.calculate_warping_properties()
e_eff = section.get_e_eff()
Section.get_g_eff()[source]
Returns

Effective shear modulus based on area

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
g_eff = section.get_g_eff()
Section.get_nu_eff()[source]
Returns

Effective Poisson’s ratio

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
nu_eff = section.get_nu_eff()

Torsion Constant

Section.get_j()[source]
Returns

St. Venant torsion constant

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
j = section.get_j()

Shear Centre

Section.get_sc()[source]
Returns

Centroidal axis shear centre (elasticity approach) (x_se, y_se)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(x_se, y_se) = section.get_sc()
Section.get_sc_p()[source]
Returns

Principal axis shear centre (elasticity approach) (x11_se, y22_se)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(x11_se, y22_se) = section.get_sc_p()

Trefftz’s Shear Centre

Section.get_sc_t()[source]
Returns

Centroidal axis shear centre (Trefftz’s approach) (x_st, y_st)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(x_st, y_st) = section.get_sc_t()

Warping Constant

Section.get_gamma()[source]
Returns

Warping constant

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
gamma = section.get_gamma()

Shear Area

Section.get_As()[source]
Returns

Shear area for loading about the centroidal axis (A_sx, A_sy)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(A_sx, A_sy) = section.get_As()
Section.get_As_p()[source]
Returns

Shear area for loading about the principal bending axis (A_s11, A_s22)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(A_s11, A_s22) = section.get_As_p()

Monosymmetry Constants

Section.get_beta()[source]
Returns

Monosymmetry constant for bending about both global axes (beta_x_plus, beta_x_minus, beta_y_plus, beta_y_minus). The plus value relates to the top flange in compression and the minus value relates to the bottom flange in compression.

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(beta_x_plus, beta_x_minus, beta_y_plus, beta_y_minus) = section.get_beta()
Section.get_beta_p()[source]
Returns

Monosymmetry constant for bending about both principal axes (beta_11_plus, beta_11_minus, beta_22_plus, beta_22_minus). The plus value relates to the top flange in compression and the minus value relates to the bottom flange in compression.

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(beta_11_plus, beta_11_minus, beta_22_plus, beta_22_minus) = section.get_beta_p()

Plastic Centroid

Section.get_pc()[source]
Returns

Centroidal axis plastic centroid (x_pc, y_pc)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(x_pc, y_pc) = section.get_pc()
Section.get_pc_p()[source]
Returns

Principal bending axis plastic centroid (x11_pc, y22_pc)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(x11_pc, y22_pc) = section.get_pc_p()

Plastic Section Moduli

Section.get_s()[source]
Returns

Plastic section moduli about the centroidal axis (sxx, syy)

Return type

tuple(float, float)

If material properties have been specified, returns the plastic moment \(M_p = f_y S\).

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(sxx, syy) = section.get_s()
Section.get_sp()[source]
Returns

Plastic section moduli about the principal bending axis (s11, s22)

Return type

tuple(float, float)

If material properties have been specified, returns the plastic moment \(M_p = f_y S\).

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(s11, s22) = section.get_sp()

Shape Factors

Section.get_sf()[source]
Returns

Centroidal axis shape factors with respect to the top and bottom fibres (sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus) = section.get_sf()
Section.get_sf_p()[source]
Returns

Principal bending axis shape factors with respect to the top and bottom fibres (sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus) = section.get_sf_p()

How Material Properties Affect Results

If a Geometry containing a user defined Material is used to build a Section, sectionproperties will assume you are performing a composite analysis and this will affect the way some of the results are stored and presented.

In general, the calculation of gross composite section properties takes into account the elastic modulus, Poisson’s ratio and yield strength of each material in the section. Unlike many design codes, sectionproperties is ‘material property agnostic’ and does not transform sections based on a defined material property, e.g. in reinforced concrete analysis it is commonplace to transform the reinforcing steel area based on the ratio between the elastic moduli, \(n = E_{steel} / E_{conc}\). sectionproperties instead calculates the gross material weighted properties, which is analogous to transforming with respect to a material property with elastic modulus, \(E = 1\).

Using the example of a reinforced concrete section, sectionproperties will calculate the gross section bending stiffness, \((EI)_g\), rather than an effective concrete second moment of area, \(I_{c,eff}\):

\[(EI)_g = E_s \times I_s + E_c \times I_c\]

If the user wanted to obtain the effective concrete second moment of area for a code calculation, they could simply divide the gross bending stiffness by the elastic modulus for concrete:

\[I_{c,eff} = \frac{(EI)_g}{E_c}\]

With reference to the get methods described in Printing a List of the Section Properties, a composite analysis will modify the following properties:

  • First moments of area get_q() - returns elastic modulus weighted first moments of area \(E.Q\)

  • Second moments of area get_ig(), get_ic(), get_ip() - return elastic modulus weighted second moments of area \(E.I\)

  • Section moduli get_z(), get_zp() - return elastic modulus weighted section moduli \(E.Z\)

  • Torsion constant get_j() - returns elastic modulus weighted torsion constant \(E.J\)

  • Warping constant get_gamma() - returns elastic modulus weighted warping constant \(E.\Gamma\)

  • Shear areas get_As(), get_As_p() - return elastic modulus weighted shear areas \(E.A_s\)

  • Plastic section moduli get_s(), get_sp() - return yield strength weighted plastic section moduli, i.e. plastic moments \(M_p = f_y.S\)

A composite analysis will also enable the user to retrieve effective gross section area-weighted material properties:

  • Effective elastic modulus \(E_{eff}\) - get_e_eff()

  • Effective shear modulus \(G_{eff}\) - get_g_eff()

  • Effective Poisson’s ratio \(\nu_{eff}\) - get_nu_eff()

These values may be used to transform composite properties output by sectionproperties for practical use, e.g. to calculate torsional rigidity:

\[(GJ)_g = \frac{G_{eff}}{E_{eff}} (EJ)_g\]

For further information, see the theoretical background to the calculation of Composite Cross-Sections.

Section Property Centroids Plots

A plot of the centroids (elastic, plastic and shear centre) can be produced with the finite element mesh in the background:

Section.plot_centroids(title='Centroids', **kwargs)[source]

Plots the elastic centroid, the shear centre, the plastic centroids and the principal axis, if they have been calculated, on top of the finite element mesh.

Parameters
Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example analyses a 200 PFC section and displays a plot of the centroids:

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

geometry = steel_sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
geometry.create_mesh(mesh_sizes=[20])

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

section.plot_centroids()
_images/pfc_centroids.png

Plot of the centroids generated by the above example.

The following example analyses a 150x90x12 UA section and displays a plot of the centroids:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])

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

section.plot_centroids()
_images/angle_centroids.png

Plot of the centroids generated by the above example.

Plotting Section Stresses

There are a number of methods that can be called from a StressResult object to plot the various cross-section stresses. These methods take the following form:

StressResult.plot_(stress/vector)_(action)_(stresstype)

where:

  • stress denotes a contour plot and vector denotes a vector plot.

  • action denotes the type of action causing the stress e.g. mxx for bending moment about the x-axis. Note that the action is omitted for stresses caused by the application of all actions.

  • stresstype denotes the type of stress that is being plotted e.g. zx for the x-component of shear stress.

The examples shown in the methods below are performed on a 150x90x12 UA (unequal angle) section. The Section object is created below:

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

geometry = steel_sections.AngleSection(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
mesh = geometry.create_mesh(mesh_sizes=[2.5])
section = Section(geometry, mesh)

Primary Stress Plots

Axial Stress (\(\sigma_{zz,N}\))
StressPost.plot_stress_n_zz(title='Stress Contour Plot - $\\sigma_{zz,N}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,N}\) resulting from the axial load \(N\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from an axial force of 10 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(N=10e3)

stress_post.plot_stress_n_zz()
_images/stress_n_zz.png

Contour plot of the axial stress.

Bending Stress (\(\sigma_{zz,Mxx}\))
StressPost.plot_stress_mxx_zz(title='Stress Contour Plot - $\\sigma_{zz,Mxx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,Mxx}\) resulting from the bending moment \(M_{xx}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the x-axis of 5 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mxx=5e6)

stress_post.plot_stress_mxx_zz()
_images/stress_mxx_zz.png

Contour plot of the bending stress.

Bending Stress (\(\sigma_{zz,Myy}\))
StressPost.plot_stress_myy_zz(title='Stress Contour Plot - $\\sigma_{zz,Myy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,Myy}\) resulting from the bending moment \(M_{yy}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the y-axis of 2 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Myy=2e6)

stress_post.plot_stress_myy_zz()
_images/stress_myy_zz.png

Contour plot of the bending stress.

Bending Stress (\(\sigma_{zz,M11}\))
StressPost.plot_stress_m11_zz(title='Stress Contour Plot - $\\sigma_{zz,M11}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,M11}\) resulting from the bending moment \(M_{11}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the 11-axis of 5 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(M11=5e6)

stress_post.plot_stress_m11_zz()
_images/stress_m11_zz.png

Contour plot of the bending stress.

Bending Stress (\(\sigma_{zz,M22}\))
StressPost.plot_stress_m22_zz(title='Stress Contour Plot - $\\sigma_{zz,M22}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,M22}\) resulting from the bending moment \(M_{22}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the 22-axis of 2 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(M22=5e6)

stress_post.plot_stress_m22_zz()
_images/stress_m22_zz.png

Contour plot of the bending stress.

Bending Stress (\(\sigma_{zz,\Sigma M}\))
StressPost.plot_stress_m_zz(title='Stress Contour Plot - $\\sigma_{zz,\\Sigma M}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,\Sigma M}\) resulting from all bending moments \(M_{xx} + M_{yy} + M_{11} + M_{22}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the x-axis of 5 kN.m, a bending moment about the y-axis of 2 kN.m and a bending moment of 3 kN.m about the 11-axis:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mxx=5e6, Myy=2e6, M11=3e6)

stress_post.plot_stress_m_zz()
_images/stress_m_zz.png

Contour plot of the bending stress.

Torsion Stress (\(\sigma_{zx,Mzz}\))
StressPost.plot_stress_mzz_zx(title='Stress Contour Plot - $\\sigma_{zx,Mzz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_stress_mzz_zx()
_images/stress_mzz_zx.png

Contour plot of the shear stress.

Torsion Stress (\(\sigma_{zy,Mzz}\))
StressPost.plot_stress_mzz_zy(title='Stress Contour Plot - $\\sigma_{zy,Mzz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_stress_mzz_zy()
_images/stress_mzz_zy.png

Contour plot of the shear stress.

Torsion Stress (\(\sigma_{zxy,Mzz}\))
StressPost.plot_stress_mzz_zxy(title='Stress Contour Plot - $\\sigma_{zxy,Mzz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_stress_mzz_zxy()
_images/stress_mzz_zxy.png

Contour plot of the shear stress.

StressPost.plot_vector_mzz_zxy(title='Stress Vector Plot - $\\sigma_{zxy,Mzz}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_vector_mzz_zxy()
_images/vector_mzz_zxy.png

Vector plot of the shear stress.

Shear Stress (\(\sigma_{zx,Vx}\))
StressPost.plot_stress_vx_zx(title='Stress Contour Plot - $\\sigma_{zx,Vx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_stress_vx_zx()
_images/stress_vx_zx.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zy,Vx}\))
StressPost.plot_stress_vx_zy(title='Stress Contour Plot - $\\sigma_{zy,Vx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_stress_vx_zy()
_images/stress_vx_zy.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zxy,Vx}\))
StressPost.plot_stress_vx_zxy(title='Stress Contour Plot - $\\sigma_{zz,Myy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_stress_vx_zxy()
_images/stress_vx_zxy.png

Contour plot of the shear stress.

StressPost.plot_vector_vx_zxy(title='Stress Vector Plot - $\\sigma_{zxy,Vx}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_vector_vx_zxy()
_images/vector_vx_zxy.png

Vector plot of the shear stress.

Shear Stress (\(\sigma_{zx,Vy}\))
StressPost.plot_stress_vy_zx(title='Stress Contour Plot - $\\sigma_{zx,Vy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_stress_vy_zx()
_images/stress_vy_zx.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zy,Vy}\))
StressPost.plot_stress_vy_zy(title='Stress Contour Plot - $\\sigma_{zy,Vy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_stress_vy_zy()
_images/stress_vy_zy.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zxy,Vy}\))
StressPost.plot_stress_vy_zxy(title='Stress Contour Plot - $\\sigma_{zxy,Vy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_stress_vy_zxy()
_images/stress_vy_zxy.png

Contour plot of the shear stress.

StressPost.plot_vector_vy_zxy(title='Stress Vector Plot - $\\sigma_{zxy,Vy}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_vector_vy_zxy()
_images/vector_vy_zxy.png

Vector plot of the shear stress.

Shear Stress (\(\sigma_{zx,\Sigma V}\))
StressPost.plot_stress_v_zx(title='Stress Contour Plot - $\\sigma_{zx,\\Sigma V}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_stress_v_zx()
_images/stress_v_zx.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zy,\Sigma V}\))
StressPost.plot_stress_v_zy(title='Stress Contour Plot - $\\sigma_{zy,\\Sigma V}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_stress_v_zy()
_images/stress_v_zy.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zxy,\Sigma V}\))
StressPost.plot_stress_v_zxy(title='Stress Contour Plot - $\\sigma_{zxy,\\Sigma V}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_stress_v_zxy()
_images/stress_v_zxy.png

Contour plot of the shear stress.

StressPost.plot_vector_v_zxy(title='Stress Vector Plot - $\\sigma_{zxy,\\Sigma V}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_vector_v_zxy()
_images/vector_v_zxy.png

Vector plot of the shear stress.

Combined Stress Plots

Normal Stress (\(\sigma_{zz}\))
StressPost.plot_stress_zz(title='Stress Contour Plot - $\\sigma_{zz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the combined normal stress \(\sigma_{zz}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from an axial force of 100 kN, a bending moment about the x-axis of 5 kN.m and a bending moment about the y-axis of 2 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(N=100e3, Mxx=5e6, Myy=2e6)

stress_post.plot_stress_zz()
_images/stress_zz.png

Contour plot of the normal stress.

Shear Stress (\(\sigma_{zx}\))
StressPost.plot_stress_zx(title='Stress Contour Plot - $\\sigma_{zx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_stress_zx()
_images/stress_zx.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zy}\))
StressPost.plot_stress_zy(title='Stress Contour Plot - $\\sigma_{zy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_stress_zy()
_images/stress_zy.png

Contour plot of the shear stress.

Shear Stress (\(\sigma_{zxy}\))
StressPost.plot_stress_zxy(title='Stress Contour Plot - $\\sigma_{zxy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_stress_zxy()
_images/stress_zxy.png

Contour plot of the shear stress.

StressPost.plot_vector_zxy(title='Stress Vector Plot - $\\sigma_{zxy}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_vector_zxy()
_images/vector_zxy.png

Vector plot of the shear stress.

Major Principal Stress (\(\sigma_{1}\))
StressPost.plot_stress_1(title='Stress Contour Plot - $\\sigma_{1}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the major principal stress \(\sigma_{1}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the major principal stress within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
mesh = geometry.create_mesh(mesh_sizes=[2.5])
section = CrossSection(geometry, mesh)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_stress_1()
_images/stress_1.png

Contour plot of the major principal stress.

Minor Principal Stress (\(\sigma_{3}\))
StressPost.plot_stress_3(title='Stress Contour Plot - $\\sigma_{3}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the Minor principal stress \(\sigma_{3}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the Minor principal stress within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
mesh = geometry.create_mesh(mesh_sizes=[2.5])
section = CrossSection(geometry, mesh)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_stress_3()
_images/stress_3.png

Contour plot of the minor principal stress.

von Mises Stress (\(\sigma_{vM}\))
StressPost.plot_stress_vm(title='Stress Contour Plot - $\\sigma_{vM}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the von Mises stress \(\sigma_{vM}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the von Mises stress within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_stress_vm()
_images/stress_vm.png

Contour plot of the von Mises stress.

Mohr’s Circles for Stresses at a Point
StressPost.plot_mohrs_circles(x, y, title=None, **kwargs)[source]

Plots Mohr’s Circles of the 3D stress state at position x, y

Parameters
  • x (float) – x-coordinate of the point to draw Mohr’s Circle

  • y (float) – y-coordinate of the point to draw Mohr’s Circle

  • title (string) – Plot title

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the Mohr’s Circles for the 3D stress state within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

at the point (10, 88.9).

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
mesh = geometry.create_mesh(mesh_sizes=[2.5])
section = Section(geometry, mesh)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_mohrs_circles(10, 88.9)
_images/mohrs_circles.png

Mohr’s Circles of the 3D stress state at (10, 88.9).

Retrieving Section Stress

All cross-section stresses can be recovered using the get_stress() method that belongs to every StressPost object:

StressPost.get_stress()[source]

Returns the stresses within each material belonging to the current StressPost object.

Returns

A list of dictionaries containing the cross-section stresses for each material.

Return type

list[dict]

A dictionary is returned for each material in the cross-section, containing the following keys and values:

  • ‘Material’: Material name

  • ‘sig_zz_n’: Normal stress \(\sigma_{zz,N}\) resulting from the axial load \(N\)

  • ‘sig_zz_mxx’: Normal stress \(\sigma_{zz,Mxx}\) resulting from the bending moment \(M_{xx}\)

  • ‘sig_zz_myy’: Normal stress \(\sigma_{zz,Myy}\) resulting from the bending moment \(M_{yy}\)

  • ‘sig_zz_m11’: Normal stress \(\sigma_{zz,M11}\) resulting from the bending moment \(M_{11}\)

  • ‘sig_zz_m22’: Normal stress \(\sigma_{zz,M22}\) resulting from the bending moment \(M_{22}\)

  • ‘sig_zz_m’: Normal stress \(\sigma_{zz,\Sigma M}\) resulting from all bending moments

  • ‘sig_zx_mzz’: x-component of the shear stress \(\sigma_{zx,Mzz}\) resulting from the torsion moment

  • ‘sig_zy_mzz’: y-component of the shear stress \(\sigma_{zy,Mzz}\) resulting from the torsion moment

  • ‘sig_zxy_mzz’: Resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the torsion moment

  • ‘sig_zx_vx’: x-component of the shear stress \(\sigma_{zx,Vx}\) resulting from the shear force \(V_{x}\)

  • ‘sig_zy_vx’: y-component of the shear stress \(\sigma_{zy,Vx}\) resulting from the shear force \(V_{x}\)

  • ‘sig_zxy_vx’: Resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear force \(V_{x}\)

  • ‘sig_zx_vy’: x-component of the shear stress \(\sigma_{zx,Vy}\) resulting from the shear force \(V_{y}\)

  • ‘sig_zy_vy’: y-component of the shear stress \(\sigma_{zy,Vy}\) resulting from the shear force \(V_{y}\)

  • ‘sig_zxy_vy’: Resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear force \(V_{y}\)

  • ‘sig_zx_v’: x-component of the shear stress \(\sigma_{zx,\Sigma V}\) resulting from all shear forces

  • ‘sig_zy_v’: y-component of the shear stress \(\sigma_{zy,\Sigma V}\) resulting from all shear forces

  • ‘sig_zxy_v’: Resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from all shear forces

  • ‘sig_zz’: Combined normal stress \(\sigma_{zz}\) resulting from all actions

  • ‘sig_zx’: x-component of the shear stress \(\sigma_{zx}\) resulting from all actions

  • ‘sig_zy’: y-component of the shear stress \(\sigma_{zy}\) resulting from all actions

  • ‘sig_zxy’: Resultant shear stress \(\sigma_{zxy}\) resulting from all actions

  • ‘sig_1’: Major principal stress \(\sigma_{1}\) resulting from all actions

  • ‘sig_3’: Minor principal stress \(\sigma_{3}\) resulting from all actions

  • ‘sig_vm’: von Mises stress \(\sigma_{vM}\) resulting from all actions

The following example returns stresses for each material within a composite section, note that a result is generated for each node in the mesh for all materials irrespective of whether the materials exists at that point or not.

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)
stresses = stress_post.get_stress()

print("Number of nodes: {0}".format(section.num_nodes))

for stress in stresses:
    print('Material: {0}'.format(stress['Material']))
    print('List Size: {0}'.format(len(stress['sig_zz_n'])))
    print('Normal Stresses: {0}'.format(stress['sig_zz_n']))
    print('von Mises Stresses: {0}'.format(stress['sig_vm']))
$ Number of nodes: 2465

$ Material: Timber
$ List Size: 2465
$ Normal Stresses: [0.76923077 0.76923077 0.76923077 ... 0.76923077 0.76923077 0.76923077]
$ von Mises Stresses: [7.6394625  5.38571866 3.84784964 ... 3.09532948 3.66992556 2.81976647]

$ Material: Steel
$ List Size: 2465
$ Normal Stresses: [19.23076923 0. 0. ... 0. 0. 0.]
$ von Mises Stresses: [134.78886419 0. 0. ... 0. 0. 0.]

Python API Reference

Pre-Processor Package

geometry Module

Geometry Class
class sectionproperties.pre.geometry.Geometry(geom: Polygon, material: pre.Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), control_points: Optional[Union[Point, List[float, float]]] = None, tol=12)[source]

Class for defining the geometry of a contiguous section of a single material.

Provides an interface for the user to specify the geometry defining a section. A method is provided for generating a triangular mesh, transforming the section (e.g. translation, rotation, perimeter offset, mirroring), aligning the geometry to another geometry, and designating stress recovery points.

Variables
  • geom (shapely.geometry.Polygon) – a Polygon object that defines the geometry

  • material (Optional[Material]) – Optional, a Material to associate with this geometry

  • control_point – Optional, an (x, y) coordinate within the geometry that represents a pre-assigned control point (aka, a region identification point) to be used instead of the automatically assigned control point generated with shapely.geometry.Polygon.representative_point().

  • tol – Optional, default is 12. Number of decimal places to round the geometry vertices to. A lower value may reduce accuracy of geometry but increases precision when aligning geometries to each other.

align_center(align_to: Optional[Union[Geometry, Tuple[float, float]]] = None)[source]

Returns a new Geometry object, translated in both x and y, so that the the new object’s centroid will be aligned with the centroid of the object in ‘align_to’. If ‘align_to’ is an x, y coordinate, then the centroid will be aligned to the coordinate. If ‘align_to’ is None then the new object will be aligned with its centroid at the origin.

Parameters

align_to (Optional[Union[Geometry, Tuple[float, float]]]) – Another Geometry to align to or None (default is None)

Returns

Geometry object translated to new alignment

Return type

Geometry

align_to(other: Union[Geometry, Tuple[float, float]], on: str, inner: bool = False) Geometry[source]

Returns a new Geometry object, representing ‘self’ translated so that is aligned ‘on’ one of the outer bounding box edges of ‘other’.

If ‘other’ is a tuple representing an (x,y) coordinate, then the new Geometry object will represent ‘self’ translated so that it is aligned ‘on’ that side of the point.

Parameters
  • other (Union[Geometry, Tuple[float, float]]) – Either another Geometry or a tuple representing an (x,y) coordinate point that ‘self’ should align to.

  • on – A str of either “left”, “right”, “bottom”, or “top” indicating which side of ‘other’ that self should be aligned to.

  • inner (bool) – Default False. If True, align ‘self’ to ‘other’ in such a way that ‘self’ is aligned to the “inside” of ‘other’. In other words, align ‘self’ to ‘other’ on the specified edge so they overlap.

Returns

Geometry object translated to alignment location

Return type

Geometry

assign_control_point(control_point: List[float, float])[source]

Returns a new Geometry object with ‘control_point’ assigned as the control point for the new Geometry. The assignment of a control point is intended to replace the control point automatically generated by shapely.geometry.Polygon.representative_point().

An assigned control point is carried through and transformed with the Geometry whenever it is shifted, aligned, mirrored, unioned, and/or rotated. If a perimeter_offset operation is applied, a check is performed to see if the assigned control point is still valid (within the new region) and, if so, it is kept. If not, a new control point is auto-generated.

The same check is performed when the geometry undergoes a difference operation (with the ‘-’ operator) or a shift_points operation. If the assigned control point is valid, it is kept. If not, a new one is auto-generated.

For all other operations (e.g. symmetric difference, intersection, split, ), the assigned control point is discarded and a new one auto-generated.

Variables

control_points – An (x, y) coordinate that describes the distinct, contiguous, region of a single material within the geometry. Exactly one point is required for each geometry with a distinct material.

calculate_area()[source]

Calculates the area of the geometry.

Returns

Geometry area.

Return type

float

calculate_centroid()[source]

Calculates the centroid of the geometry as a tuple of (x,y) coordinates.

Returns

Geometry centroid.

Return type

Tuple[float, float]

calculate_extents()[source]

Calculates the minimum and maximum x and y-values amongst the list of points; the points that describe the bounding box of the Geometry instance.

Returns

Minimum and maximum x and y-values (x_min, x_max, y_min, y_max)

Return type

tuple(float, float, float, float)

calculate_perimeter()[source]

Calculates the exterior perimeter of the geometry.

Returns

Geometry perimeter.

Return type

float

compile_geometry()[source]

Alters attributes .points, .facets, .holes, .control_points to represent the data in the shapely geometry.

create_mesh(mesh_sizes: Union[float, List[float]], coarse: bool = False)[source]

Creates a quadratic triangular mesh from the Geometry object.

Parameters
  • mesh_sizes (Union[float, List[float]]) – A float describing the maximum mesh element area to be used within the Geometry-object finite-element mesh.

  • coarse (bool) – If set to True, will create a coarse mesh (no area or quality constraints)

Returns

Geometry-object with mesh data stored in .mesh attribute. Returned Geometry-object is self, not a new instance.

Return type

Geometry

The following example creates a circular cross-section with a diameter of 50 with 64 points, and generates a mesh with a maximum triangular area of 2.5:

import sectionproperties.pre.library.primitive_sections as primitive_sections

geometry = primitive_sections.circular_section(d=50, n=64)
geometry = geometry.create_mesh(mesh_sizes=2.5)
_images/circle_mesh.png

Mesh generated from the above geometry.

classmethod from_3dm(filepath: Union[str, Path], **kwargs) Geometry[source]

Class method to create a Geometry from the objects in a Rhino .3dm file.

Parameters
  • filepath (Union[str, pathlib.Path]) – File path to the rhino .3dm file.

  • kwargs – See below.

Raises

RuntimeError – A RuntimeError is raised if two or more polygons are found. This is dependent on the keyword arguments. Try adjusting the keyword arguments if this error is raised.

Returns

A Geometry object.

Return type

Geometry

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

static from_dxf(dxf_filepath: Union[str, Path]) Union[Geometry, CompoundGeometry][source]

An interface for the creation of Geometry objects from CAD .dxf files.

Variables

dxf_filepath (Union[str, pathlib.Path]) – A path-like object for the dxf file

static from_points(points: List[List[float]], facets: List[List[int]], control_points: List[List[float]], holes: Optional[List[List[float]]] = None, material: Optional[Material] = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'))[source]

An interface for the creation of Geometry objects through the definition of points, facets, and holes.

Variables
  • points (list[list[float, float]]) – List of points (x, y) defining the vertices of the section geometry. If facets are not provided, it is a assumed the that the list of points are ordered around the perimeter, either clockwise or anti-clockwise.

  • facets (list[list[int, int]]) – A list of (start, end) indexes of vertices defining the edges of the section geoemtry. Can be used to define both external and internal perimeters of holes. Facets are assumed to be described in the order of exterior perimeter, interior perimeter 1, interior perimeter 2, etc.

  • control_points – An (x, y) coordinate that describes the distinct, contiguous, region of a single material within the geometry. Must be entered as a list of coordinates, e.g. [[0.5, 3.2]] Exactly one point is required for each geometry with a distinct material. If there are multiple distinct regions, then use CompoundGeometry.from_points()

  • holes (list[list[float, float]]) – Optional. A list of points (x, y) that define interior regions as being holes or voids. The point can be located anywhere within the hole region. Only one point is required per hole region.

  • material – Optional. A Material object that is to be assigned. If not given, then the DEFAULT_MATERIAL will be used.

classmethod from_rhino_encoding(r3dm_brep: str, **kwargs) Geometry[source]

Load an encoded single surface planer brep.

Parameters
  • r3dm_brep (str) – A Rhino3dm.Brep encoded as a string.

  • kwargs – See below.

Returns

A Geometry object found in the encoded string.

Return type

Geometry

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

mirror_section(axis: str = 'x', mirror_point: Union[List[float], str] = 'center')[source]

Mirrors the geometry about a point on either the x or y-axis.

Parameters
  • axis (string) – Axis about which to mirror the geometry, ‘x’ or ‘y’

  • mirror_point (Union[list[float, float], str]) – Point about which to mirror the geometry (x, y). If no point is provided, mirrors the geometry about the centroid of the shape’s bounding box. Default = ‘center’.

Returns

New Geometry-object mirrored on ‘axis’ about ‘mirror_point’

Return type

Geometry

The following example mirrors a 200PFC section about the y-axis and the point (0, 0):

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = steel_sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
new_geometry = geometry.mirror_section(axis='y', mirror_point=[0, 0])
offset_perimeter(amount: float = 0, where: str = 'exterior', resolution: float = 12)[source]

Dilates or erodes the section perimeter by a discrete amount.

Parameters
  • amount (float) – Distance to offset the section by. A -ve value “erodes” the section. A +ve value “dilates” the section.

  • where (str) – One of either “exterior”, “interior”, or “all” to specify which edges of the geometry to offset. If geometry has no interiors, then this parameter has no effect. Default is “exterior”.

  • resolution (float) – Number of segments used to approximate a quarter circle around a point

Returns

Geometry object translated to new alignment

Return type

Geometry

The following example erodes a 200PFC section by 2 mm:

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
new_geometry = geometry.offset_perimeter(amount=-2)
plot_geometry(labels=['control_points'], title='Cross-Section Geometry', cp=True, legend=True, **kwargs)[source]

Plots the geometry defined by the input section.

Parameters
  • labels (list[str]) – A list of str which indicate which labels to plot. Can be one or a combination of “points”, “facets”, “control_points”, or an empty list to indicate no labels. Default is [“control_points”]

  • title (string) – Plot title

  • cp (bool) – If set to True, plots the control points

  • legend (bool) – If set to True, plots the legend

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example creates a CHS discretised with 64 points, with a diameter of 48 and thickness of 3.2, and plots the geometry:

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = steel_sections.circular_hollow_section(d=48, t=3.2, n=64)
geometry.plot_geometry()
_images/chs_geometry.png

Geometry generated by the above example.

rotate_section(angle: float, rot_point: Union[List[float], str] = 'center', use_radians: bool = False)[source]

Rotates the geometry and specified angle about a point. If the rotation point is not provided, rotates the section about the center of the geometry’s bounding box.

Parameters
  • angle (float) – Angle (degrees by default) by which to rotate the section. A positive angle leads to a counter-clockwise rotation.

  • rot_point (list[float, float]) – Optional. Point (x, y) about which to rotate the section. If not provided, will rotate about the center of the geometry’s bounding box. Default = ‘center’.

  • use_radians – Boolean to indicate whether ‘angle’ is in degrees or radians. If True, ‘angle’ is interpreted as radians.

Returns

New Geometry-object rotated by ‘angle’ about ‘rot_point’

Return type

Geometry

The following example rotates a 200UB25 section clockwise by 30 degrees:

import sectionproperties.pre.library.steel_sections as steel_sections

geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
new_geometry = geometry.rotate_section(angle=-30)
shift_points(point_idxs: Union[int, List[int]], dx: float = 0, dy: float = 0, abs_x: Optional[float] = None, abs_y: Optional[float] = None) Geometry[source]

Translates one (or many points) in the geometry by either a relative amount or to a new absolute location. Returns a new Geometry representing the original with the selected point(s) shifted to the new location.

Points are identified by their index, their relative location within the points list found in self.points. You can call self.plot_geometry(labels="points") to see a plot with the points labeled to find the appropriate point indexes.

Parameters
  • point_idxs (Union[int, List[int]]) – An integer representing an index location or a list of integer index locations.

  • dx (float) – The number of units in the x-direction to shift the point(s) by

  • dy (float) – The number of units in the y-direction to shift the point(s) by

  • abs_x (Optional[float]) – Absolute x-coordinate in coordinate system to shift the point(s) to. If abs_x is provided, dx is ignored. If providing a list to point_idxs, all points will be moved to this absolute location.

  • abs_y (Optional[float]) – Absolute y-coordinate in coordinate system to shift the point(s) to. If abs_y is provided, dy is ignored. If providing a list to point_idxs, all points will be moved to this absolute location.

Returns

Geometry object with selected points translated to the new location.

Return type

Geometry

The following example expands the sides of a rectangle, one point at a time, to make it a square:

import sectionproperties.pre.library.primitive_sections as primitive_sections

geometry = primitive_sections.rectangular_section(d=200, b=150)

# Using relative shifting
one_pt_shifted_geom = geometry.shift_points(point_idxs=1, dx=50)

# Using absolute relocation
both_pts_shift_geom = one_pt_shift_geom.shift_points(point_idxs=2, abs_x=200)
shift_section(x_offset=0.0, y_offset=0.0)[source]

Returns a new Geometry object translated by ‘x_offset’ and ‘y_offset’.

Parameters
  • x_offset (float) – Distance in x-direction by which to shift the geometry.

  • y_offset (float) – Distance in y-direction by which to shift the geometry.

Returns

New Geometry-object shifted by ‘x_offset’ and ‘y_offset’

Return type

Geometry

split_section(point_i: Tuple[float, float], point_j: Optional[Tuple[float, float]] = None, vector: Union[Tuple[float, float], None, ndarray] = None) Tuple[List[Geometry], List[Geometry]][source]

Splits, or bisects, the geometry about a line, as defined by two points on the line or by one point on the line and a vector. Either point_j or vector must be given. If point_j is given, vector is ignored.

Returns a tuple of two lists each containing new Geometry instances representing the “top” and “bottom” portions, respectively, of the bisected geometry.

If the line is a vertical line then the “right” and “left” portions, respectively, are returned.

Parameters
  • point_i (Tuple[float, float]) – A tuple of (x, y) coordinates to define a first point on the line

  • point_j (Tuple[float, float]) – Optional. A tuple of (x, y) coordinates to define a second point on the line

  • vector (Union[Tuple[float, float], numpy.ndarray]) – Optional. A tuple or numpy ndarray of (x, y) components to define the line direction.

Returns

A tuple of lists containing Geometry objects that are bisected about the line defined by the two given points. The first item in the tuple represents the geometries on the “top” of the line (or to the “right” of the line, if vertical) and the second item represents the geometries to the “bottom” of the line (or to the “left” of the line, if vertical).

Return type

Tuple[List[Geometry], List[Geometry]]

The following example splits a 200PFC section about the y-axis:

import sectionproperties.pre.library.steel_sections as steel_sections
from shapely import LineString

geometry = steel_sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
right_geom, left_geom = geometry.split_section((0, 0), (0, 1))
CompoundGeometry Class
class sectionproperties.pre.geometry.CompoundGeometry(geoms: Union[MultiPolygon, List[Geometry]])[source]

Bases: Geometry

Class for defining a geometry of multiple distinct regions, each potentially having different material properties.

CompoundGeometry instances are composed of multiple Geometry objects. As with Geometry objects, CompoundGeometry objects have methods for generating a triangular mesh over all geometries, transforming the collection of geometries as though they were one (e.g. translation, rotation, and mirroring), and aligning the CompoundGeometry to another Geometry (or to another CompoundGeometry).

CompoundGeometry objects can be created directly between two or more Geometry objects by using the + operator.

Variables

geoms (Union[shapely.geometry.MultiPolygon, List[Geometry]]) – either a list of Geometry objects or a shapely.geometry.MultiPolygon instance.

load_dxf
sectionproperties.pre.geometry.load_dxf(dxf_filepath: Path)[source]

Import any-old-shape in dxf format for analysis. Code by aegis1980 and connorferster

create_facets
sectionproperties.pre.geometry.create_facets(points_list: list, connect_back: bool = False, offset: int = 0) list[source]

Returns a list of lists of integers representing the “facets” connecting the list of coordinates in ‘loc’. It is assumed that ‘loc’ coordinates are already in their order of connectivity.

‘loc’: a list of coordinates ‘connect_back’: if True, then the last facet pair will be [len(loc), offset] ‘offset’: an integer representing the value that the facets should begin incrementing from.

create_exterior_points
sectionproperties.pre.geometry.create_exterior_points(shape: Polygon) list[source]

Return a list of lists representing x,y pairs of the exterior perimeter of polygon.

create_interior_points
sectionproperties.pre.geometry.create_interior_points(lr: LinearRing) list[source]

Return a list of lists representing x,y pairs of the exterior perimeter of polygon.

create_points_and_facets
sectionproperties.pre.geometry.create_points_and_facets(shape: Polygon, tol=12) tuple[source]

Return a list of lists representing x,y pairs of the exterior perimeter of polygon.

pre Module

Material Class
class sectionproperties.pre.pre.Material(name: str, elastic_modulus: float, poissons_ratio: float, yield_strength: float, density: float, color: str)[source]

Bases: object

Class for structural materials.

Provides a way of storing material properties related to a specific material. The color can be a multitude of different formats, refer to https://matplotlib.org/api/colors_api.html and https://matplotlib.org/examples/color/named_colors.html for more information.

Parameters
  • name (string) – Material name

  • elastic_modulus (float) – Material modulus of elasticity

  • poissons_ratio (float) – Material Poisson’s ratio

  • yield_strength (float) – Material yield strength

  • density (float) – Material density (mass per unit volume)

  • color (matplotlib.colors) – Material color for rendering

Variables
  • name (string) – Material name

  • elastic_modulus (float) – Material modulus of elasticity

  • poissons_ratio (float) – Material Poisson’s ratio

  • shear_modulus (float) – Material shear modulus, derived from the elastic modulus and Poisson’s ratio assuming an isotropic material

  • density (float) – Material density (mass per unit volume)

  • yield_strength (float) – Material yield strength

  • color (matplotlib.colors) – Material color for rendering

The following example creates materials for concrete, steel and timber:

from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, density=2.4e-6,
        yield_strength=32, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, density=7.85e-6,
        yield_strength=500, color='grey'
)
timber = Material(
    name='Timber', elastic_modulus=8e3, poissons_ratio=0.35, density=6.5e-7,
        yield_strength=20, color='burlywood'
)
create_mesh
sectionproperties.pre.pre.create_mesh(points: List[List[float]], facets: List[List[float]], holes: List[List[float]], control_points: List[List[float]], mesh_sizes: Union[List[float], float], coarse: bool)[source]

Creates a quadratic triangular mesh using the triangle module, which utilises the code ‘Triangle’, by Jonathan Shewchuk.

Parameters
  • points (list[list[int, int]]) – List of points (x, y) defining the vertices of the cross-section

  • facets – List of point index pairs (p1, p2) defining the edges of the cross-section

  • holes (list[list[float, float]]) – List of points (x, y) defining the locations of holes within the cross-section. If there are no holes, provide an empty list [].

  • control_points (list[list[float, float]]) – A list of points (x, y) that define different regions of the cross-section. A control point is an arbitrary point within a region enclosed by facets.

  • mesh_sizes (list[float]) – List of maximum element areas for each region defined by a control point

  • coarse (bool) – If set to True, will create a coarse mesh (no area or quality constraints)

Returns

Dictionary containing mesh data

Return type

dict()

rhino Module

load_3dm
sectionproperties.pre.rhino.load_3dm(r3dm_filepath: Union[Path, str], **kwargs) List[Polygon][source]

Load a Rhino .3dm file and import the single surface planer breps.

Parameters
  • r3dm_filepath (pathlib.Path or string) – File path to the rhino .3dm file.

  • kwargs – See below.

Raises

RuntimeError – A RuntimeError is raised if no polygons are found in the file. This is dependent on the keyword arguments. Try adjusting the keyword arguments if this error is raised.

Returns

List of Polygons found in the file.

Return type

List[shapely.geometry.Polygon]

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

load_brep_encoding
sectionproperties.pre.rhino.load_brep_encoding(brep: str, **kwargs) Polygon[source]

Load an encoded single surface planer brep.

Parameters
  • brep (str) – Rhino3dm.Brep encoded as a string.

  • kwargs – See below.

Raises

RuntimeError – A RuntimeError is raised if no polygons are found in the encoding. This is dependent on the keyword arguments. Try adjusting the keyword arguments if this error is raised.

Returns

The Polygons found in the encoding string.

Return type

shapely.geometry.Polygon

Keyword Arguments
  • refine_num (int, optional) –

    Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves. Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines. This parameter sets the number of straight lines used in the interpolation. Default is 1.

  • vec1 (numpy.ndarray, optional) –

    A 3d vector in the Shapely plane. Rhino is a 3D geometry environment. Shapely is a 2D geometric library. Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system. vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction. Default is [1,0,0].

  • vec2 (numpy.ndarray, optional) –

    Continuing from vec1, vec2 is another vector to define the Shapely plane. It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1). Default is [0,1,0].

  • plane_distance (float, optional) –

    The distance to the Shapely plane. Default is 0.

  • project (boolean, optional) –

    Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal. Default is True.

  • parallel (boolean, optional) –

    Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded. If true, all non parallel surfaces are filtered out. Default is False.

bisect_section Module

create_line_segment
sectionproperties.pre.bisect_section.create_line_segment(point_on_line: Union[Tuple[float, float], ndarray], vector: ndarray, bounds: tuple)[source]

Return a LineString of a line that contains ‘point_on_line’ in the direction of ‘unit_vector’ bounded by ‘bounds’. ‘bounds’ is a tuple of float containing a max ordinate and min ordinate.

group_top_and_bottom_polys
sectionproperties.pre.bisect_section.group_top_and_bottom_polys(polys: GeometryCollection, line: LineString) Tuple[list, list][source]

Returns tuple of two lists representing the list of Polygons in ‘polys’ on the “top” side of ‘line’ and the list of Polygons on the “bottom” side of the ‘line’ after the original geometry has been split by ‘line’.

The 0-th tuple element is the “top” polygons and the 1-st element is the “bottom” polygons.

In the event that ‘line’ is a perfectly vertical line, the “top” polys are the polygons on the “right” of the ‘line’ and the “bottom” polys are the polygons on the “left” of the ‘line’.

line_mx_plus_b
sectionproperties.pre.bisect_section.line_mx_plus_b(line: LineString) Tuple[float, float][source]

Returns a tuple representing the values of “m” and “b” from the definition of ‘line’ as “y = mx + b”.

perp_mx_plus_b
sectionproperties.pre.bisect_section.perp_mx_plus_b(m_slope: float, point_on_line: Tuple[float, float]) Tuple[float, float][source]

Returns a tuple representing the values of “m” and “b” from for a line that is perpendicular to ‘m_slope’ and contains the ‘point_on_line’, which represents an (x, y) coordinate.

line_intersection
sectionproperties.pre.bisect_section.line_intersection(m_1: float, b_1: float, m_2: float, b_2: float) Optional[float][source]

Returns a float representing the x-ordinate of the intersection point of the lines defined by y = m_1*x + b_1 and y = m_2*x + b_2.

Returns None if the lines are parallel.

sum_poly_areas
sectionproperties.pre.bisect_section.sum_poly_areas(lop: List[Polygon]) float[source]

Returns a float representing the total area of all polygons in ‘lop’, the list of polygons.

primitive_sections Module

rectangular_section
sectionproperties.pre.library.primitive_sections.rectangular_section(b: float, d: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a rectangular section with the bottom left corner at the origin (0, 0), with depth d and width b.

Parameters
  • d (float) – Depth (y) of the rectangle

  • b (float) – Width (x) of the rectangle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a rectangular cross-section with a depth of 100 and width of 50, and generates a mesh with a maximum triangular area of 5:

from sectionproperties.pre.library.primitive_sections import rectangular_section

geometry = rectangular_section(d=100, b=50)
geometry.create_mesh(mesh_sizes=[5])
_images/rectangle_geometry.png

Rectangular section geometry.

_images/rectangle_mesh.png

Mesh generated from the above geometry.

circular_section
sectionproperties.pre.library.primitive_sections.circular_section(d: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a solid circle centered at the origin (0, 0) with diameter d and using n points to construct the circle.

Parameters
  • d (float) – Diameter of the circle

  • n (int) – Number of points discretising the circle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a circular geometry with a diameter of 50 with 64 points, and generates a mesh with a maximum triangular area of 2.5:

from sectionproperties.pre.library.primitive_sections import circular_section

geometry = circular_section(d=50, n=64)
geometry.create_mesh(mesh_sizes=[2.5])
_images/circle_geometry.png

Circular section geometry.

_images/circle_mesh.png

Mesh generated from the above geometry.

circular_section_by_area
sectionproperties.pre.library.primitive_sections.circular_section_by_area(area: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a solid circle centered at the origin (0, 0) defined by its area, using n points to construct the circle.

Parameters
  • area (float) – Area of the circle

  • n (int) – Number of points discretising the circle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a circular geometry with an area of 200 with 32 points, and generates a mesh with a maximum triangular area of 5:

from sectionproperties.pre.library.primitive_sections import circular_section_by_area

geometry = circular_section_by_area(area=310, n=32)
geometry.create_mesh(mesh_sizes=[5])
_images/circle_area_geometry.png

Circular section by area geometry.

_images/circle_area_mesh.png

Mesh generated from the above geometry.

elliptical_section
sectionproperties.pre.library.primitive_sections.elliptical_section(d_y: float, d_x: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a solid ellipse centered at the origin (0, 0) with vertical diameter d_y and horizontal diameter d_x, using n points to construct the ellipse.

Parameters
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • d_x (float) – Diameter of the ellipse in the x-dimension

  • n (int) – Number of points discretising the ellipse

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an elliptical cross-section with a vertical diameter of 25 and horizontal diameter of 50, with 40 points, and generates a mesh with a maximum triangular area of 1.0:

from sectionproperties.pre.library.primitive_sections import elliptical_section

geometry = elliptical_section(d_y=25, d_x=50, n=40)
geometry.create_mesh(mesh_sizes=[1.0])
_images/ellipse_geometry.png

Elliptical section geometry.

_images/ellipse_mesh.png

Mesh generated from the above geometry.

triangular_section
sectionproperties.pre.library.primitive_sections.triangular_section(b: float, h: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a right angled triangle with points (0, 0), (b, 0), (0, h).

Parameters
  • b (float) – Base length of triangle

  • h (float) – Height of triangle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a triangular cross-section with a base width of 10 and height of 10, and generates a mesh with a maximum triangular area of 0.5:

from sectionproperties.pre.library.primitive_sections import triangular_section

geometry = triangular_section(b=10, h=10)
geometry.create_mesh(mesh_sizes=[0.5])
_images/triangle_geometry.png

Triangular section geometry.

_images/triangle_mesh.png

Mesh generated from the above geometry.

triangular_radius_section
sectionproperties.pre.library.primitive_sections.triangular_radius_section(b: float, n_r: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a right angled isosceles triangle with points (0, 0), (b, 0), (0, h) and a concave radius on the hypotenuse.

Parameters
  • b (float) – Base length of triangle

  • n_r (int) – Number of points discretising the radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a triangular radius cross-section with a base width of 6, using n_r points to construct the radius, and generates a mesh with a maximum triangular area of 0.5:

from sectionproperties.pre.library.primitive_sections import triangular_radius_section

geometry = triangular_radius_section(b=6, n_r=16)
geometry.create_mesh(mesh_sizes=[0.5])
_images/triangle_radius_geometry.png

Triangular radius section geometry.

_images/triangle_radius_mesh.png

Mesh generated from the above geometry.

cruciform_section
sectionproperties.pre.library.primitive_sections.cruciform_section(d: float, b: float, t: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a cruciform section centered at the origin (0, 0), with depth d, width b, thickness t and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the cruciform section

  • b (float) – Width of the cruciform section

  • t (float) – Thickness of the cruciform section

  • r (float) – Root radius of the cruciform section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a cruciform section with a depth of 250, a width of 175, a thickness of 12 and a root radius of 16, using 16 points to discretise the radius. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.primitive_sections import cruciform_section

geometry = cruciform_section(d=250, b=175, t=12, r=16, n_r=16)
geometry.create_mesh(mesh_sizes=[5.0])
_images/cruciform_geometry.png

Cruciform section geometry.

_images/cruciform_mesh.png

Mesh generated from the above geometry.

steel_sections Module

circular_hollow_section
sectionproperties.pre.library.steel_sections.circular_hollow_section(d: float, t: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a circular hollow section (CHS) centered at the origin (0, 0), with diameter d and thickness t, using n points to construct the inner and outer circles.

Parameters
  • d (float) – Outer diameter of the CHS

  • t (float) – Thickness of the CHS

  • n (int) – Number of points discretising the inner and outer circles

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a CHS discretised with 64 points, with a diameter of 48 and thickness of 3.2, and generates a mesh with a maximum triangular area of 1.0:

from sectionproperties.pre.library.steel_sections import circular_hollow_section

geometry = circular_hollow_section(d=48, t=3.2, n=64)
geometry.create_mesh(mesh_sizes=[1.0])
_images/chs_geometry.png

CHS geometry.

_images/chs_mesh.png

Mesh generated from the above geometry.

elliptical_hollow_section
sectionproperties.pre.library.steel_sections.elliptical_hollow_section(d_y: float, d_x: float, t: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs an elliptical hollow section (EHS) centered at the origin (0, 0), with outer vertical diameter d_y, outer horizontal diameter d_x, and thickness t, using n points to construct the inner and outer ellipses.

Parameters
  • d_y (float) – Diameter of the ellipse in the y-dimension

  • d_x (float) – Diameter of the ellipse in the x-dimension

  • t (float) – Thickness of the EHS

  • n (int) – Number of points discretising the inner and outer ellipses

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a EHS discretised with 30 points, with a outer vertical diameter of 25, outer horizontal diameter of 50, and thickness of 2.0, and generates a mesh with a maximum triangular area of 0.5:

from sectionproperties.pre.library.steel_sections import elliptical_hollow_section

geometry = elliptical_hollow_section(d_y=25, d_x=50, t=2.0, n=64)
geometry.create_mesh(mesh_sizes=[0.5])
_images/ehs_geometry.png

EHS geometry.

_images/ehs_mesh.png

Mesh generated from the above geometry.

rectangular_hollow_section
sectionproperties.pre.library.steel_sections.rectangular_hollow_section(b: float, d: float, t: float, r_out: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a rectangular hollow section (RHS) centered at (b/2, d/2), with depth d, width b, thickness t and outer radius r_out, using n_r points to construct the inner and outer radii. If the outer radius is less than the thickness of the RHS, the inner radius is set to zero.

Parameters
  • d (float) – Depth of the RHS

  • b (float) – Width of the RHS

  • t (float) – Thickness of the RHS

  • r_out (float) – Outer radius of the RHS

  • n_r (int) – Number of points discretising the inner and outer radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an RHS with a depth of 100, a width of 50, a thickness of 6 and an outer radius of 9, using 8 points to discretise the inner and outer radii. A mesh is generated with a maximum triangular area of 2.0:

from sectionproperties.pre.library.steel_sections import rectangular_hollow_section

geometry = rectangular_hollow_section(d=100, b=50, t=6, r_out=9, n_r=8)
geometry.create_mesh(mesh_sizes=[2.0])
_images/rhs_geometry.png

RHS geometry.

_images/rhs_mesh.png

Mesh generated from the above geometry.

polygon_hollow_section
sectionproperties.pre.library.steel_sections.polygon_hollow_section(d: float, t: float, n_sides: int, r_in: float = 0, n_r: int = 1, rot: float = 0, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a regular hollow polygon section centered at (0, 0), with a pitch circle diameter of bounding polygon d, thickness t, number of sides n_sides and an optional inner radius r_in, using n_r points to construct the inner and outer radii (if radii is specified).

Parameters
  • d (float) – Pitch circle diameter of the outer bounding polygon (i.e. diameter of circle that passes through all vertices of the outer polygon)

  • t (float) – Thickness of the polygon section wall

  • r_in (float) – Inner radius of the polygon corners. By default, if not specified, a polygon with no corner radii is generated.

  • n_r (int) – Number of points discretising the inner and outer radii, ignored if no inner radii is specified

  • rot (float) – Initial counterclockwise rotation in degrees. By default bottom face is aligned with x axis.

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

Raises

Exception – Number of sides in polygon must be greater than or equal to 3

The following example creates an Octagonal section (8 sides) with a diameter of 200, a thickness of 6 and an inner radius of 20, using 12 points to discretise the inner and outer radii. A mesh is generated with a maximum triangular area of 5:

from sectionproperties.pre.library.steel_sections import polygon_hollow_section

geometry = polygon_hollow_section(d=200, t=6, n_sides=8, r_in=20, n_r=12)
geometry.create_mesh(mesh_sizes=[5])
_images/polygon_geometry.png

Octagonal section geometry.

_images/polygon_mesh.png

Mesh generated from the above geometry.

i_section
sectionproperties.pre.library.steel_sections.i_section(d: float, b: float, t_f: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs an I Section centered at (b/2, d/2), with depth d, width b, flange thickness t_f, web thickness t_w, and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the I Section

  • b (float) – Width of the I Section

  • t_f (float) – Flange thickness of the I Section

  • t_w (float) – Web thickness of the I Section

  • r (float) – Root radius of the I Section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an I Section with a depth of 203, a width of 133, a flange thickness of 7.8, a web thickness of 5.8 and a root radius of 8.9, using 16 points to discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

from sectionproperties.pre.library.steel_sections import i_section

geometry = i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=16)
geometry.create_mesh(mesh_sizes=[3.0])
_images/isection_geometry.png

I Section geometry.

_images/isection_mesh.png

Mesh generated from the above geometry.

mono_i_section
sectionproperties.pre.library.steel_sections.mono_i_section(d: float, b_t: float, b_b: float, t_ft: float, t_fb: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a monosymmetric I Section centered at (max(b_t, b_b)/2, d/2), with depth d, top flange width b_t, bottom flange width b_b, top flange thickness t_ft, top flange thickness t_fb, web thickness t_w, and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the I Section

  • b_t (float) – Top flange width

  • b_b (float) – Bottom flange width

  • t_ft (float) – Top flange thickness of the I Section

  • t_fb (float) – Bottom flange thickness of the I Section

  • t_w (float) – Web thickness of the I Section

  • r (float) – Root radius of the I Section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a monosymmetric I Section with a depth of 200, a top flange width of 50, a top flange thickness of 12, a bottom flange width of 130, a bottom flange thickness of 8, a web thickness of 6 and a root radius of 8, using 16 points to discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

from sectionproperties.pre.library.steel_sections import mono_i_section

geometry = mono_i_section(
    d=200, b_t=50, b_b=130, t_ft=12, t_fb=8, t_w=6, r=8, n_r=16
)
geometry.create_mesh(mesh_sizes=[3.0])
_images/monoisection_geometry.png

I Section geometry.

_images/monoisection_mesh.png

Mesh generated from the above geometry.

tapered_flange_i_section
sectionproperties.pre.library.steel_sections.tapered_flange_i_section(d: float, b: float, t_f: float, t_w: float, r_r: float, r_f: float, alpha: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Tapered Flange I Section centered at (b/2, d/2), with depth d, width b, mid-flange thickness t_f, web thickness t_w, root radius r_r, flange radius r_f and flange angle alpha, using n_r points to construct the radii.

Parameters
  • d (float) – Depth of the Tapered Flange I Section

  • b (float) – Width of the Tapered Flange I Section

  • t_f (float) – Mid-flange thickness of the Tapered Flange I Section (measured at the point equidistant from the face of the web to the edge of the flange)

  • t_w (float) – Web thickness of the Tapered Flange I Section

  • r_r (float) – Root radius of the Tapered Flange I Section

  • r_f (float) – Flange radius of the Tapered Flange I Section

  • alpha (float) – Flange angle of the Tapered Flange I Section (degrees)

  • n_r (int) – Number of points discretising the radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a Tapered Flange I Section with a depth of 588, a width of 191, a mid-flange thickness of 27.2, a web thickness of 15.2, a root radius of 17.8, a flange radius of 8.9 and a flange angle of 8°, using 16 points to discretise the radii. A mesh is generated with a maximum triangular area of 20.0:

from sectionproperties.pre.library.steel_sections import tapered_flange_i_section

geometry = tapered_flange_i_section(
    d=588, b=191, t_f=27.2, t_w=15.2, r_r=17.8, r_f=8.9, alpha=8, n_r=16
)
geometry.create_mesh(mesh_sizes=[20.0])
_images/taperedisection_geometry.png

I Section geometry.

_images/taperedisection_mesh.png

Mesh generated from the above geometry.

channel_section
sectionproperties.pre.library.steel_sections.channel_section(d: float, b: float, t_f: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a parallel-flange channel (PFC) section with the bottom left corner at the origin (0, 0), with depth d, width b, flange thickness t_f, web thickness t_w and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the PFC section

  • b (float) – Width of the PFC section

  • t_f (float) – Flange thickness of the PFC section

  • t_w (float) – Web thickness of the PFC section

  • r (float) – Root radius of the PFC section

  • n_r (int) – Number of points discretising the root radius

  • shift (list[float, float]) – Vector that shifts the cross-section by (x, y)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a PFC section with a depth of 250, a width of 90, a flange thickness of 15, a web thickness of 8 and a root radius of 12, using 8 points to discretise the root radius. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.steel_sections import channel_section

geometry = channel_section(d=250, b=90, t_f=15, t_w=8, r=12, n_r=8)
geometry.create_mesh(mesh_sizes=[5.0])
_images/pfc_geometry.png

PFC geometry.

_images/pfc_mesh.png

Mesh generated from the above geometry.

tapered_flange_channel
sectionproperties.pre.library.steel_sections.tapered_flange_channel(d: float, b: float, t_f: float, t_w: float, r_r: float, r_f: float, alpha: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Tapered Flange Channel section with the bottom left corner at the origin (0, 0), with depth d, width b, mid-flange thickness t_f, web thickness t_w, root radius r_r, flange radius r_f and flange angle alpha, using n_r points to construct the radii.

Parameters
  • d (float) – Depth of the Tapered Flange Channel section

  • b (float) – Width of the Tapered Flange Channel section

  • t_f (float) – Mid-flange thickness of the Tapered Flange Channel section (measured at the point equidistant from the face of the web to the edge of the flange)

  • t_w (float) – Web thickness of the Tapered Flange Channel section

  • r_r (float) – Root radius of the Tapered Flange Channel section

  • r_f (float) – Flange radius of the Tapered Flange Channel section

  • alpha (float) – Flange angle of the Tapered Flange Channel section (degrees)

  • n_r (int) – Number of points discretising the radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a Tapered Flange Channel section with a depth of 10, a width of 3.5, a mid-flange thickness of 0.575, a web thickness of 0.475, a root radius of 0.575, a flange radius of 0.4 and a flange angle of 8°, using 16 points to discretise the radii. A mesh is generated with a maximum triangular area of 0.02:

from sectionproperties.pre.library.steel_sections import tapered_flange_channel

geometry = tapered_flange_channel(
    d=10, b=3.5, t_f=0.575, t_w=0.475, r_r=0.575, r_f=0.4, alpha=8, n_r=16
)
geometry.create_mesh(mesh_sizes=[0.02])
_images/taperedchannel_geometry.png

Tapered flange channel geometry.

_images/taperedchannel_mesh.png

Mesh generated from the above geometry.

tee_section
sectionproperties.pre.library.steel_sections.tee_section(d: float, b: float, t_f: float, t_w: float, r: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Tee section with the top left corner at (0, d), with depth d, width b, flange thickness t_f, web thickness t_w and root radius r, using n_r points to construct the root radius.

Parameters
  • d (float) – Depth of the Tee section

  • b (float) – Width of the Tee section

  • t_f (float) – Flange thickness of the Tee section

  • t_w (float) – Web thickness of the Tee section

  • r (float) – Root radius of the Tee section

  • n_r (int) – Number of points discretising the root radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a Tee section with a depth of 200, a width of 100, a flange thickness of 12, a web thickness of 6 and a root radius of 8, using 8 points to discretise the root radius. A mesh is generated with a maximum triangular area of 3.0:

from sectionproperties.pre.library.steel_sections import tee_section

geometry = tee_section(d=200, b=100, t_f=12, t_w=6, r=8, n_r=8)
geometry.create_mesh(mesh_sizes=[3.0])
_images/tee_geometry.png

Tee section geometry.

_images/tee_mesh.png

Mesh generated from the above geometry.

angle_section
sectionproperties.pre.library.steel_sections.angle_section(d: float, b: float, t: float, r_r: float, r_t: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs an angle section with the bottom left corner at the origin (0, 0), with depth d, width b, thickness t, root radius r_r and toe radius r_t, using n_r points to construct the radii.

Parameters
  • d (float) – Depth of the angle section

  • b (float) – Width of the angle section

  • t (float) – Thickness of the angle section

  • r_r (float) – Root radius of the angle section

  • r_t (float) – Toe radius of the angle section

  • n_r (int) – Number of points discretising the radii

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates an angle section with a depth of 150, a width of 100, a thickness of 8, a root radius of 12 and a toe radius of 5, using 16 points to discretise the radii. A mesh is generated with a maximum triangular area of 2.0:

from sectionproperties.pre.library.steel_sections import angle_section

geometry = angle_section(d=150, b=100, t=8, r_r=12, r_t=5, n_r=16)
geometry.create_mesh(mesh_sizes=[2.0])
_images/angle_geometry.png

Angle section geometry.

_images/angle_mesh.png
cee_section
sectionproperties.pre.library.steel_sections.cee_section(d: float, b: float, l: float, t: float, r_out: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Cee section (typical of cold-formed steel) with the bottom left corner at the origin (0, 0), with depth d, width b, lip l, thickness t and outer radius r_out, using n_r points to construct the radius. If the outer radius is less than the thickness of the Cee Section, the inner radius is set to zero.

Parameters
  • d (float) – Depth of the Cee section

  • b (float) – Width of the Cee section

  • l (float) – Lip of the Cee section

  • t (float) – Thickness of the Cee section

  • r_out (float) – Outer radius of the Cee section

  • n_r (int) – Number of points discretising the outer radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

Raises

Exception – Lip length must be greater than the outer radius

The following example creates a Cee section with a depth of 125, a width of 50, a lip of 30, a thickness of 1.5 and an outer radius of 6, using 8 points to discretise the radius. A mesh is generated with a maximum triangular area of 0.25:

from sectionproperties.pre.library.steel_sections import cee_section

geometry = cee_section(d=125, b=50, l=30, t=1.5, r_out=6, n_r=8)
geometry.create_mesh(mesh_sizes=[0.25])
_images/cee_geometry.png

Cee section geometry.

_images/cee_mesh.png
zed_section
sectionproperties.pre.library.steel_sections.zed_section(d: float, b_l: float, b_r: float, l: float, t: float, r_out: float, n_r: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a zed section with the bottom left corner at the origin (0, 0), with depth d, left flange width b_l, right flange width b_r, lip l, thickness t and outer radius r_out, using n_r points to construct the radius. If the outer radius is less than the thickness of the Zed Section, the inner radius is set to zero.

Parameters
  • d (float) – Depth of the zed section

  • b_l (float) – Left flange width of the Zed section

  • b_r (float) – Right flange width of the Zed section

  • l (float) – Lip of the Zed section

  • t (float) – Thickness of the Zed section

  • r_out (float) – Outer radius of the Zed section

  • n_r (int) – Number of points discretising the outer radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a zed section with a depth of 100, a left flange width of 40, a right flange width of 50, a lip of 20, a thickness of 1.2 and an outer radius of 5, using 8 points to discretise the radius. A mesh is generated with a maximum triangular area of 0.15:

from sectionproperties.pre.library.steel_sections import zed_section

geometry = zed_section(d=100, b_l=40, b_r=50, l=20, t=1.2, r_out=5, n_r=8)
geometry.create_mesh(mesh_sizes=[0.15])
_images/zed_geometry.png

zed section geometry.

_images/zed_mesh.png
box_girder_section
sectionproperties.pre.library.steel_sections.box_girder_section(d: float, b_t: float, b_b: float, t_ft: float, t_fb: float, t_w: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'))[source]

Constructs a box girder section centered at at (max(b_t, b_b)/2, d/2), with depth d, top width b_t, bottom width b_b, top flange thickness t_ft, bottom flange thickness t_fb and web thickness t_w.

Parameters
  • d (float) – Depth of the Box Girder section

  • b_t (float) – Top width of the Box Girder section

  • b_b (float) – Bottom width of the Box Girder section

  • t_ft (float) – Top flange thickness of the Box Girder section

  • t_fb (float) – Bottom flange thickness of the Box Girder section

  • t_w (float) – Web thickness of the Box Girder section

The following example creates a Box Girder section with a depth of 1200, a top width of 1200, a bottom width of 400, a top flange thickness of 16, a bottom flange thickness of 12 and a web thickness of 8. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.steel_sections import box_girder_section

geometry = box_girder_section(d=1200, b_t=1200, b_b=400, t_ft=100, t_fb=80, t_w=50)
geometry.create_mesh(mesh_sizes=[200.0])
_images/box_girder_geometry.png

Box Girder geometry.

_images/box_girder_mesh.png

Mesh generated from the above geometry.

bulb_section
sectionproperties.pre.library.steel_sections.bulb_section(d: float, b: float, t: float, r: float, n_r: int, d_b: Optional[float] = None, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a bulb section with the bottom left corner at the point (-t / 2, 0), with depth d, bulb depth d_b, bulb width b, web thickness t and radius r, using n_r points to construct the radius.

Parameters
  • d (float) – Depth of the section

  • b (float) – Bulb width

  • t (float) – Web thickness

  • r (float) – Bulb radius

  • d_b (float) – Depth of the bulb (automatically calculated for standard sections, if provided the section may have sharp edges)

  • n_r (int) – Number of points discretising the radius

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a bulb section with a depth of 240, a width of 34, a web thickness of 12 and a bulb radius of 16, using 16 points to discretise the radius. A mesh is generated with a maximum triangular area of 5.0:

from sectionproperties.pre.library.steel_sections import bulb_section

geometry = bulb_section(d=240, b=34, t=12, r=10, n_r=16)
geometry.create_mesh(mesh_sizes=[5.0])
_images/bulb_geometry.png

Bulb section geometry.

_images/bulb_mesh.png

Mesh generated from the above geometry.

concrete_sections Module

concrete_rectangular_section
sectionproperties.pre.library.concrete_sections.concrete_rectangular_section(b: float, d: float, dia_top: float, n_top: int, dia_bot: float, n_bot: int, n_circle: int, cover: float, dia_side: Optional[float] = None, n_side: int = 0, area_top: Optional[float] = None, area_bot: Optional[float] = None, area_side: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) CompoundGeometry[source]

Constructs a concrete rectangular section of width b and depth d, with n_top top steel bars of diameter dia_top, n_bot bottom steel bars of diameter dia_bot, n_side left & right side steel bars of diameter dia_side discretised with n_circle points with equal side and top/bottom cover to the steel.

Parameters
  • b (float) – Concrete section width

  • d (float) – Concrete section depth

  • dia_top (float) – Diameter of the top steel reinforcing bars

  • n_top (int) – Number of top steel reinforcing bars

  • dia_bot (float) – Diameter of the bottom steel reinforcing bars

  • n_bot (int) – Number of bottom steel reinforcing bars

  • n_circle (int) – Number of points discretising the steel reinforcing bars

  • cover (float) – Side and bottom cover to the steel reinforcing bars

  • dia_side (float) – If provided, diameter of the side steel reinforcing bars

  • n_side (int) – If provided, number of side bars either side of the section

  • area_top (float) – If provided, constructs top reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • area_bot (float) – If provided, constructs bottom reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • area_side (float) – If provided, constructs side reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • conc_mat – Material to associate with the concrete

  • steel_mat – Material to associate with the steel

Raises

ValueError – If the number of bars is not greater than or equal to 2 in an active layer

The following example creates a 600D x 300W concrete beam with 3N20 bottom steel reinforcing bars and 30 mm cover:

from sectionproperties.pre.library.concrete_sections import concrete_rectangular_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_rectangular_section(
    b=300, d=600, dia_top=20, n_top=0, dia_bot=20, n_bot=3, n_circle=24, cover=30,
    conc_mat=concrete, steel_mat=steel
)
geometry.create_mesh(mesh_sizes=[500])
_images/concrete_rectangular_section_geometry.png

Concrete rectangular section geometry.

_images/concrete_rectangular_section_mesh.png

Mesh generated from the above geometry.

concrete_column_section
sectionproperties.pre.library.concrete_sections.concrete_column_section(b: float, d: float, cover: float, n_bars_b: int, n_bars_d: int, dia_bar: float, bar_area: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), filled: bool = False, n_circle: int = 4) CompoundGeometry[source]

Constructs a concrete rectangular section of width b and depth d, with steel bar reinforcing organized as an n_bars_b by n_bars_d array, discretised with n_circle points with equal sides and top/bottom cover to the steel which is taken as the clear cover (edge of bar to edge of concrete).

Parameters
  • b (float) – Concrete section width, parallel to the x-axis

  • d (float) – Concrete section depth, parallel to the y-axis

  • cover (float) – Clear cover, calculated as distance from edge of reinforcing bar to edge of section.

  • n_bars_b (int) – Number of bars placed across the width of the section, minimum 2.

  • n_bars_d (int) – Number of bars placed across the depth of the section, minimum 2.

  • dia_bar (float) – Diameter of reinforcing bars. Used for calculating bar placement and, optionally, for calculating the bar area for section capacity calculations.

  • bar_area (float) – Area of reinforcing bars. Used for section capacity calculations. If not provided, then dia_bar will be used to calculate the bar area.

  • conc_mat (sectionproperties.pre.pre.Material) – Material to associate with the concrete

  • steel_mat (sectionproperties.pre.pre.Material) – Material to associate with the reinforcing steel

  • filled (bool) – When True, will populate the concrete section with an equally spaced 2D array of reinforcing bars numbering ‘n_bars_b’ by ‘n_bars_d’. When False, only the bars around the perimeter of the array will be present.

  • n_circle (int) – The number of points used to discretize the circle of the reinforcing bars. The bars themselves will have an exact area of ‘bar_area’ regardless of the number of points used in the circle. Useful for making the reinforcing bars look more circular when plotting the concrete section.

Raises

ValueError – If the number of bars in either ‘n_bars_b’ or ‘n_bars_d’ is not greater than or equal to 2.

The following example creates a 600D x 300W concrete column with 25 mm diameter reinforcing bars each with 500 mm**2 area and 35 mm cover in a 3x6 array without the interior bars being filled:

from sectionproperties.pre.library.concrete_sections import concrete_column_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_column_section(
    b=300, d=600, dia_bar=25, bar_area=500, cover=35, n_bars_b=3, n_bars_d=6,
    conc_mat=concrete, steel_mat=steel, filled=False, n_circle=4
)
geometry.create_mesh(mesh_sizes=[500])
concrete_tee_section
sectionproperties.pre.library.concrete_sections.concrete_tee_section(b: float, d: float, b_f: float, d_f: float, dia_top: float, n_top: int, dia_bot: float, n_bot: int, n_circle: int, cover: float, area_top: Optional[float] = None, area_bot: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) CompoundGeometry[source]

Constructs a concrete tee section of width b, depth d, flange width b_f and flange depth d_f, with n_top top steel bars of diameter dia_top, n_bot bottom steel bars of diameter dia_bot, discretised with n_circle points with equal side and top/bottom cover to the steel.

Parameters
  • b (float) – Concrete section width

  • d (float) – Concrete section depth

  • b_f (float) – Concrete section flange width

  • d_f (float) – Concrete section flange depth

  • dia_top (float) – Diameter of the top steel reinforcing bars

  • n_top (int) – Number of top steel reinforcing bars

  • dia_bot (float) – Diameter of the bottom steel reinforcing bars

  • n_bot (int) – Number of bottom steel reinforcing bars

  • n_circle (int) – Number of points discretising the steel reinforcing bars

  • cover (float) – Side and bottom cover to the steel reinforcing bars

  • area_top (float) – If provided, constructs top reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • area_bot (float) – If provided, constructs bottom reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to circle discretisation)

  • conc_mat – Material to associatewith the concrete

  • steel_mat – Material toassociate with the steel

Raises

ValueErorr – If the number of bars is not greater than or equal to 2 in an active layer

The following example creates a 900D x 450W concrete beam with a 1200W x 250D flange, with 5N24 steel reinforcing bars and 30 mm cover:

from sectionproperties.pre.library.concrete_sections import concrete_tee_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_tee_section(
    b=450, d=900, b_f=1200, d_f=250, dia_top=24, n_top=0, dia_bot=24, n_bot=5,
    n_circle=24, cover=30, conc_mat=concrete, steel_mat=steel
)
geometry.create_mesh(mesh_sizes=[500])
_images/concrete_tee_section_geometry.png

Concrete tee section geometry.

_images/concrete_tee_section_mesh.png

Mesh generated from the above geometry.

concrete_circular_section
sectionproperties.pre.library.concrete_sections.concrete_circular_section(d: float, n: int, dia: float, n_bar: int, n_circle: int, cover: float, area_conc: Optional[float] = None, area_bar: Optional[float] = None, conc_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), steel_mat: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) CompoundGeometry[source]

Constructs a concrete circular section of diameter d discretised with n points, with n_bar steel bars of diameter dia, discretised with n_circle points with equal side and bottom cover to the steel.

Parameters
  • d (float) – Concrete diameter

  • n (float) – Number of points discretising the concrete section

  • dia (float) – Diameter of the steel reinforcing bars

  • n_bar (int) – Number of steel reinforcing bars

  • n_circle (int) – Number of points discretising the steel reinforcing bars

  • cover (float) – Side and bottom cover to the steel reinforcing bars

  • area_conc (float) – If provided, constructs the concrete based on its area rather than diameter (prevents the underestimation of concrete area due to circle discretisation)

  • area_bar (float) – If provided, constructs reinforcing bars based on their area rather than diameter (prevents the underestimation of steel area due to

  • conc_mat – Material to associate with the concrete

  • steel_mat – Material to associate with the steel

Raises

ValueErorr – If the number of bars is not greater than or equal to 2

The following example creates a 450DIA concrete column with with 6N20 steel reinforcing bars and 45 mm cover:

from sectionproperties.pre.library.concrete_sections import concrete_circular_section
from sectionproperties.pre.pre import Material

concrete = Material(
    name='Concrete', elastic_modulus=30.1e3, poissons_ratio=0.2, yield_strength=32,
    density=2.4e-6, color='lightgrey'
)
steel = Material(
    name='Steel', elastic_modulus=200e3, poissons_ratio=0.3, yield_strength=500,
    density=7.85e-6, color='grey'
)

geometry = concrete_circular_section(
    d=450, n=64, dia=20, n_bar=6, n_circle=24, cover=45, conc_mat=concrete, steel_mat=steel
)
geometry.create_mesh(mesh_sizes=[500])
_images/concrete_circular_section_geometry.png

Concrete circular section geometry.

_images/concrete_circular_section_mesh.png

Mesh generated from the above geometry.

add_bar
sectionproperties.pre.library.concrete_sections.add_bar(geometry: Union[Geometry, CompoundGeometry], area: float, material: Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w'), x: float, y: float, n: int = 4) CompoundGeometry[source]

Adds a reinforcing bar to a sectionproperties geometry.

Bars are discretised by four points by default.

Parameters
  • geometry – Reinforced concrete geometry to which the new bar will be added

  • area – Bar cross-sectional area

  • material – Material object for the bar

  • x – x-position of the bar

  • y – y-position of the bar

  • n – Number of points to discretise the bar circle

Returns

Reinforced concrete geometry with added bar

bridge_sections Module

super_t_girder_section
sectionproperties.pre.library.bridge_sections.super_t_girder_section(girder_type: int, girder_subtype: int = 2, w: float = 2100, t_w: Optional[float] = None, t_f: float = 75, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Super T Girder section to AS5100.5.

Parameters
  • girder_type (int) – Type of Super T (1 to 5)

  • girder_subtype (int) – Era Super T (1: pre-2001, 2:contemporary)

  • w (float) – Overall width of top flange

  • t_w (float) – Web thickness of the Super-T section (defaults to those of AS5100.5 Tb D3(B))

  • t_f (float) – Thickness of top flange (VIC (default) = 75 mm; NSW = 90 mm)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a T5 Super-T section with a 180 mm overlay slab and assigns the different material properties:

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

Dslab, w, t_f = 180, 2100, 75

precast = Material(
    name="65 MPa",
    elastic_modulus=37.4e3,
    poissons_ratio=0.2,
    yield_strength=65,
    density=2.4e-6,
    color="grey",
)
insitu = Material(
    name="40 MPa",
    elastic_modulus=32.8e3,
    poissons_ratio=0.2,
    yield_strength=40,
    density=2.4e-6,
    color="lightgrey",
)

super_t = bridge_sections.super_t_girder_section(girder_type=5, w=w, material=precast)
slab = primitive_sections.rectangular_section(
    d=Dslab, b=w, material=insitu
).shift_section(-w / 2, t_f)

geom = super_t + slab
geom.plot_geometry()
geom.create_mesh(mesh_sizes=[500])

sec = Section(geom)
sec.plot_mesh()

sec.calculate_geometric_properties()
sec.calculate_warping_properties()
sec.display_results(fmt=".3f")

Note that the properties are reported as modulus weighted properties (e.g. E.A) and can be normalized to the reference material by dividing by that elastic modulus:

A_65 = section.get_ea() / precast.elastic_modulus

The reported section centroids are already weighted.

_images/super_tee.png

Super Tee Girder.

i_girder_section
sectionproperties.pre.library.bridge_sections.i_girder_section(girder_type: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a precast I girder section to AS5100.5.

Parameters
  • girder_type (int) – Type of I Girder (1 to 4)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

As an example, replicate the table shown in AS5100.5 Fig. D1(A):

import pandas as pd
import sectionproperties.pre.library.bridge_sections as bridge_sections
from sectionproperties.analysis.section import Section

df = pd.DataFrame(columns=["Ag", "Zt", "Zb", "I", "dy", "th"])

for i in range(4):
    geom = bridge_sections.i_girder_section(girder_type=i + 1)
    dims = bridge_sections.get_i_girder_dims(girder_type=i + 1)
    d = sum(dims[-5:])
    geom.create_mesh(mesh_sizes=[200])
    geom.plot_geometry()
    sec = Section(geom)
    sec.plot_mesh()
    sec.calculate_geometric_properties()
    sec.calculate_warping_properties()

    A = sec.get_area()
    th = A / (sec.get_perimeter() / 2)

    df.loc[i] = [
        A,
        *(sec.get_z()[:2]),
        sec.get_ic()[0],
        d + sec.get_c()[1],
        th,
    ]

print(df)

Note that the section depth is obtained by summing the heights from the section dictionary in get_i_girder_dims().

_images/i_girder.png

I Girder.

get_super_t_girder_dims
sectionproperties.pre.library.bridge_sections.get_super_t_girder_dims(girder_type)[source]

Returns a dictionary of Super-T dimensions, refer to AS5100.5, Appendix D

Parameters

girder_type (int) – Type of Super T (1 to 5)

get_i_girder_dims
sectionproperties.pre.library.bridge_sections.get_i_girder_dims(girder_type)[source]

Returns a dictionary of I girder dimensions, refer to AS5100.5, Appendix D

Parameters

girder_type (int) – Type of I Girder (1 to 4)

nastran_sections Module

This module contains sections as defined by Nastran and Nastran-based programs, such as MYSTRAN and ASTROS.

nastran_bar
sectionproperties.pre.library.nastran_sections.nastran_bar(DIM1: float, DIM2: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a BAR section with the center at the origin (0, 0), with two parameters defining dimensions. See Nastran documentation 1 2 3 4 5 for definition of parameters. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of bar

  • DIM2 (float) – Depth (y) of bar

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a BAR cross-section with a depth of 1.5 and width of 2.0, and generates a mesh with a maximum triangular area of 0.001:

from sectionproperties.pre.library.nastran_sections import nastran_bar

geom = nastran_bar(DIM1=2.0, DIM2=1.5)
mesh = geometry.create_mesh(mesh_sizes=[0.001])
_images/bar_geometry.png

BAR section geometry.

_images/bar_mesh.png

Mesh generated from the above geometry.

nastran_box
sectionproperties.pre.library.nastran_sections.nastran_box(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a BOX section with the center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 5 for definition of parameters. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of box

  • DIM2 (float) – Depth (y) of box

  • DIM3 (float) – Thickness of box in y direction

  • DIM4 (float) – Thickness of box in x direction

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a BOX cross-section with a depth of 3.0 and width of 4.0, and generates a mesh with a maximum triangular area of 0.001:

from sectionproperties.pre.library.nastran_sections import nastran_box

geom = nastran_box(DIM1=4.0, DIM2=3.0, DIM3=0.375, DIM4=0.5)
mesh = geometry.create_mesh(mesh_sizes=[0.001])
_images/box_geometry.png

BOX section geometry.

_images/box_mesh.png

Mesh generated from the above geometry.

nastran_box1
sectionproperties.pre.library.nastran_sections.nastran_box1(DIM1: float, DIM2: float, DIM3: float, DIM4: float, DIM5: float, DIM6: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a BOX1 section with the center at the origin (0, 0), with six parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of box

  • DIM2 (float) – Depth (y) of box

  • DIM3 (float) – Thickness of top wall

  • DIM4 (float) – Thickness of bottom wall

  • DIM5 (float) – Thickness of left wall

  • DIM6 (float) – Thickness of right wall

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a BOX1 cross-section with a depth of 3.0 and width of 4.0, and generates a mesh with a maximum triangular area of 0.007:

from sectionproperties.pre.library.nastran_sections import nastran_box1

geom = nastran_box1(
    DIM1=4.0, DIM2=3.0, DIM3=0.375, DIM4=0.5, DIM5=0.25, DIM6=0.75
)
mesh = geometry.create_mesh(mesh_sizes=[0.007])
_images/box1_geometry.png

BOX1 section geometry.

_images/box1_mesh.png

Mesh generated from the above geometry.

nastran_chan
sectionproperties.pre.library.nastran_sections.nastran_chan(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a CHAN (C-Channel) section with the web’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of the CHAN-section

  • DIM2 (float) – Depth (y) of the CHAN-section

  • DIM3 (float) – Thickness of web (vertical portion)

  • DIM4 (float) – Thickness of flanges (top/bottom portion)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a CHAN cross-section with a depth of 4.0 and width of 2.0, and generates a mesh with a maximum triangular area of 0.008:

from sectionproperties.pre.library.nastran_sections import nastran_chan

geom = nastran_chan(DIM1=2.0, DIM2=4.0, DIM3=0.25, DIM4=0.5)
mesh = geometry.create_mesh(mesh_sizes=[0.008])
_images/chan_geometry.png

CHAN section geometry.

_images/chan_mesh.png

Mesh generated from the above geometry.

nastran_chan1
sectionproperties.pre.library.nastran_sections.nastran_chan1(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a CHAN1 (C-Channel) section with the web’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of channels

  • DIM2 (float) – Thickness (x) of web

  • DIM3 (float) – Spacing between channels (length of web)

  • DIM4 (float) – Depth (y) of CHAN1-section

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a CHAN1 cross-section with a depth of 4.0 and width of 1.75, and generates a mesh with a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_chan1

geom = nastran_chan1(DIM1=0.75, DIM2=1.0, DIM3=3.5, DIM4=4.0)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/chan1_geometry.png

CHAN1 section geometry.

_images/chan1_mesh.png

Mesh generated from the above geometry.

nastran_chan2
sectionproperties.pre.library.nastran_sections.nastran_chan2(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a CHAN2 (C-Channel) section with the bottom web’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Thickness of channels

  • DIM2 (float) – Thickness of web

  • DIM3 (float) – Depth (y) of CHAN2-section

  • DIM4 (float) – Width (x) of CHAN2-section

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a CHAN2 cross-section with a depth of 2.0 and width of 4.0, and generates a mesh with a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_chan2

geom = nastran_chan2(DIM1=0.375, DIM2=0.5, DIM3=2.0, DIM4=4.0)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/chan2_geometry.png

CHAN2 section geometry.

_images/chan2_mesh.png

Mesh generated from the above geometry.

nastran_cross
sectionproperties.pre.library.nastran_sections.nastran_cross(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs Nastran’s cruciform/cross section with the intersection’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Twice the width of horizontal member protruding from the vertical center member

  • DIM2 (float) – Thickness of the vertical member

  • DIM3 (float) – Depth (y) of the CROSS-section

  • DIM4 (float) – Thickness of the horizontal members

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a rectangular cross-section with a depth of 3.0 and width of 1.875, and generates a mesh with a maximum triangular area of 0.008:

from sectionproperties.pre.library.nastran_sections import nastran_cross

geom = nastran_cross(DIM1=1.5, DIM2=0.375, DIM3=3.0, DIM4=0.25)
mesh = geometry.create_mesh(mesh_sizes=[0.008])
_images/cross_geometry.png

Cruciform/cross section geometry.

_images/cross_mesh.png

Mesh generated from the above geometry.

nastran_dbox
sectionproperties.pre.library.nastran_sections.nastran_dbox(DIM1: float, DIM2: float, DIM3: float, DIM4: float, DIM5: float, DIM6: float, DIM7: float, DIM8: float, DIM9: float, DIM10: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a DBOX section with the center at the origin (0, 0), with ten parameters defining dimensions. See MSC Nastran documentation 1 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of the DBOX-section

  • DIM2 (float) – Depth (y) of the DBOX-section

  • DIM3 (float) – Width (x) of left-side box

  • DIM4 (float) – Thickness of left wall

  • DIM5 (float) – Thickness of center wall

  • DIM6 (float) – Thickness of right wall

  • DIM7 (float) – Thickness of top left wall

  • DIM8 (float) – Thickness of bottom left wall

  • DIM9 (float) – Thickness of top right wall

  • DIM10 (float) – Thickness of bottom right wall

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a DBOX cross-section with a depth of 3.0 and width of 8.0, and generates a mesh with a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_dbox

geom = nastran_dbox(
    DIM1=8.0, DIM2=3.0, DIM3=3.0, DIM4=0.5, DIM5=0.625, DIM6=0.75, DIM7=0.375, DIM8=0.25,
    DIM9=0.5, DIM10=0.375
)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/dbox_geometry.png

DBOX section geometry.

_images/dbox_mesh.png

Mesh generated from the above geometry.

nastran_fcross
sectionproperties.pre.library.nastran_sections.nastran_fcross(DIM1: float, DIM2: float, DIM3: float, DIM4: float, DIM5: float, DIM6: float, DIM7: float, DIM8: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a flanged cruciform/cross section with the intersection’s middle center at the origin (0, 0), with eight parameters defining dimensions. Added by JohnDN90.

Parameters
  • DIM1 (float) – Depth (y) of flanged cruciform

  • DIM2 (float) – Width (x) of flanged cruciform

  • DIM3 (float) – Thickness of vertical web

  • DIM4 (float) – Thickness of horizontal web

  • DIM5 (float) – Length of flange attached to vertical web

  • DIM6 (float) – Thickness of flange attached to vertical web

  • DIM7 (float) – Length of flange attached to horizontal web

  • DIM8 (float) – Thickness of flange attached to horizontal web

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example demonstrates the creation of a flanged cross section:

from sectionproperties.pre.library.nastran_sections import nastran_fcross

geom = nastran_fcross(
    DIM1=9.0, DIM2=6.0, DIM3=0.75, DIM4=0.625, DIM5=2.1, DIM6=0.375, DIM7=4.5, DIM8=0.564
)
mesh = geometry.create_mesh(mesh_sizes=[0.03])
_images/fcross_geometry.png

Flanged Cruciform/cross section geometry.

_images/fcross_mesh.png

Mesh generated from the above geometry.

nastran_gbox
sectionproperties.pre.library.nastran_sections.nastran_gbox(DIM1: float, DIM2: float, DIM3: float, DIM4: float, DIM5: float, DIM6: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a GBOX section with the center at the origin (0, 0), with six parameters defining dimensions. See ASTROS documentation 5 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of the GBOX-section

  • DIM2 (float) – Depth (y) of the GBOX-section

  • DIM3 (float) – Thickness of top flange

  • DIM4 (float) – Thickness of bottom flange

  • DIM5 (float) – Thickness of webs

  • DIM6 (float) – Spacing between webs

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a GBOX cross-section with a depth of 2.5 and width of 6.0, and generates a mesh with a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_gbox

geom = nastran_gbox(
    DIM1=6.0, DIM2=2.5, DIM3=0.375, DIM4=0.25, DIM5=0.625, DIM6=1.0
)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/gbox_geometry.png

GBOX section geometry.

_images/gbox_mesh.png

Mesh generated from the above geometry.

nastran_h
sectionproperties.pre.library.nastran_sections.nastran_h(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a H section with the middle web’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Spacing between vertical flanges (length of web)

  • DIM2 (float) – Twice the thickness of the vertical flanges

  • DIM3 (float) – Depth (y) of the H-section

  • DIM4 (float) – Thickness of the middle web

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a H cross-section with a depth of 3.5 and width of 2.75, and generates a mesh with a maximum triangular area of 0.005:

from sectionproperties.pre.library.nastran_sections import nastran_h

geom = nastran_h(DIM1=2.0, DIM2=0.75, DIM3=3.5, DIM4=0.25)
mesh = geometry.create_mesh(mesh_sizes=[0.005])
_images/h_geometry.png

H section geometry.

_images/h_mesh.png

Mesh generated from the above geometry.

nastran_hat
sectionproperties.pre.library.nastran_sections.nastran_hat(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Hat section with the top most section’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Note that HAT in ASTROS is actually HAT1 in this code. Added by JohnDN90.

Parameters
  • DIM1 (float) – Depth (y) of HAT-section

  • DIM2 (float) – Thickness of HAT-section

  • DIM3 (float) – Width (x) of top most section

  • DIM4 (float) – Width (x) of bottom sections

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a HAT cross-section with a depth of 1.25 and width of 2.5, and generates a mesh with a maximum triangular area of 0.001:

from sectionproperties.pre.library.nastran_sections import nastran_hat

geom = nastran_hat(DIM1=1.25, DIM2=0.25, DIM3=1.5, DIM4=0.5)
mesh = geometry.create_mesh(mesh_sizes=[0.001])
_images/hat_geometry.png

HAT section geometry.

_images/hat_mesh.png

Mesh generated from the above geometry.

nastran_hat1
sectionproperties.pre.library.nastran_sections.nastran_hat1(DIM1: float, DIM2: float, DIM3: float, DIM4: float, DIM5: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a HAT1 section with the bottom plate’s bottom center at the origin (0, 0), with five parameters defining dimensions. See Nastran documentation 1 2 3 5 for definition of parameters. Note that in ASTROS, HAT1 is called HAT. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width(x) of the HAT1-section

  • DIM2 (float) – Depth (y) of the HAT1-section

  • DIM3 (float) – Width (x) of hat’s top flange

  • DIM4 (float) – Thickness of hat stiffener

  • DIM5 (float) – Thicknesss of bottom plate

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a HAT1 cross-section with a depth of 2.0 and width of 4.0, and generates a mesh with a maximum triangular area of 0.005:

from sectionproperties.pre.library.nastran_sections import nastran_hat1

geom = nastran_hat1(DIM1=4.0, DIM2=2.0, DIM3=1.5, DIM4=0.1875, DIM5=0.375)
mesh = geometry.create_mesh(mesh_sizes=[0.005])
_images/hat1_geometry.png

HAT1 section geometry.

_images/hat1_mesh.png

Mesh generated from the above geometry.

nastran_hexa
sectionproperties.pre.library.nastran_sections.nastran_hexa(DIM1: float, DIM2: float, DIM3: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a HEXA (hexagon) section with the center at the origin (0, 0), with three parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Spacing between bottom right point and right most point

  • DIM2 (float) – Width (x) of hexagon

  • DIM3 (float) – Depth (y) of hexagon

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a rectangular cross-section with a depth of 1.5 and width of 2.0, and generates a mesh with a maximum triangular area of 0.005:

from sectionproperties.pre.library.nastran_sections import nastran_hexa

geom = nastran_hexa(DIM1=0.5, DIM2=2.0, DIM3=1.5)
mesh = geometry.create_mesh(mesh_sizes=[0.005])
_images/hexa_geometry.png

HEXA section geometry.

_images/hexa_mesh.png

Mesh generated from the above geometry.

nastran_i
sectionproperties.pre.library.nastran_sections.nastran_i(DIM1: float, DIM2: float, DIM3: float, DIM4: float, DIM5: float, DIM6: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs Nastran’s I section with the bottom flange’s middle center at the origin (0, 0), with six parameters defining dimensions. See Nastran documentation 1 2 3 4 for definition of parameters. Added by JohnDN90.

Parameters
  • DIM1 (float) – Depth(y) of the I Section

  • DIM2 (float) – Width (x) of bottom flange

  • DIM3 (float) – Width (x) of top flange

  • DIM4 (float) – Thickness of web

  • DIM5 (float) – Thickness of bottom web

  • DIM6 (float) – Thickness of top web

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a Nastran I cross-section with a depth of 5.0, and generates a mesh with a maximum triangular area of 0.008:

from sectionproperties.pre.library.nastran_sections import nastran_i

geom = nastran_i(
    DIM1=5.0, DIM2=2.0, DIM3=3.0, DIM4=0.25, DIM5=0.375, DIM6=0.5
)
mesh = geometry.create_mesh(mesh_sizes=[0.008])
_images/ni_geometry.png

Nastran’s I section geometry.

_images/ni_mesh.png

Mesh generated from the above geometry.

nastran_i1
sectionproperties.pre.library.nastran_sections.nastran_i1(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a I1 section with the web’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Twice distance from web end to flange end

  • DIM2 (float) – Thickness of web

  • DIM3 (float) – Length of web (spacing between flanges)

  • DIM4 (float) – Depth (y) of the I1-section

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a I1 cross-section with a depth of 5.0 and width of 1.75, and generates a mesh with a maximum triangular area of 0.02:

from sectionproperties.pre.library.nastran_sections import nastran_i1

geom = nastran_i1(DIM1=1.0, DIM2=0.75, DIM3=4.0, DIM4=5.0)
mesh = geometry.create_mesh(mesh_sizes=[0.02])
_images/i1_geometry.png

I1 section geometry.

_images/i1_mesh.png

Mesh generated from the above geometry.

nastran_l
sectionproperties.pre.library.nastran_sections.nastran_l(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a L section with the intersection’s center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of the L-section

  • DIM2 (float) – Depth (y) of the L-section

  • DIM3 (float) – Thickness of flange (horizontal portion)

  • DIM4 (float) – Thickness of web (vertical portion)

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a L cross-section with a depth of 6.0 and width of 3.0, and generates a mesh with a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_l

geom = nastran_l(DIM1=3.0, DIM2=6.0, DIM3=0.375, DIM4=0.625)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/l_geometry.png

L section geometry.

_images/l_mesh.png

Mesh generated from the above geometry.

nastran_rod
sectionproperties.pre.library.nastran_sections.nastran_rod(DIM1: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a circular rod section with the center at the origin (0, 0), with one parameter defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Radius of the circular rod section

  • n (int) – Number of points discretising the circle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a circular rod with a radius of 3.0 and 50 points discretising the boundary, and generates a mesh with a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_rod

geom = nastran_rod(DIM1=3.0, n=50)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/rod_geometry.png

Rod section geometry.

_images/rod_mesh.png

Mesh generated from the above geometry.

nastran_tee
sectionproperties.pre.library.nastran_sections.nastran_tee(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a T section with the top flange’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 5 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of top flange

  • DIM2 (float) – Depth (y) of the T-section

  • DIM3 (float) – Thickness of top flange

  • DIM4 (float) – Thickness of web

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a T cross-section with a depth of 4.0 and width of 3.0, and generates a mesh with a maximum triangular area of 0.001:

from sectionproperties.pre.library.nastran_sections import nastran_tee

geom = nastran_tee(DIM1=3.0, DIM2=4.0, DIM3=0.375, DIM4=0.25)
mesh = geometry.create_mesh(mesh_sizes=[0.001])
_images/t_geometry.png

T section geometry.

_images/t_mesh.png

Mesh generated from the above geometry.

nastran_tee1
sectionproperties.pre.library.nastran_sections.nastran_tee1(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a T1 section with the right flange’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Depth (y) of T1-section

  • DIM2 (float) – Length (x) of web

  • DIM3 (float) – Thickness of right flange

  • DIM4 (float) – Thickness of web

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a T1 cross-section with a depth of 3.0 and width of 3.875, and generates a mesh with a maximum triangular area of 0.001:

from sectionproperties.pre.library.nastran_sections import nastran_tee1

geom = nastran_tee1(DIM1=3.0, DIM2=3.5, DIM3=0.375, DIM4=0.25)
mesh = geometry.create_mesh(mesh_sizes=[0.001])
_images/t1_geometry.png

T1 section geometry.

_images/t1_mesh.png

Mesh generated from the above geometry.

nastran_tee2
sectionproperties.pre.library.nastran_sections.nastran_tee2(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a T2 section with the bottom flange’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of T2-section

  • DIM2 (float) – Depth (y) of T2-section

  • DIM3 (float) – Thickness of bottom flange

  • DIM4 (float) – Thickness of web

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a T2 cross-section with a depth of 4.0 and width of 3.0, and generates a mesh with a maximum triangular area of 0.005:

from sectionproperties.pre.library.nastran_sections import nastran_tee2

geom = nastran_tee2(DIM1=3.0, DIM2=4.0, DIM3=0.375, DIM4=0.5)
mesh = geometry.create_mesh(mesh_sizes=[0.005])
_images/t2_geometry.png

T2 section geometry.

_images/t2_mesh.png

Mesh generated from the above geometry.

nastran_tube
sectionproperties.pre.library.nastran_sections.nastran_tube(DIM1: float, DIM2: float, n: int, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a circular tube section with the center at the origin (0, 0), with two parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Outer radius of the circular tube section

  • DIM2 (float) – Inner radius of the circular tube section

  • n (int) – Number of points discretising the circle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a circular tube cross-section with an outer radius of 3.0 and an inner radius of 2.5, and generates a mesh with 37 points discretising the boundaries and a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_tube

geom = nastran_tube(DIM1=3.0, DIM2=2.5, n=37)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/tube_geometry.png

TUBE section geometry.

_images/tube_mesh.png

Mesh generated from the above geometry.

nastran_tube2
sectionproperties.pre.library.nastran_sections.nastran_tube2(DIM1: float, DIM2: float, n: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a circular TUBE2 section with the center at the origin (0, 0), with two parameters defining dimensions. See MSC Nastran documentation 1 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Outer radius of the circular tube section

  • DIM2 (float) – Thickness of wall

  • n (int) – Number of points discretising the circle

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a circular TUBE2 cross-section with an outer radius of 3.0 and a wall thickness of 0.5, and generates a mesh with 37 point discretising the boundary and a maximum triangular area of 0.01:

from sectionproperties.pre.library.nastran_sections import nastran_tube2

geom = nastran_tube2(DIM1=3.0, DIM2=0.5, n=37)
mesh = geometry.create_mesh(mesh_sizes=[0.01])
_images/tube2_geometry.png

TUBE2 section geometry.

_images/tube2_mesh.png

Mesh generated from the above geometry.

nastran_zed
sectionproperties.pre.library.nastran_sections.nastran_zed(DIM1: float, DIM2: float, DIM3: float, DIM4: float, material: Material = Material(name='default', elastic_modulus=1, poissons_ratio=0, yield_strength=1, density=1, color='w')) Geometry[source]

Constructs a Z section with the web’s middle center at the origin (0, 0), with four parameters defining dimensions. See Nastran documentation 1 2 3 4 for more details. Added by JohnDN90.

Parameters
  • DIM1 (float) – Width (x) of horizontal members

  • DIM2 (float) – Thickness of web

  • DIM3 (float) – Spacing between horizontal members (length of web)

  • DIM4 (float) – Depth (y) of Z-section

  • Optional[sectionproperties.pre.pre.Material] – Material to associate with this geometry

The following example creates a rectangular cross-section with a depth of 4.0 and width of 2.75, and generates a mesh with a maximum triangular area of 0.005:

from sectionproperties.pre.library.nastran_sections import nastran_zed

geom = nastran_zed(DIM1=1.125, DIM2=0.5, DIM3=3.5, DIM4=4.0)
mesh = geometry.create_mesh(mesh_sizes=[0.005])
_images/z_geometry.png

Z section geometry.

_images/z_mesh.png

Mesh generated from the above geometry.

Nastran References
1(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22)

MSC Nastran Quick Reference Guide 2012, PBEAML - Simple Beam Cross-Section Property, pp. 2890-2894 https://simcompanion.mscsoftware.com/infocenter/index?page=content&id=DOC10351

2(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)

Siemens NX Nastran 12 Quick Reference Guide, PBEAML, pp. 16-59 - 16-62 https://docs.plm.automation.siemens.com/data_services/resources/nxnastran/12/help/tdoc/en_US/pdf/QRG.pdf

3(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)

AutoDesk Nastran Online Documentation, Nastran Reference Guide, Section 4 - Bulk Data, PBEAML http://help.autodesk.com/view/NSTRN/2018/ENU/?guid=GUID-B7044BA7-3C26-49DA-9EE7-DA7505FD4B2C

4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18)

Users Reference Manual for the MYSTRAN General Purpose Finite Element Structural Analysis Computer Program, Jan. 2019, Section 6.4.1.53 - PBARL, pp. 154-156 https://www.mystran.com/Executable/MYSTRAN-Users-Manual.pdf

5(1,2,3,4,5)

Astros Enhancements - Volume III - Astros Theoretical Manual, Section 5.1.3.2, pp. 56 https://apps.dtic.mil/dtic/tr/fulltext/u2/a308134.pdf

Analysis Package

section Module

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

Bases: object

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

assemble_torsion(progress=None, task=None)[source]

Assembles stiffness matrices to be used for the computation of warping properties and the torsion load vector (f_torsion). A Lagrangian multiplier (k_lg) stiffness matrix is returned. The stiffness matrix are assembled using the sparse COO format and returned in the sparse CSC format.

Returns

Lagrangian multiplier stiffness matrix and torsion load vector (k_lg, f_torsion)

Return type

tuple(scipy.sparse.csc_matrix, numpy.ndarray)

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()
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()
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

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

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

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
display_results(fmt='8.6e')[source]

Prints the results that have been calculated to the terminal.

Parameters

fmt (string) – Number formatting string

The following example displays the geometric section properties for a 100D x 50W rectangle with three digits after the decimal point:

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)
section.calculate_geometric_properties()

section.display_results(fmt='.3f')
get_As()[source]
Returns

Shear area for loading about the centroidal axis (A_sx, A_sy)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(A_sx, A_sy) = section.get_As()
get_As_p()[source]
Returns

Shear area for loading about the principal bending axis (A_s11, A_s22)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(A_s11, A_s22) = section.get_As_p()
get_area()[source]
Returns

Cross-section area

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
area = section.get_area()
get_beta()[source]
Returns

Monosymmetry constant for bending about both global axes (beta_x_plus, beta_x_minus, beta_y_plus, beta_y_minus). The plus value relates to the top flange in compression and the minus value relates to the bottom flange in compression.

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(beta_x_plus, beta_x_minus, beta_y_plus, beta_y_minus) = section.get_beta()
get_beta_p()[source]
Returns

Monosymmetry constant for bending about both principal axes (beta_11_plus, beta_11_minus, beta_22_plus, beta_22_minus). The plus value relates to the top flange in compression and the minus value relates to the bottom flange in compression.

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(beta_11_plus, beta_11_minus, beta_22_plus, beta_22_minus) = section.get_beta_p()
get_c()[source]
Returns

Elastic centroid (cx, cy)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(cx, cy) = section.get_c()
get_e_eff()[source]
Returns

Effective elastic modulus based on area

Return type

float

section = Section(geometry)
section.calculate_warping_properties()
e_eff = section.get_e_eff()
get_ea()[source]
Returns

Modulus weighted area (axial rigidity)

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
ea = section.get_ea()
get_g_eff()[source]
Returns

Effective shear modulus based on area

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
g_eff = section.get_g_eff()
get_gamma()[source]
Returns

Warping constant

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
gamma = section.get_gamma()
get_ic()[source]
Returns

Second moments of area centroidal axis (ixx_c, iyy_c, ixy_c)

Return type

tuple(float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(ixx_c, iyy_c, ixy_c) = section.get_ic()
get_ig()[source]
Returns

Second moments of area about the global axis (ixx_g, iyy_g, ixy_g)

Return type

tuple(float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(ixx_g, iyy_g, ixy_g) = section.get_ig()
get_ip()[source]
Returns

Second moments of area about the principal axis (i11_c, i22_c)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(i11_c, i22_c) = section.get_ip()
get_j()[source]
Returns

St. Venant torsion constant

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
j = section.get_j()
get_mass()[source]
Returns

Cross-section mass

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
perimeter = section.get_mass()
get_nu_eff()[source]
Returns

Effective Poisson’s ratio

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
nu_eff = section.get_nu_eff()
get_pc()[source]
Returns

Centroidal axis plastic centroid (x_pc, y_pc)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(x_pc, y_pc) = section.get_pc()
get_pc_p()[source]
Returns

Principal bending axis plastic centroid (x11_pc, y22_pc)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(x11_pc, y22_pc) = section.get_pc_p()
get_perimeter()[source]
Returns

Cross-section perimeter

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
perimeter = section.get_perimeter()
get_phi()[source]
Returns

Principal bending axis angle

Return type

float

section = Section(geometry)
section.calculate_geometric_properties()
phi = section.get_phi()
get_q()[source]
Returns

First moments of area about the global axis (qx, qy)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(qx, qy) = section.get_q()
get_rc()[source]
Returns

Radii of gyration about the centroidal axis (rx, ry)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(rx, ry) = section.get_rc()
get_rp()[source]
Returns

Radii of gyration about the principal axis (r11, r22)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(r11, r22) = section.get_rp()
get_s()[source]
Returns

Plastic section moduli about the centroidal axis (sxx, syy)

Return type

tuple(float, float)

If material properties have been specified, returns the plastic moment \(M_p = f_y S\).

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(sxx, syy) = section.get_s()
get_sc()[source]
Returns

Centroidal axis shear centre (elasticity approach) (x_se, y_se)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(x_se, y_se) = section.get_sc()
get_sc_p()[source]
Returns

Principal axis shear centre (elasticity approach) (x11_se, y22_se)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(x11_se, y22_se) = section.get_sc_p()
get_sc_t()[source]
Returns

Centroidal axis shear centre (Trefftz’s approach) (x_st, y_st)

Return type

tuple(float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_warping_properties()
(x_st, y_st) = section.get_sc_t()
get_sf()[source]
Returns

Centroidal axis shape factors with respect to the top and bottom fibres (sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(sf_xx_plus, sf_xx_minus, sf_yy_plus, sf_yy_minus) = section.get_sf()
get_sf_p()[source]
Returns

Principal bending axis shape factors with respect to the top and bottom fibres (sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(sf_11_plus, sf_11_minus, sf_22_plus, sf_22_minus) = section.get_sf_p()
get_sp()[source]
Returns

Plastic section moduli about the principal bending axis (s11, s22)

Return type

tuple(float, float)

If material properties have been specified, returns the plastic moment \(M_p = f_y S\).

section = Section(geometry)
section.calculate_geometric_properties()
section.calculate_plastic_properties()
(s11, s22) = section.get_sp()
get_stress_at_point(pt: ~typing.List[float], N=0, Mxx=0, Myy=0, M11=0, M22=0, Mzz=0, Vx=0, Vy=0, agg_func=<function average>) Tuple[float][source]

Calculates the stress at a point within an element for given design actions and returns (sigma_zz, tau_xz, tau_yz)

Parameters
  • pt (list[float, float]) – The point. A list of the x and y coordinate

  • 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

  • agg_function (function, optional) – A function that aggregates the stresses if the point is shared by several elements. If the point, pt, is shared by several elements (e.g. if it is a node or on an edge), the stress (sigma_zz, tau_xz, tau_yz) are retrieved from each element and combined according to this function. By default, numpy.average is used.

Returns

Resultant normal and shear stresses list[(sigma_zz, tau_xz, tau_yz)]. If a point it not in the section then None is returned.

Return type

Union[Tuple[float, float, float], None]

get_stress_at_points(pts: ~typing.List[~typing.List[float]], N=0, Mxx=0, Myy=0, M11=0, M22=0, Mzz=0, Vx=0, Vy=0, agg_func=<function average>) List[Tuple][source]

Calculates the stress at a set of points within an element for given design actions and returns (sigma_zz, tau_xz, tau_yz)

Parameters
  • pts (list[list[float, float]]) – The points. A list of several x and y coordinates

  • 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

  • agg_function (function, optional) – A function that aggregates the stresses if the point is shared by several elements. If the point, pt, is shared by several elements (e.g. if it is a node or on an edge), the stress (sigma_zz, tau_xz, tau_yz) are retrieved from each element and combined according to this function. By default, numpy.average is used.

Returns

Resultant normal and shear stresses list[(sigma_zz, tau_xz, tau_yz)]. If a point it not in the section then None is returned for that element in the list.

Return type

List[Union[Tuple[float, float, float], None]]

get_z()[source]
Returns

Elastic section moduli about the centroidal axis with respect to the top and bottom fibres (zxx_plus, zxx_minus, zyy_plus, zyy_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(zxx_plus, zxx_minus, zyy_plus, zyy_minus) = section.get_z()
get_zp()[source]
Returns

Elastic section moduli about the principal axis with respect to the top and bottom fibres (z11_plus, z11_minus, z22_plus, z22_minus)

Return type

tuple(float, float, float, float)

section = Section(geometry)
section.calculate_geometric_properties()
(z11_plus, z11_minus, z22_plus, z22_minus) = section.get_zp()
plot_centroids(title='Centroids', **kwargs)[source]

Plots the elastic centroid, the shear centre, the plastic centroids and the principal axis, if they have been calculated, on top of the finite element mesh.

Parameters
Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example analyses a 200 PFC section and displays a plot of the centroids:

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

geometry = steel_sections.channel_section(d=200, b=75, t_f=12, t_w=6, r=12, n_r=8)
geometry.create_mesh(mesh_sizes=[20])

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

section.plot_centroids()
_images/pfc_centroids.png

Plot of the centroids generated by the above example.

The following example analyses a 150x90x12 UA section and displays a plot of the centroids:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])

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

section.plot_centroids()
_images/angle_centroids.png

Plot of the centroids generated by the above example.

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.

PlasticSection Class
class sectionproperties.analysis.section.PlasticSection(geom: Union[Geometry, CompoundGeometry])[source]

Bases: object

Class for the plastic analysis of cross-sections.

Stores the finite element geometry and material information and provides methods to compute the plastic section properties.

Parameters

section (Section) – Section object

Variables
  • geometry (Geometry) – Deep copy of the Section geometry object provided to the constructor

  • materials (list[Material]) – A list of material properties corresponding to various regions in the geometry and 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

  • elements (list[Tri6]) – List of finite element objects describing the cross-section mesh

  • f_top – Current force in the top region

  • c_top – Centroid of the force in the top region (c_top_x, c_top_y)

  • c_bot – Centroid of the force in the bottom region (c_bot_x, c_bot_y)

calculate_centroid(elements)[source]

Calculates the elastic centroid from a list of finite elements.

Parameters

elements (list[Tri6]) – A list of Tri6 finite elements.

Returns

A tuple containing the x and y location of the elastic centroid.

Return type

tuple(float, float)

calculate_extreme_fibres(angle)[source]

Calculates the locations of the extreme fibres along and perpendicular to the axis specified by ‘angle’ using the elements stored in self.elements.

Parameters

angle (float) – Angle (in degrees) along which to calculate the extreme fibre locations

Returns

The location of the extreme fibres parallel (u) and perpendicular (v) to the axis (u_min, u_max, v_min, v_max)

Return type

tuple(float, float, float, float)

calculate_plastic_force(u: ndarray, p: ndarray) Tuple[float, float][source]

Sums the forces above and below the axis defined by unit vector u and point p. Also returns the force centroid of the forces above and below the axis.

Parameters
  • elements (list[Tri6]) – A list of Tri6 finite elements.

  • u (numpy.ndarray) – Unit vector defining the direction of the axis

  • p (numpy.ndarray) – Point on the axis

Returns

Force in the top and bottom areas (f_top, f_bot)

Return type

tuple(float, float)

calculate_plastic_properties(section, verbose, progress=None)[source]

Calculates the location of the plastic centroid with respect to the centroidal and principal bending axes, the plastic section moduli and shape factors and stores the results to the supplied Section object.

Parameters
  • section (Section) – Cross section object that uses the same geometry and materials specified in the class constructor

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

check_convergence(root_result, axis)[source]

Checks that the function solver converged and if not, raises a helpful error.

Parameters
  • root_result (scipy.optimize.RootResults) – Result object from the root finder

  • axis (string) – Axis being considered by the function solver

Raises

RuntimeError – If the function solver did not converge

evaluate_force_eq(d, u, u_p, verbose)[source]

Given a distance d from the centroid to an axis (defined by unit vector u), creates a mesh including the new and axis and calculates the force equilibrium. The resultant force, as a ratio of the total force, is returned.

Parameters
  • d (float) – Distance from the centroid to current axis

  • u (numpy.ndarray) – Unit vector defining the direction of the axis

  • u_p (numpy.ndarray) – Unit vector perpendicular to the direction of the axis

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

Returns

The force equilibrium norm

Return type

float

pc_algorithm(u, dlim, axis, verbose)[source]

An algorithm used for solving for the location of the plastic centroid. The algorithm searches for the location of the axis, defined by unit vector u and within the section depth, that satisfies force equilibrium.

Parameters
  • u (numpy.ndarray) – Unit vector defining the direction of the axis

  • dlim (list[float, float]) – List [dmax, dmin] containing the distances from the centroid to the extreme fibres perpendicular to the axis

  • axis (int) – The current axis direction: 1 (e.g. x or 11) or 2 (e.g. y or 22)

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

Returns

The distance to the plastic centroid axis d, the result object r, the force in the top of the section f_top and the location of the centroids of the top and bottom areas c_top and c_bottom

Return type

tuple(float, scipy.optimize.RootResults, float, list[float, float], list[float, float])

print_verbose(d, root_result, axis)[source]

Prints information related to the function solver convergence to the terminal.

Parameters
  • d (float) – Location of the plastic centroid axis

  • root_result (scipy.optimize.RootResults) – Result object from the root finder

  • axis (string) – Axis being considered by the function solver

StressPost Class
class sectionproperties.analysis.section.StressPost(section)[source]

Bases: object

Class for post-processing finite element stress results.

A StressPost object is created when a stress analysis is carried out and is returned as an object to allow post-processing of the results. The StressPost object creates a deep copy of the MaterialGroups within the cross-section to allow the calculation of stresses for each material. Methods for post-processing the calculated stresses are provided.

Parameters

section (Section) – Cross section object for stress calculation

Variables
  • section (Section) – Cross section object for stress calculation

  • material_groups (list[MaterialGroup]) – A deep copy of the section material groups to allow a new stress analysis

get_stress()[source]

Returns the stresses within each material belonging to the current StressPost object.

Returns

A list of dictionaries containing the cross-section stresses for each material.

Return type

list[dict]

A dictionary is returned for each material in the cross-section, containing the following keys and values:

  • ‘Material’: Material name

  • ‘sig_zz_n’: Normal stress \(\sigma_{zz,N}\) resulting from the axial load \(N\)

  • ‘sig_zz_mxx’: Normal stress \(\sigma_{zz,Mxx}\) resulting from the bending moment \(M_{xx}\)

  • ‘sig_zz_myy’: Normal stress \(\sigma_{zz,Myy}\) resulting from the bending moment \(M_{yy}\)

  • ‘sig_zz_m11’: Normal stress \(\sigma_{zz,M11}\) resulting from the bending moment \(M_{11}\)

  • ‘sig_zz_m22’: Normal stress \(\sigma_{zz,M22}\) resulting from the bending moment \(M_{22}\)

  • ‘sig_zz_m’: Normal stress \(\sigma_{zz,\Sigma M}\) resulting from all bending moments

  • ‘sig_zx_mzz’: x-component of the shear stress \(\sigma_{zx,Mzz}\) resulting from the torsion moment

  • ‘sig_zy_mzz’: y-component of the shear stress \(\sigma_{zy,Mzz}\) resulting from the torsion moment

  • ‘sig_zxy_mzz’: Resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the torsion moment

  • ‘sig_zx_vx’: x-component of the shear stress \(\sigma_{zx,Vx}\) resulting from the shear force \(V_{x}\)

  • ‘sig_zy_vx’: y-component of the shear stress \(\sigma_{zy,Vx}\) resulting from the shear force \(V_{x}\)

  • ‘sig_zxy_vx’: Resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear force \(V_{x}\)

  • ‘sig_zx_vy’: x-component of the shear stress \(\sigma_{zx,Vy}\) resulting from the shear force \(V_{y}\)

  • ‘sig_zy_vy’: y-component of the shear stress \(\sigma_{zy,Vy}\) resulting from the shear force \(V_{y}\)

  • ‘sig_zxy_vy’: Resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear force \(V_{y}\)

  • ‘sig_zx_v’: x-component of the shear stress \(\sigma_{zx,\Sigma V}\) resulting from all shear forces

  • ‘sig_zy_v’: y-component of the shear stress \(\sigma_{zy,\Sigma V}\) resulting from all shear forces

  • ‘sig_zxy_v’: Resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from all shear forces

  • ‘sig_zz’: Combined normal stress \(\sigma_{zz}\) resulting from all actions

  • ‘sig_zx’: x-component of the shear stress \(\sigma_{zx}\) resulting from all actions

  • ‘sig_zy’: y-component of the shear stress \(\sigma_{zy}\) resulting from all actions

  • ‘sig_zxy’: Resultant shear stress \(\sigma_{zxy}\) resulting from all actions

  • ‘sig_1’: Major principal stress \(\sigma_{1}\) resulting from all actions

  • ‘sig_3’: Minor principal stress \(\sigma_{3}\) resulting from all actions

  • ‘sig_vm’: von Mises stress \(\sigma_{vM}\) resulting from all actions

The following example returns stresses for each material within a composite section, note that a result is generated for each node in the mesh for all materials irrespective of whether the materials exists at that point or not.

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)
stresses = stress_post.get_stress()

print("Number of nodes: {0}".format(section.num_nodes))

for stress in stresses:
    print('Material: {0}'.format(stress['Material']))
    print('List Size: {0}'.format(len(stress['sig_zz_n'])))
    print('Normal Stresses: {0}'.format(stress['sig_zz_n']))
    print('von Mises Stresses: {0}'.format(stress['sig_vm']))
$ Number of nodes: 2465

$ Material: Timber
$ List Size: 2465
$ Normal Stresses: [0.76923077 0.76923077 0.76923077 ... 0.76923077 0.76923077 0.76923077]
$ von Mises Stresses: [7.6394625  5.38571866 3.84784964 ... 3.09532948 3.66992556 2.81976647]

$ Material: Steel
$ List Size: 2465
$ Normal Stresses: [19.23076923 0. 0. ... 0. 0. 0.]
$ von Mises Stresses: [134.78886419 0. 0. ... 0. 0. 0.]
plot_mohrs_circles(x, y, title=None, **kwargs)[source]

Plots Mohr’s Circles of the 3D stress state at position x, y

Parameters
  • x (float) – x-coordinate of the point to draw Mohr’s Circle

  • y (float) – y-coordinate of the point to draw Mohr’s Circle

  • title (string) – Plot title

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the Mohr’s Circles for the 3D stress state within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

at the point (10, 88.9).

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
mesh = geometry.create_mesh(mesh_sizes=[2.5])
section = Section(geometry, mesh)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_mohrs_circles(10, 88.9)
_images/mohrs_circles.png

Mohr’s Circles of the 3D stress state at (10, 88.9).

plot_stress_1(title='Stress Contour Plot - $\\sigma_{1}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the major principal stress \(\sigma_{1}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the major principal stress within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
mesh = geometry.create_mesh(mesh_sizes=[2.5])
section = CrossSection(geometry, mesh)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_stress_1()
_images/stress_1.png

Contour plot of the major principal stress.

plot_stress_3(title='Stress Contour Plot - $\\sigma_{3}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the Minor principal stress \(\sigma_{3}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the Minor principal stress within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
mesh = geometry.create_mesh(mesh_sizes=[2.5])
section = CrossSection(geometry, mesh)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_stress_3()
_images/stress_3.png

Contour plot of the minor principal stress.

plot_stress_contour(sigs, title, cmap, normalize, **kwargs)[source]

Plots filled stress contours over the finite element mesh.

Parameters
  • sigs (list[numpy.ndarray]) – List of nodal stress values for each material

  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axe object

Return type

matplotlib.axes

plot_stress_m11_zz(title='Stress Contour Plot - $\\sigma_{zz,M11}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,M11}\) resulting from the bending moment \(M_{11}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the 11-axis of 5 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(M11=5e6)

stress_post.plot_stress_m11_zz()
_images/stress_m11_zz.png

Contour plot of the bending stress.

plot_stress_m22_zz(title='Stress Contour Plot - $\\sigma_{zz,M22}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,M22}\) resulting from the bending moment \(M_{22}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the 22-axis of 2 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(M22=5e6)

stress_post.plot_stress_m22_zz()
_images/stress_m22_zz.png

Contour plot of the bending stress.

plot_stress_m_zz(title='Stress Contour Plot - $\\sigma_{zz,\\Sigma M}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,\Sigma M}\) resulting from all bending moments \(M_{xx} + M_{yy} + M_{11} + M_{22}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the x-axis of 5 kN.m, a bending moment about the y-axis of 2 kN.m and a bending moment of 3 kN.m about the 11-axis:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mxx=5e6, Myy=2e6, M11=3e6)

stress_post.plot_stress_m_zz()
_images/stress_m_zz.png

Contour plot of the bending stress.

plot_stress_mxx_zz(title='Stress Contour Plot - $\\sigma_{zz,Mxx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,Mxx}\) resulting from the bending moment \(M_{xx}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the x-axis of 5 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mxx=5e6)

stress_post.plot_stress_mxx_zz()
_images/stress_mxx_zz.png

Contour plot of the bending stress.

plot_stress_myy_zz(title='Stress Contour Plot - $\\sigma_{zz,Myy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,Myy}\) resulting from the bending moment \(M_{yy}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from a bending moment about the y-axis of 2 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Myy=2e6)

stress_post.plot_stress_myy_zz()
_images/stress_myy_zz.png

Contour plot of the bending stress.

plot_stress_mzz_zx(title='Stress Contour Plot - $\\sigma_{zx,Mzz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_stress_mzz_zx()
_images/stress_mzz_zx.png

Contour plot of the shear stress.

plot_stress_mzz_zxy(title='Stress Contour Plot - $\\sigma_{zxy,Mzz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_stress_mzz_zxy()
_images/stress_mzz_zxy.png

Contour plot of the shear stress.

plot_stress_mzz_zy(title='Stress Contour Plot - $\\sigma_{zy,Mzz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_stress_mzz_zy()
_images/stress_mzz_zy.png

Contour plot of the shear stress.

plot_stress_n_zz(title='Stress Contour Plot - $\\sigma_{zz,N}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the normal stress \(\sigma_{zz,N}\) resulting from the axial load \(N\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from an axial force of 10 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(N=10e3)

stress_post.plot_stress_n_zz()
_images/stress_n_zz.png

Contour plot of the axial stress.

plot_stress_v_zx(title='Stress Contour Plot - $\\sigma_{zx,\\Sigma V}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_stress_v_zx()
_images/stress_v_zx.png

Contour plot of the shear stress.

plot_stress_v_zxy(title='Stress Contour Plot - $\\sigma_{zxy,\\Sigma V}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_stress_v_zxy()
_images/stress_v_zxy.png

Contour plot of the shear stress.

plot_stress_v_zy(title='Stress Contour Plot - $\\sigma_{zy,\\Sigma V}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_stress_v_zy()
_images/stress_v_zy.png

Contour plot of the shear stress.

plot_stress_vector(sigxs, sigys, title, cmap, normalize, **kwargs)[source]

Plots stress vectors over the finite element mesh.

Parameters
  • sigxs (list[numpy.ndarray]) – List of x-components of the nodal stress values for each material

  • sigys (list[numpy.ndarray]) – List of y-components of the nodal stress values for each material

  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

plot_stress_vm(title='Stress Contour Plot - $\\sigma_{vM}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the von Mises stress \(\sigma_{vM}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the von Mises stress within a 150x90x12 UA section resulting from the following actions:

  • \(N = 50\) kN

  • \(M_{xx} = -5\) kN.m

  • \(M_{22} = 2.5\) kN.m

  • \(M_{zz} = 1.5\) kN.m

  • \(V_{x} = 10\) kN

  • \(V_{y} = 5\) kN

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(
    N=50e3, Mxx=-5e6, M22=2.5e6, Mzz=0.5e6, Vx=10e3, Vy=5e3
)

stress_post.plot_stress_vm()
_images/stress_vm.png

Contour plot of the von Mises stress.

plot_stress_vx_zx(title='Stress Contour Plot - $\\sigma_{zx,Vx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_stress_vx_zx()
_images/stress_vx_zx.png

Contour plot of the shear stress.

plot_stress_vx_zxy(title='Stress Contour Plot - $\\sigma_{zz,Myy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_stress_vx_zxy()
_images/stress_vx_zxy.png

Contour plot of the shear stress.

plot_stress_vx_zy(title='Stress Contour Plot - $\\sigma_{zy,Vx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_stress_vx_zy()
_images/stress_vx_zy.png

Contour plot of the shear stress.

plot_stress_vy_zx(title='Stress Contour Plot - $\\sigma_{zx,Vy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_stress_vy_zx()
_images/stress_vy_zx.png

Contour plot of the shear stress.

plot_stress_vy_zxy(title='Stress Contour Plot - $\\sigma_{zxy,Vy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_stress_vy_zxy()
_images/stress_vy_zxy.png

Contour plot of the shear stress.

plot_stress_vy_zy(title='Stress Contour Plot - $\\sigma_{zy,Vy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_stress_vy_zy()
_images/stress_vy_zy.png

Contour plot of the shear stress.

plot_stress_zx(title='Stress Contour Plot - $\\sigma_{zx}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the x-component of the shear stress \(\sigma_{zx}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the x-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_stress_zx()
_images/stress_zx.png

Contour plot of the shear stress.

plot_stress_zxy(title='Stress Contour Plot - $\\sigma_{zxy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the resultant shear stress \(\sigma_{zxy}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots a contour of the resultant shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_stress_zxy()
_images/stress_zxy.png

Contour plot of the shear stress.

plot_stress_zy(title='Stress Contour Plot - $\\sigma_{zy}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the y-component of the shear stress \(\sigma_{zy}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the y-component of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_stress_zy()
_images/stress_zy.png

Contour plot of the shear stress.

plot_stress_zz(title='Stress Contour Plot - $\\sigma_{zz}$', cmap='coolwarm', normalize=True, **kwargs)[source]

Produces a contour plot of the combined normal stress \(\sigma_{zz}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example plots the normal stress within a 150x90x12 UA section resulting from an axial force of 100 kN, a bending moment about the x-axis of 5 kN.m and a bending moment about the y-axis of 2 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(N=100e3, Mxx=5e6, Myy=2e6)

stress_post.plot_stress_zz()
_images/stress_zz.png

Contour plot of the normal stress.

plot_vector_mzz_zxy(title='Stress Vector Plot - $\\sigma_{zxy,Mzz}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Mzz}\) resulting from the torsion moment \(M_{zz}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6)

stress_post.plot_vector_mzz_zxy()
_images/vector_mzz_zxy.png

Vector plot of the shear stress.

plot_vector_v_zxy(title='Stress Vector Plot - $\\sigma_{zxy,\\Sigma V}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,\Sigma V}\) resulting from the sum of the applied shear forces \(V_{x} + V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a shear force of 15 kN in the x-direction and 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3, Vy=30e3)

stress_post.plot_vector_v_zxy()
_images/vector_v_zxy.png

Vector plot of the shear stress.

plot_vector_vx_zxy(title='Stress Vector Plot - $\\sigma_{zxy,Vx}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vx}\) resulting from the shear force \(V_{x}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a shear force in the x-direction of 15 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vx=15e3)

stress_post.plot_vector_vx_zxy()
_images/vector_vx_zxy.png

Vector plot of the shear stress.

plot_vector_vy_zxy(title='Stress Vector Plot - $\\sigma_{zxy,Vy}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy,Vy}\) resulting from the shear force \(V_{y}\).

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a shear force in the y-direction of 30 kN:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Vy=30e3)

stress_post.plot_vector_vy_zxy()
_images/vector_vy_zxy.png

Vector plot of the shear stress.

plot_vector_zxy(title='Stress Vector Plot - $\\sigma_{zxy}$', cmap='YlOrBr', normalize=False, **kwargs)[source]

Produces a vector plot of the resultant shear stress \(\sigma_{zxy}\) resulting from all actions.

Parameters
  • title (string) – Plot title

  • cmap (string) – Matplotlib color map.

  • normalize (bool) – If set to true, the CenteredNorm is used to scale the colormap. If set to false, the default linear scaling is used.

  • kwargs – Passed to plotting_context()

Returns

Matplotlib axes object

Return type

matplotlib.axes

The following example generates a vector plot of the shear stress within a 150x90x12 UA section resulting from a torsion moment of 1 kN.m and a shear force of 30 kN in the y-direction:

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

geometry = steel_sections.angle_section(d=150, b=90, t=12, r_r=10, r_t=5, n_r=8)
geometry.create_mesh(mesh_sizes=[20])
section = Section(geometry)

section.calculate_geometric_properties()
section.calculate_warping_properties()
stress_post = section.calculate_stress(Mzz=1e6, Vy=30e3)

stress_post.plot_vector_zxy()
_images/vector_zxy.png

Vector plot of the shear stress.

MaterialGroup Class
class sectionproperties.analysis.section.MaterialGroup(material, num_nodes)[source]

Bases: object

Class for storing elements of different materials.

A MaterialGroup object contains the finite element objects for a specified material. The stress_result variable provides storage for stresses related each material.

Parameters
  • material (Material) – Material object for the current MaterialGroup

  • num_nods (int) – Number of nodes for the entire cross-section

Variables
  • material (Material) – Material object for the current MaterialGroup

  • stress_result (StressResult) – A StressResult object for saving the stresses of the current material

  • elements (list[Tri6]) – A list of finite element objects that are of the current material type

  • el_ids (list[int]) – A list of the element IDs of the elements that are of the current material type

add_element(element)[source]

Adds an element and its element ID to the MaterialGroup.

Parameters

element (Tri6) – Element to add to the MaterialGroup

StressResult Class
class sectionproperties.analysis.section.StressResult(num_nodes)[source]

Bases: object

Class for storing a stress result.

Provides variables to store the results from a cross-section stress analysis. Also provides a method to calculate combined stresses.

Parameters

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

Variables
  • sig_zz_n (numpy.ndarray) – Normal stress (\(\sigma_{zz,N}\)) resulting from an axial force

  • sig_zz_mxx (numpy.ndarray) – Normal stress (\(\sigma_{zz,Mxx}\)) resulting from a bending moment about the xx-axis

  • sig_zz_myy (numpy.ndarray) – Normal stress (\(\sigma_{zz,Myy}\)) resulting from a bending moment about the yy-axis

  • sig_zz_m11 (numpy.ndarray) – Normal stress (\(\sigma_{zz,M11}\)) resulting from a bending moment about the 11-axis

  • sig_zz_m22 (numpy.ndarray) – Normal stress (\(\sigma_{zz,M22}\)) resulting from a bending moment about the 22-axis

  • sig_zx_mzz (numpy.ndarray) – Shear stress (\(\sigma_{zx,Mzz}\)) resulting from a torsion moment about the zz-axis

  • sig_zy_mzz (numpy.ndarray) – Shear stress (\(\sigma_{zy,Mzz}\)) resulting from a torsion moment about the zz-axis

  • sig_zx_vx (numpy.ndarray) – Shear stress (\(\sigma_{zx,Vx}\)) resulting from a shear force in the x-direction

  • sig_zy_vx (numpy.ndarray) – Shear stress (\(\sigma_{zy,Vx}\)) resulting from a shear force in the x-direction

  • sig_zx_vy (numpy.ndarray) – Shear stress (\(\sigma_{zx,Vy}\)) resulting from a shear force in the y-direction

  • sig_zy_vy (numpy.ndarray) – Shear stress (\(\sigma_{zy,Vy}\)) resulting from a shear force in the y-direction

  • sig_zz_m (numpy.ndarray) – Normal stress (\(\sigma_{zz,\Sigma M}\)) resulting from all bending moments

  • sig_zxy_mzz (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,Mzz}\)) resulting from a torsion moment in the zz-direction

  • sig_zxy_vx (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,Vx}\)) resulting from a a shear force in the x-direction

  • sig_zxy_vy (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,Vy}\)) resulting from a a shear force in the y-direction

  • sig_zx_v (numpy.ndarray) – Shear stress (\(\sigma_{zx,\Sigma V}\)) resulting from all shear forces

  • sig_zy_v (numpy.ndarray) – Shear stress (\(\sigma_{zy,\Sigma V}\)) resulting from all shear forces

  • sig_zxy_v (numpy.ndarray) – Resultant shear stress (\(\sigma_{zxy,\Sigma V}\)) resulting from all shear forces

  • sig_zz (numpy.ndarray) – Combined normal force (\(\sigma_{zz}\)) resulting from all actions

  • sig_zx (numpy.ndarray) – Combined shear stress (\(\sigma_{zx}\)) resulting from all actions

  • sig_zy (numpy.ndarray) – Combined shear stress (\(\sigma_{zy}\)) resulting from all actions

  • sig_zxy (numpy.ndarray) – Combined resultant shear stress (\(\sigma_{zxy}\)) resulting from all actions

  • sig_1 (numpy.ndarray) – Major principal stress (\(\sigma_{1}\)) resulting from all actions

  • sig_3 (numpy.ndarray) – Minor principal stress (\(\sigma_{3}\)) resulting from all actions

  • sig_vm (numpy.ndarray) – von Mises stress (\(\sigma_{VM}\)) resulting from all actions

calculate_combined_stresses()[source]

Calculates the combined cross-section stresses.

SectionProperties Class
class sectionproperties.analysis.section.SectionProperties(area: Optional[float] = None, perimeter: Optional[float] = None, mass: Optional[float] = None, ea: Optional[float] = None, ga: Optional[float] = None, nu_eff: Optional[float] = None, e_eff: Optional[float] = None, g_eff: Optional[float] = None, qx: Optional[float] = None, qy: Optional[float] = None, ixx_g: Optional[float] = None, iyy_g: Optional[float] = None, ixy_g: Optional[float] = None, cx: Optional[float] = None, cy: Optional[float] = None, ixx_c: Optional[float] = None, iyy_c: Optional[float] = None, ixy_c: Optional[float] = None, zxx_plus: Optional[float] = None, zxx_minus: Optional[float] = None, zyy_plus: Optional[float] = None, zyy_minus: Optional[float] = None, rx_c: Optional[float] = None, ry_c: Optional[float] = None, i11_c: Optional[float] = None, i22_c: Optional[float] = None, phi: Optional[float] = None, z11_plus: Optional[float] = None, z11_minus: Optional[float] = None, z22_plus: Optional[float] = None, z22_minus: Optional[float] = None, r11_c: Optional[float] = None, r22_c: Optional[float] = None, j: Optional[float] = None, omega: Optional[ndarray] = None, psi_shear: Optional[ndarray] = None, phi_shear: Optional[ndarray] = None, Delta_s: Optional[float] = None, x_se: Optional[float] = None, y_se: Optional[float] = None, x11_se: Optional[float] = None, y22_se: Optional[float] = None, x_st: Optional[float] = None, y_st: Optional[float] = None, gamma: Optional[float] = None, A_sx: Optional[float] = None, A_sy: Optional[float] = None, A_sxy: Optional[float] = None, A_s11: Optional[float] = None, A_s22: Optional[float] = None, beta_x_plus: Optional[float] = None, beta_x_minus: Optional[float] = None, beta_y_plus: Optional[float] = None, beta_y_minus: Optional[float] = None, beta_11_plus: Optional[float] = None, beta_11_minus: Optional[float] = None, beta_22_plus: Optional[float] = None, beta_22_minus: Optional[float] = None, x_pc: Optional[float] = None, y_pc: Optional[float] = None, x11_pc: Optional[float] = None, y22_pc: Optional[float] = None, sxx: Optional[float] = None, syy: Optional[float] = None, sf_xx_plus: Optional[float] = None, sf_xx_minus: Optional[float] = None, sf_yy_plus: Optional[float] = None, sf_yy_minus: Optional[float] = None, s11: Optional[float] = None, s22: Optional[float] = None, sf_11_plus: Optional[float] = None, sf_11_minus: Optional[float] = None, sf_22_plus: Optional[float] = None, sf_22_minus: Optional[float] = None)[source]

Bases: object

Class for storing section properties.

Stores calculated section properties. Also provides methods to calculate section properties entirely derived from other section properties.

Variables
  • area (float) – Cross-sectional area

  • perimeter (float) – Cross-sectional perimeter

  • mass (float) – Cross-sectional mass

  • ea (float) – Modulus weighted area (axial rigidity)

  • ga (float) – Modulus weighted product of shear modulus and area

  • nu_eff (float) – Effective Poisson’s ratio

  • e_eff (float) – Effective elastic modulus

  • g_eff (float) – Effective shear modulus

  • qx (float) – First moment of area about the x-axis

  • qy (float) – First moment of area about the y-axis

  • ixx_g (float) – Second moment of area about the global x-axis

  • iyy_g (float) – Second moment of area about the global y-axis

  • ixy_g (float) – Second moment of area about the global xy-axis

  • cx (float) – X coordinate of the elastic centroid

  • cy (float) – Y coordinate of the elastic centroid

  • ixx_c (float) – Second moment of area about the centroidal x-axis

  • iyy_c (float) – Second moment of area about the centroidal y-axis

  • ixy_c (float) – Second moment of area about the centroidal xy-axis

  • zxx_plus (float) – Section modulus about the centroidal x-axis for stresses at the positive extreme value of y

  • zxx_minus (float) – Section modulus about the centroidal x-axis for stresses at the negative extreme value of y

  • zyy_plus (float) – Section modulus about the centroidal y-axis for stresses at the positive extreme value of x

  • zyy_minus (float) – Section modulus about the centroidal y-axis for stresses at the negative extreme value of x

  • rx_c (float) – Radius of gyration about the centroidal x-axis.

  • ry_c (float) – Radius of gyration about the centroidal y-axis.

  • i11_c (float) – Second moment of area about the centroidal 11-axis

  • i22_c (float) – Second moment of area about the centroidal 22-axis

  • phi (float) – Principal axis angle

  • z11_plus (float) – Section modulus about the principal 11-axis for stresses at the positive extreme value of the 22-axis

  • z11_minus (float) – Section modulus about the principal 11-axis for stresses at the negative extreme value of the 22-axis

  • z22_plus (float) – Section modulus about the principal 22-axis for stresses at the positive extreme value of the 11-axis

  • z22_minus (float) – Section modulus about the principal 22-axis for stresses at the negative extreme value of the 11-axis

  • r11_c (float) – Radius of gyration about the principal 11-axis.

  • r22_c (float) – Radius of gyration about the principal 22-axis.

  • j (float) – Torsion constant

  • omega (numpy.ndarray) – Warping function

  • psi_shear (numpy.ndarray) – Psi shear function

  • phi_shear (numpy.ndarray) – Phi shear function

  • Delta_s (float) – Shear factor

  • x_se (float) – X coordinate of the shear centre (elasticity approach)

  • y_se (float) – Y coordinate of the shear centre (elasticity approach)

  • x11_se (float) – 11 coordinate of the shear centre (elasticity approach)

  • y22_se (float) – 22 coordinate of the shear centre (elasticity approach)

  • x_st (float) – X coordinate of the shear centre (Trefftz’s approach)

  • y_st (float) – Y coordinate of the shear centre (Trefftz’s approach)

  • gamma (float) – Warping constant

  • A_sx (float) – Shear area about the x-axis

  • A_sy (float) – Shear area about the y-axis

  • A_sxy (float) – Shear area about the xy-axis

  • A_s11 (float) – Shear area about the 11 bending axis

  • A_s22 (float) – Shear area about the 22 bending axis

  • beta_x_plus (float) – Monosymmetry constant for bending about the x-axis with the top flange in compression

  • beta_x_minus (float) – Monosymmetry constant for bending about the x-axis with the bottom flange in compression

  • beta_y_plus (float) – Monosymmetry constant for bending about the y-axis with the top flange in compression

  • beta_y_minus (float) – Monosymmetry constant for bending about the y-axis with the bottom flange in compression

  • beta_11_plus (float) – Monosymmetry constant for bending about the 11-axis with the top flange in compression

  • beta_11_minus (float) – Monosymmetry constant for bending about the 11-axis with the bottom flange in compression

  • beta_22_plus (float) – Monosymmetry constant for bending about the 22-axis with the top flange in compression

  • beta_22_minus (float) – Monosymmetry constant for bending about the 22-axis with the bottom flange in compression

  • x_pc (float) – X coordinate of the global plastic centroid

  • y_pc (float) – Y coordinate of the global plastic centroid

  • x11_pc (float) – 11 coordinate of the principal plastic centroid

  • y22_pc (float) – 22 coordinate of the principal plastic centroid

  • sxx (float) – Plastic section modulus about the centroidal x-axis

  • syy (float) – Plastic section modulus about the centroidal y-axis

  • sf_xx_plus (float) – Shape factor for bending about the x-axis with respect to the top fibre

  • sf_xx_minus (float) – Shape factor for bending about the x-axis with respect to the bottom fibre

  • sf_yy_plus (float) – Shape factor for bending about the y-axis with respect to the top fibre

  • sf_yy_minus (float) – Shape factor for bending about the y-axis with respect to the bottom fibre

  • s11 (float) – Plastic section modulus about the 11-axis

  • s22 (float) – Plastic section modulus about the 22-axis

  • sf_11_plus (float) – Shape factor for bending about the 11-axis with respect to the top fibre

  • sf_11_minus (float) – Shape factor for bending about the 11-axis with respect to the bottom fibre

  • sf_22_plus (float) – Shape factor for bending about the 22-axis with respect to the top fibre

  • sf_22_minus (float) – Shape factor for bending about the 22-axis with respect to the bottom fibre

asdict()[source]

Returns the SectionProperties dataclass object as a dictionary.

calculate_centroidal_properties(mesh)[source]

Calculates the geometric section properties about the centroidal and principal axes based on the results about the global axis.

calculate_elastic_centroid()[source]

Calculates the elastic centroid based on the cross-section area and first moments of area.

fea Module

Tri6 Class
class sectionproperties.analysis.fea.Tri6(el_id: int, coords: ndarray, node_ids: List[int], material: Material)[source]

Bases: object

Class for a six noded quadratic triangular element.

Provides methods for the calculation of section properties based on the finite element method.

Parameters
  • el_id (int) – Unique element id

  • coords (numpy.ndarray) – A 2 x 6 array of the coordinates of the tri-6 nodes. The first three columns relate to the vertices of the triangle and the last three columns correspond to the mid-nodes.

  • node_ids (list[int]) – A list of the global node ids for the current element

  • material (Material) – Material object for the current finite element.

Variables
  • el_id (int) – Unique element id

  • coords (numpy.ndarray) – A 2 x 6 array of the coordinates of the tri-6 nodes. The first three columns relate to the vertices of the triangle and the last three columns correspond to the mid-nodes.

  • node_ids (list[int]) – A list of the global node ids for the current element

  • material (Material) – Material of the current finite element.

element_stress(N, Mxx, Myy, M11, M22, Mzz, Vx, Vy, ea, cx, cy, ixx, iyy, ixy, i11, i22, phi, j, nu, omega, psi_shear, phi_shear, Delta_s)[source]

Calculates the stress within an element resulting from a specified loading. Also returns the shape function weights.

Parameters
  • N (float) – Axial force

  • 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

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

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

  • ea (float) – Modulus weighted area

  • cx (float) – x position of the elastic centroid

  • cy (float) – y position of the elastic centroid

  • ixx (float) – Second moment of area about the centroidal x-axis

  • iyy (float) – Second moment of area about the centroidal y-axis

  • ixy (float) – Second moment of area about the centroidal xy-axis

  • i11 (float) – Second moment of area about the principal 11-axis

  • i22 (float) – Second moment of area about the principal 22-axis

  • phi (float) – Principal bending axis angle

  • j (float) – St. Venant torsion constant

  • nu (float) – Effective Poisson’s ratio for the cross-section

  • omega (numpy.ndarray) – Values of the warping function at the element nodes

  • psi_shear (numpy.ndarray) – Values of the psi shear function at the element nodes

  • phi_shear (numpy.ndarray) – Values of the phi shear function at the element nodes

  • Delta_s (float) – Cross-section shear factor

Returns

Tuple containing element stresses and integration weights (\(\sigma_{zz,n}\), \(\sigma_{zz,mxx}\), \(\sigma_{zz,myy}\), \(\sigma_{zz,m11}\), \(\sigma_{zz,m22}\), \(\sigma_{zx,mzz}\), \(\sigma_{zy,mzz}\), \(\sigma_{zx,vx}\), \(\sigma_{zy,vx}\), \(\sigma_{zx,vy}\), \(\sigma_{zy,vy}\), \(w_i\))

Return type

tuple(numpy.ndarray, numpy.ndarray, …)

geometric_properties()[source]

Calculates the geometric properties for the current finite element.

Returns

Tuple containing the geometric properties and the elastic and shear moduli of the element: (area, qx, qy, ixx, iyy, ixy, e, g, rho)

Return type

tuple(float)

local_coord(p)[source]

Map a point p = (x, y) in the global coordinate system onto a point (eta, xi, zeta) in the local coordinate system.

Parameters

p (numpy.ndarray) – Global coordinate (x,y)

Returns

Point in local coordinate (eta, xi, zeta)

Return type

numpy.ndarray

local_element_stress(p, N, Mxx, Myy, M11, M22, Mzz, Vx, Vy, ea, cx, cy, ixx, iyy, ixy, i11, i22, phi, j, nu, omega, psi_shear, phi_shear, Delta_s)[source]

Calculates the stress at a point p within the element resulting from a specified loading.

Parameters
  • p (numpy.ndarray) – Point (x,y) in the global coordinate system that is within the element.

  • N (float) – Axial force

  • 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

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

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

  • ea (float) – Modulus weighted area

  • cx (float) – x position of the elastic centroid

  • cy (float) – y position of the elastic centroid

  • ixx (float) – Second moment of area about the centroidal x-axis

  • iyy (float) – Second moment of area about the centroidal y-axis

  • ixy (float) – Second moment of area about the centroidal xy-axis

  • i11 (float) – Second moment of area about the principal 11-axis

  • i22 (float) – Second moment of area about the principal 22-axis

  • phi (float) – Principal bending axis angle

  • j (float) – St. Venant torsion constant

  • nu (float) – Effective Poisson’s ratio for the cross-section

  • omega (numpy.ndarray) – Values of the warping function at the element nodes

  • psi_shear (numpy.ndarray) – Values of the psi shear function at the element nodes

  • phi_shear (numpy.ndarray) – Values of the phi shear function at the element nodes

  • Delta_s (float) – Cross-section shear factor

Returns

Tuple containing stress values at point p (\(\sigma_{zz,n}\), \(\sigma_{zz,mxx}\), \(\sigma_{zz,myy}\), \(\sigma_{zz,m11}\), \(\sigma_{zz,m22}\), \(\sigma_{zx,mzz}\), \(\sigma_{zy,mzz}\), \(\sigma_{zx,vx}\), \(\sigma_{zy,vx}\), \(\sigma_{zx,vy}\), \(\sigma_{zy,vy}\))

Return type

tuple(float, float, …)

monosymmetry_integrals(phi)[source]

Calculates the integrals used to evaluate the monosymmetry constant about both global axes and both principal axes.

Parameters

phi (float) – Principal bending axis angle

Returns

Integrals used to evaluate the monosymmetry constants (int_x, int_y, int_11, int_22)

Return type

tuple(float, float, float, float)

point_within_element(pt)[source]

Determines whether a point lies within the current element.

Parameters

pt (list[float, float]) – Point to check (x, y)

Returns

Whether the point lies within an element

Return type

bool

shear_coefficients(ixx, iyy, ixy, psi_shear, phi_shear, nu)[source]

Calculates the variables used to determine the shear deformation coefficients.

Parameters
  • ixx (float) – Second moment of area about the centroidal x-axis

  • iyy (float) – Second moment of area about the centroidal y-axis

  • ixy (float) – Second moment of area about the centroidal xy-axis

  • psi_shear (numpy.ndarray) – Values of the psi shear function at the element nodes

  • phi_shear (numpy.ndarray) – Values of the phi shear function at the element nodes

  • nu (float) – Effective Poisson’s ratio for the cross-section

Returns

Shear deformation variables (kappa_x, kappa_y, kappa_xy)

Return type

tuple(float, float, float)

shear_load_vectors(ixx, iyy, ixy, nu)[source]

Calculates the element shear load vectors used to evaluate the shear functions.

Parameters
  • ixx (float) – Second moment of area about the centroidal x-axis

  • iyy (float) – Second moment of area about the centroidal y-axis

  • ixy (float) – Second moment of area about the centroidal xy-axis

  • nu (float) – Effective Poisson’s ratio for the cross-section

Returns

Element shear load vector psi (f_psi) and phi (f_phi)

Return type

tuple(numpy.ndarray, numpy.ndarray)

shear_warping_integrals(ixx, iyy, ixy, omega)[source]

Calculates the element shear centre and warping integrals required for shear analysis of the cross-section.

Parameters
  • ixx (float) – Second moment of area about the centroidal x-axis

  • iyy (float) – Second moment of area about the centroidal y-axis

  • ixy (float) – Second moment of area about the centroidal xy-axis

  • omega (numpy.ndarray) – Values of the warping function at the element nodes

Returns

Shear centre integrals about the x and y-axes (sc_xint, sc_yint), warping integrals (q_omega, i_omega, i_xomega, i_yomega)

Return type

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

torsion_properties()[source]

Calculates the element stiffness matrix used for warping analysis and the torsion load vector.

Returns

Element stiffness matrix (k_el) and element torsion load vector (f_el)

Return type

tuple(numpy.ndarray, numpy.ndarray)

gauss_points
sectionproperties.analysis.fea.gauss_points(n)[source]

Returns the Gaussian weights and locations for n point Gaussian integration of a quadratic triangular element.

Parameters

n (int) – Number of Gauss points (1, 3 or 6)

Returns

An n x 4 matrix consisting of the integration weight and the eta, xi and zeta locations for n Gauss points

Return type

numpy.ndarray

shape_function
sectionproperties.analysis.fea.shape_function(coords, gauss_point)[source]

Computes shape functions, shape function derivatives and the determinant of the Jacobian matrix for a tri 6 element at a given Gauss point.

Parameters
  • coords (numpy.ndarray) – Global coordinates of the quadratic triangle vertices [2 x 6]

  • gauss_point (numpy.ndarray) – Gaussian weight and isoparametric location of the Gauss point

Returns

The value of the shape functions N(i) at the given Gauss point [1 x 6], the derivative of the shape functions in the j-th global direction B(i,j) [2 x 6] and the determinant of the Jacobian matrix j

Return type

tuple(numpy.ndarray, numpy.ndarray, float)

extrapolate_to_nodes
sectionproperties.analysis.fea.extrapolate_to_nodes(w)[source]

Extrapolates results at six Gauss points to the six nodes of a quadratic triangular element.

Parameters

w (numpy.ndarray) – Result at the six Gauss points [1 x 6]

Returns

Extrapolated nodal values at the six nodes [1 x 6]

Return type

numpy.ndarray

principal_coordinate
sectionproperties.analysis.fea.principal_coordinate(phi, x, y)[source]

Determines the coordinates of the cartesian point (x, y) in the principal axis system given an axis rotation angle phi.

Parameters
  • phi (float) – Principal bending axis angle (degrees)

  • x (float) – x coordinate in the global axis

  • y (float) – y coordinate in the global axis

Returns

Principal axis coordinates (x1, y2)

Return type

tuple(float, float)

global_coordinate
sectionproperties.analysis.fea.global_coordinate(phi, x11, y22)[source]

Determines the global coordinates of the principal axis point (x1, y2) given principal axis rotation angle phi.

Parameters
  • phi (float) – Principal bending axis angle (degrees)

  • x11 (float) – 11 coordinate in the principal axis

  • y22 (float) – 22 coordinate in the principal axis

Returns

Global axis coordinates (x, y)

Return type

tuple(float, float)

point_above_line
sectionproperties.analysis.fea.point_above_line(u, px, py, x, y)[source]

Determines whether a point (x, y) is a above or below the line defined by the parallel unit vector u and the point (px, py).

Parameters
  • u (numpy.ndarray) – Unit vector parallel to the line [1 x 2]

  • px (float) – x coordinate of a point on the line

  • py (float) – y coordinate of a point on the line

  • x (float) – x coordinate of the point to be tested

  • y (float) – y coordinate of the point to be tested

Returns

This method returns True if the point is above the line or False if the point is below the line

Return type

bool

solver Module

solve_cgs
sectionproperties.analysis.solver.solve_cgs(k, f, m=None, tol=1e-05)[source]

Solves a linear system of equations (Ku = f) using the CGS iterative method.

Parameters
  • k (scipy.sparse.csc_matrix) – N x N matrix of the linear system

  • f (numpy.ndarray) – N x 1 right hand side of the linear system

  • tol (float) – Tolerance for the solver to achieve. The algorithm terminates when either the relative or the absolute residual is below tol.

  • m (scipy.linalg.LinearOperator) – Preconditioner for the linear matrix approximating the inverse of k

Returns

The solution vector to the linear system of equations

Return type

numpy.ndarray

Raises

RuntimeError – If the CGS iterative method does not converge

solve_cgs_lagrange
sectionproperties.analysis.solver.solve_cgs_lagrange(k_lg, f, tol=1e-05, m=None)[source]

Solves a linear system of equations (Ku = f) using the CGS iterative method and the Lagrangian multiplier method.

Parameters
  • k (scipy.sparse.csc_matrix) – (N+1) x (N+1) Lagrangian multiplier matrix of the linear system

  • f (numpy.ndarray) – N x 1 right hand side of the linear system

  • tol (float) – Tolerance for the solver to achieve. The algorithm terminates when either the relative or the absolute residual is below tol.

  • m (scipy.linalg.LinearOperator) – Preconditioner for the linear matrix approximating the inverse of k

Returns

The solution vector to the linear system of equations

Return type

numpy.ndarray

Raises

RuntimeError – If the CGS iterative method does not converge or the error from the Lagrangian multiplier method exceeds the tolerance

solve_direct
sectionproperties.analysis.solver.solve_direct(k, f)[source]

Solves a linear system of equations (Ku = f) using the direct solver method.

Parameters
  • k (scipy.sparse.csc_matrix) – N x N matrix of the linear system

  • f (numpy.ndarray) – N x 1 right hand side of the linear system

Returns

The solution vector to the linear system of equations

Return type

numpy.ndarray

solve_direct_lagrange
sectionproperties.analysis.solver.solve_direct_lagrange(k_lg, f)[source]

Solves a linear system of equations (Ku = f) using the direct solver method and the Lagrangian multiplier method.

Parameters
  • k (scipy.sparse.csc_matrix) – (N+1) x (N+1) Lagrangian multiplier matrix of the linear system

  • f (numpy.ndarray) – N x 1 right hand side of the linear system

Returns

The solution vector to the linear system of equations

Return type

numpy.ndarray

Raises

RuntimeError – If the Lagrangian multiplier method exceeds a tolerance of 1e-5

Post-Processor Package

post Module

plotting_context
sectionproperties.post.post.plotting_context(ax=None, pause=True, title='', filename='', render=True, axis_index=None, **kwargs)[source]

Executes code required to set up a matplotlib figure.

Parameters
  • ax (matplotlib.axes.Axes) – Axes object on which to plot

  • pause (bool) – If set to true, the figure pauses the script until the window is closed. If set to false, the script continues immediately after the window is rendered.

  • title (string) – Plot title

  • filename (string) – Pass a non-empty string or path to save the image as. If this option is used, the figure is closed after the file is saved.

  • render (bool) – If set to False, the image is not displayed. This may be useful if the figure or axes will be embedded or further edited before being displayed.

  • axis_index (Union[None, int, Tuple(int)]) – If more than 1 axes is created by subplot, then this is the axis to plot on. This may be a tuple if a 2D array of plots is returned. The default value of None will select the top left plot.

  • kwargs – Passed to matplotlib.pyplot.subplots()

draw_principal_axis
sectionproperties.post.post.draw_principal_axis(ax, phi, cx, cy)[source]

Draws the principal axis on a plot.

Parameters
  • ax (matplotlib.axes.Axes) – Axes object on which to plot

  • phi (float) – Principal axis angle in radians

  • cx (float) – x-location of the centroid

  • cy (float) – y-location of the centroid

Theoretical Background

Introduction

The analysis of homogenous cross-sections is particularly relevant in structural design, in particular for the design of steel structures, where complex built-up sections are often utilised. Accurate warping independent properties, such as the second moment of area and section moduli, are crucial input for structural analysis and stress verification. Warping dependent properties, such as the Saint-Venant torsion constant and warping constant are essential in the verification of slender steel structures when lateral-torsional buckling is critical.

Warping independent properties for basic cross-sections are relatively simple to calculate by hand. However accurate warping independent properties, even for the most basic cross-section, require solving several boundary value partial differential equations. This necessitates numerical methods in the calculation of these properties, which can be extended to arbitrary complex sections.

This section of the documentation describes the theory and application of the finite element method to cross-sectional analysis used by sectionproperties. The goal of sectionproperties is to perform cross-sectional and stress analysis on arbitrary cross-sections, see below figure. In its simplest form, an arbitrary cross-section can be defined by a series of points, segments and holes.

Arbitrary cross-section

Arbitrary cross-section with adopted axis convention.

Mesh Generation

The cross-section is meshed using quadratic superparametric triangular elements (Tri6) using the triangle library for Python. Superparametric quadratic elements are defined as having straight edges and mid-nodes located at the mid-point between adjacent corner nodes. triangle implements Triangle, which is a two dimensional quality mesh generator and Delaunay triangulator written by Jonathan Shewchuk in C.

For the calculation of warping independent properties (i.e. area properties), the mesh quality is not important as superparametric elements have a constant Jacobian and will result in an exact solution independent of mesh quality. However, this is not the case for the calculation of warping dependent properties. As a result, mesh quality and refinement is critical and thus the user is encouraged to ensure an adequate mesh is generated.

Finite Element Preliminaries

Element Type

Quadratic six noded triangular elements were implemented in sectionproperties in order to utilise the finite element formulations for calculating section properties. The figure below shows a generic six noded triangular element. As previously mentioned, sectionproperties implements superparametric elements, therefore the edges in the below image will always be straight and not curved.

Six noded triangular element

Six noded triangular element [1].

The quadratic triangular element was used due to the ease of mesh generation and convergence advantages over the linear triangular element.

Isoparametric Representation

An isoparametric coordinate system has been used to evaluate the shape functions of the parent element and map them to a generalised triangular element within the mesh. Three independent isoparametric coordinates (\(\eta\), \(\xi\), \(\zeta\)) are used to map the six noded triangular element as shown in the figure below.

Isoparametric coordinates for the two dimensional triangular element.

Isoparametric coordinates for the two dimensional triangular element.

Shape Functions

The shape functions for the six noded triangular element in terms of the isoparametric coordinates are as follows:

\[\begin{split}N_1 &= \eta (2 \eta - 1) \\ N_2 &= \xi (2 \xi - 1) \\ N_3 &= \zeta (2 \zeta - 1) \\ N_4 &= 4 \eta \xi \\ N_5 &= 4 \xi \zeta \\ N_6 &= 4 \eta \zeta\end{split}\]

The above shape functions can be combined into the shape function row vector:

\[\textbf{N} = [ N_1 \, N_2 \, N_3 \, N_4 \, N_5 \, N_6 ]\]
Cartesian Partial Derivatives

The partial derivatives of the shape functions with respect to the cartesian coordinates, denoted as the \(\textbf{B}\) matrix, are required in the finite element formulations of various section properties. Felippa [1] describes the multiplication of the Jacobian matrix (\(\textbf{J}\)) and the partial derivative matrix (\(\textbf{P}\)):

\[\begin{split}\textbf{J P} = \begin{bmatrix} 1 & 1 & 1 \\ \sum x_i \frac{\partial N_i}{\partial \eta} & \sum x_i \frac{\partial N_i}{\partial \xi} & \sum x_i \frac{\partial N_i}{\partial \zeta} \\ \sum y_i \frac{\partial N_i}{\partial \eta} & \sum y_i \frac{\partial N_i}{\partial \xi} & \sum y_i \frac{\partial N_i}{\partial \zeta} \\ \end{bmatrix} \begin{bmatrix} \frac{\partial \eta}{\partial x} & \frac{\partial \eta}{\partial y} \\ \frac{\partial \xi}{\partial x} & \frac{\partial \xi}{\partial y} \\ \frac{\partial \zeta}{\partial x} & \frac{\partial \zeta}{\partial y} \\ \end{bmatrix} = \begin{bmatrix} 0 & 0 \\ 1 & 0 \\ 0 & 1 \\ \end{bmatrix}\end{split}\]

The determinant of the Jacobian matrix scaled by one half is equal to the Jacobian:

\[J = \frac{1}{2} \textrm{det} \, \textbf{J}\]

The equation for textbf{J P} can be re-arranged to evaluate the partial derivate matrix (\(\textbf{P}\)):

\[\begin{split}\textbf{P} = \textbf{J}^{-1} \begin{bmatrix} 0 & 0 \\ 1 & 0 \\ 0 & 1 \\ \end{bmatrix}\end{split}\]

As described in [1], the derivates of the shape functions can be evaluated using the below expressions:

\[\begin{split}\textbf{B}^{\rm T} = \begin{bmatrix} \frac{\partial N_i}{\partial x} & \frac{\partial N_i}{\partial y} \end{bmatrix} = \begin{bmatrix} \frac{\partial N_i}{\partial \eta} & \frac{\partial N_i}{\partial \xi} & \frac{\partial N_i}{\partial \zeta} \\ \end{bmatrix} \begin{bmatrix} \textbf{P} \end{bmatrix}\end{split}\]

where the derivatives of the shape functions with respect to the isoparametric parameters can easily be evaluated from the equation for the shape functions, resulting in the following expression for the \(\textbf{B}\) matrix:

\[\begin{split}\textbf{B}^{\rm T} = \begin{bmatrix} 4 \eta - 1 & 0 & 0 \\ 0 & 4 \xi - 1 & 0 \\ 0 & 0 & 4 \zeta - 1 \\ 4 \xi & 4 \eta & 0 \\ 0 & 4 \zeta & 4 \xi \\ 4 \zeta & 0 & 4 \eta \\ \end{bmatrix} \textbf{J}^{-1} \begin{bmatrix} 0 & 0 \\ 1 & 0 \\ 0 & 1 \\ \end{bmatrix}\end{split}\]

Numerical Integration

Three different integration schemes are utilised in the cross-section analysis in order to evaluate the integrals of varying order polynomials. The one point, three point and six point integration schemes are summarised in the figure below:

Six noded triangle integration schemes with maximum degree of polynomial that is evaluated exactly [1].
1 pt. integration; p-degree = 1.

1 pt. integration; p-degree = 1.

3 pt. integration; p-degree = 2.

3 pt. integration; p-degree = 2.

6 pt. integration; p-degree = 4.

6 pt. integration; p-degree = 4.

The locations and weights of the Gauss points are summarised in the table below [1]:

Scheme

\(\eta\)-location

\(\xi\)-location

\(\zeta\)-location

weight

1 pt.

\(\frac{1}{3}\)

\(\frac{1}{3}\)

\(\frac{1}{3}\)

1

3 pt.

\(\frac{2}{3}\)

\(\frac{1}{6}\)

\(\frac{1}{6}\)

\(\frac{1}{3}\)

\(\frac{1}{6}\)

\(\frac{2}{3}\)

\(\frac{1}{6}\)

\(\frac{1}{3}\)

\(\frac{1}{6}\)

\(\frac{1}{6}\)

\(\frac{2}{3}\)

\(\frac{1}{3}\)

6 pt.

\(1 - 2 g_2\)

\(g_2\)

\(g_2\)

\(w_2\)

\(g_2\)

\(1 - 2 g_2\)

\(g_2\)

\(w_2\)

\(g_2\)

\(g_2\)

\(1 - 2 g_2\)

\(w_2\)

\(g_1\)

\(g_1\)

\(1 - 2 g_1\)

\(w_1\)

\(1 - 2 g_1\)

\(g_1\)

\(g_1\)

\(w_1\)

\(g_1\)

\(1 - 2 g_1\)

\(g_1\)

\(w_1\)

The parameters for the six point numerical integration are shown below:

\[\begin{split}g_{1,2} &= \frac{1}{18} \left(8 - \sqrt{10} \pm \sqrt{38 - 44\sqrt{\frac{2}{5}}}\right) \\ w_{1,2} &= \frac{620 \pm \sqrt{213125-53320 \sqrt{10}}}{3720}\end{split}\]

Bringing together the isoparametric representation of the six noded triangular element and numerical integration, the integration of a function \(f(\eta, \xi, \zeta)\) proves to be simpler than integrating the corresponding function \(f(x,y)\) over the cartesian element [2]. The transformation formula for integrals is:

\[\begin{split}\int_{\Omega} f(x,y) \, dx \, dy &= \int_{\Omega_r} f(\eta, \xi, \zeta) \, J \, d\eta \, d\xi \, d\zeta \\ &= \sum_i^n w_i f(\eta_i, \xi_i, \zeta_i) \, J_i\end{split}\]

where the sum is taken over the integration points, \(w_i\) is the weight of the current integration point and \(J_i\) is the Jacobian at the current integration point (recall that the Jacobian is constant for the superparametric six noded triangular element).

Extrapolation to Nodes

The most optimal location to sample stresses are at the integration points, however the results are generally plotted using nodal values. As a result, the stresses at the integration points need to be extrapolated to the nodes of the element. The extrapolated stresses at the nodes (\(\tilde{\boldsymbol{\sigma}}_g\)) can be calculated through the multiplication of a smoothing matrix (\(\textbf{H}\)) and the stresses at the integration points (\(\boldsymbol{\sigma}_g\)) [2]:

\[\tilde{\boldsymbol{\sigma}}_g = \textbf{H}^{-1} \, \boldsymbol{\sigma}_g\]

where the \(\textbf{H}\) matrix contains the row vectors of the shape functions at each integration point:

\[\begin{split}\textbf{H} = \begin{bmatrix} \textbf{N}(\eta_1, \xi_1, \zeta_1) \\ \textbf{N}(\eta_2, \xi_2, \zeta_2) \\ \textbf{N}(\eta_3, \xi_3, \zeta_3) \\ \textbf{N}(\eta_4, \xi_4, \zeta_4) \\ \textbf{N}(\eta_5, \xi_5, \zeta_5) \\ \textbf{N}(\eta_6, \xi_6, \zeta_6) \\ \end{bmatrix}\end{split}\]

Where two or more elements share the same node, nodal averaging is used to evaluate the nodal stress.

Lagrangian Multiplier

As described in the calculation of the Torsion Constant and Shear Properties, partial differential equations are to be solved with purely Neumann boundary conditions. In the context of the torsion and shear problem, this involves the inversion of a nearly singular global stiffness matrix. After shifting the domain such that the centroid coincides with the global origin, the Lagrangian multiplier method is used to solve the set of linear equations of the form \(\textbf{K} \textbf{u} = \textbf{F}\) by introducing an extra constraint on the solution vector whereby the mean value is equal to zero. Larson et. al [3] describe the resulting modified stiffness matrix, and solution and load vector:

\[\begin{split}\begin{bmatrix} \textbf{K} & \textbf{C}^{\rm{T}} \\ \textbf{C} & 0 \\ \end{bmatrix} \begin{bmatrix} \textbf{u} \\ \lambda \\ \end{bmatrix} = \begin{bmatrix} \textbf{F} \\ 0 \\ \end{bmatrix}\end{split}\]

where \(\textbf{C}\) is a row vector of ones and \(\lambda\) may be though of as a force acting to enforce the constraints, which should be relatively small when compared to the values in the force vector and can be omitted from the solution vector.

Calculation of Cross-Section Properties

Cross-Sectional Area

The area A of the cross-section is given by [2]:

\[A = \int_A dx \, dy = \sum_e A_e = \sum_e \int_{\Omega} J_e \, d\eta \, d\xi \, d\zeta\]

As the Jacobian is constant over the element, the integration over the element domain in the above equation can be performed using one point integration:

\[A = \sum_e \sum_{i=1}^1 w_i J_i\]

First Moments of Area

The first moments of area are defined by [2]:

\[\begin{split}Q_x &= \int_A y \, dA = \sum_e \int_{\Omega} \textbf{N} \textbf{y}_e J_e \, d\eta \, d\xi \, d\zeta \\ Q_y &= \int_A x \, dA = \sum_e \int_{\Omega} \textbf{N} \textbf{x}_e J_e \, d\eta \, d\xi \, d\zeta \\\end{split}\]

where \(\textbf{x}_e\) and \(\textbf{y}_e\) are column vectors containing the cartesian coordinates of the element nodes. The above equations can be evaluated using three point integration as the shape functions (\(\textbf{N}\)) are quadratic:

\[\begin{split}Q_x &= \sum_e \sum_{i=1}^3 w_i \textbf{N}_i \textbf{y}_e J_e \\ Q_y &= \sum_e \sum_{i=1}^3 w_i \textbf{N}_i \textbf{x}_e J_e \\\end{split}\]

Centroids

The coordinates of the centroid are found from [2]:

\[\begin{split}x_c &= \frac{Q_y}{A} \\ y_c &= \frac{Q_x}{A} \\\end{split}\]

Second Moments of Area

The second moments of area are defined by [2]:

\[\begin{split}I_{xx} &= \int_A y^2 \, dA = \sum_e \int_{\Omega} (\textbf{N} \textbf{y}_e)^2 J_e \, d\eta \, d\xi \, d\zeta \\ I_{yy} &= \int_A x^2 \, dA = \sum_e \int_{\Omega} (\textbf{N} \textbf{x}_e)^2 J_e \, d\eta \, d\xi \, d\zeta \\ I_{xy} &= \int_A xy \, dA = \sum_e \int_{\Omega} \textbf{N} \textbf{y}_e \textbf{N} \textbf{x}_e J_e \, d\eta \, d\xi \, d\zeta \\\end{split}\]

The above equations can be evaluated using six point integration as the square of the shape functions are quartic:

\[\begin{split}I_{xx} &= \sum_e \sum_{i=1}^6 w_i (\textbf{N}_i \textbf{y}_e)^2 J_e \\ I_{yy} &= \sum_e \sum_{i=1}^6 w_i (\textbf{N}_i \textbf{x}_e)^2 J_e \\ I_{xy} &= \sum_e \sum_{i=1}^6 w_i \textbf{N} \textbf{y}_e \textbf{N} \textbf{x}_e J_e \\\end{split}\]

The above equations list the second moments of area about the global coordinate system axis, which is chosen arbitrarily by the user. These properties can be found about the centroidal axis of the cross-section by using the parallel axis theorem:

\[\begin{split}I_{\overline{xx}} &= I_{xx} - {y_c}^2 A = I_{xx} - \frac{{Q_x}^2}{A} \\ I_{\overline{yy}} &= I_{yy} - {x_c}^2 A = I_{yy} - \frac{{Q_y}^2}{A} \\ I_{\overline{xy}} &= I_{xy} - x_c y_c A = I_{xy} - \frac{Q_x Q_y}{A} \\\end{split}\]

Radii of Gyration

The radii of gyration can be calculated from the second moments of area and the cross-sectional area as follows [2]:

\[\begin{split}r_x = \sqrt{\frac{I_{xx}}{A}} \\ r_y = \sqrt{\frac{I_{yy}}{A}} \\\end{split}\]

Elastic Section Moduli

The elastic section modulii can be calculated from the second moments of area and the extreme (min. and max.) coordinates of the cross-section in the x and y-directions [2]:

\[\begin{split}Z_{xx}^+ = \frac{I_{\overline{xx}}}{y_{max} - y_c} \\ Z_{xx}^- = \frac{I_{\overline{xx}}}{y_c - y_{min}} \\ Z_{yy}^+ = \frac{I_{\overline{yy}}}{x_{max} - x_c} \\ Z_{yy}^- = \frac{I_{\overline{yy}}}{x_c - x_{min}} \\\end{split}\]

Plastic Section Moduli

For a homogenous section, the plastic centroid can be determined by finding the intersection of the two lines that evenly divide the cross-sectional area in both the \(x\) and \(y\) directions. A suitable procedure could not be found in literature and thus an algorithm involving the iterative incrementation of the plastic centroid was developed. The algorithm uses Brent’s method to efficiently locate the plastic centroidal axes in the global and principal directions.

Once the plastic centroid has been located, the plastic section moduli can be readily computed using the following expression:

\[\begin{split}S_{xx} &= \frac{A}{2} \left| y_{c,t} - y_{c,b} \right| \\ S_{yy} &= \frac{A}{2} \left| x_{c,t} - x_{c,b} \right|\end{split}\]

where \(A\) is the cross-sectional area, and \(x_{c,t}\) and \(x_{c,b}\) refer to the centroids of the top half section and bottom half section respectively.

Principal Axis Properties

The principal bending axes are determined by calculating the principal moments of inertia[2]:

\[\begin{split}I_{11} &= \frac{I_{\overline{xx}} + I_{\overline{yy}}}{2} + \Delta \\ I_{22} &= \frac{I_{\overline{xx}} + I_{\overline{yy}}}{2} - \Delta \\\end{split}\]

where:

\[\Delta = \sqrt{\left(\frac{I_{\overline{xx}} - I_{\overline{yy}}}{2}\right)^2 + {I_{\overline{xy}}}^2}\]

The angle between the \(\bar{x}\) axis and the axis belonging to the largest principal moment of inertia can be computed as follows:

\[\phi = {\tan}^{-1} \frac{I_{\overline{xx}} - I_{11}}{I_{\overline{xy}}}\]

The prinicpal section moduli require the calculation of the perpendicular distance from the principal axes to the extreme fibres. All the nodes in the mesh are considered with vector algebra used to compute the perpendicular distances and the minimum and maximum distances identified. The perpendicular distance from a point \(P\) to a line parallel to \(\overrightarrow{u}\) that passes through \(Q\) is given by:

\[d = | \, \overrightarrow{PQ} \times \overrightarrow{u} \, |\]

The location of the point is checked to see whether it is above or below the principal axis. Again vector algebra is used to check this condition. The condition in the below equation will result in the point being above the \(\overrightarrow{u}\) axis.

\[\overrightarrow{QP} \times \overrightarrow{u} < 0\]

Using the above equations, the principal section moduli can be computed similar to that in the calculation of the Elastic Section Moduli and Plastic Section Moduli.

Torsion Constant

The Saint-Venant torsion constant (\(J\)) can be obtained by solving the below partial differential equation for the warping function, \(\omega\):

\[\nabla^2 \omega = 0\]

subject to the boundary condition described below:

\[\frac{\partial \omega}{\partial x} n_x + \frac{\partial \omega}{\partial y} n_y = y n_x - x n_y\]

Pilkey [2] shows that by using the finite element method, this problem can be reduced to a set of linear equations of the form:

\[\textbf{K} \boldsymbol{\omega} = \textbf{F}\]

where \(\textbf{K}\) and \(\textbf{F}\) are assembled through summation at element level. The element equations for the \(e^{\textrm{th}}\) element are:

\[\textbf{k}^e \boldsymbol{\omega}^e = \textbf{f}^e\]

with the stiffness matrix defined as:

\[\textbf{k}^e = \int_{\Omega} \textbf{B}^{\rm T} \textbf{B} J_e \, d\eta \, d\xi \, d\zeta\]

and the load vector defined as:

\[\begin{split}\textbf{f}^e = \int_{\Omega} \textbf{B}^{\rm T} \begin{bmatrix} \textbf{N} \textbf{y} \\ -\textbf{N} \textbf{x} \\ \end{bmatrix} J_e \, d\eta \, d\xi \, d\zeta\end{split}\]

Applying numerical integration to the stiffness matrix and load vector results in the following expressions:

\[\begin{split}\textbf{k}^e &= \sum_{i=1}^3 w_i \textbf{B}_i^{\rm T} \textbf{B}_i J_e \\ \textbf{f}^e &= \sum_{i=1}^6 w_i \textbf{B}_i^{\rm T} \begin{bmatrix} \textbf{N}_i \textbf{y}_e \\ -\textbf{N}_i \textbf{x}_e \\ \end{bmatrix} J_e\end{split}\]

Once the warping function has been evaluated, the Saint-Venant torsion constant can be calculated as follows:

\[J = I_{xx} + I_{yy} - \boldsymbol{\omega}^{\rm T} \textbf{K} \boldsymbol{\omega}\]

Shear Properties

The shear behaviour of the cross-section can be described by Saint-Venant’s elasticity solution for a homogenous prismatic beam subjected to transverse shear loads [2]. Through cross-section equilibrium and linear-elasticity, an expression for the shear stresses resulting from a transverse shear load can be derived. Pilkey [2] explains that this is best done through the introduction of shear functions, \(\Psi\) and \(\Phi\), which describe the distribution of shear stress within a cross-section resulting from an applied transverse load in the \(x\) and \(y\) directions respectively. These shear functions can be obtained by solving the following uncoupled partial differential equations:

\[\begin{split}\nabla^2 \Psi &= 2(I_{\overline{xy}} y - I_{\overline{xx}} x) \\ \nabla^2 \Phi &= 2(I_{\overline{xy}} x - I_{\overline{yy}} y)\end{split}\]

subject to the respective boundary conditions:

\[\begin{split}\frac{\partial \Psi}{\partial n} &= \textbf{n} \cdot \textbf{d} \\ \frac{\partial \Phi}{\partial n} &= \textbf{n} \cdot \textbf{h}\end{split}\]

where \(\textbf{n}\) is the normal unit vector at the boundary and \(\textbf{d}\) and \(\textbf{h}\) are defined as follows:

\[\begin{split}\textbf{d} &= \nu \left(I_{\overline{xx}} \frac{x^2 -y^2}{2} - I_{\overline{xy}} xy\right) \textbf{i} + \nu \left(I_{\overline{xx}} xy + I_{\overline{xy}} \frac{x^2 -y^2}{2}\right) \textbf{j} \\ \textbf{h} &= \nu \left(I_{\overline{yy}} xy - I_{\overline{xy}} \frac{x^2 -y^2}{2}\right) \textbf{i} - \nu \left(I_{\overline{xy}} xy + I_{\overline{yy}} \frac{x^2 -y^2}{2}\right) \textbf{j}\end{split}\]

Pilkey [2] shows that the shear equations subject to the boundary conditions can be solved using the finite element method. This results in a set of linear equations at element level of the form:

\[\begin{split}\textbf{k}^e \boldsymbol{\Psi}^e &= \textbf{f}^e_x \\ \textbf{k}^e \boldsymbol{\Phi}^e &= \textbf{f}^e_y\end{split}\]

The local stiffness matrix, \(\textbf{k}^e\), is identical to the matrix used to determine the torsion constant:

\[\textbf{k}^e = \int_{\Omega} \textbf{B}^{\rm T} \textbf{B} J_e \, d\eta \, d\xi \, d\zeta\]

The load vectors are defined as:

\[\begin{split}\textbf{f}^e_x &= \int_{\Omega} \left[\frac{\nu}{2} \textbf{B}^{\rm T} \begin{bmatrix} d_1 \\ d_2\\ \end{bmatrix} + 2 (1 + \nu) \textbf{N}^{\rm T} (I_{\overline{xx}} \textbf{N} \textbf{x} - I_{\overline{xy}} \textbf{N} \textbf{y}) \right] J_e \, d\eta \, d\xi \, d\zeta \\ \textbf{f}^e_y &= \int_{\Omega} \left[\frac{\nu}{2} \textbf{B}^{\rm T} \begin{bmatrix} h_1 \\ h_2\\ \end{bmatrix} + 2 (1 + \nu) \textbf{N}^{\rm T} (I_{\overline{yy}} \textbf{N} \textbf{y} - I_{\overline{xy}} \textbf{N} \textbf{x}) \right] J_e \, d\eta \, d\xi \, d\zeta \\\end{split}\]

where:

\[\begin{split}d_1 &= I_{\overline{xx}} r - I_{\overline{xy}} q & d_2 &= I_{\overline{xy}} r + I_{\overline{xx}} q \\ h_1 &= -I_{\overline{xy}} r + I_{\overline{yy}} q & h_2 &= -I_{\overline{yy}} r - I_{\overline{xy}} q \\ r &= (\textbf{N} \textbf{x})^2 - (\textbf{N} \textbf{y})^2 & q &= 2 \textbf{N} \textbf{x} \textbf{N} \textbf{y}\end{split}\]

Applying numerical integration to the stiffness matrix and load vector results in the following expressions:

\[\begin{split}\textbf{k}^e &= \sum_{i=1}^3 w_i \textbf{B}_i^{\rm T} \textbf{B}_i J_e \\ \textbf{f}^e_x &= \sum_{i=1}^6 w_i \left[\frac{\nu}{2} \textbf{B}_i^{\rm T} \begin{bmatrix} d_{1,i} \\ d_{2,i} \\ \end{bmatrix} + 2 (1 + \nu) \textbf{N}_i^{\rm T} (I_{\overline{xx}} \textbf{N}_i \textbf{x}_e - I_{\overline{xy}} \textbf{N}_i \textbf{y}_e) \right] J_e \\ \textbf{f}^e_y &= \sum_{i=1}^6 w_i \left[\frac{\nu}{2} \textbf{B}_i^{\rm T} \begin{bmatrix} h_{1,i} \\ h_{2,i} \\ \end{bmatrix} + 2 (1 + \nu) \textbf{N}_i^{\rm T} (I_{\overline{yy}} \textbf{N}_i \textbf{y}_e - I_{\overline{xy}} \textbf{N}_i \textbf{x}_e) \right] J_e \\\end{split}\]
Shear Centre

The shear centre can be computed consistently based on elasticity, or through Trefftz’s definition, which is based on thin-wall assumptions [2].

Elasticity: Pilkey [2] demonstrates that the coordinates of the shear centre are given by the following expressions:

\[\begin{split}x_s &= \frac{1}{\Delta_s} \left[ \frac{\nu}{2} \int_{\Omega} (I_{\overline{yy}} x + I_{\overline{xy}} y)\left(x^2+y^2 \right) \, d \Omega - \int_{\Omega} \textbf{g} \cdot \boldsymbol{\nabla \Phi} \, d \Omega\right] \\ y_s &= \frac{1}{\Delta_s} \left[ \frac{\nu}{2} \int_{\Omega} (I_{\overline{xx}} y + I_{\overline{xy}} x)\left(x^2+y^2 \right) \, d \Omega + \int_{\Omega} \textbf{g} \cdot \boldsymbol{\nabla \Psi} \, d \Omega\right] \\\end{split}\]

where:

\[\begin{split}\Delta_s &= 2 (1 + \nu)(I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2) \\ \textbf{g} &= y \textbf{i} - x \textbf{j}\end{split}\]

The first integral in shear centre equations can be evaluated using quadrature for each element. The second integral can be simplified once the shear functions, \(\Psi\) and \(\Phi\), have been obtained:

\[\begin{split}\int_{\Omega} \textbf{g} \cdot \boldsymbol{\nabla \Phi} \, d \Omega &= \textbf{F}^{\rm T} \boldsymbol{\Phi} \\ \int_{\Omega} \textbf{g} \cdot \boldsymbol{\nabla \Psi} \, d \Omega &= \textbf{F}^{\rm T} \boldsymbol{\Psi}\end{split}\]

where \(\textbf{F}\) is the global load vector determined for the torsion problem in Torsion Constant. The resulting expression for the shear centre therefore becomes:

\[\begin{split}x_s &= \frac{1}{\Delta_s} \Bigg[\Bigg(\frac{\nu}{2} \sum_{i=1}^6 w_i (I_{\overline{yy}} \textbf{N}_i \textbf{x}_e + I_{\overline{xy}} \textbf{N}_i \textbf{y}_e)\Big((\textbf{N}_i \textbf{x}_e)^2 + (\textbf{N}_i \textbf{y}_e)^2 \Big) J_e \Bigg) - \textbf{F}^{\rm T} \boldsymbol{\Phi} \Bigg] \\ y_s &= \frac{1}{\Delta_s} \Bigg[ \Bigg(\frac{\nu}{2} \sum_{i=1}^6 w_i (I_{\overline{xx}} \textbf{N}_i \textbf{y}_e + I_{\overline{xy}} \textbf{N}_i \textbf{x}_e)\Big((\textbf{N}_i \textbf{x}_e)^2 + (\textbf{N}_i \textbf{y}_e)^2 \Big) J_e \Bigg) + \textbf{F}^{\rm T} \boldsymbol{\Psi} \Bigg]\end{split}\]

Trefftz’s Definition: Using thin walled assumptions, the shear centre coordinates according to Trefftz’s definition are given by:

\[\begin{split}x_s &= \frac{I_{\overline{xy}} I_{x \omega} - I_{\overline{yy}} I_{y \omega}}{I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2} \\ y_s &= \frac{I_{\overline{xx}} I_{x \omega} - I_{\overline{xy}} I_{y \omega}}{I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2}\end{split}\]

where the sectorial products of area are defined as:

\[\begin{split}I_{x\omega} &= \int_{\Omega} x \omega(x,y) \, d \Omega \\ I_{y\omega} &= \int_{\Omega} y \omega(x,y) \, d \Omega\end{split}\]

The finite element implementation of the above integrals are shown below:

\[\begin{split}I_{x\omega} &= \sum_e \sum_{i=1}^6 w_i \textbf{N}_i \textbf{x}_e \textbf{N}_i \boldsymbol{\omega}_e J_e \\ I_{y\omega} &= \sum_e \sum_{i=1}^6 w_i \textbf{N}_i \textbf{y}_e \textbf{N}_i \boldsymbol{\omega}_e J_e \\\end{split}\]
Shear Deformation Coefficients

The shear deformation coefficients are used to calculate the shear area of the section as a result of transverse loading. The shear area is defined as \(A_s = k_s A\). Pilkey [2] describes the finite element formulation used to determine the shear deformation coefficients:

\[\begin{split}\kappa_x &= \sum_e \int_{\Omega} \left(\boldsymbol{\Psi}^{e\rm{T}} \textbf{B}^{\rm{T}} - \textbf{d}^{\rm{T}}\right) \left(\textbf{B} \boldsymbol{\Psi}^e - \textbf{d}\right) J_e \, d\Omega \\ \kappa_y &= \sum_e \int_{\Omega} \left(\boldsymbol{\Phi}^{e\rm{T}} \textbf{B}^{\rm{T}} - \textbf{h}^{\rm{T}}\right) \left(\textbf{B} \boldsymbol{\Phi}^e - \textbf{h}\right) J_e \, d\Omega \\ \kappa_{xy} &= \sum_e \int_{\Omega} \left(\boldsymbol{\Psi}^{e\rm{T}} \textbf{B}^{\rm{T}} - \textbf{d}^{\rm{T}}\right) \left(\textbf{B} \boldsymbol{\Phi}^e - \textbf{h}\right) J_e \, d\Omega \\\end{split}\]

where the shear areas are related to \(\kappa_x\) and \(\kappa_y\) by:

\[\begin{split}k_{s,x} A &= \frac{{\Delta_s}^2}{\kappa_x} \\ k_{s,y} A &= \frac{{\Delta_s}^2}{\kappa_y} \\ k_{s,xy} A &= \frac{{\Delta_s}^2}{\kappa_{xy}} \\\end{split}\]

The finite element formulation of the shear deformation coefficients is described below:

\[\begin{split}\kappa_x &= \sum_e \sum_{i=1}^6 w_i \left(\boldsymbol{\Psi}^{e\rm{T}} \textbf{B}_i^{\rm{T}} - \frac{\nu}{2} \begin{bmatrix} d_{1,i} \\ d_{2,i} \\ \end{bmatrix}^{\rm{T}}\right) \left(\textbf{B}_i \boldsymbol{\Psi}^e - \frac{\nu}{2} \begin{bmatrix} d_{1,i} \\ d_{2,i} \\ \end{bmatrix}\right) J_e \\ \kappa_y &= \sum_e \sum_{i=1}^6 w_i \left(\boldsymbol{\Phi}^{e\rm{T}} \textbf{B}_i^{\rm{T}} - \frac{\nu}{2} \begin{bmatrix} h_{1,i} \\ h_{2,i} \\ \end{bmatrix}^{\rm{T}}\right) \left(\textbf{B}_i \boldsymbol{\Phi}^e - \frac{\nu}{2} \begin{bmatrix} h_{1,i} \\ h_{2,i} \\ \end{bmatrix}\right) J_e \\ \kappa_{xy} &= \sum_e \sum_{i=1}^6 w_i \left(\boldsymbol{\Psi}^{e\rm{T}} \textbf{B}_i^{\rm{T}} - \frac{\nu}{2} \begin{bmatrix} d_{1,i} \\ d_{2,i} \\ \end{bmatrix}^{\rm{T}}\right) \left(\textbf{B}_i \boldsymbol{\Phi}^e - \frac{\nu}{2} \begin{bmatrix} h_{1,i} \\ h_{2,i} \\ \end{bmatrix}\right) J_e \\\end{split}\]
Warping Constant

The warping constant, \(\Gamma\), can be calculated from the warping function (\(\omega\)) and the coordinates of the shear centre [2]:

\[\Gamma = I_{\omega} - \frac{{Q_{\omega}}^2}{A} - y_s I_{x\omega} + x_s I_{y\omega}\]

where the warping moments are calculated as follows:

\[\begin{split}Q_{\omega} &= \int_{\Omega} \omega \, d\Omega = \sum_e \sum_{i=1}^3 w_i \textbf{N}_i \boldsymbol{\omega}_e J_e \\ I_{\omega} &= \int_{\Omega} \omega^2 \, d\Omega = \sum_e \sum_{i=1}^6 w_i (\textbf{N}_i \boldsymbol{\omega}_e)^2 J_e\end{split}\]

Monosymmetry Constants

The monosymmetry constants are used to evaluate buckling in sections with unequal flanges. The constants are calculated in accordance with the formula provided is AS4100-1998 [4]:

\[\begin{split}\beta_x &= \frac{1}{I_{xx}} \int_{\Omega} x^2 y + y^3 d\Omega - 2y_s \\ \beta_y &= \frac{1}{I_{yy}} \int_{\Omega} x y^2 + x^3 d\Omega - 2x_s \\\end{split}\]

The finite element formulation of the above integrals is described below:

\[\begin{split}\int_{\Omega} x^2 y + y^3 d\Omega &= \sum_e \sum_{i=1}^6 w_i \left[(\textbf{N}_i \textbf{x}_e)^2 \textbf{N}_i \textbf{y}_e + (\textbf{N}_i \textbf{y}_e)^3 \right] J_e \\ \int_{\Omega} x y^2 + x^3 d\Omega &= \sum_e \sum_{i=1}^6 w_i \left[\textbf{N}_i \textbf{x}_e (\textbf{N}_i \textbf{y}_e)^2 + (\textbf{N}_i \textbf{x}_e)^3 \right] J_e \\\end{split}\]

Cross-Section Stresses

Cross-section stresses resulting from an axial force, bending moments, a torsion moment and shear forces, can be evaluated at the integration points within each element. Extrapolation to Nodes describes the process of extrapolating the stresses to the element nodes and the combination of the results with the adjacent elements through nodal averaging.

Axial Stresses

The normal stress resulting from an axial force \(N_{zz}\) at any point \(i\) is given by:

\[\sigma_{zz} = \frac{N_{zz}}{A}\]

Bending Stresses

Global Axis Bending

The normal stress resulting from a bending moments \(M_{xx}\) and \(M_{yy}\) at any point \(i\) is given by [2]:

\[\sigma_{zz} = -\frac{I_{\overline{xy}} M_{xx} + I_{\overline{xx}} M_{yy}}{I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2} \overline{x}_i + \frac{I_{\overline{yy}} M_{xx} + I_{\overline{xy}} M_{yy}}{I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2} \overline{y}_i\]
Principal Axis Bending

Similarly, the normal stress resulting from a bending moments \(M_{11}\) and \(M_{22}\) at any point \(i\) is given by:

\[\sigma_{zz} = -\frac{M_{22}}{I_{\overline{22}}} \overline{x}_{1,i} + \frac{M_{11}}{I_{\overline{11}}} \overline{y}_{2,i}\]

Torsion Stresses

The shear stresses resulting from a torsion moment \(M_{zz}\) at any point \(i\) within an element \(e\) are given by [2]:

\[\begin{split}\boldsymbol{\tau}^e = \begin{bmatrix} \tau_{zx} \\ \tau_{zy} \\ \end{bmatrix}^e = \frac{M_{zz}}{J} \left(\textbf{B}_i \boldsymbol{\omega}^e - \begin{bmatrix} \textbf{N}_i \textbf{y}_e \\ -\textbf{N}_i \textbf{x}_e \\ \end{bmatrix}\right)\end{split}\]

Shear Stresses

The shear stresses resulting from transverse shear forces \(V_{xx}\) and \(V_{yy}\) at any point \(i\) within an element \(e\) are given by [2]:

\[\begin{split}\begin{bmatrix} \tau_{zx} \\ \tau_{zy} \\ \end{bmatrix}^e = \frac{V_{xx}}{\Delta_s} \left(\textbf{B}_i \boldsymbol{\Psi}^e - \frac{\nu}{2} \begin{bmatrix} d_{1,i} \\ d_{2,i} \\ \end{bmatrix}\right) + \frac{V_{yy}}{\Delta_s} \left(\textbf{B}_i \boldsymbol{\Phi}^e - \frac{\nu}{2} \begin{bmatrix} h_{1,i} \\ h_{2,i} \\ \end{bmatrix}\right)\end{split}\]

von Mises Stresses

The von Mises stress can be determined from the net axial and shear stress as follows [2]:

\[\sigma_{vM} = \sqrt{{\sigma_{zz}}^2 + 3({\tau_{zx}}^2 + {\tau_{zy}}^2)}\]

Principal Stresses

For a cross section subjected to axial force, shear in the \(x\) and \(y\) axes which are perpendicular to the centroidal (\(z\)) axis, and moments about all three axes, there are no axial stresses in the \(x\) or \(y\) axes, and so the stress tensor is given by:

\[\begin{split}\boldsymbol{\sigma} = \begin{bmatrix} 0 & 0 & \tau_{zx} \\ 0 & 0 & \tau_{zy} \\ \tau_{xz} & \tau_{yz} & \sigma_{zz} \end{bmatrix}\end{split}\]

and of course the complementary shear stresses are equal, \(\tau_{zx}=\tau_{xz}\), \(\tau_{zy}=\tau_{yz}\).

By definition, the principal stresses are those for which the stress tensor becomes a diagonal matrix through a coordinate transformation. Since this is the basic eigenvalue problem, the principal stresses are then given by:

\[\det (\boldsymbol{\sigma} - \lambda \textbf{I}) = 0\]

Of which the characteristic polynomial can then be written:

\[\lambda^3 - I_1\lambda^2 + I_2\lambda - I_3 = 0\]

where the stress invariants \(I\) are then given by [5]:

\[\begin{split}I_1 &= \textrm{tr}(\boldsymbol{\sigma}) = \sigma_{zz} \\ I_2 &= \frac{1}{2}\left[\textrm{tr}(\boldsymbol{\sigma})^2 - \textrm{tr}(\boldsymbol{\sigma}^2) \right] = -\tau_{zx}^2 - \tau_{zy}^2 \\ I_3 &= \det(\boldsymbol{\sigma}) = 0\end{split}\]

and thus, the cubic polynomial reduces to a quadratic, the two roots of which are then the first and third principal stresses (with \(\sigma_2 = 0\)):

\[\sigma_{1,3} = \frac{\sigma_{zz}}{2} \pm \sqrt{ \left(\frac{\sigma_{zz}}{2}\right)^2 + \tau_{zx}^2 + \tau_{zy}^2 }\]

Composite Cross-Sections

Pilkey [2] explains that composite cross-sections can be analysed using a modulus-weighted approach in which the differential area element is multiplied by the elastic modulus for the element, \(E_e\):

\[d \widetilde{A} = E_e \, dA\]

The expression for section properties after the application of numerical integration then becomes:

\[\int f(x,y) \, d \widetilde{A} = \sum_i^n w_i f(\eta_i, \xi_i, \zeta_i) \, J_i E_e\]

Pilkey [2] also notes that an assumption of the elastic cross-sectional analysis of warping and shear is that:

\[\sigma_x = \sigma_y = \tau_{xy} = 0\]

However, for composite sections with variable Poisson’s ratios, this assumption does not hold. Pilkey [2] does mention that engineering materials often have very similar Poisson’s ratios and therefore the difference can be negligible.

Note

If the Poisson’s ratio of two materials used in a composite analysis are vastly different, the assumptions used in sectionproperties may not hold, see Chapter 5 & 6 of [2].

For the warping and shear analysis of composite cross-sections, sectionproperties defines an area based on an effective Poisson’s ratio that is used to calculate the relevant properties described above:

\[\nu_{eff} = \frac{(E.A)_g}{2 (G.A)_g} - 1\]

References

      1. Felippa, Introduction to Finite Element Methods, Department of Aerospace Engineering Sciences and Center for Aerospace Structures University of Colorado, Boulder, Colorado, 2004.

      1. Pilkey, Analysis and Design of Elastic Beams: Computational Methods, John Wiley & Sons, Inc., New York, 2002.

      1. Larson, F. Bengzon, The Finite Element Method: Theory, Implementation, and Applications, Vol. 10, Springer, Berlin, Heidelberg, 2013. doi:10.1007/978-3-642-33287-6.

  1. AS 4100 - 1998: Steel Structures. (1998, June). Standards Australia.

  2. Oñate, E. (2009), Structural Analysis with the Finite Element Method. Linear Statics. Volume 1: The Basis and Solids, Springer Netherlands

Testing and Results Validation

sectionproperties has a (slowly) growing suite of tests. The testing suite serves to verify functionality and find exceptions from edge cases, but also validate the results against known cases. Since this library performs engineering calculations, it should have some manner of proving its accuracy. Each analyst who uses it is responsible for their own projects and calculations, but having a high level of confidence that the software can produce correct results, given the correct inputs, is a boon to all users. Some test results and explanations from the latter category will be outlined on this page, since the former really serves no use to the end user.

Textbook Examples

An obvious starting location is replicating examples from academic texts. “Aircraft Structures” by David J. Peery is a highly regarded text in the field of aerospace structures 1.

Peery - Symmetric Sections

The simplest example of a realistic section problem is the symmetric I-Beam, with a free-fixed boundary condition and a transverse tip load. The free-body-diagram and shear and moment diagrams are shown in the problem statement, referenced below. This problem is Example 1 in Section 6.2.

From Peery, Sec. 6.2 Example 1
Check #1:

In sectionproperties, there are multiple ways to set this problem up. We could different shapely geometries and merge together, or a set of custom points, or a built-in constructor. For the sake of simplicity, this simpler I-section is identical to the Nastran I-section definition, so it makes sense to utilize the built-in constructor from pre.library.nastran_sections.nastran_i.

Using an arbitrarily coarse mesh, the properties can then be directly calculated from the class method Section.calculate_geomtric_properties().

Peery lists the second moment of area about the primary bending axis as a value of \(43.3 [in^4]\). For the automated tests in this library, we check against this hardcoded value, with a tolerance of \(\pm 0.1%\).

Check #2:

As a final check against this example, we can calculate the maximum bending stress on the I-beam. From simple statics, the maximum moment from the FBD will be \(800,000 [in-lbs]\) at the fixed end. Applying this moment to our section from before will allow computation of stress over the FEM.

Peery quotes the peak value at \(55.5 [ksi]\), which is rounded to the nearest decimal place. From the equatio listed in the text, the theoretical value is actually \(55,427.3 [psi]\).

\[f = \frac{My}{I} = 55,427.3 = 55,400\]

Again, the automated test against this checks the hardcoded value with a tolerance of \(\pm 0.1%\). For accuracy, 55,427.3 is used instead of the rounded value.

For full details and the most updated code of this exampe, see the examples page in the documentation gallery. For the exact test code execution, check the source.

Peery - Unsymmetric Sections

For a more complex example, we can turn to Example 1 in Section 7.2 of Peery. Here, we have a still-simplified Z-section, but bending about two axes. Note axes definitions in the problem statement. Beam axial direction in sectionproperties is always referenced as the z-axis, and loads must be applied in this coordinate system.

From Peery, Sec. 7.2 Example 1

The construction of this geometry takes a similar approach to Ex 6.2.1, and utilizes a built-in factory: pre.library.nastran_sections.nastran_zed. The only difference you may notice in the test code is usage of a custom class for ease of initialization. This is not necessary.

Using an arbitrarily coarse mesh, the properties can then be directly calculated from the class method Section.calculate_geomtric_properties(). Each property listed directly by Peery is taken as a hardcoded value and checked against, within the testing suite.

Property

Peery Value

I_x

693.3 [in4]

I_y

173.3 [in4]

I_xy

-240 [in4]

I_p

787.1 [in4]

I_q

79.5 [in4]

theta

21.35 [deg]

For stress results, the theoretical values follow the biaxial bending equation. These values are checked against automatically in the testing suite. Note that again Peery rounds the values quoted directly, for simplicity. The testing suite also verifies that the theoretical value as per the equation matches the theoretical value quoted in the text, which also matches the computed value from the sectionproperties FEM.

\[f_b = \frac{M_x I_{xy} - M_y I_x}{I_x I_y - I_{xy}^2}x + \frac{M_y I_{xy} - M_x I_y}{I_x I_y - I_{xy}^2}y\]

Point

x

y

-494x

-315y

\(f_b\), [psi]

A

-5

4

2470

-1260

1210.0 = 1210

B

-5

6

2470

-1890

580.0 = 580

C

1

6

-494

-1890

-2384.0 = -2380

From Peery, Sec. 7.2 Example 1 results

For full details and the most updated code of this example, see the examples page in the documentation gallery. For the exact test code execution, check the source.

1

D. J. Peery, Aircraft Structures. New York: Dover Publications, 2011. ISBN-10: 0-486-48580-3

Here’s a quick example that harnesses some of the power of sectionproperties and shows its simplicity:

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

# create geometry of the cross-section
geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)

# generate a finite element mesh
geometry.create_mesh(mesh_sizes=[10])

# create a Section object for analysis
section = Section(geometry)

# calculate various cross-section properties
section.calculate_geometric_properties()
section.calculate_warping_properties()

# print some of the calculated section properties
print(section.get_area())  # cross-section area
>>>3231.80
print(section.get_ic())  # second moments of area about the centroidal axis
>>>(23544664.29, 3063383.07, 0.00)
print(section.get_j())  # torsion constant
>>>62954.43
print(section.get_As())  # shear areas in the x & y directions
>>>(1842.24, 1120.19)

Support

Raise an issue on the GitHub issue tracker or contact me at robbie.vanleeuwen@gmail.com. If you have a request for a feature to be added to the sectionproperties package, please don’t hesitate to get in touch

License

The project is licensed under the MIT license.