def test_csschd(self): """checks the CSSCHD card""" #sid = 10 #aesid = 0 #lalpha = None #lmach = None #lschd = None sid = 5 aesid = 50 lalpha = 12 lmach = 15 lschd = 25 card = ['CSSCHD', sid, aesid, lalpha, lmach, lschd] bdf_card = BDFCard(card, has_none=True) csshcd1 = CSSCHD.add_card(bdf_card, comment='csschd card') csshcd1.validate() csshcd1.write_card() label = 'ELEV' cid1 = 0 alid1 = 37 aesurf = AESURF(aesid, label, cid1, alid1) aefact_sid = alid1 Di = [0., 0.5, 1.] aefact_elev = AEFACT(aefact_sid, Di) aefact_sid = lalpha Di = [0., 5., 10.] aefact_alpha = AEFACT(aefact_sid, Di) aefact_sid = lmach Di = [0., 0.7, 0.8] aefact_mach = AEFACT(aefact_sid, Di) aefact_sid = lschd Di = [0., 15., 30., 45.] aefact_delta = AEFACT(aefact_sid, Di) model = BDF() model._add_aesurf_object(aesurf) model._add_aefact_object(aefact_elev) model._add_aefact_object(aefact_alpha) model._add_aefact_object(aefact_mach) model._add_aefact_object(aefact_delta) csshcd1.cross_reference(model) csshcd1.write_card() csshcd1.uncross_reference() csshcd1.write_card() #----------- lalpha = None lmach = None csshcd2 = CSSCHD(sid, aesid, lschd, lalpha=lalpha, lmach=lmach, comment='cssch card') csshcd2.write_card() with self.assertRaises(RuntimeError): csshcd2.validate()
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_object(coord) model._add_aesurf_object(aesurf1) elements = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100] aelist = AELIST(aelist_id1, elements) model._add_aelist_object(aelist) elements = [11, 22, 33, 44, 55, 66, 77, 88, 99] aelist = AELIST(aelist_id2, elements) model._add_aelist_object(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()