|
[Sponsors] |
Segmentation fault while initialization of F_UDMI, why? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 27, 2016, 11:20 |
Segmentation fault while initialization of F_UDMI, why?
|
#1 |
New Member
Deutschland
Join Date: Feb 2013
Posts: 6
Rep Power: 13 |
Hi everyone,
i dont understand why i get an segmentation fault in my code: #include "udf.h" #define NUM_UDM 1 static int udm_offset = UDM_UNRESERVED; DEFINE_ON_DEMAND(on_loading) { if (udm_offset == UDM_UNRESERVED) udm_offset = Reserve_User_Memory_Vars(NUM_UDM); if (udm_offset == UDM_UNRESERVED) Message("\nYou need to define up to %d extra UDMs in GUI and then reload current library \n", NUM_UDM); else { Message("%d UDMs have been reserved by the current library \n",NUM_UDM); Set_User_Memory_Name(udm_offset,"Mass"); } Message("\nUDM Offset for Current Loaded Library = %d \n",udm_offset); } DEFINE_ON_DEMAND(Mass_init) { Domain *d; d=Get_Domain(1); Thread *t; face_t f; if(udm_offset != UDM_UNRESERVED) { Message("\nSetting Mass. "); thread_loop_f(t,d) { if(BOUNDARY_FACE_THREAD_P(t)){ begin_f_loop(f,t) { F_UDMI(f,t,udm_offset)=42; } end_f_loop(f,t) } } Message("Done.\n"); } else Message("UDM: Mass have not yet been reserved for library\n"); } When i execute on demand "on_loading" with 1 memory location: "1 UDMs have been reserved by the current library UDM Offset for Current Loaded Library = 0" after that i execute "Mass_init": "Setting Mass. Error: received a fatal signal (Segmentation fault). Error: received a fatal signal (Segmentation fault). Error Object: #f" Where is my fault? Thank you very much! br, Niels |
|
June 28, 2016, 04:57 |
|
#2 | |
Senior Member
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13 |
Quote:
enum /* UDMs */ { mass, /*whatever the name you want*/ NUM_UDM }; Then change the following line F_UDMI(f,t,mass)=42; And exclude this one #define NUM_UDM 1 |
||
Tags |
f_udmi, segmentaion fault |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel | francesco | OpenFOAM Bugs | 4 | May 2, 2017 21:59 |
ABL use of fixed shear stress leads to segmentation fault 11 | cristopf | OpenFOAM Running, Solving & CFD | 1 | December 23, 2016 16:57 |
Segmentation fault when running in parallel | Pj. | OpenFOAM Running, Solving & CFD | 3 | April 8, 2015 08:12 |
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example | sudo | OpenFOAM Running, Solving & CFD | 3 | April 2, 2013 17:27 |
segmentation fault when installing OF-2.1.1 on a cluster | Rebecca513 | OpenFOAM Installation | 9 | July 31, 2012 15:06 |