CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Algebraic tensor operations (http://www.cfd-online.com/Forums/openfoam-pre-processing/62125-algebraic-tensor-operations.html)

maka July 17, 2007 10:20

Cross Product: I tried to c
 
Cross Product:

I tried to calculate a cross product by a code like

A ^ U

A is dimensionedVector
U is volVectorField

I got the error:

error: no match for 'operator^' in 'Foam::operator==(const Foam::tmp<foam::fvmatrix<type> >&, const Foam::dimensioned<type>&) [with Type = Foam::Vector<double>](((const Foam::dimensioned<foam::vector<double> >&)((const Foam::dimensioned<foam::vector<double> >*)(& Foam::operator-(const Foam::dimensioned<type>&, const Foam::dimensioned<type>&) [with Type = Foam::Vector<double>](((const Foam::dimensioned<foam::vector<double> >&)((const Foam::dimensioned<foam::vector<double> >*)(& Foam::operator*(const Foam::dimensioned<double>&, const Foam::dimensioned<type>&) [with Type = Foam::Vector<double>](((const Foam::dimensioned<foam::vector<double> >&)((const Foam::dimensioned<foam::vector<double> >*)(& omegaF)))))))))))) ^ U'
/data/maka/OpenFOAM/linuxAMD64/gcc-4.1.0/bin/../lib/gcc/x86_64-unknown-linux-gnu /4.1.0/../../../../include/c++/4.1.0/bits/ios_base.h:165: note: candidates are: std::_Ios_Iostate std::operator^(std::_Ios_Iostate, std::_Ios_Iostate)
/data/maka/OpenFOAM/linuxAMD64/gcc-4.1.0/bin/../lib/gcc/x86_64-unknown-linux-gnu /4.1.0/../../../../include/c++/4.1.0/bits/ios_base.h:127: note: std::_Ios_Openmode std::operator^(std::_Ios_Openmode, std::_Ios_Openmode)
/data/maka/OpenFOAM/linuxAMD64/gcc-4.1.0/bin/../lib/gcc/x86_64-unknown-linux-gnu /4.1.0/../../../../include/c++/4.1.0/bits/ios_base.h:87: note: std::_Ios_Fmtflags std::operator^(std::_Ios_Fmtflags, std::_Ios_Fmtflags)

Any idea how to define such operation:

I wanted the cross product to be applied to the vector A with each vector of the volVectorField. Thanks.

Best regards,
Maka.

maka July 17, 2007 14:04

this is to be done as a part o
 
this is to be done as a part of equation definition like Ueqn for example in icoFoam.

maka July 17, 2007 14:40

it was operator precedence pro
 
it was operator precedence problem, that is discussed in here.

the solution is to use the (A ^ U) instead of A ^ U


All times are GMT -4. The time now is 05:11.