Efficient calculation of force in electromagnetic devices | Synapse