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