本文整理汇总了Python中pyNastran.bdf.bdf.BDF.add_coord方法的典型用法代码示例。如果您正苦于以下问题:Python BDF.add_coord方法的具体用法?Python BDF.add_coord怎么用?Python BDF.add_coord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyNastran.bdf.bdf.BDF
的用法示例。
在下文中一共展示了BDF.add_coord方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cord2c_01
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import add_coord [as 别名]
def test_cord2c_01(self):
lines = [
'CORD2C* 3 0 0. 0.',
'* 0. 0. 0. 1.*',
'* 1. 0. 1.'
]
model = BDF(debug=False)
card = model.process_card(lines)
card = BDFCard(card)
card = CORD2C(card)
model.add_coord(card)
lines = [
'CORD2R 4 3 10. 0. 5. 10. 90. 5.',
' 10. 0. 6.'
]
card = model.process_card(lines)
card = BDFCard(card)
card = CORD2R(card)
model.add_coord(card)
model.cross_reference()
cord2r = model.Coord(3)
self.assertEqual(cord2r.Cid(), 3)
self.assertEqual(cord2r.Rid(), 0)
cord2r = model.Coord(4)
self.assertEqual(cord2r.Cid(), 4)
self.assertEqual(cord2r.Rid(), 3)
self.assertTrue(allclose(cord2r.i, array([0., 0., 1.])))
delta = cord2r.j - array([1., 1., 0.]) / 2**0.5
self.assertTrue(allclose(cord2r.j, array([1., 1., 0.]) / 2**0.5), str(delta))
delta = cord2r.k - array([-1., 1., 0.]) / 2**0.5
self.assertTrue(allclose(cord2r.k, array([-1., 1., 0.]) / 2**0.5), str(delta))
示例2: test_aesurf_1
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import add_coord [as 别名]
def test_aesurf_1(self):
"""checks the AESURF/AELIST cards"""
aesid = 10
label = 'FLAP'
cid1 = 0
aelist_id1 = 10
cid2 = None
alid2 = None
aesurf1 = AESURF(aesid, label, cid1, aelist_id1, cid2, alid2,
#eff, ldw,
#crefc, crefs, pllim, pulim,
#hmllim, hmulim, tqllim, tqulim,
comment='aesurf comment')
aesurf2 = AESURF.add_card(BDFCard(
[
'AESURF', aesid, label, cid1, aelist_id1, cid2, alid2,
#eff, ldw,
#crefc, crefs, pllim, pulim,
#hmllim, hmulim, tqllim, tqulim,
]), comment='aesurf comment')
#assert aesurf1 == aesurf2
cid2 = 1
coord = CORD2R(cid2, rid=0, origin=[0., 0., 0.],
zaxis=[1., 0., 0.], xzplane=[0., 1., 1.], comment='')
aelist_id1 = 10
aelist_id2 = 20
aesurf2 = AESURF.add_card(BDFCard(
[
'AESURF', aesid, label, cid1, aelist_id1, cid2, aelist_id2,
#eff, ldw,
#crefc, crefs, pllim, pulim,
#hmllim, hmulim, tqllim, tqulim,
]), comment='aesurf comment')
aesurf1.validate()
aesurf2.validate()
log = SimpleLogger(level='warning')
model = BDF()
model.add_coord(coord)
model.add_aesurf(aesurf1)
elements = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
aelist = AELIST(aelist_id1, elements)
model.add_aelist(aelist)
elements = [11, 22, 33, 44, 55, 66, 77, 88, 99]
aelist = AELIST(aelist_id2, elements)
model.add_aelist(aelist)
aesurf1.cross_reference(model)
aesurf1.write_card()
aesurf1.raw_fields()
aesurf1.uncross_reference()
aesurf1.write_card()
aesurf1.cross_reference(model)
aesurf1.raw_fields()
aesurf2.cross_reference(model)
aesurf2.write_card()
aesurf2.raw_fields()
aesurf2.uncross_reference()
aesurf2.write_card()
aesurf2.cross_reference(model)
aesurf2.raw_fields()
示例3: test_spline2
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import add_coord [as 别名]
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()