#(c) Rory Clune 05/16/2011 from numpy import* from Structures import * if __name__ == '__main__': #----------- # INPUT DATA FOR A REALLY SIMPLE BEAM STRUCTURE #----------- # The geometry of the structural nodes (10-bar truss) geometry = array([[0., 0. ], [ 5., 0. ], [ 10., 0. ]]) # A connectivity matrix defines how nodes are connected with beams. a row contains ( beam - node - node ) connectivity = array([[ 0, 1 ], [ 1, 2 ]]) # Restrained degrees of freedom - pins at either end fixity = array([0,1,6,7]) # The loading - a downward point load at midspan load = zeros((3*geometry.shape[0])) load[4] = -100 A = 10*ones(connectivity.shape[0]) I = 10*ones(connectivity.shape[0]) s = structure(geometry, connectivity, fixity, load, A, I) u = s.analyze() s.show(40,40,100,200,4); #----------- # INPUT DATA FOR A MORE COMPLEX #----------- # The geometry of the structural nodes (10-bar truss) geometry = array([[0., 0. ], [ 5., 0. ], [ 10., 0. ], [15.,0.], [15.,5.], [ 10., 5. ], [ 5., 5. ], [ 0., 5. ]]) # A connectivity matrix defines how nodes are connected with beams. a row contains ( beam - node - node ) connectivity = array([[ 0, 1 ], [ 1, 2 ], [ 2, 3 ] , [ 3, 4 ], [ 4, 5 ], [5, 6], [6, 7], [ 7, 1 ], [ 0, 6 ], [ 6, 1 ], [ 1, 5 ], [ 6, 2 ], [5, 2], [2, 4], [5, 3] ], dtype = int) # Restrained degrees of freedom fixity = array([21,22,0,1]) load = zeros((3*geometry.shape[0])); load[10] = -100 A = 10*ones(connectivity.shape[0]) I = 10*ones(connectivity.shape[0]) s = structure(geometry, connectivity, fixity, load, A, I) s.show(30,30,100,150,10)