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

perl script error (looping)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2009, 13:47
Default perl script error (looping)
  #1
New Member
 
al mazdeh
Join Date: Mar 2009
Posts: 16
Rep Power: 17
amazdeh is on a distinguished road
Can anyone show me how to loop through files in perl? Or cfx
I know how to use loops-but I like to apply it on files with names in numeric orders foe exampleslike

PLATEJET_InCompress_1.def
PLATEJET_InCompress_2.def
PLATEJET_InCompress_3.def


I wrote a script file- that gives me one error when it tries to rewrite the file after each loop- i have highlighed it below


COMMAND FILE:
CFX Pre Version = 11.0
END


!$num_files = 2;
! for ($i=0; $i < $num_files; $i++) {
! $n = $i + 1;
! $filename = "PLATEJET_InCompress_" . $n . ".def";
>load filename=$filename , mode=def, recoverSession=no, replaceFlow=yes, overwrite=yes > update
>importccl filename=change.ccl, mode = append, autoLoadLibrary = none

>writeCaseFile filename = "PLATEJET_InCompress_" . $n . ".def", operation=write \
solver file
> update


>close, deleteLibrary = On
> update
!}
amazdeh is offline   Reply With Quote

Reply


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
Perl script for intialisation pratik mehta CFX 2 September 10, 2008 04:09
Is Perl installed with CFX? Rikio CFX 4 May 28, 2008 04:33
Solver Control via .pre file with Perl script ahlo CFX 1 March 7, 2008 13:33
Time-steps via Perl in CCL Rui CFX 5 March 29, 2004 01:47
linking the script Mavinakere FLUENT 0 September 12, 2002 12:57


All times are GMT -4. The time now is 20:48.