def test_coord_adding(self): origin = [0., 0., 0.] zaxis = [0., 0., 1.] xzplane = [1., 0., 0.] cid1 = CORD2R(cid=1, rid=0, origin=origin, zaxis=zaxis, xzplane=xzplane, comment='cord2r') xaxis = [1., 0., 0.] yaxis = [0., 1., 0.] zaxis = [0., 0., 1.] xz_plane = [1., 0., 1.] yz_plane = [0., 1., 1.] xy_plane = [1., 1., 0.] # x-axis cid2 = CORD2R.add_axes(cid=2, rid=0, origin=origin, xaxis=xaxis, yaxis=None, zaxis=None, xyplane=None, yzplane=None, xzplane=xz_plane) cid3 = CORD2R.add_axes(cid=2, rid=0, origin=origin, xaxis=xaxis, yaxis=None, zaxis=None, xyplane=xy_plane, yzplane=None, xzplane=None) # y-axis cid4 = CORD2R.add_axes(cid=4, rid=0, origin=origin, xaxis=None, yaxis=yaxis, zaxis=None, xyplane=xy_plane, yzplane=None, xzplane=None) cid5 = CORD2R.add_axes(cid=5, rid=0, origin=origin, xaxis=None, yaxis=yaxis, zaxis=None, xyplane=None, yzplane=yz_plane, xzplane=None) # z-axis cid4 = CORD2R.add_axes(cid=4, rid=0, origin=origin, xaxis=None, yaxis=None, zaxis=zaxis, xyplane=None, yzplane=None, xzplane=xz_plane) cid5 = CORD2R.add_axes(cid=5, rid=0, origin=origin, xaxis=None, yaxis=None, zaxis=zaxis, xyplane=None, yzplane=yz_plane, xzplane=None) # ijk cid6 = CORD2R.add_ijk(cid=6, rid=0, origin=origin, i=xaxis, j=yaxis, k=None) cid7 = CORD2R.add_ijk(cid=7, rid=0, origin=origin, i=xaxis, j=None, k=zaxis) cid8 = CORD2R.add_ijk(cid=8, rid=0, origin=origin, i=None, j=yaxis, k=zaxis)
def test_coord_adding(self): origin = [0., 0., 0.] zaxis = [0., 0., 1.] xzplane = [1., 0., 0.] cid1 =CORD2R(cid=1, rid=0, origin=origin, zaxis=zaxis, xzplane=xzplane, comment='') xaxis = [1., 0., 0.] yaxis = [0., 1., 0.] zaxis = [0., 0., 1.] xz_plane = [1., 0., 1.] yz_plane = [0., 1., 1.] xy_plane = [1., 1., 0.] # x-axis cid2 = CORD2R.add_axes(cid=2, rid=0, origin=origin, xaxis=xaxis, yaxis=None, zaxis=None, xyplane=None, yzplane=None, xzplane=xz_plane) cid3 = CORD2R.add_axes(cid=2, rid=0, origin=origin, xaxis=xaxis, yaxis=None, zaxis=None, xyplane=xy_plane, yzplane=None, xzplane=None) # y-axis cid4 = CORD2R.add_axes(cid=4, rid=0, origin=origin, xaxis=None, yaxis=yaxis, zaxis=None, xyplane=xy_plane, yzplane=None, xzplane=None) cid5 = CORD2R.add_axes(cid=5, rid=0, origin=origin, xaxis=None, yaxis=yaxis, zaxis=None, xyplane=None, yzplane=yz_plane, xzplane=None) # z-axis cid4 = CORD2R.add_axes(cid=4, rid=0, origin=origin, xaxis=None, yaxis=None, zaxis=zaxis, xyplane=None, yzplane=None, xzplane=xz_plane) cid5 = CORD2R.add_axes(cid=5, rid=0, origin=origin, xaxis=None, yaxis=None, zaxis=zaxis, xyplane=None, yzplane=yz_plane, xzplane=None) # ijk cid6 = CORD2R.add_ijk(cid=6, rid=0, origin=origin, i=xaxis, j=yaxis, k=None) cid7 = CORD2R.add_ijk(cid=7, rid=0, origin=origin, i=xaxis, j=None, k=zaxis) cid8 = CORD2R.add_ijk(cid=8, rid=0, origin=origin, i=None, j=yaxis, k=zaxis)
def test_spline2(self): """checks the SPLINE2 card""" #| SPLINE2 | EID | CAERO | ID1 | ID2 | SETG | DZ | DTOR | CID | #| | DTHX | DTHY | None | USAGE | | | | | #+---------+------+-------+-------+-------+------+----+------+-----+ #| SPLINE2 | 5 | 8 | 12 | 24 | 60 | 0. | 1.0 | 3 | #| | 1. | | | | | | | | cid = 3 origin = [0., 0., 0.] xaxis = [1., 0., 0.] xyplane = [0., 1., 0.] coord = CORD2R.add_axes(cid, rid=0, origin=origin, xaxis=xaxis, yaxis=None, zaxis=None, xyplane=xyplane, yzplane=None, xzplane=None, comment='comment') eid = 8 pid = 10 cp = 0 nsb = 4 nint = 2 lsb = None lint = None p1 = [0., 0., 0.] x12 = 42. igid = None caero2 = CAERO2(eid, pid, igid, p1, x12, cp=cp, nsb=nsb, nint=nint, lsb=lsb, lint=lint, comment='this is a caero') #caero = CAERO2(eid, pid, cp, nsb, nint, lsb, lint, igid, p1, x12) sid = 60 ids = [7, 13] set_obj = SET1(sid, ids, is_skin=False, comment='set card') grid7 = GRID(nid=7, cp=0, xyz=[7., 0., 0.], cd=0, ps='', seid=0, comment='') grid13 = GRID(nid=13, cp=0, xyz=[13., 0., 0.], cd=0, ps='', seid=0, comment='') model = BDF(log=None) model._add_coord_object(coord) model._add_caero_object(caero2) model._add_set_object(set_obj) model._add_node_object(grid7) model._add_node_object(grid13) eid = 5 caero = 8 id1 = 12 id2 = 24 setg = 60 dz = 0. dtor = 1.0 cid = 3 dthx = 1. dthy = None usage = None card = ['SPLINE2', eid, caero, id1, id2, setg, dz, dtor, cid, dthx, dthy, None, usage] bdf_card = BDFCard(card, has_none=True) spline_a = SPLINE2.add_card(bdf_card, comment='spline2_a') spline_a.write_card() spline_b = SPLINE2(eid, caero, id1, id2, setg, dz, dtor, cid, dthx, dthy, usage, comment='spline2_b') spline_b.validate() spline_b.write_card() spline_b.cross_reference(model) spline_b.write_card()
def test_spline2(self): """checks the SPLINE2 card""" #| SPLINE2 | EID | CAERO | ID1 | ID2 | SETG | DZ | DTOR | CID | #| | DTHX | DTHY | None | USAGE | | | | | #+---------+------+-------+-------+-------+------+----+------+-----+ #| SPLINE2 | 5 | 8 | 12 | 24 | 60 | 0. | 1.0 | 3 | #| | 1. | | | | | | | | cid = 3 origin = [0., 0., 0.] xaxis = [1., 0., 0.] xyplane = [0., 1., 0.] coord = CORD2R.add_axes(cid, rid=0, origin=origin, xaxis=xaxis, yaxis=None, zaxis=None, xyplane=xyplane, yzplane=None, xzplane=None, comment='comment') eid = 8 pid = 10 cp = 0 nsb = 4 nint = 2 lsb = None lint = None p1 = [0., 0., 0.] x12 = 42. igid = None caero2 = CAERO2(eid, pid, igid, p1, x12, cp=cp, nsb=nsb, nint=nint, lsb=lsb, lint=lint, comment='this is a caero') #caero = CAERO2(eid, pid, cp, nsb, nint, lsb, lint, igid, p1, x12) sid = 60 ids = [7, 13] set_obj = SET1(sid, ids, is_skin=False, comment='set card') grid7 = GRID(nid=7, cp=0, xyz=[7., 0., 0.], cd=0, ps='', seid=0, comment='') grid13 = GRID(nid=13, cp=0, xyz=[13., 0., 0.], cd=0, ps='', seid=0, comment='') model = BDF(log=None) model.add_coord(coord) model.add_caero(caero2) model.add_set(set_obj) model.add_node(grid7) model.add_node(grid13) eid = 5 caero = 8 id1 = 12 id2 = 24 setg = 60 dz = 0. dtor = 1.0 cid = 3 dthx = 1. dthy = None usage = None card = ['SPLINE2', eid, caero, id1, id2, setg, dz, dtor, cid, dthx, dthy, None, usage] bdf_card = BDFCard(card, has_none=True) spline_a = SPLINE2.add_card(bdf_card, comment='spline2_a') spline_a.write_card() spline_b = SPLINE2(eid, caero, id1, id2, setg, dz, dtor, cid, dthx, dthy, usage, comment='spline2_b') spline_b.validate() spline_b.write_card() spline_b.cross_reference(model) spline_b.write_card()