How can I output the coordinates of a specific boundary and its corresponding computation results as two lists in dolfinx?

Sure, I’ve done the test and everything should be fine. Similarly, I would like to implement this section of dolfin code in dolfinx (defining non-uniform boundary conditions):https://fenicsproject.discourse.group/t/how-to-represent-non-uniform-first-and-second-type-boundary-conditions/13654/6?u=french_fries
Below is the modified code I’m using:

import dolfinx
import numpy as np
from mpi4py import MPI
from dolfinx import io, default_scalar_type
from dolfinx.io import gmshio
from dolfinx.fem.petsc import LinearProblem
from ufl import (TestFunction, TrialFunction, dot, dx, grad)
from dolfinx.fem import (Constant, dirichletbc, functionspace, Function, locate_dofs_topological)
from pathlib import Path

mesh, cell_markers, facet_markers = gmshio.read_from_msh("test.msh", MPI.COMM_WORLD, gdim=2)
VT = functionspace(mesh, ("CG", 1))
T_data = np.array([0, 100, 50, 80, 60])
T_coordinates = np.array([[0, 0, 0], [0, 0.25, 0], [0, 0.5, 0], [0, 0.75, 0], [0, 1, 0]])
Tf = Function(VT)

facets = facet_markers.find(6)
vertices = dolfinx.mesh.compute_incident_entities(mesh.topology, facets, mesh.topology.dim-1, 0)
fdim = mesh.topology.dim - 1
boundary_dofs = locate_dofs_topological(VT, fdim, facets)

# Get all boundary 6 coordinates
send_coordinates = []
coordinates = mesh.geometry.x
for vertex in vertices:
    send_coordinates.append(coordinates[vertex])
boundary_coords = np.asarray(send_coordinates).reshape(-1, coordinates.shape[1])

# Compute distances between boundary coordinates and q_coordinates
points_A = np.expand_dims(boundary_coords, 1)
points_B = np.expand_dims(T_coordinates, 0)
distances = np.sum(np.square(points_A - points_B), axis=2)
is_close = distances < 1e2 * 1e-14
positions = np.nonzero(is_close)
for row, col in zip(*positions):
    Tf.vector[boundary_dofs[row]] = T_data[col]
    print(boundary_coords[row][1], T_data[col])

bcT = dirichletbc(Tf, boundary_dofs, VT)

# Define variational problem
f = Constant(mesh, default_scalar_type(100))
T_ = TestFunction(VT)
dT = TrialFunction(VT)
aT = dot(grad(dT), grad(T_)) * dx
LT = f * T_ * dx

# Compute solution
Delta_T = Function(VT)
problem = LinearProblem(aT, LT, bcs=[bcT], petsc_options={"ksp_type": "preonly", "pc_type": "lu"})
Delta_T = problem.solve()

The results show that the assignment is correct, but there appears to be a type error for Tf in the dirichletbc function:

1.0 60
0.75 80
0.5 50
0.25 100
0.0 0
Traceback (most recent call last):
  File "/home/dyfluid/Desktop/dolfinx/test.py", line 41, in <module>
    bcT = dirichletbc(Tf, boundary_dofs, VT)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dyfluid/anaconda3/envs/fenicsx-env/lib/python3.11/site-packages/dolfinx/fem/bcs.py", line 189, in dirichletbc
    bc = bctype(_value, dofs, V._cpp_object)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: __init__(): incompatible function arguments. The following argument types are supported:

Could you help me fix it?If necessary, I can provide the mesh file (2D unit rectangle, 5 nodes on each edge). Thank you.