Topology optimization of energy absorbing frames