CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   scale(a, b) function (http://www.cfd-online.com/Forums/openfoam-programming-development/79685-scale-b-function.html)

ozgur August 31, 2010 09:05

use of scale(a, b) function?? error: ‘scale’ was not declared in this scope
 
Hi,

In the Programmer’s Guide there is a description of a function named as scale:

Quote:

As the name suggests, the scale function is a tool for scaling the components of one tensor by the components of another tensor of the same rank. It is evaluated as the product of corresponding components of 2 tensors, e.g., scaling vector a by vector b would produce vector c whose components are ci = scale(a, b) = (a1b1, a2b2, a3b3)
I have tried to use it however, I get the following error during compilation:
Code:

error: ‘scale’ was not declared in this scope
My code is simple:

Code:

#include "fvCFD.H"
...
vector a(1,2,3), b(4,5,6), c;
c=scale(a,b)


What can I do about this?

Thanks,

Ozgur

ngj August 31, 2010 11:25

Unfortunately the Programmers Guide is not up to date, as the function is now called "cmptMultiply".

Best regards,

Niels

ozgur September 1, 2010 05:53

Hi Niels,

Thanks again :)

Ozgur

sunliming December 31, 2012 01:02

Can cmptMultiply be used for scalarField, e.g. cmptMultiply(points1,points2) where type of points1 and points2 is scalarField?

ngj December 31, 2012 09:19

Hi Nick,

You can just multiply two scalarFields with the operator "*", which result in a scalarField, so the cmptMultiply is not needed.

Happy New Year

Niels

sunliming January 1, 2013 02:11

Hi Niels,
Thank you! It's cool and convenient to use "*" for scalarField multiply. Sometimes it is just hard to access OpenFOAM for there are so few documents about how to operate field. And it's slow and inefficient to dig in the source code itself. If there are some instructions of handing fields, that would be better for OpenFAOM user programming!

Happy new year!
Nick

yvesc May 26, 2014 19:34

Thank you Niels
 
Quote:

Originally Posted by ngj (Post 273505)
Unfortunately the Programmers Guide is not up to date, as the function is now called "cmptMultiply".

Best regards,

Niels

*sigh* this is 2013, and the Programmer's Guide is still not up-to-date.
Lost me 1/2 hour.


All times are GMT -4. The time now is 02:18.