Hello,
I don't think this is the easiest way. One can use the command layers.I don't think you need to include or define the spacer, so one can remove it from the geometry. Moreover, you have lateral space, not used by the layers, which is not necessary. Then one can reduce the grid size to 10 in y.
SetGridSize(400, 10, 29)
SetCellSize(10e-9, 10e-9, 5e-9)
a := Layers(0,20) // 20 layers for the first material
b := Layers(21,29) //Skip one for the spacer, then 8 layers for the next material
setgeom(a.add(b))
DefRegion(1, a)
DefRegion(2, b) // Now region two is the second material, not the spacer. You can define directly DefRegion(3, b) if you prefer to avoid redefining region 3 properties from your script.
Please check that this is what you want.
To check it one can use mumax3-convert and gplot format. For this save one of the variables that are different. For example, add save(regions) to a script to use that.
That will save an ovf file which is difficult to work with
To inspect it one can convert it to the gplot format with
mumax3-convert -gplot.
This creates a file with the position x,y,z and the magnitude. x, y, z are in meters and starting from 0,0,0 in one of the corners. This is not very useful but one can probe an exact position using the options of mumax3-convert. xrange filters a number of cells. It is integers like the index in mumax and the second argument is exclusive. Then to select only one point in your geometry one can combine xrange and yrange.
mumax3-convert -gplot -xrange 199:200 -yrange 5:6 regions000000.ovf
This yields only a line along z, because only z is allowed varying, because all the points in the plane xy are exactly the same. With that you will be able to check if everything is ok by simple inspection or using some representation software.
Best regards,
Felipe