CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Segmentation Fault with Get_Domain? (https://www.cfd-online.com/Forums/fluent/173351-segmentation-fault-get_domain.html)

joeyliu June 17, 2016 19:34

Segmentation Fault with Get_Domain?
 
Hi all,

I'm having a bit of trouble with my UDF and can't seem to find anything to solve it. My code is simple, but I hope that will only make it easier for someone to spot my mistake. I'm basically just trying to create a pressure profile. I'm also using DEFINE_ON_DEMAND instead of DEFINE_PROFILE because my goal is to eventually use data from other surfaces in this code (which, by my understanding, will require those domains and threads as well).

#include <udf.h>
DEFINE_ON_DEMAND(pressure_profile_TEST)
{

Domain *d = Get_Domain(1);

Thread *t = Lookup_Thread(d, 5);

int i;

real x[ND_ND];

real y;

face_t f;

begin_f_loop(f, t)

{

F_CENTROID(x, f, t);

y = x[1];

F_PROFILE(f, t, i) = 10;

}

end_f_loop(f, t);


}


Running this yields the error:
Error: received a fatal signal (Segmentation fault). Error Object: #f
Thanks for reading! Please let me know if you have any suggestions.


All times are GMT -4. The time now is 19:21.