Ejemplo n.º 1
0
    def write_f06(self,
                  header,
                  pageStamp,
                  pageNum=1,
                  f=None,
                  is_mag_phase=False):
        if self.nonlinear_factor is not None:
            return self._write_f06_transient(header, pageStamp, pageNum, f)

        msg = header + [
            '                                  S T R E S S E S   A T   G R I D   P O I N T S   - -     S U R F A C E       5\n',
            '0                       SURFACE X-AXIS X  NORMAL(Z-AXIS)  Z         REFERENCE COORDINATE SYSTEM FOR SURFACE DEFINITION CID        0\n',
            '     GRID      ELEMENT            STRESSES IN SURFACE SYSTEM           PRINCIPAL STRESSES            MAX             \n',
            '     ID          ID    FIBRE   NORMAL-X   NORMAL-Y   SHEAR-XY     ANGLE      MAJOR      MINOR      SHEAR     VON MISES\n'
        ]
        #'0     13683          3736    TRIAX6         4.996584E+00   0.0            1.203093E+02   0.0            0.0            0.0'
        #'      13683          3737    TRIAX6        -4.996584E+00   0.0           -1.203093E+02   0.0            0.0            0.0'
        #'      13683                  *TOTALS*       6.366463E-12   0.0           -1.364242E-12   0.0            0.0            0.0'
        for eKey, nxs in sorted(self.nx.items()):
            eKey2 = eKey
            zero = '0'
            for iLoad, nx in enumerate(nxs):
                ny = self.ny[eKey][iLoad]
                txy = self.txy[eKey][iLoad]
                angle = self.angle[eKey][iLoad]
                majorP = self.majorP[eKey][iLoad]
                minorP = self.minorP[eKey][iLoad]
                tmax = self.tmax[eKey][iLoad]
                ovm = self.ovm[eKey][iLoad]

                (elemName) = self.elemName[eKey][iLoad]
                eid = self.eids[eKey][iLoad]
                vals = [nx, ny, txy, majorP, minorP, tmax, ovm]
                (vals2, isAllZeros) = writeFloats10E(vals)
                [nx, ny, txy, majorP, minorP, tmax, ovm] = vals2
                if eid == 0:
                    eid = zero
                msg.append(
                    '%s%8s  %8s   %4s    %s %s %s   %7.4f %s %s %s  %-s\n' %
                    (zero, eKey2, eid, elemName, nx, ny, txy, angle, majorP,
                     minorP, tmax, ovm.rstrip()))
                zero = ' '
                eKey2 = ' '

        msg.append(pageStamp + str(pageNum) + '\n')
        if f is not None:
            f.write(''.join(msg))
            msg = ['']
        return (''.join(msg), pageNum)
