|
22 | 22 | @testitem "DifferentiationMethod" setup=[Setup] begin |
23 | 23 | using MeshIntegrals: _has_analytical, _default_method, _guarantee_analytical |
24 | 24 |
|
25 | | - # _has_analytical of instances |
26 | | - triangle = Triangle(Point(0, 0, 0), Point(0, 1, 0), Point(1, 0, 0)) |
27 | | - @test _has_analytical(triangle) == true |
| 25 | + # Test geometries |
28 | 26 | sphere = Sphere(Point(0, 0, 0), 1.0) |
29 | | - @test _has_analytical(sphere) == false |
| 27 | + triangle = Triangle(Point(0, 0, 0), Point(0, 1, 0), Point(1, 0, 0)) |
30 | 28 |
|
31 | | - # _default_method |
32 | | - @test _default_method(Meshes.Triangle) isa Analytical |
33 | | - @test _default_method(triangle) isa Analytical |
34 | | - @test _default_method(Meshes.Sphere) isa FiniteDifference |
35 | | - @test _default_method(sphere) isa FiniteDifference |
| 29 | + # _has_analytical of instances |
| 30 | + @test _has_analytical(sphere) == false |
| 31 | + @test _has_analytical(triangle) == true |
36 | 32 |
|
37 | 33 | # _has_analytical of types |
38 | | - @test _has_analytical(Meshes.BezierCurve) == false |
39 | | - @test _has_analytical(Meshes.Line) == true |
40 | | - @test _has_analytical(Meshes.Plane) == true |
41 | | - @test _has_analytical(Meshes.Ray) == true |
42 | 34 | @test _has_analytical(Meshes.Sphere) == false |
43 | | - @test _has_analytical(Meshes.Tetrahedron) == false |
44 | 35 | @test _has_analytical(Meshes.Triangle) == true |
45 | 36 |
|
| 37 | + # _default_method |
| 38 | + @test _default_method(Meshes.Sphere) isa FiniteDifference |
| 39 | + @test _default_method(sphere) isa FiniteDifference |
| 40 | + @test _default_method(Meshes.Triangle) isa Analytical |
| 41 | + @test _default_method(triangle) isa Analytical |
| 42 | + |
46 | 43 | # _guarantee_analytical |
47 | | - @test _guarantee_analytical(Meshes.Line, Analytical()) === nothing |
48 | | - @test_throws "Analytical" _guarantee_analytical(Meshes.Line, FiniteDifference()) |
| 44 | + @test _guarantee_analytical(Meshes.Triangle, Analytical()) === nothing |
| 45 | + @test_throws "Analytical" _guarantee_analytical(Meshes.Triangle, FiniteDifference()) |
49 | 46 |
|
50 | 47 | # FiniteDifference |
51 | 48 | @test FiniteDifference().ε ≈ 1e-6 |
|
0 commit comments