Ab initio calculations of relative stabilities of different structural arrangements in dioctahedral phyllosilicates