Engineering the strain field for the control of quantum confinement: An analytical model for arbitrary shape nanostructures