• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python f06_formatting.writeImagFloats13E函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pyNastran.f06.f06_formatting.writeImagFloats13E函数的典型用法代码示例。如果您正苦于以下问题:Python writeImagFloats13E函数的具体用法?Python writeImagFloats13E怎么用?Python writeImagFloats13E使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了writeImagFloats13E函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _write_f06_transient

    def _write_f06_transient(self, header, pageStamp, pageNum=1, f=None, is_mag_phase=False):

        words = ['                             C O M P L E X   F O R C E S   I N   B A R   E L E M E N T S   ( C B A R )\n',
                 '                                                          (REAL/IMAGINARY)\n',
                 '0    ELEMENT         BEND-MOMENT END-A            BEND-MOMENT END-B                - SHEAR -               AXIAL\n',
                 '       ID.         PLANE 1       PLANE 2        PLANE 1       PLANE 2        PLANE 1       PLANE 2         FORCE         TORQUE\n']

        msg = []
        for dt, bendA in sorted(self.bendingMomentA.items()):
            header[1] = ' %s = %10.4E\n' % (self.data_code['name'], dt)
            msg += header + words
            for eid in sorted(bendA):
                bm1a, bm2a = self.bendingMomentA[dt][eid]
                bm1b, bm2b = self.bendingMomentB[dt][eid]
                ts1, ts2 = self.shear[dt][eid]
                af = self.axial[dt][eid]
                trq = self.torque[dt][eid]
                (vals2, isAllZeros) = writeImagFloats13E([bm1a, bm2a, bm1b, bm2b, ts1, ts2, af, trq], is_mag_phase)
                [bm1ar, bm2ar, bm1br, bm2br, ts1r, ts2r, afr, trqr,
                 bm1ai, bm2ai, bm1bi, bm2bi, ts1i, ts2i, afi, trqi] = vals2
                msg.append('     %8i    %13s %13s  %13s %13s  %13s %13s  %13s  %-s\n' % (eid, bm1ar, bm2ar, bm1br, bm2br, ts1r, ts2r, afr, trqr))
                msg.append('     %8s    %13s %13s  %13s %13s  %13s %13s  %13s  %-s\n' % ('', bm1ai, bm2ai, bm1bi, bm2bi, ts1i, ts2i, afi, trqi))
            msg.append(pageStamp + str(pageNum) + '\n')
            if f is not None:
                f.write(''.join(msg))
                msg = ['']
            pageNum += 1
        return (''.join(msg), pageNum - 1)
开发者ID:anick107,项目名称:von_mises_rms,代码行数:28,代码来源:oef_complexForceObjects.py


示例2: _write_f06_quad4_bilinear_transient

    def _write_f06_quad4_bilinear_transient(self, dt, eid, n, is_mag_phase, cen):
        """
        CQUAD4 bilinear
        CQUAD8
        CTRIAR
        CTRIA6
        """
        msg = ''
        nids = sorted(self.exx[dt][eid].keys())
        for node_id in nids:
            for ilayer in range(len(self.exx[dt][eid][node_id])):
                fdr = self.fiberCurvature[eid][node_id][ilayer]
                exx = self.exx[dt][eid][node_id][ilayer]
                eyy = self.eyy[dt][eid][node_id][ilayer]
                exy = self.exy[dt][eid][node_id][ilayer]
                ([fdr, exxr, eyyr, exyr,
                  fdi, exxi, eyyi, exyi], is_all_zeros) = writeImagFloats13E([fdr, exx, eyy, exy], is_mag_phase)

                if node_id == 0 and ilayer == 0:
                    msg += '0  %8i %8s  %-13s   %-13s / %-13s   %-13s / %-13s   %-13s /   %s\n' % (eid, cen, fdr, exxr, exxi, eyyr, eyyi, exyr, exyi)
                elif ilayer == 0:
                    msg += '   %8s %8i  %-13s   %-13s / %-13s   %-13s / %-13s   %-13s /   %s\n' % ('', node_id, fdr, exxr, exxi, eyyr, eyyi, exyr, exyi)
                elif ilayer == 1:
                    msg += '   %8s %8s  %-13s   %-13s / %-13s   %-13s / %-13s   %-13s /   %s\n\n' % ('', '', fdr, exxr, exxi, eyyr, eyyi, exyr, exyi)
                else:
                    raise RuntimeError('Invalid option for cquad4')
        return msg
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:27,代码来源:oes_plates.py


