Multiplication of a column and row vector.


75
views
0
3 months ago by
Nima  
Hi,

I have a column vector n=(n1,n2,n3)T and a row vector nT. I need to calculate nnin UFL format as a 3x3 matrix. However, I receive a syntax error when I use "n*n.T" and I know "dot(n,n.T)" is just going to give me scalar. Any help would be much appreciated.
Community: FEniCS Project

2 Answers


4
3 months ago by
Nate  
Look into ufl.outer

I assume you want to compute `n \otimes n`

https://fenicsproject.org/olddocs/ufl/1.5.0/ufl.html#ufl.operators.outer
2
3 months ago by
Ovais  
f = Constant((1,0,0))
g = outer(f,f)

should work
Please login to add an answer/comment or follow this question.

Similar posts:
Search »