How to retrieve thread id by name
hi guys, does anybody of you know a good method to retrieve the id of a thread (you know, those shown in the boundary conditions panel) if I only know the name of the thread (e.g. ground)? I have to implement a function like
int thread_id = getThreadIDByName("ground"); but I have absolutely no idea how to get the id of "ground" without taking a look into the boundary conditions panel and adjust the sources. thanks for any help thomas |
Re: How to retrieve thread id by name
by typing :
surface list into the tui you get all idīs to all names. hope that helps |
Re: How to retrieve thread id by name
definitely helps. but do you know a way to call this from within the source code (I was thinking about doing this via CX_Interpret_String(char *) ) so that you can access the output? I was thinking about writing a *.fluent file that starts a transscript and cutting out the needed information from the generated file, but I want everything to happen automatically when I load the case into fluent and still don't know how to realise this best...
|
Re: How to retrieve thread id by name
sorry i canīt help you with that.
|
Hi Thomas!
Did you solve the problem of getting the thread ID from the name? I have exactly the same problem now... Thanks in advance! |
Quote:
real ground_id; CX_Interpret_String("(if(not(rp-var-object 'ground-id))(rp-var-define 'ground-id -1 'integer #f) ())"); CX_Interpret_String("(if (zone-name->id 'ground)(rpsetvar 'ground-id (zone-name->id 'ground))(rpsetvar 'ground-id -1))"); ground_id=RP_Get_Integer("ground-id"); Note: The above code doesn't work in parallel solver. You need to use auto-load scheme file. For Fluent 12.1, you can loop over all the thread in you domain and use THREAD_NAME to judge whether the thread name is same as you specified. Then use THREAD_ID to get its id. |
Quote:
I use Fluent 13 in parallel, do you mean that I can use THREAD_NAME(t) instead of THREAD_ID(t) in my loop? For example to access my cells in zone n: thread_loop_c (t,domain) { if ( NULL != THREAD_STORAGE(t,SV_T_G) ) { begin_c_loop (c,t) { if(THREAD_NAME(t) == "n") { } } end_c_loop (c,t) } } It doesn't seems to work, maybe I misunderstood you... Thanks for your help! |
Quote:
|
Interesting, a long way since this posting started. Now ANSYS 2021academic, just looking if any developments have occurred. Whether above code will work with parallel processing or not.
|
Quote:
/surface> list-surfaces surface group name id points 0D facets 1D facets 2D facets ------------------------- ---- --------- ---------- ----------- ----------- cylinder 0 0 0 0 0 inlet 2 0 0 0 0 int_fluid 3 0 0 0 0 outlet 1 0 0 0 0 x0 4 0 0 0 0 Total: 0 points, 0 facets. |
All times are GMT -4. The time now is 09:53. |