Thank you very much. That is right.
I have another question.I want to get [ux, uy] * [ux, uy] '.
So I entered the following code, but it didn’t seem to work.
sens = [ux,uy]*[ux,uy]';
Can you help me find out what the problem is?
real[int] auxVec(ux[].n);
auxVec = k*ux[];
real com = auxVec'*ux[];
cout << "com=" << com << endl;
[ux,uy] is a vectorial finite element function, while ux[] is a vector that contains all the values at the gridpoints of [ux,uy]. Consult the documentation for more details.
I’m sorry to bother you again.
I have the following code. I print ux uy, they are the same. I think they both represent all the values at the gridpoints of [ux,uy].As you said above.
But if I modify the code as follows:
Replace
fespace Vh(Th,[P1,P1]);
Vh [ux,uy],[uu,vv];
as
fespace Vh(Th,P1);
Vh ux,uy,uu,vv;
The printed ux and uy seem different.
What is the difference between the two?