|
[Sponsors] |
December 31, 2004, 11:57 |
How to program TUI when prompts may vary?
|
#1 |
Guest
Posts: n/a
|
How is it best to program the Text User Interface given that the prompts may vary from situation to situation? For example in the program below, which does work, I read and analyze several different mesh files whose names contain a number that increments. In two places (they're commented) I have to add extra "dummy" operations to cause a known number of prompts so I can then answer them. Is there a less klunky way to do this???
(define filename1 "/file/read-case/ P:\a\fluent\20041227\multimesh9\\") (define filename2 "") (define filename3 "1") (define filename4 ".msh y") ; Later must answer y to "discard mesh" so need one to discard on first pass /file/read-case/ p:\a\fluent\simple.msh (define (analyze_flow) (ti-menu-load-string (string-append filename1 filename2 filename3 filename4)) (ti-menu-load-string "/define/boundary-conditions/velocity-inlet v_inlet n n y y n 1.22") (ti-menu-load-string "/solve/initialize/set-defaults pressure 0") (ti-menu-load-string "/solve/initialize/set-defaults x-velocity 0") (ti-menu-load-string "/solve/initialize/set-defaults y-velocity 0") ; Don't know if flow field exists so initialize (which may fail), iterate (which won't), reinitialize y (ti-menu-load-string "/solve/initialize/initialize-flow") (ti-menu-load-string "/solve/iterate 1") (ti-menu-load-string "/solve/initialize/initialize-flow y") (ti-menu-load-string "/display/set/contours/filled-contours? y") (ti-menu-load-string "/solve/iterate 1") (ti-menu-load-string "/display/contour pressure , ,") (ti-menu-load-string "/display/set/overlays? y") (ti-menu-load-string "/display/vector velocity mass-imbalance , , , ,") (ti-menu-load-string "/solve/iterate 5") (ti-menu-load-string "/display/contour pressure , ,") (ti-menu-load-string "/display/set/overlays? y") (ti-menu-load-string "/display/vector velocity mass-imbalance , , , ,") (ti-menu-load-string "/solve/iterate 40") (ti-menu-load-string "/display/contour pressure , ,") (ti-menu-load-string "/display/set/overlays? y") (ti-menu-load-string "/display/vector velocity mass-imbalance , , , ,") ) ; ; (define counter (lambda (n) (do ((i n (- i 1))) ((zero? i)) (set! filename2 (format #f "~a" i)) (analyze_flow) ))) ; (counter 3) |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chemkin Forums? PSR.f program help? | johnjohnmulley | Main CFD Forum | 2 | August 5, 2013 07:53 |
TUI Commands from GUI? | Carlos | FLUENT | 6 | May 22, 2013 18:05 |
Which opensource and free CAD program? | Xwang | Main CFD Forum | 1 | October 24, 2010 17:29 |
Update boundary conditions calculated by an external program | CedricVH | OpenFOAM | 2 | January 15, 2010 11:55 |
Define animate using TUI | Zurlugh | FLUENT | 1 | July 24, 2008 08:55 |