'<' not supported between instances of 'Mesh' and 'Mesh' Error

# Create mesh and define function space
nx = ny = 256
mesh = RectangleMesh( Point(0, 0), Point(5120, 6400), nx, ny)

# Define function space for velocity
W = VectorFunctionSpace(mesh, 'P', 2)

#Define function space for system of equations

P1 = FiniteElement('P', triangle, 1)
element = MixedElement( [P1, P1] )
V = FunctionSpace ( mesh, element)

# Define test functions
v_1, v_2= TestFunctions(V)

# Define functions for velocity and PDE
w = Function(W)
u = Function(V)
u_n = Function(V)

# Split system functions to access components
u_1, u_2 = split(u)
u_n1, u_n2 = split(u_n)

#Define source terms
f_1 = Constant (0.14)
f_2 = Constant (0.0)

# Define expressions used in variational forms
k = Constant(dt)
M1 = Constant(M1)
D = Constant(D)
alpha_c = Constant(alpha_c)
q_s = Constant(q_s)
q_c = Constant(q_c)
M_s0 = Constant(M_s0)
Gamma = Constant(Gamma)
M2 = Constant(M2)

# Define re-evaporation function
from ufl.operators import min_value
def Re(u_1, u_2):
    return ((alpha_c/2)*u_2* (1-(min_value(u_1, q_s)/q_s)))

#Define Latent heat source
from ufl.algebra import Sum
def P(a):
    return ( alpha*(a-q_c) * H(a - q_c) )

#Define vapor to condensate conversion function
def Q(u_1):
    return(2*alpha* (u_1-q_s) * H(u_1 -q_s))

#Define function
def K(u_1, u_2):
    return( (L*(P(u_1)-P_c)+L*(Q(u_1)-Q_c)+(F_s-F_c))/M_s(u_2))

def M_s(u_2):
    return( M_s0 + Gamma * u_2)

#Define function of large scale precipitation
from ufl.operators import min_value
def P_(u_1, u_2):
    return ( (alpha_c/2) * u_2 * (min_value(u_1 , q_s) / q_s))
    



# Define Heaviside function H
#from ufl.conditional import conditional
def H(x):
    c = conditional(gt(x, 0), 1, 0)
    return(c)

# Define variational problem
F =  - M1 * dot(grad( vel(u_1, u_2)), grad( u_1))*v_1* dx \
    - M2 * dot(grad( vel(u_1, u_2)), grad( u_2))*v_2* dx

This is the actual code, and I defined a function vel(u_1, u_2) as follows:

# Finding the wind variable v1
def vel( w1, w2):
    class PeriodicBoundary(SubDomain):
        def inside(self, x, on_boundary):
            return bool( x[0] <DOLFIN_EPS or x[0] > -DOLFIN_EPS and on_boundary)

        def map(self, x, y):
            y[0] = x[0] - 5120.0
            y[1] = x[1]

       # pbc =  PeriodicBoundary()
        
    # Create mesh and define the function space
    mesh1 = RectangleMesh(Point(0, 0),Point(5120, 6400), nx, ny)
    V1 = FunctionSpace(mesh1, "CG", 1, constrained_domain=PeriodicBoundary()  )
    dof_coordinates = V.tabulate_dof_coordinates()

    # Define Boundary Condition
    pbc =  PeriodicBoundary()

    # Define variational problem
    u1 = TrialFunction(V1)
    v1 = TestFunction(V1)
    f  = - div ( K(w1, w2))
    a = dot(grad(u1), grad(v1))*dx
    L = f*v1*dx

    # Compute solution
    u1 = Function(V)
    solve(a == L, u1 , pbc)

    return(u1) 

Here I solved How to define the periodic and Neumann boundary condition?

The following error occurred here:

 File "AN.py", line 128, in vel
    L = f*v1*dx
  File "/Users/kapilchawla/opt/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/ufl/measure.py", line 437, in __rmul__
    domains = extract_domains(integrand)
  File "/Users/kapilchawla/opt/anaconda3/envs/fenicsproject/lib/python3.8/site-packages/ufl/domain.py", line 355, in extract_domains
    return sorted(join_domains(domainlist))
TypeError: '<' not supported between instances of 'Mesh' and 'Mesh'

Could you please let me know my mistake here?