morphogen.mesh.polycrystal

Conforming tetrahedral meshes of polycrystals (Voronoi and Laguerre tessellations).

The exact cells of the tessellation (morphogen.mesh.polyhedra) are convex polyhedra with planar facets; the features smaller than min_feature are removed first (morphogen.mesh.regularize). Each piece is then split into tetrahedra, a cone from its centroid over its triangulated facets: a valid mesh of the whole complex, conforming at the grain boundaries, with poor elements. MMG (mmg3d) remeshes it to the requested size, keeping the grain boundaries (interfaces between subdomains of different references), their triple lines (non-manifold edges) and quadruple points.

Periodic polycrystals get matching opposite faces. The edges of the box are subdivided once for the four parallel edges; each pair of opposite faces is meshed in two dimensions from the traces of the grain boundaries (the faces of the regularized complex are translates of each other), subdivided at the element size: mmg2d remeshes their constrained Delaunay triangulation, keeping the traces. The same triangles are used on both faces and the volume remeshing keeps them unchanged.

Quality: on Voronoi tessellations of 30 to 300 cells, the mean quality of the elements is 0.72-0.74 and 0.1 % of them are below 0.05-0.1; the few worst ones (down to 0.004) sit in the thin wedges between grain boundaries and faces of the box that remain.

morphogen.mesh.polycrystal.REF_GRAIN_BOUNDARY = 7

Reference of the grain-boundary triangles (the faces of the box are 1-6).

morphogen.mesh.polycrystal.initial_mesh(cx: CellComplex, *, size, sizing, periodic, folder, timeout)[source]

Tetrahedra of the pieces (cones from their centroids over their triangulated facets), with the cell + 1 of each tetrahedron, the triangles of the faces of the box (references 1-6, first n_box of them) and of the grain boundaries.

morphogen.mesh.polycrystal.whole_initial_mesh(cx: CellComplex, *, size: float)[source]

Tetrahedra of whole periodic cells (cones from their centroids over their triangulated facets), with the cell + 1 of each tetrahedron, the triangles bounding their union (first n_outer of them) and those of the grain boundaries. The edges are subdivided at the element size; each pair of translated facets bounding the union is meshed once (_mesh_polygon()), the translate taking the same triangles. The regularization checked that the fans of the facets from their centres are seen from the centroids of the pieces; a triangulation of a warped facet that is not (one of its triangles seen from the other side) is replaced by that fan.

morphogen.mesh.polycrystal.polycrystal_mesh(micro, *, size: float, min_size: float | None = None, hausdorff: float | None = None, gradation: float = 2.0, min_feature: float | None = None, phases: str = 'all', order: int = 1, periodic: bool | None = None, cells: str = 'whole', exact: bool = False, executable: str | None = None, workdir=None, timeout: float | None = None) → TetMesh[source]

Conforming tetrahedral mesh of a Voronoi or Laguerre tessellation, one subdomain per cell: each element knows its cell (mesh.cell), its phase and, through its cell, its crystal orientation (mesh.orientations).

Parameters:
  • size – Largest element size (-hmax).

  • min_size – Smallest element size (default size / 10), Hausdorff distance (default size / 20; 1e-6 size when exact) and size gradation of MMG.

  • hausdorff – Smallest element size (default size / 10), Hausdorff distance (default size / 20; 1e-6 size when exact) and size gradation of MMG.

  • gradation – Smallest element size (default size / 10), Hausdorff distance (default size / 20; 1e-6 size when exact) and size gradation of MMG.

  • min_feature – Features of the tessellation smaller than this length (short edges, caps of cells on the faces of the box) are removed before meshing (default size / 4, 0 when exact; 0 keeps the exact cells, at the price of flat elements next to their small features).

  • exact – Keep the facets of the cells exactly: the edges where they bend given to MMG as ridges and their ends as corners, and its Hausdorff distance a millionth of the size by default (the facets are planar: nothing to approximate, while its smoothing moves the nodes of the surfaces within that distance). Not with a positive min_feature: the cells are then regularized, their facets bent.

  • phases – "all", or "solid": the cells of phase 1 only.

  • periodic – Periodic mesh (default: when the tessellation is periodic).

  • cells – Periodic meshes: "whole" (default) meshes the whole cells, periodized at the design: their union fills the volume of the box and its boundary is made of pairs of translated facets with the same triangles, so that every node of the boundary has its translates (mesh.periodic_links()); "box" cuts the cells by the faces of the box, meshed alike on opposite faces.