Representing the geometry of domains by wavelets with applications to partial differential equations