示例3: write_f06

    def write_f06(self, header, pageStamp, page_num=1, f=None, is_mag_phase=False):
        if self.nonlinear_factor is not None:
            return self._write_f06_transient(header, pageStamp, page_num, f, is_mag_phase)

        msg = header + [
            '                                 S T R E S S E S   I N   B A R   E L E M E N T S          ( C B A R )\n',
            '  ELEMENT        SA1            SA2            SA3            SA4           AXIAL          SA-MAX         SA-MIN     M.S.-T\n',
            '    ID.          SB1            SB2            SB3            SB4           STRESS         SB-MAX         SB-MIN     M.S.-C\n',
        ]

        for eid, S1s in sorted(self.s1.iteritems()):
            eType = self.eType[eid]
            axial = self.axial[eid]
            s1 = self.s1[eid]
            s2 = self.s2[eid]
            s3 = self.s3[eid]
            s4 = self.s4[eid]

            vals = [s1[0], s2[0], s3[0], s4[0], axial,
                    s1[1], s2[1], s3[1], s4[1], ]
            (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
            [s1ar, s2ar, s3ar, s4ar, axialr,
             s1br, s2br, s3br, s4br,
             s1ai, s2ai, s3ai, s4ai, axiali,
             s1bi, s2bi, s3bi, s4bi, ] = vals2
            msg.append('0%8i   %-13s  %-13s  %-13s  %-13s  %s\n' % (eid, s1ar, s2ar, s3ar, s4ar, axialr))
            msg.append(' %8s   %-13s  %-13s  %-13s  %-13s  %s\n' % ('', s1ai, s2ai, s3ai, s4ai, axiali))

            msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1br, s2br, s3br, s4br))
            msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1bi, s2bi, s3bi, s4bi))

        msg.append(pageStamp % page_num)
        f.write(''.join(msg))
        return page_num
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:34,代码来源:oes_bars.py


示例4: write_f06

    def write_f06(self, header, pageStamp, page_num=1, f=None, is_mag_phase=False):
        msg = []
        #print self.data_code
        hasCycle = hasattr(self, 'mode_cycle')
        for i, (iMode, eigVals) in enumerate(sorted(iteritems(self.translations))):
            msg += header
            freq = self.eigrs[i]
            #freq = 0.0
            msg.append('%16s = %12E\n' % ('EIGENVALUE', freq))
            if hasCycle:
                msg.append('%16s = %12E          C O M P L E X   E I G E N V E C T O R   N O . %10i\n \n' % ('CYCLES', self.mode_cycle, iMode))
            else:
                msg.append('                                         C O M P L E X   E I G E N V E C T O R   N O . %10i\n \n' % (iMode))
            msg.append('      POINT ID.   TYPE          T1             T2             T3             R1             R2             R3\n')
            for nodeID, displacement in sorted(iteritems(eigVals)):
                rotation = self.rotations[iMode][nodeID]
                grid_type = self.gridTypes[nodeID]
                (dx, dy, dz) = displacement
                (rx, ry, rz) = rotation

                vals = [dx, dy, dz, rx, ry, rz]
                (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
                [dxr, dyr, dzr, rxr, ryr, rzr,
                 dxi, dyi, dzi, rxi, ryi, rzi] = vals2
                msg.append('%14i %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n' % (nodeID, grid_type, dxr, dyr, dzr, rxr, ryr, rzr))
                msg.append('%14s %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n' % ('', '', dxi, dyi, dzi, rxi, ryi, rzi))

            msg.append(pageStamp % page_num)
            f.write(''.join(msg))
            msg = ['']
            page_num += 1
        return page_num - 1
开发者ID:umvarma,项目名称:pynastran,代码行数:32,代码来源:oug_eigenvectors.py


示例5: _write_f06_transient

    def _write_f06_transient(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False):
        assert f is not None
        words = ['                         C O M P L E X   F O R C E S   O F   M U L T I   P O I N T   C O N S T R A I N T\n',
                 '                                                          (REAL/IMAGINARY)\n',
                 ' \n',
                 '      POINT ID.   TYPE          T1             T2             T3             R1             R2             R3\n']
        msg = []
        for dt, translations in sorted(iteritems(self.translations)):
            header[1] = ' %s = %10.4E\n' % (self.data_code['name'], dt)
            msg += header + words
            for nodeID, translation in sorted(iteritems(translations)):
                rotation = self.rotations[dt][nodeID]
                grid_type = self.gridTypes[nodeID]

                (dx, dy, dz) = translation
                (rx, ry, rz) = rotation

                vals = [dx, dy, dz, rx, ry, rz]
                (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
                #if not is_all_zeros:
                [v1r, v2r, v3r, v4r, v5r, v6r, v1i,
                    v2i, v3i, v4i, v5i, v6i] = vals2
                msg.append('0%13i %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n' % (nodeID, grid_type, v1r, v2r, v3r, v4r, v5r, v6r.rstrip()))
                msg.append(' %13i %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n' % (nodeID, grid_type, v1i, v2i, v3i, v4i, v5i, v6i.rstrip()))

            msg.append(page_stamp % page_num)
            f.write(''.join(msg))
            page_num += 1
        return page_num - 1
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:29,代码来源:oqg_mpcForces.py


示例6: write_element_transient

    def write_element_transient(self, element_name, nnodes, eids, dt, header, msg, f, is_mag_phase):
        dtLine = ' %14s = %12.5E\n' % (self.data_code['name'], dt)
        header[1] = dtLine
        msg = header + msg

        f.write('\n'.join(msg))
        for eid in eids:
            node_ids = self.exx[dt][eid].keys()
            node_ids.remove('CENTER')
            cid = 10
            f.write('0 %12i %11sGRID CS %2i GP\n' % (eid, 0, nnodes))
            for inode in ['CENTER'] + sorted(node_ids):
                # cid
                oxx = self.exx[dt][eid][inode]
                oyy = self.eyy[dt][eid][inode]
                ozz = self.ezz[dt][eid][inode]
                txy = self.exy[dt][eid][inode]
                tyz = self.eyz[dt][eid][inode]
                txz = self.exz[dt][eid][inode]
                ([oxxr, oyyr, ozzr, txyr, tyzr, txzr,
                  oxxi, oyyi, ozzi, txyi, tyzi, txzi,], is_all_zeros) = writeImagFloats13E([oxx, oyy, ozz,
                                                                                          txy, tyz, txz], is_mag_phase)

                f.write('0   %22s    %-13s  %-13s  %-13s    %-13s  %-13s  %s\n' % (inode, oxxr, oyyr, ozzr, txyr, tyzr, txzr))
                f.write('    %22s    %-13s  %-13s  %-13s    %-13s  %-13s  %s\n' % ('',    oxxi, oyyi, ozzi, txyi, tyzi, txzi))
开发者ID:umvarma,项目名称:pynastran,代码行数:25,代码来源:oes_solids.py


示例7: _write_f06_transient

    def _write_f06_transient(self, header, pageStamp, page_num=1, f=None, is_mag_phase=False):
        words = [
            '                                 S T R E S S E S   I N   B A R   E L E M E N T S          ( C B A R )\n',
            '  ELEMENT        SA1            SA2            SA3            SA4           AXIAL          SA-MAX         SA-MIN     M.S.-T\n',
            '    ID.          SB1            SB2            SB3            SB4           STRESS         SB-MAX         SB-MIN     M.S.-C\n',
        ]
        msg = []
        for dt, S1s in sorted(self.s1.iteritems()):
            header[1] = ' %s = %10.4E\n' % (self.data_code['name'], dt)
            msg += header + words
            for eid, S1 in sorted(S1s.iteritems()):
                eType = self.eType[eid]
                axial = self.axial[dt][eid]
                s1 = self.s1[dt][eid]
                s2 = self.s2[dt][eid]
                s3 = self.s3[dt][eid]
                s4 = self.s4[dt][eid]
                vals = [s1[0], s2[0], s3[0], s4[0], axial,
                        s1[1], s2[1], s3[1], s4[1], ]
                (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
                [s1ar, s2ar, s3ar, s4ar, axialr,
                 s1br, s2br, s3br, s4br,
                 s1ai, s2ai, s3ai, s4ai, axiali,
                 s1bi, s2bi, s3bi, s4bi, ] = vals2
                msg.append('0%8i   %-13s  %-13s  %-13s  %-13s  %s\n' % (eid, s1ar, s2ar, s3ar, s4ar, axialr))
                msg.append(' %8s   %-13s  %-13s  %-13s  %-13s  %s\n' % ('', s1ai, s2ai, s3ai, s4ai, axiali))

                msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1br, s2br, s3br, s4br))
                msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1bi, s2bi, s3bi, s4bi))

            msg.append(pageStamp % page_num)
            f.write(''.join(msg))
            msg = ['']
            page_num += 1
        return page_num - 1
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:35,代码来源:oes_bars.py


