def test(osi, tolv, tolp, tolrv, tolrp, tolrelv, tolrelp, max_iter, maxincr, p_flag=0, n_type=2):
    """
    Create a PFEM test, which check both increments and residual forvelocities and pressures.

    Parameters
    ----------
    osi: o3seespy.OpenSeesInstance
    tolv: float
            Tolerance for velocity increments
    tolp: float
            Tolerance for pressure increments
    tolrv: float
            Tolerance for relative velocity increments
    tolrp: float
            Tolerance for relative pressure increments
    tolrelv: None
            
    tolrelp: None
            
    max_iter: int
            Max number of iterations to check
    maxincr: int
            Max times for error increasing
    p_flag: int, optional
            Print flag : * 0 print nothing. * 1 print information on norms each time ``test()`` is invoked. * 2 print
            information on norms and number of iterations at end of successful test. * 4 at each step it will print the norms
            and also the :math:`\delta u` and :math:`r(u)` vectors. * 5 if it fails to converge at end of ``numiter`` it
            will print an error message **but return a successfull test**.
    n_type: int, optional
            Type of norm, (0 = max-norm, 1 = 1-norm, 2 = 2-norm). 
    """
    tolv = float(tolv)
    tolp = float(tolp)
    tolrv = float(tolrv)
    tolrp = float(tolrp)
    max_iter = int(max_iter)
    maxincr = int(maxincr)
    p_flag = int(p_flag)
    n_type = int(n_type)
    _parameters = [tolv, tolp, tolrv, tolrp, tolrelv, tolrelp, max_iter, maxincr, p_flag, n_type]
    return osi.to_process("test", _parameters)