示例#1
0
    def test_op2_01(self):
        op2Filename = os.path.join('solid_bending', 'solid_bending.op2')
        folder = os.path.abspath(os.path.join(testPath, '..', 'models'))
        make_geom = True
        write_bdf = True
        write_f06 = True
        debug = False
        op2file = os.path.join(folder, op2Filename)
        run_op2(op2file,
                make_geom=make_geom,
                write_bdf=write_bdf,
                iSubcases=[],
                write_f06=write_f06,
                is_vector=False,
                debug=debug,
                stopOnFailure=True)

        make_geom = False
        write_bdf = False
        run_op2(op2file,
                make_geom=make_geom,
                write_bdf=write_bdf,
                iSubcases=[],
                write_f06=write_f06,
                is_vector=True,
                debug=debug,
                stopOnFailure=True)
示例#2
0
    def test_op2_solid_bending_01(self):
        op2_filename = os.path.join('solid_bending.op2')
        folder = os.path.abspath(os.path.join(test_path, '..', 'models', 'solid_bending'))
        op2_filename = os.path.join(folder, op2_filename)
        make_geom = False
        write_bdf = False
        write_f06 = True
        debug = False
        #debug_file = 'solid_bending.debug.out'
        model, ext = os.path.splitext(op2_filename)
        debug_file = model + '.debug.out'

        if os.path.exists(debug_file):
            os.remove(debug_file)
        run_op2(op2_filename, make_geom=make_geom, write_bdf=write_bdf, isubcases=[],
                write_f06=write_f06,
                debug=debug, stop_on_failure=True, binary_debug=True)
        assert os.path.exists(debug_file), os.listdir(folder)
        #os.remove(debug_file)

        make_geom = False
        write_bdf = False
        write_f06 = True
        run_op2(op2_filename, make_geom=make_geom, write_bdf=write_bdf, isubcases=[],
                write_f06=write_f06,
                debug=debug, stop_on_failure=True, binary_debug=True)
        assert os.path.exists(debug_file), os.listdir(folder)
        os.remove(debug_file)
示例#3
0
 def test_op2_02(self):
     op2Filename = os.path.join('plate_py', 'plate_py.op2')
     folder = os.path.abspath(os.path.join(testPath, '..', 'models'))
     make_geom = True
     write_bdf = True
     write_f06 = True
     debug = False
     op2file = os.path.join(folder, op2Filename)
     run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, iSubcases=[],
             write_f06=write_f06, debug=debug, stopOnFailure=True)
示例#4
0
    def test_op2_good_sine_01(self):
        op2_filename = os.path.join('freq_sine', 'good_sine.op2')
        folder = os.path.abspath(os.path.join(test_path, '..', 'models'))
        make_geom = False
        write_bdf = False
        write_f06 = False
        debug = False
        op2file = os.path.join(folder, op2_filename)
        op2i, is_passed = run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, isubcases=[],
                                  write_f06=write_f06,
                                  debug=debug, stop_on_failure=True,
                                  quiet=True)

        nids = [5]
        isubcase = 103
        with self.assertRaises(AssertionError):
            # no index 0; fortran 1-based
            try:
                acc = op2i.accelerations[isubcase]
            except KeyError:
                raise KeyError('getting accelerations; isubcase=%s; keys=%s' % (
                    isubcase, op2i.accelerations.keys()))

            acc.extract_xyplot(nids, 0, 'real')

        accx = op2i.accelerations[103].extract_xyplot(nids, 1, 'real')
        accxi = op2i.accelerations[103].extract_xyplot(nids, 1, 'imag')
示例#5
0
    def test_op2_01(self):
        op2Filename = os.path.join('solid_bending', 'solid_bending.op2')
        folder = os.path.abspath(os.path.join(testPath, '..', 'models'))
        make_geom = True
        write_bdf = True
        write_f06 = True
        debug = False
        op2file = os.path.join(folder, op2Filename)
        run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, iSubcases=[],
                write_f06=write_f06, is_vector=False,
                debug=debug, stopOnFailure=True)

        make_geom = False
        write_bdf = False
        run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, iSubcases=[],
                write_f06=write_f06, is_vector=True,
                debug=debug, stopOnFailure=True)
示例#6
0
    def test_op2_plate_py_01(self):
        op2_filename = os.path.join('plate_py', 'plate_py.op2')
        folder = os.path.abspath(os.path.join(test_path, '..', 'models'))
        make_geom = False
        write_bdf = False
        write_f06 = False
        debug = False
        op2file = os.path.join(folder, op2_filename)
        run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, isubcases=[],
                write_f06=write_f06,
                debug=debug, stop_on_failure=True)

        make_geom = False
        write_bdf = False
        write_f06 = True
        run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, isubcases=[],
                write_f06=write_f06,
                debug=debug, stop_on_failure=True)
示例#7
0
    def test_op2_01(self):
        op2_filename = os.path.join('solid_bending', 'solid_bending.op2')
        folder = os.path.abspath(os.path.join(test_path, '..', 'models'))
        make_geom = False
        write_bdf = False
        write_f06 = True
        debug = False
        op2file = os.path.join(folder, op2_filename)
        run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, iSubcases=[],
                write_f06=write_f06, is_vector=False,
                debug=debug, stopOnFailure=True, binary_debug=True)
        assert os.path.exists('debug.out'), os.listdir('.')
        os.remove('debug.out')

        make_geom = False
        write_bdf = False
        write_f06 = True
        run_op2(op2file, make_geom=make_geom, write_bdf=write_bdf, iSubcases=[],
                write_f06=write_f06, is_vector=True,
                debug=debug, stopOnFailure=True, binary_debug=True)
        assert os.path.exists('debug.out'), os.listdir('.')
        os.remove('debug.out')