@classmethod
def assert_coord(cls, nx, ny, nz, coord, negative_values=False):
    """

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

            - coord has the approperiate length (6*(nx+1)*(ny+1)) and
            - that all values are positive unless negative_values are
              explicitly allowed.

        """
    if len(coord) != 6 * (nx + 1) * (ny + 1):
        raise AssertionError('Expected len(coord) to be %d, was %d' % (6 *
            (nx + 1) * (ny + 1), len(coord)))
    if not negative_values and min(coord) < 0:
        raise AssertionError('Negative COORD values was generated. ' +
            'This is likely due to a tranformation. ' +
            'Increasing the escape_origio_shift will most likely ' +
            'fix the problem')
