1 Introduction

Michell’s (1904) work on the layout optimization of trusses can be considered the first investigation of topology optimization (TO). Before the emergence of modern TO algorithms, many efforts have been made concerning material distribution optimization in 2D and 3D design areas (Bendsøe et al. 1994, 1995; Asgari 2015, 2016). Since then and mainly over the past decades, with the emergence of various methods including density-based methods (Bendsøe 1989; Zhou and Rozvany 1991), evolutionary procedures (Xie and Steven 1992, 1993), bubble method (Eschenauer et al. 1994), topological derivative (Sokolowski and Zochowski 1999), level-set methods (Sethian and Wiegmann 2000; Allaire et al. 2002; Wang et al. 2003; Xia et al. 2006, 2011, 2012, 2014; Luo et al. 2008; Xia and Shi 2016a, 2016b) and phase-field method (Bourdin and Chambolle 2003), TO has gone under serious changes and developments in both academic and industrial disciplines. The single-material minimum compliance problem subjected to a volume constraint is the most considered design case in this area. However, its borders have gone beyond single material static problems, and novel subjects including non-homogenous and multi-material cases (Banh et al. 2023, 2021a, 2021b; Ngoc et al. 2022; Doan and Lee 2017), non-linear studies (Meng 2022), fuzzy and probabilistic-based TO models (Meng et al. 2020, 2021), etc. have been studied by researchers.

The evolutionary structural optimization (ESO) method proposed by Xie and Steven (1992, 1993), is a heuristic TO method based on the simple concept that a structure’s topology is optimal when low-stress areas are gradually removed from. This simple concept behind the ESO method makes it a user-friendly one for researchers and students. Its extended version, known as the bi-directional evolutionary structural optimization (BESO) method, was developed by Querin et al. (1998, 2000a, 2000b). In this method, adding elements to highly stressed areas became possible as well as their removal from low-stress regions. The next prominent development in the ESO method was presented by Huang and Xie (2007a) which was an improved version of the BESO method. This update has shown a promising performance in a wide range of structural design studies including stiffness and frequency optimizations (Teimouri and Asgari 2019, 2020; Huang et al. 2010), nonlinear material and large deformation problems (Huang and Xie 2007b, 2008a), energy absorption (Huang et al. 2007), multiple materials (Huang and Xie 2009), multiple constraints (Huang and Xie 2010a), periodic structures (Huang and Xie 2008b), hybrid structures (Dong et al. 2020; Teimouri et al. 2021), and so on (Huang and Xie 2010a). Apart from being very easy to understand and implement (at least for the compliance minimization case), the primary motivation for the evolutionary approaches seems to be that mathematically based or continuous variable approaches “involve some complex calculus operations and mathematical programming” (Li et al. 1999). They contain “mathematical methods of some complexity” (Zhao et al. 1998), whereas the evolutionary approach “takes advantage of powerful computing technology and intuitive concepts of evolution processes in nature” (Li et al. 1999). Through years of development, the current form of BESO has become a gradient-based mathematical optimization method with convergent and mesh-independent algorithms (Zuo and Xie 2015).

Implementation of the TO algorithms in different engineering problems has been the subject of many studies, and researchers, either academic or industrial have published several codes and programming tools for this purpose. Meanwhile, these codes have been helpful for new users to understand the underlying idea of structural topology optimization (Zhu et al. 2021). In the review and educational articles of (Zhu et al. 2020, 2021), these optimization programs are discussed in detail. In Table 1 (Han et al. 2021), educational computer programs for continuum topology optimization problems are gathered from different articles.

Table 1 Educational computer programs for topology optimization (Dong et al. 2020)

