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>.

Best
 W.


--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 [email protected]
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/00ff50c1-bea1-4a47-5b9d-dff0d5c1cda8%40colostate.edu.

Reply via email to