(V=None, E2V=None, AggOp=None, A=None, splitting=None, mesh_type=None)
Check input for local functions.
Check input for local functions.
Check input for local functions .
def check_input(V=None, E2V=None, AggOp=None, A=None, splitting=None, mesh_type=None):
    """Check input for local functions."""
    if V is not None and not np.issubdtype(V.dtype, np.floating):
        raise ValueError('V should be of type float')

    if E2V is not None:
        if not np.issubdtype(E2V.dtype, np.integer):
            raise ValueError('E2V should be of type integer')
        if E2V.min() != 0:
            warnings.warn(f'Element indices begin at {E2V.min()}')

    if AggOp is not None and AggOp.shape[1] > AggOp.shape[0]:
        raise ValueError('AggOp should be of size N x Nagg')

    if A is not None and AggOp is None:
        raise ValueError('problem with check_input')

    if (A is not None and AggOp is not None
       and ((A.shape[0] != A.shape[1]) or (A.shape[0] != AggOp.shape[0]))):
        raise ValueError('expected square matrix A and compatible with AggOp')

    if splitting is not None and V is None:
        raise ValueError('problem with check_input')

    if splitting is not None:
        splitting = splitting.ravel()
        if V is not None and (len(splitting) % V.shape[0]) != 0:
            raise ValueError('splitting must be a multiple of N')

    if mesh_type is not None:
        valid_mesh_types = ('vertex', 'tri', 'quad', 'tet', 'hex')
        if mesh_type not in valid_mesh_types:
            raise ValueError(f'mesh_type should be {" or ".join(valid_mesh_types)}')
def check_input ( V = None , E2V = None , AggOp = None , A = None , splitting = None , mesh_type = None ) : if V is not None and not np . issubdtype ( V . dtype , np . floating ) : raise ValueError ( 'V should be of type float' ) if E2V is not None : if not np . issubdtype ( E2V . dtype , np . integer ) : raise ValueError ( 'E2V should be of type integer' ) if E2V . min ( ) != 0 : warnings . warn ( f'Element indices begin at {E2V.min()}' ) if AggOp is not None and AggOp . shape [ 1 ] > AggOp . shape [ 0 ] : raise ValueError ( 'AggOp should be of size N x Nagg' ) if A is not None and AggOp is None : raise ValueError ( 'problem with check_input' ) if ( A is not None and AggOp is not None and ( ( A . shape [ 0 ] != A . shape [ 1 ] ) or ( A . shape [ 0 ] != AggOp . shape [ 0 ] ) ) ) : raise ValueError ( 'expected square matrix A and compatible with AggOp' ) if splitting is not None and V is None : raise ValueError ( 'problem with check_input' ) if splitting is not None : splitting = splitting . ravel ( ) if V is not None and ( len ( splitting ) % V . shape [ 0 ] ) != 0 : raise ValueError ( 'splitting must be a multiple of N' ) if mesh_type is not None : valid_mesh_types = ( 'vertex' , 'tri' , 'quad' , 'tet' , 'hex' ) if mesh_type not in valid_mesh_types : raise ValueError ( f'mesh_type should be {" or ".join(valid_mesh_types)}' )