How to compute a pointwise vector product within an ufl-file
i am really new in working with fenics and the packages around. So i have got a question about ufl. I want to generate an input Matrix for an optimal control problem.
So i am writing down my variational form and want to get the expression
in my matrix (c is only an constant). For that i am assembling L to an Vector B via
Now i want to pointwise multiply this vector with another vector, called z.
I am writing my main programm in C++ and the pointwise multiplying doesn't make any problem.
My question is now. How could i get the pointwise multiplication into the ufl-file, such that, i don't have to do the multiplication after assembling my vector.
I tried to use the Coefficient class in ufl and later on i tried it with the Function class via
elem=FiniteElem
z = Coefficient(elem) or z = Function(elem).
With the Coefficient class the multiplication
does not create an error but the result isn't correct when i'm comparing it with the pointwise operation
in MATLAB. So i'm sure i'm not computing a pointwise multiplication of two vectors.
Could you please help me with this problem. It would really help me.
Regards,
Norman
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- UFL Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Norman Lang
- Solved:
- Last query:
- Last reply: