Example #1
0
    def _read_grav(self, data: bytes, n: int) -> int:
        """
        GRAV(4401,44,26) - the marker for Record 7

        Word Name Type Description
        1 SID I Load set identification number
        2 CID I Coordinate system identification number
        3 A RS Acceleration vector scale factor
        4 N(3) RS Components of a vector coordinate system defined by CID
        7 MB I Bulk Data Section with CID definition: -1=main, 0=partitioned
        """
        ntotal = 28 * self.factor  # 7*4
        s = Struct(mapfmt(self._endian + b'ii4fi', self.size))
        nentries = (len(data) - n) // ntotal
        for unused_i in range(nentries):
            edata = data[n:n + ntotal]
            out = s.unpack(edata)
            if self.is_debug_file:
                self.binary_debug.write('  GRAV=%s\n' % str(out))
            #(sid, cid, a, n1, n2, n3, mb) = out
            grav = GRAV.add_op2_data(out)
            self._add_load_object(grav)
            n += ntotal
        self.card_count['GRAV'] = nentries
        return n
Example #2
0
 def _read_grav(self, data, n):
     """
     GRAV(4401,44,26) - the marker for Record 7
     """
     ntotal = 28  # 7*4
     s = Struct(b(self._endian + 'ii4fi'))
     nentries = (len(data) - n) // ntotal
     for i in range(nentries):
         edata = data[n:n + 28]
         out = s.unpack(edata)
         (sid, cid, a, n1, n2, n3, mb) = out
         grav = GRAV.add_op2_data(out)
         self._add_load_object(grav)
         n += 28
     self.card_count['GRAV'] = nentries
     return n
Example #3
0
 def _read_grav(self, data, n):
     """
     GRAV(4401,44,26) - the marker for Record 7
     """
     ntotal = 28  # 7*4
     s = Struct(b(self._endian + 'ii4fi'))
     nentries = (len(data) - n) // ntotal
     for i in range(nentries):
         edata = data[n:n + 28]
         out = s.unpack(edata)
         (sid, cid, a, n1, n2, n3, mb) = out
         grav = GRAV.add_op2_data(out)
         self._add_load_object(grav)
         n += 28
     self.card_count['GRAV'] = nentries
     return n