Пример #1
0
 def _read_mat4(self, data, n):
     """
     MAT4(2103,21,234) - record 5
     """
     s = Struct(b(self._endian + 'i10f'))
     nmaterials = (len(data) - n) // 44
     for i in range(nmaterials):
         out = s.unpack(data[n:n+44])
         (mid, k, cp, rho, h, mu, hgen, refenth, tch, tdelta, qlat) = out
         mat = MAT4.add_op2_data(out)
         self.add_thermal_material(mat, allow_overwrites=True)
         n += 44
     self.card_count['MAT4'] = nmaterials
     return n
Пример #2
0
 def _read_mat4(self, data, n):
     """
     MAT4(2103,21,234) - record 5
     """
     s = Struct(self._endian + b'i10f')
     nmaterials = (len(data) - n) // 44
     for i in range(nmaterials):
         out = s.unpack(data[n:n + 44])
         (mid, k, cp, rho, h, mu, hgen, refenth, tch, tdelta, qlat) = out
         mat = MAT4.add_op2_data(out)
         self._add_thermal_material_object(mat, allow_overwrites=True)
         n += 44
     self.card_count['MAT4'] = nmaterials
     return n
Пример #3
0
 def _read_mat4(self, data: bytes, n: int) -> int:
     """
     MAT4(2103,21,234) - record 5
     """
     ntotal = 44 * self.factor
     s = Struct(mapfmt(self._endian + b'i10f', self.size))
     nmaterials = (len(data) - n) // ntotal
     for unused_i in range(nmaterials):
         out = s.unpack(data[n:n + ntotal])
         #(mid, k, cp, rho, h, mu, hgen, refenth, tch, tdelta, qlat) = out
         mat = MAT4.add_op2_data(out)
         self._add_thermal_material_object(mat, allow_overwrites=False)
         n += ntotal
     self.card_count['MAT4'] = nmaterials
     return n