In the textbook definition of the stress tensor it is defined at each point in space and therefore position dependant.
When three dimensional periodic boundary conditions are used, I have seen it often, that a stress tensor is given for the entire material which is of course not position dependent anymore. (Electronic structure codes and force fields always return a single 3 $\times$ 3 matrix for the stress tensor)
How are these two quantities related?
Here is an example:
Suppose the electric field $ \vec E(x, y, z) $ is known inside the periodic cell with cell vectors $\vec a$, $\vec b$ and $\vec c$. Calculating the Maxwell stress tensor is easy: $$ \sigma_{ij}(x, y, z) = \epsilon_0 E_i E_j - 0.5 \epsilon_0 E^2 .$$
Is the Maxwell stress tensor $ \sigma_{ij}(x, y, z)$ related to the total stress that can be written as a single 3 $\times$ 3 matrix? If so, how are the two quantities connected.