This code solves the compliance minimization problem subject to volume and maximum size restrictions, as shown in (II). The problem is formulated using the robust design approach based on eroded, intermediate and dilated designs. A quarter of the 3D MBB beam is modeled and the density filter weights are adjusted to simulate an extension of the design domain.
The theoretical details are presented in the manuscript:
E. Fernandez, K. Yang, S. Koppen, P. Alarcon, S. Bauduin, P. Duysinx (2020). Imposing minimum and maximum member size, minimum cavity size, and minimum separation distance between solid members in topology optimization. Computer Methods in Applied Mechanics and Engineering, https://doi.org/10.1016/j.cma.2020.113157.
This code is based on the version 2017 of the TopOpt_in_PETSc code. The original code can be found here: https://github.com/topopt/TopOpt_in_PETSc (N. Aage, E. Andreassen, B. S. Lazarov (2014), Topology optimization using PETSc: An easy-to-use, fully parallel, open source topology optimization framework, Structural and Multidisciplinary Optimization, DOI 10.1007/s00158-014-1157-0)
Implementations made by Eduardo Fernandez & Kaike Yang, University of Liege, Belgium.
The following files were modified from the original code:
-
main(cc): Continuation over the beta and penal parameters / Scaling the upper bound of the volume constraint / Export additional data (MPIIO output).
-
TopOpt(cc/h): Projection parameters (beta, thresholds, minimum size) / Maximum size dimensions and parameters / Declaration and Initialization of arrays.
-
Filter(cc/h): Solid Passive elements / Change of the filter Matrix H / Numerical treatment on H wrt the boundaries / eroded, intermediate and dilated projections / Maximum size Constraint.
-
LinearElasticity(cc/h): Robust formulation (on eroded) / 3D-MBB boundary conditions;
-
MPIIO(cc): Export additional data.
NOTE: By default, the code solves the problem (II). To solve the problem (I), define m=1 in TopOpt.cc and comment out the maximum size restriction as indicated in Filter.cc (line 322).
Python 2.7 needed for configuring PETSc makefile
- 'apt get install python2'
Compile PETSc 3.7.4 in a path XXXXXXX/petsc-3.7.4
cd XXXXXXX
wget https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.7.4.tar.gz
tar -xf petsc-3.7.4.tar.gz
cd petsc-3.7.4
wget https://www.mcs.anl.gov/petsc/mirror/externalpackages/fblaslapack-3.4.2.tar.gz
python2.7 ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-mpich --download-fblaslapack=fblaslapack-3.4.2.tar.gz
- This will configure the make file, an folder in the path
XXXXXXX/petsc-3.7.4
will appear with which is calledarch-YYYYYYY
. Fill this architecture in the next command. make PETSC_DIR=XXXXXXX/petsc-3.7.4 PETSC_ARCH=arch-YYYYYYY all
make PETSC_DIR=XXXXXXX/petsc-3.7.4 PETSC_ARCH=arch-YYYYYYY test
See requirements and instructions at https://github.com/topopt/TopOpt_in_PETSc
- To compile, edit the first two lines in the makefile
-
PETSC_DIR=XXXXXXX/petsc-3.7.4
-
PETSC_ARCH=arch-YYYYYYY
- To compile, e.g:
make topopt
- To execute, e.g:
XXXXXXX/arch-YYYYYYY/bin/mpiexec -np 4 ./topopt
- To execute in the background and being able to close your terminal, e.g.:
nohup XXXXXXX/arch-YYYYYYY/bin/mpiexec -np 4 ./topopt > terminal.output &
- Visualize using ParaView.
NOTE: The code works with PETSc version 3.7.4
The default problem takes about 1 hour to be solved on a laptop. The default solution looks like this:
To recover the full MBB beam, the solution must be reflected with respect to the two planes of symmetry. The full optimized solution looks as follows: