CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Cloning a case without the GUI using cloneCase function

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2006, 15:50
Default Hello, this is my first attemp
  #1
New Member
 
Santiago Giraldo
Join Date: Mar 2009
Location: Edmonton, Alberta, Canada
Posts: 5
Rep Power: 17
muerzo is on a distinguished road
Hello, this is my first attempt in the "thread" world you have here, I've seen pretty useful things, but nothing about this.
I don't know if i'm looking in the wrong thread... anyway...sorry if i am, I need to clone a case straight from the code, without using FoamX->Clone Case app.

I need this because I'm working with a slightly modified version of icoFoam that allows me to change BC's; Once a BC has changed, I pretend to set up a new cloned case and just edit the changed BC's, run the solver again, keeping the old case running in another process in the background, and starting to run the new one (the cloned one).
I know I'm a OpenFOAM beginner, and probably asking way more over me.. but does anyone know how to do it??
I've been checking the FoamX.C code, and theres a function

" void FoamXServer::CaseBrowser::ICaseBrowser_stub::clone Case( const FoamXServer::CaseDescriptor& _par_caseDesc, const char* _par_newCaseRootDir, const char* _par_newCaseName, const char* _par_newAppClassName, const char* _par_timeSel ) "

that i think is the one responsible for that, but i'm not quite sure which is the FoamXServer::CaseDescriptor& and how to obtain it.
Remember.. anything but using the GUI..thanks so much.
muerzo is offline   Reply With Quote

Old   September 26, 2006, 04:57
Default Can't you just do a 'cp' inste
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Can't you just do a 'cp' instead? Just call e.g. system("cp -r cavity-orig cavity")

(Or use the 'cp' function in OSspecific.H but that has a bug in it in 1.3 when copying subdirectories)
mattijs is offline   Reply With Quote

Old   September 26, 2006, 12:14
Default Thanks Matttijs for the quick
  #3
New Member
 
Santiago Giraldo
Join Date: Mar 2009
Location: Edmonton, Alberta, Canada
Posts: 5
Rep Power: 17
muerzo is on a distinguished road
Thanks Matttijs for the quick response, but is there no way to do it the way I intend to? the system calls were the thing i didn't want to do, but probably I'll end up doing that. Thanks again.

Even so, do you know how can i obtain the information from the caseDescriptor?

Thanks a lot,
muerzo is offline   Reply With Quote

Old   September 27, 2006, 04:17
Default caseDescriptor : see idl/FoamX
  #4
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
caseDescriptor : see idl/FoamX.idl in the FoamX source directory. In the ICaseBrowserImpl.C there are enough examples how to use it.
mattijs is offline   Reply With Quote

Old   September 27, 2006, 13:35
Default Thanks again, I'll look into i
  #5
New Member
 
Santiago Giraldo
Join Date: Mar 2009
Location: Edmonton, Alberta, Canada
Posts: 5
Rep Power: 17
muerzo is on a distinguished road
Thanks again, I'll look into it...
muerzo is offline   Reply With Quote

Old   September 27, 2006, 16:44
Default Hi again, I'm still not there
  #6
New Member
 
Santiago Giraldo
Join Date: Mar 2009
Location: Edmonton, Alberta, Canada
Posts: 5
Rep Power: 17
muerzo is on a distinguished road
Hi again, I'm still not there yet, I checked the code you told me to.
In the FoamX.idl file (which is newer than C++ to me...*sigh*) they define CaseDescriptor as a structure, ok so far.
Then in the ICaseBrowserImpl.C caseDescriptor is mentioned in several functions, in the .H file one can see how its created ( I think, please correct me if I'm wrong)

FoamXServer::CaseDescriptor* FoamX::ICaseBrowserImpl::caseDescriptor
(
const fileName& rootDir,
const fileName& rawRootDir,
const fileName& caseName
)

That in the ICaseBrowserImpl.C file. The questions remain: is this created when FoamX is started, or when i double click on a case? how can I have the caseDescriptor available for me without starting FoamX? any piece of advice to have a function or something that returns me this?

Sorry for the persistence, thanks!

PS. Why in FoamX.C the cloneCase funtion is called like this:

void FoamXServer::CaseBrowser::ICaseBrowser_stub::clone Case(...)

why a stub.. hehe and what does that mean?
muerzo is offline   Reply With Quote

Old   September 29, 2006, 05:51
Default This is all Corba stuff. Haven
  #7
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
This is all Corba stuff. Haven't looked at it for a while. If you insist on going this way have a look at IHostBrowserImpl::openCaseBrowser. This function gets called by the Java client when you click on a machine.

So you'll have to do something similar, then get the reference of the started caseBrowser from the name server ('nsd', has to be running) and then you'll be able to construct one of those caseDescriptors and call cloneCase somehow.
mattijs is offline   Reply With Quote

Old   September 29, 2006, 12:07
Default Thanks.. I will look into it..
  #8
New Member
 
Santiago Giraldo
Join Date: Mar 2009
Location: Edmonton, Alberta, Canada
Posts: 5
Rep Power: 17
muerzo is on a distinguished road
Thanks.. I will look into it... probably it will take me a while, so thanks a lot for the really useful tips you have given me. Will be back with more questions.. hehe
muerzo is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New BC for the case ivanyao OpenFOAM Running, Solving & CFD 1 October 29, 2008 05:04
Cloning a case or creating a new case for 16 processes mellanoxuser OpenFOAM Running, Solving & CFD 0 February 8, 2008 17:52
Problem seeing new case in case browser alan_fergus OpenFOAM Pre-Processing 9 June 22, 2006 04:46
Stream Function - Potential Function coordinates harish Main CFD Forum 8 June 25, 2005 14:18
Cloning a case from the command line Daniele Panara (Panara) OpenFOAM Pre-Processing 2 February 1, 2005 10:58


All times are GMT -4. The time now is 05:51.