Topology Optimization - How to apply load at different nodes

I am working on a standard code for the topology optimization of a MBB beam as in the figure.The force has to be defined at the upper left corner. The design domain is descretized into finite elements, say 100 elements in the x-direction and 10 elements in the y-direction. Both node numbers and element numbers are numbered column wise from left to right.Now, I want to change the position of code the midpoint of right side end of the beam. How do I do that?

 Accepted Answer

Hi Sagar,
If you are refering to the 99-line code, available at https://www.topopt.mek.dtu.dk/Apps-and-software/A-99-line-topology-optimization-code-written-in-MATLAB, the corner nodes are labeled as
upper left corner = 1
bottom left corner = nely+1
upper right corner = (nelx)*(nely+1)+1
bottom left corner = (nelx+1)*(nely+1)
Finally, considering that nely is even, the middle node of the right edge is
midpoint = (nelx)*(nely+1)+1+nely/2
Best,
Anderson

4 Comments

Thank you for your answer and I am working with the top99 code.I am actually having trouble understanding how the nelx and nely work i.e; upper right corner = (nelx)*(nely+1)+1 in this way. Could you please elaborate and explain me how it works. I am new to matlab and I have difficulties in understanding the code.Also, could you explain me the lines (37-48) and (68 - 69) in the code,
38 function [xnew]=OC(nelx,nely,x,volfrac,dc)
39 l1 = 0; l2 = 100000; move = 0.2;
40 while (l2-l1 > 1e-4)
41 lmid = 0.5*(l2+l1);
42 xnew = max(0.001,max(x-move,min(1.,min(x+move,x.
*sqrt(-dc./lmid)))));
43 if sum(sum(xnew)) - volfrac*nelx*nely > 0;
44 l1 = lmid;
45 else
46 l2 = lmid;
47 end
48 end
68 K = sparse(2*(nelx+1)*(nely+1), 2*(nelx+1)*(nely+1));
69 F = sparse(2*(nely+1)*(nelx+1),1); U = sparse(2*(nely+1)*(nelx+1),1);
Hi Anderson,
I tried giving this (midpoint = (nelx)*(nely+1)+1+nely/2) for the load but my iterations are not stopping and the optimized beam is not correct. Can you please tell me where I went wrong.
Thank you
Hi Sagar,
Lines 37–48 are related to the Optimality criteria based optimizer. Please take a look at the code article:
Sigmund, O. A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21, 120–127 (2001). https://doi.org/10.1007/s001580050176
Best,
Anderson
Hi,
I am trying to calculate stress at each element of the beam in the same code and included the code to calculate that inside the while loop(lines 46-48). But I am getting very high stress values. Can anyone please help me to find the reason for that,

Sign in to comment.

More Answers (0)

Categories

Find more on Develop Apps Using App Designer in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!