upxo.meshing.gbconformant.d3v2p0.tet_smoothing module
Raise tetrahedral dihedral angles by moving mesh nodes.
Phase 1 moves nodes inside grains. Phase 2 (optional, surface given) also
moves grain-surface nodes along their own surface: patch-interior nodes on
their surrounding triangles, junction-line and RVE-trace nodes along their
line; RVE-plane coordinates stay exact; curve corners and nodes of frozen
grains stay fixed. A node’s move changes only the tets that contain it (its
star) and, for a surface node, the surface triangles around it.
Acceptance rule for a move, on every tet of the star: - the worst normalised angle quality of the star rises (smallest dihedral
relative to
target, largest dihedral relative tomax_angle);
a tet whose smallest dihedral is at or above
targetmay lose angle but stays at or above its floor; a tet belowtargetloses none. The floor isneighbour_floor(default:target) for a tet that started at or abovetarget, and the larger of its starting angle andneighbour_floorfor one that started below, so no tet ends below min(start, target) or belowneighbour_floorif it started above it;a tet whose largest dihedral is at or below
max_anglestays at or below it; a tet abovemax_anglegains none;every tet keeps a positive volume.
With corner_max_deviation, curve corners (junction points where three or
more junction lines meet) also move, in any direction but within that
deviation of the previous surface; RVE corners stay fixed.
With wedge_limit, a surface node’s move must also keep the no-sharpening rule
at every surface edge around it (facet_angles.sharpens).
For a surface node, additionally: each surrounding surface triangle obeys the
same rule on its smallest angle (triangle_target, triangle_floor); the
old node position stays within max_deviation of the new surface; facet
openings around the node stay at or above minimum_facet_angle.
Trial moves follow the gradient of a soft minimum of the star quality at
halving step lengths and, with search_directions, 26 fixed directions at the
first four step lengths; for surface nodes they are projected onto the surface
or line. The passing move with the best star quality is kept.
- upxo.meshing.gbconformant.d3v2p0.tet_smoothing.smooth_tet_dihedrals(points, tetrahedra, movable, *, enabled=True, target=30.0, max_angle=150.0, neighbour_floor=None, max_passes=10, node_iterations=3, max_halvings=8, initial_step=0.3, softness=20.0, surface=None, frozen_grain_ids=(), max_deviation=None, minimum_facet_angle=0.0, triangle_target=30.0, triangle_floor=None, search_directions=True, progress=None, corner_max_deviation=None, wedge_limit=None)[source]
Return (points, report) with nodes relocated under the rule above.
movable: boolean mask of free nodes inside grains (Phase 1). With surface (a ClosedRVE whose points are the first len(surface.points) mesh points), grain-surface nodes also move (Phase 2). All tets must have positive volume. initial_step is the first trial step as a fraction of the mean distance from the node to its star neighbours. neighbour_floor and triangle_floor default to target and triangle_target (no relaxation).
- upxo.meshing.gbconformant.d3v2p0.tet_smoothing.minimum_sicn_gmsh(points, tetrahedra)[source]
Gmsh minSICN of linear tetrahedra (same metric as the tet mesher).
- upxo.meshing.gbconformant.d3v2p0.tet_smoothing.smooth_grain_tetrahedra(tets, surface_node_count, *, enabled=True, target=30.0, max_angle=150.0, neighbour_floor=None, max_passes=10, node_iterations=3, max_halvings=8, initial_step=0.3, softness=20.0, surface=None, frozen_grain_ids=(), max_deviation=None, minimum_facet_angle=0.0, triangle_target=30.0, triangle_floor=None, search_directions=True, progress=None, corner_max_deviation=None, wedge_limit=None)[source]
Smooth a verified GrainTetrahedra result and re-verify it.
Nodes 0..surface_node_count-1 are the grain-surface nodes of the mesher output. Without surface they stay fixed (Phase 1). With surface (the ClosedRVE the tets were generated from) they move under the surface rules (Phase 2); use surface_after_smoothing to obtain the moved surface. Quality (Gmsh minSICN), per-grain minima and volumes, dihedral statistics and readiness are recomputed. Without surface moves grain volumes must be unchanged; with them each grain’s tet volume must equal the volume its moved surface encloses, the total must equal the RVE volume, and moved surface triangles must not intersect. Readiness keeps the input thresholds.