def setUpClass(cls): _nodes = {1: Node.Node(ID=1, coords=(0, 0)), 2: Node.Node(ID=2, coords=(0, 2000)), 3: Node.Node(ID=3, coords=(2000, 4000)), 4: Node.Node(ID=4, coords=(5000, 4000)), 5: Node.Node(ID=5, coords=(5000, 3000)), 6: Node.Node(ID=6, coords=(5000, 2000)), 7: Node.Node(ID=7, coords=(5000, 1000)), 8: Node.Node(ID=8, coords=(5000, 0)), 9: Node.Node(ID=9, coords=(5000, -1000)), } mat = Material.Steel() s1 = sections.Rectangle(height=100, width=100) # section s2 = sections.Rectangle(height=200, width=200) # section _sections = [s1, s1, s2, s1, s1, s1, s1, s1] _beams = [HB.HermitianBeam2D(ID=x+1, E=mat.E, rho=mat.rho, I=_sections[x].I.x, A=_sections[x].A, i=_nodes[y], j=_nodes[y+1]) for x, y in zip(range(8), range(1, len(_nodes.keys())))] _supports = {1: ['ux', 'uy'], 9: ['ux', 'uy'], } cls.structure = Structure.Structure(beams=_beams, supports=_supports) # adding nodal loads cls.structure.clear_loads() cls.structure.add_nodal_load(nodeID=3, dynam={'FX': 1000, 'FY': 500}, clear=True) cls.structure.add_nodal_load(nodeID=5, dynam={'FX': -1500}) # internal loads b = cls.structure.beams[1] cls.structure.add_internal_loads(beam=b, loadtype='uniform perpendicular force', value=2.0)
def setUpClass(cls): _nodes = [Node.Node(ID=x+1, coords=(500 * x, 0)) for x in range(7)] mat = Material.Steel() sect = sections.Rectangle(height=3, width=10) # section _beams = [HB.HermitianBeam2D(ID=x+1, E=mat.E, rho=mat.rho, I=sect.I.x, A=sect.A, i=_nodes[x], j=_nodes[x+1]) for x in range(6)] _supports = {7: ['ux', 'uy', 'rotz']} cls.structure = Structure.Structure(beams=_beams, supports=_supports) # adding nodal loads cls.structure.clear_loads() cls.structure.add_nodal_load(nodeID=1, dynam={'FY': -1000}, clear=True)
def setUpClass(cls): _nodes = [Node.Node(ID=x+1, coords=(500 * x, 0)) for x in range(7)] mat = Material.Steel() sect = sections.Rectangle(height=3, width=10) # section _beams = [HB.HermitianBeam2D(ID=x+1, E=mat.E, rho=mat.rho, I=sect.I.x, A=sect.A, i=_nodes[x], j=_nodes[x+1]) for x in range(6)] _supports = {7: ['ux', 'uy', 'rotz']} cls.structure = Structure.Structure(beams=_beams, supports=_supports) # adding nodal loads cls.structure.clear_loads() cls.structure.add_nodal_load(nodeID=1, dynam={'FY': -1000, 'FX': -1000}, clear=True) cls.structure.add_internal_loads(beam=cls.structure.beams[0], loadtype='uniform axial force', value=1) cls.structure.add_internal_loads(beam=cls.structure.beams[2], loadtype='concentrated axial force', value=-1000, position=0.4) cls.structure.add_internal_loads(beam=cls.structure.beams[4], loadtype='concentrated axial force', value=1000, position=0.99)
def setUpClass(cls): # nodes _n1 = Node.Node(ID=1, coords=(0, 0)) _n2 = Node.Node(ID=2, coords=(100, 0)) # beams section_column = sections.Rectangle(height=3, width=10) # section mat = Material.Steel() _b1 = HB.HermitianBeam2D.from_dict(adict={'ID': 1, 'E': mat.E, 'I': section_column.I.x, 'A': section_column.A, 'rho': mat.rho, 'i': _n1, 'j': _n2}) _b1.number_internal_points = 4 # setting this to have much less values for comparison # supports BCs = {1: ['ux', 'uy', 'rotz'], NR_BEAMS+1: ['ux', 'uy', 'rotz']} # supports as dict # this is the cantilever itself, composed of the beams, complete with supports cls.structure = Structure.Structure(beams=[_b1], supports=BCs)
def setUpClass(cls): _nodes = [Node.Node(ID=x+1, coords=(500 * x, 0)) for x in range(7)] mat = Material.Steel() sect = sections.Rectangle(height=3, width=10) # section _beams = [HB.HermitianBeam2D(ID=x+1, E=mat.E, rho=mat.rho, I=sect.I.x, A=sect.A, i=_nodes[x], j=_nodes[x+1]) for x in range(6)] _supports = {1: ['uy'], 3: ['uy'], 5: ['uy'], 7: ['ux', 'uy', 'rotz'], } cls.structure = Structure.Structure(beams=_beams, supports=_supports) # adding nodal loads cls.structure.clear_loads() cls.structure.add_nodal_load(nodeID=1, dynam={'FX': -1000}, clear=True) cls.structure.add_nodal_load(nodeID=2, dynam={'FY': -1000}) cls.structure.add_nodal_load(nodeID=4, dynam={'MZ': 500000}) # internal loads b = cls.structure.beams[4] cls.structure.add_internal_loads(beam=b, loadtype='uniform perpendicular force', value=-10.0) b = cls.structure.beams[5] cls.structure.add_internal_loads(beam=b, loadtype='uniform perpendicular force', value=-20.0)
NR_BEAMS = 1 # number of finite elements LENGTH = 200 # length of cantilever F_HORIZONTAL = 0 F_VERTICAL = 0 # nodes if VERTICAL: # vertical beam _nodes = [Node.Node.from_dict(adict={'ID': i+1, 'coords': (0, i*LENGTH/NR_BEAMS)}) for i in range(NR_BEAMS+1)] else: # horizontal beam _nodes = [Node.Node.from_dict(adict={'ID': i+1, 'coords': (i*LENGTH/NR_BEAMS, 0)}) for i in range(NR_BEAMS+1)] # beams section_column = sections.Rectangle(height=3, width=10) # section print(section_column) mat = Material.Steel() rho = mat.rho EE = mat.E _beams = [HB.HermitianBeam2D.from_dict(adict= {'ID': i, 'E': EE, 'I': section_column.I['x'], 'A': section_column.A, 'rho': rho, 'i': _nodes[i], 'j': _nodes[i+1]}) for i in range(NR_BEAMS)] # supports BCs = {1: ['ux', 'uy', 'rotz']} # supports as dict # this is the cantilever itself, composed of the beams, complete with supports structure = Structure.Structure(beams=_beams, supports=BCs) # adding loads # directly defined nodal loads