% compute the center coordinate of every subdomain/ellipse function coor = centerCoordinate(lx, ly, ly_full, nelx, nely) cx = lx/2; cy = ly_full - ly/2; coor = zeros(nely, nelx, 2); coor(1,1,:) = [cx, cy]; % NOTE is [cx, cy] for i = 1:nelx cy = ly_full - ly/2; for j = 1:nely coor(j,i,:) = [cx, cy]; cy = cy - ly; end cx = cx + lx; end end