Imagine a closed loop in the shape of a trefoil knot (https://en.wikipedia.org/wiki/Trefoil_knot). How should one calculate the flux through this loop? Normally we define an arbitrary smooth surface, say, $\mathcal{S}$ whose boundary $\partial{\mathcal{S}}$ is the given loop and calculate the flux using its integral definition as $$\Phi_B = \int_{{\mathcal{S}}} \mathbf{B}\cdot d\mathbf{S}\tag{1}\label{1}$$ It is clear how to use $\eqref{1}$ when the loop is a simple loop and the surface is also a simple one, but how can one spread a surface on a trefoil and it be still true that for such surfaces the flux is always the same because $\nabla \cdot \mathbf{B}=0$, in other words how does Gauss' theorem hold for surfaces whose boundary is a trefoil?
Alternatively, one could introduce the vector potential $\mathbf{B}=\nabla \times \mathbf{A}$ and using Stokes' theorem derive from the definition of flux $\eqref{1}$ that $$\Phi_A = \int_{{\mathcal{S}}} \nabla \times \mathbf{A}\cdot d\mathbf{S}\\ =\oint_{\partial\mathbf{S}} \mathbf{A}\cdot d \ell \tag{2}\label{2}$$ So, whenever we can use Stokes' theorem we also have $\Phi_A=\Phi_B$. How does Stokes' theorem hold if the loop is a trefoil?
If in fact the application of either Gauss' or Stokes' theorem has a problem then does the fact that the line integral via $\eqref{2}$ can always be used to define the flux $\Phi_A$ mean that at least in this sense $\mathbf{A}$ is more fundamental than $\mathbf{B}$?
