Stress-Based Topology Optimization for Steady-State and Transient Thermoelastic Design