Mechanical stress tensor for a fluid in a magnetostatic field