Releasing chemical energy in spatially programmed ferroelectrics