CARMA—Cellular Automata with Refined Mesh Adaptation—The Easy Way of Generation of Structural Topologies

: This paper is focused on the development of a Cellular Automata algorithm with the refined mesh adaptation technique and the implementation of this algorithm in topology optimization problems. Traditionally, a Cellular Automaton is created based on regular discretization of the design domain into a lattice of cells, the states of which are updated by applying simple local rules. It is expected that during the topology optimization process the local rules responsible for the evaluation of cell states can drive the solution to solid/void resulting structures. In the proposed approach, the finite elements are equivalent to cells of an automaton and the states of cells are represented by design variables. While optimizing engineering structural elements, the important issue is to obtain well ‐ defined solutions: in particular, topologies with smooth boundaries. The quality of the structural topology boundaries depends on the resolution level of mesh discretization: the greater the number of elements in the mesh, the better the representation of the optimized structure. However, the use of fine meshes implies a high computational cost. We propose, therefore, an adaptive way to refine the mesh. This allowed us to reduce the number of design variables without losing the accuracy of results and without an excessive increase in the number of elements caused by use of a fine mesh for a whole structure. In particular, it is not necessary to cover void regions with a very fine mesh. The implementation of a fine grid is expected mainly in the so ‐ called grey regions where it has to be decided whether a cell becomes solid or void. The benefit of the proposed approach, besides the possibility of obtaining high ‐ resolution, sharply resolved fine optimal topologies with a relatively low computational cost, is also that the checkerboard effect, mesh dependency, and the so ‐ called grey areas can be eliminated without using any additional filtering. Moreover, the algorithm presented is versatile, which allows its easy combination with any structural analysis solver built on the finite element method.


Introduction
Topology optimization is still one of the most important issues in the field of optimal design of engineering structures. It has gained enormous popularity, for many years being an effective tool applied to innovative design projects with a wide range of applications in various areas, including mechanical engineering, civil engineering, bioengineering, material science, and many others. Today, the interest of researchers and designers is mainly focused on improving the quality, versatility, and effectiveness of optimization algorithms to be applied to solving demanding engineering design tasks. Apart from studies on theoretical issues, e.g., [1,2], new numerical algorithms and methods, e.g., [3], and innovative applications, the attention is focused on computational efficiency and accuracy. Modern fast algorithms are developed with the aim of getting optimization codes, which will guarantee that a relatively small number of iterations is needed. At the same time, the reduction of the dimensionality of problems, combined with the refined mesh adaptation, has been considered. Since the first implementation of adaptive mesh in topology optimization [4], the concept of reduction of the number of design variables has become popular, because it allows creation of similar topologies, compared to those with a large number of design variables involved, without extensive computational effort. Moreover, mesh refinement allows inexpensive but efficient improvement of the finite element solution, as shown in [5,6]. A broad discussion of the current state of knowledge can be found in [7][8][9]. Most published papers focused on adaptive strategies discuss filtering, e.g., [10], errors indicators [11,12], or some aspects of a finite element grid, e.g., [13,14].
This paper is focused on the development of a Cellular Automata algorithm with the refined mesh adaptation technique, and the implementation of this algorithm in topology optimization problems. The versatility of the method was confirmed by the results of numerical tests performed for structures under one-and two-load cases, and also for the design-dependent self-weight loading. The results were compared with solutions gained for very fine mesh to confirm their correctness. In this paper, the discussion is also expanded to include some results obtained using algorithms proposed by other authors.

