Modeling of the in situ state of stress in elastic layered rock subject to stress and strain-driven tectonic forces