示例8: _write_f06_block

    def _write_f06_block(self, words, header, pageStamp, page_num=1, f=None, is_mag_phase=False):
        raise RuntimeError('is this function used???')
        #words += self.getTableMarker()
        if is_mag_phase:
            words += ['                                                         (MAGNITUDE/PHASE)\n', ]
        else:
            words += ['                                                          (REAL/IMAGINARY)\n', ]

        words += [' \n', '      POINT ID.   TYPE          T1             T2             T3             R1             R2             R3\n']

        msg = words
        for node_id, translation in sorted(self.translations.iteritems()):
            rotation = self.rotations[node_id]
            grid_type = self.gridTypes[node_id]

            (dx, dy, dz) = translation
            (rx, ry, rz) = rotation

            vals = [dx, dy, dz, rx, ry, rz]
            (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
            [dxr, dyr, dzr, rxr, ryr, rzr,
             dxi, dyi, dzi, rxi, ryi, rzi] = vals2
            f.write('0 %12i %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n'
                    '  %12s %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n'
                      % (node_id, grid_type, dxr, dyr, dzr, rxr, ryr, rzr,
                                    '', '', dxi, dyi, dzi, rxi, ryi, rzi))

        f.write(pageStamp % page_num)
        msg = ['']
        return page_num
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:30,代码来源:tableObject.py


示例9: _write_f06_block

    def _write_f06_block(self, words, header, pageStamp, pageNum=1, f=None, is_mag_phase=False):
        #words += self.getTableMarker()
        if is_mag_phase:
            words += ['                                                         (MAGNITUDE/PHASE)\n', ]
        else:
            words += ['                                                          (REAL/IMAGINARY)\n', ]

        words += [' \n', '      POINT ID.   TYPE          T1             T2             T3             R1             R2             R3\n']

        msg = words
        for nodeID, translation in sorted(self.translations.items()):
            rotation = self.rotations[nodeID]
            gridType = self.gridTypes[nodeID]

            (dx, dy, dz) = translation
            (rx, ry, rz) = rotation

            vals = [dx, dy, dz, rx, ry, rz]
            (vals2, isAllZeros) = writeImagFloats13E(vals)
            [dxr, dyr, dzr, rxr, ryr, rzr, dxi, dyi, dzi, rxi,
                ryi, rzi] = vals2
            msg.append('0 %12i %6s     %13s  %13s  %13s  %13s  %13s  %-s\n' % (nodeID, gridType, dxr, dyr, dzr, rxr, ryr, rzr.rstrip()))
            msg.append('  %12s %6s     %13s  %13s  %13s  %13s  %13s  %-s\n' %
                       ('', '', dxi, dyi, dzi, rxi, ryi, rzi.rstrip()))

        msg.append(pageStamp + str(pageNum) + '\n')
        if f is not None:
            f.write(''.join(msg))
            msg = ['']
        return (''.join(msg), pageNum)
开发者ID:anick107,项目名称:von_mises_rms,代码行数:30,代码来源:tableObject.py


示例10: _write_f06_transient

    def _write_f06_transient(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False, is_sort1=True):
        """
        .. todo:: improve formatting
        """
        words = [
            "                         C O M P L E X   F O R C E S   I N   S C A L A R   S P R I N G S   ( C E L A S 1 )\n",
            "                                                          (REAL/IMAGINARY)\n",
            " \n",
            "                ELEMENT                                                   ELEMENT\n",
            "                  ID.                    FORCE                              ID.                    FORCE\n",
        ]
        #                   1001       1.537879E+01 /  0.0                            1002       1.537879E+01 /  0.0
        #                   1003       1.537879E+01 /  0.0                            1004       1.537879E+01 /  0.0
        #                   1005       1.537879E+01 /  0.0                            1006       1.537879E+01 /  0.0
        #                   1007       7.689395E+00 /  0.0                            1008       7.689395E+00 /  0.0
        #                   1009       7.689395E+00 /  0.0                            1010       7.689395E+00 /  0.0
        msg = []
        is_mag_phase = False
        for dt, Stress in sorted(iteritems(self.stress)):
            if isinstance(dt, float):  # fix
                header[1] = " %s = %10.4E float %s\n" % (self.data_code["name"], dt, self.analysis_code)
            else:
                header[1] = " %s = %10i integer %s\n" % (self.data_code["name"], dt, self.analysis_code)
            msg += header + words

            i = 0
            for elementID, stress in sorted(iteritems(Stress)):

                if is_mag_phase:
                    stressr = abs(stress)
                    stressi = angle(stress, deg=True)
                else:
                    stressr = stress.real
                    stressi = stress.imag

                (vals2, is_all_zeros) = writeImagFloats13E([stress], is_mag_phase)
                if i == 0:
                    elementID1 = elementID
                    [stress1Real, stress1Imag] = vals2
                if i == 1:
                    elementID2 = elementID
                    [stress2Real, stress2Imag] = vals2
                    msg.append(
                        "%14i %-13s / %-13s  %14i %-13s / %s\n"
                        % (elementID1, stress1Real, stress1Imag, elementID2, stress2Real, stress2Imag)
                    )
                    i = -1
                i += 1
            msg.append(page_stamp % page_num)
            f.write("".join(msg))
            msg = [""]
            page_num += 1
        return page_num - 1
开发者ID:HibernantBear,项目名称:pyNastran,代码行数:53,代码来源:oes_springs.py


示例11: _write_f06_transient

    def _write_f06_transient(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False):
        words = [
            "                             C O M P L E X   F O R C E S   I N   B A R   E L E M E N T S   ( C B A R )\n",
            "                                                          (REAL/IMAGINARY)\n",
            "0    ELEMENT         BEND-MOMENT END-A            BEND-MOMENT END-B                - SHEAR -               AXIAL\n",
            "       ID.         PLANE 1       PLANE 2        PLANE 1       PLANE 2        PLANE 1       PLANE 2         FORCE         TORQUE\n",
        ]

        msg = []
        for dt, bendA in sorted(iteritems(self.bendingMomentA)):
            header[1] = " %s = %10.4E\n" % (self.data_code["name"], dt)
            msg += header + words
            for eid in sorted(bendA):
                bm1a, bm2a = self.bendingMomentA[dt][eid]
                bm1b, bm2b = self.bendingMomentB[dt][eid]
                ts1, ts2 = self.shear[dt][eid]
                af = self.axial[dt][eid]
                trq = self.torque[dt][eid]
                (vals2, is_all_zeros) = writeImagFloats13E([bm1a, bm2a, bm1b, bm2b, ts1, ts2, af, trq], is_mag_phase)
                [
                    bm1ar,
                    bm2ar,
                    bm1br,
                    bm2br,
                    ts1r,
                    ts2r,
                    afr,
                    trqr,
                    bm1ai,
                    bm2ai,
                    bm1bi,
                    bm2bi,
                    ts1i,
                    ts2i,
                    afi,
                    trqi,
                ] = vals2
                msg.append(
                    "     %8i    %-13s %-13s  %-13s %-13s  %-13s %-13s  %-13s  %s\n"
                    % (eid, bm1ar, bm2ar, bm1br, bm2br, ts1r, ts2r, afr, trqr)
                )
                msg.append(
                    "     %8s    %-13s %-13s  %-13s %-13s  %-13s %-13s  %-13s  %s\n"
                    % ("", bm1ai, bm2ai, bm1bi, bm2bi, ts1i, ts2i, afi, trqi)
                )
            msg.append(page_stamp % page_num)
            f.write("".join(msg))
            msg = [""]
            page_num += 1
        return page_num - 1
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:50,代码来源:oef_complexForceObjects.py


示例12: write_f06

    def write_f06(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False, is_sort1=True):
        msg = []
        #print self.data_code
        hasCycle = hasattr(self, 'mode_cycle')
        assert len(self.eigis) == len(self.translations)
        for i, (iMode, eigVals) in enumerate(sorted(iteritems(self.translations))):
            msg += header
            eigr = self.eigrs[i]
            eigi = self.eigis[i]
            eigr = 0. if eigr == -0. else eigr
            eigi = 0. if eigi == -0. else eigi

            f.write(''.join(header))
            f.write('      %16s = %12E, %12E\n' % ('COMPLEX EIGENVALUE', eigr, eigi))
            if hasCycle:
                f.write('%16s = %12E          C O M P L E X   E I G E N V E C T O R   N O . %10i\n \n' % ('CYCLES', self.mode_cycle, iMode))
            else:
                # TODO: should there be an extra ' \n'???
                f.write('                                       C O M P L E X   E I G E N V E C T O R   NO. %10i\n' % (iMode))

            if is_mag_phase:
                f.write('                                                         (MAGNITUDE/PHASE)\n \n')
            else:
                f.write('                                                          (REAL/IMAGINARY)\n \n')
            f.write('      POINT ID.   TYPE          T1             T2             T3             R1             R2             R3\n')
            for nodeID, displacement in sorted(iteritems(eigVals)):
                rotation = self.rotations[iMode][nodeID]
                grid_type = self.gridTypes[nodeID]
                (dx, dy, dz) = displacement
                (rx, ry, rz) = rotation

                vals = [dx, dy, dz, rx, ry, rz]
                (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
                [dxr, dyr, dzr, rxr, ryr, rzr,
                 dxi, dyi, dzi, rxi, ryi, rzi] = vals2
                if grid_type == 'S':
                    f.write('0%13i %6s     %-13s\n' % (nodeID, grid_type, dxr))
                    f.write(' %13s %6s     %-13s\n' % ('', '', dxi))
                else:
                    f.write('0%13i %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n' % (nodeID, grid_type, dxr, dyr, dzr, rxr, ryr, rzr))
                    f.write(' %13s %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %s\n' % ('', '', dxi, dyi, dzi, rxi, ryi, rzi))

            f.write(page_stamp % page_num)
            msg = ['']
            page_num += 1
        return page_num - 1
开发者ID:HibernantBear,项目名称:pyNastran,代码行数:46,代码来源:oug_eigenvectors.py


示例13: _write_f06_tri3_transient

    def _write_f06_tri3_transient(self, dt, eid, n, is_mag_phase):
        msg = ''
        nids = sorted(self.exx[dt][eid].keys())
        for node_id in nids:
            for ilayer in range(len(self.exx[dt][eid][node_id])):
                fdr = self.fiberCurvature[eid][node_id][ilayer]
                exx = self.exx[dt][eid][node_id][ilayer]
                eyy = self.eyy[dt][eid][node_id][ilayer]
                exy = self.exy[dt][eid][node_id][ilayer]

                ([fdr, exxr, eyyr, exyr,
                  fdi, exxi, eyyi, exyi], is_all_zeros) = writeImagFloats13E([fdr, exx, eyy, exy], is_mag_phase)
                if ilayer == 0:
                    msg += '0  %6i   %-13s     %-13s / %-13s     %-13s / %-13s     %-13s / %s\n' % (eid, fdr, exxr, exxi, eyyr, eyyi, exyr, exyi)
                else:
                    msg += '   %6s   %-13s     %-13s / %-13s     %-13s / %-13s     %-13s / %s\n' % ('', fdr, exxr, exxi, eyyr, eyyi, exyr, exyi)
        return msg
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:17,代码来源:oes_plates.py


示例14: write_f06

    def write_f06(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False):
        if self.nonlinear_factor is not None:
            return self._write_f06_transient(header, page_stamp, page_num, f, is_mag_phase)
        msg = header + [
            "                             C O M P L E X   F O R C E S   I N   B A R   E L E M E N T S   ( C B A R )\n",
            "                                                          (REAL/IMAGINARY)\n",
            "0    ELEMENT         BEND-MOMENT END-A            BEND-MOMENT END-B                - SHEAR -               AXIAL\n",
            "       ID.         PLANE 1       PLANE 2        PLANE 1       PLANE 2        PLANE 1       PLANE 2         FORCE         TORQUE\n",
        ]

        for eid in sorted(self.bendingMomentA):
            bm1a, bm2a = self.bendingMomentA[eid]
            bm1b, bm2b = self.bendingMomentB[eid]
            ts1, ts2 = self.shear[eid]
            af = self.axial[eid]
            trq = self.torque[eid]
            (vals2, is_all_zeros) = writeImagFloats13E([bm1a, bm2a, bm1b, bm2b, ts1, ts2, af, trq], is_mag_phase)
            [
                bm1ar,
                bm2ar,
                bm1br,
                bm2br,
                ts1r,
                ts2r,
                afr,
                trqr,
                bm1ai,
                bm2ai,
                bm1bi,
                bm2bi,
                ts1i,
                ts2i,
                afi,
                trqi,
            ] = vals2
            msg.append(
                "     %8i    %-13s %-13s  %-13s %-13s  %-13s %-13s  %-13s  %s\n"
                % (eid, bm1ar, bm2ar, bm1br, bm2br, ts1r, ts2r, afr, trqr)
            )
            msg.append(
                "     %8s    %-13s %-13s  %-13s %-13s  %-13s %-13s  %-13s  %s\n"
                % ("", bm1ai, bm2ai, bm1bi, bm2bi, ts1i, ts2i, afi, trqi)
            )
        msg.append(page_stamp % page_num)
        f.write("".join(msg))
        return page_num
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:46,代码来源:oef_complexForceObjects.py


示例15: write_f06

    def write_f06(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False, is_sort1=True):
        f.write('%s write_f06 not implemented...\n' % self.__class__.__name__)
        return page_num

        if self.nonlinear_factor is not None:
            return self._write_f06_transient(header, page_stamp, page_num, f, is_mag_phase, is_sort1=is_sort1)

        msg = header + [
            '                                  S T R A I N S    I N   B A R   E L E M E N T S          ( C B A R )\n',
            '  ELEMENT        SA1            SA2            SA3            SA4           AXIAL          SA-MAX         SA-MIN     M.S.-T\n',
            '    ID.          SB1            SB2            SB3            SB4           STRAIN         SB-MAX         SB-MIN     M.S.-C\n',
        ]
        for eid, E1s in sorted(iteritems(self.e1)):
            eType = self.eType[eid]
            axial = self.axial[eid]

            e1 = self.e1[eid]
            e2 = self.e2[eid]
            e3 = self.e3[eid]
            e4 = self.e4[eid]
            vals = [e1[0], e2[0], e3[0], e4[0], axial,
                    e1[1], e2[1], e3[1], e4[1]]
            #(vals2, is_all_zeros) = writeFloats13E(vals)
            #[e10, e20, e30, e40, axial,
             #e11, e21, e31, e41] = vals2

            #vals = (s1ai, s2ai, s3ai, s4ai, axiali,
                    #s2ai, s2bi, s2ci, s2di)
            (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
            (s1ar, s2ar, s3ar, s4ar, axialr,
             s1br, s2br, s3br, s4br,
             s1ai, s2ai, s3ai, s4ai, axiali,
             s1bi, s2bi, s3bi, s4bi) = vals2

            msg.append('0%8i   %-13s  %-13s  %-13s  %-13s  %s\n' % (eid, s1ar, s2ar, s3ar, s4ar, axialr))
            msg.append(' %8s   %-13s  %-13s  %-13s  %-13s  %s\n' % ('', s1ai, s2ai, s3ai, s4ai, axiali))

            msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1br, s2br, s3br, s4br))
            msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1bi, s2bi, s3bi, s4bi))

            #msg.append('0%8i   %-13s  %-13s  %-13s  %-13s  %-13s  %-13s  %-13s %s\n' % (eid, e10, e20, e30, e40, axial))
            #msg.append(' %8s   %-13s  %-13s  %-13s  %-13s  %-13s  %-13s  %-13s %s\n' % ('', e11, e21, e31, e41))
        msg.append(page_stamp % page_num)
        f.write(''.join(msg))
        return page_num
