CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > CFX

command editor

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 15, 2009, 12:37
Default command editor
  #1
New Member
 
Join Date: Jul 2009
Posts: 6
Rep Power: 9
fkonias is on a distinguished road
Hi all,
I am trying to create some sessions of my own in the command editor, but I do not know the commands and some general stuff…

1) Is there a command like Fortran’s “do”?

2) for example I wrote :

DATA READER:
CASE:Case 50_202pN_001
DOMAIN:Apomastefsi S3
Components to Ignore = Apomastefsi S3
Components to Update =
END
END
END

This works fine. But when I load a different case which means different case name (“Case 50_202pN_001” ), then as expected there are errors! I tried to replace the “Case 50_202pN_001” with “$case” but it didn’t work. Is there a way to bypass this problem? Is there a way to make these lines compatible with ANY case without changing the case name manually?

Thanks a lot
fkonias
fkonias is offline   Reply With Quote

Old   July 15, 2009, 12:52
Default
  #2
LKF
New Member
 
Join Date: Mar 2009
Posts: 16
Rep Power: 9
LKF is on a distinguished road
Hi,

I'm not familiar with 'CASE' but the following should let you loop through a series of commands for a list of different files (I've assumed that 'Case 50_202pN_001' is a res file).

Code:
!foreach $case('Case 50_202pN_001.res', ...)
!{
DATA READER:
CASE:$case
DOMAIN:Apomastefsi S3
Components to Ignore = Apomastefsi S3
Components to Update =
END
END
END
!}
Inthe sample code above, the '!' is required at the start of each code line. Perl variables, functions, commands will work following the !.

To create your own session file, I think the best bet is to record one in POST and then edit it in a command editor. This will allow you to see the commands and then you can just tweak it with your own variables and loops, etc.

I learned a little bit of the coding required to make my own session files through ANSYS training, so I'm not familiar with what content is in the documentation, but I'm sure you'll find some.

Hope this helps a bit.
LKF is offline   Reply With Quote

Old   July 16, 2009, 08:56
Default
  #3
New Member
 
Join Date: Jul 2009
Posts: 6
Rep Power: 9
fkonias is on a distinguished road
Thank you for your replay, but I am not quite sure how to use this!
It looks like it’s a kind of a loop, which is repeated for all ‘things’ in the parenthesis. Am I right? Well this is something else that I might be able to use somewhere else, but it’s not what I was looking for this time. I just want to replace “Case 50_202pN_001” with a “skeleton key”. Like when we write *.* if that is possible.
fkonias is offline   Reply With Quote

Old   July 16, 2009, 19:31
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 12,412
Rep Power: 97
ghorrocks is a jewel in the roughghorrocks is a jewel in the roughghorrocks is a jewel in the rough
Hi,

The for loop in LKF's example is a perl script. CFX supports perl in some of its transcript files. Read the documentation on scripting in CFX or look at the web for references on perl such as http://www.perl.org/

Glenn Horrocks
ghorrocks is offline   Reply With Quote

Old   July 21, 2009, 22:47
Default
  #5
Senior Member
 
Rogerio Jack
Join Date: Mar 2009
Location: Brazil
Posts: 100
Rep Power: 8
rogbrito is an unknown quantity at this point
Send a message via Skype™ to rogbrito
a good book: R. Schwartz and T. Phoenix, Learning Perl, Ed. O'Reilly. At Amazon dot com:

http://www.amazon.com/Learning-Perl-...8230978&sr=8-1
rogbrito is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:06.