def _read_qbdy3(self, data, n): """ QBDY3(2109,21,414) - the marker for Record 26 """ ntotal = 16 # 4*4 nentries = (len(data) - n) // ntotal for i in range(nentries): edata = data[n:n + 16] out = unpack('ifii', edata) (sid, q0, cntrlnd, eid) = out load = QBDY3.add_op2_data(out) self._add_thermal_load_object(load) n += 16 self.card_count['QBDY3'] = nentries return n
def _read_qbdy3(self, data, n): """ QBDY3(2109,21,414) - the marker for Record 26 """ ntotal = 16 # 4*4 nentries = (len(data) - n) // ntotal for i in range(nentries): edata = data[n:n + 16] out = unpack('ifii', edata) (sid, q0, cntrlnd, eid) = out load = QBDY3.add_op2_data(out) self.add_thermal_load(load) n += 16 self.card_count['QBDY3'] = nentries return n
def readQBDY3(self, data): """ QBDY3(2109,21,414) - the marker for Record 26 """ #print "reading QBDY3" n = 0 nEntries = len(data) // 16 # 4*4 for i in range(nEntries): eData = data[n:n + 16] out = unpack('ifii', eData) (sid, q0, cntrlnd, eid) = out load = QBDY3(None, out) self.add_thermal_load(load) n += 16 data = data[n:]
def _read_qbdy3(self, data: bytes, n: int) -> int: """ QBDY3(2109,21,414) - the marker for Record 26 """ ntotal = 16 # 4*4 nentries = (len(data) - n) // ntotal struct_if2i = Struct(self._endian + b'ifii') for unused_i in range(nentries): edata = data[n:n + 16] out = struct_if2i.unpack(edata) #(sid, q0, cntrlnd, eid) = out load = QBDY3.add_op2_data(out) self._add_thermal_load_object(load) n += 16 self.card_count['QBDY3'] = nentries return n
def _readQBDY3(self, data, n): """ QBDY3(2109,21,414) - the marker for Record 26 """ #print "reading QBDY3" ntotal = 16 # 4*4 nEntries = (len(data) - n) // ntotal for i in xrange(nEntries): eData = data[n:n + 16] out = unpack('ifii', eData) (sid, q0, cntrlnd, eid) = out load = QBDY3(None, out) self.add_thermal_load(load) n += 16 self.card_count['QBDY3'] = nEntries return n
def _mirror_loads(model: BDF, nid_offset: int = 0, eid_offset: int = 0): """ Mirrors the loads. A mirrored force acts in the same direction. Considers: - PLOAD4 - no coordinate systems (assumes cid=0) - FORCE, FORCE1, FORCE2, MOMENT, MOMENT1, MOMENT2 - PLOAD, PLOAD2 - TEMP, QVOL, QHBDY, QBDY1, QBDY2, QBDY3 """ for unused_load_id, loads in model.loads.items(): for load in loads: loads_new = [] load_type = load.type if load_type == 'PLOAD4': g1 = None g34 = None if load.g1 is not None: g1 = load.g1 + nid_offset if load.g34 is not None: g34 = load.g34 + nid_offset eids = [eid + eid_offset for eid in load.eids] load = PLOAD4(load.sid, eids, load.pressures, g1, g34, cid=load.cid, nvector=load.nvector, surf_or_line=load.surf_or_line, line_load_dir=load.line_load_dir, comment='') loads_new.append(load) elif load_type == 'FORCE': load = FORCE(load.sid, load.node + nid_offset, load.mag, load.xyz, cid=load.cid, comment='') loads_new.append(load) elif load_type == 'FORCE1': load = FORCE1(load.sid, load.node + nid_offset, load.mag, load.g1 + nid_offset, load.g2 + nid_offset, comment='') loads_new.append(load) elif load_type == 'FORCE2': load = FORCE2(load.sid, load.node + nid_offset, load.mag, load.g1 + nid_offset, load.g2 + nid_offset, load.g3 + nid_offset, load.g4 + nid_offset, comment='') loads_new.append(load) elif load_type == 'MOMENT': load = MOMENT(load.sid, load.node + nid_offset, load.mag, load.xyz, cid=load.cid, comment='') loads_new.append(load) elif load_type == 'MOMENT1': load = MOMENT1(load.sid, load.node + nid_offset, load.mag, load.g1 + nid_offset, load.g2 + nid_offset, comment='') loads_new.append(load) elif load_type == 'MOMENT2': load = MOMENT2(load.sid, load.node + nid_offset, load.mag, load.g1 + nid_offset, load.g2 + nid_offset, load.g3 + nid_offset, load.g4 + nid_offset, comment='') loads_new.append(load) elif load_type == 'PLOAD': nodes = [nid + nid_offset for nid in load.nodes] load = PLOAD(load.sid, load.pressure, nodes, comment='') loads_new.append(load) elif load_type == 'PLOAD2': eids = [eid + eid_offset for eid in load.eids] load = PLOAD2(load.sid, load.pressure, eids, comment='') loads_new.append(load) elif load_type == 'QVOL': elements = [eid + eid_offset for eid in load.elements] load = QVOL(load.sid, load.qvol, nid_offset + load.control_point, elements) loads_new.append(load) elif load_type == 'QHBDY': grids = [nid + nid_offset for nid in load.grids] load = QHBDY(load.sid, load.flag, load.q0, grids, af=load.af) loads_new.append(load) elif load_type == 'QBDY1': eids = [eid + eid_offset for eid in load.eids] load = QBDY1(load.sid, load.qflux, eids) loads_new.append(load) elif load_type == 'QBDY2': load = QBDY2(load.sid, load.eid + eid_offset, load.qfluxs, comment='') loads_new.append(load) elif load_type == 'QBDY3': eids = [eid + eid_offset for eid in load.eids] load = QBDY3(load.sid, load.q0, load.cntrlnd + nid_offset, eids) loads_new.append(load) elif load_type == 'TEMP': temperatures = {} for nid, temp in load.temperatures.items(): temperatures[nid + nid_offset] = temp load = TEMP(load.sid, temperatures) loads_new.append(load) elif load_type == 'GRAV': pass else: # pragma: no cover model.log.warning('skipping:\n%s' % load.rstrip()) if loads_new: loads += loads_new