sectionproperties is a python package for the analysis of arbitrary cross-sections using the
finite element method written by Robbie van Leeuwen. sectionproperties can be used to determine
section properties to be used in structural design and visualise cross-sectional stresses resulting
from combinations of applied forces and bending moments.
These instructions will get you a copy of sectionproperties up and running on
your local machine. You will need a working copy of python 3.8, 3.9 or 3.10 on your
machine.
sectionproperties uses shapely to prepare the
cross-section geometry and triangle to efficiently
generate a conforming triangular mesh in order to perform a finite element analysis of the
structural cross-section.
sectionproperties and all of its dependencies can be installed through the python package index:
pip install sectionproperties
Note that dependencies required for importing from rhino files are not included by default.
To obtain these dependencies, install using the rhino option:
Python pytest modules are located in the sectionproperties.tests package.
To see if your installation is working correctly, install pytest and run the
following test:
The dimensions and shape of the cross-section to be analysed define the geometry
of the cross-section. The Section Library provides a number of
functions to easily generate either commonly used structural sections. Alternatively,
arbitrary cross-sections can be built from a list of user-defined points, see
Geometry from points, facets, holes, and control points.
The final stage in the pre-processor involves generating a finite element mesh of
the geometry that the solver can use to calculate the cross-section properties.
This can easily be performed using the create_mesh()
method that all Geometry objects have
access to.
The following example creates a geometry object with a circular cross-section.
The diameter of the circle is 50 and 64 points are used to discretise the circumference
of the circle. A finite element mesh is generated with a maximum triangular area
of 2.5:
Finite element mesh generated by the above example.¶
If you are analysing a composite section, or would like to include material properties
in your model, material properties can be created using the Material
class. The following example creates a steel material object:
The geometric analysis can be performed individually. However in order to perform
a warping or plastic analysis, a geometric analysis must first be performed. Further,
in order to carry out a stress analysis, both a geometric and warping analysis must
have already been executed. The program will display a helpful error if you try
to run any of these analyses without first performing the prerequisite analyses.
The following example performs a geometric and warping analysis on the circular
cross-section defined in the previous section with steel used as the material
property:
importsectionproperties.pre.library.primitive_sectionsasprimitive_sectionsfromsectionproperties.analysis.sectionimportSectionfromsectionproperties.pre.preimportMaterialsteel=Material(name='Steel',elastic_modulus=200e3,poissons_ratio=0.3,density=7.85e-6,yield_strength=500,color='grey')geometry=primitive_sections.circular_section(d=50,n=64,material=steel)geometry.create_mesh(mesh_sizes=[2.5])# Adds the mesh to the geometrysection=Section(geometry)section.calculate_geometric_properties()section.calculate_warping_properties()
Refer to Running an Analysis for a more detailed explanation of the solver stage.
Once an analysis has been performed, a number of methods belonging to the
Section object can be called
to present the cross-section results in a number of different formats. For example
the cross-section properties can be printed to the terminal, a plot of the centroids
displayed and the cross-section stresses visualised in a contour plot.
The following example analyses a 200 PFC section. The cross-section properties
are printed to the terminal and a plot of the centroids is displayed:
importsectionproperties.pre.library.steel_sectionsassteel_sectionsfromsectionproperties.analysis.sectionimportSectiongeometry=steel_sections.channel_section(d=200,b=75,t_f=12,t_w=6,r=12,n_r=8)geometry.create_mesh(mesh_sizes=[2.5])# Adds the mesh to the geometrysection=Section(geometry)section.calculate_geometric_properties()section.calculate_plastic_properties()section.calculate_warping_properties()section.plot_centroids()section.display_results()
Plot of the elastic centroid and shear centre for the above example generated
by plot_centroids()¶
Refer to Viewing the Results for a more detailed explanation of the post-processing stage.
Creating Geometries, Meshes, and Material Properties¶
Before performing a cross-section analysis, the geometry of the cross-section and a finite element
mesh must be created. Optionally, material properties can be applied to different regions of the
cross-section. If materials are not applied, then a default material is used to report the
geometric properties.
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.
If a Material is not given, then the default material is
assigned to the Geometry.material attribute. The default material has an elastic modulus of
1, a Poisson’s ratio of 0 and a yield strength of 1.
Class for defining a geometry of multiple distinct regions, each potentially
having different material properties.
CompoundGeometry instances are composed of multiple Geometry objects. As with
Geometry objects, CompoundGeometry objects have methods for generating a triangular
mesh over all geometries, transforming the collection of geometries as though they
were one (e.g. translation, rotation, and mirroring), and aligning the CompoundGeometry
to another Geometry (or to another CompoundGeometry).
CompoundGeometry objects can be created directly between two or more Geometry
objects by using the + operator.
Variables
geoms (Union[shapely.geometry.MultiPolygon,
List[Geometry]]) – either a list of Geometry objects or a shapely.geometry.MultiPolygon
instance.
A CompoundGeometry is instantiated with one argument
which can be one of two types:
A CompoundGeometry does not have a .material
attribute and therefore, a Material cannot be assigned to a
CompoundGeometry directly. Since a
CompoundGeometry is simply a combination of
Geometry objects, the Material(s) should be assigned to
the individual Geometry objects that comprise the
CompoundGeometry.
CompoundGeometry objects created from a
shapely.geometry.MultiPolygon will have its constituent
Geometry objects assigned the default material.
Each Geometry contains its own material definition,
which is stored in the .material attribute. A geometry’s material may be altered at any time by
simply assigning a new Material to the .material attribute.
In addition to creating geometries directly from shapely.geometry.Polygon and/or
shapely.geometry.MultiPolygon objects, there are other ways to create geometries for
analysis:
From lists of points, facets, hole regions, and control regions
From .dxf files
From .3dm files
From Rhino encodings
Using transformation methods on existing geometries and/or by applying set operations
(e.g. |, +, -, &, ^)
From sectionproperties’s section library
For the first two approaches, an optional .material parameter can be passed containing a
Material (or list of Material objects) to associate with the
newly created geometry(ies). The material attribute can be altered afterward in a
Geometry object at any time by simply assigning a
different Material to the .material attribute.
Geometry from points, facets, holes, and control points¶
In sectionproperties v1.x.x, geometries were created by specifying lists of points, facets,
holes, and control_points. This functionality has been preserved in v2.0.0 by using the
from_points() class method.
An interface for the creation of Geometry objects through the definition of points,
facets, and holes.
Variables
points (list[list[float, float]]) – List of points (x, y) defining the vertices of the section geometry.
If facets are not provided, it is a assumed the that the list of points are ordered
around the perimeter, either clockwise or anti-clockwise.
facets (list[list[int, int]]) – A list of (start, end) indexes of vertices defining the edges
of the section geoemtry. Can be used to define both external and internal perimeters of holes.
Facets are assumed to be described in the order of exterior perimeter, interior perimeter 1,
interior perimeter 2, etc.
control_points – An (x, y) coordinate that describes the distinct, contiguous,
region of a single material within the geometry. Must be entered as a list of coordinates,
e.g. [[0.5, 3.2]]
Exactly one point is required for each geometry with a distinct material.
If there are multiple distinct regions, then use CompoundGeometry.from_points()
holes (list[list[float, float]]) – Optional. A list of points (x, y) that define interior regions as
being holes or voids. The point can be located anywhere within the hole region.
Only one point is required per hole region.
material – Optional. A Material object
that is to be assigned. If not given, then the
DEFAULT_MATERIAL will be used.
For simple geometries (i.e. single-region shapes without holes), if the points are an ordered sequence of coordinates, only the points
argument is required (facets, holes, and control_points are optional). If the geometry has holes, then all arguments are required.
If the geometry has multiple regions, then the
from_points() class method must be used.
An interface for the creation of CompoundGeometry objects through the definition of points,
facets, holes, and control_points. Geometries created through this method are expected to
be non-ambiguous meaning that no “overlapping” geometries exists and that nodal connectivity
is maintained (e.g. there are no nodes “overlapping” with facets without nodal connectivity).
Variables
points (list[list[float]]) – List of points (x, y) defining the vertices of the section geometry.
If facets are not provided, it is a assumed the that the list of points are ordered
around the perimeter, either clockwise or anti-clockwise
facets (list[list[int]]) – A list of (start, end) indexes of vertices defining the edges
of the section geoemtry. Can be used to define both external and internal perimeters of holes.
Facets are assumed to be described in the order of exterior perimeter, interior perimeter 1,
interior perimeter 2, etc.
control_points (list[list[float]]) – Optional. A list of points (x, y) that define non-interior regions as
being distinct, contiguous, and having one material. The point can be located anywhere within
region. Only one point is permitted per region. The order of control_points must be given in the
same order as the order that polygons are created by ‘facets’.
If not given, then points will be assigned automatically using
shapely.geometry.Polygon.representative_point()
holes (list[list[float]]) – Optional. A list of points (x, y) that define interior regions as
being holes or voids. The point can be located anywhere within the hole region.
Only one point is required per hole region.
materials (list[Material]) – Optional. A list of Material objects that are to be
assigned, in order, to the regions defined by the given control_points. If not given, then
the DEFAULT_MATERIAL will be used for each region.
Geometries can now be created from .3dm files and BREP encodings.
Various limitations and assumptions need to be acknowledged:
sectional analysis is based in 2d and Rhino is a 3d environment.
the recognised Rhino geometries are limited to planer-single-surfaced BREPs.
Rhino uses NURBS for surface boundaries and sectionproperties uses piecewise linear boundaries.
a search plane is defined.
See the keyword arguments below that are used to search and simplify the Rhino geometry.
Rhino files are read via the class methods sectionproperties.pre.geometry.Geometry.from_3dm() and
sectionproperties.pre.geometry.CompoundGeometry.from_3dm().
Each class method returns the respective objects.
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.
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.
Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves.
Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines.
This parameter sets the number of straight lines used in the interpolation.
Default is 1.
vec1 (numpy.ndarray,optional) –
A 3d vector in the Shapely plane. Rhino is a 3D geometry environment.
Shapely is a 2D geometric library.
Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system.
vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction.
Default is [1,0,0].
vec2 (numpy.ndarray,optional) –
Continuing from vec1, vec2 is another vector to define the Shapely plane.
It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1).
Default is [0,1,0].
plane_distance (float,optional) –
The distance to the Shapely plane.
Default is 0.
project (boolean,optional) –
Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal.
Default is True.
parallel (boolean,optional) –
Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded.
If true, all non parallel surfaces are filtered out.
Default is False.
Geometry objects can also be created from encodings of Rhino BREP.
Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves.
Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines.
This parameter sets the number of straight lines used in the interpolation.
Default is 1.
vec1 (numpy.ndarray,optional) –
A 3d vector in the Shapely plane. Rhino is a 3D geometry environment.
Shapely is a 2D geometric library.
Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system.
vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction.
Default is [1,0,0].
vec2 (numpy.ndarray,optional) –
Continuing from vec1, vec2 is another vector to define the Shapely plane.
It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1).
Default is [0,1,0].
plane_distance (float,optional) –
The distance to the Shapely plane.
Default is 0.
project (boolean,optional) –
Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal.
Default is True.
parallel (boolean,optional) –
Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded.
If true, all non parallel surfaces are filtered out.
Default is False.
More advanced filtering can be achieved by working with the Shapely geometries directly.
These can be accessed by load_3dm() and
load_rhino_brep_encoding().
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.
RuntimeError – A RuntimeError is raised if no polygons are found in the encoding.
This is dependent on the keyword arguments.
Try adjusting the keyword arguments if this error is raised.
Returns
The Polygons found in the encoding string.
Return type
shapely.geometry.Polygon
Keyword Arguments
refine_num (int,optional) –
Bézier curve interpolation number. In Rhino a surface’s edges are nurb based curves.
Shapely does not support nurbs, so the individual Bézier curves are interpolated using straight lines.
This parameter sets the number of straight lines used in the interpolation.
Default is 1.
vec1 (numpy.ndarray,optional) –
A 3d vector in the Shapely plane. Rhino is a 3D geometry environment.
Shapely is a 2D geometric library.
Thus a 2D plane needs to be defined in Rhino that represents the Shapely coordinate system.
vec1 represents the 1st vector of this plane. It will be used as Shapely’s x direction.
Default is [1,0,0].
vec2 (numpy.ndarray,optional) –
Continuing from vec1, vec2 is another vector to define the Shapely plane.
It must not be [0,0,0] and it’s only requirement is that it is any vector in the Shapely plane (but not equal to vec1).
Default is [0,1,0].
plane_distance (float,optional) –
The distance to the Shapely plane.
Default is 0.
project (boolean,optional) –
Controls if the breps are projected onto the plane in the direction of the Shapley plane’s normal.
Default is True.
parallel (boolean,optional) –
Controls if only the rhino surfaces that have the same normal as the Shapely plane are yielded.
If true, all non parallel surfaces are filtered out.
Default is False.
Note
Dependencies for importing files from rhino are not included by default. To obtain
the required dependencies install sectionproperties with the rhino option:
Each geometry instance is able to be manipulated in 2D space for the purpose of creating novel, custom section geometries
that the user may require.
Note
Operations on geometries are non-destructive. For each operation, a new geometry object is
returned.
This gives sectionproperties geoemtries a fluent API meaning that transformation methods can
be chained together. Please see Advanced Geometry Creation for examples.
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 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.
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’
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’
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.
The following example expands the sides of a rectangle, one point at a time,
to make it a square:
importsectionproperties.pre.library.primitive_sectionsasprimitive_sectionsgeometry=primitive_sections.rectangular_section(d=200,b=150)# Using relative shiftingone_pt_shifted_geom=geometry.shift_points(point_idxs=1,dx=50)# Using absolute relocationboth_pts_shift_geom=one_pt_shift_geom.shift_points(point_idxs=2,abs_x=200)
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).
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
Dilates or erodes the perimeter of a CompoundGeometry object by a discrete amount.
Parameters
amount (float) – Distance to offset the section by. A -ve value “erodes” the section. A +ve
value “dilates” the section.
where (str) – One of either “exterior”, “interior”, or “all” to specify which edges of the
geometry to offset. If geometry has no interiors, then this parameter has no effect.
Default is “exterior”.
resolution (float) – Number of segments used to approximate a quarter circle around a point
If performing a positive offset on a CompoundGeometry with multiple materials, ensure
that the materials propagate as desired by performing a .plot_mesh() prior to performing
any analysis.
Visualisation of geometry objects is best performed in the Jupyter computing environment,
however, most visualisation can also be done in any environment which supports display of
matplotlib plots.
There are generally two ways to visualise geometry objects:
In the Jupyter computing environment, geometry objects utilise their underlying
shapely.geometry.Polygon object’s _repr_svg_ method to show the geometry
as it’s own representation.
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
A finite element mesh is required to perform a cross-section analysis. After a geometry has been
created, a finite element mesh can then be created for the geometry by using the
create_mesh() method:
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:
The length of mesh_sizes must match the number of regions
in the geometry object.
Once the mesh has been created, it is stored within the geometry object and the geometry object
can then be passed to Section for analysis.
Please see Running an Analysis for further information on performing analyses.
Creating Section Geometries from the Section Library¶
In order to make your life easier, there are a number of built-in functions that generate typical
structural cross-sections, resulting in Geometry objects.
These typical cross-sections reside in the sectionproperties.pre.library module.
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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.
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:
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:
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:
Note that the properties are reported as modulusweighted 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.
The below tutorial was created to demonstrate the creation of valid geometries
for section analysis by combining multiple shapes.
Some key points to remember:
Geometries of two different materials should not overlap (can create unpredictable results)
If two geometries of the same materials are overlapping, then you should perform a union on the two sections
Two different section geometries that share a common edge (facet) should also share the same nodes (do not leave “floating” nodes along common edges)
These are general points to remember for any finite element analysis.
Note
sectionproperties will not prevent the creation of these ambiguous sections. The flexibility of the new
pre-processing engine (shapely) allows for a wide variety of intermediate modelling steps but the user must ensure
that the final model is one that is appropriate for analysis.
fromsectionproperties.pre.preimportMaterialmat1=Material("Material_1",200e3,0.3,100,400,"red")mat2=Material("Material_2",150e3,0.2,100,200,"blue")# Just some differing propertiesi_sec1.material=mat1i_sec2.material=mat2
Now, we can use the + operator to naively combine these two sections into a CompoundGeometry. Note, the two
different materials:
i_sec1+i_sec2
When we plot the geometry, we will see that even though we have two materials, we only have one control point for both geometries:
(i_sec1+i_sec2).plot_geometry()
If we went a few steps further by creating a mesh and then plotting that mesh as part of an analysis section, we would see the unpredictable result of the mesh:
To prevent ambiguity between geometries and their analytical regions, there are a few options we can take. We can perform a simple union operation but that will lose
the material information for one of our sections: whichever section comes first in the operation will have
it’s information preserved. In this example, we will use | (union)
with i_sec2 taking precedence by being the first object in the operation:
i_sec2|i_sec1
However, this is unsatisfactory as a solution. We want this section to more aptly represent a real section that might be created by cutting and welding two sections together.
Lets say we want the upright “I” section to be our main section and the diagonal section will be added on to it.
It is sometimes possible to do this in a quick operation, one which does not create nodes in common at the intersection points.
Here, we will simply “slice” i_sec2 with i_sec1 and add it to i_sec1. This will create “floating nodes” along the
common edges of i_sec2 and i_sec1 because the nodes are not a part of i_sec1:
(i_sec2-i_sec1)+i_sec1
Sometimes, we can get away with this as in this example. We can see in the plot that there are five distinct regions indicated with five control points.
When we are “unlucky”, sometimes gaps can be created (due to floating point errors) where the two sections meet and a proper hole might not be detected, resulting
in an incorrect section.
It is best practice to first create nodes in common on both sections and then combine them. For this, an extra step is required:
cut_2_from_1=(i_sec1-i_sec2)# locates intersection nodessec_1_nodes_added=cut_2_from_1|i_sec1# This can also be done in one linesec_1_nodes_added=(i_sec1-i_sec2)|i_sec1
Now, when we use .plot_geometry(), we can see the additional nodes added to “section 1”:
sec_1_nodes_added.plot_geometry()
The additional nodes from the cut portion are now merged as part of the “section 1” geometry.¶
At this point, we can use our “section 1 with additional nodes” to create our complete geometry:
From the shapely vector representation, we can see that the squares are shaded red.
This indicates an “invalid” geometry from shapely’s perspective
because there are two polygons that share an edge. For this geometry, the intention is to have two squares
that are connected on one side and so the red shading provided by the shapely representation tells us that
we are getting what we expect.
Now, say this is not our final geometry and we actually want to have it rotated by 30 degrees:
geometry=geometry.rotate_section(30)
Here, we can see that the shapely representation is now showing as green indicating a “valid” shapely geometry.
Even though it is now valid for shapely, because it is green we know that these two polygons no longer share an edge
because there is a miniscule separation between them as a result of a floating point error.
When we try to mesh this geometry, we will actually cause a crash with triangle, the meshing tool used behind-the-scenes
by sectionproperties:
geometry.create_mesh(mesh_sizes=[0.2,0.1])# This may crash the kernel
The crash occurs because the distance between the two polygons is so small, even though they are separated and
the space between them will not be meshed. The same crash would occur if the polygons were overlapping by this same
small distance.
If we plot the geometry, you can see that each of the two squares has only four nodes and four facets and their relationship
is only incidental. If their edges happen to perfectly align, they will be considered as one continuous section. If their edges
do not perfectly align, they will be considered as discontinuous.
To remedy this, take the same approach as in the preceding example by creating intermediate nodes where the two polygons
intersect by using set operations. If we subtract s2 from s1 then we will have the larger square with intermediate nodes created:
(s1-s2).plot_geometry(labels=['points'])
Now, if we build the compound geometry up from this larger square with the intermediate points, then our section will work.:
This example demonstrates creating nested geometries using two different approaches.
These approaches reflect the differences between how shapely (geometry pre-processor) “perceives” geometry
and how Triangle (meshing tool) “perceives” geometry and how the modeller might adapt their
input style depending on the situation.
The nested geometry we are trying to create looks as follows:
In creating this geometry consider the following:
shapely has a concept of “z-ordering” where it is possible for one geometry to be “over”
another geometry and for an overlap section to exist. When a hole is created in a polygon,
it is only local to that polygon.
Triangle does not have a concept of “z-ordering” so there is only a single plane which
may have regions of different materials (specified with control points). When a hole is created
in the plane, it “punches” through “all” polygons in the plane.
To create the nested geometry using shapely, the code would be as follows:
mat1=Material(name="Material 1",elastic_modulus=100,poissons_ratio=0.3,yield_strength=10,density=1e-6,color="yellow")mat2=Material(name="Material 2",elastic_modulus=100,poissons_ratio=0.3,yield_strength=10,density=1e-6,color="orange")mat3=Material(name="Material 3",elastic_modulus=100,poissons_ratio=0.3,yield_strength=10,density=1e-6,color="red")sq1=sections.rectangular_section(100,100,material=mat1).align_center()sq2=sections.rectangular_section(75,75,material=mat2).align_center()sq3=sections.rectangular_section(50,50,material=mat3).align_center()hole=sections.rectangular_section(25,25).align_center()compound=((sq1-sq2)# Create a big square with a medium hole in it and stack it over...+(sq2-sq3)# ... a medium square with a medium-small hole in it and stack it over...+(sq3-hole)# ...a medium-small square with a small hole in it.)compound
To create the nested geometry using the Triangle interface, the code would be as follows:
points=[# Points for four squares are created[-50.0,50.0],# Square 1[50.0,50.0],[50.0,-50.0],[-50.0,-50.0],[37.5,-37.5],# Square 2[37.5,37.5],[-37.5,37.5],[-37.5,-37.5],[25.0,-25.0],# Square 3[25.0,25.0],[-25.0,25.0],[-25.0,-25.0],[12.5,-12.5],# Square 4 (hole)[12.5,12.5],[-12.5,12.5],[-12.5,-12.5],]facets=[# Facets trace each of the four squares[0,1],# Square 1[1,2],[2,3],[3,0],[4,5],# Square 2[5,6],[6,7],[7,4],[8,9],# Square 3[9,10],[10,11],[11,8],[12,13],# Square 4 (hole)[13,14],[14,15],[15,12],]control_points=[[-43.75,0.0],[-31.25,0.0],[-18.75,0.0]]# Three squaresholes=[[0,0]]nested_compound=CompoundGeometry.from_points(points=points,facets=facets,control_points=control_points,holes=holes)nested_compound
Notice how the shapely representation shows the squares overlapping each other instead of the squares
fitting into the “hole below”.
Is one of these methods better than the other? Not necessarily. The shapely approach is suitable
for manually creating the geometry whereas the Triangle approach is suitable for reading in serialized
data from a file, for example.
And, for either case, when the compound geometry is meshed, we see this:
The first step in running a section analysis is the creation of a
Section object. This class
stores the structural geometry and finite element mesh and provides methods to
perform various types of sectional analyses.
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:
Before carrying out a section analysis it is a good idea to check the quality
of the finite element mesh. Some useful methods are provided to display mesh statistics
and to plot the finite element mesh:
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:
A plastic analysis calculates the plastic properties of the section.
Note
A geometric analysis must be performed on the Section object before
a plastic analysis is carried out.
Warning
The plastic analysis in sectionproperties assumes all materials are
able to reach their yield stress defined in the material properties. Care should be
taken if analysing materials or cross-sections exhibiting non-linear behaviour, e.g.
reinforced concrete or non-compact steel sections.
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:
A warping analysis calculates the torsion and shear properties of the section.
Note
A geometric analysis must be performed on the Section object before
a warping analysis is carried out.
Warning
There must be connectivity between all elements of the mesh to perform a
valid warping analysis. This is a limitation of the elastic theory that this
implementation is based on, as there is no way to quantify the transfer of shear and
warping between two unconnected regions.
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:
A stress analysis calculates the section stresses arising from a set of forces
and moments. Executing this method returns a StressResult
object which stores the section stresses and provides stress plotting functions.
Note
A geometric analysis must be performed on the Section object before a stress
analysis is carried out. Further, if the shear force or twisting moment is non-zero
a warping analysis must also be performed.
Warning
The stress analysis in sectionproperties is linear-elastic and does not
account for the yielding of materials or any non-linearities.
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:
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:
A list of section properties that have been calculated by various analyses can
be printed to the terminal using the display_results()
method that belongs to every
Section object.
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.
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.
If a Geometry containing a user defined
Material is used to build a
Section, sectionproperties will assume you
are performing a composite analysis and this will affect the way some of the results are
stored and presented.
In general, the calculation of gross composite section properties takes into account the elastic
modulus, Poisson’s ratio and yield strength of each material in the section. Unlike many design
codes, sectionproperties is ‘material property agnostic’ and does not transform sections based on
a defined material property, e.g. in reinforced concrete analysis it is commonplace to transform
the reinforcing steel area based on the ratio between the elastic moduli,
\(n = E_{steel} / E_{conc}\). sectionproperties instead calculates the gross material
weighted properties, which is analogous to transforming with respect to a material property with
elastic modulus, \(E = 1\).
Using the example of a reinforced concrete section, sectionproperties will calculate the gross
section bending stiffness, \((EI)_g\), rather than an effective concrete second moment of area,
\(I_{c,eff}\):
\[(EI)_g = E_s \times I_s + E_c \times I_c\]
If the user wanted to obtain the effective concrete second moment of area for a code calculation,
they could simply divide the gross bending stiffness by the elastic modulus for concrete:
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.
There are a number of methods that can be called from a StressResult
object to plot the various cross-section stresses. These methods take the following form:
stress denotes a contour plot and vector denotes a vector plot.
action denotes the type of action causing the stress e.g. mxx for bending moment about the x-axis. Note that the action is omitted for stresses caused by the application of all actions.
stresstype denotes the type of stress that is being plotted e.g. zx for the x-component of shear stress.
The examples shown in the methods below are performed on a 150x90x12 UA
(unequal angle) section. The Section
object is created below:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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.
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:
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.
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:
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:
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:
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:
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:
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:
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:
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:
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.
The following example calculates the geometric, warping and plastic properties
of a 50 mm diameter circle. The circle is discretised with 64 points and a mesh
size of 2.5 mm2.
The geometry and mesh are plotted, and the mesh information printed to the terminal
before the analysis is carried out. Detailed time information is printed to the
terminal during the cross-section analysis stage. Once the analysis is complete,
the cross-section properties are printed to the terminal. The centroidal
axis second moments of area and torsion constant are saved to variables and it
is shown that, for a circle, the torsion constant is equal to the sum of the
second moments of area.
Calculate section properties of Nastran HAT1 section.
The following example demonstrates how to create a cross-section defined in
a Nastran-based finite element analysis program. The following creates a
HAT1 cross-section and calculates the geometric, warping and plastic properties.
The HAT1 cross-section is meshed with a maximum elemental area of 0.005.
The geometry and mesh are plotted, and the mesh information printed to the terminal
before the analysis is carried out. Detailed time information is printed to the
terminal during the cross-section analysis stage. Once the analysis is complete,
the cross-section properties are printed to the terminal. The centroidal
axis second moments of area and torsion constant are saved to variables and it
is shown that, for non-circular sections, the torsion constant is not equal to the
sum of the second moments of area.
Create a mesh with a maximum elemental area of 0.005
geometry.create_mesh(mesh_sizes=[0.005])section=Section(geometry,time_info=True)# create a Section objectsection.display_mesh_info()# display the mesh informationsection.plot_mesh()# plot the generated mesh`
Mesh Statistics:
- 2038 nodes
- 926 elements
- 2 regions
<AxesSubplot: title={'center': 'Finite Element Mesh'}>
Perform a geometric, warping and plastic analysis, displaying the time info
Calculate section properties of a user-defined section from points and facets.
The following example demonstrates how geometry objects can be created from a
list of points, facets, holes and control points. An straight angle section with
a plate at its base is created from a list of points and facets. The bottom plate
is assigned a separate control point meaning two discrete regions are created.
Creating separate regions allows the user to control the mesh size in each region
and assign material properties to different regions. The geometry is cleaned to
remove the overlapping facet at the junction of the angle and the plate. A
geometric, warping and plastic analysis is then carried out.
The geometry and mesh are plotted before the analysis is carried out. Once the
analysis is complete, a plot of the various calculated centroids is generated.
Merge two sections together into a single larger section.
The following example demonstrates how to combine multiple geometry objects into
a single geometry object. A 150x100x6 RHS is modelled with a solid 50x50 triangular
section on its top and a 100x100x6 angle section on its right side.
The three geometry objects are combined together as a CompoundGeometry
object using the + operator.
To manipulate individual geometries into the final shape, there are a variety of
methods available to move and align. This example uses .align_center(), .align_to(),
and .shift_section().
The geometry and mesh are plotted, and the mesh information printed to the terminal
before the analysis is carried out. Detailed time information is printed to the
terminal during the cross-section analysis stage. Once the analysis is complete,
the centroids are plotted.
Create a mesh and section. For the mesh, use a mesh size of 2.5 for
the RHS, 5 for the triangle and 3 for the angle.
geometry.create_mesh(mesh_sizes=[2.5,5,3])section=Section(geometry,time_info=True)section.display_mesh_info()# display the mesh informationsection.plot_mesh()# plot the generated mesh
Mesh Statistics:
- 6020 nodes
- 2736 elements
- 3 regions
<AxesSubplot: title={'center': 'Finite Element Mesh'}>
Perform a geometric, warping and plastic analysis, displaying the time info
and the iteration info for the plastic analysis
section.calculate_geometric_properties()section.calculate_warping_properties()section.calculate_plastic_properties(verbose=True)# plot the centroidssection.plot_centroids()
╭───────────────────────────── Geometric Analysis ─────────────────────────────╮
│ │
│ ✅ Geometric analysis ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.7682 s ] │
│ complete │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
/home/docs/checkouts/readthedocs.org/user_builds/sectionproperties/envs/2.1.5/lib/python3.9/site-packages/shapely/set_operations.py:133: RuntimeWarning: invalid value encountered in intersection
return lib.intersection(a, b, **kwargs)
╭────────────────────────────── Warping Analysis ──────────────────────────────╮
│ │
│ ✅ Warping analysis ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 17.0115 s ] │
│ completed │
│ ✅ 6020x6020 stiffness ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 3.7134 s ] │
│ matrix assembled │
│ ✅ Warping function solved ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.3571 s ] │
│ (direct) │
│ ✅ Shear function vectors ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 3.7671 s ] │
│ assembled │
│ ✅ Shear functions solved ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.6567 s ] │
│ (direct) │
│ ✅ Shear and warping ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.4376 s ] │
│ integrals assembled │
│ ✅ Shear deformation ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 3.4618 s ] │
│ coefficients assembled │
│ ✅ Monosymmetry integrals ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.6060 s ] │
│ assembled │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
d = -91.996268369166; f_norm = 1.0
d = 108.003731630834; f_norm = -1.0
d = 8.003731630833997; f_norm = -0.04433903442685115
d = 3.5610941851785247; f_norm = -0.013257745358062492
d = 1.6934563166381202; f_norm = -0.00019149964748535968
d = 1.666207547083575; f_norm = -8.635909458075013e-07
d = 1.6660841169311136; f_norm = -5.6994862781888e-11
d = 1.666082783889055; f_norm = 9.269146437289895e-09
---x-axis plastic centroid calculation converged at 1.66608e+00 in 7 iterations.
d = -67.409490017714; f_norm = 1.0
d = 132.590509982286; f_norm = -1.0
d = 32.590509982285994; f_norm = -0.546379783397773
d = -17.409490017714006; f_norm = 0.22681010830111303
d = -2.742322822682775; f_norm = -0.043022470763644426
d = -5.080875765477266; f_norm = -0.011205909614768165
d = -5.8657449981455345; f_norm = 0.0004252464243683582
d = -5.83704941245604; f_norm = -8.433780157994712e-06
d = -5.837607455591706; f_norm = -6.102942204925805e-09
d = -5.837610874395434; f_norm = 4.552923959027148e-08
---y-axis plastic centroid calculation converged at -5.83761e+00 in 9 iterations.
d = -106.16681282996605; f_norm = -1.0
d = 113.67282241177995; f_norm = 1.0
d = 3.7530047909069424; f_norm = 0.03943689434659865
d = -0.5886438731993531; f_norm = 0.006410315748600418
d = -1.4248809343865285; f_norm = 4.9126448281156184e-05
d = -1.4313306978318274; f_norm = 6.360698932422306e-08
d = -1.431339059474304; f_norm = 6.337318715773886e-13
d = -1.4313402751438338; f_norm = -9.24687090782149e-09
---11-axis plastic centroid calculation converged at -1.43134e+00 in 7 iterations.
d = -96.43010376150612; f_norm = -1.0
d = 93.41518522403122; f_norm = 1.0
d = -1.507459268737449; f_norm = 0.2499934430169193
d = -26.819412050693135; f_norm = -0.5136606142451586
d = -9.793701141307178; f_norm = 0.06969393886809541
d = -12.614043035926347; f_norm = -0.015439988274406884
d = -12.102542542006356; f_norm = 0.0009283409099111105
d = -12.13155264001933; f_norm = 1.1002850184137821e-05
d = -12.131900348758636; f_norm = -1.8901470638209108e-10
d = -12.131893782808461; f_norm = 2.0758839474150476e-07
---22-axis plastic centroid calculation converged at -1.21319e+01 in 9 iterations.
╭────────────────────────────── Plastic Analysis ──────────────────────────────╮
│ │
│ ✅ Plastic analysis complete ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.1618 s ] │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
<AxesSubplot: title={'center': 'Centroids'}>
Total running time of the script: ( 0 minutes 21.523 seconds)
The following example demonstrates how geometry objects can be mirrored and
rotated. A 200PFC and 150PFC are placed back-to-back by using the
mirror_section() method and are
rotated counter-clockwise by 30 degrees by using the
rotate_section() method. The
geometry is cleaned to ensure there are no overlapping facets along the junction
between the two PFCs. A geometric, warping and plastic analysis is then carried out.
The geometry and mesh are plotted, and the mesh information printed to the terminal
before the analysis is carried out. Detailed time information is printed to the
terminal during the cross-section analysis stage and iteration information printed
for the plastic analysis. Once the analysis is complete, a plot of the various
calculated centroids is generated.
Create a mesh and section. For the mesh, use a mesh size of 5 for the 200PFC
and 4 for the 150PFC
geometry.create_mesh(mesh_sizes=[5,4])section=Section(geometry,time_info=True)section.display_mesh_info()# display the mesh informationsection.plot_mesh()# plot the generated mesh
Mesh Statistics:
- 4850 nodes
- 2157 elements
- 2 regions
<AxesSubplot: title={'center': 'Finite Element Mesh'}>
Perform a geometric, warping and plastic analysis, displaying the time info
and the iteration info for the plastic analysis
The following example demonstrates how a stress analysis can be performed on a
cross-section. A 150x100x6 RHS is modelled on its side with a maximum mesh area
of 2 mm2. The pre-requisite geometric and warping analyses are performed
before two separate stress analyses are undertaken. The first combines bending
and shear about the x-axis with a torsion moment and the second combines bending
and shear about the y-axis with a torsion moment.
After the analysis is performed, various plots of the stresses are generated.
The following example demonstrates how to create a composite cross-section by assigning
different material properties to various regions of the mesh. A steel 310UB40.4 is modelled
with a 50Dx600W timber panel placed on its top flange.
The geometry and mesh are plotted, and the mesh information printed to the terminal
before the analysis is carried out. All types of cross-section analyses are carried
out, with an axial force, bending moment and shear force applied during the stress
analysis. Once the analysis is complete, the cross-section properties are printed
to the terminal and a plot of the centroids and cross-section stresses generated.
panel=sections.rectangular_section(d=50,b=600,material=timber)panel=panel.align_center(ub).align_to(ub,on="top")# Create intermediate nodes in panel to match nodes in ubpanel=(panel-ub)|panel
Merge the two sections into one geometry object
section_geometry=CompoundGeometry([ub,panel])
Create a mesh and a Section object. For the mesh use a mesh size of 5 for
the UB, 20 for the panel
section_geometry.create_mesh(mesh_sizes=[5,20])comp_section=Section(section_geometry,time_info=True)comp_section.display_mesh_info()# display the mesh information
Mesh Statistics:
- 9083 nodes
- 4246 elements
- 2 regions
Plot the mesh with coloured materials and a line transparency of 0.6
comp_section.plot_mesh(materials=True,alpha=0.6)
<AxesSubplot: title={'center': 'Finite Element Mesh'}>
Analyse a cross-section to be used in frame analysis.
The following example demonstrates how sectionproperties can be used to
calculate the cross-section properties required for a frame analysis. Using this
method is preferred over executing a geometric and warping analysis as only variables
required for a frame analysis are computed. In this example the torsion constant of
a rectangular section is calculated for a number of different mesh sizes and the
accuracy of the result compared with the time taken to obtain the solution.
mesh_sizes=[3,4,5,10,15,20,25,30,40,50,75,100,200]j_calc=[]# list to store torsion constantst_calc=[]# list to store computation times
Loop through mesh sizes
formesh_sizeinmesh_sizes:geometry.create_mesh(mesh_sizes=[mesh_size])# create meshsection=Section(geometry)# create a Section objectstart_time=time.time()# start timing# calculate the frame properties(_,_,_,_,j,_)=section.calculate_frame_properties()t=time.time()-start_time# stop timingt_calc.append(t)# save the timej_calc.append(j)# save the torsion constant# print the resultstr="Mesh Size: {0}; ".format(mesh_size)str+="Solution Time {0:.5f} s; ".format(t)str+="Torsion Constant: {0:.12e}".format(j)print(str)
Mesh Size: 3; Solution Time 6.62067 s; Torsion Constant: 2.858525191518e+06
Mesh Size: 4; Solution Time 4.81756 s; Torsion Constant: 2.858529348617e+06
Mesh Size: 5; Solution Time 3.83594 s; Torsion Constant: 2.858533994778e+06
Mesh Size: 10; Solution Time 1.87892 s; Torsion Constant: 2.858564308063e+06
Mesh Size: 15; Solution Time 1.20050 s; Torsion Constant: 2.858628499542e+06
Mesh Size: 20; Solution Time 0.88515 s; Torsion Constant: 2.858670496343e+06
Mesh Size: 25; Solution Time 0.71865 s; Torsion Constant: 2.858748138885e+06
Mesh Size: 30; Solution Time 0.59589 s; Torsion Constant: 2.858865014806e+06
Mesh Size: 40; Solution Time 0.45969 s; Torsion Constant: 2.858947255775e+06
Mesh Size: 50; Solution Time 0.38113 s; Torsion Constant: 2.859438375764e+06
Mesh Size: 75; Solution Time 0.24807 s; Torsion Constant: 2.860241467603e+06
Mesh Size: 100; Solution Time 0.17823 s; Torsion Constant: 2.861326245766e+06
Mesh Size: 200; Solution Time 0.09177 s; Torsion Constant: 2.869013885610e+06
Compute the error, assuming that the finest mesh (index 0) gives the ‘correct’ value
The below example creates a 100x6 SHS and plots the geometry, mesh, centroids and torsion vectors
in a 2x2 subplot arrangement.
geometry=steel_sections.rectangular_hollow_section(d=100,b=100,t=6,r_out=15,n_r=8)# Plot the geometryax=geometry.plot_geometry(nrows=2,ncols=2,figsize=(12,7),render=False,labels=[])fig=ax.get_figure()# get the figure# Create a mesh and section object, for the mesh, use a maximum area of 2geometry.create_mesh(mesh_sizes=[2])section=Section(geometry)section.plot_mesh(ax=fig.axes[1],materials=False)# plot the mesh# Perform a geometry and warping analysissection.calculate_geometric_properties()section.calculate_warping_properties()section.plot_centroids(ax=fig.axes[2])# plot the cetnroids# Perform a stress analysis with Mzz = 10 kN.mstress=section.calculate_stress(Mzz=10e6)stress.plot_vector_mzz_zxy(ax=fig.axes[3],title="Torsion Vectors")# plot the torsion vectorsplt.show()# show the plot
Total running time of the script: ( 0 minutes 16.214 seconds)
In this example the convergence of the torsion constant is investigated through an analysis of an
I Section. The mesh is refined both by modifying the mesh size and by specifying the number of
points making up the root radius. The figure below the example code shows that mesh refinement
adjacent to the root radius is a far more efficient method in obtaining fast convergence when
compared to reducing the mesh area size for the entire section.
geometry=steel_sections.i_section(d=203,b=133,t_f=7.8,t_w=5.8,r=8.9,n_r=32)geometry.create_mesh(mesh_sizes=[5])# create meshsection=Section(geometry)# create a Section objectsection.calculate_geometric_properties()section.calculate_warping_properties()j_reference=section.get_j()# get the torsion constant
Run through mesh_sizes with n_r = 8
formesh_sizeinmesh_size_list:geometry=steel_sections.i_section(d=203,b=133,t_f=7.8,t_w=5.8,r=8.9,n_r=8)geometry.create_mesh(mesh_sizes=[mesh_size])# create meshsection=Section(geometry)# create a Section objectsection.calculate_geometric_properties()section.calculate_warping_properties()mesh_elements.append(len(section.elements))mesh_results.append(section.get_j())
Run through n_r with mesh_size = 10
forn_rinnr_list:geometry=steel_sections.i_section(d=203,b=133,t_f=7.8,t_w=5.8,r=8.9,n_r=n_r)geometry.create_mesh(mesh_sizes=[10])# create meshsection=Section(geometry)# create a Section objectsection.calculate_geometric_properties()section.calculate_warping_properties()nr_elements.append(len(section.elements))nr_results.append(section.get_j())
Convert results to a numpy array and compute the error
Plot the variation of the torsion constant with aspect ratio of a rectangle section.
In this example, the aspect ratio of a rectangular section is varied whilst keeping a constant
cross-sectional area and the torsion constant calculated. The variation of the torsion constant
with the aspect ratio is then plotted.
d_list=[]b_list=np.linspace(0.2,1,20)j_list=[]# list holding torsion constant results
Number of elements for each analysis
n=100
Loop through all the widths
forbinb_list:# calculate d assuming area = 1d=1/bd_list.append(d)# compute mesh sizems=d*b/n# perform a warping analysis on rectanglegeometry=sections.rectangular_section(d=d,b=b)geometry.create_mesh(mesh_sizes=[ms])section=Section(geometry)section.calculate_geometric_properties()section.calculate_warping_properties()# get the torsion constantj=section.get_j()print("d/b = {0:.3f}; J = {1:.5e}".format(d/b,j))j_list.append(j)
Symmetric and Unsymmetric Beams in Complex Bending¶
Calculate section properties of two different beams
given in examples from ‘Aircraft Structures,’ by Peery.
These cases have known results, and the output from
sectionproperties can be compared for accuracy. These
examples represent a more rigourous ‘proof’ against a
‘real’ problem. Only results that have values in the
reference material are tested here.
This is a symmetric I-section with no lateral supports,
undergoing pure unidirectional cantilever bending.
Note that units here are inches, to match the text.
We’ll use a very coarse mesh here, to show a conservative
comparison for accuracy. Theoretically, with more
discretization, we would capture the real results more accurately.
<AxesSubplot: title={'center': 'Finite Element Mesh'}>
Perform a geometric analysis on the section, and plot properties
We don’t need warping analysis for these simple checks,
but sectionproperties needs them before evaluating stress.
Next we can extract the max stress from the section, and let’s
go ahead and look at the calculated fringe plot. Refer to the
stress example for details.
Moving on to something a bit more advanced…
This is an unsymmetric Z-section with no lateral supports.
Note that units here are inches, to match the text.
Section properties all look good, so we can move on to
some stress analysis. Before we do, we will need a quick
function to pull stress at a certain point. This is a bit
of a hack! Future versions of sectionproperties will have
a much more robust system for getting stress at an
arbitrary location. This particular function will work for
the locations we need, since we know a node will be there.
fromtypingimportTupledefget_node(nodes,coord)->Tuple[int,tuple]:""" This function will loop over the node list provided, finding the index of the coordinates you want. Returns the index in the nodes list, and the coords. """forindex,varinenumerate(nodes):ifall(var==coord):returnindex,varelse:continueraiseValueError(f"No node found with coordinates: {coord}")
The load applied in the reference is -100,000 in-lbs about the
x-axis, and 10,000 inb-lbs about the y-axis.
stress=section.calculate_stress(Mxx=-1e5,Myy=1e4)
Check stress at location A (see docs page for details)
Approximation of Torsion Constant for Trapezoidal Sections¶
Trapezoidal elements or components of a cross-section are
quite common in bridge structures, either concrete or steel
composite construction. However, it’s common to determine
the torsion constant of the trapezoidal section by using a
rectangular approximation. For example, this is done in
the Autodesk Structural Bridge Design software when there
is a haunch in a Steel Composite Beam
The question then arises, when is it appropriate to make
the rectangular approximation to a trapezoidal section,
and what might the expected error be?
It’s better to collect the relevant section property calculation in a
single function. We are only interested in the torsion constant, so this
is straightforward enough. geom is the Section Property Geometry object;
ms is the mesh size.
The number of elements per unit area is an important input to the calculations
even though we are only examining ratios of the results. A nominal value of 100
is reasonable.
This function accepts the width b and a slope S to create the trapezoid.
Since we are only interested in relative results, the nominal dimensions are
immaterial. There are a few ways to parametrize the problem, but it has been
found that setting the middle height of trapezoid (i.e. the average height)
to a unit value works fine.
The slope S is 0 for a rectangle, and 1 for a triangle and is
defined per the plot below. A range of S, between 0.0 and 1.0 and
a range of b are considered, between 1 and 10 here (but can be extended)
Here we highlight a few of the contours to illustrate the accuracy and behaviour
of the approximation.
As expected, when the section is rectangular, the error is small, but as it increases
towards a triangle the accuracy generally reduces. However, there is an interesting
line at an aspect ratio of about 2.7 where the rectangular approximation is always
equal to the trapezoid’s torsion constant.
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.
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 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 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.
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:
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.
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.
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.
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.
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’
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
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
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’
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.
The following example expands the sides of a rectangle, one point at a time,
to make it a square:
importsectionproperties.pre.library.primitive_sectionsasprimitive_sectionsgeometry=primitive_sections.rectangular_section(d=200,b=150)# Using relative shiftingone_pt_shifted_geom=geometry.shift_points(point_idxs=1,dx=50)# Using absolute relocationboth_pts_shift_geom=one_pt_shift_geom.shift_points(point_idxs=2,abs_x=200)
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).
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.
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.
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)
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.
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.
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.
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’.
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.
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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.
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:
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:
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:
Note that the properties are reported as modulusweighted 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.
Constructs a BAR section with the center at the origin (0, 0), with two parameters
defining dimensions. See Nastran documentation 12345 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:
Constructs a BOX section with the center at the origin (0, 0), with four parameters
defining dimensions. See Nastran documentation 12345 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:
Constructs a BOX1 section with the center at the origin (0, 0), with six parameters
defining dimensions. See Nastran documentation 1234 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:
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 1234 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:
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 1234 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:
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 1234 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:
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 1234 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:
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:
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:
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:
Constructs a H section with the middle web’s middle center at the origin (0, 0), with four
parameters defining dimensions. See Nastran documentation 1234 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:
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 1234 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:
Constructs a HAT1 section with the bottom plate’s bottom center at the origin (0, 0),
with five parameters defining dimensions. See Nastran documentation 1235 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:
Constructs a HEXA (hexagon) section with the center at the origin (0, 0), with three
parameters defining dimensions. See Nastran documentation 1234 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:
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 1234 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:
Constructs a I1 section with the web’s middle center at the origin (0, 0), with four
parameters defining dimensions. See Nastran documentation 1234 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:
Constructs a L section with the intersection’s center at the origin (0, 0), with four
parameters defining dimensions. See Nastran documentation 123 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:
Constructs a circular rod section with the center at the origin (0, 0), with one parameter
defining dimensions. See Nastran documentation 1234 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:
Constructs a T section with the top flange’s middle center at the origin (0, 0), with four
parameters defining dimensions. See Nastran documentation 12345 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:
Constructs a T1 section with the right flange’s middle center at the origin (0, 0), with
four parameters defining dimensions. See Nastran documentation 1234 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:
Constructs a T2 section with the bottom flange’s middle center at the origin (0, 0), with
four parameters defining dimensions. See Nastran documentation 1234 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:
Constructs a circular tube section with the center at the origin (0, 0), with two
parameters defining dimensions. See Nastran documentation 1234 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:
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:
Constructs a Z section with the web’s middle center at the origin (0, 0), with four
parameters defining dimensions. See Nastran documentation 1234 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:
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:
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)
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:
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:
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:
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:
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:
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.
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.
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.
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.
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.
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.
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.
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
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
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.
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:
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.
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:
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:
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.
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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
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.
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
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.
The analysis of homogenous cross-sections is particularly relevant in structural design, in
particular for the design of steel structures, where complex built-up sections are often utilised.
Accurate warping independent properties, such as the second moment of area and section moduli, are
crucial input for structural analysis and stress verification. Warping dependent properties, such
as the Saint-Venant torsion constant and warping constant are essential in the verification of
slender steel structures when lateral-torsional buckling is critical.
Warping independent properties for basic cross-sections are relatively simple to calculate by hand.
However accurate warping independent properties, even for the most basic cross-section, require
solving several boundary value partial differential equations. This necessitates numerical methods
in the calculation of these properties, which can be extended to arbitrary complex sections.
This section of the documentation describes the theory and application of the finite element method
to cross-sectional analysis used by sectionproperties. The goal of sectionproperties is to
perform cross-sectional and stress analysis on arbitrary cross-sections, see below figure. In its
simplest form, an arbitrary cross-section can be defined by a series of points, segments and holes.
Arbitrary cross-section with adopted axis convention.¶
The cross-section is meshed using quadratic superparametric triangular elements (Tri6) using the
triangle library for Python. Superparametric quadratic
elements are defined as having straight edges and mid-nodes located at the mid-point between
adjacent corner nodes. triangle implements
Triangle, which is a two dimensional quality mesh
generator and Delaunay triangulator written by Jonathan Shewchuk in C.
For the calculation of warping independent properties (i.e. area properties), the mesh
quality is not important as superparametric elements have a constant Jacobian and will result in an
exact solution independent of mesh quality. However, this is not the case for the calculation of
warping dependent properties. As a result, mesh quality and refinement is critical and thus the
user is encouraged to ensure an adequate mesh is generated.
Quadratic six noded triangular elements were implemented in sectionproperties in order to utilise
the finite element formulations for calculating section properties. The figure below shows a
generic six noded triangular element. As previously mentioned, sectionproperties implements
superparametric elements, therefore the edges in the below image will always be straight and not
curved.
An isoparametric coordinate system has been used to evaluate the shape functions of the parent
element and map them to a generalised triangular element within the mesh. Three independent
isoparametric coordinates (\(\eta\), \(\xi\), \(\zeta\)) are used to map the six
noded triangular element as shown in the figure below.
Isoparametric coordinates for the two dimensional triangular element.¶
The partial derivatives of the shape functions with respect to the cartesian coordinates, denoted
as the \(\textbf{B}\) matrix, are required in the finite element formulations of various section
properties. Felippa [1] describes the multiplication of the Jacobian matrix (\(\textbf{J}\))
and the partial derivative matrix (\(\textbf{P}\)):
where the derivatives of the shape functions with respect to the isoparametric parameters can
easily be evaluated from the equation for the shape functions, resulting in the following expression
for the \(\textbf{B}\) matrix:
Three different integration schemes are utilised in the cross-section analysis in order to evaluate
the integrals of varying order polynomials. The one point, three point and six point integration
schemes are summarised in the figure below:
Six noded triangle integration schemes with maximum degree of polynomial that is evaluated exactly [1].¶
Bringing together the isoparametric representation of the six noded triangular element and
numerical integration, the integration of a function \(f(\eta, \xi, \zeta)\) proves to be
simpler than integrating the corresponding function \(f(x,y)\) over the cartesian element [2].
The transformation formula for integrals is:
where the sum is taken over the integration points, \(w_i\) is the weight of the current
integration point and \(J_i\) is the Jacobian at the current integration point (recall that the
Jacobian is constant for the superparametric six noded triangular element).
The most optimal location to sample stresses are at the integration points, however the results are
generally plotted using nodal values. As a result, the stresses at the integration points need to
be extrapolated to the nodes of the element. The extrapolated stresses at the nodes
(\(\tilde{\boldsymbol{\sigma}}_g\)) can be calculated through the multiplication of a smoothing
matrix (\(\textbf{H}\)) and the stresses at the integration points
(\(\boldsymbol{\sigma}_g\)) [2]:
As described in the calculation of the Torsion Constant and Shear Properties, partial differential
equations are to be solved with purely Neumann boundary conditions. In the context of the torsion
and shear problem, this involves the inversion of a nearly singular global stiffness matrix. After
shifting the domain such that the centroid coincides with the global origin, the Lagrangian
multiplier method is used to solve the set of linear equations of the form
\(\textbf{K} \textbf{u} = \textbf{F}\) by introducing an extra constraint on the solution
vector whereby the mean value is equal to zero. Larson et. al [3] describe the resulting modified
stiffness matrix, and solution and load vector:
where \(\textbf{C}\) is a row vector of ones and \(\lambda\) may be though of as a force
acting to enforce the constraints, which should be relatively small when compared to the values in
the force vector and can be omitted from the solution vector.
As the Jacobian is constant over the element, the integration over the element domain in the above
equation can be performed using one point integration:
\[\begin{split}Q_x &= \int_A y \, dA = \sum_e \int_{\Omega} \textbf{N} \textbf{y}_e J_e \, d\eta \, d\xi \, d\zeta \\
Q_y &= \int_A x \, dA = \sum_e \int_{\Omega} \textbf{N} \textbf{x}_e J_e \, d\eta \, d\xi \, d\zeta \\\end{split}\]
where \(\textbf{x}_e\) and \(\textbf{y}_e\) are column vectors containing the cartesian
coordinates of the element nodes. The above equations can be evaluated using three point
integration as the shape functions (\(\textbf{N}\)) are quadratic:
The above equations list the second moments of area about the global coordinate system axis, which
is chosen arbitrarily by the user. These properties can be found about the centroidal axis of the
cross-section by using the parallel axis theorem:
The elastic section modulii can be calculated from the second moments of area and the extreme (min.
and max.) coordinates of the cross-section in the x and y-directions [2]:
For a homogenous section, the plastic centroid can be determined by finding the intersection of
the two lines that evenly divide the cross-sectional area in both the \(x\) and \(y\)
directions. A suitable procedure could not be found in literature and thus an algorithm involving
the iterative incrementation of the plastic centroid was developed. The algorithm uses
Brent’s method
to efficiently locate the plastic centroidal axes in the global and principal directions.
Once the plastic centroid has been located, the plastic section moduli can be readily computed
using the following expression:
where \(A\) is the cross-sectional area, and \(x_{c,t}\) and \(x_{c,b}\) refer to the
centroids of the top half section and bottom half section respectively.
The prinicpal section moduli require the calculation of the perpendicular distance from the
principal axes to the extreme fibres. All the nodes in the mesh are considered with vector algebra
used to compute the perpendicular distances and the minimum and maximum distances identified. The
perpendicular distance from a point \(P\) to a line parallel to \(\overrightarrow{u}\) that
passes through \(Q\) is given by:
The location of the point is checked to see whether it is above or below the principal axis. Again
vector algebra is used to check this condition. The condition in the below equation will result in
the point being above the \(\overrightarrow{u}\) axis.
The Saint-Venant torsion constant (\(J\)) can be obtained by solving the below partial
differential equation for the warping function, \(\omega\):
\[\nabla^2 \omega = 0\]
subject to the boundary condition described below:
\[\frac{\partial \omega}{\partial x} n_x + \frac{\partial \omega}{\partial y} n_y = y n_x - x n_y\]
Pilkey [2] shows that by using the finite element method, this problem can be reduced to a set of
linear equations of the form:
\[\textbf{K} \boldsymbol{\omega} = \textbf{F}\]
where \(\textbf{K}\) and \(\textbf{F}\) are assembled through summation at element level.
The element equations for the \(e^{\textrm{th}}\) element are:
The shear behaviour of the cross-section can be described by Saint-Venant’s elasticity solution for
a homogenous prismatic beam subjected to transverse shear loads [2]. Through cross-section
equilibrium and linear-elasticity, an expression for the shear stresses resulting from a transverse
shear load can be derived. Pilkey [2] explains that this is best done through the introduction of
shear functions, \(\Psi\) and \(\Phi\), which describe the distribution of shear stress
within a cross-section resulting from an applied transverse load in the \(x\) and \(y\)
directions respectively. These shear functions can be obtained by solving the following uncoupled
partial differential equations:
\[\begin{split}\nabla^2 \Psi &= 2(I_{\overline{xy}} y - I_{\overline{xx}} x) \\
\nabla^2 \Phi &= 2(I_{\overline{xy}} x - I_{\overline{yy}} y)\end{split}\]
Pilkey [2] shows that the shear equations subject to the boundary conditions can be solved using
the finite element method. This results in a set of linear equations at element level of the form:
The shear centre can be computed consistently based on elasticity, or through Trefftz’s definition,
which is based on thin-wall assumptions [2].
Elasticity: Pilkey [2] demonstrates that the coordinates of the shear centre are given by the following
expressions:
\[\begin{split}x_s &= \frac{1}{\Delta_s} \left[ \frac{\nu}{2} \int_{\Omega} (I_{\overline{yy}} x + I_{\overline{xy}} y)\left(x^2+y^2 \right) \, d \Omega - \int_{\Omega} \textbf{g} \cdot \boldsymbol{\nabla \Phi} \, d \Omega\right] \\
y_s &= \frac{1}{\Delta_s} \left[ \frac{\nu}{2} \int_{\Omega} (I_{\overline{xx}} y + I_{\overline{xy}} x)\left(x^2+y^2 \right) \, d \Omega + \int_{\Omega} \textbf{g} \cdot \boldsymbol{\nabla \Psi} \, d \Omega\right] \\\end{split}\]
where:
\[\begin{split}\Delta_s &= 2 (1 + \nu)(I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2) \\
\textbf{g} &= y \textbf{i} - x \textbf{j}\end{split}\]
The first integral in shear centre equations can be evaluated using quadrature for each element.
The second integral can be simplified once the shear functions, \(\Psi\) and \(\Phi\),
have been obtained:
where \(\textbf{F}\) is the global load vector determined for the torsion problem in
Torsion Constant. The resulting expression for the shear centre therefore becomes:
The shear deformation coefficients are used to calculate the shear area of the section as a result
of transverse loading. The shear area is defined as \(A_s = k_s A\). Pilkey [2] describes the
finite element formulation used to determine the shear deformation coefficients:
where the shear areas are related to \(\kappa_x\) and \(\kappa_y\) by:
\[\begin{split}k_{s,x} A &= \frac{{\Delta_s}^2}{\kappa_x} \\
k_{s,y} A &= \frac{{\Delta_s}^2}{\kappa_y} \\
k_{s,xy} A &= \frac{{\Delta_s}^2}{\kappa_{xy}} \\\end{split}\]
The finite element formulation of the shear deformation coefficients is described below:
The monosymmetry constants are used to evaluate buckling in sections with unequal flanges. The
constants are calculated in accordance with the formula provided is AS4100-1998 [4]:
Cross-section stresses resulting from an axial force, bending moments, a torsion moment and shear
forces, can be evaluated at the integration points within each element. Extrapolation to Nodes
describes the process of extrapolating the stresses to the element nodes and the combination of the
results with the adjacent elements through nodal averaging.
For a cross section subjected to axial force, shear in the \(x\) and \(y\) axes which are
perpendicular to the centroidal (\(z\)) axis, and moments about all three axes, there are no
axial stresses in the \(x\) or \(y\) axes, and so the stress tensor is given by:
and of course the complementary shear stresses are equal, \(\tau_{zx}=\tau_{xz}\),
\(\tau_{zy}=\tau_{yz}\).
By definition, the principal stresses are those for which the stress tensor becomes a diagonal
matrix through a coordinate transformation. Since this is the basic eigenvalue problem, the
principal stresses are then given by:
Pilkey [2] explains that composite cross-sections can be analysed using a modulus-weighted approach
in which the differential area element is multiplied by the elastic modulus for the element,
\(E_e\):
\[d \widetilde{A} = E_e \, dA\]
The expression for section properties after the application of numerical integration then becomes:
Pilkey [2] also notes that an assumption of the elastic cross-sectional analysis of warping and
shear is that:
\[\sigma_x = \sigma_y = \tau_{xy} = 0\]
However, for composite sections with variable Poisson’s ratios, this assumption does not hold.
Pilkey [2] does mention that engineering materials often have very similar Poisson’s ratios and
therefore the difference can be negligible.
Note
If the Poisson’s ratio of two materials used in a composite analysis are vastly different, the
assumptions used in sectionproperties may not hold, see Chapter 5 & 6 of [2].
For the warping and shear analysis of composite cross-sections, sectionproperties defines an area
based on an effective Poisson’s ratio that is used to calculate the relevant properties described
above:
Felippa, Introduction to Finite Element Methods, Department of Aerospace Engineering Sciences and Center for Aerospace Structures University of Colorado, Boulder, Colorado, 2004.
Pilkey, Analysis and Design of Elastic Beams: Computational Methods, John Wiley & Sons, Inc., New York, 2002.
Larson, F. Bengzon, The Finite Element Method: Theory, Implementation, and Applications, Vol. 10, Springer, Berlin, Heidelberg, 2013. doi:10.1007/978-3-642-33287-6.
AS 4100 - 1998: Steel Structures. (1998, June). Standards Australia.
Oñate, E. (2009), Structural Analysis with the Finite Element Method. Linear Statics. Volume 1: The Basis and Solids, Springer Netherlands
sectionproperties has a (slowly) growing suite of tests. The testing suite
serves to verify functionality and find exceptions from edge cases, but
also validate the results against known cases. Since this library performs
engineering calculations, it should have some manner of proving its accuracy.
Each analyst who uses it is responsible for their own projects
and calculations, but having a high level of confidence that the software
can produce correct results, given the correct inputs, is a boon to all users.
Some test results and explanations from the latter category will be outlined
on this page, since the former really serves no use to the end user.
An obvious starting location is replicating examples from academic texts.
“Aircraft Structures” by David J. Peery is a highly regarded text in the
field of aerospace structures 1.
The simplest example of a realistic section problem is the symmetric I-Beam,
with a free-fixed boundary condition and a transverse tip load. The
free-body-diagram and shear and moment diagrams are shown in the problem
statement, referenced below. This problem is Example 1 in Section 6.2.
In sectionproperties, there are multiple ways to set this problem up. We could
different shapely geometries and merge together, or a set of custom points,
or a built-in constructor. For the sake of simplicity, this simpler I-section
is identical to the Nastran I-section definition, so it makes sense to utilize
the built-in constructor from pre.library.nastran_sections.nastran_i.
Using an arbitrarily coarse mesh, the properties can then be directly calculated
from the class method Section.calculate_geomtric_properties().
Peery lists the second moment of area about the primary bending axis as a value
of \(43.3 [in^4]\). For the automated tests in this library, we check against
this hardcoded value, with a tolerance of \(\pm 0.1%\).
As a final check against this example, we can calculate the maximum bending
stress on the I-beam. From simple statics, the maximum moment from the FBD
will be \(800,000 [in-lbs]\) at the fixed end. Applying this moment to our
section from before will allow computation of stress over the FEM.
Peery quotes the peak value at \(55.5 [ksi]\), which is rounded to the nearest
decimal place. From the equatio listed in the text, the theoretical value is
actually \(55,427.3 [psi]\).
\[f = \frac{My}{I} = 55,427.3 = 55,400\]
Again, the automated test against this checks the hardcoded value with a
tolerance of \(\pm 0.1%\). For accuracy, 55,427.3 is used instead of the
rounded value.
For full details and the most updated code of this exampe, see the
examples page
in the documentation gallery. For the exact test code execution, check the
source.
For a more complex example, we can turn to Example 1 in Section 7.2 of Peery.
Here, we have a still-simplified Z-section, but bending about two axes. Note
axes definitions in the problem statement. Beam axial direction in
sectionproperties is always referenced as the z-axis, and loads must be applied
in this coordinate system.
The construction of this geometry takes a similar approach to Ex 6.2.1, and
utilizes a built-in factory: pre.library.nastran_sections.nastran_zed.
The only difference you may notice in the test code is usage of a custom class
for ease of initialization. This is not necessary.
Using an arbitrarily coarse mesh, the properties can then be directly calculated
from the class method Section.calculate_geomtric_properties(). Each property
listed directly by Peery is taken as a hardcoded value and checked against,
within the testing suite.
Property
Peery Value
I_x
693.3 [in4]
I_y
173.3 [in4]
I_xy
-240 [in4]
I_p
787.1 [in4]
I_q
79.5 [in4]
theta
21.35 [deg]
For stress results, the theoretical values follow the biaxial bending equation.
These values are checked against automatically in the testing suite. Note that
again Peery rounds the values quoted directly, for simplicity. The testing suite
also verifies that the theoretical value as per the equation matches the
theoretical value quoted in the text, which also matches the computed value from
the sectionproperties FEM.
For full details and the most updated code of this example, see the
examples page
in the documentation gallery. For the exact test code execution, check the
source.
D. J. Peery, Aircraft Structures. New York: Dover Publications, 2011.
ISBN-10: 0-486-48580-3
Here’s a quick example that harnesses some of the power of sectionproperties and shows its simplicity:
importsectionproperties.pre.library.steel_sectionsassteel_sectionsfromsectionproperties.analysis.sectionimportSection# create geometry of the cross-sectiongeometry=steel_sections.i_section(d=203,b=133,t_f=7.8,t_w=5.8,r=8.9,n_r=8)# generate a finite element meshgeometry.create_mesh(mesh_sizes=[10])# create a Section object for analysissection=Section(geometry)# calculate various cross-section propertiessection.calculate_geometric_properties()section.calculate_warping_properties()# print some of the calculated section propertiesprint(section.get_area())# cross-section area>>>3231.80print(section.get_ic())# second moments of area about the centroidal axis>>>(23544664.29,3063383.07,0.00)print(section.get_j())# torsion constant>>>62954.43print(section.get_As())# shear areas in the x & y directions>>>(1842.24,1120.19)
Raise an issue on the GitHub issue tracker or contact me at
robbie.vanleeuwen@gmail.com. If you have a request for a
feature to be added to the sectionproperties package, please don’t hesitate to get in touch