Stabilizing nanostructures in metals using grain and twin boundary architectures