@classmethod
def assert_zcorn(cls, nx, ny, nz, zcorn, twisted_check=True):
    """

        Raises an AssertionError if the zcorn is not as expected. In
        patricular, it is verified that:

            - zcorn has the approperiate length (8*nx*ny*nz) and
            - that no cell is twisted.

        """
    if len(zcorn) != 8 * nx * ny * nz:
        raise AssertionError('Expected len(zcorn) to be %d, was %d' % (8 *
            nx * ny * nz, len(zcorn)))
    plane_size = 4 * nx * ny
    for p in range(8 * nx * ny * nz - plane_size):
        if zcorn[p] > zcorn[p + plane_size] and twisted_check:
            raise AssertionError('Twisted cell was created. ' +
                'Decrease offset or increase dz to avoid this!')
