Build arbitrary magnetostatic field with dipoles?

By "static" in this thread, I mean the charge and current density is constant in time (so things can be moving, but the distribution cannot).

We can build an arbitrary eletrostatic field with a "eletric monopole" density.
Since Del.B=0, can we build an arbitrary magnetostatic field with just a "magnetic dipole" density?

--

Since we also need the direction of the dipoles, I guess this density it would be a vector field.

Based on analogy with magnetostatics in materials where [tex]B = \mu_0(H + M)[/tex] and M can be considered the "dipole density", it seems like this is possible because I could just consider _every_ current a "bound current" instead of a "free current" and push everything onto M.

Correct?
Or is there something that prevents considering all "free currents" as "bound currents"?

So while I can find the curl in terms of B
[tex] \nabla \times \mathbf{M} = \frac{1}{\mu_0}\nabla \times \mathbf{B}[/tex]
I can't figure out how to get the divergence in terms of B
[tex] \nabla \cdot \mathbf{M} = - \nabla \cdot \mathbf{H}[/tex]
because H and M depend on each other. It looks like there is no unique solution.

As a comment I'd like to add, that maybe it's less confusing to consider this problem with the B field alone. All the physics can be explained with Biot-Savart. The H field is only an auxiliary field to absorb complicating terms if magnetizable materials are present. However at least fundamentally these materials can also be explained with a lot of tiny charge currents and the resulting B fields. In that case you don't have to worry about free currents or bound currents

Do you mean: how can I create the magnetostatic field of a current loop with just magnetic dipoles?

Using the analogy with magnetic fields in matter, instead of a free current loop, this can be replaced by a set of dipoles which has a "bound current"
[tex] \nabla \times \mathbf{M} = \mathbf{j}_{bound}[/tex]

I believe I already showed that I can solve for a dipole density that would create such a field. The problem is that it doesn't appear to be unique. I'm not sure what exactly that means here.

Basically, since:
[tex] \nabla \times \mathbf{M} = \frac{1}{\mu_0}\nabla \times \mathbf{B}[/tex]
Then, given B, a solution for a "dipole density" that would produce that field:
[tex] \mathbf{M} = \frac{1}{\mu_0} \mathbf{B} + \nabla f[/tex]
where f is some function of position. Currently I can't seem to come up with much of a constraint on f.

The key seems to be getting a constraint on Del.M, but I can't figure out how to do this.
Any ideas?

As a comment I'd like to add, that maybe it's less confusing to consider this problem with the B field alone. All the physics can be explained with Biot-Savart. The H field is only an auxiliary field to absorb complicating terms if magnetizable materials are present. However at least fundamentally these materials can also be explained with a lot of tiny charge currents and the resulting B fields. In that case you don't have to worry about free currents or bound currents

Yes, since I what to absorb ALL currents into the "dipole field", that is why I tried to use that analogy to solve the problem. So 'bound' currents seem to be my friend here in solving this problem.

If you have a different way to approach this, please let me know.
Are you suggesting we start with the field of an individual magnetic dipole and then explicitly calculate the magnetic field from an arbitrary dipole density M?

Since I want to prove that any magnetostatic field can be generated with just a field of dipoles, I would have to invert that equation to solve for M given B. I don't know how to do that. This path looks much more complicated. Or did I misunderstand your suggestion?