开发者ID:HibernantBear,项目名称:pyNastran,代码行数:45,代码来源:oes_bars.py


示例16: write_f06

    def write_f06(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False, is_sort1=True):
        msg_temp, nnodes = get_f06_header(self, is_mag_phase, is_sort1)

        # write the f06
        ntimes = self.data.shape[0]

        cid = 0
        for itime in range(ntimes):
            dt = self._times[itime]

            #print('eids=', eids)

            dt_line = ' %14s = %12.5E\n' % (self.data_code['name'], dt)
            header[1] = dt_line
            msg = header + msg_temp
            f.write('\n'.join(msg))

            # TODO: can I get this without a reshape?
            oxx = self.data[itime, :, 0]
            oyy = self.data[itime, :, 1]
            ozz = self.data[itime, :, 2]
            txy = self.data[itime, :, 3]
            tyz = self.data[itime, :, 4]
            txz = self.data[itime, :, 5]

            eids2 = self.element_node[:, 0]
            nodes = self.element_node[:, 1]

            # loop over all the elements and nodes
            for deid, node, doxx, doyy, dozz, dtxy, dtyz, dtxz in zip(eids2, nodes, oxx, oyy, ozz, txy, tyz, txz):
                # TODO: cid not supported
                ([oxxr, oyyr, ozzr, txyr, tyzr, txzr,
                  oxxi, oyyi, ozzi, txyi, tyzi, txzi,], is_all_zeros) = writeImagFloats13E([doxx, doyy, dozz,
                                                                                            dtxy, dtyz, dtxz], is_mag_phase)
                if node == 0:  # CENTER
                    f.write('0 %12i %11sGRID CS %2i GP\n' % (deid, cid, nnodes))
                    f.write('0   %22s    %-13s  %-13s  %-13s    %-13s  %-13s  %s\n' % ('CENTER', oxxr, oyyr, ozzr, txyr, tyzr, txzr))
                    f.write('    %22s    %-13s  %-13s  %-13s    %-13s  %-13s  %s\n' % ('', oxxi, oyyi, ozzi, txyi, tyzi, txzi))
                else:
                    f.write('0   %22s    %-13s  %-13s  %-13s    %-13s  %-13s  %s\n' % (node, oxxr, oyyr, ozzr, txyr, tyzr, txzr))
                    f.write('    %22s    %-13s  %-13s  %-13s    %-13s  %-13s  %s\n' % ('', oxxi, oyyi, ozzi, txyi, tyzi, txzi))
            f.write(page_stamp % page_num)
            page_num += 1
        return page_num - 1
