找回密码
 注册
查看: 2545|回复: 2

带#include<stdio.h>的程序不能运行!

[复制链接]
发表于 2009-2-21 16:08:38 | 显示全部楼层 |阅读模式

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

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

x
求教大虾:
    用来定义动网格运动方式的程序中,不含#include<stdio.h>的可以运行,但是包含了这个头文件的就无法运行了,请各位大虾指点一下迷津,谢谢!
 楼主| 发表于 2009-2-21 16:10:14 | 显示全部楼层
具体代码如下:
#include "stdio.h"
#include "udf.h"
/*#define PI=3.1415926*/
#define A=0.02
#define omegal 2*3.1415926*2.0
/****************************************
compiled UDF for 2-degree of freedem equation of motion
****************************************/
/*static real o_prev=0.0;*/
DEFINE_CG_MOTION(valve, dt, vel, omega, time, dtime)
{
thread *t;
face_t f;
real dv_y;
/*reset velocities*/
NV_S(vel,=,0.0);
NV_S(omega,=,0.0);
if(!Data_valid_P())
  return;
/*get the thread pointer for which this motion is defined*/
t=DT_THREAD(dt);
/*compute change in velocity*/
v_y_prev=omegal*A*cos(omegal*time);
/*message("time=%f,omega=%f\n",time,o_prev);*/
/*set y-component of velocity*/
vel[1]=v_y_prev;
}
发表于 2009-2-24 22:07:20 | 显示全部楼层

回复 2# zuowu0423 的帖子

应该不能要#include "stdio.h",以下是帮助里的一段话
2.15 File Inclusion Directive Using #include
The UDF interpreter also supports C preprocessor directives for file inclusions. When you
use the #include file inclusion directive, the C preprocessor replaces the line #include
filename with the contents of the named file.
#include "filename"
The file you name must reside in your current directory. The only exception to this rule
is the udf.h file, which is read automatically by the FLUENT solver.
For example, the le inclusion directive given by
#include "udf.h"
will cause the udf.h file to be included with your source code.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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