Use of nodal coordinate in weak from equation

Dear all,

I am solving an elasticity problem, in which a uniform load (Ktensor) is applied to nodal points on the FE mesh. I put a brief version of my code for your reference.
As you see below, I need to multiply the load (Ktensor) to nodal coordinates. I tried the following options to define nodal coordinates in my weak from equation, and the results are not the same.

fespace Vh(Th, [P2, P2]);
Vh [u1, u2]; //unknowns (displacement fluctuations)
Vh [v1, v2]; //test functions (virtual displacement)
macro epsilon(u1,u2) [dx(u1), dy(u2), dx(u2)+dy(u1)] //EOM // strain vector

func Ktensor = [[1., 0.], [0., 0.], [0., 0.]]; // applied load

// >>> Option 1:

Vh [X,Y] = [x, y];

solve Elastic([u1, u2], [v1, v2]) = int2d(Th)(epsilon(v1,v2)'*C*epsilon(u1,u2)) + int2d(Th)(epsilon(v1,v2)'*C*(Ktensor*[X,Y])) ;

// >>> Option 2:

macro coord [x, y] // EOM

solve Elastic([u1, u2], [v1, v2]) = int2d(Th)(epsilon(v1,v2)'*C*epsilon(u1,u2)) + int2d(Th)(epsilon(v1,v2)'*C*(Ktensor*coord)) ;

In the above, C is the elastic matrix of the material, and the only difference in the problem formulation is the way that nodal coordinates are defined. But the results are different.

Can anyone help me understand what is the proper way of defining nodal coordinates in my problem?

Thank you !

Naively I would say that here you use P2 and not P1. P1 elements are determined by values at the vertices of triangle while P2 are defined by vertices and mid-edges…

In the first case you are using a fespace function that aproximates the [x,y] field and in the second one you are using the exact field so, in the numerical integration, results can differ from one to the other.

1 Like