@classmethod
def assert_actnum(cls, nx, ny, nz, actnum):
    """

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

            - actnum has the approperiate length nx*ny*nz and
            - that all values are either 0 or 1.

        """
    if actnum is None:
        return
    if len(actnum) != nx * ny * nz:
        raise AssertionError(
            'Expected the length of ACTNUM to be %d, was %s.' % (nx * ny *
            nz, len(actnum)))
    if set(actnum) - set([0, 1]):
        raise AssertionError(
            "Expected ACTNUM to consist of 0's and 1's, was %s." % ', '.
            join(map(str, set(actnum))))