Most of the presented codes are written by solving the simple mean compliance problem; one can easily apply them to solve different compliance problems. Among other published codes for different algorithms, there have been several efforts to implement the ESO and BESO methods including soft-kill and SERA for 2D problems, and PYTHON3D for 3D problems. In a comprehensive review of the BESO method on advanced structures and materials, MATLAB codes esoL and esoX can be referred to Xia et al. (2018). The BESO method, with its discrete nature, can overcome numerical instabilities such as checkerboarding, mesh dependency, and intermediate material densities. Yongsheng Han’s article (Han et al. 2021) introduces an efficient 137-line MATLAB code for geometrically nonlinear compliance topology optimization problems using the BESO method. These codes have also smoothed the way for many commercial TO software packages like TOSCA, n-Topology, Altair Inspire, and so on, which have been used by researchers in many articles (Teimouri and Asgari 2021). Among the published programs, few of them have focused on using well-known FEM packages in their optimization code. It seems that optimization codes equipped with this feature can be more successful in solving versatile structural problems. Moreover, higher calculation speed and more precise and valid outputs are expected while the FEA part is done by an efficient powerful software like ANSYS or ABAQUS. This feature makes the designer more convenient to focus on the code and optimization process rather than solving a complicated FEM problem for a specific geometry or mesh size.

Being aware of the above-mentioned research efforts' pros and cons, and also considering the FE modeling complexity of different published codes, this work is aimed at developing a multipurpose efficient optimization software interface that could be easily understood, used, and developed by students and researchers all around the world.

In this work, a BESO-based MATLAB-ABAQUS interface is presented for solving 2D compliance problems. This interface includes MATLAB functions generated based on the BESO optimization steps, which are capable of reading the ABAQUS FEA results file, exporting and analyzing its required data, updating the design area, and finally, writing a new FE input file in each iteration.

In Sect. 2, the BESO procedure is briefly discussed. The detailed program lines written in MATLAB are presented in Sect. 3. In Sect. 4, some examples are presented and compared to other programs’ results to validate the presented software package. Finally, conclusions are made in Sect. 5.

2 The BESO algorithm formulation implemented in MATLAB

2.1 Problem statement

The solid-void minimum compliance or maximum stiffness topology optimization problem with a volume constraint is considered as follows:

$$\begin{array}{*{20}l} {{\text{Minimize}}:} \hfill & {C = \frac{1}{2}{\varvec{F}}^{{\varvec{T}}} {\varvec{U}}} \hfill \\ \end{array}$$
(1a)
$$\begin{array}{*{20}l} {{\text{Subject to}}:} \hfill & {\mathop \sum \limits_{j = 1}^{Ne} x_{j} V_{j} \le V_{0} } \hfill \\ \end{array}$$
(1b)
$${\varvec{F}}={\varvec{K}}{\varvec{U}}$$
(1c)
$$\begin{array}{*{20}l} {{\text{Design variable}}:} \hfill & {x_{j} = \left( {0 \;or\;xmin} \right)or\;1} \hfill \\ \end{array}$$
(1d)

where \(C\) is the total strain energy (the objective function), \({\varvec{F}}\) and \({\varvec{U}}\) are global load and displacement vectors, \({\varvec{K}}\) is the global stiffness matrix, \(\bf x\) is elements’ densities vector representing their presence or absence in the design space, \({V}_{j}\) and \({V}_{0}\) indicate the jth element’s volume and the prescribed volume of the final structure respectively, and \({N}_{e}\) is the total number of elements in the design space.

2.2 The BESO algorithm

Applying the material interpolation scheme of the SIMP method in the BESO algorithm, a solid-void pattern will be assumed. This scheme is considered as follows:

$$E\left({x}_{j}\right)={E}_{1}{x}_{j}^{p}$$
(2a)
$${\varvec{K}}=\sum_{j=1}^{{N}_{e}}{x}_{j}^{p}{{\varvec{K}}}_{{\varvec{j}}}^{1}$$
(2b)

In Eq. (2a), the elastic modulus of each element is defined as a function of the element density and solid material’s Young modulus \({E}_{1}\), and \(p\) is the penalization parameter equal to 3. In Eq. (2b), the global stiffness matrix, \({\varvec{K}}\), depends on the jth element density and the stiffness matrix of the solid material \({{\varvec{K}}}_{{\varvec{J}}}^{1}\).

The BESO method applies a gradient-based strategy in the sensitivity analysis step to update the design domain. So, the design variables are updated based on the elemental sensitivity number \({\alpha }_{e}\) as follows:

$${\alpha }_{e}=\frac{\partial C}{\partial {x}_{e}}$$
(3a)
$${\alpha }_{e}=-p{x}_{e}^{p-1}{{\varvec{u}}}_{{\varvec{e}}}^{{\varvec{T}}}{{\varvec{k}}}_{1}{{\varvec{u}}}_{{\varvec{e}}}$$
(3b)

