|
[Sponsors] |
February 1, 2013, 05:34 |
Problem with using runtime().path
|
#1 |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18 |
I'm writing a utility and I want to plot some graphs, for the path I need runTime.path() but where I need it somewhere else than the main file.
Assume the structure is like this: utility.C // being the main file #include "aux.H" #include "createTime.H" aux.C // where I defined a class to be used in utility #include "graph.H" Now I need to have runTime in aux.C but if I include it there compiler complains as: error: incomplete type ‘Foam::Time’ used in nested name specifier any idea? |
|
February 2, 2013, 08:14 |
|
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Greetings Mahdi,
Could you please create and share a simple utility that shows this? Because your description is reaaaally too vague. The problem could be one of several possibilities and listing them all could lead someone to the brink of despair... Best regards, Bruno
__________________
|
|
February 3, 2013, 15:40 |
|
#3 |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18 |
I did over simplified the files.
I have commented a line in file cGen.C, that is the problem I'm facing. |
|
February 3, 2013, 17:16 |
|
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Hi Mahdi,
Attached is the modified code. I removed some "*~" files, to avoid confusion. The solution is simple: when constructing an instance of the class, simply give it the reference path for it to keep a copy of it. Then it can be used whenever needed. In "applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C" you can find more examples of this kind of manipulations, as well as how to create and remove folders. Best regards, Bruno
__________________
|
|
February 5, 2013, 09:08 |
|
#5 |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18 |
What do you think by passing whole runTime object?
for the moment I need graph setup of runTime (which is manually set to "raw" for the moment) and by developing more I may need timeName(). Is it a bad idea? |
|
February 5, 2013, 09:51 |
|
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128 |
Honestly I don't know if it's good or bad. I suggest that you try it.
If it breaks with using the full object, then you'll know that maybe it's better to give only the strictly necessary information
__________________
|
|
February 5, 2013, 10:26 |
|
#7 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Mahdi,
I have previously been passing the full runTime (class Time) as Code:
const Time & t_ Kind regards, Niels |
|
February 5, 2013, 11:28 |
|
#8 |
Senior Member
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18 |
Thank you gentlemen for your time. It was really helpful to me
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Gambit - meshing over airfoil wrapping (?) problem | JFDC | FLUENT | 1 | July 11, 2011 06:59 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |
Is this problem well posed? | Thomas P. Abraham | Main CFD Forum | 5 | September 8, 1999 15:52 |