CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

a question fo scheme

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2011, 04:18
Default a question fo scheme
  #1
New Member
 
zhjieli
Join Date: Sep 2011
Posts: 3
Rep Power: 14
xiaomo is on a distinguished road
I have write scheme programe as this:
(define line1 (list 1 2 3 4 5 6 7 8 9))
(define l '())
(do ((i 0 (+ i 3))) ((> i (length line1)))
(set! l (append l (list (list-ref line1 i)) ))
)
when I read it in fluent ,occur this error
Error: CAR: invalid argument [1]: wrong type [not a pair]
Error Object: ()
but I defined that this programe' function was completed.

Please, someone can help me?
xiaomo is offline   Reply With Quote

Old   September 29, 2011, 12:00
Default
  #2
Member
 
fox000002's Avatar
 
Join Date: Apr 2009
Posts: 46
Rep Power: 17
fox000002 is on a distinguished road
List index start at 0.

The max valid index is

Code:
 (- (length l) 1)
In your code, the error occurs when the index is 9, which exceed the max index value.
fox000002 is offline   Reply With Quote

Old   September 30, 2011, 01:15
Default
  #3
New Member
 
zhjieli
Join Date: Sep 2011
Posts: 3
Rep Power: 14
xiaomo is on a distinguished road
thank!
You are warm-hearted man
xiaomo 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
extrapolation in MUSCL scheme Chandra Main CFD Forum 6 February 14, 2007 11:21
One Question on VOF Model Colin FLUENT 2 October 24, 2004 09:38
Question on Sediment Mass Conservation Scheme Wen Long Main CFD Forum 0 July 6, 2004 15:45
problem about numerical scheme in LES. libin Main CFD Forum 4 July 1, 2004 04:32
Scheme documentation and question Mickaël Perrin FLUENT 0 July 4, 2002 05:21


All times are GMT -4. The time now is 18:23.