Skip to content

Commit 67d6b90

Browse files
JWock82JWock82
authored andcommitted
Merge branch 'DKMQ' of https://github.com/JWock82/PyNite into DKMQ
2 parents a8ad859 + 98e3444 commit 67d6b90

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+635
-635
lines changed

Examples/Beam on Elastic Foundation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@
7474
renderer.render_model()
7575

7676
# Find and print the largest displacement
77-
d_min = boef.Members['M1'].min_deflection('dy')
77+
d_min = boef.members['M1'].min_deflection('dy')
7878
print('Minimum deflection: ', round(d_min, 4), 'in')
7979

8080
# Alternatively the line below could be used to get the largest nodal displacement in the model
8181
# It will be slightly less since there is no node at the midpoint of the member.
82-
# d_min = min([node.DY['Combo 1'] for node in boef.Nodes.values()])
82+
# d_min = min([node.DY['Combo 1'] for node in boef.nodes.values()])
8383

8484
# Find and print the minimum moment
85-
M_min = boef.Members['M1'].min_moment('Mz')
86-
M_max = boef.Members['M1'].max_moment('Mz')
85+
M_min = boef.members['M1'].min_moment('Mz')
86+
M_max = boef.members['M1'].max_moment('Mz')
8787
print('Minimum moment: ', round(M_min), 'k-in')
8888
print('Maximum moment: ', round(M_max), 'k-in')

Examples/Braced Frame - Spring Supported.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,5 @@
143143

144144
# We should see upward displacement at N1 and downward displacement at N4 if
145145
# our springs worked correctly
146-
print('N1 displacement in Y =', braced_frame.Nodes['N1'].DY['1.2D+1.0W'])
147-
print('N4 displacement in Y =', braced_frame.Nodes['N4'].DY['1.2D+1.0W'])
146+
print('N1 displacement in Y =', braced_frame.nodes['N1'].DY['1.2D+1.0W'])
147+
print('N4 displacement in Y =', braced_frame.nodes['N4'].DY['1.2D+1.0W'])

Examples/Braced Frame - Tension Only.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@
122122
# Plot the axial load diagrams for the braces. We should see no compression on
123123
# 'Brace2' and 64 kips on 'Brace1' if the tension-only analysis worked
124124
# correctly.
125-
braced_frame.Members['Brace1'].plot_axial(combo_name='1.2D+1.0W')
126-
braced_frame.Members['Brace2'].plot_axial(combo_name='1.2D+1.0W')
125+
braced_frame.members['Brace1'].plot_axial(combo_name='1.2D+1.0W')
126+
braced_frame.members['Brace2'].plot_axial(combo_name='1.2D+1.0W')
127127

128128
# Report the frame reactions for the load combination '1.2D+1.0W'. We should
129129
# see a -50 kip horizontal reaction at node 'N1', and a zero kip reaction at
130130
# node 'N4' if the tension-only analysis worked correctly. Similarly, we
131131
print('1.2D+1.0W: N1 reaction FY =',
132-
'{:.3f}'.format(braced_frame.Nodes['N1'].RxnFY['1.2D+1.0W']), 'kip')
132+
'{:.3f}'.format(braced_frame.nodes['N1'].RxnFY['1.2D+1.0W']), 'kip')
133133
print('1.2D+1.0W: N1 reaction FX =',
134-
'{:.3f}'.format(braced_frame.Nodes['N1'].RxnFX['1.2D+1.0W']), 'kip')
134+
'{:.3f}'.format(braced_frame.nodes['N1'].RxnFX['1.2D+1.0W']), 'kip')
135135
print('1.2D+1.0W: N4 reaction FY =',
136-
'{:.3f}'.format(braced_frame.Nodes['N4'].RxnFY['1.2D+1.0W']), 'kip')
136+
'{:.3f}'.format(braced_frame.nodes['N4'].RxnFY['1.2D+1.0W']), 'kip')
137137
print('1.2D+1.0W: N4 reaction FX =',
138-
'{:.3f}'.format(braced_frame.Nodes['N4'].RxnFX['1.2D+1.0W']), 'kip')
138+
'{:.3f}'.format(braced_frame.nodes['N4'].RxnFX['1.2D+1.0W']), 'kip')

