On 9/16/21 7:34 PM, Toddy Liu wrote:
>
> Yes, I can write the components of V(u(x_q)) by known expression, for example
> V(u(x_q))= (2u(x_q),3u(x_q)) where 2u(x_q) is the x-direction and 3u(x_q) is
> y-direction. I construct a vector<Tensor> named tmp_vector and assign the
> values by tmp_vector[0]=2u(x_q), tmp_vector[1]=3u(x_q). Then I do the
> multiplication tmp_vector*fe_values.shape_grad(i,q_point). But when I ran the
> program, errors occurred because maybe the operation between these two terms
> is not permitted. So I define the V(u(x_q)) by Point<dim>(2u(x_q),3u(x_q)) and
> the program runs without errors.
The dot product is defined between two objects of type Tensor<1,dim>. A
Point<dim> is derived from Tensor<1,dim>, so this works. Just
vector<Tensor<1,dim>> doesn't -- it should have been Tensor<1,dim>.