Ejemplo n.º 1
0
 def to_mat1(self) -> MAT1:
     return MAT1(self.mid,
                 self.E,
                 self.G,
                 self.nu,
                 rho=self.rho,
                 a=self.alpha)
Ejemplo n.º 2
0
 def readMAT1(self, data):
     """
     MAT1(103,1,77) - record 2
     """
     #print "reading MAT1"
     while len(data) >= 48:  # 12*4
         eData = data[:48]
         data = data[48:]
         out = unpack('iffffffffffi', eData)
         (mid, E, G, nu, rho, A, TRef, ge, St, Sc, Ss, mcsid) = out
         self.addOp2Material(MAT1(None, out))
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
 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
Ejemplo n.º 5
0
 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
Ejemplo n.º 6
0
 def _readMAT1(self, data, n):
     """
     MAT1(103,1,77) - record 2
     """
     #print "reading MAT1"
     ntotal = 48  # 12*4
     s = Struct(b'i10fi')
     nmaterials = (len(data) - n) // ntotal
     for i in xrange(nmaterials):
         eData = data[n:n+48]
         out = s.unpack(eData)
         (mid, E, G, nu, rho, A, TRef, ge, St, Sc, Ss, mcsid) = out
         self.addOp2Material(MAT1(None, out))
         n += ntotal
     self.card_count['MAT1'] = nmaterials
     return n
Ejemplo n.º 7
0
 def add_mat1(self, card, comment):
     #self.mat1.add(card, comment)
     mid = integer(card, 1, 'material_id')
     mat = MAT1(card=card, comment=comment)
     #mat.add(card=card, comment=comment)
     self.mat1[mid] = mat