<commit_before>import os.path as op

from sfepy.base.testing import TestCommon

class Test(TestCommon):

    @staticmethod
    def from_conf(conf, options):
        from sfepy import data_dir
        from sfepy.fem import Mesh, Domain

        mesh = Mesh('mesh', data_dir + '/meshes/various_formats/small3d.mesh')
        domain = Domain('domain', mesh)

        return Test(conf=conf, options=options, domain=domain)

    def test_facets(self):
        ok = True

        ed = self.domain.ed
        _ok = ed.n_unique == 26
        self.report('unique edges: %s' % _ok)
        ok = ok and _ok

        fa = self.domain.fa
        _ok = fa.n_unique == 30
        self.report('unique faces: %s' % _ok)
        ok = ok and _ok

        return ok

    def test_refine(self):
        domain = self.domain

        for ii in range(3):
            domain = domain.refine()
            filename = op.join(self.options.out_dir,
                               'refine_' + domain.mesh.name + '.mesh')
            domain.mesh.write(filename, io='auto')

        return True<commit_msg>add test for refine_3_8()<commit_after>import os.path as op

from sfepy.base.testing import TestCommon
from sfepy import data_dir
from sfepy.fem import Mesh, Domain

def refine(domain, out_dir, level=3):
    for ii in range(3):
        domain = domain.refine()
        filename = op.join(out_dir, 'refine_' + domain.mesh.name + '.mesh')
        domain.mesh.write(filename, io='auto')

    return domain

class Test(TestCommon):

    @staticmethod
    def from_conf(conf, options):
        mesh = Mesh('mesh_tetra',
                    data_dir + '/meshes/various_formats/small3d.mesh')
        domain = Domain('domain', mesh)

        return Test(conf=conf, options=options, domain=domain)

    def test_facets(self):
        ok = True

        ed = self.domain.ed
        _ok = ed.n_unique == 26
        self.report('unique edges: %s' % _ok)
        ok = ok and _ok

        fa = self.domain.fa
        _ok = fa.n_unique == 30
        self.report('unique faces: %s' % _ok)
        ok = ok and _ok

        return ok

    def test_refine_tetra(self):
        refine(self.domain, self.options.out_dir)

        return True

    def test_refine_hexa(self):
        mesh = Mesh('mesh_hexa',
                    data_dir + '/meshes/various_formats/abaqus_hex.inp')
        domain = Domain('domain', mesh)

        refine(domain, self.options.out_dir)

        return True
{'fraction_non_alphanumeric': 0.10847318870241507, 'fraction_numerical': 0.006139991813344249, 'mean_word_length': 2.1054637865311308, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7446872', 'n_tokens_mistral': 809, 'n_tokens_neox': 766, 'n_words': 191}