In Eq. (3b), \({{\varvec{u}}}_{{\varvec{e}}}\) represents the elemental displacement vector.

To overcome the mesh-dependency and checker-boarding of the design domain, a smoothing approach is applied to the sensitivity numbers of elements as follows:

$$\widehat{{\alpha }_{e}}=\frac{{\sum }_{j}w({r}_{ej}){\alpha }_{j}}{{\sum }_{j}w({r}_{ej})}$$
(4a)
$$w\left({r}_{ej}\right)=\mathrm{max}(0,{r}_{min}-{r}_{ej})$$
(4b)

where \({r}_{ej}\) is the distance between elements e and j centroids, w indicates the weight function of each element, and \({r}_{min}\) is the filtering radius. To achieve convergent solutions, the BESO method uses average elemental sensitivity numbers that bring the history of the procedure into account (Eq. 5).

$$\widehat{{\alpha }_{e}}=\frac{\widehat{{\alpha }_{e}^{k}}+\widehat{{\alpha }_{e}^{k-1}}}{2}$$
(5)

For detailed information, one can refer to the book, “Evolutionary topology optimization of continuum structures, Methods and Applications”, proposed by Huang and Xie (2010b).

After modifying elemental sensitivity numbers (Eq. 5), they will be sorted. The criterion used for elements addition/deletion in the BESO method is defined as the sensitivity numbers of solid elements (\({x}_{j} = 1\)) are always higher than those of soft elements (\({x}_{j} = 0/xmin\)). So, depending on the elements removal approach (soft-kill or hard-kill), those with lower sensitivity numbers will be removed or labeled with xmin (Huang and Xie 2010b). The number of removed or xmin-labeled elements is determined based on the volume constraint evolutionary ratio (\(ER\)) at each step \(k\) (Eq. 6).

$${V}_{k+1}={V}_{k}\left(1\pm ER\right) (k=\mathrm{1,2},3,\dots )$$
(6)

The add/remove procedure of elements and FEA continues in a repetitive loop until the optimization constraint is reached and the objective function is converged. Convergence of the objective function is calculated based on Eq. 7.

$$error=\frac{\left|\sum_{i=1}^{N}{C}_{k-i+1}-\sum_{i=1}^{N}{C}_{k-N-i+1}\right|}{\sum_{i=1}^{N}{C}_{k-i+1}}\le \tau$$
(7)

The iterative procedure of the main BESO method and its implemented version in this article (the MATLAB-ABAQUS interface) is presented in Figs. 1 and 2.

Fig. 1
figure 1

Flowchart of the BESO algorithm (Huang and Xie 2010b)

Fig. 2
figure 2

Flowchart of the FEM-based BESO developed in the MATLAB-ABAQUS interface

3 MATLAB-ABAQUS interface implementation

In the following, the main optimization code (engine/source) and its functions will be explained in detail. The source code (BESO m-file) consists of 6 sections that take the user through the optimization process. These sections are presented from 3.1 to 3.6.

Before the main code, all texts from the Command Window are cleared; resulting in a clear screen; and then, an arbitrary working directory is defined by the user (lines 1–5). All MATLAB files, FEA input and output files, and optimization results will be created and saved in this directory. This directory will be called by the System command in line 6.

All codes can be found in Appendix A.

3.1 Define a design domain (lines 7–8)

The MATLAB-ABAQUS TOP interface is developed for two-dimensional problems with linear plane stress elements. The initial design domain, including geometry, loading, boundary conditions, linear plane stress elements, quad meshes (CPS4R), and a static analysis step need to be defined in the ABAQUS CAE environment. Then, a.inp job file should be exported from the ABAQUS job module to the predefined directory where MATLAB m-files exist. In this study, the exported input file is named Job-1. It should be opened after creation by a text editing tool of Windows, and the following texts should be added/replaced after the “” section:

figure b

These changes define the outputs, including nodal displacement and coordinates, and elemental stress, strain energy, and volume values, that all are needed in a compliance optimization problem. This file data will be needed to run the zeroth iteration FEA (Sect. 3.3) on the initial design domain and extract the model parameters (elemental and nodal data of the initial design domain (Sect. 3.4)), which will be required in the sensitivity analysis.