The Aim of the Paper
While optimizing engineering structural elements, the important issue is to obtain well-defined solutions, in particular, topologies with smooth boundaries. The quality of the structure topology boundaries depends mainly on the resolution level of mesh discretization; usually the greater the number of elements in the mesh, the better the representation of the optimized structure (see Figure  1). One can observe, however, that even for a very dense mesh, the so-called grey elements can still be present at the boundaries, even if some filtering techniques have been implemented (see Figure  2). This is because these techniques mainly reduce the effect of mesh dependency and not necessarily eliminate grey elements. This usually requires additional filtering. It can be observed that while implementing dense meshes some thin and slender parts of structural topology can appear. This effect should also be controlled by filtering techniques (see Figure 3).
(a) (b) Figure 3. The appearance of thin and slender parts of structural topology in the case of a fine mesh has to be controlled by filtering techniques: (a) example of a fine mesh without filtering; (b) example of a fine mesh with filtering.
All of the abovementioned issues have to be taken into consideration while developing topology generators for engineering applications. The main goal is to achieve a regular, well-defined structural layout. It seems that the remedy for the above can be the implementation of refined mesh adaptation techniques. Adaptive mesh refinement allows for reduction of the number of design variables without losing the accuracy of results and without an excessive increase in the number of elements caused by using a fine mesh for the whole structure. It is possible to obtain high-resolution optimal topologies with a relatively low computational cost. It is not necessary to cover void regions or solid regions, the appearance and necessity of which are detected in the very first stage of optimization process with a very fine mesh. The implementation of a fine grid is expected to be used mainly for the so-called grey regions, where it is decided whether a cell becomes solid or void. The benefit of such an approach is also that the checkerboard effect and the so-called grey areas can be eliminated without using any additional filtering.
The aim of this paper is to develop a Cellular Automata algorithm with the refined mesh adaptation technique and to present the implementation of this algorithm into topology optimization problems.

Topology Optimization Using the Cellular Automata Method
The concept of topology optimization can be dated back to 1904 and is attributed to the paper by Michell [15], but the papers by Bendsoe and Kikuchi [16], and Bendsoe [17] published in the late 1990s sparked the development of this research area. The idea of topology optimization is to find a material layout which meets the assumed criteria, and in this sense gives the optimal solution. During the optimization process, the material is redistributed within the desired design domain, which leads to the creation of a new shape of optimized structure.
In topology optimization, the computational design domain is discretized and represented by finite elements, for which design variables called relative densities are selected. The material representation can be defined using the well-known and broadly accepted solid isotropic material with penalization (SIMP) approach, e.g., [18,19], where the elastic modulus of each element is a function of relative density : In Equation (1), is the Young modulus of a solid material, whereas the power (usually equal to 3) is introduced to penalize intermediate densities. The constraints are imposed on the design variables, and in Equation (1) is a non-zero minimum relative density introduced in order to avoid singularity.
For the design domain discretized and represented by finite elements, the topology optimization problem aimed at minimizing the function of compliance d of a structure subject to a total volume constraint can be expressed as (see Equation (2)): minimize subject to (2) In (2), and are the global displacement and force vectors, is the global stiffness matrix, and are the element displacement vector and stiffness matrix, respectively, and is the number of elements. Simultaneously, a constraint imposed on global volume of a structure, represented by the function of the design variables , has been applied for a specified volume fraction , and standing for the initial design domain volume. A broad discussion of the principles of topology optimization can be found, for example, in [16][17][18]20].
Simultaneously with the development of the topology optimization area, especially within engineering applications, numerous numerical optimization techniques aimed at solving newly formulated problems efficiently and quickly have been proposed. Some of those optimization techniques are based on gradient information, e.g., the optimality criteria method [21,22] or level set methods [21][22][23], some others implement non-gradient evolutionary techniques [23]. Among many proposals one can also find Cellular Automata (CA). This method has become more and more popular since the introduction of the concept by von Neumann [24] and Ulam [25]. However, the application of Cellular Automata to structural optimization has occurred only in the last two decades. In particular, this concept has been successfully applied to topology optimization, which was illustrated in a series of published papers, e.g., [26][27][28][29][30][31]. In particular, the efficiency of the Cellular Automata method is discussed in [32].
The idea of Cellular Automata is to model a complex system by its discrete idealization and to mimic system performance based on local interactions governed by simple local update rules. The application of CA requires decomposition of the design domain into a lattice of cells, which can have influence only on the neighboring cells. The examples of plane neighborhoods for rectangular cells are presented in Figure 4. Having selected a neighborhood, the problem can now be formulated as a set of local minimizations posed for each element: In order to solve the problem, a heuristic, local CA update rule is here proposed, utilizing the information gathered from a selected neighborhood. New values of design variables can be calculated based on the Gauss-Seidel iteration mode, i.e., cell updates its state based on updated values found for cell neighbors in the current and previous iteration, or on the Jacobi iteration mode, i.e., cell updates its state based on the states of the surrounding cells obtained in the previous iteration only. This scheme was chosen for this paper. In what follows: where t is the current iteration and: The rule is illustrated in Figure 5: In Equation (5) denotes move limit (e.g., = 0.2), coefficients, (for central cell ) and (for M neighboring cells) are calculated based on the concept preliminary reported in [33]-see Equation (6): where , are the values of compliances of the central and neighboring cells, and are the threshold values of compliances which separate cells of the lowest and the largest compliances, and can be selected for each example. For the remaining cells, the linear function was built to fulfill the assumptions and 2 . (7)

Numerical Treatment
The numerical algorithm has been built in order to apply the above proposed approach to the generation of structural topologies.

General
As to the iterative optimization procedure, the sequential/nested approach has been adapted. Thus, for each iteration a structural analysis for the optimized element is performed first, and then the local updating rules are applied. It means that the objective is computed from the state solution obtained, and the design field is updated based on the local rule. As for the material density, the design variables field follows the discretization of the FEM solver.
One of the assumptions was to combine the algorithm with a professional structural analysis code. The CA topology generator introduced can easily be combined with such programs. In this paper, the finite element analysis tool ANSYS stands for the structural analysis module.
The global volume constraint can be applied for a specified volume fraction. The volume constraint is implemented in each iteration when local update rules have been applied to all elements. In practice, the design variables multiplier is introduced, and then its value is sought, to fulfill the volume constraint. As a result, the topologies generated preserve a specified volume fraction of a solid material during the optimization process.
In the present study, the assumed change of the objective function value for subsequent iterations was implemented as the stopping criterion, but in general it can also be defined as performing a selected number of iterations.

The Local Rule
As for the practical numerical realization of the CA local rule (4)- (7), it is proposed to introduce the threshold number of cells, instead of the threshold compliance value. To do this, the cell compliances are sorted in ascending order and consecutive indices are ascribed to the sorted cells.
In what follows, and can be replaced now by and , where is the number of elements of the smallest compliance and stands for the number of elements of the largest compliance. Equation (7) can be rewritten in the form of Equation (8): In this method, 1 is implemented, but a selection is not restricted to this value. It is important to underline that in the presented algorithm, only two parameters to adjust are defined, namely and . One can select these values to control and tune the algorithm performance, for example, start with a wide interval , decreasing it as the generation of topologies proceeds. Based on numerical tests performed, it is recommended to start with the selection: 0.1 and 0.9 , which means the selection of 10 percent of elements in both the subset of the smallest and the subset of the largest compliances. After a given number of iterations, the values of and can be modified. For the test examples in this paper, after 20 iterations the value 0.7 , whereas 0.9 remained unchanged. It has been observed that adjusting the interval can speed up the process of eliminating the so-called grey elements at the final stage of topology generation.

Neighborhood
Each cell has the same selected neighborhood, therefore those at the boundary have neighboring cells that lie outside the design domain. For those cells, the values of the design variables must be also specified. The most common approach, utilized in this paper, is to set all these values to a fixed value; zero is the usual choice. As an alternative, adiabatic or reflecting boundary conditions (e.g., [29]) can also be adopted (see Figure 6).

The Pseudo-Code
Below, in Table 1, the pseudo-code of the proposed algorithm is listed.

Cellular Automata Algorithm with Refined Mesh Adaptation
The effectiveness of any algorithm applied to solve topology optimization problems relies on the computational effort required to obtain the optimal solution in terms of the number of iterations to perform, number of elements used in the structural analysis, number of design variables, and so on. This computational effort can be reduced by introducing a non-regular mesh of finite elements during the iteration process, by adapting the algorithm to perform mesh refinement within selected regions of the design domain. From the numerical point of view, it is not so obvious where and how to apply such refining, and it is generally assumed that this choice is related to the problem under consideration [34]. For example, the regions of stress concentration or the value of the numerical error indicator can suggest the refinement. While performing topology optimization, the attention is focused on the regions where it has to be decided whether design elements become solids or voids, i.e., on the so-called grey regions defined by the refinement indicator γi [10]: According to [10], the value of γi ≥ 0.16 indicates the necessity of refinement of the ith element. Nevertheless, the numerical studies performed have shown that this value can be slightly modified and adjusted to specific examples being considered. It is also possible to choose a different adaptive strategy based on, for example, the values of compliance or stress calculated for design cells. Based on preliminary studies, one can state that the adjustments of the boundary values of the refinement indicator have a more significant influence on the final refinement than the values of physical quantities on which they are defined. It is also worth mentioning that the function in Equation (9) does not need to be a quadratic function, including asymmetry. This issue could be investigated in detail in further research. Based on the above discussion, the mesh refinement was applied to inner and outer boundaries to improve the quality of the boundary representation. Importantly, it allows grey elements on the boundaries to be avoided, and a solid/void (black-and-white) structure to be obtain, at the same time controlling the mesh resolution. The proposed Cellular Automata approach does not require any additional density filtering to generate solid/void topologies, and the simplest refinement strategy described above is entirely sufficient to meet a condition of smooth boundaries with a very fine mesh.
To control the process of the mesh refinement, the principles described, e.g., in [6] and [8] were adopted. The first rule is to keep the element size within the defined range, i.e., the smallest size of elements which can be refined is set. That prevents the creation of very small elements, which bring no improvement to the solution. The next issue is when to apply a refinement. If it is applied too early, after a small number of iterations, a large number of cells will be refined because of a large number of grey elements at this stage. In the end, this causes the profit from the reduction of the total elements number to be low. 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.

