CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Error compiling simpleMatrixTestC (http://www.cfd-online.com/Forums/openfoam/60901-error-compiling-simplematrixtestc.html)

jaswi August 3, 2007 13:05

Hi OpenFOAM users I tried t
 
Hi OpenFOAM users

I tried to compile the simpleMatrixTest.C located in /OpenFOAM/OpenFOAM-1.4/applications/test/simpleMatrix and it gives the following error:


singh@taifun:~/OpenFOAM/OpenFOAM-1.4/applications/test/simpleMatrix> wmake
Making dependency list for source file simpleMatrixTest.C
SOURCE=simpleMatrixTest.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/singh/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64Gcc4DPOpt/simpleMatrixTest.o
simpleMatrixTest.C: In function 'int main(int, char**)':
simpleMatrixTest.C:41: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:42: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:43: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:44: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:45: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:46: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:47: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:48: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
simpleMatrixTest.C:49: error: 'class Foam::simpleMatrix<foam::vector<double> >' has no member named 'matrix'
make: *** [Make/linux64Gcc4DPOpt/simpleMatrixTest.o] Fehler 1

I tried to look in the class but it didn't help me much.

Anybody expert in C++ please take a look and help me to understand what's wrong

Thanks a lot
Kind Regards
Jaswinder

lr103476 September 28, 2007 18:00

I got the same error messages
 
I got the same error messages with the latest OF-1.4.1 versions (standard and dev). OF-1.3 worked OK.

Has anyone already fixed this problem with simpleMatrix....

Frank

lr103476 September 29, 2007 05:16

Apparently, the matrix() funct
 
Apparently, the matrix() function disappeared in the simpleMatrix class. The source() function is still there. I assume that simpleMatrix just works as follows

simpleMatrix<vector> A(2);
//filling the matrix
A[0][0] = 1.0;
A[0][1] = 2.0;
A[1][0] = 3.0;
A[1][1] = 4.0;

//Defining some source vector
A.source()[0] = vector(1.0, 1.0, 1.0);
A.source()[1] = vector(2.0, 2.0, 2.0);

//Solving the system
Info << A.solve() << endl;

Could someone confirm that this is the correct way?

Regards, Frank

hjasak September 29, 2007 06:36

Yup, what you are doing is fin
 
Yup, what you are doing is fine. Have a look at simpleMatrix.H:

template<class>
class simpleMatrix
:
public scalarMatrix


Therefore simpleMatrix IS-A scalarMatrix and your access functions are fine.

Enjoy,

Hrv

wenxu August 22, 2014 03:32

Do you mean that Ax=b, where A is the simplematrix, b is the source vector and x is the solution?


All times are GMT -4. The time now is 17:32.