本文整理汇总了Python中pyNastran.bdf.bdf.BDF.update_card方法的典型用法代码示例。如果您正苦于以下问题:Python BDF.update_card方法的具体用法?Python BDF.update_card怎么用?Python BDF.update_card使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyNastran.bdf.bdf.BDF
的用法示例。
在下文中一共展示了BDF.update_card方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_openmdao_field_1
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import update_card [as 别名]
def test_openmdao_field_1(self):
model = BDF(debug=False)
node = GRID(57, cp=10, xyz=[1., 2., 3.], cd=7, ps='', seid=0, comment='')
model.nodes[57] = node
#print()
str(node)
model.update_card('GRID', 57, 2, 11) # cp
str(node)
model.update_card('GRID', 57, 2, 12) # cp
str(node)
model.update_card('GRID', 57, 3, 13.) # x
str(node)
model.update_card('GRID', 57, 4, 14.) # y
str(node)
model.update_card('GRID', 57, 4, 14.) # y
str(node)
示例2: test_openmdao_good_1
# 需要导入模块: from pyNastran.bdf.bdf import BDF [as 别名]
# 或者: from pyNastran.bdf.bdf.BDF import update_card [as 别名]
def test_openmdao_good_1(self):
updates = [
#['MAT1', 3, 10.0], # 3 is E -> set to 10.0
#['MAT1', 4, 10.0], # 3 is G -> set to 10.0
['GRID', 1, 3, 10.0], # 3 is x1 -> set to 10.0
['GRID', 1, 4, 20.0], # 4 is x2 -> set to 20.0
['CPENTA', 9, 2, 10], # 2 is property_id -> set to 10
['CPENTA', 9, 3, 20], # 3 is node1 -> set to 20
['PSOLID', 4, 1, 2], # 1 is material_id
['PARAM', 'WTMASS', 1, 'WTMASs'], # key
['PARAM', 'WTMASS', 2, 0.0025], # value1
['PCOMP', 1, 2, 1.],
['PCOMP', 1, 3, 2.],
['PCOMP', 1, 12, 'YES_A'],
['PCOMP', 1, 16, 'YES_B'],
['PCOMP', 1, 20, 'YES_C'],
['CTETRA', 8, 3, 1], # nid[0]
['CTETRA', 8, 4, 2], # nid[1]
['CTETRA', 8, 5, 3], # nid[2]
['CTETRA', 8, 6, 4], # nid[3]
]
#GRID 1 0 0. 0. 0. 0
#GRID 2 0 1. 0. 0. 0
#GRID 3 0 1. 1. 0. 0
#GRID 4 0 0. 1. 0. 0
#CPENTA 9 4 21 22 23 24 25 26
#PSOLID 4 1 0
#CTETRA 8 4 11 12 13 15
bdf_filename = os.path.join(test_path, 'unit', 'test_mass.dat')
model = BDF()
model.read_bdf(bdf_filename)
for iupdate in updates:
Type, iType, ifield, value = iupdate
card = model.update_card(Type, iType, ifield, value)