Problem with using runtime().path
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? |
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... :rolleyes: Best regards, Bruno |
1 Attachment(s)
I did over simplified the files.
I have commented a line in file cGen.C, that is the problem I'm facing. |
1 Attachment(s)
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 |
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? |
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 ;) |
Hi Mahdi,
I have previously been passing the full runTime (class Time) as Code:
const Time & t_ Kind regards, Niels |
Thank you gentlemen for your time. It was really helpful to me
|
All times are GMT -4. The time now is 01:33. |