|
[Sponsors] |
May 16, 2007, 08:41 |
Hello!
I would like to apol
|
#1 |
New Member
Normunds Jekabsons
Join Date: Mar 2009
Location: Riga, Latvia
Posts: 10
Rep Power: 17 |
Hello!
I would like to apologize for rather simple question,also my apologies if this is already answered somewhere. My problem is - I need to know the case name and root directories outside the main() function, in some of .C files where I would like to define more complex boundary conditions. I can use global variables in file with main() function, something like #include"fvCFD.H" ... argList* global_args; ... main(int argc, char **argv) { #include"setRootCase.H" ... global_args = &args; ... } and than in an other file extern argList* global_args; however it looks for me a bit ugly. Is here an other way arround, something like functions global.getCaseName() global.getRoot() accessible from anywhere without modification of main() body? Is it possible to read transport properties in a similar way, I must have mesh for it's constructor, how to get it? Thank you in advance! /Normunds |
|
May 17, 2007, 12:13 |
runTime.caseName()
runTime.ro
|
#2 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
runTime.caseName()
runTime.rootPath() Check Time.H in src/OpenFOAM/lnInclude/ |
|
May 18, 2007, 04:31 |
Thank you Eugene for your answ
|
#3 |
New Member
Normunds Jekabsons
Join Date: Mar 2009
Location: Riga, Latvia
Posts: 10
Rep Power: 17 |
Thank you Eugene for your answer!
however, in my case it gives error: 'runTime' was not declared in this scope My file (globalTest.C) *************************** #include"fvCFD.H" #include"Time.H" #include"GlobalTest.H" // my code with class globalTest definition globalTest::globalTest() { Info << runTime.caseName() << endl; } ************************** may be I have to include some header file with global runTime identifier declaration? perhaps, I can ask my question in more exact manner - is inside OpenFoam source any way how to access global case information without remembering variables (ones which holds case name, mesh, etc) on creation by myself? Is here some globally accessible register or whatever in which these unique things (by meaning one per application) are automatically remembered when I create them? sincerely /normunds |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Influece of wall velocity in the main flow | marvin | CFX | 0 | March 22, 2008 02:05 |
Main Diffenrences between commercian packages ?? | Abou | Main CFD Forum | 8 | October 16, 2006 08:36 |
axisymmetric main flow + injection | Stephan | FLUENT | 1 | January 19, 2006 11:43 |
Re: Heat transfer coefficient (from Main Forum) | Eugene | Phoenics | 0 | January 15, 2002 05:30 |
Main Star-CD Commands | Maxime Perelli | Siemens | 1 | April 17, 2001 08:35 |