|
[Sponsors] |
July 24, 2012, 10:30 |
Question about ICEM script failure
|
#1 |
Senior Member
lnk
Join Date: Feb 2011
Location: Switzerland
Posts: 118
Rep Power: 15 |
Hi everyone,
May I ask why the following script doesn't work? ' set a 2.5 set b (sqrt(pi*$a*$a)*0.5) ic_undo_group_begin ic_geo_new_family GEOM ic_boco_set_part_color GEOM ic_empty_tetin ic_point {} GEOM pnt.00 0,0,$b ic_undo_group_end ' but this works ' set a 2.5 set b (sqrt(pi*$a*$a)*0.5) ic_undo_group_begin ic_geo_new_family GEOM ic_boco_set_part_color GEOM ic_empty_tetin ic_point {} GEOM pnt.00 0,0,0 ic_undo_group_end ' Best regard and many thanks, lnk Last edited by lnk; July 29, 2012 at 11:27. |
|
July 24, 2012, 11:22 |
|
#3 |
Senior Member
lnk
Join Date: Feb 2011
Location: Switzerland
Posts: 118
Rep Power: 15 |
||
July 29, 2012, 10:19 |
|
#4 |
Senior Member
Stuart Buckingham
Join Date: May 2010
Location: United Kingdom
Posts: 267
Rep Power: 26 |
Hi Ink,
You need to understand that the programming language used for ICEM is LISP. LISP is different to many other common languages (c, python, fortran, java etc) in the way that functions are used. The simple 1 + 2 + 3 + 4 is lisp is actually (+ 1 2 3 4) i.e. the operator (+) goes at the start followed by the arguements (1 2 3 4). If you do a quick google for LISP programming, I'm sure you will find some great guides. The only piece of advice I will offer is that multiply CANNOT multiply more than two values, ie 2 * 3 * 4 * 5 CANNOT be written in LISP as (MULT 2 3 4 5). The easiest way to do this is to nest the multiplications, giving: (MULT (MULT 2 3) (MULT 4 5)). Obviously the inner multiplications are equated first, then the outer one gives the final value. This is the same as (2 * 3) * (4 * 5). Stu |
|
July 29, 2012, 11:03 |
|
#5 |
Senior Member
|
||
July 29, 2012, 11:15 |
|
#6 |
Senior Member
Stuart Buckingham
Join Date: May 2010
Location: United Kingdom
Posts: 267
Rep Power: 26 |
Hahaha, sorry it's late and I'm tired :-(. I was thinking Fluent. Fluent's scripting langauge is LISP, ICEM uses Tcl/Tk. In Tcl you use the expr function to evaluate maths functions.
For example: set aft_angle [expr { (22000+(1-$steer_param)*1530)/$radius }] |
|
July 29, 2012, 11:30 |
|
#7 |
Senior Member
lnk
Join Date: Feb 2011
Location: Switzerland
Posts: 118
Rep Power: 15 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
internal field question - PitzDaily Case | atareen64 | OpenFOAM Running, Solving & CFD | 2 | January 26, 2011 16:26 |
Question about Table applicaiton. | universez | OpenFOAM Running, Solving & CFD | 0 | January 12, 2010 21:31 |
[ICEM] Building topology command script files | Anorky | ANSYS Meshing & Geometry | 8 | January 11, 2010 08:25 |
Poisson Solver question | Suresh | Main CFD Forum | 3 | August 12, 2005 05:37 |
awk script question | awk script question | Main CFD Forum | 0 | March 28, 2005 03:06 |