Examples/Circular Bin with Conical Hopper.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929

3030
# Generate the mesh. The mesh would automatically be generated during analysis, but we want to
3131
# manipulate it now so we'll generate it in advance.
32-
model.Meshes['MSH1'].generate()
32+
model.meshes['MSH1'].generate()
3333

3434
# Determine how many elements make up the circumference at the top of the hopper. This will
3535
# determine the number of elements making up the circumference of the cylindrical shell.
36-
n_hopper = model.Meshes['MSH1'].num_quads_outer
36+
n_hopper = model.meshes['MSH1'].num_quads_outer
3737

3838
# Find an unused node and element name to start the cylinder off with
39-
first_node = 'N' + str(len(model.Nodes.values()) + 1)
40-
first_element = 'Q' + str(len(model.Quads.values()) + 1)
39+
first_node = 'N' + str(len(model.nodes.values()) + 1)
40+
first_element = 'Q' + str(len(model.quads.values()) + 1)
4141

4242
# Add the cylindrical shell mesh
4343
model.add_cylinder_mesh('MSH2', mesh_size, r_shell, h_shell, t, 'Steel', kx_mod, ky_mod, center,
@@ -51,12 +51,12 @@
5151
# cProfile.run('model.merge_duplicate_nodes()', sort='cumtime')
5252

5353
# Add hydrostatic pressure to each element in the model
54-
for element in model.Quads.values():
54+
for element in model.quads.values():
5555
Yavg = (element.i_node.Y + element.j_node.Y + element.m_node.Y + element.n_node.Y)/4
5656
model.add_quad_surface_pressure(element.name, 62.4*(h_shell - Yavg), case='Hydrostatic')
5757

5858
# Add supports at the springline
59-
for node in model.Nodes.values():
59+
for node in model.nodes.values():
6060
if round(node.Y, 10) == 0:
6161
model.def_support(node.name, True, True, True, False, False, False)
6262

Examples/Moment Frame - Lateral Load.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@
7373
Visualization.render_model(MomentFrame, annotation_size=5, deformed_shape=True, deformed_scale=50, combo_name='1.2D+1.0W')
7474

7575
# Plot the moment diagram for the beam
76-
MomentFrame.Members['Beam'].plot_moment('Mz', combo_name='1.2D+1.0W')
76+
MomentFrame.members['Beam'].plot_moment('Mz', combo_name='1.2D+1.0W')
7777

7878
# Plot the deflection of the column
79-
MomentFrame.Members['Col1'].plot_deflection('dy', combo_name='1.2D+1.0W')
79+
MomentFrame.members['Col1'].plot_deflection('dy', combo_name='1.2D+1.0W')
8080

8181
# Find the maximum shear in the first column
82-
print('Column Shear Force:', MomentFrame.Members['Col1'].max_shear('Fy', combo_name='1.2D+1.0W'), 'kip')
82+
print('Column Shear Force:', MomentFrame.members['Col1'].max_shear('Fy', combo_name='1.2D+1.0W'), 'kip')
8383

8484
# Find the frame lateral drift
8585
# Note that the deflections are stored as a dictionary in the node object by load combination, so [] are used instead of () below
86-
print('Frame Lateral Drift:', MomentFrame.Nodes['N2'].DX['1.2D+1.0W'], 'in')
86+
print('Frame Lateral Drift:', MomentFrame.nodes['N2'].DX['1.2D+1.0W'], 'in')
8787

8888
# Find the maximum uplift reaction
89-
print('Left Support Y Reaction:', MomentFrame.Nodes['N1'].RxnFY['0.9D+1.0W'], 'kip')
89+
print('Left Support Y Reaction:', MomentFrame.nodes['N1'].RxnFY['0.9D+1.0W'], 'kip')

Examples/P-Delta Analysis.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
renderer.render_model()
4848

4949
# The moment at the base of the column
50-
calculated_moment = cantilever.Nodes['N1'].RxnMZ['Combo 1']
51-
calculated_moment2 = cantilever.Members['M1'].plot_moment('Mz', 'Combo 1', 100)
50+
calculated_moment = cantilever.nodes['N1'].RxnMZ['Combo 1']
51+
calculated_moment2 = cantilever.members['M1'].plot_moment('Mz', 'Combo 1', 100)
5252

5353
# the deflection at the top of the column
54-
calculated_displacement = cantilever.Nodes['N6'].DX['Combo 1']*12
54+
calculated_displacement = cantilever.nodes['N6'].DX['Combo 1']*12
5555

5656
# Calculate the AISC benchmark problem solution:
5757
alpha = (P*L**2/(E*I))**0.5

Examples/Rectangular Plate Bending - Qauds.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
# PyNite automatically generates each mesh when it analyzes. Sometimes it's convenient to generate
3131
# the nodes and elements in the mesh in advance so that we can manipulate the mesh prior to
3232
# analysis.
33-
model.Meshes['MSH1'].generate()
33+
model.meshes['MSH1'].generate()
3434

3535
# Step through each quadrilateral in the model
36-
for element in model.Quads.values():
36+
for element in model.quads.values():
3737
# Add loads to the element
3838
model.add_quad_surface_pressure(element.name, load, case='W')
3939

4040
# Add fully fixed supports on all side of the wall
41-
for node in model.Nodes.values():
41+
for node in model.nodes.values():
4242
if (round(node.Y, 10) == 0 or round(node.Y, 10) == height or round(node.X, 10) == 0 or
4343
round(node.X, 10) == width):
4444
model.def_support(node.name, True, True, True, True, True, True)
@@ -97,7 +97,7 @@
9797
# the maximum moment.
9898

9999
# Get the force vector for quad 101 for load combination '1.0W'
100-
f_vector = model.Quads['Q101'].f('1.0W')
100+
f_vector = model.quads['Q101'].f('1.0W')
101101

102102
# The DKMQ element's force vector is arranged as follows:
103103
# ************************************************************************************************************************************************************
@@ -113,7 +113,7 @@
113113
Mx = f_vector[4, 0]
114114

115115
# We can find the max My moment similarly from quad 6
116-
f_vector_11 = model.Quads['Q6'].f('1.0W')
116+
f_vector_11 = model.quads['Q6'].f('1.0W')
117117
My= f_vector_11[3, 0]
118118

119119
# Now we'll convert these values to a force per unit length. The height and width of the plate is

Examples/Rectangular Tank Wall - Hydrostatic Loads.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737

3838
# Generate the mesh prior to analysis. This step is optional, but it allows you to work with it to
3939
# it before analyzing.
40-
model.Meshes['MSH1'].generate()
40+
model.meshes['MSH1'].generate()
4141

4242
# Step through each quadrilateral and rectangular plate in the model
43-
for element in list(model.Quads.values()) + list(model.Plates.values()):
43+
for element in list(model.quads.values()) + list(model.plates.values()):
4444

4545
# Calculate the average elevation of the element based on the positions of its nodes
4646
Yavg = (element.i_node.Y + element.j_node.Y + element.m_node.Y + element.n_node.Y)/4
@@ -49,13 +49,13 @@
4949
if Yavg < HL:
5050

5151
# Add hydrostatic loads to the element
52-
if model.Meshes['MSH1'].element_type == 'Rect':
52+
if model.meshes['MSH1'].element_type == 'Rect':
5353
model.add_plate_surface_pressure(element.name, 62.4*(HL - Yavg), case='F')
5454
else:
5555
model.add_quad_surface_pressure(element.name, 62.4*(HL - Yavg), case='F')
5656

5757
# Add fully fixed supports at left, right, and bottom of the wall
58-
for node in model.Nodes.values():
58+
for node in model.nodes.values():
5959
if round(node.Y, 10) == 0 or round(node.X, 10) == 0 or round(node.X, 10) == width:
6060
model.def_support(node.name, True, True, True, True, True, True)
6161

@@ -103,5 +103,5 @@
103103
# Print the maximum and minumum displacements
104104
D = E*t**3/(12*(1-nu**2))
105105
d = 0.00069*qo*a**4/D
106-
print('Max displacement: ', max([node.DZ['1.4F'] for node in model.Nodes.values()]))
106+
print('Max displacement: ', max([node.DZ['1.4F'] for node in model.nodes.values()]))
107107
print('Timoshenko Solution for displacement, d: ', d)

Examples/Shear Wall with Openings.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,33 @@
3535
origin=[0, 0, 0], plane='XY', element_type='Quad')
3636

