Problem with boundary condition. Error: "Unable to compile C++ code with dijitso"

I want to solve the Poisson for a new function defined as newDivision, but fenics cannot integrate this solution. How could I reformulate my problem?

from fenics import *
import numpy as np
from mshr import *

def newDivision(y,x):
if abs(x)<10**(-8):
z = 40000
return z

else:
    z= y/x
    return z

mesh = UnitSquareMesh(8, 8)

#mesh = UnitSquareMesh(i, i)
V = FunctionSpace(mesh, ‘Lagrange’, 1)

u_D = Expression(‘newDivision(x[1]/x[0])’, degree=4)

def boundary(x, on_boundary):
return on_boundary

bc = DirichletBC(V, u_D, boundary)

Define variational problem

u = TrialFunction(V)
v = TestFunction(V)
f = Expression(‘0’, degree=0)
a = dot(grad(u), grad(v))dx
L = f
v*dx

Compute solution

u = Function(V)
solve(a == L, u, bc)

Plot solution and mesh

plot(u)
plot(mesh)

Compute error in L2 norm

error= errornorm(u_D, u, ‘L2’)

Please properly format your code using 3x ` encapsulation, as explained in: Extended Syntax | Markdown Guide
to ensure proper formatting

I did some modifications in your code. The below works on my side:

from fenics import *

class newDivision(UserExpression):

    def eval(self, value, x):

        if  x[0] <= 10 ** (-8):
            value[0] = 40000
        else:
            value[0] = x[1] / x[0]
    def value_shape(self):
        return ()

bcs = newDivision()

mesh = UnitSquareMesh(8, 8)

V = FunctionSpace(mesh, "CG", 1)

def boundary(x, on_boundary):
    return on_boundary

bc = DirichletBC(V, bcs, boundary)

u = TrialFunction(V)
v = TestFunction(V)

f = Constant (0)
a = dot(grad(u), grad(v))*dx
L = f*v * dx
u = Function(V)
solve(a == L, u, bc)

File( "Results.pvd") << u