On 10/17/19 11:49 AM, het patel wrote:
> 
> Just one more thing. I have very basic understanding of C++ . In the 
> code(step-3) it does vector dot product of the gradient without  writing any 
> sort of function to do so. This might sound bit lame to you but, can you tell 
> me if  we can do dot product by simply doing a*b then how to do vector cross 
> product or matrix multiplication and other such mathematical operations as I 
> have worked mostly on MATLAB  for my assignments where this things are very 
> easy.

Quantities such as the gradient are represented by the class Tensor<1,dim>, 
i.e., a rank-1 tensor (=vector) with dim components. All of the usual 
operations +, -, * are defined for such objects and correspond to their usual 
mathematical meaning. In particular, gradient*gradient results in a scalar, 
whereas 2*gradient would result in a vector twice the length as the gradient 
itself.

The same is true if you have matrices of size dim x dim: There is, for 
example, operator* for such matrices and correspondingly sized vectors.

For vector products, you will want to look at the following function and the 
ones below it:
 
https://www.dealii.org/developer/doxygen/deal.II/classTensor.html#a024cb35dcb0c9c453dfbeaab6bc9f078

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/0491dcd0-59f4-10fd-579a-01bf38130018%40colostate.edu.

Reply via email to