CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

received a fatal signal (Segmentation fault) using udf to reading node coordinate

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2017, 13:56
Default received a fatal signal (Segmentation fault) using udf to reading node coordinate
  #1
New Member
 
Join Date: Nov 2016
Posts: 18
Rep Power: 10
f.yn is on a distinguished road
hi
i wanted to see node coordinates so i wrote this udf:



#include "udf.h"
FILE *fout;
int n;
Node *v;
void Print_Thread_node_position(Domain *domain, int id)
{
face_t f;
Thread *t = Lookup_Thread(domain, id);
fprintf(fout,"thread id %d\n", id);
begin_f_loop(f, t)
{
f_node_loop(f, t, n)
{
v=F_NODE(f,t,n);
NODE_MARK(v) = 0;
}
}
end_f_loop(f, t);
begin_f_loop(f, t)
{
f_node_loop(f, t, n)
{
real pos_x;
real pos_y;
real pos_z;
pos_x = NODE_X(v);
pos_y = NODE_Y(v);
pos_z = NODE_Z(v);
if(NODE_MARK(v) == 0) /* if not already visited */
fprintf(fout, " f%g %g %g\n", pos_x, pos_y, pos_z);
NODE_MARK(v) = 1;
}

}
end_f_loop(f, t);
fprintf(fout, "\n");
}

DEFINE_ON_DEMAND(get_coords)
{
Domain *domain;
domain = Get_Domain(1);
fout = fopen("faces.out", "w");
Print_Thread_node_position(domain, 2);
Print_Thread_node_position(domain, 4);
fclose(fout);
}


but after executing i get this error:
Error: received a fatal signal (Segmentation fault).

can you tell me what's wrong?
f.yn is offline   Reply With Quote

Old   July 28, 2017, 16:55
Default
  #2
New Member
 
Join Date: Nov 2016
Posts: 18
Rep Power: 10
f.yn is on a distinguished road
i used <Message("")> there is a problem with this line:
Print_Thread_node_position(domain, );
f.yn is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: received a fatal signal (Segmentation fault). MayTheFlowBeWithYou FLUENT 12 June 30, 2017 04:09
Received a fatal signal (Segmentation fault) with UDF lisa_china Fluent UDF and Scheme Programming 2 June 30, 2017 04:07
fatal signal segmentation fault in a UDF hares FLUENT 6 January 21, 2017 04:26
Parallel UDF Segmentation fault error KevinZ09 Fluent UDF and Scheme Programming 1 January 9, 2017 06:30
Wave Tank Numerical Beach Error: received a fatal signal (Segmentation fault) Shyam Kaushik Fluent Multiphase 0 November 15, 2016 14:59


All times are GMT -4. The time now is 14:35.