|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Tony
Join Date: Jun 2010
Posts: 51
Rep Power: 4 ![]() |
Hi,
I wanted to know if it is possible to multiply a tensor and a vector to obtain another vector as result. I tried using the multiplication sign but it is not possible. Thanks! |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,877
Rep Power: 23 ![]() |
Take a look at the programming guide.
__________________
Alberto GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. GeekoCFD 32bit - The 32bit edition of GeekoCFD. GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats. |
|
|
|
|
|
|
|
|
#3 |
|
Member
Tony
Join Date: Jun 2010
Posts: 51
Rep Power: 4 ![]() |
Hey,
I did and tried the inner product but it won't give the right result. I just did manual matrix multiplication. Thanks, Tony |
|
|
|
|
|
|
|
|
#4 | |
|
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,877
Rep Power: 23 ![]() |
Quote:
Best,
__________________
Alberto GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image. GeekoCFD 32bit - The 32bit edition of GeekoCFD. GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats. |
||
|
|
|
||
|
|
|
#5 |
|
Member
Tony
Join Date: Jun 2010
Posts: 51
Rep Power: 4 ![]() |
Hey,
Here is the code. The commented parts is the manual multiplication (which works) and the last line is what I tried. It compiles and runs but it doesnt give the right result. When it compiles it gives a warning "warning: suggest parentheses around + or - in operand of &" Code:
bladePointDummie=bladePoints[c][n][k]; //bladePoints[c][n][k][0]=RM.xx()*(bladePointDummie[0]-nacHubGrd[c][1][0])+RM.xy()*(bladePointDummie[1]-nacHubGrd[c][1][1])+RM.xz()*(bladePointDummie[2]-nacHubGrd[c][1][2])+nacHubGrd[c][1][0]; //bladePoints[c][n][k][1]=RM.yx()*(bladePointDummie[0]-nacHubGrd[c][1][0])+RM.yy()*(bladePointDummie[1]-nacHubGrd[c][1][1])+RM.yz()*(bladePointDummie[2]-nacHubGrd[c][1][2])+nacHubGrd[c][1][1]; //bladePoints[c][n][k][2]=RM.zx()*(bladePointDummie[0]-nacHubGrd[c][1][0])+RM.zy()*(bladePointDummie[1]-nacHubGrd[c][1][1])+RM.zz()*(bladePointDummie[2]-nacHubGrd[c][1][2])+nacHubGrd[c][1][2]; bladePoints[c][n][k]=RM&(bladePointDummie-nacHubGrd[c][1])+nacHubGrd[c][1]; |
|
|
|
|
|
![]() |
| Tags |
| multiply, tensor, vector |
| Thread Tools | |
| Display Modes | |
|
|