Thank you so much. I appreciate your help. 

On Monday, December 10, 2018 at 1:54:28 PM UTC-5, Wolfgang Bangerth wrote:
>
> On 12/10/18 11:25 AM, Jaman wrote: 
> > 
> > I have stuck in another piece of the weak form. I have an inner product 
> (\grad 
> > u^{n-1}:\grad u^n I, \grad v), where : is the contraction between the 
> two 
> > tensors,  "I" is the identity matrix and v is the test function. 
> > 
> > I understand that scalar_product(old_time_gradient_values[q], grad_phi[ 
> j ]) 
> > will serve for the part \grad u^{n-1}:\grad u^n but how can I multiply 
> it with 
> > the identity matrix of the appropriate size so that I can take another 
> > scalar_product to complete the contribution of it in the local_matrix? I 
> hope 
> > if this problem is solved I can move faster. 
>
> You don't have to. The term 
>    scalar_product(old_time_gradient_values[q], grad_phi[ j ]) 
> is just a scalar number, so instead of multiplying it with I (resulting in 
> a 
> tensor) and then multiplying the tensor with grad v, you are better off 
> writing this as 
>
>    (\grad u^{n-1}:\grad u^n I, \grad v) 
>    = \int [\grad u^{n-1}:\grad u^n] [I : \grad v] 
>
> i.e., you now only need to know how to compute [I : \grad v]. But this is 
> just 
> the trace of grad v: 
>
>    = \int [\grad u^{n-1}:\grad u^n] [trace (\grad v)] 
>
> Best 
>   W. 
>
>
> -- 
> ------------------------------------------------------------------------ 
> Wolfgang Bangerth          email:                 bang...@colostate.edu 
> <javascript:> 
>                             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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to