CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

dynamic_cast and lookupObject

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

LinkBack Thread Tools Display Modes
Old   December 10, 2009, 19:12
Default dynamic_cast and lookupObject
Senior Member
Kevin Smith
Join Date: Mar 2009
Posts: 103
Rep Power: 8
kev4573 is on a distinguished road
I am having trouble compiling a custon dynamicFvMesh library. I've taken what is essentially the mixerGgiFvMesh and added these lines to it

121     word field("p");
123     const volScalarField& p = lookupObject<volScalarField>(field);
And get a compiler error like this.. I've seen lookups like this in other classes derived from dynamicFvMesh and they compile just fine.

Any help is appreciated

/home/kevin/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/typeInfo.H: In function ‘bool Foam::isA(const Type&) [with TestType = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>, Type = Foam::regIOobject]’:
/home/kevin/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/objectRegistryTemplates.C:44:   instantiated from ‘Foam::wordList Foam::objectRegistry::names() const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]’
/home/kevin/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/objectRegistryTemplates.C:139:   instantiated from ‘const Type& Foam::objectRegistry::lookupObject(const Foam::word&) const [with Type = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>]’
freeRotatingGgiFvMesh/freeRotatingGgiFvMesh.C:123:   instantiated from here
/home/kevin/OpenFOAM/OpenFOAM-1.5-dev/src/OpenFOAM/lnInclude/typeInfo.H:126: error: cannot dynamic_cast ‘(const Foam::regIOobject*)t’ (of type ‘const class Foam::regIOobject*’) to type ‘const struct Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>*’ (target is not pointer or reference to complete type)
kev4573 is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

All times are GMT -4. The time now is 19:52.