Selection of surface-type through TUI

Selection of surface type through TUI is very useful especially in cases where there are hundreds of point-surfaces or plane-surfaces.
Following three scheme files would allow an user to select surface type through TUI. The scheme files contain notes which explain the usuage of each one.


**************************************************************************************************
rep1.scm
******************************************************************************************************

;;;This scheme file allows the user to select surface-type through TUI,
;;;on which net value of a scalar variable have to be reported.
;;;
;;;The usuage of which is as follows:
;;;
;;;(report 'su-ve-av 'point-surf 'pre)
;;;
;;;where su-ve-av---> represents TUI command for "surface-vertex-avg"
;;;point-surf ---->point-surface
;;;pre--->"pressure"
;;;examples:
;;;1surface-vertex-avg-->(report 'su-ve-av 'point-surf 'tem)
;;;2)surface-facet-avg--->(report 'su-fa-av 'point-surf 'tem)
;;;3)plane-surface--->(report 'su-fa-av 'plane-surf 'tem)


(define report
(lambda (rep-type surf-type quantity)
(ti-menu-load-string (format #f "re ~a ~a ~a"
rep-type
(inquire-surface-group-names-of-type surf-type)
quantity))))


*********************************************************************************************************


*****************************************************************************************
rep2.scm
*****************************************************************************************

;;;This scheme file allows the user to select surface-type through TUI,
;;;on which individual value as well the net value of a scalar
;;;variable have to be reported.
;;;
;;;The usuage of which is as follows:
;;;
;;;(report-ind 'su-ve-av 'point-surf 'pre)
;;;
;;;where su-ve-av---> represents TUI command for "surface-vertex-avg"
;;;point-surf ---->point-surface
;;;pre--->"pressure"
;;;examples:
;;;1surface-vertex-avg-->(report-ind 'su-ve-av 'point-surf 'tem)
;;;2)surface-facet-avg--->(report-ind 'su-fa-av 'point-surf 'tem)


(define report-ind
(lambda (rep-type surf-type quantity)
(let ((s-list (inquire-surface-group-names-of-type surf-type)))
(for-each (lambda (sid)
(ti-menu-load-string (format #f "re ~a ~a () ~a" rep-type
sid quantity)))
s-list)
(ti-menu-load-string (format #f "re ~a ~a ~a" rep-type s-list
quantity)))))

**********************************************************************************************************




*****************************************************************************************************************
rep3.scm
********************************************************************************************************************
;;;This scheme file reports "surafce-vertex-average" on any surface
;;;whose names are p1,p2,p3,....pn.
;;;
;;;Following are the inputs given through TUI
;;;1)first surface number--->p1
;;;2)Last surface number--->"n"

;;;The usuage of which is as follows:
;;;
;;;(report-point 1 4 "pre")
;;;
;;;where 1---> represents first point/plane surface number ("p1")
;;; 4--->last surface number ("p4")
;;;pre--->"pressure"



(define (report-point a1 a2 string)
(define tmpstr "re su-ve-avg (")
(do ((i a1 (+ 1 i)))
((= i (+ a2 1)))
(set! tmpstr (string-append tmpstr "p" (number->string i) " ")))
(set! tmpstr (string-append tmpstr ")" string))
(ti-menu-load-string tmpstr)
)


;;;NOTE:

;;;1)The scheme part is pretty simple and can be modified as required. For instance if
;;;"surface-facet-average" is required please change in the second line
;;; (define tmpstr "re su-ve-avg (")-----> (define tmpstr "re su-fac-avg (")

;;;2)If the name of point/plane surface starts with "W"
;;;change (set! tmpstr (string-append tmpstr "p" (number->string i) " "))) to
;;;(set! tmpstr (string-append tmpstr "W" (number->string i) " ")))


;;;3)The names of the point/plane-surfaces should be in sequence,in the sense
;;; p1,p2,p4 would give an error.


************************************************************************************************************************************





Show Form
No comments yet. Be the first to add a comment!