Seg fault when accessing cell face velocities F_U, F_V, F_W
I am trying to access the F_U, ..., face velocities within the c_face_loop celll looping macro. My udf compiles without errors but returns a seg fault at runtime. The problem is coming from trying to access the cell face velocities. It has me stomped because the face thread pointer is properly assigned, and a similar access to the F_FLUX macro yields no errors. I have shown the problematic segment of this code:
Thread *fthread, *CellThread; face_t face; int n; Domain *domain; cell_t cell = (obtained from another part of the code); domain = Get_Domain(1); CellThread = domain->c; c_face_loop(cell,CellThread,n) { face = C_FACE(cell,CellThread,n); fthread = C_FACE_THREAD(cell,CellThread,n); VmF[0] += CVm*DT*F_FLUX(face,fthread)*F_U(face,fthread)/RhoF/CellVolume; VmF[1] += CVm*DT*F_FLUX(face,fthread)*F_V(face,fthread)/RhoF/CellVolume; VmF[2] += CVm*DT*F_FLUX(face,fthread)*F_W(face,fthread)/RhoF/CellVolume; } It gives no runtime errors when I remove the F_U, F_V, F_W macros but leave the F_FLUX. Any help would be appreciated. |
All times are GMT -4. The time now is 12:19. |