Code to smoothly patch together local functions (linear/ polynomial) defined on charts of a manifold to give a global approximation using Partitions of Unity (PoU)