Ejemplo n.º 2
0
    def write_f06(self,
                  header,
                  pageStamp,
                  page_num=1,
                  f=None,
                  is_mag_phase=False):
        f.write(
            'GridPointStressesVolumeObject write_f06 is not implemented...\n')
        return page_num

        #raise NotImplementedError()
        if self.nonlinear_factor is not None:
            return self._write_f06_transient(header, pageStamp, page_num, f)

        msg = header + [
            '                                  S T R E S S E S   A T   G R I D   P O I N T S   - -     S U R F A C E       5\n',
            '0                       SURFACE X-AXIS X  NORMAL(Z-AXIS)  Z         REFERENCE COORDINATE SYSTEM FOR SURFACE DEFINITION CID        0\n',
            '     GRID      ELEMENT            STRESSES IN SURFACE SYSTEM           PRINCIPAL STRESSES            MAX             \n',
            '     ID          ID    FIBRE   NORMAL-X   NORMAL-Y   SHEAR-XY     ANGLE      MAJOR      MINOR      SHEAR     VON MISES\n'
        ]
        #'0     13683          3736    TRIAX6         4.996584E+00   0.0            1.203093E+02   0.0            0.0            0.0'
        #'      13683          3737    TRIAX6        -4.996584E+00   0.0           -1.203093E+02   0.0            0.0            0.0'
        #'      13683                  *TOTALS*       6.366463E-12   0.0           -1.364242E-12   0.0            0.0            0.0'
        for eKey, nxs in sorted(iteritems(self.nx)):
            eKey2 = eKey
            zero = '0'
            for iLoad, nx in enumerate(nxs):
                ny = self.ny[eKey][iLoad]
                nz = self.nz[eKey][iLoad]
                txy = self.txy[eKey][iLoad]
                tyz = self.tyz[eKey][iLoad]
                txz = self.txz[eKey][iLoad]
                pressure = self.pressure[eKey][iLoad]
                ovm = self.ovm[eKey][iLoad]

                #(elemName) = self.elemName[eKey][iLoad]
                #eid = self.eids[eKey][iLoad]
                vals = [nx, ny, nz, txy, tyz, txz, pressure, ovm]
                (vals2, is_all_zeros) = writeFloats10E(vals)
                [nx, ny, nz, txy, tyz, txz, pressure, ovm] = vals2
                msg.append('%s%8s  %s %s %s   %s %s %s %s  %-s\n' %
                           (zero, eKey, nx, ny, nz, txy, tyz, txz, pressure,
                            ovm.rstrip()))
                zero = ' '
                eKey2 = ' '

        msg.append(pageStamp % page_num)
        f.write(''.join(msg))
        return page_num
    def write_f06(self, f, header=None, page_stamp='PAGE %s', page_num=1, is_mag_phase=False, is_sort1=True):
        if header is None:
            header = []
        f.write('GridPointStressesVolumeObject write_f06 is not implemented...\n')
        return page_num

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

        msg = header + ['                                  S T R E S S E S   A T   G R I D   P O I N T S   - -     S U R F A C E       5\n',
                        '0                       SURFACE X-AXIS X  NORMAL(Z-AXIS)  Z         REFERENCE COORDINATE SYSTEM FOR SURFACE DEFINITION CID        0\n',
                        '     GRID      ELEMENT            STRESSES IN SURFACE SYSTEM           PRINCIPAL STRESSES            MAX             \n',
                        '     ID          ID    FIBRE   NORMAL-X   NORMAL-Y   SHEAR-XY     ANGLE      MAJOR      MINOR      SHEAR     VON MISES\n']
              #'0     13683          3736    TRIAX6         4.996584E+00   0.0            1.203093E+02   0.0            0.0            0.0'
              #'      13683          3737    TRIAX6        -4.996584E+00   0.0           -1.203093E+02   0.0            0.0            0.0'
              #'      13683                  *TOTALS*       6.366463E-12   0.0           -1.364242E-12   0.0            0.0            0.0'
        for ekey, nxs in sorted(iteritems(self.nx)):
            ekey2 = ekey
            zero = '0'
            for iLoad, nx in enumerate(nxs):
                ny = self.ny[ekey][iLoad]
                nz = self.nz[ekey][iLoad]
                txy = self.txy[ekey][iLoad]
                tyz = self.tyz[ekey][iLoad]
                txz = self.txz[ekey][iLoad]
                pressure = self.pressure[ekey][iLoad]
                ovm = self.ovm[ekey][iLoad]

                #(elemName) = self.elemName[ekey][iLoad]
                #eid = self.eids[ekey][iLoad]
                vals = [nx, ny, nz, txy, tyz, txz, pressure, ovm]
                (vals2, is_all_zeros) = writeFloats10E(vals)
                [nx, ny, nz, txy, tyz, txz, pressure, ovm] = vals2
                msg.append('%s%8s  %s %s %s   %s %s %s %s  %-s\n' % (zero, ekey, nx, ny, nz, txy, tyz, txz, pressure, ovm.rstrip()))
                zero = ' '
                ekey2 = ' '

        msg.append(page_stamp % page_num)
        f.write(''.join(msg))
        return page_num
    def write_f06(self, f, header=None, page_stamp='PAGE %s', page_num=1, is_mag_phase=False, is_sort1=True):
        if header is None:
            header = []
        if self.nonlinear_factor is not None:
            return self._write_f06_transient(header, page_stamp, page_num, f, is_mag_phase=is_mag_phase, is_sort1=is_sort1)

        msg = header + ['                                  S T R E S S E S   A T   G R I D   P O I N T S   - -     S U R F A C E       5\n',
                        '0                       SURFACE X-AXIS X  NORMAL(Z-AXIS)  Z         REFERENCE COORDINATE SYSTEM FOR SURFACE DEFINITION CID        0\n',
                        '     GRID      ELEMENT            STRESSES IN SURFACE SYSTEM           PRINCIPAL STRESSES            MAX             \n',
                        '     ID          ID    FIBRE   NORMAL-X   NORMAL-Y   SHEAR-XY     ANGLE      MAJOR      MINOR      SHEAR     VON MISES\n']
              #'0     13683          3736    TRIAX6         4.996584E+00   0.0            1.203093E+02   0.0            0.0            0.0'
              #'      13683          3737    TRIAX6        -4.996584E+00   0.0           -1.203093E+02   0.0            0.0            0.0'
              #'      13683                  *TOTALS*       6.366463E-12   0.0           -1.364242E-12   0.0            0.0            0.0'
        for ekey, nxs in sorted(iteritems(self.nx)):
            ekey2 = ekey
            zero = '0'
            for iLoad, nx in enumerate(nxs):
                ny = self.ny[ekey][iLoad]
                txy = self.txy[ekey][iLoad]
                angle = self.angle[ekey][iLoad]
                majorP = self.majorP[ekey][iLoad]
                minorP = self.minorP[ekey][iLoad]
                tmax = self.tmax[ekey][iLoad]
                ovm = self.ovm[ekey][iLoad]

                (elemName) = self.elemName[ekey][iLoad]
                eid = self.eids[ekey][iLoad]
                vals = [nx, ny, txy, majorP, minorP, tmax, ovm]
                (vals2, is_all_zeros) = writeFloats10E(vals)
                [nx, ny, txy, majorP, minorP, tmax, ovm] = vals2
                if eid == 0:
                    eid = zero
                angle, isAllZero = writeFloats8p4F([angle])
                anglei = angle[0]
                msg.append('%s%8s  %8s   %4s    %s %s %s   %8s %10s %10s %10s  %s\n' % (zero, ekey2, eid, elemName, nx, ny, txy, anglei, majorP, minorP, tmax, ovm))
                zero = ' '
                ekey2 = ' '
        msg.append(page_stamp % page_num)
        f.write(''.join(msg))
        return page_num
