|
[Sponsors] |
August 22, 2007, 12:49 |
In programmer's guide:
c_i =
|
#1 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
In programmer's guide:
c_i = scale(a, b) = (a1*b1, a2*b2, a3*b3) I'm looking for a similar operation but with division operators. scalediv(a, b) = (a1/b1, a2/b2, a3/b3). Is there a function to do that? or I have to write a one? I intend to use it on 2 volVectorFields Thanks. Best regards, Maka |
|
August 22, 2007, 12:57 |
I needed this in my developmen
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
I needed this in my development stuff a while back and it's been added to my development version. It's called invScale.
I would recommend thinking carefully if you really need it or not. If you do, you can grep and search because for proper functionality it needs to be added in 4-5 places. Good luck, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
August 22, 2007, 15:21 |
I do not know how complicated
|
#3 |
Senior Member
Join Date: Mar 2009
Posts: 225
Rep Power: 18 |
I do not know how complicated is your case, but can't you simply make d_i = 1/b_i and then a_i * d_i ?
|
|
August 23, 2007, 06:41 |
Thanks Hrv, I will try it.
@
|
#4 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
Thanks Hrv, I will try it.
@Krystian: the operation of scalar division is defined as tensor/scalar but not the opposite. As a result 1/tensor will give a compilation error. Best regards, Maka. |
|
August 23, 2007, 07:06 |
Which is exactly what it shoul
|
#5 |
Senior Member
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17 |
Which is exactly what it should do. What do you mean by 1/tensor? The operation is not mathematically defined. You could ask for the inverse of the tensor, of course, but is that what you mean?
For that matter, scaling one vector by another component-wise probably is mathematically a bit dodgy as well. If you are looking for a transformation of the vector by different amounts in each direction, once again this would be a tensor operation. Gavin |
|
August 23, 2007, 09:52 |
The operation of devision is n
|
#6 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
The operation of devision is not defined for vector (example of a tensor) because it only has a meaning when they are parallel. But here what I'm after is not an legitimate operation on vector or tensor. I need a scaling FUNCTION, that can take on vector field and scale it by another vector field (element by element scalar division). Assume you have two terms in an equation and you explicitly want to see how they wait relative to each other during run time. Then you will not Hrv's invScale function. That was exactly my situation. Thanks Gavin and Krystian for your comments. Please feel free to criticize the need that I explained. At the moment, I'm recompiling after I added Hrv's function. Thanks for your help.
Best regards, Maka. |
|
November 11, 2008, 13:57 |
If we have an equation:
s*T1=
|
#7 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
If we have an equation:
s*T1=T2; where s is unknown scalar; T1 and T2 is two tensors; How can we calculate s by well defined mathematical operation? s=T2/T1; is not mathematically defined. Thanks. |
|
November 11, 2008, 14:07 |
I think it should be:
s*T1*
|
#8 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
I think it should be:
s*T1*inv(T1)= s*I=T2*inv(T1); Then we know X=s*I; s=sqrt(mag(X)/n); where n is the number of diagonal elements of the tensor I; is that correct? Thanks. |
|
November 20, 2008, 08:43 |
I think it is:
s=tr(T2 & in
|
#9 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
I think it is:
s=tr(T2 & inv(T1))/3; |
|
September 11, 2012, 03:36 |
|
#10 |
New Member
Maosong Cheng
Join Date: Aug 2012
Posts: 19
Rep Power: 14 |
where can I find invScale function?
|
|
October 10, 2013, 21:27 |
|
#11 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18 |
Anyone knows where can I find this scale function's header?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dimension problem with operation scale | booz | OpenFOAM Pre-Processing | 0 | October 10, 2008 04:57 |
Large Scale Model:Small scale computer | gull | COMSOL | 0 | March 5, 2007 07:37 |
scale or full scale | justin | FLUENT | 1 | August 4, 2006 23:00 |
relation b/n Kolomogorov scale and Taylor scale | hanman | Main CFD Forum | 0 | February 28, 2006 05:16 |
Convert color-scale pictures to gray-scale ones | XC | FLUENT | 4 | March 29, 2005 19:55 |