Interface Refinement 3D Example¶
XML Input File¶
The basename for this file is pbx_interface_3D.xml.
The file can be run using this command:
microstructpy --demo=pbx_interface_3D.xml
The full text of the file is:
<?xml version="1.0" encoding="UTF-8"?>
<input>
<material>
<name> Binder </name>
<material_type> matrix </material_type>
<fraction> 35 </fraction>
<shape> sphere </shape>
<size>
<dist_type> uniform </dist_type>
<loc> 0.45 </loc>
<scale> 0.25 </scale>
</size>
<color> lightgray </color>
</material>
<material>
<name> Inclusions </name>
<material_type> crystalline </material_type>
<fraction> 65 </fraction>
<shape> sphere </shape>
<size>
<dist_type> lognorm </dist_type>
<scale> 0.8 </scale>
<s> 0.3 </s>
</size>
<color> darkorange </color>
</material>
<domain>
<shape> cube </shape>
<side_length> 3 </side_length>
<corner> (0, 0, 0) </corner>
<periodic> True </periodic>
</domain>
<settings>
<directory> pbx_interface_3D </directory>
<verbose> True </verbose>
<rng_seeds>
<size> 1 </size>
<position> 1 </position>
</rng_seeds>
<!-- the overlap tolerance: with 0.7 all the seeds can be placed -->
<rtol> 0.7 </rtol>
<!-- the seeds and the grains stay a margin away from the periodic
faces, or cross them by more than the margin: auto is half the
target edge length, at most an eighth of the smallest grain -->
<periodic_margin> auto </periodic_margin>
<edge_opt> True </edge_opt>
<edge_opt_n_iter> 10 </edge_opt_n_iter>
<!-- small triangles on the grain boundaries (the interfaces between
the binder and the inclusions), larger tetrahedra inside the
grains -->
<mesh_min_angle> 15 </mesh_min_angle>
<mesh_max_edge_length> 0.2 </mesh_max_edge_length>
<mesh_max_volume> 0.05 </mesh_max_volume>
<seeds_kwargs>
<linewidths> 0.2 </linewidths>
</seeds_kwargs>
<poly_kwargs>
<linewidths> 0.2 </linewidths>
</poly_kwargs>
<tri_kwargs>
<linewidths> 0.1 </linewidths>
</tri_kwargs>
</settings>
</input>
Materials¶
The materials are those of the Binder and Inclusions 3D Example: crystalline
inclusions (65% of the volume, spherical seeds with lognormal diameters) in
a binder (a matrix phase, 35% of the volume, seeded with small spheres).
Domain Geometry¶
The materials fill a cube of side length 3, periodic in the three directions.
Settings¶
The mesh is refined on the grain boundaries, which are the interfaces between the binder and the inclusions (and between neighboring inclusions), and coarse inside the grains.
In 3D, mesh_max_edge_length sets the maximum edge length of the
triangles on the facets of the polyhedral mesh, 0.2 here: the facets are
triangulated to that size before TetGen meshes the cells.
mesh_max_volume sets the maximum volume of the tetrahedra, 0.05 here,
which is the volume of a regular tetrahedron with edges about four times
longer, and TetGen grades the element size between the two.
The mesh has a minimum dihedral angle of 15 degrees.
The seeds are placed a margin away from the periodic faces (periodic_margin
set to auto: half the target edge length, or an eighth of the smallest
grain if that is smaller) and the edge optimization moves the seeds that
leave a thin piece of a grain on a face, a corner narrower than the minimum
angle of the mesh, or a very short edge, since any of these forces very
small tetrahedra.
Output Files¶
The three plots that this file generates are the seeding, the polyhedral mesh, and the tetrahedral mesh. The seeds and the polyhedral mesh are those of the Binder and Inclusions 3D Example (Fig. 29 and Fig. 30), since the seeds and the settings of the optimization are the same. Only the tetrahedral mesh differs, shown (its facets) in Fig. 33.
Fig. 33 Interface refinement 3D example - tetrahedral mesh.¶