CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

scalarMatrix

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2012, 13:10
Default scalarMatrix
  #1
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 15
flowris is on a distinguished road
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
Indeed, on this line, we can find
Code:
        mutable scalarMatrix* BPtr_;
How can we use scalarMatrix in 2.0.x?
flowris is offline   Reply With Quote

Old   March 27, 2012, 13:32
Default
  #2
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
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
marupio is offline   Reply With Quote

Old   March 28, 2012, 12:25
Default
  #3
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 15
flowris is on a distinguished road
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
RBFMotionFunctionObject inherits from functionObject, and both have the member function virtual bool execute(); so I don't really see the problem.

.
flowris is offline   Reply With Quote

Old   March 28, 2012, 18:55
Default
  #4
Senior Member
 
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 21
marupio is on a distinguished road
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
marupio is offline   Reply With Quote

Reply

Tags
scalarmatrix

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
LUDecompose, LUBacksubstitue in class scalarMatrix jaswi OpenFOAM Programming & Development 4 July 8, 2009 04:37


All times are GMT -4. The time now is 12:08.