Linear Operator

16 views
Skip to first unread message

Nikki Holtzer

unread,
Oct 26, 2020, 2:40:19 PM10/26/20
to deal.II User Group
Hello all,

I am struggling to turn a matrix scalar product into a linear operator. I currently have:

temp = M.matrix_scalar_product(u,u);


and I need to turn 'temp' into a linear operator. 

I have tried turning 'M' into a linear operator first  and then  performing the multiplication and have also tried something like linear_operator(temp). Neither has compiled.

Thank you in advance!

Matthias Maier

unread,
Oct 26, 2020, 3:07:39 PM10/26/20
to dea...@googlegroups.com
Dear Nikki,

A "linear operator" in deal.II is an object that linearly transforms a
vector into another one, i.e., it has a vector space as domain of
definition and a vector space as range space.

In your case M.matrix_scalar_product(u,u) is (u^T M u), this is a
quadratic operation, not a linear one. You cannot represent this
operation with a linear operator. Did you intend to simply scale with
that value?

Best,
Matthias

Nikki Holtzer

unread,
Oct 26, 2020, 3:15:14 PM10/26/20
to deal.II User Group
Matthias,

When you helped me implement the operator N_c which is added to my linear_operator , i.e. 

auto N_c = temp1_coef*M + temp_coef*Kronecker;

auto system_matrix = linear_operator(linear_part) + N_c;


the first term is not complete.


Really I want,

auto N_c = temp1_coef*|Psi^m|^2 *M + temp_coef*Kronecker;

auto system_matrix = linear_operator(linear_part) + N_c;


So I was trying in some way to represent that so I can add that term to 'temp_coef*Kronecker' which is of type linear operator. 

Nikki 





Reply all
Reply to author
Forward
0 new messages