|
[Sponsors] |
received a fatal signal (Segmentation fault) using udf to reading node coordinate |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 28, 2017, 13:56 |
received a fatal signal (Segmentation fault) using udf to reading node coordinate
|
#1 |
New Member
Join Date: Nov 2016
Posts: 18
Rep Power: 10 |
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? |
|
July 28, 2017, 16:55 |
|
#2 |
New Member
Join Date: Nov 2016
Posts: 18
Rep Power: 10 |
i used <Message("")> there is a problem with this line:
Print_Thread_node_position(domain, ); |
|
|
|
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 |