Simulation of periodic patterns often suffer from artifacts due to incommensurability of the intrinsic length scale and the system size. We introduce a simple numerical scheme to avoid this problem in finding equilibrium domain morphologies from a Ginzburg-Landau-type free energy. In this scheme, the boundary values are determined only by the local equilibrium condition at the adjacent bulk sites. The scheme is especially advantageous in equilibrating patterns that have two or more characteristic lengths. We demonstrate it using a model of lamellar-lamellar coexistence in block copolymer blends.