UDF循环迭代宏

本文主要参考FLUENT的UDF指南和胡坤大神的ANSYS Fluent二次开发指南

遍历区域中的网格单元

Domain *domain;
Thread *c_thread;
thread_loop_c(c_thread,domain)
{
    /*对单元进行操作*/
}

遍历区域中的网格面

Thread *f_thread;
domain *domain;
thread_loop_f(f_thread,domain)
{
    /*对网格面进行操作*/
}

遍历网格单元集合中的所有单元

cell_t c;
Thread *c_thread;
begin_c_loop(c, c_thread)
{
    /*对网格单元进行操作*/
}
end_c_loop(c, c_thread)

 遍历面集合中的所有面

face_t f;
Thread *f_thread;
begin_f_loop(f, f_thread)
{
    /*对网格面进行操作*/
}
end_f_loop(f, f_thread)

  遍历一个网格单元上的所有面

cell_t c;
Thread *t;
face_t f;
Thread *tf;
int n;
c_face_loop(c, t, n)
{
    f = C_FACE(c,t,n);
    tf = C_FACE_THREAD(c,t,n);
}

 遍历网格单元中的节点

cell_t c;
Thread *t;
int n;
Node *node;
c_node_loop(c, t, n)
{
    node = C_NODE(c,t,n);
}

  遍历网格面中的所有节点

face_t f;
Thread *t;
int n;
Node *node;
f_node_loop(f, t, n)
{
    node = F_NODE(f,t,n);
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值