Ejemplo n.º 1
0
 def _read_cvisc(self, data, n):
     struct_4i = Struct(self._endian + b'4i')
     nentries = (len(data) - n) // 16
     for i in range(nentries):
         edata = data[n:n + 16]  # 4*4
         out = struct_4i.unpack(edata)
         # (eid, pid, n1, n2) = out
         if self.is_debug_file:
             self.binary_debug.write('  CVISC=%s\n' % str(out))
         element = CVISC.add_op2_data(out)
         self.add_op2_element(element)
         n += 16
     self.increase_card_count('CVISC', nentries)
     return n
Ejemplo n.º 2
0
 def _read_cvisc(self, data, n):
     """CVISC(3901,39, 50) - the marker for Record 104"""
     s = Struct(b(self._endian + '4i'))
     nelements = (len(data) - n) // 16
     for i in range(nelements):
         edata = data[n:n + 16]  # 4*4
         out = s.unpack(edata)
         if self.is_debug_file:
             self.binary_debug.write('  CVISC=%s\n' % str(out))
         #(eid,pid,n1,n2) = out
         elem = CVISC.add_op2_data(out)
         self.addOp2Element(elem)
         n += 16
     self.card_count['CVISC'] = nelements
     return n
Ejemplo n.º 3
0
 def _read_cvisc(self, data: bytes, n: int) -> int:
     """CVISC(3901,39,50) - the marker for Record 105"""
     struct_4i = Struct(self._endian + b'4i')
     ntotal = 16  # 4*4
     nentries = (len(data) - n) // ntotal
     for unused_i in range(nentries):
         edata = data[n:n + ntotal]
         out = struct_4i.unpack(edata)
         if self.is_debug_file:
             self.binary_debug.write('  CVISC=%s\n' % str(out))
         # (eid, pid, n1, n2) = out
         element = CVISC.add_op2_data(out)
         self.add_op2_element(element)
         n += ntotal
     self.increase_card_count('CVISC', nentries)
     return n