Calculating Magnetic Flux