## 5 Cellular Automata Algorithm with Refined Mesh Adaptation
If refining is applied too late, the resulting topology can be formed by a coarse mesh, and the topology details may be omitted. Detailed discussion of this issue can be found in [7]. The main goal of the work described in this paper was the reduction of the number of finite elements in mesh discretization during topology optimization, without losing the accuracy of the final solution. Various strategies of mesh refinement were investigated, and based on that research, the authors propose a strategy which performed effectively when incorporated into the topology optimization algorithm. The idea employed in this paper is as follows. First, a given number (up to 10) of optimization steps are performed--those iterations are performed for a coarse mesh. At this stage, first void and solid elements appear, but the structure topology is still far away from the final solution. Based on the coarse mesh layout, the elements for the first refinement are selected. Hence, the second stage of the optimization process (i.e., up to 5 iterations), followed by the second refinement for the selected elements, is performed. The iterative procedure continues until the minimal allowable element size has been reached. This strategy eliminates the situation, when the refinement is applied too early, after a small number of iterations, and a large number of cells is refined because of a large number of grey elements at this stage. Fine mesh applied to the whole structure at an early stage of the process practically eliminates all advantages related to the adaptive strategy implementation, in particular the reduction of the number of elements. On the other hand, if refining is applied too late, the resulting topology can be formed by a coarse mesh and the topology details may be omitted. The number of iterations required for subsequent refinement stages is controlled by the user and may differ depending on the problem being solved. As mentioned earlier, in this method the efficient finite element analysis tool ANSYS is used as the structural analysis module. The solution using the ANSYS package has more advantages, namely the refinement is carried out automatically after the optimization program has indicated refinement regions, and there are also various tools which can be used to improve element quality automatically at each step of the refining process. Additionally, the user can define any complicated geometry, or use different types of elements without implementing significant changes into the main optimization program. The automatic mesh refinement of selected elements proceeds in order to get the resulting element edge length equal to approximately 0.5 of the original element edge length. The mesh created is free from so-called hanging nodes, because the neighboring cells of the refined element are affected (split) in order to preserve the transition between elements. In the automatic refinement of the meshing procedure, the depth of refinement is equal to one element outward of the selected cell, and introducing triangular elements is forbidden; these options can be defined in ANSYS. An illustration of the mesh refinement concept is presented in detail in Figure 7.  
It is worth noting that within the regions of refinement, the number of neighboring cells can vary depending on the type of neighborhood.