def test_cbar2(self): """Tests a CBAR/PBAR""" model = BDF(debug=True, log=None, mode='msc') model.bdf_filename = 'cbar.bdf' model.add_grid(1, [0., 0., 0.]) model.add_grid(2, [0.5, 0., 0.]) model.add_grid(3, [1., 0., 0.]) L = 1.0 pid = 2 mid = 3 E = 3.0e7 G = None nu = 0.3 model.add_mat1(mid, E, G, nu, rho=0.0, a=0.0, tref=0.0, ge=0.0, St=0.0, Sc=0.0, Ss=0.0, mcsid=0) eid = 1 x = [0., 1., 0.] g0 = None nids = [1, 2] model.add_cbar(eid, pid, nids, x, g0, offt='GGG', pa=0, pb=0, wa=None, wb=None, comment='') eid = 2 nids = [2, 3] model.add_cbar(eid, pid, nids, x, g0, offt='GGG', pa=0, pb=0, wa=None, wb=None, comment='') A = 1. k_axial = A * E / L model.add_pbar(pid, mid, A=A, i1=1., i2=1., i12=1., j=1., nsm=0., c1=0., c2=0., d1=0., d2=0., e1=0., e2=0., f1=0., f2=0., k1=1.e8, k2=1.e8, comment='') load_id = 2 spc_id = 3 nid = 3 mag = 1. fxyz = [1., 0., 0.] model.add_force(load_id, nid, mag, fxyz, cid=0) components = 123456 nodes = 1 model.add_spc1(spc_id, components, nodes, comment='') setup_case_control(model) solver = Solver(model) solver.run() # F = kx fmag = 1.0 dx = fmag / k_axial assert dx == solver.xg[6*2], f'dx={dx} xg={xg}'
def test_cbar(self): """Tests a CBAR/PBAR""" model = BDF(debug=True, log=None, mode='msc') model.add_grid(1, [0., 0., 0.]) model.add_grid(2, [1., 0., 0.]) nids = [1, 2] eid = 1 pid = 2 mid = 3 E = 3.0e7 G = None nu = 0.3 model.add_mat1(mid, E, G, nu, rho=0.0, a=0.0, tref=0.0, ge=0.0, St=0.0, Sc=0.0, Ss=0.0, mcsid=0) x = [0., 1., 0.] g0 = None model.add_cbar(eid, pid, nids, x, g0, offt='GGG', pa=0, pb=0, wa=None, wb=None, comment='') model.add_pbar(pid, mid, A=1., i1=1., i2=1., i12=1., j=1., nsm=0., c1=0., c2=0., d1=0., d2=0., e1=0., e2=0., f1=0., f2=0., k1=1.e8, k2=1.e8, comment='') load_id = 2 spc_id = 3 nid = 2 mag = 1. fxyz = [1., 0., 0.] model.add_force(load_id, nid, mag, fxyz, cid=0) components = 123456 nodes = 1 model.add_spc1(spc_id, components, nodes, comment='') setup_case_control(model) solver = Solver(model) solver.run()