CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > ANSYS Meshing & Geometry

[ICEM] Building topology command script files

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2009, 06:34
Default Building topology command script files
  #1
Member
 
Join Date: Mar 2009
Posts: 52
Rep Power: 17
Anorky is on a distinguished road
Hi everyone,

I have a question concerning the topology building for the geometry.
As already mentioned in my previous posts, I'm currently scripting the geometry, blocking and meshing.

When topology is build and this is recorded by the replay function the commands look like:

ic_undo_group_begin
ic_geo_delete_unattached { "LIST CONTAINING ALL PARTS" } 0 1
ic_build_topo 0.02 -angle 30 -no_concat "LIST CONTAINING ALL PARTS"
ic_geo_delete_unattached { "LIST CONTAINING ALL PARTS"}
ic_undo_group_end

The "LIST CONTAINING ALL PARTS" is automatically constructed when building the topology and recording and is valid for that geometry.

I would like to know if it is possible to construct this list automatically depending on the current geometry opened.

I mean, my geometry changes from analysis to analysis. Not always the geometry contains the same parts resulting in an error when running the scripting files if some parts are missing or extra parts are included.

If the list could be made automatically, the resulting script file would be a lot more variable. Otherwise, I have to record the topology building for all possible geometrical situations...

If I didn't make my question clear don't hesitate to tell me!

Thanks for reading my post and a happy christmas to all of you!
Anorky is offline   Reply With Quote

Old   December 24, 2009, 12:27
Default Yes it is possible.
  #2
Senior Member
 
PSYMN's Avatar
 
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,663
Blog Entries: 1
Rep Power: 47
PSYMN has a spectacular aura aboutPSYMN has a spectacular aura about
Yes, it is possible. There is a command to find all the parts in a model, you can set that into an array and then use the $array in the other command... Email me a reminder and I will get the command for you in the new year... Or you could look for it in the programmers guide...

Simon
PSYMN is offline   Reply With Quote

Old   January 6, 2010, 11:59
Default Code...
  #3
Senior Member
 
PSYMN's Avatar
 
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,663
Blog Entries: 1
Rep Power: 47
PSYMN has a spectacular aura aboutPSYMN has a spectacular aura about
There are many different ways to do this (search help => programmers guide for "family" to see how many different ic_ commands there are), so I asked a developer what he thought would be the best way, and this is what he sent me.



The following 2 lines should work for geometry, mesh and blocking parts. The variable “parts” contains all existing part names , which are visible in the moment and/or set to “on” in the tree.

set parts ""
foreach f [array names fam_visible] { if $fam_visible($f) { append parts “$f “ } }

You can use the variable parts like:
ic_build_topo 0.006 -angle 30 -no_concat -new_family $parts


I hope this helps...
PSYMN is offline   Reply With Quote

Old   January 6, 2010, 12:12
Default For all existing parts...
  #4
Senior Member
 
PSYMN's Avatar
 
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,663
Blog Entries: 1
Rep Power: 47
PSYMN has a spectacular aura aboutPSYMN has a spectacular aura about
Oh yea, to get all existing parts use:
foreach f [array names fam_visible] { append parts “$f “ }
PSYMN is offline   Reply With Quote

Old   January 7, 2010, 08:42
Default You are a Genius
  #5
Member
 
Join Date: Mar 2009
Posts: 52
Rep Power: 17
Anorky is on a distinguished road
Hi Simon,

Thanks for the help, you are a genius!!

Kind regards,
K
Anorky is offline   Reply With Quote

Old   January 7, 2010, 09:40
Default You are a Genius
  #6
Member
 
Join Date: Mar 2009
Posts: 52
Rep Power: 17
Anorky is on a distinguished road
Hi Simon,

Thanks for the help, you are a genius!!

Kind regards,
K
Anorky is offline   Reply With Quote

Old   January 7, 2010, 18:00
Default
  #7
