Skip to content

Commit 8ae794f

Browse files
committed
Physical member dist load fix
1 parent db38a97 commit 8ae794f

File tree

4 files changed

+76
-2
lines changed

4 files changed

+76
-2
lines changed

PyNite/PhysMember.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def descritize(self):
117117
if x2_load < xj:
118118
x2 = x2_load - xi
119119
else:
120-
x2 = xj
120+
x2 = xj - xi
121121
w2 = w(xj)
122122

123123
# Add the load to the sub-member

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ PyNite depends on the following packages:
6464

6565
# What's New?
6666

67+
v0.0.68
68+
* Bug fix for member distributed loads on physical members. Added a unit test to check for this error going forward. This bug only affected physical members (new as of v0.0.67) that had distributed loads and internal nodes.
69+
6770
v0.0.67
6871
* Added physical members. Members now automatically detect internal nodes and subdivide themselves and their loads.
6972
* Refactoring: deprecated old method names for member results. You may now have some errors show up if you still try to get member results using the old method names.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# -*- coding: utf-8 -*-
2+
"""
3+
MIT License
4+
5+
Copyright (c) 2020 D. Craig Brinck, SE; tamalone1
6+
"""
7+
8+
import unittest
9+
from PyNite import FEModel3D
10+
import math
11+
import sys
12+
from io import StringIO
13+
14+
class TestMemberInternalResults(unittest.TestCase):
15+
"""
16+
Tests for member internal results
17+
"""
18+
19+
def setUp(self):
20+
# Suppress printed output temporarily
21+
sys.stdout = StringIO()
22+
23+
def tearDown(self):
24+
# Reset the print function to normal
25+
sys.stdout = sys.__stdout__
26+
27+
def test_beam_shear(self):
28+
"""
29+
Units for this model are kips and feet
30+
"""
31+
32+
# Define a new beam
33+
beam = FEModel3D()
34+
35+
# Define the nodes
36+
beam.add_node('N1', 0, 0, 0)
37+
beam.add_node('N2', 10, 0, 0)
38+
39+
# Define the supports
40+
beam.def_support('N1', True, True, True, True, False, False)
41+
beam.def_support('N2', True, True, True, False, False, False)
42+
43+
# Define beam section proerties
44+
J = 400/12**4
45+
Iy = 200/12**4
46+
Iz = 200/12**4
47+
E = 29000*144
48+
G = 11200*144
49+
A = 12/12**2
50+
51+
# Create the beam
52+
beam.add_member('M1', 'N1', 'N2', E, G, Iy, Iz, J, A)
53+
54+
# Add a mid-span node
55+
beam.add_node('N3', 5, 0, 0)
56+
57+
# Add a member distributed load
58+
beam.add_member_dist_load('M1', 'FY', -0.5, -0.5, case='D')
59+
beam.add_load_combo('D', {'D':1.0})
60+
61+
# Analyze the model
62+
beam.analyze_linear()
63+
64+
# from PyNite.Visualization import Renderer
65+
# renderer = Renderer(beam)
66+
# renderer.combo_name = 'D'
67+
# renderer.annotation_size = 1
68+
# renderer.render_model()
69+
70+
# Check the shear at midspan - it should be zero
71+
self.assertAlmostEqual(beam.Members['M1'].shear('Fy', 5, 'D'), 0, 2)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="PyNiteFEA",
8-
version="0.0.67",
8+
version="0.0.68",
99
author="D. Craig Brinck, PE, SE",
1010
author_email="Building.Code@outlook.com",
1111
description="A simple elastic 3D structural finite element library for Python.",

0 commit comments

Comments
 (0)