An energy-based model of areas tiling the cortex and its fast computation