def to_mat1(self) -> MAT1: return MAT1(self.mid, self.E, self.G, self.nu, rho=self.rho, a=self.alpha)
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))
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
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