找回密码
 注册
查看: 2156|回复: 4

请高手解答下这个语句的含义是什么?

[复制链接]
发表于 2011-1-11 11:02:33 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
请高人帮忙解答下这个语句的含义是什么:if(!Data_Valid_P)
谢谢了!
发表于 2011-1-11 16:12:03 | 显示全部楼层
发表于 2011-1-11 21:47:52 | 显示全部楼层

回复 1# liuzheyoungman 的帖子

Data_Valid_P is defined in the id.h header file, and is included in udf.h. The function returns 1 (true) if the data that is passed as an argument is valid, and 0 (false) if it is not.

You can check that the cell values of the variables that appear in your UDF are accessible before you use them in a computation by using the Data_Valid_P macro.

Suppose you read a case file and, in the process, load a UDF. If the UDF performs a calculation using variables that have not yet been initialized, such as the velocity at interior cells, then an error will occur. To avoid this kind of error, an if else condition can be added to your code. If ( if) the data are available, the function can be computed in the normal way. If the data are not available ( else), then no calculation, or a trivial calculation can be performed instead. Once the flow field has been initialized, the function can be reinvoked so that the correct calculation can be performed.
发表于 2011-1-12 08:47:14 | 显示全部楼层
原帖由 znon 于 2011-1-11 21:47 发表
Data_Valid_P is defined in the id.h header file, and is included in udf.h. The function returns 1 (true) if the data that is passed as an argument is valid, and 0 (false) if it is not.

You can chec ...

这么专业啊。呵呵。你也用udf吗?能请教一些问题嘛?
发表于 2011-1-13 12:39:06 | 显示全部楼层

回复 4# zzt_1234 的帖子

这个就是帮助文件中的内容,我拷贝过来的。

有什么问题可以贴出来,大家互相学习。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表