def _read_rload2_msc(self, data, n): """ RLOAD2(5207,52,132) - Record 27 MSC 1 SID I Load set identification number 2 DAREA I DAREA Bulk Data entry identification number 3 DPHASE I DPHASE Bulk Data entry identification number 4 DELAY I DELAY Bulk Data entry identification number 5 TB I TABLEDi Bulk Data entry identification number for B(f) 6 TP I TABLEDi Bulk Data entry identification number for Phi(f) 7 TYPE I Nature of the dynamic excitation 8 T RS Time delay 9 PH RS Phase lead """ dloads = [] ntotal = 36 nentries = (len(data) - n) // ntotal struc = Struct(self._endian + b'7i 2f') for unused_i in range(nentries): edata = data[n:n+ntotal] out = struc.unpack(edata) sid, darea, dphasei, delayi, tbi, tpi, load_type, tau, phase = out if self.is_debug_file: self.binary_debug.write(' RLOAD2=%s\n' % str(out)) dload = RLOAD2(sid, darea, delay=delayi, dphase=dphasei, tb=tbi, tp=tpi, Type=load_type, comment='') dloads.append(dload) n += ntotal return n, dloads
def _read_rload2_nx(self, data, n): """ RLOAD2(5207,52,132) - Record 27 NX 1 SID I Load set identification number 2 DAREA I DAREA Bulk Data entry identification number 3 DELAYI I DELAY Bulk Data entry identification number 4 DPHASEI I DPHASE Bulk Data entry identification number 5 TBI I TABLEDi Bulk Data entry identification number for B(f) 6 TPI I TABLEDi Bulk Data entry identification number for Phi(f) 7 TYPE I Nature of the dynamic excitation 8 DELAYR RS If DELAYI = 0, constant value for delay 9 DPHASER RS If DPHASEI = 0, constant value for phase 10 TBR RS If TBI = 0, constant value for B(f) 11 TPR RS If TPI = 0, constant value for PHI(f) """ dloads = [] ntotal = 44 nentries = (len(data) - n) // ntotal struc = Struct(self._endian + b'7i 4f') for unused_i in range(nentries): edata = data[n:n + ntotal] out = struc.unpack(edata) sid, darea, delayi, dphasei, tbi, tpi, load_type, delayr, dphaser, tbr, tpr = out if self.is_debug_file: self.binary_debug.write(' RLOAD2=%s\n' % str(out)) tb = tbi tp = tpi delay = delayi dphase = dphasei if tbi == 0: tb = tbr if tpi == 0: tp = tpr if delayi == 0: delay = delayr if dphasei == 0: dphase = dphaser dload = RLOAD2(sid, darea, delay=delay, dphase=dphase, tb=tb, tp=tp, Type=load_type, comment='') dloads.append(dload) n += ntotal return n, dloads