Senior Member
 
PSYMN's Avatar
 
Simon Pereira
Join Date: Mar 2009
Location: Ann Arbor, MI
Posts: 2,663
Blog Entries: 1
Rep Power: 47
PSYMN has a spectacular aura aboutPSYMN has a spectacular aura about
Nope, not a genius, just smarter than the average bear.

But I do work with a lot of really smart people (it is really quite humbling), one of whom supplied this solution (this is easy stuff for him).
PSYMN is offline   Reply With Quote

Old   January 11, 2010, 06:50
Default Usage: TMP_BSP_FAM [ materials ]
  #8
Member
 
Join Date: Mar 2009
Posts: 52
Rep Power: 17
Anorky is on a distinguished road
Hi Simon,

I was wondering if you would know what is/ could be causing the following error:

Error in replay of source $scriptname
Usage: TMP_BSP_FAM [ materials ]

When I use the code you provided above in a replay file or script only blocking a part of my geometry everything works fine. Thus if I only run this script no problems occur.
But when I use this commmand in the same script that is called to run after some other blocking operations are done this error appears...
The structure looks like this in general:

1. Set some parameters
2. source $script 1 (geometry 1) when finished close project
3. source $script 2 (geometry 2) when finished close project
4. ...
5. source $script 5 (Blocking 1) when finished close project
6. source $script 6 (Blocking 2) when finished close project
7. ...
8. source $script 8 (script containing the commands in the above posts)


I only used the above command in the nr 8 script for blocking. When I run it like this the above mentioned error appears...

In the script I used it as follows:

#Place all the existing parts in a list
set listofparts ""
foreach f [array names fam_visible] { append listofparts "$f " }

#Initialize the 2D surface blocking
ic_undo_group_begin
ic_geo_new_family FLUID
ic_boco_set_part_color FLUID
eval ic_hex_surface_blocking FLUID -mapped -min_edge 0.0 -surfaces $LISTOFSURFACES
ic_hex_switch_blocking root
ic_hex_unblank_blocks
ic_hex_multi_grid_level
eval ic_hex_compute_mesh_size $listofparts FLUID
ic_hex_unstruct_face_type all_quads
ic_hex_switch_blocking root
ic_undo_group_end

Kind regards and thanks!!
Anorky is offline   Reply With Quote

Old   January 11, 2010, 08:25
Default Close project commands
  #9
Member
 
Join Date: Mar 2009
Posts: 52
Rep Power: 17
Anorky is on a distinguished road
Hi Simon,

I think it might have something to do with the close project commands I use...
I use the following commands to close the blocking:
ic_hex_unload_blocking
ic_geo_delete_family FLUID

And these for closing the geometry and remainder of the project:
ic_boco_unload
ic_csystem_display all 0
ic_csystem_set_current global
ic_unload_tetin
ic_empty_tetin
ic_geo_set_modified 0
ic_cart_is_loaded
ic_csystem_display all 0
ic_csystem_set_current global
ic_geo_set_modified 0

Up to this point in the scripts no mesh was created so there is no need to close that I imagine.

The "listofparts" made contains parts which aren't present in the geometry that is beeing blocked. But this parts of the geometry are made before the blocking process is started. I thougth that closing closing the project would suffice to avoid this but apperantly this is not the case. Do you see an error or missing commands in the list above?
The last list is also used to close the project when only geometry is created.

Thanks,
Anorky 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
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found piprus OpenFOAM Installation 22 February 25, 2010 14:43
Problems in compiling paraview in Suse 10.3 platform chiven OpenFOAM Installation 3 December 1, 2009 08:21
OpenFOAM15 paraFoam bug koen OpenFOAM Bugs 19 June 30, 2009 11:46
Compilation error OF1.5-dev on Suse10.3 darenyang OpenFOAM Installation 0 April 29, 2009 05:55
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 21:51


All times are GMT -4. The time now is 02:11.