Hi, professor Wolfgang 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.
I want to ask whether the way I define V(u(x_q)) is right and are there any better ways to do this? Thank you very much! Best, Toddy Wolfgang Bangerth <[email protected]> 于2021年9月17日周五 上午8:33写道: > On 9/15/21 10:47 PM, Toddy Liu wrote: > > > > Thank you very much for your reply and it really helps me. You explained > > how to deal with the latter case (V'(u) . grad u, phi_i) and I've got > > the point how to solve this. Addtionally. how about the former case > > -(V(u), grad phi_i). Specifically, how to construct the vector V(u) and > > then multiply with grad phi_i or to say fe_values.shape_grad(i,q_point)? > > You perform the integral via quadrature, and so all you have to know is > what > V(u)(x_q) = V(u(x_q)) > which you evaluate in the same way as you did > sin(u(x_q)) > in step-25 with the only exception that now V(u(x_q)) is a vector > (actually, a Tensor<1,dim>) instead of a scalar quantity. > > 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/d92bb312-b4e0-251d-cce6-cd0e2e08a117%40colostate.edu > . > -- 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/CAGbW%2BYdTYXDEsZ4M1Of%3DY5x4Q00-QsUVCq%3DFrmrJKxPmDkVEPQ%40mail.gmail.com.
