Periodic homogenization of linear elastic materials

Hi, everyone, I want to obtain macroscopic stiffness of a periodic RVE (Periodic homogenization of linear elastic materials — Numerical tours of continuum mechanics using FEniCS master documentation). But I do not know how to apply the macroscopic strain load or displacement one. Can you provide some guidance or examples. Thanks very much.

Best wishes.
Ceb