|
[Sponsors] |
UDF: Given coordinates, How to identify the cell? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 9, 2012, 17:35 |
|
#21 |
New Member
Bradley J
Join Date: Jul 2012
Location: Cincinnati, OH
Posts: 12
Rep Power: 14 |
Hello All.
I have tried running this code for a 2D axissymetric case and recieved this error: ..\..\src\find.c(14) : error C2100: illegal indirection ..\..\src\find.c(14) : error C2440: '=' : cannot convert from 'int' to 'CX_Cell_Id' this is line 14 cx_cell=*CX_Find_Cell_With_Point(pt); code: #include"udf.h" #include"cxndsearch.h" DEFINE_ON_DEMAND(find_cell) { #if !RP_HOST Domain *d; cell_t c; Thread *t; CX_Cell_Id cx_cell; real NV_VEC(pt); real c_centroid[ND_ND]; NV_D(pt,=,0.009995,0.000175,0.0); CX_Start_ND_Point_Search(); cx_cell=*CX_Find_Cell_With_Point(pt); CX_End_ND_Point_Search(); c=RP_CELL(&cx_cell); t=RP_THREAD(&cx_cell); C_CENTROID(c_centroid,c,t); Message("coordinate of the specified point: x=%g,y=%g\n",pt[0],pt[1]); Message("coordinate of the cell found: x=%g,y=%g\n",c_centroid[0],c_centroid[1]); #endif } |
|
August 24, 2012, 17:30 |
|
#22 |
New Member
Paul H
Join Date: Aug 2012
Posts: 1
Rep Power: 0 |
I'm having compilation issues too- tried to compile on windows and linux, the compiler complains about the the same line:
cx_cell=*CX_Find_Cell_With_Point(pt); Has anyone gotten this work? Any details on fluent version, environment? This seems like an extremely useful function. |
|
October 28, 2013, 09:13 |
|
#23 |
Member
Mat
Join Date: Jan 2012
Posts: 60
Rep Power: 14 |
Dear all,
I know is a bit a late, but it can be usefull for futur users. I suppose the function "CX_Find_Cell_With_Point" was available with the previous versions of Fluent (Actually, I used it with succes in Fluent 6.0, but it doesnt work with Fluent 14.5). If you want the same functionality, you can use the function "SV_locate_point" with the actual version of Fluent : Code:
... cell_t c; Thread *t; CX_Cell_Id *cx_cell; float pos[3]; ... SV_locate_point(pos, cx_cell); c = cx_cell->ct.c; t = cx_cell->ct.t; ... In the parallel case, I don't see another solution than doing the loop among the cell yourself, and communicate between the nodes. Best, Mat |
|
June 24, 2014, 14:21 |
|
#24 | |
New Member
Garvit Goel
Join Date: May 2014
Posts: 11
Rep Power: 12 |
Quote:
invalid type argument of unary * (have int) and warnings that - implicit declaration of function CX_Start_ND_Point_Search CX_Find_Cell_With_Point CX_End_ND_Point_Search Thanks a lot |
||
October 16, 2016, 02:32 |
|
#25 |
New Member
Join Date: Jun 2013
Posts: 18
Rep Power: 13 |
the source code of the higher version is seem to be changed.
the 'search' is a struct type whose variables are not illustrated yet. |
|
December 11, 2018, 07:58 |
What should be put between brackets
|
#26 |
New Member
Join Date: Oct 2009
Posts: 25
Rep Power: 17 |
What should be put between brackets in CX statemetns in a real code?
CX_Start_ND_Point_Search(ND_Search *, cxboolean do_domain, int t_id); CX_Find_Cell_With_Point(ND_Search *, float v[3]); CX_End_ND_Point_Search(ND_Search *) I would need a short example with the CX_... loop inside a code and CX_...(?) content. Last edited by jacek; December 12, 2018 at 05:48. |
|
August 15, 2022, 06:54 |
|
#27 | |
Member
George Pichurov
Join Date: Jul 2010
Posts: 52
Rep Power: 16 |
Quote:
You can loop to find the cell centre closest to the desired point. I have done that. But, in parallel computation (and resp. compilation) each partition assigned to a process loops through that loop and finds it own point, closest to the desired coordinate, but belonging to its partition. So I end up with n cells (where n is the number of processes=partitions) that are not necessary close to the desired coordinate. So we need one of two things: 1. Either find a way if a coordinate lies within a cell entity (within the boundaries of a cell), or 2. Find a way to loop by a host process and not by compute processes. However, the ID will be duplicate (for example cell number lets say 140 will exist in all partitions of a parallel run) |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Technical] How to identify cell neighbours | booz | OpenFOAM Meshing & Mesh Conversion | 59 | November 20, 2017 01:40 |
How to identify boundary cell and internal cell | dbxmcf | OpenFOAM Running, Solving & CFD | 2 | November 6, 2016 10:11 |
?? How to get cell center coordinates? | erica | FLUENT | 0 | May 11, 2005 23:02 |
identify Cell face | Sunlight007 | Siemens | 3 | August 30, 2003 06:30 |
How to get nodes coordinates for a certain cell ? | mikhail | FLUENT | 2 | November 1, 2000 11:18 |