-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmainMulti.m
29 lines (20 loc) · 1008 Bytes
/
mainMulti.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function mainMulti(nelx,nely,volfrac,initialDesign,posttreat,problem)
%used to obtain compliance and time of our method
%volfrac: global volume fraction
%nelx: number of cells in horizontal direction
%nely: number of cells in vertical direction
%initialDesign: initial guess : "volfrac" for uniform density, "top88" for mono-scale optimization
%posttreat: 0: no post-treatment (faster); 1: posttreatment(better design)
%problem: 'MBB', 'Lshape' or 'Canti'
macroTic=tic;
[cTheor,xdens,xcos,xsin,xcub]=topMulti(nelx,nely,volfrac,initialDesign,problem); %macro-optimization
macroTime=toc(macroTic);
totdesignTic=tic;
[xPhys]=totalDesign(xdens,xcos,xsin,xcub,nelx,nely,volfrac,posttreat,problem); %get total design
totdesignTime=toc(totdesignTic);
%print final design
figure(5)
colormap(gray); imagesc(1-xPhys); caxis([0 1]); axis equal; axis off; drawnow;
%evaluate final design
compliance=evaluateTotalDesign(xPhys,3,problem)
totalTime=macroTime+totdesignTime