My approach, I did it and I know it works, is certainly not as clean as the one proposed by UmeshMatur.
What I propose is to select in each domain, and not at the boundaries, several points inside the domain and define the x,y and code. It is necessary to have several point near the boundary. YOu should not locate points on the boundary.
then when the algorithm runs, for az given point, it will look for the closest referenced point and assign the corresponding domain. Again, all points are inside the domains, most of them close to a boundary
As an example (only), for the "Wave" domain, I would select
2 points on the left x=0.1 y=2 and 20
3 points near the bottom boundary x=0.5 y=2, x=2 y=1.9, x=9 y=1.
3 points near the upper boundary
1 point in the center.
I think you get the idea. Since the "tip" of the Wave domain is bent, you may need more points inside the tip.
I can e-mail a sample Excel spreadsheet.
Again, to program the splines is better, and not that difficult. Hope this helps.