1. A method of calculating electromagnetic scattering properties of a structure, the structure being periodic in at least one direction and including materials of differing properties such as to cause a discontinuity in an electromagnetic field at a material boundary, the method comprising: numerically solving, using a processing device, a volume integral equation for a vector field that is related to the electromagnetic field by a change of basis, the vector field being continuous at the material boundary, so as to determine an approximate solution of the vector field.