An accurate and efficient algorithm is presented, which allows deriving the structure function of a discretized 3-D heat conduction problem. In this approach, the partial thermal conductances and capacitances in the structure function are computed in terms of weighted spatial averages of thermal resistivity and volumetric heat capacity. As a result, the exact influence of all materials and geometric details on each part of the structure function is determined. The approach is validated on a state-of-the-art SiGe heterojunction bipolar transistor (HBT) for high-frequency applications.