CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS Meshing & Geometry (https://www.cfd-online.com/Forums/ansys-meshing/)
-   -   [ICEM] Scripting command: List of vertex numbers (https://www.cfd-online.com/Forums/ansys-meshing/162281-scripting-command-list-vertex-numbers.html)

makmarios November 7, 2015 11:48

Scripting command: List of vertex numbers
 
Hi,

I have created a script that creates an arbitrary number of roughness elements on a surface. For simplicity, let the surface be flat and the roughness elements rectangular. This procedure in ICEM is quite straightforward once one is accustomed to TCL and has used the record script command, and in addition I have complete control over the naming convention of geometric attributes. And then there comes the blocking issue. For this I create geometrical objects (points, curves and surfaces) around each rough. element using naming consistency so by choosing where to create blocks in just one I choose effectively for every element's vicinity. considering control over the geometry, I find it easier to follow a bottom to top strategy, since I do not have to split blocks and then delete a bunch of them. Unfortunately, ICEM doesn't like that. Not, one, bit. The indexing convention of the vertices is completely messed up, as after some point instead of {i j k} they appear to be like {i j k m:n ...} (i j k m n integers). This does not affect blocking, but it is a great pain when coming to choose edges for node distribution. As I said before, I have a consistent naming for the assisting for blocking geometrical objects, therefore I was aiming to spot the vertices I want by comparing all the vertices' locations with the point's location.

However, I cannot loop through the indices as they are completely inconsistent, and the numbering of the vertices is not continuous either. I would loop through them until I find the two vertices I need for each edge, but the script crashes when a vertex number that does not exist is used. But if I had a list of the vertex numbers, for which I ve been desperately searching , then I could loop through that list and I would be able to enjoy my days in the sun at last!

Thank u for your time.

bluebase November 9, 2015 08:25

Hi Marios,

unfortunately, i can't recall a function to list all vertices.
Maybe you can work around that problem with "ic_hex_get_block_vertices block_num". It returns all 8 vertex numbers of a block... You only need to know the block number. Where again i don't know a function to get all blocks. "ic_hex_get_vertex_blocks vertex_num" may be a further workaround. This function returns blocks attached to a certain vertex.
When you know the very first index vertex or block, you could loop recursively through all blocks and vertices to create a complete list of your own. This doesn't seem to be very elegant though...

With regards,
Sebastian

makmarios November 9, 2015 08:40

Thanks a lot for your answer. Yesterday night I found to implement your suggestion as follows:
#constructing vertex list
set listBlocks [ic_hex_list_block_numbers]
foreach iblock $listBlocks {
set listVertices [ic_hex_get_block_vertices $iblock]
foreach ivertex $listVertices {


}
}

As you said, this is not elegant at all, so it would be nice to find a more straightforward way

makmarios November 16, 2015 12:56

Ok, there is the straightforward way mentioned:

http://www.cfd-online.com/Forums/ans...ts-curves.html

http://www.cfd-online.com/Forums/ans...ng-meshes.html


All times are GMT -4. The time now is 15:41.