|
[Sponsors] |
[waves2Foam] volVectorField& U = db().lookupObject<volVectorField>("U") , runtime error |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 24, 2014, 21:21 |
volVectorField& U = db().lookupObject<volVectorField>("U") , runtime error
|
#1 |
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Hi Niels and all Foamers,
I have a question on modifying the linearSpring class when applying to floating bodies in waveDyMFoam. I am trying to modify linearSpring.C so that the code sees the finite volume mesh and can access all points in it. I did the following modifications in linearSpring.C and was able to make the modified dynamic library, mylibforcesNEW.so. ///////////////////////////////////Modifications to linearSpring.C ////////////// const objectRegistry& db(); const volVectorField& U = db().lookupObject<volVectorField>("U"); const fvMesh & mesh = U.mesh(); const pointField & pp = mesh.points(); // Thanks to Niels post (http://www.cfd-online.com/Forums/ope...tml#post275193) ///////////////////////////////////////////////////////// I then used this library in waveDyMFoam by including the name in system/controlDict. But when I run the solver, I get the following error ////////RUNTIME ERROR /////////////// waveDyMFoam: symbol lookup error: /share/gecko/krishnak/OpenFOAM/krishnak-2.1.0/ platforms/linux64GccDPOpt/lib/mylibforcesNEW.so: undefined symbol: _Z2dbv /////////////////////////////////////// Also the run time error disappears if I do not include lines starting from const volVectorField& U = db().lookupObject<volVectorField>("U"); Any help is welcome. Also if there is a better way to access the mesh within linearSpring.C, please let me know. Thanks and best regards Kumar PS: Runtime include libs for waveDyMFoam: libs ( "libOpenFOAM.so" "libfvMotionSolvers.so" "mylibforcesNEW.so" ); |
|
August 1, 2014, 17:11 |
accessing streamFunction class from main
|
#2 |
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Hi Niels and all,
I was trying to access member function printCoeffs() of class streamFunction from main (waveFoam). In waveFoam, I write, ///CODE BELOW/// Info<< " Coeff = " << Foam::waveTheories::streamFunction.printCoeffs() << nl << endl; And the error I get is error: 'streamFunction' is not a member of 'Foam::waveTheories' . ( I checked streamFunction.H where it is given Foam::waveTheories::streamFunction ) Thanks in advance Kumar |
|
August 1, 2014, 19:56 |
accessing streamFunction class from main
|
#3 |
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
I posted the wrong error in the post just before !
This is the error... error: expected primary-expression before '.' token Thanks again Kumar |
|
August 2, 2014, 05:55 |
|
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Kumar,
What you are trying does not make sense. You will have to construct the object, before you use the method. Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
August 2, 2014, 21:41 |
|
#5 |
Senior Member
kumar
Join Date: Mar 2009
Posts: 112
Rep Power: 17 |
Hi Niels,
Thank so much for your reply. I see what you mean ( for example in createFields.H , i see an example for trubulence, interface, also this link helped me ; http://eprints.soton.ac.uk/200155/1/WorkShopFOAM.pdf) . I hope I can bug you with one other question: Suppose I create an object of streamFunction class in my main program. I think this object will be another object that will be DIFFERENT from the object (of streamFunction class) created by the waves2foam lib. Am I correct ?(this means there is no way of accessing the object of streamFunction class from main !!) Best regards Kumar |
|
August 3, 2014, 03:13 |
|
#6 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hallo Kumar,
Yes, it will be another, but identical object, if you create it with the same properties. For instance, both the relaxation zones and boundary conditions have separate but identical waveTheory objects. Besides that, there is no way of accessing the wave theory from the waveFoam-solver, unless you perform a somewhat large re-write of the code. Kind regards, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] blockMesh with double grading. | spwater | OpenFOAM Meshing & Mesh Conversion | 92 | January 12, 2019 10:00 |
DPM udf error | haghshenasfard | FLUENT | 0 | April 13, 2016 07:35 |
Errors in UDF | shashank312 | Fluent UDF and Scheme Programming | 6 | May 30, 2013 21:30 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |