# Multi-Scale Concurrent Topology Optimization Based on BESO, Implemented in MATLAB
## 6 Numerical Results
Regarding the macro domains, different target volume fractions were considered between the test cases, and a sensitivity filtering technique was applied with different filtering radii for each test case. For the cantilever beam with a fixed hole test case, a target volume fraction of 50% and a filter radius of 6 elements were considered. In addition, the long cantilever beam had a target volume fraction of 50% and a filter radius of 3 was considered. Lastly, for the L shape test case, a target volume fraction of 30% and a filter radius of 3 elements were considered. The resulting optimal geometries for both the structural and periodic unit cell are presented in Figure 3.  
The call to the ConcTopOptBESO function for the three test cases is presented below in Listing 10. ```
1[c,CH,x,y]=ConCTopOptBESO (1.5,1,150,100,50,50,0.5,3,6.0,1.5,0.05,p)%Cantilever
```
2[c,CH,x,y]=ConCTopOptBESO (1,1,80,80,50,50,0.3,0.5,3,3.0,1.5,0.05,p)%L-shape ```
3[c,CH,x,y]=ConCTopOptBESO (4,1,160,40,50,50,0.5,3,3.0,1.5,0.05,p)%longCantilever
```

For the implementation of the different support and loading conditions, _Lines_ 15 and 16 are modified depending on the test case. For the cantilever test case, _Lines_ 15 and 16 are modified following Listing 11. ```
1[c,CH,x,y]=ConCTopOptBESO (1.5,1,150,100,50,50,0.5,3,6.0,1.5,0.05,p)%Cantilever
```

Listing 11: Loading conditions and fixed degrees of freedom for the cantilever test case

```
1[c,CH,x,y]=ConCTopOptBESO (1.5,1,150,100,50,50,0.5,3,6.0,1.5,0.05,p)%Cantilever
```

Listing 10: Optimization parameters for the three 2D test cases

For the L-Shape test case, _Lines_ 15 and 16 are modified following Listing 12. Lastly, for the long cantilever test case, _Lines_ 15 and 16 are modified following Listing 13. **Listing 13** Loading conditions and fixed degrees of freedom for the long cantilever test case

15F = sparse(2*(nelx*(nelx*(nely+1)+nely/2+1),1,-load,2*(nely+1)*(nelx+1),,1);
16 fixeddofs = 1:2*(nely+1);

In the implementation of the cantilever beam with fixed hole and L-shape test cases, a set of passive elements is necessary to enforce part of the macro domain to be void. The passive element implementation follows the implementation presented in top88 in [27]. Thus, a matrix called _passive_ is initialized during the initialization step of the optimization procedure following Listing 14 for the Cantlever. Figure 3: The 2D test cases—Resulting geometries for both structural (macro-scale) and periodic unit cell (micro-scale). ```
1 passive=zeros(nely,nelx);
2 fori=1:nelx
3 forj=1:nely
4 ifsqrt((j-nely/2)^2+(i-nelx/3)^2)<nely/3
5 passive(j,i)=1;
6 end
7 end
8 end
```

**Listing 14** Initialization of the passive element variable for the cantilever test case

```
1 passive=zeros(nely,nelx);
2 fori=1:nelx
3 forj=1:nely
4 ifi>nelx/3&&j<2*nely/3 passive(j,i)=1;
6 end
7 end
```

**Listing 15** Initialization of the passive element variable for the L-Shape test case

```
1 forall=1:nelx
3 forj=1:nelx
4 ifi>nelx/3&&j<2*nely/3 passive(j,i)=1;
6 end
7 end
```

**Listing 16** Implementation of the passive elements inside the optimization procedure

Regarding the 3D test cases, two different examples were selected for optimization. These examples are the 3D cantilever beam and the 3D wheel. A graphic representation of these two test cases is also illustrated in Figure 4.

Figure 4: _Cont._



The call to the UCOpt3D for the two 3D test cases is presented in Listing 17. **Listing 17** Optimization parameters for the three 3D test cases

1. [c,CH,x,y]=ConcTopBeso3D (1,1,0.5,40,20,40,20,20,0,0.2,0.5,3,1.5,3.0,0.05,p) % 3D Wheel
2. [c,CH,x,y]=ConcTopBeso3D (15,5,1,60,20,4,20,20,20,0.3,0.5,3,1.5,3.0,0.05,p) % 3D Wheel

For the implementation of the different support and loading conditions, _Lines_ 12-19 are modified depending on the test case. For the 3D Wheel test case, _Lines_ 12-19 are modified following Listing 18. **Listing 18** Definiton of loading conditions and fixed degrees of freedom for the 3D wheel test case

1. [leftmargin=*]
2.