def _read_mat1(self, data, n): """ MAT1(103,1,77) - record 2 """ ntotal = 48 # 12*4 s = Struct(b(self._endian + 'i10fi')) nmaterials = (len(data) - n) // ntotal for i in range(nmaterials): edata = data[n:n+48] out = s.unpack(edata) (mid, E, G, nu, rho, A, TRef, ge, St, Sc, Ss, mcsid) = out mat = MAT1.add_op2_data(out) self.add_op2_material(mat) n += ntotal self.card_count['MAT1'] = nmaterials return n
def _read_mat1(self, data, n): """ MAT1(103,1,77) - record 2 """ ntotal = 48 # 12*4 s = Struct(self._endian + b'i10fi') nmaterials = (len(data) - n) // ntotal for i in range(nmaterials): edata = data[n:n + 48] out = s.unpack(edata) #(mid, E, G, nu, rho, A, tref, ge, St, Sc, Ss, mcsid) = out mat = MAT1.add_op2_data(out) self.add_op2_material(mat) n += ntotal self.card_count['MAT1'] = nmaterials return n
def _read_mat1(self, data: bytes, n: int) -> int: """ MAT1(103,1,77) - record 2 """ ntotal = 48 * self.factor # 12*4 s = Struct(mapfmt(self._endian + b'i10fi', self.size)) nmaterials = (len(data) - n) // ntotal for unused_i in range(nmaterials): edata = data[n:n + ntotal] out = s.unpack(edata) #(mid, E, G, nu, rho, A, tref, ge, St, Sc, Ss, mcsid) = out mat = MAT1.add_op2_data(out) self.add_op2_material(mat) n += ntotal self.card_count['MAT1'] = nmaterials return n