<commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
import pygmsh

from helpers import compute_volume


def test():
    geom = pygmsh.built_in.Geometry()

    rectangle = geom.add_rectangle(
            0.0, 1.0,
            0.0, 1.0,
            0.0,
            0.1
            )
    
    geom.add_raw_code('Recombine Surface {%s};' % rectangle.surface.id)

    with open('quads.geo', 'w') as fgeo:
        fgeo.write(geom.get_code())

    ref = 1.0
    points, cells, _, _, _ = pygmsh.generate_mesh(geom, dim=2)
    assert abs(compute_volume(points, cells) - ref) < 1.0e-2 * ref
    return points, cells


if __name__ == '__main__':
    import meshio
    meshio.write('quads.vtu', *test())<commit_msg>made use of new geo_filename option to generate_mesh; nschloe/pygmsh#115<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
import pygmsh

from helpers import compute_volume


def test():
    geom = pygmsh.built_in.Geometry()

    rectangle = geom.add_rectangle(
            0.0, 1.0,
            0.0, 1.0,
            0.0,
            0.1
            )
    
    geom.add_raw_code('Recombine Surface {%s};' % rectangle.surface.id)

    ref = 1.0
    points, cells, _, _, _ = pygmsh.generate_mesh(geom,
                                                  dim=2,
                                                  geo_filename='quads.geo')
    assert abs(compute_volume(points, cells) - ref) < 1.0e-2 * ref
    return points, cells


if __name__ == '__main__':
    import meshio
    meshio.write('quads.vtu', *test())
{'fraction_non_alphanumeric': 0.13224755700325733, 'fraction_numerical': 0.026710097719869708, 'mean_word_length': 1.887218045112782, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3469412', 'n_tokens_mistral': 556, 'n_tokens_neox': 530, 'n_words': 112}