|
[Sponsors] |
const volVectorField& U = db().lookupObject<volVectorField>("U") gives runtime error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 28, 2014, 18:26 |
const volVectorField& U = db().lookupObject<volVectorField>("U") gives runtime error
|
#1 |
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Hi All,
I am trying to access the points in the mesh inside the linearSpring class. So inside the linearSpring.C , (under the restrain member function), I do the following modifications, ////////////////Mods. to linearSpring.C// const objectRegistry& db(); const volVectorField& U = db().lookupObject<volVectorField>("U"); //Line2 const fvMesh & mesh = U.mesh(); //Line3 const pointField & pp = mesh.points(); //Line4 ///////////////////////////////////////// The libary compiles with out errors, but when I use this in a solver(waveDyMFoam), it gives the following run time errors. I also found that if I comment out Lines 2 to 4 , the run time error disappears. ///////RUN TIME ERROR//// waveDyMFoam: symbol lookup error: /share/gecko/krishnak/OpenFOAM/krishnak-2.1.0/ platforms/linux64GccDPOpt/lib/mylibforcesNEW.so: undefined symbol: _Z2dbv Any suggestion is welcome Thanks in advance Kumar |
|
July 29, 2014, 04:35 |
|
#2 |
New Member
Jacques F.
Join Date: Jul 2013
Location: Toulouse
Posts: 6
Rep Power: 13 |
What is in your Make/files and Make/options ?
|
|
July 29, 2014, 16:17 |
|
#3 |
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Hi Jacks,
Thanks for your quick reply. Make/options is : EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude LIB_LIBS = \ -lincompressibleTransportModels \ -lincompressibleRASModels \ -lincompressibleLESModels \ -lbasicThermophysicalModels \ -lspecie \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ -lmeshTools \ -lsampling /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// Make/files //////////////////////////////// forces/forces.C forces/forcesFunctionObject.C forceCoeffs/forceCoeffs.C forceCoeffs/forceCoeffsFunctionObject.C sDoFRBM = pointPatchFields/derived/sixDoFRigidBodyMotion $(sDoFRBM)/sixDoFRigidBodyMotion.C $(sDoFRBM)/sixDoFRigidBodyMotionIO.C $(sDoFRBM)/sixDoFRigidBodyMotionState.C $(sDoFRBM)/sixDoFRigidBodyMotionStateIO.C sDoFRBMR = $(sDoFRBM)/sixDoFRigidBodyMotionRestraint $(sDoFRBMR)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C $(sDoFRBMR)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C $(sDoFRBMR)/linearAxialAngularSpring/linearAxialAngularSpring.C $(sDoFRBMR)/linearSpring/linearSpring.C $(sDoFRBMR)/sphericalAngularSpring/sphericalAngularSpring.C $(sDoFRBMR)/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C sDoFRBMC = $(sDoFRBM)/sixDoFRigidBodyMotionConstraint $(sDoFRBMC)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C $(sDoFRBMC)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C $(sDoFRBMC)/fixedAxis/fixedAxis.C $(sDoFRBMC)/fixedLine/fixedLine.C $(sDoFRBMC)/fixedOrientation/fixedOrientation.C $(sDoFRBMC)/fixedPlane/fixedPlane.C $(sDoFRBMC)/fixedPoint/fixedPoint.C pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVect orField.C LIB = $(FOAM_USER_LIBBIN)/mylibforcesNEW ////////////////////////////////////////////////////////// What area your thoughts? Thanks in advance Kumar |
|
July 30, 2014, 06:16 |
|
#4 |
New Member
Jacques F.
Join Date: Jul 2013
Location: Toulouse
Posts: 6
Rep Power: 13 |
I thought it might be due to linking error while compiling waveDyMFoam, so in Make/options file of your waveDyMFoam solver not mentioning correctly your
mylibforcesNEW.so library. |
|
July 30, 2014, 23:55 |
|
#5 |
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Hi Jacks,
I tried out your suggestion, i.e, I recompiled the waveDyMFoam with the library (instead of calling the library at real time in the controlDict of waveDyMFoam, as a dynamic linked library, which I did first) and I get this error. // ERROR// /share/gecko/krishnak/OpenFOAM/krishnak-2.1.0/platforms/linux64GccDPOpt/lib/libmylibforcesNEW.so: undefined reference to `db() ////////////// I implemented the new code starting with, {const objectRegistry& db(); const volVectorField& U = db().lookupObject<volVectorField>("U"); } .., inspired by this post http://www.cfd-online.com/Forums/ope...tml#post254642 , but reading more closely and going through fvPatchField.H, I found that db is already defined in that class and that may be the reason they are able to access it. However in the linearSpring class , no db ( or similar) is defined. Also no db is defined in the class above linearSpring ( sixDoFRigidBodyMotionRestraints ). At this point I am not sure how to proceed. Once again, If you can give any pointers on how to proceed, that would be great. Thanks a lot Kumar |
|
March 6, 2020, 22:41 |
|
#6 | |
New Member
tooran
Join Date: Nov 2016
Posts: 23
Rep Power: 10 |
Quote:
use this following line. const fvMesh& mesh = U_.mesh(); |
||
March 9, 2020, 01:01 |
|
#7 |
Senior Member
Yogesh Bapat
Join Date: Oct 2010
Posts: 102
Rep Power: 16 |
You need to access db using function in mesh. Check functions in fvMesh for this.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
error compiling modified applications | yvyan | OpenFOAM Programming & Development | 21 | March 1, 2016 05:53 |
RunTim Error for simpleFoam | Djub | OpenFOAM Running, Solving & CFD | 2 | April 12, 2013 12:51 |
how to change a volScalarField in bc? | Katl | OpenFOAM Programming & Development | 20 | February 2, 2012 07:10 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 11:23 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 03:32 |