The boundary conditions are defined in an evolutionary way in our top3d program. This tutorial will show you how to change boundary conditions effortlessly and effectively.
The boundary conditions and loading conditions are defined in lines 12-18. Since the node coordinates and node numbers are automatically mapped by the program, defining different boundary conditions is very simple. To solve a 3D wheel problem as shown below, which is constrained by planar joint on the corners with a downward point load in the center of the bottom, the following changes need to be made: Initial design domain

[expand title="Step.1: Changing Loading Conditions" expanded="true" tag="h5"]

[matlab firstline="12"]
il = nelx/2; jl = 0 ; kl = nelz/2;
loadnid = kl*(nelx+1)(nely+1)+il(nely+1)+(nely+1-jl);
loaddof = 3*loadnid(:) - 1;
[/matlab]

[/expand]

[expand title="Step.2: Defining the Corresponding Boundary Conditions" expanded="true" tag="h5"]

[matlab firstline="16"]
iif = [0 0 nelx nelx]; jf = [0 0 0 0]; kf = [0 nelz 0 nelz];
fixednid = kf*(nelx+1)(nely+1)+iif(nely+1)+(nely+1-jf);
fixeddof = [3fixednid(:); 3fixednid(:)-1; 3*fixednid(:)-2];
[/matlab]

[/expand]

[expand title="Step.3: Run the program" expanded="true" tag="h5"]
The problem can be promoted by line:

[matlab light="true"]
top3d(40,20,40,0.2,3.0,1.5)
[/matlab]

Then, you should have result like this:
Change boundary conditions: Wheel
[/expand]