def export_marc_dat(self, *args): fullpath = args[0] exp1 = exporter(self.model, fullpath, "ex_Marc_dat") path, filename = os.path.split(fullpath) exp1.export(path)
def export_opensees_tcl(self, *args): fullpath = args[0] exp1 = exporter(self.model, fullpath, "ex_OpenSees") path, filename = os.path.split(fullpath) exp1.export(path)
def BuildModel(): model1 = model(settings) H = 4.875 # total height B = 10 # total width t1 = 0.4375 # thickness of the ploymer concrete t3 = 0.125 # offset of the top plate t2 = H - t1 -t3 # height of the second portion b3 = 1.375 # top-left portion b4 = B - b3 * 2 # top-middle portion b1 = 3.75 b2 = B - b1 * 2 alpha = atan(t2/(b1-b3)) #alpha = 60.0/180.0* 3.1415926 # incline angle #b1 = b3 + t2 / float(alpha) #b2 = B - b1 * 2 # Define nodes N1 = [0.0,H,0] N2 = [0,t2,0] N3 = [0,0,0] N4 = [b3,t2,0] N5 = [b1,0,0] N6 = [b3+b4,t2,0] N7 = [b1+b2,0,0] N8 = [B,H,0] N9 = [B,t2,0] N10 = [B,0,0] N11 = [b3,H,0] N12 = [b3+b4,H,0] N13 = [0,t2 + t3,0] N14 = [b3,t2 + t3,0] N15 = [b3 + b4,t2 + t3,0] N16 = [B,t2 + t3,0] tempnodes = [N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,N12,N13,N14,N15,N16] # create t1 model1.node(tempnodes) Lsize_seg_B = 0.5 Lsize_seg_H = 0.25 model1 = create_2d_patch(model1,[2,3,5,4],[floor(int(t2/Lsize_seg_H)),floor(int(b3/Lsize_seg_B))*2],setname='bottom_left') model1 = create_2d_patch(model1,[4,5,7,6],[floor(int(t2/Lsize_seg_H)),floor(int(b4/Lsize_seg_B))],setname='bottom_middle') model1 = create_2d_patch(model1,[6,7,10,9],[floor(int(t2/Lsize_seg_H)),floor(int(b3/Lsize_seg_B))*2],setname='bottom_right') model1 = create_2d_patch(model1,[1,13,14,11],[floor(int(t1/Lsize_seg_H))+1,floor(int(b3/Lsize_seg_B))*2],setname='top_left') model1 = create_2d_patch(model1,[11,14,15,12],[floor(int(t1/Lsize_seg_H))+1,floor(int(b4/Lsize_seg_B))],setname='top_middle') model1 = create_2d_patch(model1,[12,15,16,8],[floor(int(t1/Lsize_seg_H))+1,floor(int(b3/Lsize_seg_B))*2],setname='top_right') # create line elements that will be stretched to the frp plate model1 = create_single_line_setname(model1,'bottom_left-1-4',mode='x',ressetname='L1') model1 = create_single_line_setname(model1,'bottom_middle-1-4',mode='x',ressetname='L1') model1 = create_single_line_setname(model1,'bottom_right-1-4',mode='x',ressetname='L1') model1 = create_single_line_setname(model1,'bottom_left-1-4',mode='x',ressetname='L2') model1 = create_single_line_setname(model1,'bottom_right-1-4',mode='x',ressetname='L2') model1 = create_single_line_setname(model1,'bottom_middle-1-2',mode='x',ressetname='L3') model1 = create_single_line_setname(model1,'bottom_middle-3-4',mode='x',ressetname='L3') model1 = create_single_line_setname(model1,'bottom_middle-2-3',mode='x',ressetname='L4') model1 = create_single_line_setname(model1,'bottom_left-2-3',mode='x',ressetname='L5') model1 = create_single_line_setname(model1,'bottom_middle-2-3',mode='x',ressetname='L5') model1 = create_single_line_setname(model1,'bottom_right-2-3',mode='x',ressetname='L5') # stretch the mesh to generate 3D L_total = 50.0 Lincr = 2.0 n_incr = int(L_total/Lincr) model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['L1'],setname='plate_frp_L1') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['L2'],setname='plate_frp_L2') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['L3'],setname='plate_frp_L3') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['L4'],setname='plate_frp_L4') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['L5'],setname='plate_frp_L5') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['bottom_left'],setname='solid_bottom_left') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['bottom_middle'],setname='solid_bottom_middle') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['bottom_right'],setname='solid_bottom_right') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['top_left'],setname='solid_top_left') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['top_middle'],setname='solid_top_middle') model1,a,b,c = sktretch_2dmesh(model1,n_incr,Lincr,ElemSetNameList=['top_right'],setname='solid_top_right') # merge duplicate nodes model1.sweep() # create interface #for i in range(0,floor(int(B/Lsize_seg_B))) interfacenodelist = model1.nodelist.select_node_coord(rz=[-0.001,0.001],ry=[t2-0.01,t2+0.01]) #model1 = create_interface(model1,[-b1/2.0,h-tf,0],[-b1/2.0,h-tf1,0],2,24,setname='interface_left') for nodeid in interfacenodelist: xyz = model1.nodelist.itemlib[nodeid].xyz xyz = list(xyz) model1 = create_interface(model1,xyz,[xyz[0],xyz[1]+t3,xyz[2]],Lincr,n_incr,setname='interface') exp1 = exporter(model1,'hybrid.proc','ex_Marc_dat') exp1.export('default') #t0 = time.time() model1.modelsavetofile('hybrid.pydat')
def export_model(self, *args): fullpath = args[1] libtype = args[0] exp1 = exporter(self.model, fullpath, "ex_plain") # path,filename = os.path.split(fullpath) exp1.export_target(libtype, fullpath)
import sys import os import datetime sys.path.append("../../webfe/") import numpy as np from core.model.registry import model from core.export.export import exporter from core.settings import settings from core.procedures.t_section import tsec_planeconfig from core.procedures.rec_section import rec_planeconfig from core.imports.marc.import_marc_dat import importfile_marc_dat from core.post.import_marc_t16 import post_t16 from core.plots.plots import tpfdb from core.utility.table.stress_strain import add_mat_by_stressstrain, add_mat_by_file from command import commandparser if __name__ == "__main__": model1 = model(settings) model1 = add_mat_by_file( model1, "Aluminum", "ss.csv", mode="Ratio|Total Strain", proplimit=29.44, propstrain=0.003511, straincinr=0.0005 ) # model1 = add_mat_by_stressstrain(model1,'mat_rebar',MMFX,0.0026) name = "material" exp1 = exporter(model1, name + ".proc", "ex_Marc_dat") exp1.export(name) model1.modelsavetofile(name + ".pydat") print 1
def test_procedure_dowelaction(name,dia,dow_width,dow_height,dow_rebarcenter,dow_holewidth,dow_holedepth,dow_length,dow_length_incr,dow_sep_incr,dow_sep_h): model1 = model(settings) #dow_width = 2 #dow_height = 4 #dow_rebarcenter = 3 #dow_holewidth = 1 #dow_holedepth = 1 #dow_length = 16 #dow_length_incr = 1 #dow_sep_incr = 2 # create nodes and elements model1 = rec_planeconfig(model1,'rec1',dow_width,dow_height,dow_rebarcenter,dow_holewidth,dow_holedepth,dow_length,dow_length_incr,dow_sep_incr) # add and assign property model1 = add_property(model1) # model1.section('rec1','SolidCircular3D',{'mattag':'mat_rebar','para':{'diameter':dia},}) model1.section('interface','interface2d',{}) # default thickness as unit model1.link_sec_prop('rec1','rebar') model1.link_sec_prop('interface','interface') model1.link_prop_conn('interface',setnamelist=['interface_bot']) model1.link_prop_conn('concrete',setnamelist=['element_sec',]) model1.link_prop_conn('rebar',setnamelist=['rebar',]) # rotate model1.nodelist.transform(ry=3.1415926/2.0) # define top interface and bottom interface rebar_nodes = model1.nodelist.select_node_coord(ry=[dow_height-dow_rebarcenter-0.01,dow_height-dow_rebarcenter+0.01], rz=[-0.01,0.01]) model1.nodeset('rebar_nodes',{'nodelist':rebar_nodes}) # select top surface node for supports topnodes = model1.nodelist.select_node_coord(ry=[dow_height,dow_height]) model1.nodeset('topnodes',{'nodelist':topnodes}) model1.bond('topbond',{'xyz':[1,1,1,0,0,0],'DOF':6,'setnamelist':['topnodes']}) # select center of rebar for applying the cententrated load middlenodes = model1.nodelist.select_node_coord(rx=[0,0],rz=[0,0],ry=[dow_height-dow_rebarcenter,dow_height-dow_rebarcenter]) model1.nodeset('middlenodes',{'nodelist':middlenodes}) model1.table('loadtable',1,['time'],[[0,0],[1,1]]) model1.load('centerload',{'xyz':[0,1,0,0,0,0],'DOF':6,'scalar':-4,'setnamelist':['middlenodes'],'tabletag':'loadtable'}) # restrain due to symmetric xybondnodes = model1.nodelist.select_node_coord(rz=[-0.01,0.01]) model1.nodeset('xybondnodes',{'nodelist':xybondnodes}) model1.bond('xybond',{'xyz':[0,0,1,1,0,0],'DOF':6,'setnamelist':['xybondnodes']}) # restrain due to symmetric yzbondnodes = model1.nodelist.select_node_coord(rx=[-0.01,0.01]) model1.nodeset('yzbondnodes',{'nodelist':yzbondnodes}) model1.bond('xzbond',{'xyz':[1,0,1,1,1,1],'DOF':6,'setnamelist':['yzbondnodes']}) model1.loadcase('loadcase1','static_arclength',{'boundarylist':['topbond','centerload','xybond','xzbond'],'para':{'nstep':50}}) model1.job('job1','static_job',{'loadcaselist':['loadcase1'],'submit':False,'reqresultslist':['stress','total_strain','crack_strain','plastic_strain']}) # delete the portion sepnodes = model1.nodelist.select_node_coord(rx=[0,dow_length_incr*dow_sep_incr],ry=[0,dow_sep_h]) #model1.nodeset('middlenodes',{'nodelist':middlenodes}) sepelem = model1.select_elements_nodelist(sepnodes) rebarelem = model1.setlist['rebar'].elemlist sepelem = list(set(sepelem) - set(rebarelem)) model1.delete_elements(sepelem) # delete the top interface layer #model1.delete_elements(model1.setlist['interface_top'].elemlist) model1.sweep() exp1 = exporter(model1,name+'.proc','ex_Marc_dat') exp1.export(name) model1.modelsavetofile(name+'.pydat') print 1
import datetime sys.path.append('../../webfe/') import numpy as np from core.model.registry import model from core.export.export import exporter from core.settings import settings from core.procedures.t_section import tsec_planeconfig from core.procedures.rec_section import rec_planeconfig from core.imports.marc.import_marc_dat import importfile_marc_dat from core.post.import_marc_t16 import post_t16 from core.plots.plots import tpfdb from core.utility.table.stress_strain import add_mat_by_stressstrain, add_mat_by_file from command import commandparser if __name__ == '__main__': model1 = model(settings) model1 = add_mat_by_file(model1, 'Aluminum', 'ss.csv', mode='Ratio|Total Strain', proplimit=29.44, propstrain=0.003511, straincinr=0.0005) #model1 = add_mat_by_stressstrain(model1,'mat_rebar',MMFX,0.0026) name = 'material' exp1 = exporter(model1, name + '.proc', 'ex_Marc_dat') exp1.export(name) model1.modelsavetofile(name + '.pydat') print 1
def BuildModel(): model1 = model(settings) bf = 12.0 # width of flange UHPportion tf = 1.0 # thickness of flange UHPportion h = 5.0 # total section height tf1 = 1.25 # distance between UHPC and frp top plate t1 = 0.25 # thickness of top portion FRP b1 = 6 # width of top portion FRP t2 = 0.25 # thickness of inclined FRP portion ang2 = 60 # angle of inclined FRP portion t3 = 0.25 # Thickness of the botton center part t4 = 0.25 # Thickness of the botton side part L = 48.0 Lsize = 2.0 bsize = 1.0 hsize = 0.25 d = h - max(t3, t4) / 2.0 # effective depth from center # get width of center part h2 = d - tf1 b3 = b1 + h2 * 2 / tan(float(ang2) / 180.0 * 3.1415926) b4h = (bf - b3) / 2.0 # Define nodes N1 = [-bf / 2.0, 0, 0] N2 = [-b3 / 2.0, 0, 0] N3 = [0, 0, 0] N4 = [b3 / 2.0, 0, 0] N5 = [bf / 2.0, 0, 0] N6 = [-b1 / 2.0, h - tf1, 0] N7 = [b1 / 2.0, h - tf1, 0] N8 = [-b1 / 2.0, 0, 0] N9 = [b1 / 2.0, 0, 0] #t0 = time.time() # create t1 mdoel1 = create_single_line_nodecoord(model1, N6, N7, divident(N6, N7, bsize, 'Even'), elemsetname='frp_t1') mdoel1 = create_single_line_nodecoord(model1, N1, N2, divident(N1, N2, bsize), elemsetname='frp_t4_l') mdoel1 = create_single_line_nodecoord(model1, N2, N8, divident(N2, N6, bsize), elemsetname='frp_t3_l') mdoel1 = create_single_line_nodecoord(model1, N8, N9, divident(N8, N9, bsize, 'Even'), elemsetname='frp_t3') mdoel1 = create_single_line_nodecoord(model1, N9, N4, divident(N7, N4, bsize), elemsetname='frp_t3_r') mdoel1 = create_single_line_nodecoord(model1, N4, N5, divident(N4, N5, bsize), elemsetname='frp_t4_r') mdoel1 = create_single_line_nodecoord(model1, N2, N6, divident(N2, N6, bsize), elemsetname='frp_t2_l') mdoel1 = create_single_line_nodecoord(model1, N7, N4, divident(N7, N4, bsize), elemsetname='frp_t2_r') #t1 = time.time() - t0 #print 'time to construct FRP layers %s ' % str(t1) #t0 = time.time() model1, a, b, c = sktretch_2dmesh(model1, 24, 2, ElemSetNameList=['frp_t1'], setname='plate_frp_t1') model1, a, b, c = sktretch_2dmesh(model1, 24, 2, ElemSetNameList=['frp_t2_l', 'frp_t2_r'], setname='plate_frp_t2') model1, a, b, c = sktretch_2dmesh( model1, 24, 2, ElemSetNameList=['frp_t3_l', 'frp_t3_r', 'frp_t3'], setname='plate_frp_t3') model1, a, b, c = sktretch_2dmesh(model1, 24, 2, ElemSetNameList=['frp_t4_l', 'frp_t4_r'], setname='plate_frp_t4') #t1 = time.time() - t0 #print 'time to Extrude FRP layers %s ' % str(t1) # create top UHPC layer #t0 = time.time() model1 = create_3d_patch(model1, (0 - bf / 2.0, h - tf, 0), (bsize, hsize, Lsize), (bf / bsize, tf / hsize, L / Lsize), setname='UHPC') #t1 = time.time() - t0 #print 'time to construct UHPC %s ' % str(t1) #t0 = time.time() model1.sweep() #t1 = time.time() - t0 #print 'time to sweep nodes %s ' % str(t1) #t0 = time.time() model1.nodelist.get_sortedcoordtable() model1 = create_interface(model1, [-b1 / 2.0, h - tf, 0], [-b1 / 2.0, h - tf1, 0], 2, 24, setname='interface_left') model1 = create_interface(model1, [0, h - tf, 0], [0, h - tf1, 0], 2, 24, setname='interface_center') model1 = create_interface(model1, [b1 / 2.0, h - tf, 0], [b1 / 2.0, h - tf1, 0], 2, 24, setname='interface_right') #t1 = time.time() - t0 #print 'time to construct interface %s ' % str(t1) # add and assign property model1 = add_property(model1) model1.section('frp_t1', 'shell_section', {'thickness': t1}) model1.section('frp_t2', 'shell_section', {'thickness': t2}) model1.section('frp_t3', 'shell_section', {'thickness': t3}) model1.section('frp_t4', 'shell_section', {'thickness': t4}) model1.section('interface', 'interface2d', {}) model1.link_sec_prop('frp_t1', 'frp_t1') model1.link_sec_prop('frp_t2', 'frp_t2') model1.link_sec_prop('frp_t3', 'frp_t3') model1.link_sec_prop('frp_t4', 'frp_t4') model1.link_sec_prop('interface', 'interface') model1.link_prop_conn( 'interface', setnamelist=['interface_left', 'interface_center', 'interface_right']) model1.link_prop_conn('concrete', setnamelist=['UHPC']) model1.link_prop_conn('frp_t1', setnamelist=['element_plate_frp_t1']) model1.link_prop_conn('frp_t2', setnamelist=['element_plate_frp_t2']) model1.link_prop_conn('frp_t3', setnamelist=['element_plate_frp_t3']) model1.link_prop_conn('frp_t4', setnamelist=['element_plate_frp_t4']) # create boundary conditions leftbond = model1.nodelist.select_node_coord(rz=[0, 0], ry=[0, 0]) rightbond = model1.nodelist.select_node_coord(rz=[L, L], ry=[0, 0]) centerload = model1.nodelist.select_node_coord(rz=[L / 2.0, L / 2.0], ry=[h, h]) centerlineload = model1.nodelist.select_node_coord(rx=[0, 0], rz=[0, L], ry=[h - tf, h - tf]) middlenode = model1.nodelist.select_node_coord(rx=[0, 0], rz=[L / 2.0, L / 2.0], ry=[0, 0]) model1.nodeset('middlenode', {'nodelist': middlenode}) model1.nodeset('leftbond', {'nodelist': leftbond}) model1.nodeset('rightbond', {'nodelist': rightbond}) model1.nodeset('centerload', {'nodelist': centerload}) model1.nodeset('centerlineload', {'nodelist': centerlineload}) model1.table('loadtable', 1, ['time'], [[0, 0], [1, 1]]) model1.bond('leftbond', { 'xyz': [1, 1, 1, 0, 0, 0], 'DOF': 6, 'setnamelist': ['leftbond'] }) model1.bond('rightbond', { 'xyz': [0, 1, 1, 0, 0, 0], 'DOF': 6, 'setnamelist': ['rightbond'] }) model1.bond('support_z', { 'xyz': [0, 0, 1, 0, 0, 0], 'DOF': 6, 'setnamelist': ['centerlineload'] }) model1.load( 'centerload', { 'xyz': [0, 1, 0, 0, 0, 0], 'DOF': 6, 'scalar': -4, 'setnamelist': ['centerload'], 'tabletag': 'loadtable' }) # create Reb2 loadlinenode = model1.nodelist.select_node_coord(rz=[L / 2.0, L / 2.0], ry=[h, h]) loadlinecenter = model1.nodelist.select_node_coord(rz=[L / 2.0, L / 2.0], ry=[h, h], rx=[0, 0]) # remove center node fron list loadlinenode = loadlinenode.difference(loadlinecenter) loadlinenode = list(loadlinenode) loadlinecenter = list(loadlinecenter) model1.nodaltie( 'rbe_load', 'marc_rbe2', { 'tietype': 'DY', 'tieid': 1, 'retnode': loadlinecenter[0], 'tienodelist': loadlinenode }) model1.loadcase( 'loadcase1', 'static_arclength', { 'boundarylist': ['leftbond', 'centerload', 'rightbond', 'support_z'], 'para': { 'nstep': 50 } }) model1.job( 'job1', 'static_job', { 'loadcaselist': ['loadcase1'], 'submit': True, 'reqresultslist': ['stress', 'total_strain', 'crack_strain', 'plastic_strain'] }) # rotate model1.nodelist.transform(ry=3.1415926 / 2.0) exp1 = exporter(model1, 'hybrid.proc', 'ex_Marc_dat') exp1.export('default') #t0 = time.time() model1.modelsavetofile('hybrid.pydat')
def BuildModel(): model1 = model(settings) bf = 12.0 # width of flange UHPportion tf = 1.0 # thickness of flange UHPportion h = 5.0 # total section height tf1 = 1.25 # distance between UHPC and frp top plate t1 = 0.25 # thickness of top portion FRP b1 = 6 # width of top portion FRP t2 = 0.25 # thickness of inclined FRP portion ang2 = 60 # angle of inclined FRP portion t3 = 0.25 # Thickness of the botton center part t4 = 0.25 # Thickness of the botton side part L = 48.0 Lsize = 2.0 bsize = 1.0 hsize = 0.25 d = h - max(t3,t4)/2.0 # effective depth from center # get width of center part h2 = d - tf1 b3 = b1 + h2 *2 / tan(float(ang2)/180.0*3.1415926) b4h = (bf - b3) / 2.0 # Define nodes N1 = [-bf/2.0,0,0] N2 = [-b3/2.0,0,0] N3 = [0,0,0] N4 = [b3/2.0,0,0] N5 = [bf/2.0,0,0] N6 = [-b1/2.0,h-tf1,0] N7 = [b1/2.0,h-tf1,0] N8 = [-b1/2.0,0,0] N9 = [b1/2.0,0,0] #t0 = time.time() # create t1 mdoel1 = create_single_line_nodecoord(model1,N6,N7,divident(N6,N7,bsize,'Even'),elemsetname='frp_t1') mdoel1 = create_single_line_nodecoord(model1,N1,N2,divident(N1,N2,bsize),elemsetname='frp_t4_l') mdoel1 = create_single_line_nodecoord(model1,N2,N8,divident(N2,N6,bsize),elemsetname='frp_t3_l') mdoel1 = create_single_line_nodecoord(model1,N8,N9,divident(N8,N9,bsize,'Even'),elemsetname='frp_t3') mdoel1 = create_single_line_nodecoord(model1,N9,N4,divident(N7,N4,bsize),elemsetname='frp_t3_r') mdoel1 = create_single_line_nodecoord(model1,N4,N5,divident(N4,N5,bsize),elemsetname='frp_t4_r') mdoel1 = create_single_line_nodecoord(model1,N2,N6,divident(N2,N6,bsize),elemsetname='frp_t2_l') mdoel1 = create_single_line_nodecoord(model1,N7,N4,divident(N7,N4,bsize),elemsetname='frp_t2_r') #t1 = time.time() - t0 #print 'time to construct FRP layers %s ' % str(t1) #t0 = time.time() model1,a,b,c = sktretch_2dmesh(model1,24,2,ElemSetNameList=['frp_t1'],setname='plate_frp_t1') model1,a,b,c = sktretch_2dmesh(model1,24,2,ElemSetNameList=['frp_t2_l','frp_t2_r'],setname='plate_frp_t2') model1,a,b,c = sktretch_2dmesh(model1,24,2,ElemSetNameList=['frp_t3_l','frp_t3_r','frp_t3'],setname='plate_frp_t3') model1,a,b,c = sktretch_2dmesh(model1,24,2,ElemSetNameList=['frp_t4_l','frp_t4_r'],setname='plate_frp_t4') #t1 = time.time() - t0 #print 'time to Extrude FRP layers %s ' % str(t1) # create top UHPC layer #t0 = time.time() model1 = create_3d_patch(model1,(0-bf/2.0,h-tf,0),(bsize,hsize,Lsize),(bf/bsize,tf/hsize,L/Lsize),setname='UHPC') #t1 = time.time() - t0 #print 'time to construct UHPC %s ' % str(t1) #t0 = time.time() model1.sweep() #t1 = time.time() - t0 #print 'time to sweep nodes %s ' % str(t1) #t0 = time.time() model1.nodelist.get_sortedcoordtable() model1 = create_interface(model1,[-b1/2.0,h-tf,0],[-b1/2.0,h-tf1,0],2,24,setname='interface_left') model1 = create_interface(model1,[0,h-tf,0],[0,h-tf1,0],2,24,setname='interface_center') model1 = create_interface(model1,[b1/2.0,h-tf,0],[b1/2.0,h-tf1,0],2,24,setname='interface_right') #t1 = time.time() - t0 #print 'time to construct interface %s ' % str(t1) # add and assign property model1 = add_property(model1) model1.section('frp_t1','shell_section',{'thickness':t1}) model1.section('frp_t2','shell_section',{'thickness':t2}) model1.section('frp_t3','shell_section',{'thickness':t3}) model1.section('frp_t4','shell_section',{'thickness':t4}) model1.section('interface','interface2d',{}) model1.link_sec_prop('frp_t1','frp_t1') model1.link_sec_prop('frp_t2','frp_t2') model1.link_sec_prop('frp_t3','frp_t3') model1.link_sec_prop('frp_t4','frp_t4') model1.link_sec_prop('interface','interface') model1.link_prop_conn('interface',setnamelist=['interface_left','interface_center','interface_right']) model1.link_prop_conn('concrete',setnamelist=['UHPC']) model1.link_prop_conn('frp_t1',setnamelist=['element_plate_frp_t1']) model1.link_prop_conn('frp_t2',setnamelist=['element_plate_frp_t2']) model1.link_prop_conn('frp_t3',setnamelist=['element_plate_frp_t3']) model1.link_prop_conn('frp_t4',setnamelist=['element_plate_frp_t4']) # create boundary conditions leftbond = model1.nodelist.select_node_coord(rz=[0,0],ry=[0,0]) rightbond = model1.nodelist.select_node_coord(rz=[L,L],ry=[0,0]) centerload = model1.nodelist.select_node_coord(rz=[L/2.0,L/2.0],ry=[h,h]) centerlineload = model1.nodelist.select_node_coord(rx=[0,0],rz=[0,L],ry=[h-tf,h-tf]) middlenode = model1.nodelist.select_node_coord(rx=[0,0],rz=[L/2.0,L/2.0],ry=[0,0]) model1.nodeset('middlenode',{'nodelist':middlenode}) model1.nodeset('leftbond',{'nodelist':leftbond}) model1.nodeset('rightbond',{'nodelist':rightbond}) model1.nodeset('centerload',{'nodelist':centerload}) model1.nodeset('centerlineload',{'nodelist':centerlineload}) model1.table('loadtable',1,['time'],[[0,0],[1,1]]) model1.bond('leftbond',{'xyz':[1,1,1,0,0,0],'DOF':6,'setnamelist':['leftbond']}) model1.bond('rightbond',{'xyz':[0,1,1,0,0,0],'DOF':6,'setnamelist':['rightbond']}) model1.bond('support_z',{'xyz':[0,0,1,0,0,0],'DOF':6,'setnamelist':['centerlineload']}) model1.load('centerload',{'xyz':[0,1,0,0,0,0],'DOF':6,'scalar':-4,'setnamelist':['centerload'],'tabletag':'loadtable'}) # create Reb2 loadlinenode = model1.nodelist.select_node_coord(rz=[L/2.0,L/2.0],ry=[h,h]) loadlinecenter = model1.nodelist.select_node_coord(rz=[L/2.0,L/2.0],ry=[h,h],rx=[0,0]) # remove center node fron list loadlinenode = loadlinenode.difference(loadlinecenter) loadlinenode = list(loadlinenode) loadlinecenter = list(loadlinecenter) model1.nodaltie('rbe_load','marc_rbe2',{'tietype':'DY','tieid':1,'retnode':loadlinecenter[0],'tienodelist':loadlinenode}) model1.loadcase('loadcase1','static_arclength',{'boundarylist':['leftbond','centerload','rightbond','support_z'],'para':{'nstep':50}}) model1.job('job1','static_job',{'loadcaselist':['loadcase1'],'submit':True,'reqresultslist':['stress','total_strain','crack_strain','plastic_strain']}) # rotate model1.nodelist.transform(ry=3.1415926/2.0) exp1 = exporter(model1,'hybrid.proc','ex_Marc_dat') exp1.export('default') #t0 = time.time() model1.modelsavetofile('hybrid.pydat')
def moment_curvature(model, secname, axialLoad, maxK, numIncr=100, prjname=None, recorderfiber=None): """ triger a sectional moment curvature analysis for certain layered section in the model defination""" # copy all required files shutil.copy2(os.path.join(folder, 'MomentCurvature_recorder.tcl'), 'source') shutil.copy2(os.path.join(folder, 'LibUnits.tcl'), 'source') # read main control file f1 = open(os.path.join(folder, 'MomentCurvature_main.tcl'), 'r') text = f1.read() # get material and section export string exp1 = exporter(model, 'opensees.txt', 'ex_OpenSees') sec = model.seclist[secname] exportsec = 'set %s 1\n' % secname exportsec += exp1.write_sec(secname) matlist = model.get_material_by_section(secname) exportmat = '' nmat = 1 for matname in matlist: exportmat += 'set %s %i\n' % (matname, nmat) exportmat += exp1.write_mat(matname) nmat += 1 # get recorder string if needed if recorderfiber != None: exportrecorder = '' for fibertag in recorderfiber: fiber = sec.fiber[fibertag] exp2 = 'recorder Element -file $dataDir/%(path)s -time -ele 2001 section fiber %(locy)s 0 $%(mattag)s stressStrain\n' % ( { 'path': fibertag, 'locy': fiber.locy, 'mattag': fiber.mattag, }) exportrecorder += exp2 else: exportrecorder = '' output = text % { 'exportmats': exportmat, 'exportsec': exportsec, 'axialLoad': axialLoad, 'sectag': secname, 'maxK': maxK, 'numIncr': numIncr, 'prjname': prjname, 'exportrecorder': exportrecorder } # generate source file name if prjname == None: sourcefile = 'moment_curvature' + secname + '.tcl' else: sourcefile = prjname + '.tcl' sourcefilepath = os.path.join('source', sourcefile) # write source file to working folder if not os.path.exists('source'): os.makedirs('source') f1 = open(sourcefilepath, 'w') f1.write(output) f1.close() # call external opensees program run_OpenSees(sourcefile) #run_OpenSees_interact(sourcefile,loop) return 1
def test_procedure_dowelaction(name, dia, dow_width, dow_height, dow_rebarcenter, dow_holewidth, dow_holedepth, dow_length, dow_length_incr, dow_sep_incr, dow_sep_h): model1 = model(settings) #dow_width = 2 #dow_height = 4 #dow_rebarcenter = 3 #dow_holewidth = 1 #dow_holedepth = 1 #dow_length = 16 #dow_length_incr = 1 #dow_sep_incr = 2 # create nodes and elements model1 = rec_planeconfig(model1, 'rec1', dow_width, dow_height, dow_rebarcenter, dow_holewidth, dow_holedepth, dow_length, dow_length_incr, dow_sep_incr) # add and assign property model1 = add_property(model1) # model1.section('rec1', 'SolidCircular3D', { 'mattag': 'mat_rebar', 'para': { 'diameter': dia }, }) model1.section('interface', 'interface2d', {}) # default thickness as unit model1.link_sec_prop('rec1', 'rebar') model1.link_sec_prop('interface', 'interface') model1.link_prop_conn('interface', setnamelist=['interface_bot']) model1.link_prop_conn('concrete', setnamelist=[ 'element_sec', ]) model1.link_prop_conn('rebar', setnamelist=[ 'rebar', ]) # rotate model1.nodelist.transform(ry=3.1415926 / 2.0) # define top interface and bottom interface rebar_nodes = model1.nodelist.select_node_coord(ry=[ dow_height - dow_rebarcenter - 0.01, dow_height - dow_rebarcenter + 0.01 ], rz=[-0.01, 0.01]) model1.nodeset('rebar_nodes', {'nodelist': rebar_nodes}) # select top surface node for supports topnodes = model1.nodelist.select_node_coord(ry=[dow_height, dow_height]) model1.nodeset('topnodes', {'nodelist': topnodes}) model1.bond('topbond', { 'xyz': [1, 1, 1, 0, 0, 0], 'DOF': 6, 'setnamelist': ['topnodes'] }) # select center of rebar for applying the cententrated load middlenodes = model1.nodelist.select_node_coord( rx=[0, 0], rz=[0, 0], ry=[dow_height - dow_rebarcenter, dow_height - dow_rebarcenter]) model1.nodeset('middlenodes', {'nodelist': middlenodes}) model1.table('loadtable', 1, ['time'], [[0, 0], [1, 1]]) model1.load( 'centerload', { 'xyz': [0, 1, 0, 0, 0, 0], 'DOF': 6, 'scalar': -4, 'setnamelist': ['middlenodes'], 'tabletag': 'loadtable' }) # restrain due to symmetric xybondnodes = model1.nodelist.select_node_coord(rz=[-0.01, 0.01]) model1.nodeset('xybondnodes', {'nodelist': xybondnodes}) model1.bond('xybond', { 'xyz': [0, 0, 1, 1, 0, 0], 'DOF': 6, 'setnamelist': ['xybondnodes'] }) # restrain due to symmetric yzbondnodes = model1.nodelist.select_node_coord(rx=[-0.01, 0.01]) model1.nodeset('yzbondnodes', {'nodelist': yzbondnodes}) model1.bond('xzbond', { 'xyz': [1, 0, 1, 1, 1, 1], 'DOF': 6, 'setnamelist': ['yzbondnodes'] }) model1.loadcase( 'loadcase1', 'static_arclength', { 'boundarylist': ['topbond', 'centerload', 'xybond', 'xzbond'], 'para': { 'nstep': 50 } }) model1.job( 'job1', 'static_job', { 'loadcaselist': ['loadcase1'], 'submit': False, 'reqresultslist': ['stress', 'total_strain', 'crack_strain', 'plastic_strain'] }) # delete the portion sepnodes = model1.nodelist.select_node_coord( rx=[0, dow_length_incr * dow_sep_incr], ry=[0, dow_sep_h]) #model1.nodeset('middlenodes',{'nodelist':middlenodes}) sepelem = model1.select_elements_nodelist(sepnodes) rebarelem = model1.setlist['rebar'].elemlist sepelem = list(set(sepelem) - set(rebarelem)) model1.delete_elements(sepelem) # delete the top interface layer #model1.delete_elements(model1.setlist['interface_top'].elemlist) model1.sweep() exp1 = exporter(model1, name + '.proc', 'ex_Marc_dat') exp1.export(name) model1.modelsavetofile(name + '.pydat') print 1
def export_opensees_tcl(self, *args): fullpath = args[0] exp1 = exporter(self.model, fullpath, 'ex_OpenSees') path, filename = os.path.split(fullpath) exp1.export(path)
def export_marc_dat(self, *args): fullpath = args[0] exp1 = exporter(self.model, fullpath, 'ex_Marc_dat') path, filename = os.path.split(fullpath) exp1.export(path)
def export_model(self, *args): fullpath = args[1] libtype = args[0] exp1 = exporter(self.model, fullpath, 'ex_plain') #path,filename = os.path.split(fullpath) exp1.export_target(libtype, fullpath)
def moment_curvature(model,secname,axialLoad,maxK,numIncr=100,prjname=None,recorderfiber=None): """ triger a sectional moment curvature analysis for certain layered section in the model defination""" # copy all required files shutil.copy2(os.path.join(folder,'MomentCurvature_recorder.tcl'),'source') shutil.copy2(os.path.join(folder,'LibUnits.tcl'),'source') # read main control file f1 = open(os.path.join(folder,'MomentCurvature_main.tcl'),'r') text = f1.read() # get material and section export string exp1 = exporter(model,'opensees.txt','ex_OpenSees') sec = model.seclist[secname] exportsec = 'set %s 1\n' % secname exportsec += exp1.write_sec(secname) matlist = model.get_material_by_section(secname) exportmat = '' nmat = 1 for matname in matlist: exportmat += 'set %s %i\n' % (matname,nmat) exportmat += exp1.write_mat(matname) nmat +=1 # get recorder string if needed if recorderfiber != None: exportrecorder = '' for fibertag in recorderfiber: fiber = sec.fiber[fibertag] exp2 = 'recorder Element -file $dataDir/%(path)s -time -ele 2001 section fiber %(locy)s 0 $%(mattag)s stressStrain\n' % ({ 'path':fibertag, 'locy':fiber.locy, 'mattag':fiber.mattag,} ) exportrecorder += exp2 else: exportrecorder = '' output = text % {'exportmats':exportmat,'exportsec':exportsec,'axialLoad':axialLoad,'sectag':secname, 'maxK':maxK,'numIncr':numIncr,'prjname':prjname,'exportrecorder':exportrecorder} # generate source file name if prjname == None: sourcefile = 'moment_curvature'+secname +'.tcl' else: sourcefile = prjname + '.tcl' sourcefilepath = os.path.join('source',sourcefile) # write source file to working folder if not os.path.exists('source'): os.makedirs('source') f1 = open(sourcefilepath,'w') f1.write(output) f1.close() # call external opensees program run_OpenSees(sourcefile) #run_OpenSees_interact(sourcefile,loop) return 1