Geometry Optimization for Miniaturized Thermoelectric Generators