|
[Sponsors] |
How to get access to the functions inside the shared libraries in OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 10, 2015, 09:24 |
How to get access to the functions inside the shared libraries in OpenFOAM
|
#1 |
New Member
Mohsen Ranjbaran
Join Date: Feb 2015
Posts: 1
Rep Power: 0 |
Dear all
Does anyone knows how I can get access to the functions inside the shared libraries (.so) in OpenFOAM? Regards Mohsen |
|
February 11, 2015, 06:21 |
|
#2 |
Senior Member
Blanco
Join Date: Mar 2009
Location: Torino, Italy
Posts: 193
Rep Power: 17 |
Yes, you can find the source of the lib under the src dir.
Use this as an example: Code:
grep -R libforces.so $FOAM_SRC Regards |
|
March 25, 2015, 03:56 |
|
#3 |
Senior Member
Join Date: Jul 2011
Posts: 120
Rep Power: 14 |
Hi, I think he meant accessing variables of the objects created in the libraries?
|
|
March 25, 2015, 04:36 |
|
#4 |
Senior Member
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21 |
A library is a bunch of object code, containing the translation of the C++ we humans write to machine language. Basically, every OpenFOAM utility accesses library functions, whose implementation is stored in the .so file.
If you are writing your utility, all you need to do is to include the header: Code:
#include "someClass.H" Code:
someClass someObject; someObject.someMemberFunction(); Code:
-I/path/to/library/lnInclude -L/path/to/library/file -lsomeLibrary If you are using function objects, you will be doing this automatically. Still, you need to add something like `functionObjectsLibs ("libsomeLibrary.so")` in the control dict. Btw, what exactly do you want to do?
__________________
When asking a question, prepare a SSCCE. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
time functions in openFoam? | cyberbrain | OpenFOAM Running, Solving & CFD | 6 | November 2, 2015 21:25 |
parallel running - error while loading shared libraries: | seami | OpenFOAM Installation | 1 | December 9, 2011 04:39 |
Access source code of OpenFOAM | nmansouri | OpenFOAM | 1 | October 14, 2010 02:17 |
Can't profile shared libraries | rsamuel | OpenFOAM Programming & Development | 1 | August 3, 2009 09:58 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 18:07 |