When two obects $A$ and $B$ exchange heat irreversibly ($T\_A\neq T\_B$), the entropy of $A+B$ increases. My question is where: in $A$, in $B$, on the boundary? Is there some entropy exchange between $A$ and $B$? For the moment, my question is not really clear. I'm going to try to give a better example.

Consider a one-dimensional metal rod with temperature $T(x)$ along the rod. The total entropy is:

$$S = \int s(x)dx$$

with $s(x) = \rho C\log(T(x))$ and $\rho$ (mass per unit of length) and $C$ (specifc heat capacity) are constants.

The heat diffuses according to the heat equation. The entropy $s(x)$ will change at each point. Is it possible to separate, at each point $x$, the entropy being created there from the entropy being "exchanged" with the neighborhood? Can you write something like:

$$ds(x)=\delta s\_e(x) + \delta s\_c(x)$$

where $\delta s\_e(x)$ would be the entropy being "exchanged with the neighbourhood" and $\delta s\_c(x)$ would be the entropy being "created" at $x$? If so, what would they be?