Interface Refinement Example

XML Input File

The basename for this file is pbx_interface_2D.xml. The file can be run using this command:

microstructpy --demo=pbx_interface_2D.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> circle </shape>
        <size>
            <dist_type> uniform </dist_type>
            <loc> 0.08 </loc>
            <scale> 0.08 </scale>
        </size>
        <color> lightgray </color>
    </material>

    <material>
        <name> Inclusions </name>
        <material_type> crystalline </material_type>
        <fraction> 65 </fraction>
        <shape> circle </shape>
        <size>
            <dist_type> lognorm </dist_type>
            <scale> 0.35 </scale>
            <s> 0.35 </s>
        </size>
        <color> darkorange </color>
    </material>

    <domain>
        <shape> square </shape>
        <side_length> 3 </side_length>
        <corner> (0, 0) </corner>
        <periodic> True </periodic>
    </domain>

    <settings>
        <directory> pbx_interface_2D </directory>
        <verbose> True </verbose>
        <rng_seeds>
            <size> 1 </size>
            <position> 1 </position>
        </rng_seeds>

        <!-- the overlap tolerance: with 0.5 all the seeds can be placed -->
        <rtol> 0.5 </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> 25 </edge_opt_n_iter>

        <!-- small elements along the grain boundaries (the interfaces
             between the binder and the inclusions), larger elements inside
             the grains -->
        <mesh_min_angle> 25 </mesh_min_angle>
        <mesh_max_edge_length> 0.03 </mesh_max_edge_length>
        <mesh_max_volume> 0.02 </mesh_max_volume>

        <seeds_kwargs>
            <linewidth> 0.3 </linewidth>
        </seeds_kwargs>
        <poly_kwargs>
            <linewidth> 0.3 </linewidth>
        </poly_kwargs>
        <tri_kwargs>
            <linewidth> 0.15 </linewidth>
        </tri_kwargs>
    </settings>
</input>

Materials

The materials are those of the Binder and Inclusions Example: crystalline inclusions (65% of the area, circular seeds with lognormal diameters) in a binder (a matrix phase, 35% of the area, seeded with small circles).

Domain Geometry

The materials fill a square domain of side length 3, periodic in both directions.

Settings

The mesh is refined along the grain boundaries, which are the interfaces between the binder and the inclusions (and between neighboring inclusions), and coarse inside the grains.

mesh_max_edge_length sets the maximum length of the element edges along the grain boundaries, 0.03 here, while mesh_max_volume sets the maximum area of the elements, 0.02 here, which is the area of a triangle with edges about seven times longer. Triangle grades the element size between the two.

The mesh has a minimum angle of 25 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 triangles.

Output Files

The three plots that this file generates are the seeding, the polygon mesh, and the triangular mesh. The seeds and the polygonal mesh are those of the Binder and Inclusions Example (Fig. 26 and Fig. 27), since the seeds and the settings of the optimization are the same. Only the triangular mesh differs, shown in Fig. 32.

Triangular mesh.

Fig. 32 Interface refinement example - triangular mesh.