Finite element implementation of virtual work principle for magnetic or electric force and torque computation | Synapse