# cell_t c from point coorfdinates UDF

 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 2, 2009, 10:06 cell_t c from point coorfdinates UDF #1 New Member   Andrea Di Carlo Join Date: Jun 2009 Posts: 2 Rep Power: 0 Dear all I'm new of this forum. Could you help me? I was written a UDF(FLUENT), I should obtain the cell_t c that contain a point of known coordinate (x,y,z). I'm going to better explain. From UDF manual I know there is the macro C_CENTROID(x,c,t) that from the knoledge of c and t give x,y,z coordinate of the cell centre. I would like to know if there is a macro that could do the opposite, know the point x,y,z that could return the number of cell that contain that point. Thank you very much

 June 2, 2009, 18:06 Use Find_bounding_cell #2 New Member   Bocliff Sutter Join Date: Jun 2009 Posts: 7 Rep Power: 9 Greetings, You can use the function: cell_t Find_bounding_cell(Domain *domain, real *x, Thread **t) You provide the domain pointer, the coordinates of the point, and it returns the cell_t index and the thread pointer. Include dpm_tools.h before using it. Regards, Bocliff Sutter

 June 2, 2009, 18:12 #3 New Member   Bocliff Sutter Join Date: Jun 2009 Posts: 7 Rep Power: 9 Make sure you do not call this from some cell loop as you will end up with n^2 algorithm... Bocliff Sutter "May your Yak live long"

 June 4, 2009, 09:13 cell_t c from point coorfdinates UDF Reply to Thread #4 New Member   Andrea Di Carlo Join Date: Jun 2009 Posts: 2 Rep Power: 0 Thank you very much Bocliff It works. You saved me from an nervous breakdown thnk you again

 October 15, 2012, 12:04 #5 New Member   Ian Maes Join Date: Oct 2011 Posts: 10 Rep Power: 7 Hi! I see the communication in this topic was ended in 2009, but could somebody type an example of the use of this function? Is it also possible in 3D and give coordinates of x,y and z to the function? Thank you in advance, Kind regards, Ian

 October 15, 2012, 12:39 Mhd #6 Member   payamfadaei Join Date: Oct 2012 Location: Mashhad/Iran Posts: 32 Rep Power: 6 hello my dear! I have a magnetic field in my flow and I read a lot of MHD tutorials but I am not able that in which format I should write this in c/c++ ....please if you have a similar c program me help. regards nasser likes this.

December 29, 2012, 17:28
#7
New Member

Nasser
Join Date: Dec 2012
Posts: 21
Rep Power: 5
Quote:
 Originally Posted by Payam89 hello my dear! I have a magnetic field in my flow and I read a lot of MHD tutorials but I am not able that in which format I should write this in c/c++ ....please if you have a similar c program me help. regards
hi
I have same problem , can you solve it my friends ?

 December 30, 2012, 02:40 #8 Senior Member   SSL Join Date: Oct 2012 Posts: 227 Rep Power: 7 Please share your equation. It's easy to write UDF for any equation.

 July 4, 2014, 06:44 #9 New Member   Garvit Goel Join Date: May 2014 Posts: 11 Rep Power: 4 Lets say I first loop over the entire domain and store cell_t c and thread *t for every cell. Can I later access a cell using these c and t? For eg i store cell_t c and thread *t of some cell in global variables c_global and t_global. Then in some other function I do C_CENTROID ( xc , c_global, t_global ); Will xc hold the centroid of that original cell? Thanks a lot garvit goel Imperial college

July 4, 2014, 12:05
#10
New Member

Garvit Goel
Join Date: May 2014
Posts: 11
Rep Power: 4
Quote:
 Originally Posted by Bocliff Make sure you do not call this from some cell loop as you will end up with n^2 algorithm... Bocliff Sutter "May your Yak live long"
Is it possible to obatin a n^1 or less algorithym?

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post touf Open Source Meshers: Gmsh, Netgen, CGNS, ... 2 December 10, 2007 03:27 Ralf Schmidt FLUENT 0 September 22, 2006 09:45 Ralf Schmidt FLUENT 0 September 21, 2006 11:32 Sam Bennett FLUENT 6 December 1, 2005 09:46 Chie Min CFX 5 July 12, 2001 23:19

All times are GMT -4. The time now is 12:32.