Computational study of structural phase transformations in ultrathin materials