Exemple #1
0
        if stype:
            self.type = stype
        else:
            self.type = 'ELEMENT'


# Test mesh parser on all CalculiX examples
if __name__ == '__main__':
    clean.screen()
    os.chdir(os.path.dirname(__file__))
    start_time = time.perf_counter()
    print = tests.print

    # Prepare logging
    log_file = __file__[:-3] + '.log'
    h = tests.myHandler(log_file)
    logging.getLogger().addHandler(h)
    logging.getLogger().setLevel(logging.INFO)

    limit = 3000  # how many files to process
    examples_dir = '../../../../examples/ccx_2.16.test'
    counter = 0

    print(log_file, 'MESH PARSER TEST\n\n')
    examples = tests.scan_all_files_in(examples_dir, '.inp', limit)
    for file_name in examples:
        counter += 1
        relpath = os.path.relpath(file_name, start=os.getcwd())
        print(log_file, '\n{}\n{}: {}'.format('=' * 50, counter, relpath))

        # Parse mesh
Exemple #2
0
            # gui.cgx.kill(w)
            has_nodes = len(self.m.Mesh.nodes)
            gui.cgx.open_inp(self.w, self.j.inp, has_nodes)


# Test importer on all CalculiX examples
if __name__ == '__main__':
    clean.screen()
    os.chdir(os.path.dirname(os.path.realpath(__file__)))
    start_time = time.perf_counter()
    print = tests.print
    m = model.Model() # generate FEM model

    # Prepare logging
    log_file = __file__[:-3] + '.log'
    h = tests.myHandler(log_file) # remove old log file
    log_capture_string = io.StringIO()
    ch = logging.StreamHandler(log_capture_string)
    ch.setLevel(logging.DEBUG)
    fmt = logging.Formatter('%(levelname)s: %(message)s')
    ch.setFormatter(fmt)
    logging.getLogger().addHandler(ch)

    limit = 50000 # how many files to process
    # examples_dir = '../../examples/ccx/test'
    # examples_dir = '../../examples/abaqus/eif'
    # examples_dir = '../../examples/yahoo'
    examples_dir = '../../examples'
    counter = 0

    print(log_file, 'IMPORTER (KEYWORDS PARSER) TEST\n\n')