Ejemplo n.º 1
0
from pyNastran.bdf.bdf_interface.pybdf import BDFInputPy
from pyNastran.bdf.bdf_interface.include_file import (
    split_filename_into_tokens,
    get_include_filename,
    PurePosixPath,
    PureWindowsPath,
)  # ,_split_to_tokens
from pyNastran.utils import print_bad_path
from pyNastran.bdf.bdf_interface.test.test_case_control_deck import compare_lines

ROOT_PATH = pyNastran.__path__[0]
TEST_PATH = os.path.join(ROOT_PATH, 'bdf', 'test', 'unit')
MESH_UTILS_PATH = os.path.join(ROOT_PATH, 'bdf', 'mesh_utils', 'test')
MODEL_PATH = os.path.join(ROOT_PATH, '../', 'models')

log = get_logger2(debug=None)


class TestReadWriteFiles(unittest.TestCase):
    def test_read_include_dir_2_files(self):
        """tests a model that will write to multiple files"""
        full_path = os.path.join(TEST_PATH)
        model = BDF(log=log, debug=False)
        bdf_filename = 'test_include2.bdf'
        if not os.path.exists(bdf_filename):
            bdf_filename = os.path.join(full_path, 'test_include2.bdf')
            #print(full_path)
        #print(bdf_filename)
        model.read_bdf(bdf_filename,
                       xref=True,
                       punch=False,
Ejemplo n.º 2
0
from __future__ import unicode_literals, print_function
import os
from codecs import open as codec_open
import unittest
from six import PY2, StringIO

import pyNastran
from pyNastran.bdf.bdf import BDF, read_bdf, get_logger2
from pyNastran.bdf.test.test_case_control_deck import compare_lines

root_path = pyNastran.__path__[0]
test_path = os.path.join(root_path, 'bdf', 'test', 'unit')

log = get_logger2(debug=None)

class TestReadWrite(unittest.TestCase):
    """various BDF I/O tests"""

    def test_write_1(self):
        """
        Tests 1 read method and various write methods
        """
        model = BDF(log=log, debug=False)

        bdf_name = os.path.join(test_path, 'test_mass.dat')
        model.read_bdf(bdf_name)
        model.write_bdf(os.path.join(test_path, 'test_mass1a.out'), size=8)
        model.write_bdf(os.path.join(test_path, 'test_mass2a.out'), size=8)
        msg = model.get_bdf_stats(return_type='list')
        str('\n'.join(msg))
Ejemplo n.º 3
0
 def test_renumber_02(self):
     bdf_filename = os.path.join(MODEL_PATH, 'iSat', 'ISat_Dploy_Sm.dat')
     bdf_filename_renumber = os.path.join(MODEL_PATH, 'iSat', 'ISat_Dploy_Sm_renumber.dat')
     bdf_filename_check = os.path.join(MODEL_PATH, 'iSat', 'ISat_Dploy_Sm_check.dat')
     log = get_logger2(debug=None)
     check_renumber(bdf_filename, bdf_filename_renumber, bdf_filename_check, log=log)