@@ -4,25 +4,27 @@ Create dictionary of mesh generation options with default values. These at once
44keyword arguments available to the methods of the package and are listed in the following table:
55
66
7- | keyword | default | 2D | 3D | Explanation |
8- |:---------------|:-------:|:---:|:---:|:-----------------------------------------------------------|
9- | PLC | true | -p | -p | Triangulate/tetraheralize PLSG/PLC |
10- | refine | false | -r | -r | Refines a previously generated mesh. |
11- | quality | true | -q | -q | Quality mesh generation |
12- | minangle | 20 | | | Minimum angle for quality |
13- | volumecontrol | true | -a | -a | Maximum area constraint |
14- | maxvolume | Inf | | | Value of area/volume constraint if less than Inf |
15- | attributes | true | -A | -A | Regional attribute to each simplex. |
16- | confdelaunay | true | -D | | Ensure that all circumcenter lie within the domain. |
17- | nosteiner | false | -Y | -Y | Prohibits insertion of Steiner points on the mesh boundary |
18- | quiet | true | -Q | -Q | Suppress all output unless an error occurs. |
19- | verbose | false | -V | -V | Give detailed information. |
20- | debugfacets | true | | -d | Detects self-intersections of facets of the PLC. |
21- | check | false | -C | -C | Checks the consistency of the final mesh. |
22- | optlevel | 1 | | -O | Specifies the level of mesh optimization. |
23- | unsuitable | nothing | | | Unsuitable function |
24- | addflags | "" | | | Additional flags |
25- | flags | nothing | | | Set flags, overwrite all other options |
7+ | keyword | default | 2D | 3D | Explanation |
8+ |:------------------|:-------:|:---:|:---:|:-----------------------------------------------------------|
9+ | PLC | true | -p | -p | Triangulate/tetraheralize PLSG/PLC |
10+ | refine | false | -r | -r | Refines a previously generated mesh. |
11+ | quality | true | -q | -q | Quality mesh generation |
12+ | minangle | 2D: 20 | | | Minimum angle for quality |
13+ | | 3D: 0 | | | |
14+ | radius_edge_ratio | 2.0 | | | (3D only) Minimum radius/edge ratio for quality |
15+ | volumecontrol | true | -a | -a | Maximum area constraint |
16+ | maxvolume | Inf | | | Value of area/volume constraint if less than Inf |
17+ | attributes | true | -A | -A | Regional attribute to each simplex. |
18+ | confdelaunay | true | -D | | Ensure that all circumcenter lie within the domain. |
19+ | nosteiner | false | -Y | -Y | Prohibits insertion of Steiner points on the mesh boundary |
20+ | quiet | true | -Q | -Q | Suppress all output unless an error occurs. |
21+ | verbose | false | -V | -V | Give detailed information. |
22+ | debugfacets | true | | -d | Detects self-intersections of facets of the PLC. |
23+ | check | false | -C | -C | Checks the consistency of the final mesh. |
24+ | optlevel | 1 | | -O | Specifies the level of mesh optimization. |
25+ | unsuitable | nothing | | | Unsuitable function |
26+ | addflags | "" | | | Additional flags |
27+ | flags | nothing | | | Set flags, overwrite all other options |
2628
2729
2830For mesh generation, these are turned into mesh generator control flags. This process can be completely
@@ -39,11 +41,12 @@ The `unsuitable` parameter should be a function, see
3941[`triunsuitable!`](https://juliageometry.github.io/TetGen.jl/stable/#TetGen.triunsuitable!-Tuple{Function}) .
4042
4143"""
42- default_options () = Dict {Symbol, Any} (
44+ default_options (mesher ) = Dict {Symbol, Any} (
4345 :PLC => true ,
4446 :refine => false ,
4547 :quality => true ,
46- :minangle => 20 ,
48+ :minangle => mesher == :triangle ? 20 : 0 ,
49+ :radius_edge_ratio => 2.0 ,
4750 :volumecontrol => true ,
4851 :maxvolume => Inf ,
4952 :attributes => true ,
@@ -82,8 +85,15 @@ function makeflags(options, mesher)
8285 options[:PLC ] ? flags *= " p" : nothing
8386 options[:refine ] ? flags *= " r" : nothing
8487 if options[:quality ]
88+ radius_edge_ratio = Float64 (options[:radius_edge_ratio ])
8589 minangle = Float64 (options[:minangle ])
86- flags *= @sprintf (" q%.2f" , minangle)
90+ if mesher == :tetgen
91+ flags *= @sprintf (" q%.2f" , radius_edge_ratio)
92+ flags *= @sprintf (" /%.2f" , minangle)
93+ else
94+ flags *= @sprintf (" q%.2f" , minangle)
95+ end
96+
8797 end
8898 if options[:volumecontrol ]
8999 flags *= " a"
0 commit comments