示例#1
0
 def __init__(self):
     self.model = model(settings)
     self.results = tpfdb()
     self.commandhis = []
     self.currentsettings = {}
     self.macro_start = 0
     self.macro_end = 0
示例#2
0
文件: command.py 项目: Junlings/webfe
 def __init__(self):
     self.model = model(settings)
     self.results = tpfdb()
     self.commandhis = []
     self.currentsettings = {}
     self.macro_start = 0
     self.macro_end = 0
示例#3
0
文件: command.py 项目: Junlings/webfe
    def new_project(self, *args):
        settings["prjname"] = args[0]
        settings["ndm"] = args[1]
        settings["ndf"] = args[2]
        settings["root"] = args[3]
        self.model = model(settings)

        print "New model created @ %s" % datetime.datetime.now()
示例#4
0
def test_material():
    model1 = model(settings)
    
    model1 = mat.create_simpe_orie_UHPC(model1,'mat_UHPC_1',1.0,1.5,factor=1.0)
    model1 = mat.create_simpe_orie_UHPC(model1,'mat_UHPC_2',1.0,1.5,factor=1.2)
    
    
    print 1
示例#5
0
    def new_project(self, *args):
        settings['prjname'] = args[0]
        settings['ndm'] = args[1]
        settings['ndf'] = args[2]
        settings['root'] = args[3]
        self.model = model(settings)

        print "New model created @ %s" % datetime.datetime.now()
示例#6
0
def test_importt16():

    model1 = model(settings)
    f1 = post_t16(
        'M:\\marcworking\\Tbeam_interface_tune\\1t1s\\1t1s_elastic.t16')
    res = f1.postset_incr([
        'Element Scalar', 'Comp 11 of Total Strain', 0, 'REBAR_ELEMENTS', -1,
        1e6, 1
    ])
示例#7
0
def test_procedure_dowelaction():
    model1 = model(settings)

    #model1 = tsec_planeconfig(model1,'tsec1',12,1.25,1,3.75,2,4,1) #bf,tf,tf1,hw,tw,d,ds
    model1 = rec_planeconfig(model1, 'rec1', 2, 4, 3, 1, 1, 16, 1)

    model1.modelsavetofile('temp.pydat')

    model1 = model1.modelloadbyfile('temp.pydat')
    print model1.get_element_typeid(100)
    print 1
示例#8
0
def test_procedure_dowelaction():
    model1 = model(settings)

    #model1 = tsec_planeconfig(model1,'tsec1',12,1.25,1,3.75,2,4,1) #bf,tf,tf1,hw,tw,d,ds
    model1 = rec_planeconfig(model1,'rec1',2,4,3,1,1,16,1)
    
    
    
    
    model1.modelsavetofile('temp.pydat')
    
    
    model1 = model1.modelloadbyfile('temp.pydat')
    print model1.get_element_typeid(100)
    print 1
示例#9
0
def test_section():
    model1 = model(settings)

    model1.material('m1',
                    'uniaxial_elastic',
                    paralib={
                        'E': 29000.0,
                        'mu': 0.3,
                        'mass': 0.0
                    })
    prop = {
        'mattag': 'm1',
        'numLine': 10,
        'widthLine': 1,
        'yStart': 0,
        'zStart': 0,
        'yEnd': 10,
        'zEnd': 10
    }
    prop2 = {
        'mattag': 'm1',
        'numLine': 10,
        'widthLine': 1,
        'yStart': 0,
        'zStart': 0,
        'yEnd': 10,
        'zEnd': -10
    }

    model1.section(
        'sec1', 'fibersection', {
            'layerlib': {
                '1': {
                    'type': 'line',
                    'prop': prop
                },
                '2': {
                    'type': 'line',
                    'prop': prop2
                }
            },
            'patchlib': {},
            'fiberlib': {}
        })
    model1.seclist['sec1'].collect_fibers()

    PlotFiberSection(model1, 'sec1')
    print 1
示例#10
0
def test_section():
    model1 = model(settings)
    
    model1.material('m1','uniaxial_elastic',paralib={'E':29000.0,'mu':0.3,'mass':0.0})
    prop = {'mattag':'m1','numLine':10,'widthLine':1,'yStart':0,'zStart':0,'yEnd':10,'zEnd':10}
    prop2 = {'mattag':'m1','numLine':10,'widthLine':1,'yStart':0,'zStart':0,'yEnd':10,'zEnd':-10}
    
    model1.section('sec1','fibersection',{'layerlib':{'1':{'type':'line','prop':prop},
                                                      '2':{'type':'line','prop':prop2}},
                                           'patchlib':{},
                                           'fiberlib':{}})
    model1.seclist['sec1'].collect_fibers()
    
    
    PlotFiberSection(model1,'sec1')
    print 1
示例#11
0
def procedure_interface3d(*args):
    model1 = model(settings)
    
    mtype = args[0]
    La = float(args[1])
    Ha = float(args[2])
    Za = float(args[3])
    Lb = float(args[4])
    Hb = float(args[5])  # mess with t2 as t3
    Zb = float(args[6])
    Lsize = float(args[7])
    Hsize = float(args[8])
    #offset = float(args[7])
    #bond_region = float(args[8])
    
    model1 = create_pullout(model1,La=La,Ha=Ha,Za=Za,Lb=Lb,Hb=Hb,Zb=Zb,Lsize=Lsize,Hsize=Hsize,offset=0,bond_region=None)
    
    return model1
    
    
示例#12
0
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')
示例#13
0
            vertices_hex = self.model.vertices_elem['hex']
            n_hex = len(vertices_hex)
            if n_hex > 0:
                glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)
                glVertexPointerd(vertices_hex)
                glDrawArrays(GL_QUADS, 0, n_hex)


if __name__ == '__main__':

    import sys
    sys.path.append('../..')
    from core.model.registry import model
    from core import settings

    model1 = model(settings)

    # create node
    model1.node([[0, 0, 0], [1, 0, 0], [2, 0, 0], [3, 0, 0], [4, 0, 0],
                 [5, 0, 0], [5, 2, 0]])

    # create element
    model1.element([[1, 2], [2, 3], [3, 4]])
    model1.nodaltie('in plate',
                    'marc_rbe2',
                    paralib={
                        'tietype': 'fix',
                        'retnode': 7,
                        'tienodelist': [6]
                    })
    app = wx.App()
示例#14
0
def BuildModel_hybrid_command(*args):
    model1 = model(settings)
    
    H = float(args[0])
    B = float(args[1])
    t1 = float(args[2])
    t3 = float(args[3])  # mess with t2 as t3
    b3 = float(args[4])
    a = float(args[5])
    L = float(args[6])
    Mesh_H = float(args[7])
    Mesh_B = float(args[8])
    Mesh_L = float(args[9])
        
        
    #H = 4.875           # total height
    #B = 10          # total width
    #t1 = 0.5       # 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 = b3 + t2/tan(a/180.0*3.1415926)
    b2 = B - b1 * 2
    
    #alpha = atan(t2/(b1-b3))    # incline angle
    
    # 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 = Mesh_B
    Lsize_seg_H = Mesh_H
    
    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 = L
    Lincr = Mesh_L
    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')
    

    return model1
示例#15
0
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
示例#16
0
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
示例#17
0
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
示例#18
0
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')
示例#19
0
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')
示例#20
0
def test_importt16():


    model1 = model(settings)
    f1 = post_t16('M:\\marcworking\\Tbeam_interface_tune\\1t1s\\1t1s_elastic.t16')
    res = f1.postset_incr(['Element Scalar','Comp 11 of Total Strain',0,'REBAR_ELEMENTS',-1,1e6,1])