|
[Sponsors] |
March 27, 2012, 13:10 |
scalarMatrix
|
#1 |
Senior Member
Join Date: Apr 2010
Posts: 151
Rep Power: 15 |
I am trying to convert an older mesh motion class from 1.5-dev to 2.0.x. The compiler gives me the following error:
Code:
RBFInterpolation.H:102: error: ISO C++ forbids declaration of ‘scalarMatrix’ with no type Code:
mutable scalarMatrix* BPtr_; |
|
March 27, 2012, 13:32 |
|
#2 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21 |
The matrix class structures changed between 1.5 and 1.6 and caused me a bit of a headache. I don't remember the details, but you can look at the implementations of ODE solvers between the two versions to see what you need to change.
__________________
~~~ Follow me on twitter @DavidGaden |
|
March 28, 2012, 12:25 |
|
#3 |
Senior Member
Join Date: Apr 2010
Posts: 151
Rep Power: 15 |
David,
Thank you for this tip. I tried to find files containing scalarMatrix, without succes. I looked in scalarMatrices.C and, as far as I understand, one has to chose between the subclasses. So I changed all scalarMatrix to scalarRectangularMatrix, which seems the most general subclass. Now, I have another error that I could not overcome: Code:
SOURCE=RBFMotionFunctionObject.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/dynamicMesh/lnInclude -I/home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/finiteVolume/lnInclude -I/home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/meshTools/lnInclude -I/home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/triSurface/lnInclude -IlnInclude -I. -I/home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude -I/home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/RBFMotionFunctionObject.o In file included from RBFMotionFunctionObject.H:42, from RBFMotionFunctionObject.C:30: /home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude/functionObject.H: In static member function ‘static Foam::autoPtr<Foam::functionObject> Foam::functionObject::adddictionaryConstructorToTable<functionObjectType>::New(const Foam::word&, const Foam::Time&, const Foam::dictionary&) [with functionObjectType = Foam::RBFMotionFunctionObject]’: /home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude/functionObject.H:91: instantiated from ‘Foam::functionObject::adddictionaryConstructorToTable<functionObjectType>::adddictionaryConstructorToTable(const Foam::word&) [with functionObjectType = Foam::RBFMotionFunctionObject]’ RBFMotionFunctionObject.C:46: instantiated from here /home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude/functionObject.H:84: error: cannot allocate an object of abstract type ‘Foam::RBFMotionFunctionObject’ RBFMotionFunctionObject.H:58: note: because the following virtual functions are pure within ‘Foam::RBFMotionFunctionObject’: /home/jmatthei/OpenFOAM/OpenFOAM-2.0.x/src/OpenFOAM/lnInclude/functionObject.H:152: note: virtual bool Foam::functionObject::execute(bool) make: *** [Make/linux64GccDPOpt/RBFMotionFunctionObject.o] Error 1 . |
|
March 28, 2012, 18:55 |
|
#4 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21 |
I don't know much about the classes you are working with, but I've dealt with that error before. The compiler is complaining that you are trying to create an instance of pure virtual object. Pure virtual objects cannot be created... they only exist as a part of a logical class structure. You have to go down the class structure and find a suitable derived object. The only way you can tell if the class is "pure virtual" or not is: pure virtual objects are missing the implementation of at least one function. The compiler is telling you which function is missing: execute(). So either find another object that inherits RBFMotionFunctionObject, or implement execute() in this class yourself.
Share and enjoy! -Dave
__________________
~~~ Follow me on twitter @DavidGaden |
|
Tags |
scalarmatrix |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LUDecompose, LUBacksubstitue in class scalarMatrix | jaswi | OpenFOAM Programming & Development | 4 | July 8, 2009 04:37 |