3737
# Add a 4' wide x 12' tall door opening to the mesh
38-
model.Meshes['MSH1'].add_rect_opening(name='Door 1', x_left=2*12, y_bott=0*12, width=4*12, height=12*12)
38+
model.meshes['MSH1'].add_rect_opening(name='Door 1', x_left=2*12, y_bott=0*12, width=4*12, height=12*12)
3939

4040
# Add a 4' wide x 4' tall window opening to the mesh
41-
model.Meshes['MSH1'].add_rect_opening(name='Window 1', x_left=8*12, y_bott=8*12, width=4*12, height=4*12)
41+
model.meshes['MSH1'].add_rect_opening(name='Window 1', x_left=8*12, y_bott=8*12, width=4*12, height=4*12)
4242

4343
# Add another 4' wide x 4' tall window opening to the mesh
44-
model.Meshes['MSH1'].add_rect_opening(name='Window 2', x_left=14*12, y_bott=8*12, width=4*12, height=4*12)
44+
model.meshes['MSH1'].add_rect_opening(name='Window 2', x_left=14*12, y_bott=8*12, width=4*12, height=4*12)
4545

4646
# Add another 4' wide x 12' tall door opening to the mesh
47-
model.Meshes['MSH1'].add_rect_opening(name='Door 2', x_left=20*12, y_bott=0*12, width=4*12, height=12*12)
47+
model.meshes['MSH1'].add_rect_opening(name='Door 2', x_left=20*12, y_bott=0*12, width=4*12, height=12*12)
4848

