MEDYAN.MeshAdaptParams
Union{}
Parameters of the mesh adaptation done by adapt_membranes!.
Adaptation repeats a main loop:
- If
do_meshsmoothing, smooth the mesh. - Set the target length of every edge, as described below.
- Scan the edges up to
max_adjust_itertimes. An edge longer than√2times its target is split. An edge shorter than1/√2times its target is collapsed. - Stop if step 3 found every edge within those bounds. Otherwise relax the mesh and go back to step 1.
The target length of an edge is the mean of the target lengths at its two vertices. The target length at a vertex starts as curvature_resolution times the smallest radius of curvature there, so more curved regions get shorter edges. At a border vertex it starts no longer than the shortest border edge of the vertex. It is then limited to between min_size and max_size, which gives flat regions max_size. Last, the target lengths are smoothed over neighboring vertices diffuse_iter times.
Relaxing the mesh takes up to relaxation_max_iter_total rounds. A round is relaxation_max_iter_reloc vertex relocation sweeps, then an attempt to flip every edge.
min_degree::Int64: Lowest degree a collapse or flip can leave an internal vertex with. Default is4.max_degree::Int64: Highest degree a split, collapse or flip can leave a vertex with. Default is9.edge_flip_min_dot_normal::Float64: An edge is flipped only if the unit normals of its two triangles have a dot product of at least this, both before and after the flip. Default is0.9.edge_collapse_min_quality_improvement::Float64: An edge is collapsed only ifq_before / q_afteris at least this.qis the worst triangle quality around the two vertices of the edge. Quality is circumradius / (2 inradius): 1 for an equilateral triangle, larger for worse shapes. A value below 1 lets a collapse worsen the worst triangle. Default is0.6.edge_collapse_min_dot_normal::Float64: An edge is collapsed only if each triangle around the merged vertex would have a unit normal with a dot product of at least this with the unit normals of its neighbors. Default is0.85.relaxation_max_iter_reloc::Int64: Number of vertex relocation sweeps in a relaxation round. A sweep moves each internal vertex within its tangent plane, toward where its triangles would be equilateral. This drags along what is attached to the membrane: linked vertices move like any other, and in-triangle points keep their barycentric coordinates. The default,0, never relocates vertices.relaxation_max_iter_total::Int64: Maximum number of relaxation rounds each time the mesh is relaxed. Rounds stop early when one flips no edge. Default is3.curvature_resolution::Float64: Target length at a vertex divided by the smallest radius of curvature there, before the limits and smoothing. The normals of neighboring triangles then differ by about this angle (rad), socos(curvature_resolution)should be aboveedge_flip_min_dot_normal. Otherwise edges in curved regions are not flipped. Default is0.3.max_size::Float64: Upper limit of the target length at a vertex (nm). Default is60.min_size::Float64: Lower limit of the target length at a vertex (nm). A membrane collides with itself where the height of a triangle is under twice theradius_collideof itsMembraneMechParams. Heights get down to about 0.4 times the target length, so this should be at least 5 timesradius_collide. Default is25.diffuse_iter::Int64: Number of times the target lengths at the vertices are smoothed. Each time, the target length at a vertex becomes the mean of its own and the average of its neighbors’. Default is4.do_meshsmoothing::Bool: Iftrue, each main loop iteration starts withmeshsmoothing_itersteps of curvature flow, which moves internal vertices to shrink the surface area. This changes the shape and energy of the membrane, so only use it to clean up an initial mesh. Default isfalse.meshsmoothing_dt::Float64: Step size of a curvature flow step (dimensionless). Default is0.01.meshsmoothing_iter::Int64: Number of curvature flow steps per main loop iteration. Default is5.max_adjust_iter::Int64: Maximum number of scans over all edges in a main loop iteration. Scans stop early when one changes nothing. Default is10.max_soft_mainloop_iter::Int64: After this many main loop iterations, adaptation stops as soon as the last edge scan of an iteration changes nothing. Default is7.max_hard_mainloop_iter::Int64: After this many main loop iterations, adaptation stops at the next step 4. Default is14.