The Square Cantilever Structure
As an introductory example of the implementation of the proposed idea, a plain elastic square structure, fixed along the left edge and loaded as presented in Figure 8, was chosen. The Young modulus and the Poisson ratio were E = 2 10 11 Pa and ν = 0.3, respectively. A volume fraction equal to 0.5 was implemented. A concentrated force P equal to 1000 N was applied. First, the structure was discretized with a regular mesh of 2500 cells (0.0004 m 2 ). The topology optimization with an adaptive refinement procedure was applied and the results are presented in Figure 9, where the selected middle topologies and the final one are shown. At the end of the optimization process, the resulting number of cells equaled 26,217. The final value of the compliance equaled 2.149 10 −4 Nm. The iteration history showing the fast convergence to the final solution is provided in Figure 10.  For these calculations, the von Neumann neighborhood was chosen, but the implementation of the Moore one was also tested. According to the results of this study, the choice of the neighborhood type had no significant influence on the final results of the topology optimization for the examples discussed in this paper. Below (Figure 11), the final topologies found for von Neumann (left) and Moore (right) neighborhoods are presented. The final values of the compliance for both types were the same, i.e., 2.149 10 −4 Nm. To compare the results of the application of the Cellular Automata to the refined mesh adaptation with the results obtained for a regular mesh, the structure was discretized with a regular lattice of 211,600 elements (~4.726 10 −6 m 2 , see Figure 12d), which corresponds to the size of the smallest elements of the mesh formed during refinement. To get the results for the refined mesh and for the regular mesh, the proposed algorithm needed 39 and 48 iterations, respectively.
The comparison of the computing time for the example discussed was performed to illustrate the effectiveness of the proposed approach. The timing information for the case of mesh refinement, and calculation for the corresponding fine mesh, were taken into account. A clock-time was used as a metric of algorithm runtime. The calculation process consists of two main stages: FEM analysis and design variable update. For the optimization involving the mesh refinement, after a given number of iterations with initial mesh, two refinement processes were performed. The times of those processes had minimal influence on the final time of all calculations, and the profit from applying the mesh adaptation was not reduced by the need to carry out the mesh refinement. The time spent on an optimization iteration is less than 2 s, even for a large number of elements. The time consumption is therefore caused by the structural analyses. For the example considered (where a 4-node finite element was used), the total time of the whole process in the case of a mesh adaptation was equal to about 24 min, while for a fine uniform mesh it was more than 140 min. The ANSYS Mechanical 14.0 was used as the analysis tool with two Intel(R) Xeon(R) CPU E5645 2.4 GHz processors and 192 GB of RAM (64 bit architecture). It is important to underline that for every iteration for a regular mesh, 168 s are needed to perform the analysis, while for each step of a mesh refinement, 8, 15, and 45 s are needed, respectively.
To check if the resulting designs depend on the initial resolution of the mesh, the calculations were repeated for three sizes of initial elements: 0.0025 m 2 , 0.0004 m 2 , and 0.0001 m 2 . Final topologies are presented in Figure 12, including those calculated for a regular mesh for 211,600 elements. In each case, the same number (2) of mesh refinements was performed during the adaptation process, to get a more appropriate comparison. For the sake of comparison, this example was solved using both the code based on [35] with different filtering techniques, including the one based on Helmholtz type differential equations [36], and the code based on [37]. The results are given in Figure 13 and Figure 14, respectively.
(a) (b) (c) Figure 13. Final topology obtained using [35] with a small (a) and a large filtering radius. Case (b) refers to density filtering, whereas case (c) is the result of application of filtering based on Helmholtz-type differential equations.
(a) (b) Figure 14. Final topology obtained using [37] with a small (a) and a large (b) filtering radius.
Additionally, the initial irregularities in the mesh were introduced to illustrate the flexibility of the method. Irregularities (a denser mesh) were located in places with the expected concentration of stresses for the initial structure (see Figure 15). The final value of the compliance equaled 2.388 10 −4 Nm. The iteration history is shown in Figure 16.

