The Ampere circuital theorem can be expressed as $$\oint_lB\operatorname dl=\mu_0\sum I.$$ This does not seem to say anything about the wire which carries the current. If the wire has shape, for example a prism or a cylinder with varying radius, how to use the theorem?
An example problem. The cross sectional surface of an infinitely long straight wire is in such a shape,
How to find the magnetic flux density around it?