コード例 #1
0
    def _read_buckling_eigenvalue_4(self, data):
        # BLAMA - Buckling eigenvalue summary table
        # CLAMA - Complex eigenvalue summary table
        # LAMA - Normal modes eigenvalue summary table
        if self.read_mode == 1:
            return len(data)

        msg = '_read_buckling_eigenvalue_4'
        #return self._not_implemented_or_skip(data, msg)  # TODO: implement buckling eigenvalues

        ntotal = 4 * 7
        nModes = len(data) // ntotal
        n = 0
        #assert self.isubcase != 0, self.isubcase
        blama = BucklingEigenvalues(11)
        self.eigenvalues[self.Title] = blama
        #self.eigenvalues[self.isubcase] = lama
        s = Struct(b'ii5f')
        for i in range(nModes):
            edata = data[n:n+ntotal]
            out = s.unpack(edata)
            if self.debug4():
                self.binary_debug.write('  eigenvalue%s - %s\n' % (i, str(out)))
            (iMode, order, eigen, omega, freq, mass, stiff) = out # BLAMA??
            #(modeNum, extractOrder, eigenvalue, radian, cycle, genM, genK) = line  # LAMA
            #(rootNum, extractOrder, eigr, eigi, cycle, damping) = data  # CLAMA
            blama.addF06Line(out)
            n += ntotal
        return n
コード例 #2
0
    def _read_buckling_eigenvalue_4(self, data, ndata):
        """parses the Buckling Eigenvalues Table 4 Data"""
        # BLAMA - Buckling eigenvalue summary table
        # CLAMA - Complex eigenvalue summary table
        # LAMA - Normal modes eigenvalue summary table
        if self.read_mode == 1:
            return ndata

        ntotal = 4 * 7
        nmodes = ndata // ntotal
        n = 0
        #assert self.isubcase != 0, self.isubcase
        blama = BucklingEigenvalues(11)
        self.eigenvalues[self.title] = blama
        #self.eigenvalues[self.isubcase] = lama
        s = Struct(b(self._endian + 'ii5f'))
        for i in range(nmodes):
            edata = data[n:n + ntotal]
            out = s.unpack(edata)
            if self.is_debug_file:
                self.binary_debug.write('  eigenvalue%s - %s\n' %
                                        (i, str(out)))
            (imode, order, eigen, omega, freq, mass, stiff) = out  # BLAMA??
            #(modeNum, extractOrder, eigenvalue, radian, cycle, genM, genK) = line  # LAMA
            #(rootNum, extractOrder, eigr, eigi, cycle, damping) = data  # CLAMA
            blama.add_f06_line(out)
            n += ntotal
        return n
コード例 #3
0
ファイル: lama.py プロジェクト: zhenhaochu/pyNastran
    def _read_buckling_eigenvalue_4(self, data: bytes, ndata: int):
        """parses the Buckling Eigenvalues Table 4 Data"""
        # BLAMA - Buckling eigenvalue summary table
        # CLAMA - Complex eigenvalue summary table
        # LAMA - Normal modes eigenvalue summary table
        if self.read_mode == 1:
            return ndata

        ntotal = 28  # 4 * 7
        nmodes = ndata // ntotal
        n = 0
        #assert self.isubcase != 0, self.isubcase
        blama = BucklingEigenvalues(self.title, self.table_name, nmodes)
        #assert self.title not in self.eigenvalues, f'table={self.table_name_str} title={self.title} optimization_count={self._count}'
        self.eigenvalues[self.title] = blama
        #self.eigenvalues[self.isubcase] = lama
        structi = Struct(self._endian + b'ii5f')
        for i in range(nmodes):
            edata = data[n:n + ntotal]
            out = structi.unpack(edata)
            if self.is_debug_file:
                self.binary_debug.write('  eigenvalue%s - %s\n' %
                                        (i, str(out)))
            #(imode, order, eigen, omega, freq, mass, stiff) = out # BLAMA??
            #(mode_num, extract_order, eigenvalue, radian, cycle, genM, genK) = line  # LAMA
            #(root_num, extract_order, eigr, eigi, cycle, damping) = data  # CLAMA
            blama.add_op2_line(out, i)
            n += ntotal
        return n
コード例 #4
0
ファイル: lama.py プロジェクト: EmanueleCannizzaro/pyNastran
    def _read_buckling_eigenvalue_4(self, data, ndata):
        """parses the Buckling Eigenvalues Table 4 Data"""
        # BLAMA - Buckling eigenvalue summary table
        # CLAMA - Complex eigenvalue summary table
        # LAMA - Normal modes eigenvalue summary table
        if self.read_mode == 1:
            return ndata

        ntotal = 4 * 7
        nmodes = ndata // ntotal
        n = 0
        #assert self.isubcase != 0, self.isubcase
        blama = BucklingEigenvalues(11)
        self.eigenvalues[self.title] = blama
        #self.eigenvalues[self.isubcase] = lama
        s = Struct(b(self._endian + 'ii5f'))
        for i in range(nmodes):
            edata = data[n:n+ntotal]
            out = s.unpack(edata)
            if self.is_debug_file:
                self.binary_debug.write('  eigenvalue%s - %s\n' % (i, str(out)))
            (imode, order, eigen, omega, freq, mass, stiff) = out # BLAMA??
            #(modeNum, extractOrder, eigenvalue, radian, cycle, genM, genK) = line  # LAMA
            #(rootNum, extractOrder, eigr, eigi, cycle, damping) = data  # CLAMA
            blama.add_f06_line(out)
            n += ntotal
        return n
コード例 #5
0
def _load_eigenvalue(h5_result, log):
    """Loads a RealEigenvalue"""
    class_name = _cast(h5_result.get('class_name'))
    title = ''
    nmodes = _cast(h5_result.get('nmodes'))
    if class_name == 'RealEigenvalues':
        obj = RealEigenvalues(title, nmodes=nmodes)
    elif class_name == 'ComplexEigenvalues':
        obj = ComplexEigenvalues(title, nmodes)
    elif class_name == 'BucklingEigenvalues':
        obj = BucklingEigenvalues(title, nmodes=nmodes)
    else:
        log.warning('  %r is not supported...skipping' % class_name)
        return None

    assert obj.class_name == class_name, 'class_name=%r selected; should be %r' % (obj.class_name, class_name)
    keys_to_skip = ['class_name', 'is_complex', 'is_real']
    for key in h5_result.keys():
        if key in keys_to_skip:
            continue
        else:
            datai = _cast(h5_result.get(key))
            assert not isinstance(datai, binary_type), key
            setattr(obj, key, datai)
    return obj