The Rectangular Cantilever Structure
As a second introductory example, a plain elastic structure fixed along the left edge, and loaded with three concentrated forces, as presented in Figure 17, was chosen. The Young modulus and the Poisson ratio were E = 2 10 11 Pa and ν = 0.3, respectively, and P equaled 1000 N. A volume fraction equal to 0.5 was implemented. In the first step, the structure was discretized with a regular mesh of 1500 cells. The topology optimization with a refining procedure was applied, and the results, including selected iterations and final topology, and the iteration history, are presented in Figures 18 and 19, respectively. At the end of the optimization process, the resulting number of cells equaled 33,853, and the final value of the compliance equaled 0.820 10 −5 Nm. To cover the whole structure with a fine mesh with 8-node elements (the same size as the smallest elements as in the refined grid), 101,250 elements were needed. For the example considered, the total time of the whole process in the case of a mesh adaptation was equal to about 37 min, while for a fine uniform mesh it was more than 250 min. It is important to underline that for every iteration for a regular mesh, 500 s are needed to make an analysis, while for each step of a mesh refinement, 7, 33, and 85 s are needed, respectively. The computational cost is generated mostly by the structural analysis. Time spent on updating the design variables is 1-2 s per iteration, the optimization part returns an almost immediate response.  For comparison, this example was calculated using both the code based on [35] and the code based on [37]. The results are given in Figures 20 and 21, respectively. (a) (b) Figure 21. The final topology obtained using [37] with a small (a) and a large (b) filtering radius.

The T-bracket Structure
To examine the proposed Cellular Automata method combined with the refined mesh adaptation, more complicated geometries were investigated. The first of them is a T-bracket structure (see Figure 22). Half of the element was considered due to symmetry. The Young modulus and the Poisson ratio were E = 2 10 11 Pa and ν = 0.3, respectively. A volume fraction equal to 0.5 was implemented, a concentrated force P = 1000 N was applied. As in the previous example, the dynamic mesh refinement was implemented for an initially regular mesh of 775 elements. The initial mesh, a selected iteration, and the final topology for this example are shown in Figure 23. The compliance value of the optimized structure equals 1.741 10 −4 Nm, the iteration history is presented in Figure 24.  For comparison, this example was calculated using the code based on [35]. The resulting topology is given in Figure 26.

The Kneestructure
A knee-structure was chosen as the next example to illustrate the performance of a proposed methodology ( Figure 27). The Young modulus and the Poisson ratio were E = 2 10 11 Pa and ν = 0.3, respectively. A volume fraction equal to 0.5 was implemented, and force P = 1000 N. The optimization process started with 645 elements, and at the end the mesh consisted of 18,191 elements. To cover the whole structure with the same very fine mesh, 69,348 elements were required. The final value of a compliance equaled 1.486 10 −4 Nm. Selected middle topologies and the final one are presented in Figure 28, the iteration history is presented in Figure 29.  Next, this example was calculated with the code based on [35], with the resulting topology shown in Figure 30.

The Plane Structure with Holes
The plane symmetric structure with holes presented in Figure 31 was selected to illustrate the performance of the algorithm for more complicated geometry. The radii of the holes were R1 = 0.075 m, R2 = 0.03 m, R3 = 0.045 m. The Young modulus and the Poisson ratio were E = 2 10 11 Pa and ν = 0.3, respectively. A volume fraction equal to 0.75 and a concentrated force P = 1000 N were applied. The optimization process started with 2818 and at the end the mesh consisted of 34,596 elements. To cover the whole structure with the same very fine mesh, 770,775 elements were required. The final results are presented in Figure 32 and the iteration history is presented in Figure  33. The final value of the compliance equaled 0.716 10 −3 Nm.  In this case of a mesh with high irregularities, an additional CA rule was introduced; solid elements that are surrounded by voids are converted into voids, and vice versa. This prevents the appearance of sharp details along the edges.
The example was calculated with the code based on [35] with resulting topology shown in Figure 34.

