# Question about dot product

**URL:** <https://discourse.channelflow.ch/t/question-about-dot-product/131>\
**Category:** Programming\
**Created:** [December 17, 2021, 3:43pm UTC](https://discourse.channelflow.ch/t/question-about-dot-product/131 "2021-12-17T15:43:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastien](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@Sebastien](https://discourse.channelflow.ch/u/Sebastien)\
**Post date:** [December 17, 2021, 3:43pm UTC](https://discourse.channelflow.ch/t/question-about-dot-product/131/1 "2021-12-17T15:43:56Z")

</div>

Dear channelflow developers,  
I have a question concerning the function dot() in diffops.cpp  
I have troubles understanding the computation of fdotg when f.Nd= 3 and g.Nd = 9.

fdotg(nx, ny, nz, 0) += f(nx, ny, nz, i) \* g(nx, ny, nz, ij)

shouldn’t it be  
fdotg(nx, ny, nz, i) += f(nx, ny, nz, j) \* g(nx, ny, nz, ij)

just like in dotgrad ?  
As far as I know, the function dot for vector - tensor product is not used for computing non linear terms, so it is not a big deal, it is just for clarification.

Best wishes,  
Sébastien

---

<div class="post-metadata">

**Author:** ![jlangham](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@jlangham](https://discourse.channelflow.ch/u/jlangham)\
**Post date:** [December 21, 2021, 9:43am UTC](https://discourse.channelflow.ch/t/question-about-dot-product/131/2 "2021-12-21T09:43:35Z")

</div>

Hi,

I’m not a developer but this looks like a bug to me on the grounds (as you say) that fdotg is not having all of its fields updated, i.e. being treated like a vector in this case.

Perhaps you could submit it as a bug report,

-Jake
