Modeling of three-dimensional structures of amorphous and nanocrystalline alloys