File: test_refinement.py

package info (click to toggle)
pygmsh 7.1.17-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 684 kB
  • sloc: python: 3,070; makefile: 164; sh: 7
file content (17 lines) | stat: -rw-r--r-- 413 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from math import sqrt

import pytest

import pygmsh


@pytest.mark.skip("Only works in Gmsh 4.7.0+")
def test():
    with pygmsh.occ.Geometry() as geom:
        geom.add_ball([0.0, 0.0, 0.0], 1.0)
        geom.set_mesh_size_callback(
            lambda dim, tag, x, y, z: abs(sqrt(x ** 2 + y ** 2 + z ** 2) - 0.5) + 0.1
        )
        mesh = geom.generate_mesh()

    assert mesh.cells[0].data.shape[0] > 1500