Note
Click here to download the full example code
Creating a Built-Up Section¶
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.
# sphinx_gallery_thumbnail_number = 1
import sectionproperties.pre.library.steel_sections as steel_sections
from sectionproperties.pre.geometry import Geometry
from sectionproperties.analysis.section import Section
Create a 150x100x6 RHS
rhs = steel_sections.rectangular_hollow_section(d=150, b=100, t=6, r_out=15, n_r=8)
Create a triangular section from points, facets, and control points
points = [[0, 0], [50, 0], [25, 50]]
facets = [[0, 1], [1, 2], [2, 0]]
control_points = [[25, 25]]
triangle = Geometry.from_points(points, facets, control_points)
triangle = triangle.align_center(rhs).align_to(rhs, on="top")
Create a 100x100x6 angle and position it on the right of the RHS
angle = steel_sections.angle_section(d=100, b=100, t=6, r_r=8, r_t=5, n_r=8)
angle = angle.shift_section(x_offset=100, y_offset=25)
Combine the sections into a CompoundGeometry with + operator
geometry = rhs + triangle + angle
geometry.plot_geometry() # plot the geometry
<AxesSubplot: title={'center': 'Cross-Section Geometry'}>
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 information
section.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 centroids
section.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)