CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   dynamic_cast and lookupObject (https://www.cfd-online.com/Forums/openfoam-programming-development/70966-dynamic_cast-lookupobject.html)

kev4573 December 10, 2009 18:12

dynamic_cast and lookupObject
 
I am having trouble compiling a custon dynamicFvMesh library. I've taken what is essentially the mixerGgiFvMesh and added these lines to it

Code:

121    word field("p");
122
123    const volScalarField& p = lookupObject<volScalarField>(field);
124

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

Code:

/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)



All times are GMT -4. The time now is 23:30.