As the optimization process begins, a dynamic ABAQUS input file, the same as the initial design domain, will be needed to be called for creating the next iteration input file (updated design domain). It should be noted that this file should include the deleted or soft elements to result in an updated design area. So, a copy of the created.inp file should be created in the same folder named Job-1temp with the following modifications made to it:

If a hard-kill approach is desired, the “” string, should be added right before the “” line:

figure e

The above-mentioned line defines an element set named that includes the list of elements that should be deleted at each step. This elemental set will be removed from the design area based on the following modifications to the file:

figure g

If a soft-kill approach is desired, instead of the permanent deletion of elements, their initial material property should be replaced by a soft material’s property. For this purpose, the following modifications in the Job-1temp file should be applied:


Step 1: Soft elements (equivalent to deleted elements of the hard-kill procedure) should be defined as an element set as follows:

figure h

Step 2: Mechanical properties of the soft material (Material-2), calculated based on Eq. 2a, should be added after the “” headline as follows:

figure j

Step 3: To assign the Material-2 properties to the soft elements ( ), another section definition is needed in the ABAQUS Material property module. This section is defined as follows:

figure l

After applying the above-mentioned modifications, the dynamic ABAQUS input file is ready to be used during the optimization iterations. This.inp file will be summoned and read line by line to write a new input file as an updated design area (Sect. 3.5.2).

It should be noted that to use any other type of element (like 3D cubic element which is of more interest to researchers), the smoothing step of the BESO algorithm needs to be modified for 3D elements and so, the sensitivity analysis. Consequently, modifications based on a 3D element's equation order and the number of nodes should be applied to all necessary matrices' sizes in the MATLAB functions.

3.2 Define the BESO parameters (lines 9–12)

In Sect. 2, the BESO initial parameters such as evolutionary ratio (ER), maximum addition ratio (AR_Max), minimum filtering radius (Rmin), volume fraction (Vol_Frc), minimum design variable (xmin), and penalization parameter (p) values are defined and entered by the user (the last two are only defined in case of using a soft kill approach). These parameters are constant during the optimization iterative process.

3.3 Zeroth iteration (lines 13–15)

In the third section, ABAQUS is called to run the first Finite Element (FE) simulation (the zeroth iteration) on the initial design domain (Job-1.inp). For this purpose, the system command is used to summon ABAQUS for running the predefined Job-1.inp file. Its job output is named Iteration_0, and its data will be used in the optimization evolutionary process initiation (5th section). A function is created named as LckChk.m to check the appearance and disappearance of the ABAQUS.Lck file and freeze the optimization process till the FEA is completed and results are extractable.

3.4 Obtaining FEM model parameters (line 17)

In the fourth section, using the second generated MATLAB function (ObtPar.m (98-line)), model parameters including nodal coordinates, elemental connectivity, elements centroid coordinates, nodes in an element filtering radius, elements connected to a node, number of elements (NmEl), and nodes (NmNd), initial volume (InitialVol), and design area volume (DesVol) are extracted from the model input file (Job-1.inp). Based on these data, the weight of nodes in an element filter radius (Nd_weight) and elements’ weight connected to a node (El_weight) will be calculated. All these data will be saved to BESO_Arrays.mat and will be called at each iteration to be used in the sensitivity analysis (Eqs. 3, 4 and 5) and volume evolution formula (Eq. 6).

3.5 Beginning of the evolutionary process (lines 18–50)

In Sect. 5, the evolutionary procedure of the BESO method is implemented. Before the initiation of the optimization loop, some definitions need to be made (lines 18–22). Firstly, a zero matrix is created for saving elemental old (previous While loop) sensitivity numbers, and three zero matrices are created for saving the index (number) of dead (removed) and live elements. To count down the value of the current iteration, the Iter variable is defined and set to zero. The error variable indicating the value of the compliance convergence criteria is set to 1000.

The optimization iterative procedure is implemented in a While loop. To start the first iteration, the FE results of the initial design domain analysis (Iteration_0.dat) are saved to a variable named DatName (line 24). The Iter counter, which has been set to zero, is updated to one in line 25. It should be noted that the updated value of the Iter counter (e.g. one) indicates the new design domain that will be generated at the end of the current loop based on previous iteration FEA results (e.g. 0). To conduct the sensitivity analysis, these results, plus initial BESO and model parameters obtained in Sects. 3.2, 3.3 and 3.4 are needed. For this purpose, a new function is defined named as ElemUpd.m (line 26).

