I do not think the topic title is matching your question.
You are asking how you can vary the computational domain of your problem, morphing
\Omega=[0,1] to \hat\Omega=T(\Omega)=[0,5].
In legacy DOLFIN, this can be done by using the ALE.move
command, see for instance: How to use ALE for moving boundary problems? - #2 by dokken