Traction Boundary Conditions in 2D Mechanics Problems

Hello everyone,I learned the usage of traction boundary conditions in the tutorial(This is a thermoelastic problem, where Delta_T represents the known temperature distribution. I am concerned about the traction term in the variational formula):

Vu = VectorFunctionSpace(mesh, 'CG', 2)
du = TrialFunction(Vu)
u_ = TestFunction(Vu)
u = Function(Vu, name="Displacement")
T = Constant((1.0, 0.0))    # Uniform traction force in the x-direction
Wint = inner(sigma(du, Delta_T), eps(u_))*dx
aM = lhs(Wint)
LM = rhs(Wint) + dot(T, u_)*ds(4)

Boundary 4 is an arc, and I want T to be a force directed towards the center of the circle, as shown in the diagram:
1713960170309
I have two questions. Firstly, if T is uniform, I have two options:

n = FacetNormal(mesh)
dot(Constant(T) * n, u_)*ds(4)

or:

T_x = Expression('T * cos(x[0])', degree=1)
T_y = Expression('T * abs(sin(x[1]))', degree=1)
T_expr = as_vector((P_x, P_y))
T = project(P_expr, Vu)

dot(T, u_)*ds(4)

But the results of these two methods are completely different. I don’t know which one to use, or are both incorrect?
Secondly, building upon the first question, I want to know how to handle it if T is a discrete vector (with a length equal to the number of nodes on boundary 4, and with different magnitudes at each node).

Hi. First of all: Copy a numpy matrix into a fencis function - #2 by edgar
Then, I really hope that I’m not doing a disservice here, but if you are getting a different answer, may be it has to do with the way you are getting the components cos(x[0]) (I thought of posting the earlier link, because I don’t see the definition of x).
Also, depending on your issue, may be some circumferential symmetry could help (?).
In any case, you may be better off not listening to me, except for what the link says. Good luck.

Sorry, I’m not entirely sure what I can get from your link. Could you explain it, please? Thanks.

It’s a kind recommendation to Read before posting: How do I get my question answered?, that I am a regular user, that you need a MWE (besides other useful information) and that I wish you the best.