当前位置: 首页>>代码示例>>Python>>正文


Python f06_formatting.writeImagFloats13E函数代码示例

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


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


注:本文中的pyNastran.f06.f06_formatting.writeImagFloats13E函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。