|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Rodrigo Villarreal
Join Date: Nov 2016
Posts: 40
Rep Power: 10 ![]() |
Hello everyone,
I'm having a SIGSEV error while trying to nest a cell loop within a face loop in a DEFINE_PROFILE macro to sum a cell source to each face element, below there is a minimal example of what I'm trying to do: DEFINE_PROFILE(blabla,thread,i) { Thread *tc; cell_t c; face_t f; real source; real SV; real vector_face[ND_ND]; real vector_cell[ND_ND]; real diff[ND_ND]; begin_f_loop(f,thread) F_CENTROID(vector_face,f,thread); begin_c_loop(c,tc) { C_CENTROID(vector_cell, c, tc); NV_VV(diff, =, vector_face, -, vector_cell); SV=C_UDMI(c,tc,0); source+=SV/pow(NV_MAG(diff),2.0); } end_c_loop(c,tc) F_PROFILE(f,thread,i) = source; end_f_loop(f,thread) } Is this the correct way to do so? Thanks for your answer |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Rodrigo Villarreal
Join Date: Nov 2016
Posts: 40
Rep Power: 10 ![]() |
I managed to do so, it was lacking the thread of the whole domain, for a DEFINE_PROFILE macro it needs the pointer of the domain.
---------------------------- DEFINE_PROFILE(Stereo,thread,i) { Domain *d; d = Get_Domain(1); Thread *tc; cell_t c; face_t f; begin_f_loop(f,thread) thread_loop_c(tc,d) { begin_c_loop(c,tc) { DO STUFF FOR EACH CELL } end_c_loop(c,tc) } F_PROFILE(f,thread,i) =APPLY TO EACH FACE end_f_loop(f,thread) } ---------------------------- |
|
![]() |
![]() |
![]() |
Tags |
cell loop macros, face loop, fluent, udf |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 02:36 |
Seakeeping Solver:Crashed | akbarbagusd | Fidelity CFD | 0 | November 5, 2021 12:42 |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 06:09 |
udf problem | jane | Fluent UDF and Scheme Programming | 37 | February 20, 2018 04:17 |
decomposePar problem: Cell 0contains face labels out of range (Again)) | limonegiallo | OpenFOAM Pre-Processing | 4 | August 28, 2017 05:18 |