开发者ID:HibernantBear,项目名称:pyNastran,代码行数:44,代码来源:oes_solids.py


示例17: _write_f06_transient_block

    def _write_f06_transient_block(self, words, header, page_stamp, page_num, f, is_mag_phase):
        if is_mag_phase:
            words += ['                                                         (MAGNITUDE/PHASE)\n', ]
        else:
            words += ['                                                          (REAL/IMAGINARY)\n', ]

        words += [' \n', '      POINT ID.   TYPE          T1             T2             T3             R1             R2             R3\n']
        #words += self.getTableMarker()

        if not len(header) >= 3:
            header.append('')
        for itime in range(self.ntimes):
            node = self.node_gridtype[:, 0]
            gridtype = self.node_gridtype[:, 1]
            t1 = self.data[itime, :, 0]
            t2 = self.data[itime, :, 1]
            t3 = self.data[itime, :, 2]
            r1 = self.data[itime, :, 3]
            r2 = self.data[itime, :, 4]
            r3 = self.data[itime, :, 5]

            dt = self._times[itime]
            header[2] = ' %s = %10.4E\n' % (self.data_code['name'], dt)
            f.write(''.join(header + words))
            for node_id, gridtypei, t1i, t2i, t3i, r1i, r2i, r3i in zip(node, gridtype, t1, t2, t3, r1, r2, r3):
                sgridtype = self.recast_gridtype_as_string(gridtypei)
                vals = [t1i, t2i, t3i, r1i, r2i, r3i]
                (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
                [dxr, dyr, dzr, rxr, ryr, rzr,
                 dxi, dyi, dzi, rxi, ryi, rzi] = vals2
                #if not is_all_zeros:
                if sgridtype == 'S':
                    f.write('0 %12i %6s     %-s\n'
                            '  %12s %6s     %-s\n' % (
                                node_id, sgridtype, dxr,
                                '', '', dxi))
                else:
                    f.write('0 %12i %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %-s\n'
                            '  %12s %6s     %-13s  %-13s  %-13s  %-13s  %-13s  %-s\n' % (
                                node_id, sgridtype, dxr, dyr, dzr, rxr, ryr, rzr,
                                            '', '', dxi, dyi, dzi, rxi, ryi, rzi))
            f.write(page_stamp % page_num)
            page_num += 1
        return page_num - 1
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:44,代码来源:tableObject.py


示例18: _write_sort1_as_sort1

    def _write_sort1_as_sort1(self, f, name, header, page_stamp, msg_temp, page_num,
                              is_mag_phase=False):
        ntimes = self.data.shape[0]
        for itime in range(ntimes):
            dt = self._times[itime]

            dt_line = ' %14s = %12.5E\n' % (name, dt)
            header[1] = dt_line
            msg = header + msg_temp
            f.write('\n'.join(msg))

            # TODO: can I get this without a reshape?
            sa1 = self.data[itime, :, 0]
            sa2 = self.data[itime, :, 1]
            sa3 = self.data[itime, :, 2]
            sa4 = self.data[itime, :, 3]
            axial = self.data[itime, :, 4]
            sb1 = self.data[itime, :, 5]
            sb2 = self.data[itime, :, 6]
            sb3 = self.data[itime, :, 7]
            sb4 = self.data[itime, :, 8]
            #[sa1, sa2, sa3, sa4, axial, sb1, sb2, sb3, sb4]

            eids = self.element
            for eid, s1ai, s2ai, s3ai, s4ai, axiali, s2ai, s2bi, s2ci, s2di in zip(eids, sa1, sa2, sa3, sa4, axial, sb1, sb2, sb3, sb4):
                vals = (s1ai, s2ai, s3ai, s4ai, axiali,
                        s2ai, s2bi, s2ci, s2di)
                (vals2, is_all_zeros) = writeImagFloats13E(vals, is_mag_phase)
                (s1ar, s2ar, s3ar, s4ar, axialr,
                 s1br, s2br, s3br, s4br,
                 s1ai, s2ai, s3ai, s4ai, axiali,
                 s1bi, s2bi, s3bi, s4bi) = vals2

                msg.append('0%8i   %-13s  %-13s  %-13s  %-13s  %s\n' % (eid, s1ar, s2ar, s3ar, s4ar, axialr))
                msg.append(' %8s   %-13s  %-13s  %-13s  %-13s  %s\n' % ('', s1ai, s2ai, s3ai, s4ai, axiali))

                msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1br, s2br, s3br, s4br))
                msg.append(' %8s   %-13s  %-13s  %-13s  %s\n' % ('', s1bi, s2bi, s3bi, s4bi))
            f.write(page_stamp % page_num)
            page_num += 1
        return page_num
