|
[Sponsors] |
August 13, 2013, 11:28 |
how to put time folders in a unique folder
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
when run is doing a lot of time folders originate in the root folder of case.
in such situation may it take a lot of time to find essential folders 0,constant and system or maybe delete them mistakenly with other folders. how can have time folders in a separate folder? is there a script for this purpose?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 13, 2013, 12:39 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
What do you mean with find the essential folders? From the shell it is just "cd folder" right?
Did you consider improving your work flow with utilities pyFoamClearCase.py and pyFoamCloneCase.py? You can improve one of these utlities to do what you want. It seems not too difficult, add some function to the SolutionDirectory class, and create a new instance of this class in some fancy utility Or, of course you could try to move it with bash and fancy regular expressions. |
|
August 13, 2013, 12:52 |
|
#3 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
Hi Bernhard
none of them! I meant main folders that are :0,constant and system. I mean that if all other time folders could be written in a separate folder we had a more well-ordered case folder,then we had this folders:0,constant,system,time_folder that time_folder is a folder that includes all time folders after 0 time. do you mean I can do this by Swak utilities?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 13, 2013, 14:27 |
|
#4 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
If you are really, really, really sure that you want to do this, then try the following, which ought to work:
Code:
mkdir time_folders list=`ls -d [0-9]* | grep -v "^0$"` mv $list time_folders/. Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
August 13, 2013, 15:00 |
|
#5 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
Hi Niels
thanks for the script but I like a way that it can be done automatically with the solver itself.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 13, 2013, 15:07 |
|
#6 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
If that should be done nicely, then it means that you need to change the core of OpenFoam. Also, you would need to modify paraFoam/ParaView to be able to visualise data.
Depending on how you approach the above, you might need to put "if's" into all utilities/solvers, as the 0-folder and all other time folders have a different relative path to the root-case directory. Shortly: Why don't you merely learn to work with the existing file structure? 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 13, 2013, 15:17 |
|
#7 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
then there is a lot of work to do that.I just said that it would be better if the root folder was less crowded! whats your opinion?
I think maybe they do it in later releases.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 14, 2013, 03:59 |
|
#8 |
New Member
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17 |
Maybe you could use a function object with your controlDict. I use this with some success to reduce the number of files created at runtime to only the latest.
sysCall2 { type systemCall; functionObjectLibs ( "libsystemCall.so" ); executeCalls 0(); endCalls 0(); writeCalls 2("ls -1td $PWD/_impellerSurfacePressure/* | tail -n +3 | xargs echo rm -rf" "ls -1td $PWD/_impellerSurfacePressure/* | tail -n +3 | xargs rm -rf"); outputControl outputTime; // outputInterval 10; }
__________________
Regards, Per |
|
August 14, 2013, 05:39 |
|
#9 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
Hi
seems be nice,could you explain its lines a bit to me?thanks.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 14, 2013, 06:03 |
|
#10 |
New Member
PA
Join Date: Mar 2009
Posts: 25
Rep Power: 17 |
Typing --help after the different linux commands usually gets you a long way in linux.
It may be faster for you to try the lines below than me trying to explain. ls -1td <OF case folder> ls -1td <OF case folder> | tail -n +3 (try varying the number 3) ls -1td <OF case folder> | tail -n +3 | xargs echo rm -rf (echo just ensures that you don't delete anything by mistake) The above is called twice in my function object just to get some output with 'echo'. Not the most beautiful approach but it worked for me. Regarding function object see http://openfoamwiki.net/index.php/Ti...ect_systemCall
__________________
Regards, Per |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TimeVaryingMappedFixedValue | irishdave | OpenFOAM Running, Solving & CFD | 32 | June 16, 2021 07:55 |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 05:13 |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
calculation diverge after continue to run | zhajingjing | OpenFOAM | 0 | April 28, 2010 05:35 |
Modeling in micron scale using icoFoam | m9819348 | OpenFOAM Running, Solving & CFD | 7 | October 27, 2007 01:36 |