text
stringlengths
0
39.3k
Release 2019 R3 - © ANSY S, Inc. All rights r eser ved. - Contains pr opr ietar y and c onfidential inf ormation
of ANSY S, Inc. and its subsidiar ies and affiliat es. 12Text User In terfaceOne c onsequenc e of this c onvenienc e is tha t filename pr ompts do not e valua te the r esponse . For e x-
ample , the sequenc e
> (define fn "valve.ps")
fn
> hc fn
will end up wr iting a pic ture file with the name fn, not valve.ps . Since the filename pr ompt did
not e valua te the r esponse ,fn did not get a chanc e to evalua te “valve.ps” as it w ould f or most
other pr ompts .
2.2.6. Lists
Some func tions in ANSY S Fluen t requir e a “list” of objec ts such as numb ers, strings , Booleans , and so
on. A list is a Scheme objec t tha t is simply a sequenc e of objec ts termina ted b y the empt y list ,’() .
Lists ar e pr ompt ed f or an elemen t at a time , and the end of the list is signaled b y en tering an empt y
list. This t ermina ting list f orms the tail of the pr ompt ed list , and c an either b e empt y or c an c ontain
values . For c onvenienc e, the empt y list c an b e en tered as () as w ell as the standar d form ’() . Normally ,
list pr ompts sa ve the pr evious ar gumen t list as the default. To mo dify the list , overwrite the desir ed
elemen ts and t ermina te the pr ocess with an empt y list. For e xample ,
element(1) [()] 1
element(2) [()] 10
element(3) [()] 100
element(4) [()] Enter
creates a list of thr ee numb ers: 1, 10, and 100. Subsequen tly,
element(1) [1] Enter
element(2) [10] Enter
element(3) [100] Enter
element(4) [()] 1000
element(5) [()] Enter
adds a f ourth elemen t.Then
element(1) [1] Enter
element(2) [10] Enter
element(3) [100] ()
leaves only 1 and 10 in the list. Subsequen tly en tering
element(1) [1] ,,’(11 12 13)
creates a fiv e elemen t list: 1, 10, 11, 12, and 13. Finally , a single empt y list r emo ves all elemen ts
element(1) [1] ()
13Release 2019 R3 - © ANSY S, Inc. All rights r eser ved. - Contains pr opr ietar y and c onfidential inf ormation
of ANSY S, Inc. and its subsidiar ies and affiliat es.Text Prompt S ystemA diff erent type of list , namely , a “list-of-sc alars” contains pick menu it ems (and not list it ems) f or which
a selec tion has t o be made fr om list ed quan tities , which ar e available a t the Enter prompt. Hence, a
list-of-sc alars c annot b e en tered as a list.
An example of a “list-of-sc alars” consists of the f ollowing:
2.2.7. Evalua tion
All responses t o pr ompts (e xcept filenames , see ab ove) ar e evalua ted b y the Scheme in terpreter b efore
they are used .You c an ther efore en ter an y valid Scheme e xpression as the r esponse t o a pr ompt. For
example , to en ter a unit v ector with one c omp onen t equal t o 1/3 (without using y our c alcula tor),
/foo> set-xy
x-component [1.0] (/ 1 3)
y-component [0.0] (sqrt (/ 8 9))
Release 2019 R3 - © ANSY S, Inc. All rights r eser ved. - Contains pr opr ietar y and c onfidential inf ormation
of ANSY S, Inc. and its subsidiar ies and affiliat es. 14Text User In terfaceor, you c ould first define a utilit y func tion t o comput e the sec ond c omp onen t of a unit v ector,
> (define (unit-y x) (sqrt (- 1.0 (* x x))))
unit-y
/foo> set-xy
x-component [1.0] (/ 1 3)
y-component [0.0] (unit-y (/ 1 3))
2.2.8. Default Value Binding
The default v alue a t an y pr ompt is b ound t o the Scheme symb ol “ _” (undersc ore) so tha t the default
value c an f orm par t of a Scheme e xpression. For e xample , if y ou w ant to decr ease a default v alue so
that it is one-thir d of the or iginal v alue , you c ould en ter
shrink-factor [0.8] (/ _ 3)
2.3. Interrupts
The e xecution of the c ode c an b e halt ed b y pr essing the Ctrl+c, at which time the pr esen t op eration
stops a t the ne xt recoverable lo cation.
2.4. System C ommands
The w ay you e xecut e sy stem c ommands with the ! (bang) shell esc ape char acter will b e sligh tly diff erent
for Linux and Windo ws systems .
For additional inf ormation, see the f ollowing sec tions:
2.4.1. System C ommands f or LINUX-based Op erating S ystems
2.4.2. System C ommands f or Windo ws-based Op erating S ystems
2.4.1. System C ommands f or LINUX-based Op erating S ystems
If you ar e running ANSY S Fluen t under a Linux-based op erating sy stem, all char acters f ollowing the !
up t o the ne xt newline char acter will b e execut ed in a subshell. Any fur ther input r elated t o these
system c ommands must b e en tered in the windo w in which y ou star ted the pr ogram, and an y scr een
output will also app ear in tha t windo w. (Note tha t if y ou star ted ANSY S Fluen t remot ely, this input
and output will b e in the windo w in which y ou star ted C ortex.)
> !rm junk.*
> !vi script.rp
!pwd and !ls will e xecut e the Linux c ommands in the dir ectory in which C ortex was star ted.The
screen output will app ear in the windo w in which y ou star ted ANSY S Fluen t, unless y ou star ted it r e-
mot ely, in which c ase the output will app ear in the windo w in which y ou star ted C ortex. (Note tha t
!cd execut es in a subshell, so it will not change the w orking dir ectory either f or ANSY S Fluen t or f or
Cortex, and is ther efore not useful.) Typing cd with no ar gumen ts will mo ve you t o your home dir ectory
in the c onsole .
15Release 2019 R3 - © ANSY S, Inc. All rights r eser ved. - Contains pr opr ietar y and c onfidential inf ormation
of ANSY S, Inc. and its subsidiar ies and affiliat es.System C ommandsANSY S Fluen t includes thr ee sy stem c ommand aliases ( pwd ,ls, and chdir ) tha t will b e execut ed in
your w orking dir ectory with output displa yed in the ANSY S Fluen t console . Note tha t these aliases will
invoke the c orresponding Linux c ommands with r espect to the par ent dir ectory of the c ase file . For
example ,pwd prints the par ent dir ectory of the c ase file in the ANSY S Fluen t console , while !pwd
prints the dir ectory from which y ou star ted ANSY S Fluen t in the Linux shell windo w wher e you star ted
ANSY S Fluen t.
Several examples of sy stem c ommands en tered in the c onsole ar e sho wn b elow.The scr een output
that will app ear in the windo w in which ANSY S Fluen t was star ted (or , if y ou star ted the pr ogram r e-
mot ely, in the windo w in which C ortex was star ted) f ollows the e xamples .
Example input (in the ANSY S Fluen t console):
> !pwd
> !ls valve*.*
Example output (in the windo w in which ANSY S Fluen t— or C ortex, if y ou star ted the pr ogram r e-
mot ely—w as star ted):
/home/cfd/run/valve
valve1.cas valve1.msh valve2.cas valve2.msh
2.4.2. System C ommands f or Windo ws-based Op erating S ystems