3.5.1 Sensitivity analysis

The ElemUpd.m function (60-line) is responsible for conducting the sensitivity analysis and sorting of the elements for addition/removal purposes. Elemental strain energy values of the previous iteration (e.g. Iter 0) are needed to calculate new sensitivity numbers. The number of elements to be deleted will be determined based on the calculated target volume for the ongoing iteration (e.g. Iter 1). Input values of this function are the previous iteration’s FEA results (e.g. Iteration_0.dat), ER, NmEl, NmNd, Vol_Frc, ElSen_old, Iter, and sh_del_elm_old. The outputs of this function will be the list of live and dead/soft elements (sh_del_elm and sh_live_elm), compliance and current volume values (Compl and Cur_Vol), volume adding ratio (AR_Cur), and updated elemental sensitivity numbers (ElSen_new). In the following, this function’s sections are presented in detail.

  • Section 1: Exporting sensitivity numbers (lines 2–24)

Four zero matrices are created as follows to save elemental and nodal strain energy values (lines 2–5):

figure m

The ElStat matrix is created to save the number of elements in the first column, their state of being (0 or 1) in the second column, and their corresponding sensitivity number in the third column. The RoughElSen matrix is created to save non-smoothed elemental strain energy values. NdSen and ElSen are created to save nodal and smoothed elemental strain energy values.

In line 6, the previous iteration FEA output file (e.g. Iteration_0.dat) is opened with the fopen command, and it is read line by line with the fgetl command until it reaches the “ ” string where elemental strain energy data are written after (line 7–18). To export these values from the.dat file in a matrix format, the importdata command is used (line 19). Now, exported strain energy values are summed to calculate the compliance value of the structure (line 23), and then saved to the RoughElSen matrix (line 24).

  • Section 2: Smoothing sensitivity numbers (lines 25–37)

This section starts with calling BESO_Arrays.mat, which contains static saved data from the ObtPar.m function (line 25). These data are used in lines 26–31 to calculate smoothed sensitivity numbers (The ElSen matrix) based on the filtering scheme method (Eq. 4 and Eq. 5). For Iter number 1, while it's the first time that sensitivity analysis is conducted, there is no need to stabilization, and the ElSen matrix is directly saved to the ElStat(:,3) matrix (line 33). But for Iter numbers greater than one, the average total amount of new and old sensitivity numbers, ElSen(:,1) and ElSen_old, is calculated based on Eq. 5 and then saved to the ElStat(:,3) matrix (line 35 and 37).

  • Section 3: Determining target volume for the next iteration (lines 38–44)

Equation 6 is implemented in lines 38–44. The term Cur_Vol is defined as the current volume of the design domain based on the previous iteration.dat file data and then used to calculate the target volume (TargVol) for the next iteration.

  • Section 4: Determining the Elements for ADD/DEL Process (lines 45–60)

To begin the add/del step, the sort command is used to treat the third column of the ElStat matrix as a vector and sort elemental strain energy values in an ascending format. The index of the elements (indicating the number of the elements) is also considered when sorting them (lines 45–46). Then, counter i is defined as i = 1, and the variable sum_vol is set to 0 (lines 47–48). Using a While loop, the number of elements to be deleted from the design domain is counted using counter i until the following inequality is not satisfied (lines 49–55):

figure o

After determining the number of elements to be deleted, two matrices named sh_del_elm and sh_live_elm, are defined to save the elemental number of live and dead/soft elements (lines 56–59). Finally, these matrices, alongside with compliance value of the structure (Compl), current (Cur_Vol) and initial volume (InitialVol) values, and updated sensitivity numbers (ElSen_new) are extracted from the ElemUpd.m function to be used in the following lines of the evolutionary process (BESO.m While loop):

figure p

In lines 27–29, ElSen_new, sh_del_elm, and sh_live_elm matrices, extracted from the previous iteration FE analysis, are saved as old values to be used in the next loop:

figure q

3.5.2 Updating the design area by creating an input file for the next loop FEA (line 30)

