def get_section_j(geom, ms, plot_geom=False):
    geom.create_mesh(mesh_sizes=[ms])
    section = Section(geom)
    if plot_geom:
        section.plot_mesh()
    section.calculate_geometric_properties()
    section.calculate_warping_properties()
    return section.get_j()
# %%
# 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()
import sectionproperties.pre.library.primitive_sections as sections
from sectionproperties.analysis.section import Section

# %%
# Create a 50 diameter circle discretised by 64 points
geometry = sections.circular_section(d=50, n=64)
geometry.plot_geometry()

# %%
# Create a mesh with a mesh size of 2.5 and display information about it
geometry.create_mesh(mesh_sizes=[2.5])

section = Section(geometry, time_info=True)
section.display_mesh_info()
section.plot_mesh()

# %%
# perform a geometric, warping and plastic analysis, displaying the time info
section.calculate_geometric_properties()
section.calculate_warping_properties()
section.calculate_plastic_properties()

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

# %%
# Get and print the second moments of area and the torsion constant
(ixx_c, iyy_c, ixy_c) = section.get_ic()
j = section.get_j()
# sphinx_gallery_thumbnail_number = 8

from sectionproperties.pre.geometry import Geometry, CompoundGeometry
from sectionproperties.analysis.section import Section

# %%
# 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()
示例#5
0
panel = (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

# %%
# Plot the mesh with coloured materials and a line transparency of 0.6
comp_section.plot_mesh(materials=True, alpha=0.6)

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