Topology Optimization for a Multiple Load Case
As the example of the two-load scheme, a plain elastic square structure fixed along the left edge and loaded as shown in Figure 35 was chosen. The Young modulus and the Poisson ratio were E = 2 10 11 Pa and ν = 0.3, respectively. A volume fraction equal to 0.4 was implemented, and a concentrated force P = 4000 N was applied. The initial regular mesh consisted of 1156 elements. The topology optimization steps (selected iterations) with mesh refinement are presented in Figure 36. The iteration history is shown in Figure  37. The final value of the compliance equaled 0.451 10 −2 Nm.  At the end of the optimization process according to the refinement, the resulting number of cells equaled 44,034, while the regular mesh needed 92,416 elements to cover the whole structure with elements of the same size as the smallest cell of the irregular mesh. The resulting topology was free from grey elements on the boundaries, small holes, and thin elements, which is desirable from the point of view of the manufacturing technology. This effect was gained without additive filtering, in contrast to the studies presented in [38].

Topology Optimization under Self-Weight Load
Including design-dependent loading like self-weight makes the examples considered more practical and realistic, but computationally more demanding. On the other hand, this aspect has significant importance while considering, for example, massive engineering structures. The problem of topology optimization with design-dependent loads is discussed, for example, in [39] and [40]. When dealing with self-weight loading, the modification and extension of a standard SIMP method is necessary (see [41]), so that the material density ρi of each element is defined according to Equation (8): .
It is worth noticing that the total volume constraint can be inactive while considering topology optimization, including self-weight loading. The right choice of algorithm control parameters can prevent this problem.
A rectangle (2 m × 1 m) supported at the left and right lower corners under self-weight was investigated to illustrate the topology optimization under the presence of self-weight loading. Half of the element was considered due to the symmetry. The Young modulus E = 2 10 11 Pa and the Poisson ratio ν = 0.3, were implemented. The density of the material equaled ρ = 8000 kg/m 3 . The volume fraction was equal to 0.5. Only self-weight loading was taken into account. The initial regular mesh consisted of 400 elements, and at the end of the refinement process this number reached the value of 4593. Selected middle topologies and the final one are presented in Figure 38. The corresponding regular grid would require 32,400 elements.

Conclusions
The quality of structural topologies depends on the density of mesh discretization. On the other hand, the use of fine mesh for a whole structure in order to obtain a topology with smooth boundaries implies a high computational cost. The remedy for that can be the implementation of the adaptive mesh refinement. Refining mesh in an adaptive way allows for reduction of the number of elements without losing the accuracy of results. Choosing this approach in this paper, a Cellular Automata approach with the refined mesh adaptation has been proposed in order to generate structural topologies. The fine grid was implemented mainly in the so-called grey regions, where it has to be decided whether a cell becomes solid or void. The results of topology generation for illustrative examples confirmed the accuracy of the approach presented in this paper.
The benefits of applying the Cellular Automata algorithm with the refined mesh adaptation can be summarized as follows:  high-resolution optimal topologies can be generated with a relatively low computational cost  the algorithm presented is versatile, which allows for its easy combination with any solver built on a finite element method  using Cellular Automata does not require additional density filtering  boundaries of the resulting structures are smooth  in the case of a fine mesh, thin and slender parts of structural topology do not appear  the so-called grey areas are eliminated without using any additional filtering  the mesh dependency phenomenon has not been observed  topologies generated are free of the checkerboard effect.
Although the discussion in this paper has been restricted to generation of plane topologies, it has to be stressed that the proposed concept can be extended to spatial problems. Both the form of the Cellular Automata local rules and the possibility of refinement of the meshing procedure offered by the ANSYS solver allow adjustment to 3D tasks.
It is also worth noting that the proposed approach can also be extended to the implementation of the adaptive mesh refinement based on solution errors, e.g., equivalent stress error or deformation error, which allows for improvement in the numerical accuracy of the structural analysis.
Author Contributions: As far as conceptualization, methodology, software, investigation and writing the paper are concerned, B.B. and K.T.-Z. contributed equally to this work. All authors have read and agreed to the published version of the manuscript.