As the list of live and dead/soft elements is extracted, the design domain can be updated and saved as a new input file (iteration_1.inp) for the next iteration. In this regard, a new function named InpUpd.m (20-line) is defined to create the new updated input file (line 30). The input data for the InpUpd.m function are the iteration number, Job-1temp file, and the list of dead/soft elements extracted from the ElemUpd.m function. This function opens the temporary job file (Job-1temp) as a reading source, and a new writable file named Iteration_1. The Job-1temp file is read line by line and written to the Iteration_1 file, including the number of elements to be deleted or softly killed.

3.5.3 New FEA on the updated design area (lines 31–32)

As the new input file is created based on the previous iteration results, a new FEA should be conducted before the initiation of the new iteration. So, again the system command (line 31) is used to summon ABAQUS and run the Iteration_1.inp file. The FEA result report file (Iteration_1.dat) will be saved in the working directory, ready to be called in the second iteration.

3.5.4 Convergence criterion check (lines 33–38)

At the end of this section, the convergence of the objective function is calculated based on Eq. 7 (lines 33–38).

3.6 Exporting plots (lines 39–50)

As the convergence criterion is satisfied, the optimization While loop ends, and the objective function and the volume constraint evolutions can be plotted. Section 6 (lines 39–50) is written for this purpose using the MATLAB plot command.

4 Results

In this section, samples for the maximum stiffness problem (minimum compliance) using the MATLAB-ABAQUS TOP software package are presented. Using this software interface, the optimum material distribution patterns for the sample problems are obtained, and results are compared to the SIMP method results. Topology evolution of the example problems along with the convergence of the objective function and the volume constraint indicate the validity and efficient performance of the developed MATLAB-ABAQUS TOP interface.

4.1 A short cantilever problem

A design domain of 80 mm in length, 55 mm in height, and 1 mm in thickness (2D planar modeling space) is defined in the ABAQUS part module, as shown in Fig. 3. A Young’s modulus of 100 GPa, and a Poisson’s ratio of 0.3 are defined in the ABAQUS material module. A concentrated downward force of 100 N is applied for a static analysis step. Then, the FE model is generated using linear quad plane-stress (CPS4R) elements (mesh grid of 100 \(\times\) 80). In the job module, a new job is defined named Job-1 and an input file is generated using the Write Input option. A copy of this file is created and renamed to Job-1temp, and changes are made to these files as explained in Sect. 3.1.

Fig. 3
figure 3

The design domain, loading, and boundary conditions of a short cantilever

The BESO parameters for the short cantilever problem are as presented in Table 2:

Table 2 The BESO parameters for the short cantilever problem

Running the interface for the above mentioned inputs, the optimization results are achieved as indicated in Fig. 4 and 5.

As can be seen in Fig. 4, while the volume fraction constraint reaches 0.5, the mean compliance value converges to 1.88 (N.mm). Topology convergence occurs after iteration 45 (Fig. 5). To verify the validity of the developed MATLAB-ABAQUS TOP computer interface, the final topology is compared to the SIMP method result, as depicted in Fig. 6.

Fig. 4
figure 4

Evolution histories of the objective function (strain energy) and the volume constraint

Fig. 5
figure 5

Evolution histories of the short cantilever topology: a iteration 15; b iteration 30; c iteration 45; d iteration 65 (final)

Fig. 6
figure 6

Comparing results of the SIMP a and the BESO b methods for the short cantilever problem

It should be noted that in the SIMP method, a continuum design domain including gray elements is achieved, resulting in a higher strain energy value. However, the BESO approach is a discrete-based (0–1) method meaning that no gray elements are allowed to remain in the design domain; so, resulting in a faster FEA process.

4.2 An MBB beam problem

In this example, An MBB (Fig. 7) beam with a design domain of 240 mm in length, 40 mm in height, and 1 mm in thickness is defined in the ABAQUS part module. A concentrated downward force of 100 N is applied for a static analysis step, and a Young’s modulus of 200 GPa and a Poisson’s ratio of 0.3 are considered as the material properties. The same FE modeling procedure is applied to discretize the design area into 240 \(\times\) 40 CPS4R elements. Job-1 and its copy, Job-1temp, are also created.

Fig. 7
figure 7

The design domain, loading, and boundary conditions of an MBB beam

Table 3 The BESO parameters for the MBB beam problem

The BESO parameters for this case study are considered as indicated in Table 3.

