← Back to team overview

ufl team mailing list archive

Re: [Question #164419]: How to compute a pointwise vector product within an ufl-file

 

Question #164419 on UFL changed:
https://answers.launchpad.net/ufl/+question/164419

    Status: Answered => Open

Norman Lang is still having a problem:
elem=FiniteElement("Lagrange",tetrahedron,1) 
v = TestFunction(element)

The expression inner(1, v)*ds(1)  should do the same like v*ds(1) i guess. With that expression i want to generate a vector of length n, where n is the number of grid nodes (because of use of Lagrange, 1) and the vector only has some constant entries on node places of the boundary one (ds(1)).
Later on this should be an input vector of an optimal control problem.

Now i want to create a vector which depends on my spatial coordinate z.
More precise i want to generate a vector of the form

                              B(i)=exp(-50*z(i))*v(i)*ds(1).

The entries of vector should vary over the hight of my working piece.
In my C++ code i could realize that via a pointwise multiplication.

But i want to get that expression into my variational form to generate the right hand side of my system of linear equations which i want to solve with FEniCS.
Because of your answer 

'Unless you can write what you want into the PDE, you cannot express it
with UFL.

UFL is a language for variational forms, not for linear algebra
operations on the assembled global vectors and matrices.'

i think it isn't really possible. So i would be happy if some has got an
other approach for this problem.


I hope one can understand my problem now and i want to thank for the previous answer.

Regards,

Norman

-- 
You received this question notification because you are a member of UFL
Team, which is an answer contact for UFL.


Follow ups

References