Mirroring and Rotating Geometry

Mirror and rotate a cross section.

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.

# sphinx_gallery_thumbnail_number = 1

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

Create a 200PFC and a 150PFC

pfc1 = steel_sections.channel_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
pfc2 = steel_sections.channel_section(
    d=150, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8
).shift_section(0, 26.5)

Mirror the 200 PFC about the y-axis

pfc1 = pfc1.mirror_section(axis="y", mirror_point=[0, 0])

Merge the pfc sections

geometry = ((pfc1 - pfc2) | pfc1) + pfc2

Rotate the geometry counter-clockwise by 30 degrees

geometry = geometry.rotate_section(angle=30)
geometry.plot_geometry()
Cross-Section Geometry
<AxesSubplot: title={'center': 'Cross-Section Geometry'}>

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 information
section.plot_mesh()  # plot the generated mesh
Finite Element 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

section.calculate_geometric_properties()
section.calculate_warping_properties()
section.calculate_plastic_properties(verbose=True)

section.plot_centroids()
Centroids
╭───────────────────────────── Geometric Analysis ─────────────────────────────╮
│                                                                              │
│   ✅ Geometric analysis        ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.1727 s ] │
│   complete                                                                   │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────── Warping Analysis ──────────────────────────────╮
│                                                                              │
│   ✅ Warping analysis         ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 13.6499 s ] │
│   completed                                                                  │
│   ✅ 4850x4850 stiffness      ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.8322 s ]  │
│   matrix assembled                                                           │
│   ✅ Warping function solved  ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.4012 s ]  │
│   (direct)                                                                   │
│   ✅ Shear function vectors   ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.9431 s ]  │
│   assembled                                                                  │
│   ✅ Shear functions solved   ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.7427 s ]  │
│   (direct)                                                                   │
│   ✅ Shear and warping        ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 1.9260 s ]  │
│   integrals assembled                                                        │
│   ✅ Shear deformation        ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.7342 s ]  │
│   coefficients assembled                                                     │
│   ✅ Monosymmetry integrals   ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 2.0610 s ]  │
│   assembled                                                                  │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
d = -154.328341319365; f_norm = 1.0
d = 131.525142448589; f_norm = -1.0
d = -11.401599435387993; f_norm = 0.13458389687111885
d = 5.55231463203793; f_norm = -0.021090896125661042
d = 3.255390167671628; f_norm = -0.004055963678927537
d = 2.724499194243151; f_norm = 0.00045100079082289346
d = 2.7776241413031926; f_norm = -9.631031333251518e-06
d = 2.7765133886258857; f_norm = -2.1922919066993703e-08
d = 2.7765108545970905; f_norm = 5.977503270512459e-15
---x-axis plastic centroid calculation converged at 2.77651e+00 in 8 iterations.
d = -165.804528212969; f_norm = 1.0
d = 152.808229193691; f_norm = -1.0
d = -6.498149509638978; f_norm = 0.12894151075699403
d = 11.696951784368366; f_norm = -0.11748181846161726
d = 3.0224744372298193; f_norm = -5.230315361698405e-16
d = 3.022472425992601; f_norm = 2.7238961090721597e-08
---y-axis plastic centroid calculation converged at 3.02247e+00 in 5 iterations.
d = -101.49999999999997; f_norm = -1.0
d = 101.50000000000105; f_norm = 1.0
d = 5.400124791776761e-13; f_norm = 4.10953349847732e-15
d = -4.999994599877908e-07; f_norm = -1.905973318172039e-09
---11-axis plastic centroid calculation converged at 5.40012e-13 in 3 iterations.
d = -133.14647432951313; f_norm = -1.0
d = 132.8535256704871; f_norm = 1.0
d = -0.14647432951301198; f_norm = -0.05050838948742143
d = 6.248158849099496; f_norm = 0.3421731433506338
d = 0.6760309227208605; f_norm = 0.004360272672365583
d = 0.6106685276300443; f_norm = -3.810658334951715e-15
d = 0.6106693329643081; f_norm = 5.372319469831614e-08
---22-axis plastic centroid calculation converged at 6.10669e-01 in 6 iterations.
╭────────────────────────────── Plastic Analysis ──────────────────────────────╮
│                                                                              │
│   ✅ Plastic analysis complete ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.1037 s ] │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

<AxesSubplot: title={'center': 'Centroids'}>

Total running time of the script: ( 0 minutes 17.261 seconds)

Gallery generated by Sphinx-Gallery