Figure 8 indicates that as the volume fraction constraint reaches 0.5, the mean compliance value converges to 2.55 (N.mm). The topology convergence, as shown in Fig. 9, occurs after iteration 15. To verify the validity of the result, the final topology is compared to the SIMP method result (Fig. 10).

Fig. 8
figure 8

Evolution histories of a the mean compliance and b the volume fraction for the classic MBB beam

Fig. 9
figure 9

Evolution histories of the MBB beam topology: a iteration 10, b iteration 20, c iteration 30, and d iteration 40 (final)

Fig. 10
figure 10

Comparing SIMP a and BESO b methods’ results for the MBB beam problem

4.3 A Bridge-type structure

This example, as indicated in Fig. 11, includes a rectangular design domain of 240 mm in length, 40 mm in height, and 1 mm in thickness. A uniformly-distributed load of 100/240 N/mm is applied to the bottom deck of 240 mm × 1 mm, and its two corners are constrained. The design area is discretized into 240 × 40 CPS4R elements.

Fig. 11
figure 11

The design domain, loading, and boundary conditions of a bridge-type structure

Table 4 The BESO parameters for the bridge-type structure

The BESO parameters for the bridge-type structure are considered as indicated in Table 4.

To stop the elements of the deck area from deletion, the design domain is divided into two sub-domains of design and frozen areas, as shown in Fig. 12. In this regard, elements of the frozen area are excluded from the list of sh_del_elm.

Fig. 12
figure 12

Design area and non-design area in the bridge-type structure

Running the interface for the above mentioned inputs, the optimization results are achieved as as indicated in Figs. 13 and 14.

As  can be seen in Figs. 13 and 14, convergence occurs after iteration 35 for the objective function, the volume constraint, and the structure topology.

Fig. 13
figure 13

Evolution histories of the mean compliance and the volume fraction for the bridge-type structure

Fig. 14
figure 14

Evolution histories of the bridge-type structure topology: a iteration 10, b iteration 20, c iteration 30, and d iteration 45 (final)

4.4 A Multiple-load case problem

In this example, a multiple-load case, which is one of the basic TO problems, is considered. A rectangular design domain of 240 × 40 × 1 mm3, as shown in Fig. 15, is loaded in two different points and its two corners are constrained. The design area is discretized into 240 × 40 CPS4R elements .

Fig. 15
figure 15

Design domain, loading, and boundary conditions for a multiple-load case problem

Fig. 16
figure 16

Evolution histories of the mean compliance and the volume fraction for the multiple-load case problem

Fig. 17
figure 17

Evolution histories of the multiple-load case problem's topology: a iteration 10, b iteration 20, c iteration 30, and d iteration 47 (final)

Table 5 The BESO parameters for the multiple-load case problem

The BESO parameters are considered as  indicated in Table 5.

Running the interface for the above mentioned inputs, the optimization results are achieved as illustrated in Figs. 16 and 17.

5 Conclusion

In this article, a BESO-based MATLAB-ABAQUS interface is presented for solving 2D compliance problems. In this regard, the BESO method, developed by Huang and Xie (2010b), is implemented by defining different MATLAB functions. For the FEA part, ABAQUS software is considered which is summoned by the optimization source code when required. The format of the ABAQUS input and output files suitable for the MATLAB optimization code is discussed in detail. The MATLAB functions, each one being responsible for a step of the BESO method, are explained and all codes for connecting MATLAB and ABAQUS are presented. Different examples of the compliance problem are solved and results are compared to the SIMP method outputs to validate and verify the developed interface. This code is presented for educational and engineering practice purposes, which can be considered as a computer program asset for students new to the topology optimization field. This work is aimed at developing a multipurpose efficient optimization software interface that could be easily understood, used, and developed by students and researchers all around the world. Using ABAQUS as the finite element solver, many issues arising from FEM codes are resolved. So, geometry and loading are not considered design challenges anymore. This interface has the potential to be developed for other topology optimization problems and 3D geometries. All codes are presented in the Appendix section.

6 Supplementary materials

A folder named 2DBESO-MATLABAQUS, including MATLAB m-files and ABAQUS input job files is presented for a sample problem (2D MMB Beam). Instructions for running the software package are given in a text file saved into the mentioned folder.