## 3 PolyCISAMR Algorithm  
### Overview of CISAMR Algorithm  
The PolyCISAMR algorithm introduced here for meshing polycrystalline microstructure is an extension of the 2D CISAMR algorithm originally introduced in [44]. CISAMR is a non-iterative algorithm that transforms an initial structured mesh composed of rectangular elements into a high-quality conforming mesh consisting of rectangular and triangular elements in three stages: \(h\)-adaptive refinement of elements near material interfaces, \(r\)-adaptivity of nodes of elements that intersect the interface, and sub-triangulation of elements with hanging nodes and elements deformed during the \(r\)-adaptivity phase. The  
Figure 11: Example of a concave grain and the corresponding NURBS control points characterizing its geometry. Figure 12: NURBS-based model of the polycrystalline image in Figure 3.  
process is illustrated in Figure 13, and each step of the algorithm is described in more detail in the remainder of this subsection. \(\circ\)**\(h\)-adaptive refinement**: Using NURBS curves as an explicit representation of material interfaces, we first identify four-node quadrilateral (Q4) elements of the background mesh intersecting each interface. As shown in Figure 13, a Structured Adaptive Mesh Refinement (SAMR) algorithm is then implemented to refine these elements as well as their selected neighboring elements. The objectives of this step are twofold: (i) to reduce the geometric discretization error; and (ii) to reduce the error associated with the gradient recovery in the vicinity of the interface in the corresponding FE simulation. At each refinement level, all nonconforming Q4 elements that are cut by the interface are subdivided into four Q4 sub-elements. The neighboring elements that are subjected to refinement are selected based on the relative distances of their nodes to the interface. In this approach, if the interface intersects an element edge with length \(h\) at a distance \(d<0.5h\) from one of the nodes of that edge, all neighboring elements that share this node are refined. As discussed in [44], a number of constraints must be satisfied during the SAMR phase to ensure that the final conforming elements have proper aspect ratios. For example, as depicted in Figure 13, each edge of a background element is allowed to hold only one hanging node. If more hanging nodes appear on an edge, the elements sharing that edge are subjected to additional refinement until this constraint is satisfied. Similarly, adaptive refinement is activated when the edges of an element intersect either an interface multiple times or with multiple interfaces. \(\circ\)**\(r\)-adaptivity:**: The next step is to visit the nodes of adaptively refined elements cut by an interface to determine whether they must be relocated to that interface. Figure 13 shows the deformed mesh created after applying this \(r\)-adaptivity phase, during which \(\approx\)50% of the originally nonconforming elements of the background mesh are transformed to conforming elements. We assume that the lengths of edges connected to mesh node \(\mathcal{N}\) are \(h_{i}\) and the intersection point(s) of these edges with the interface have distance(s) \(d_{i}\) from \(\mathcal{N}\). As shown in Figure 14, the new location of this node after performing \(r\)-adaptivity is determined as follows:  
\(\bullet\)**Case 1:**: If only one of the edges connected to \(\mathcal{N}\) intersects an interface:  
\(\bullet\)If \(d\geq 0.5h\): no need to relocate the node. \(\bullet\)If \(d<0.5h\): move the node to the edge-interface intersection point. \(\bullet\)**Case 2:**: If two of the edges connected to \(\mathcal{N}\) intersect an interface:  
\(\bullet\)If \(d_{1}\geq 0.5h_{1}\) and \(d_{2}\geq 0.5h_{2}\): do not relocate the node.