Example #1
0
    def _read_mat11(self, data, n):
        """
        MAT11(2903,29,371)
        """
        ntotal = 128  # 23*4
        struc = Struct(b(self._endian + 'i 15f 16i'))
        nmaterials = (len(data) - n) // ntotal
        assert nmaterials > 0, nmaterials
        for i in range(nmaterials):
            edata = data[n:n+ntotal]

            out = struc.unpack(edata)
            (mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23,
             rho, a1, a2, a3, tref, ge) = out[:16]
            mat = MAT11.add_op2_data(out)
            self.add_op2_material(mat)
            n += ntotal
        self.card_count['MAT11'] = nmaterials
        return n
    def _read_mat11(self, data, n):
        """
        MAT11(2903,29,371)
        """
        ntotal = 128  # 23*4
        struc = Struct(b(self._endian + 'i 15f 16i'))
        nmaterials = (len(data) - n) // ntotal
        assert nmaterials > 0, nmaterials
        for i in range(nmaterials):
            edata = data[n:n+ntotal]

            out = struc.unpack(edata)
            (mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23,
             rho, a1, a2, a3, tref, ge) = out[:16]
            mat = MAT11.add_op2_data(out)
            self.add_op2_material(mat)
            n += ntotal
        self.card_count['MAT11'] = nmaterials
        return n
Example #3
0
 def _read_mat11_old(self, data, n):
     """
     MAT11(2903,29,371)
     """
     ntotal = 80  # 20*4
     s = Struct(b(self._endian + 'i 15f 4s 4s 4s 4s'))
     nmaterials = (len(data) - n) // ntotal
     assert nmaterials > 0, nmaterials
     for i in range(nmaterials):
         edata = data[n:n + 80]
         out = s.unpack(edata)
         (mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23, rho, a1, a2, a3,
          tref, ge, blank1, blank2, blank3, blank4) = out
         mat = MAT11.add_op2_data(out)
         assert mid > 0, mat
         self.add_op2_material(mat)
         n += 80
     self.card_count['MAT11'] = nmaterials
     return n
 def _read_mat11_old(self, data, n):
     """
     MAT11(2903,29,371)
     """
     ntotal = 80  # 20*4
     s = Struct(b(self._endian + 'i 15f 4s 4s 4s 4s'))
     nmaterials = (len(data) - n) // ntotal
     assert nmaterials > 0, nmaterials
     for i in range(nmaterials):
         edata = data[n:n+80]
         out = s.unpack(edata)
         (mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23,
          rho, a1, a2, a3, tref, ge,
          blank1, blank2, blank3, blank4) = out
         mat = MAT11.add_op2_data(out)
         assert mid > 0, mat
         self.add_op2_material(mat)
         n += 80
     self.card_count['MAT11'] = nmaterials
     return n
Example #5
0
 def _read_mat11_old(self, data: bytes, n: int) -> int:
     """
     MAT11(2903,29,371)
     """
     ntotal = 80  # 20*4
     s = Struct(self._endian + b'i 15f 4s 4s 4s 4s')
     nmaterials = (len(data) - n) // ntotal
     assert nmaterials > 0, nmaterials
     for unused_i in range(nmaterials):
         edata = data[n:n + 80]
         out = s.unpack(edata)
         (mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23, rho, a1, a2, a3,
          tref, ge, blank1, blank2, blank3, blank4) = out
         if self.is_debug_file:
             self.binary_debug.write('  MAT11-old=%s\n' % str(out))
         mat = MAT11.add_op2_data(out)
         assert mid > 0, mat
         self.add_op2_material(mat)
         n += 80
     self.card_count['MAT11'] = nmaterials
     return n
Example #6
0
    def _read_mat11(self, data: bytes, n: int) -> int:
        """
        MAT11(2903,29,371)
        """
        ntotal = 128 * self.factor  # 23*4
        struc = Struct(mapfmt(self._endian + b'i 15f 16i', self.size))
        nmaterials = (len(data) - n) // ntotal
        assert nmaterials > 0, nmaterials
        for unused_i in range(nmaterials):
            edata = data[n:n + ntotal]

            out = struc.unpack(edata)
            #(mid, e1, e2, e3, nu12, nu13, nu23, g12, g13, g23,
            #rho, a1, a2, a3, tref, ge) = out[:16]
            if self.is_debug_file:
                self.binary_debug.write('  MA11=%s\n' % str(out))
            mat = MAT11.add_op2_data(out)
            self.add_op2_material(mat)
            n += ntotal
        self.card_count['MAT11'] = nmaterials
        return n