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

# %%
# 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

# %%
# 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()
Example #2
0
# %%
# Perform a geometric, warping and plastic analysis
comp_section.calculate_geometric_properties()
comp_section.calculate_warping_properties()
comp_section.calculate_plastic_properties(verbose=True)

# %%
# Perform a stress analysis with N = 100 kN, Mxx = 120 kN.m and Vy = 75 kN
stress_post = comp_section.calculate_stress(N=-100e3, Mxx=-120e6, Vy=-75e3)

# %%
# Print the results to the terminal
comp_section.display_results()

# %%
# Plot the centroids
comp_section.plot_centroids()

# %%
# Plot the axial stress
stress_post.plot_stress_n_zz(pause=False)

# %%
# Plot the bending stress
stress_post.plot_stress_m_zz(pause=False)

# %%
# Plot the shear stress
stress_post.plot_stress_v_zxy()
# %%
# Load a geometry with a single region from a dxf file
geom = Geometry.from_dxf(dxf_filepath="files/section_holes.dxf")
geom.plot_geometry()

# %%
# Generate a mesh
geom.create_mesh([1])
sec = Section(geom)
sec.plot_mesh(materials=False)

# %%
# Conduct a geometric & plastic analysis
sec.calculate_geometric_properties()
sec.calculate_plastic_properties()
sec.plot_centroids()

# %%
# Display the geometric & plastic properties
sec.display_results()

# %%
# Load a geometry with multiple holes from a dxf file
geom = Geometry.from_dxf(dxf_filepath="files/section_holes_complex.dxf")
geom.plot_geometry()

# %%
# Generate a mesh
geom.create_mesh([1])
sec = Section(geom)
sec.plot_mesh(materials=False)
# 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 geometry
ax = 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 2
geometry.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 analysis
section.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.m
stress = section.calculate_stress(Mzz=10e6)
stress.plot_vector_mzz_zxy(ax=fig.axes[3],
                           title="Torsion Vectors")  # plot the torsion vectors
plt.show()  # show the plot