开发者ID:HibernantBear,项目名称:pyNastran,代码行数:41,代码来源:oes_bars.py


示例19: _write_f06_transient

    def _write_f06_transient(self, header, page_stamp, page_num=1, f=None, is_mag_phase=False):
        if self.element_type == 1:
            element_header = '                           C O M P L E X    S T R A I N S    I N   R O D   E L E M E N T S   ( C R O D )\n'
        elif self.element_type == 3:
            element_header = '                          C O M P L E X    S T R A I N S    I N   R O D   E L E M E N T S   ( C T U B E )\n'
        elif self.element_type == 10:
            element_header = '                         C O M P L E X    S T R A I N S    I N   R O D   E L E M E N T S   ( C O N R O D )\n'
        else:
            raise NotImplementedError('element_name=%r element_type=%s' % (self.element_name, self.element_type))

        if is_mag_phase:
            mag_phase = '                                                          (MAG/PHASE)\n'  # not tested
        else:
            mag_phase = '                                                          (REAL/IMAGINARY)\n'

        words = [element_header,
                    mag_phase,
                    ' \n',
                    '                 ELEMENT                             AXIAL                                         TORQUE\n',
                    '                   ID.                               FORCE\n',
                    '                       1                 -2.459512E+05 /  3.377728E+04                  0.0          /  0.0\n',]
        words = ['                                       S T R A I N S   I N   R O D   E L E M E N T S      ( C R O D )\n',
                 '       ELEMENT       AXIAL       SAFETY      TORSIONAL     SAFETY       ELEMENT       AXIAL       SAFETY      TORSIONAL     SAFETY\n',
                 '         ID.        STRAIN       MARGIN        STRAIN      MARGIN         ID.        STRAIN       MARGIN        STRAIN      MARGIN\n']
        msg = []
        for dt, axials in sorted(iteritems(self.axial)):
            dtLine = '%14s = %12.5E\n' % (self.data_code['name'], dt)
            header[2] = dtLine
            msg += header + words
            out = []
            for eid in sorted(axials):
                axial = self.axial[dt][eid]
                torsion = self.torsion[dt][eid]
                ([axialr, torsionr, axiali, torsioni], is_all_zeros) = writeImagFloats13E([axial, torsion], is_mag_phase)
                f.write('                %8i                 %-13s / %-13s                 %-13s / %s\n' % (eid, axialr, axiali, torsionr, torsioni))
            msg.append(page_stamp % page_num)
            page_num += 1
            f.write(''.join(msg))
        return page_num - 1
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:39,代码来源:oes_rods.py


示例20: write_f06

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python f06_formatting.write_floats_13e函数代码示例发布时间:2022-05-25
下一篇:
Python f06_formatting.writeFloats13E函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap