2. Quality Controls

2.1. XML Input File

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

microstructpy --demo=intro_2_quality.xml

The full text of the file is:

<?xml version="1.0" encoding="UTF-8"?>
<input>
    <material>
        <name> Matrix </name>
        <material_type> matrix </material_type>
        <fraction> 2 </fraction>

        <shape> circle </shape>
        <size>
            <dist_type> uniform </dist_type>
            <loc> 0 </loc>
            <scale> 1.5 </scale>
        </size>
    </material>

    <material>
        <name> Inclusions </name>
        <fraction> 1 </fraction>
        <shape> circle </shape>
        <diameter> 2 </diameter>
    </material>

    <domain>
        <shape> square </shape>
        <side_length> 20 </side_length>
        <corner> (0, 0) </corner>
    </domain>

    <settings>
        <filetypes>
            <seeds_plot> png </seeds_plot>
            <poly_plot> png </poly_plot>
            <tri_plot> png </tri_plot>
        </filetypes>

        <directory> intro_2_quality </directory>
        <verbose> True </verbose>

        <!-- Mesh Quality Settings -->
        <mesh_min_angle> 25 </mesh_min_angle>
        <mesh_max_volume> 1 </mesh_max_volume>
        <mesh_max_edge_length> 0.1 </mesh_max_edge_length>
    </settings>
</input>

2.1.1. Material 1 - Matrix

<material>
    <name> Matrix </name>
    <material_type> matrix </material_type>
    <fraction> 2 </fraction>

    <shape> circle </shape>
    <size>
        <dist_type> uniform </dist_type>
        <loc> 0 </loc>
        <scale> 1.5 </scale>
    </size>
</material>

There are two materials, in a 2:1 ratio based on volume. The first is a matrix, which is represented with small circles.

2.1.2. Material 2 - Inclusions

<material>
    <name> Inclusions </name>
    <fraction> 1 </fraction>
    <shape> circle </shape>
    <diameter> 2 </diameter>
</material>

The second material consists of circular inclusions with diameter 2.

2.1.3. Domain Geometry

<domain>
    <shape> square </shape>
    <side_length> 20 </side_length>
    <corner> (0, 0) </corner>
</domain>

These two materials fill a square domain. The bottom-left corner of the rectangle is the origin, which puts the rectangle in the first quadrant. The side length is 20, which is 10x the size of the inclusions.

2.1.4. Settings

<settings>
    <filetypes>
        <seeds_plot> png </seeds_plot>
        <poly_plot> png </poly_plot>
        <tri_plot> png </tri_plot>
    </filetypes>

    <directory> intro_2_quality </directory>
    <verbose> True </verbose>

    <!-- Mesh Quality Settings -->
    <mesh_min_angle> 25 </mesh_min_angle>
    <mesh_max_volume> 1 </mesh_max_volume>
    <mesh_max_edge_length> 0.1 </mesh_max_edge_length>
</settings>

PNG files of each step in the process will be output, as well as the intermediate text files. They are saved in a folder named intro_2_quality, in the current directory (i.e ./intro_2_quality).

The minimum interior angle of the elements is 25 degrees, ensuring lower aspect ratios compared to the first example. The maximum area of the elements is also limited to 1, which populates the matrix with smaller elements. Finally, The maximum edge length of elements at interfaces is set to 0.1, which increasing the mesh density surrounding the inclusions and at the boundary of the domain.

Note that the edge length control is currently unavailable in 3D.

2.2. Output Files

The three plots that this file generates are the seeding, the polygon mesh, and the triangular mesh.

2.2.1. Seeding Plot

Seed particles.

2.2.2. Polygon Mesh Plot

Polygon mesh.

2.2.3. Triangular Mesh Plot

Triangular mesh.