4949
# Generate the mesh now that we've defined all the openings. Pynite automatically generates all
5050
# meshes when analyzing, but generating it early with give us the chance to work with it prior to
5151
# analysis.
52-
model.Meshes['MSH1'].generate()
52+
model.meshes['MSH1'].generate()
5353

5454
# Shear at the top of the wall
5555
V = 100 # kip
5656

5757
# The shear at the top of the wall will be distributed evently to all the
5858
# nodes at the top of the wall. Determine how many nodes are at the top of the
5959
# wall.
60-
n = len([node for node in model.Nodes.values() if isclose(node.Y, height)])
60+
n = len([node for node in model.nodes.values() if isclose(node.Y, height)])
6161
v = V/n
6262

6363
# Add supports and loads to the nodes
64-
for node in model.Nodes.values():
64+
for node in model.nodes.values():
6565

6666
# Determine if the node is at the base of the wall
6767
if isclose(node.Y, 0):
@@ -96,7 +96,7 @@
9696
renderer.render_model()
9797

9898
# Print the maximum displacement
99-
d_max = max([node.DX['Seismic'] for node in model.Nodes.values()])
99+
d_max = max([node.DX['Seismic'] for node in model.nodes.values()])
100100
print('Max displacement: ', d_max, 'in')
101101
print('Expected displacement from reference text: ', 7.623/E*t, 'in')
102102
print('Wall rigidity: ', V/d_max, 'kips/in')

Examples/Simple Beam - Factored Envelope.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
# Visualization.render_model(simple_beam, annotation_size=10, deformed_shape=True, deformed_scale=30, render_loads=True, combo_name='1.2D+1.6L')
4747

4848
# Plot the shear diagram with all load cases and max/min envelope
49-
x, M1 = simple_beam.Members['M1'].moment_array("Mz", n_points=400, combo_name='1.4D')
50-
_, M2 = simple_beam.Members['M1'].moment_array("Mz", n_points=400, combo_name='1.2D+1.6L')
51-
_, M3 = simple_beam.Members['M1'].moment_array("Mz", n_points=400, combo_name='1.2D+1.6S')
49+
x, M1 = simple_beam.members['M1'].moment_array("Mz", n_points=400, combo_name='1.4D')
50+
_, M2 = simple_beam.members['M1'].moment_array("Mz", n_points=400, combo_name='1.2D+1.6L')
51+
_, M3 = simple_beam.members['M1'].moment_array("Mz", n_points=400, combo_name='1.2D+1.6S')
5252

5353
max_envelope = np.maximum(np.maximum(M1, M2), M3)
5454
min_envelope = np.minimum(np.minimum(M1, M2), M3)

0 commit comments

Comments
 (0)