|
[Sponsors] |
December 17, 2014, 06:03 |
refCast compilation and understanding error
|
#1 |
New Member
Martin K
Join Date: Jan 2013
Location: Germany
Posts: 28
Rep Power: 13 |
Hi all,
while trying to move a mesh by modifying the pointDisplacement file out of my solver, I got stuck. I could really need some help using and understanding refCast. Here is what I got: Code:
pointVectorField& PointDisplacement = refCast<pointVectorField&> ( mesh.objectRegistry::lookupObject<pointVectorField> ( "pointDisplacement" ) ); vectorField& pDisp = PointDisplacement.internalField(); vectorField& pDispOld = pDisp; pDisp == vector (0,0,0.001)+pDispOld; Code:
/home/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/typeInfo.H: In instantiation of ‘To& Foam::refCast(From&) [with To = Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>&; From = const Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>]’: ../pointDisplacementInterFace.H:15:2: required from here /home/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/typeInfo.H:110:35: error: cannot dynamic_cast ‘r’ (of type ‘const class Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>’) to type ‘class Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>&’ (conversion casts away constness) return dynamic_cast<To&>(r); ^ /home/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/typeInfo.H:116:28: error: ‘typeName’ is not a member of ‘Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>&’ << " to type " << To::typeName ^ /home/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/typeInfo.H:119:35: error: cannot dynamic_cast ‘r’ (of type ‘const class Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>’) to type ‘class Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>&’ (conversion casts away constness) return dynamic_cast<To&>(r); ^ /home/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/typeInfo.H: In function ‘To& Foam::refCast(From&) [with To = Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>&; From = const Foam::GeometricField<Foam::Vector<double>, Foam::pointPatchField, Foam::pointMesh>]’: /home/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/typeInfo.H:121:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ make: *** [Make/linux64GccDPOpt/myInterDyMFoam.o] Fehler 1 |
|
April 26, 2018, 20:14 |
|
#2 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 |
Hey,
I'm getting the same error. Did you manage to figure it out? Best, Scram_1 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to setup a simple OpenFOAM cluster? | TommiPLaiho | OpenFOAM Installation | 3 | October 27, 2013 16:15 |
fireFoam.1.7.x_0.4 compilation error | !link | OpenFOAM Installation | 9 | December 24, 2012 05:15 |