CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (http://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   ODETest.C Compiling failed in version 1.6 (http://www.cfd-online.com/Forums/openfoam-bugs/74713-odetest-c-compiling-failed-version-1-6-a.html)

sxhdhi April 7, 2010 03:14

ODETest.C Compiling failed in version 1.6
 
Dear All,

When I compiled ODETest.C in version 1.6 it is failure. I remembered I could do it in version 1.5.

The error info I obtained is

moduser@pingu1:~/OpenFOAM/OpenFOAM-1.6/applications/test/ODETest$ wmake
Making dependency list for source file ODETest.C
SOURCE=ODETest.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/moduser/OpenFOAM/OpenFOAM-1.6/src/ODE/lnInclude -IlnInclude -I. -I/home/moduser/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/moduser/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/ODETest.o
ODETest.C:72: error: wrong number of template arguments (1, should be 2)
/home/moduser/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude/Matrix.H:55: error: provided for ‘template<class Form, class Type> class Foam::Matrix’
ODETest.C: In member function ‘void testODE::jacobian(Foam::scalar, const Foam::scalarField&, Foam::scalarField&, int&) const’:
ODETest.C:80: error: invalid types ‘int[int]’ for array subscript
ODETest.C:81: error: invalid types ‘int[int]’ for array subscript
ODETest.C:82: error: invalid types ‘int[int]’ for array subscript
ODETest.C:83: error: invalid types ‘int[int]’ for array subscript
ODETest.C:85: error: invalid types ‘int[int]’ for array subscript
ODETest.C:86: error: invalid types ‘int[int]’ for array subscript
ODETest.C:87: error: invalid types ‘int[int]’ for array subscript
ODETest.C:88: error: invalid types ‘int[int]’ for array subscript
ODETest.C:90: error: invalid types ‘int[int]’ for array subscript
ODETest.C:91: error: invalid types ‘int[int]’ for array subscript
ODETest.C:92: error: invalid types ‘int[int]’ for array subscript
ODETest.C:93: error: invalid types ‘int[int]’ for array subscript
ODETest.C:95: error: invalid types ‘int[int]’ for array subscript
ODETest.C:96: error: invalid types ‘int[int]’ for array subscript
ODETest.C:97: error: invalid types ‘int[int]’ for array subscript
ODETest.C:98: error: invalid types ‘int[int]’ for array subscript
ODETest.C: In function ‘int main(int, char**)’:
ODETest.C:114: error: cannot declare variable ‘ode’ to be of abstract type ‘testODE’
ODETest.C:42: note: because the following virtual functions are pure within ‘testODE’:
/home/moduser/OpenFOAM/OpenFOAM-1.6/src/ODE/lnInclude/ODE.H:84: note: virtual void Foam::ODE::jacobian(Foam::scalar, const Foam::scalarField&, Foam::scalarField&, Foam::scalarSquareMatrix&) const
make: *** [Make/linux64GccDPOpt/ODETest.o] Error 1

Could anyone help me?

BTW, I found OpenFOAM ODE could only treat IVP problem. Is it possible to modify the solver for BVP? Thanks in advance!

Best Regards,

Xiaohui

mattijs April 7, 2010 05:12

Works fine for 16x.

For BVP you'd be better off to use a matrix based method. Or reformulate it in terms of a simulation on a 1D mesh and use finite volume operators.

WiWo April 21, 2010 09:34

Hi Xiaohui,

I was wondering if you were able to solve your problem with ODEtest. I was trying to compile ODEtest in OF1.6 and I'm getting exactly the same error as you do.

Further I tried compiling ODEtest in OFdev-1.5 which yields complains about the virtual functions pretty similar to what you get in the last few lines of your output.

SOURCE=ODETest.C ; g++ -m64 -Dlinux64 -DDP -DFOAM_DEV_REVISION_NUMBER=exported -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/wolfgang/OpenFOAM/OpenFOAM-1.5-dev/src/ODE/lnInclude -IlnInclude -I. -I/home/wolfgang/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude -I/home/wolfgang/OpenFOAM/OpenFOAM-1.5-dev/src/OSspecific/Unix/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/ODETest.o
ODETest.C: In function »int main(int, char**)«:
ODETest.C:114: error: cannot declare variable ‘ode’ to be of abstract type ‘testODE’
ODETest.C:42: note: because the following virtual functions are pure within ‘testODE’:

Does anybody have suggestions about how to overcome this problem?

Cheers,
Wolfgang

henry April 22, 2010 03:42

We have fixed ODEtest in OpenFOAM-1.6.x which you can obtain from our git repository.

H

WiWo April 27, 2010 05:36

Dear Henry,

Thank you for the hint to OF-1.6.x - ODEtest works fine there.

I tried to transfer this ODEtest to OF-1.5dev, as this is the environment I'm currently using (mainly because I need icoFsiFoam). It seems that there are quite some significant differences in the ODEsolver class between OF16x and OF15dev and some other classes (e.g. scalarSquareMatrix) are missing.

In the end I wasn't able to get ODEtest running on ODE15dev but it helped a lot in understanding how the ODEsolver works. I could figure out another solution, which works in OF15dev by adapting the sixDOFSolver and its dedicated classes.

Thank you very much for your help.

Best regards,
Wolfgang


All times are GMT -4. The time now is 07:29.