Posted Sat, 27 Feb 2016 17:46:45 GMT by Javier Gonzalez
Hello

I need to get the node number in a specific location of slice 1 in a 3D problem. I am trying to use the  IfmFindNodeAtXY function to get it, and then pass the node number to a query that obtains the budget flow at that node. I get the error "(BudgetQueryFlowAtNode): Node number out of range! Skipped...".

I've done the budget query using node numbers directly, and It works ok. Thus I'm guessing the error is in the call to IfmFindNodeAtXY.
I'm giving the  function the approximate coordinates of a node, and a tolerance. I know for certain there is a node within the range of coordinates and the distance passed to the function. The code is as follows:

int NodeNumber;
double dist;
double * pointer1;

dist = 7.0;
pointer1 = &dist;
NodeNumber = IfmFindNodeAtXY(pDoc, 352, 1715, pointer1);

I know the node is located at (x,y) = (352.6, 1715.7). Therefore can't understand why I get the error if I'm specifying a distance that would enclose it.

Doubts would be:

Does the IfmFindNodeAtXY function always return the node number in slice 1? If not, How the Z location has to be handled?
Am I right to assume that units of the argument dist* in IfmFindNodeAtXY are meters?
Is there another way to know node numbers without having to code it in IFM?
What is the best way to print to the Feflow Log panel the results for that NodeNumber assignment in order to be able to debug it? Is it the same if the value to print would be another variable of double type?

Thanks,
Javier
Posted Mon, 29 Feb 2016 17:26:54 GMT by Carlos Andres Rivera Villarreyes Global Product Specialist - FEFLOW
Hi Javier,

I have double checked the function. It properly returns a node number. I think your problem is the coordinate system. FEFLOW works with the local coordinate system, thus you will need to subtract the origin (X,Y) to the coordinates before you pass these values to the IfmFindNodeAtXY function.

node = IfmFindNodeAtXY(m_pDoc, 352, 1715, pointer1);
IfmInfo(m_pDoc, "Node: %i", node);

The second statement will print the number on the Log panel. After FEFLOW 6.2 (p12), we introduced two more functions for searching nodes or elements:

  int       (*findElementAtXYZ) (IfmHandle, double x, double y, double z);
  int       (*findNodeAtXYZ) (IfmHandle, double x, double y, double z, double* dist);

If you need just to know the number of the node and/or element, you can simply create a nodal/elemental expression distribution in FEFLOW GUI. Remember to decrease one unit to the number you get (to be in concordance with C++ counts from zero).

Cheers,
Carlos
Posted Mon, 29 Feb 2016 17:28:31 GMT by Carlos Andres Rivera Villarreyes Global Product Specialist - FEFLOW
PS. In Python, the function returns a list with the node number and the distance to the point provided.
Posted Mon, 29 Feb 2016 20:53:53 GMT by Javier Gonzalez
Thanks a lot Carlos for your reply.

Could you please confirm if the node found by IfmFindNodeAtXY is always at slice1?
Also, the coordinates shown in the bottom status bar when using the mesh inspector, local or global?

Thanks again.
J.
Posted Mon, 29 Feb 2016 20:58:53 GMT by Carlos Andres Rivera Villarreyes Global Product Specialist - FEFLOW
Hola Javier,

Yes. The search in 2D will give you the node number in the Slice 1. The coordinate display is what you have selected in the menu View -> Coordinate system.

Cheers,
Carlos
Posted Mon, 29 Feb 2016 22:19:29 GMT by Javier Gonzalez
Thank you very much Carlos.
Regards
Javier
Posted Tue, 08 Mar 2016 18:25:01 GMT by adacovsk
Another reason why it may be incorrect for you Jegs is that the node index starts at 0 in the IFM, whereas in FEFLOW, it starts at 1, so you could be looking at a completely different node.

You must be signed in to post in this forum.