Ejemplo n.º 5
0
    def write_f06(self, header, pageStamp, pageNum=1, f=None, is_mag_phase=False):
        if self.nonlinear_factor is not None:
            return self._write_f06_transient(header, pageStamp, pageNum, f)

        msg = header + ['                                  S T R E S S E S   A T   G R I D   P O I N T S   - -     S U R F A C E       5\n',
                        '0                       SURFACE X-AXIS X  NORMAL(Z-AXIS)  Z         REFERENCE COORDINATE SYSTEM FOR SURFACE DEFINITION CID        0\n',
                        '     GRID      ELEMENT            STRESSES IN SURFACE SYSTEM           PRINCIPAL STRESSES            MAX             \n',
                        '     ID          ID    FIBRE   NORMAL-X   NORMAL-Y   SHEAR-XY     ANGLE      MAJOR      MINOR      SHEAR     VON MISES\n']
              #'0     13683          3736    TRIAX6         4.996584E+00   0.0            1.203093E+02   0.0            0.0            0.0'
              #'      13683          3737    TRIAX6        -4.996584E+00   0.0           -1.203093E+02   0.0            0.0            0.0'
              #'      13683                  *TOTALS*       6.366463E-12   0.0           -1.364242E-12   0.0            0.0            0.0'
        for eKey, nxs in sorted(self.nx.items()):
            eKey2 = eKey
            zero = '0'
            for iLoad, nx in enumerate(nxs):
                ny = self.ny[eKey][iLoad]
                txy = self.txy[eKey][iLoad]
                angle = self.angle[eKey][iLoad]
                majorP = self.majorP[eKey][iLoad]
                minorP = self.minorP[eKey][iLoad]
                tmax = self.tmax[eKey][iLoad]
                ovm = self.ovm[eKey][iLoad]

                (elemName) = self.elemName[eKey][iLoad]
                eid = self.eids[eKey][iLoad]
                vals = [nx, ny, txy, majorP, minorP, tmax, ovm]
                (vals2, isAllZeros) = writeFloats10E(vals)
                [nx, ny, txy, majorP, minorP, tmax, ovm] = vals2
                if eid == 0:
                    eid = zero
                msg.append('%s%8s  %8s   %4s    %s %s %s   %7.4f %s %s %s  %-s\n' % (zero, eKey2, eid, elemName, nx, ny, txy, angle, majorP, minorP, tmax, ovm.rstrip()))
                zero = ' '
                eKey2 = ' '

        msg.append(pageStamp + str(pageNum) + '\n')
        if f is not None:
            f.write(''.join(msg))
            msg = ['']
        return (''.join(msg), pageNum)