We present methods for calculating the strayeld in nite element and nite difference micromagnetic simulations using true periodic boundary conditions. In contrast to pseudo periodic boundary conditions, which are widely used in micromagnetic codes, the presented methods eliminate the shape anisotropy originating from the outer boundary. This is a crucial feature when studying the influence of the microstructure on the performance of composite materials, which is demonstrated by hysteresis calculations of soft magnetic structures that are operated in a closed magnetic loop configuration. The applied differential formulation is perfectly suited for the application of true periodic boundary conditions. The nite difference equations can be solved by a highly efficient Fast Fourier Transform method.