def _read_mat10(self, data: bytes, n: int) -> int: """ MAT10(2801,28,365) - record 9 Word Name Type Description 1 MID I Material identification number 2 BULK RS Bulk modulus 3 RHO RS Mass density 4 C RS Speed of sound 5 GE RS Structural damping coefficient """ ntotal = 20 * self.factor # 5*4 s = Struct(mapfmt(self._endian + b'i4f', self.size)) nmaterials = (len(data) - n) // ntotal assert nmaterials > 0, nmaterials for unused_i in range(nmaterials): edata = data[n:n + ntotal] out = s.unpack(edata) n += ntotal (mid, bulk, rho, c, ge) = out if self.is_debug_file: self.binary_debug.write(' MAT10=%s\n' % str(out)) if mid == 0 and bulk == 0. and rho == 0. and c == 0. and ge == 0.: self.log.debug(' skipping empty MAT10...') continue mat = MAT10.add_op2_data(out) assert mat.mid > 0, mat self.add_op2_material(mat) self.card_count['MAT10'] = nmaterials return n
def _read_mat10(self, data, n): """ MAT10(2801,28,365) - record 9 """ ntotal = 20 # 5*4 s = Struct(b(self._endian + 'i4f')) nmaterials = (len(data) - n) // ntotal assert nmaterials > 0, nmaterials for i in range(nmaterials): edata = data[n:n+20] out = s.unpack(edata) (mid, bulk, rho, c, ge) = out assert mid > 0, out mat = MAT10.add_op2_data(out) assert mat.mid > 0, mat self.add_op2_material(mat) n += 20 self.card_count['MAT10'] = nmaterials return n
def _read_mat10(self, data, n): """ MAT10(2801,28,365) - record 9 """ #self.log.debug("reading MAT10") ntotal = 20 # 5*4 s = Struct(b(self._endian + 'i4f')) nmaterials = (len(data) - n) // ntotal assert nmaterials > 0, nmaterials for i in range(nmaterials): edata = data[n:n+20] out = s.unpack(edata) (mid, bulk, rho, c, ge) = out assert mid > 0, out mat = MAT10.add_op2_data(out) assert mat.mid > 0, mat self.add_op2_material(mat) n += 20 self.card_count['MAT10'] = nmaterials return n