def build(self): """sizes the vectorized attributes of the ComplexShearArray""" if not hasattr(self, 'subtitle'): self.subtitle = self.data_code['subtitle'] #print('ntimes=%s nelements=%s ntotal=%s subtitle=%s' % ( #self.ntimes, self.nelements, self.ntotal, self.subtitle)) nnodes = 1 #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes self.ntotal = self.nelements * nnodes # * 2 #self.ntotal self.itime = 0 self.ielement = 0 self.itotal = 0 #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) self._times = np.zeros(self.ntimes, dtype=dtype) #self.ntotal = self.nelements * nnodes self.element = np.zeros(self.nelements, dtype=idtype) # the number is messed up because of the offset for the element's properties if self.nelements != self.ntotal: msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % ( self.ntimes, self.nelements, nnodes, self.nelements * nnodes, self.ntotal) raise RuntimeError(msg) # [max_shear, avg_shear] self.data = np.zeros((self.ntimes, self.ntotal, 2), dtype=cfdtype)
def build(self): """sizes the vectorized attributes of the ComplexCBeamArray""" #print('ntimes=%s nelements=%s ntotal=%s subtitle=%s' % ( #self.ntimes, self.nelements, self.ntotal, self.subtitle)) nnodes = 1 #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes #self.ntotal //= self.ntimes self.itime = 0 self.ielement = 0 self.itotal = 0 self.is_built = True #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype(self.nonlinear_factor, self.size) self._times = zeros(self.ntimes, dtype) #self.element = array(self.nelements, dtype='|S8') #self.ntotal = self.nelements * nnodes self.element_node = zeros((self.ntotal, 2), idtype) self.sd = zeros(self.ntotal, 'float32') # the number is messed up because of the offset for the element's properties #if self.nelements * nnodes != self.ntotal: #msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % (self.ntimes, #self.nelements, nnodes, #self.nelements * nnodes, #self.ntotal) #raise RuntimeError(msg) #[sxc, sxd, sxe, sxf] self.data = zeros((self.ntimes, self.ntotal, 4), cfdtype)
def build(self): """sizes the vectorized attributes of the ComplexCBarArray""" #print('ntimes=%s nelements=%s ntotal=%s subtitle=%s' % ( #self.ntimes, self.nelements, self.ntotal, self.subtitle)) #nnodes = 1 #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes #self.ntotal //= self.ntimes self.itime = 0 self.ielement = 0 self.itotal = 0 #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) self._times = zeros(self.ntimes, dtype=dtype) #self.element = array(self.nelements, dtype='|S8') #self.ntotal = self.nelements * nnodes self.element = zeros(self.ntotal, dtype=idtype) # the number is messed up because of the offset for the element's properties #if self.nelements * nnodes != self.ntotal: #msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % (self.ntimes, #self.nelements, nnodes, #self.nelements * nnodes, #self.ntotal) #raise RuntimeError(msg) #[s1a, s2a, s3a, s4a, axial, s2a, s2b, s2c, s2d] self.data = zeros((self.ntimes, self.ntotal, 9), cfdtype)
def build(self) -> None: """sizes the vectorized attributes of the ComplexPlateArray C:\MSC.Software\simcenter_nastran_2019.2\tpl_post1\cqrdbx111.op2 name; nelements numwide ndata size ntotal nelements nnodes nlayers """ if not hasattr(self, 'subtitle'): self.subtitle = self.data_code['subtitle'] #print(self._ntotals, self.ntotal) #print(self.code_information()) #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes #print('element_type=%r ntimes=%s nelements=%s nnodes=%s ntotal=%s subtitle=%s' % ( #self.element_type, self.ntimes, self.nelements, nnodes, self.ntotal, self.subtitle)) #self.ntotal = self.nelements * nnodes * 2 #self.ntotal self.itime = 0 self.ielement = 0 self.itotal = 0 #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) if self.is_sort1: ntimes = self.ntimes nlayers = self.ntotal #print(f' SORT1: ntimes={ntimes} nlayers={nlayers} {self.element_name}-{self.element_type}') else: raise NotImplementedError(self.code_information()) #elif self.is_sort2: #nelements = self.ntimes #nlayers = nelements * 2 * nnodes #ntimes = self.ntotal #print(f' SORT2: ntimes={ntimes} nlayers={nlayers} {self.element_name}-{self.element_type}') #print("nelements=%s nlayers=%s ntimes=%s" % (nelements, nlayers, ntimes)) self._times = zeros(ntimes, dtype=dtype) #self.ntotal = self.nelements * nnodes # the number is messed up because of the offset for the element's properties #if not self.nelements * nnodes * 2 == self.ntotal: #msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % ( #self.ntimes, self.nelements, nnodes, #self.nelements * nnodes, self.ntotal) #raise RuntimeError(msg) # [o1a, o2a, t12a, o1za, o2za, # o1b, o2b, t12b, o1zb, e2zb, ovm] self.data = zeros((ntimes, nlayers, 11), dtype=cfdtype) self.element_layer = zeros((nlayers, 2), dtype=idtype)
def build(self) -> None: """sizes the vectorized attributes of the ComplexPlateArray""" if not hasattr(self, 'subtitle'): self.subtitle = self.data_code['subtitle'] nnodes = self.nnodes_per_element #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes #print('element_type=%r ntimes=%s nelements=%s nnodes=%s ntotal=%s subtitle=%s' % ( #self.element_type, self.ntimes, self.nelements, nnodes, self.ntotal, self.subtitle)) self.ntotal = self.nelements * nnodes * 2 #self.ntotal self.itime = 0 self.ielement = 0 self.itotal = 0 self.is_built = True #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) self._times = zeros(self.ntimes, dtype=dtype) #self.ntotal = self.nelements * nnodes # TODO: could be more efficient by using nelements for cid self.element_node = zeros((self.ntotal, 2), dtype=idtype) #self.element_cid = zeros((self.nelements, 2), 'int32') # the number is messed up because of the offset for the element's properties #if not self.nelements * nnodes * 2 == self.ntotal: #msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % ( #self.ntimes, self.nelements, nnodes, #self.nelements * nnodes, self.ntotal) #raise RuntimeError(msg) self.fiber_curvature = zeros(self.ntotal, 'float32') if self.has_von_mises: # [oxx, oyy, txy, ovm] self.data = zeros((self.ntimes, self.ntotal, 4), dtype=cfdtype) else: # [oxx, oyy, txy] self.data = zeros((self.ntimes, self.ntotal, 3), 'complex64')
def build(self): """sizes the vectorized attributes of the ComplexCBushArray""" assert self.ntimes > 0, 'ntimes=%s' % self.ntimes assert self.nelements > 0, 'nelements=%s' % self.nelements assert self.ntotal > 0, 'ntotal=%s' % self.ntotal self.nelements //= self.ntimes self.itime = 0 self.ielement = 0 self.itotal = 0 #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) self._times = zeros(self.ntimes, dtype=dtype) self.element = zeros(self.nelements, dtype=idtype) #[tx, ty, tz, rx, ry, rz] self.data = zeros((self.ntimes, self.nelements, 6), dtype=cfdtype)
def build(self): """sizes the vectorized attributes of the ComplexSolidArray""" #print('ntimes=%s nelements=%s ntotal=%s subtitle=%s' % ( #self.ntimes, self.nelements, self.ntotal, self.subtitle)) nnodes = self.nnodes_per_element #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes #self.ntotal //= self.ntimes self.itime = 0 self.ielement = 0 self.itotal = 0 self.is_built = True #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) self._times = zeros(self.ntimes, dtype=dtype) #self.element_types2 = array(self.nelements, dtype='|S8') #self.element_types3 = zeros((self.nelements, 2), dtype='int32') #self.ntotal = self.nelements * nnodes # TODO: could be more efficient by using nelements for cid self.element_node = zeros((self.ntotal, 2), dtype=idtype) self.element_cid = zeros((self.nelements, 2), dtype=idtype) # the number is messed up because of the offset for the element's properties #if not self.nelements * nnodes == self.ntotal: #msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % (self.ntimes, #self.nelements, nnodes, #self.nelements * nnodes, #self.ntotal) #raise RuntimeError(msg) if self.result_flag == 0: # [oxx, oyy, ozz, txy, tyz, txz] self.data = zeros((self.ntimes, self.ntotal, 6), dtype=cfdtype) else: # oxx self.data = zeros((self.ntimes, self.ntotal, 1), 'complex64')
def build(self): """sizes the vectorized attributes of the ComplexRodArray""" assert self.ntimes > 0, 'ntimes=%s' % self.ntimes assert self.nelements > 0, 'nelements=%s' % self.nelements assert self.ntotal > 0, 'ntotal=%s' % self.ntotal self.nelements //= self.ntimes self.itime = 0 self.ielement = 0 self.itotal = 0 self.is_built = True #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) self._times = zeros(self.ntimes, dtype=dtype) self.element = zeros(self.nelements, dtype=idtype) #[axial, torsion] self.data = zeros((self.ntimes, self.nelements, 2), dtype=cfdtype)
def build(self): """sizes the vectorized attributes of the ComplexSpringDamperArray""" #print('ntimes=%s nelements=%s ntotal=%s' % (self.ntimes, self.nelements, self.ntotal)) assert self.ntimes > 0, 'ntimes=%s' % self.ntimes assert self.nelements > 0, 'nelements=%s' % self.nelements assert self.ntotal > 0, 'ntotal=%s' % self.ntotal #self.names = [] self.nelements //= self.ntimes self.itime = 0 self.ielement = 0 self.itotal = 0 #self.ntimes = 0 #self.nelements = 0 #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) self._times = zeros(self.ntimes, dtype=dtype) self.element = zeros(self.nelements, dtype=idtype) #[spring_stress] self.data = zeros((self.ntimes, self.ntotal, 1), dtype=cfdtype)
def build(self) -> None: """sizes the vectorized attributes of the ComplexPlateArray C:\MSC.Software\simcenter_nastran_2019.2\tpl_post1\cqrdbx111.op2 name; nelements numwide ndata size ntotal nelements nnodes nlayers CQUADR-82 6 77 1848 4 4*77=308 1848/308=6 5 2*5*6=60 CTRIAR-70 9 62 2232 4 4*62=248 2232/248=9 4 2*9*4=72 """ if not hasattr(self, 'subtitle'): self.subtitle = self.data_code['subtitle'] nnodes = self.nnodes_per_element #print(self._ntotals, self.ntotal) #print(self.code_information()) #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes #print('element_type=%r ntimes=%s nelements=%s nnodes=%s ntotal=%s subtitle=%s' % ( #self.element_type, self.ntimes, self.nelements, nnodes, self.ntotal, self.subtitle)) #self.ntotal = self.nelements * nnodes * 2 #self.ntotal self.itime = 0 self.ielement = 0 self.itotal = 0 #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype( self.nonlinear_factor, self.size) if self.is_sort1: ntimes = self.ntimes nelements = self.ntotal # // (2 * nnodes) # neids=actual number of elements nlayers = self.ntotal #nx = ntimes #ny = self.ntotal #print(f' SORT1: ntimes={ntimes} nelements={nelements} nlayers={nlayers} {self.element_name}-{self.element_type}') #if self.element_type == 74: #aasdf elif self.is_sort2: nelements = self.ntimes nlayers = nelements * 2 * nnodes ntimes = self.ntotal #print(f' SORT2: ntimes={ntimes} nelements={nelements} nlayers={nlayers} {self.element_name}-{self.element_type}') #print("nelements=%s nlayers=%s ntimes=%s" % (nelements, nlayers, ntimes)) self._times = zeros(ntimes, dtype=dtype) #self.ntotal = self.nelements * nnodes # the number is messed up because of the offset for the element's properties #if not self.nelements * nnodes * 2 == self.ntotal: #msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % ( #self.ntimes, self.nelements, nnodes, #self.nelements * nnodes, self.ntotal) #raise RuntimeError(msg) self.fiber_curvature = zeros(nlayers, 'float32') nelement_nodes = nlayers # [oxx, oyy, txy] self.data = zeros((ntimes, nlayers, 3), dtype=cfdtype) # TODO: could be more efficient by using nelements for cid self.element_node = zeros((nelement_nodes, 2), dtype=idtype)
def build(self) -> None: """sizes the vectorized attributes of the ComplexPlateArray SORT1: - etype SORT ndata numwide size -> nelements ntimes nnodes ntotal_layers - CQUAD8 1 1044 87 4 1044/(4*87)=3 xxx 5 3*5=15 C:\MSC.Software\simcenter_nastran_2019.2\tpl_post2\tr1081x.op2 - QUADR 2 3828 87 1 3828/(4*87)=11 10 2*1*10=20 C:\MSC.Software\simcenter_nastran_2019.2\tpl_post2\cqromids111.op2 """ if not hasattr(self, 'subtitle'): self.subtitle = self.data_code['subtitle'] nnodes = self.nnodes_per_element #print(self._ntotals, self.ntotal) #print(self.code_information()) #self.names = [] #self.nelements //= nnodes self.nelements //= self.ntimes #print('element_type=%r ntimes=%s nelements=%s nnodes=%s ntotal=%s subtitle=%s' % ( #self.element_type, self.ntimes, self.nelements, nnodes, self.ntotal, self.subtitle)) #self.ntotal = self.nelements * nnodes * 2 #self.ntotal self.itime = 0 self.ielement = 0 self.itotal = 0 #print('ntotal=%s ntimes=%s nelements=%s' % (self.ntotal, self.ntimes, self.nelements)) #print("ntimes=%s nelements=%s ntotal=%s" % (self.ntimes, self.nelements, self.ntotal)) dtype, idtype, cfdtype = get_complex_times_dtype(self.nonlinear_factor, self.size) # nelements is the actual number of elements if self.is_sort1: ntimes = self.ntimes nelements = self.ntotal // 2 nlayers = self.ntotal #print(f' SORT1: ntimes={ntimes} nelements={nelements} nlayers={nlayers} {self.element_name}-{self.element_type}') elif self.is_sort2: #print(self._ntotals) nelements = self.ntimes nlayers = nelements * 2 * nnodes ntimes = self.ntotal // (2 * nnodes) #print(f' SORT2: ntimes={ntimes} nelements={nelements} nnodes={nnodes} nlayers={nlayers} {self.element_name}-{self.element_type}') #print(f'{self.element_name}-{self.element_type} nelements={nelements} nlayers={nlayers} ntimes={ntimes}') self._times = zeros(ntimes, dtype=dtype) #self.ntotal = self.nelements * nnodes # the number is messed up because of the offset for the element's properties #if not self.nelements * nnodes * 2 == self.ntotal: #msg = 'ntimes=%s nelements=%s nnodes=%s ne*nn=%s ntotal=%s' % ( #self.ntimes, self.nelements, nnodes, #self.nelements * nnodes, self.ntotal) #raise RuntimeError(msg) self.fiber_curvature = zeros(nlayers, 'float32') # [oxx, oyy, txy, ovm] self.data = zeros((ntimes, nlayers, 4), dtype=cfdtype) # we could use nelements*2 to make it smaller, but it'd be harder self.element_node = zeros((nlayers, 2), dtype=idtype)