研发埠
标题:
【让网格动起来】fluent VC++6.0programer2.0编译udf出错
[打印本页]
作者:
梭罗
时间:
2013-7-25 18:51
标题:
【让网格动起来】fluent VC++6.0programer2.0编译udf出错
编译结果:-------------------Configuration: Serial - Win32 Release--------------------Compiling...functions.cppD:\GAMBIT\2D0722\Serial\profile.h(49) : error C2377: &#39
OINT' : redefinition; typedef cannot be overloaded with any other symbol C:\Program Files\Microsoft Visual Studio\VC98\Include\windef.h(310) : see declaration of &#39
OINT&#39;D:\GAMBIT\2D0722\Serial\slide.h(141) : warning C4005: &#39;ASSERT&#39; : macro redefinition C:\Program Files\Microsoft Visual Studio\VC98\MFC\Include\afx.h(245) : see previous definition of &#39;ASSERT&#39;D:\GAMBIT\2D0722\Serial\functions.cpp(22) : warning C4305: &#39;=&#39; : truncation from &#39;const double&#39; to &#39;float&#39;D:\GAMBIT\2D0722\Serial\functions.cpp(23) : warning C4305: &#39;=&#39; : truncation from &#39;const double&#39; to &#39;float&#39;D:\GAMBIT\2D0722\Serial\functions.cpp(25) : warning C4305: &#39;=&#39; : truncation from &#39;const double&#39; to &#39;float&#39;D:\GAMBIT\2D0722\Serial\functions.cpp(26) : warning C4305: &#39;=&#39; : truncation from &#39;const double&#39; to &#39;float&#39;执行 cl.exe 时出错.functions.obj - 1 error(s), 0 warning(s)#include "udf.h" DEFINE_GEOM(UDF,d,dt,position) { real T,f; real pi; real R0,R1,R2; real a,b; real c1,c2,c3; real e1,e2; real s; T=CURRENT_TIME; f=200000; pi=3.141592653; R0=0.15; a=0.01; b=0.01; R1=(2.830030237-a+841/(2.830030237-a))/2000; R2=(b+2.830030237+841/(b+2.830030237))/2000; s=-sin(2*pi*f*T); if(s>0) { c1=sqrt(R2*R2-position[0]*position[0]); c2=sqrt(R0*R0-position[0]*position[0]); c3=sqrt(R2*R2-R0*R0*0.1933333333*0.1933333333); position[1]=c2+s*(c1-c2+R0*0.981133131756-c3); } else if(s<0) { e1=sqrt(R1*R1-position[0]*position[0]); c2=sqrt(R0*R0-position[0]*position[0]); e2=sqrt(R1*R1-R0*R0*0.1933333333*0.1933333333); position[1]=c2+s*(c2-e1+e2-R0*0.981133131756); } } }[img][/img]上面源程序如果不清晰,请看下面:#include &quot;udf.h&quot;DEFINE_GEOM(UDF,d,dt,position){ real T,f; real pi; real R0,R1,R2; real a,b; real c1,c2,c3; real e1,e2; real s; T=CURRENT_TIME; f=200000; pi=3.141592653; R0=0.15; a=0.01; b=0.01; R1=(2.830030237-a+841/(2.830030237-a))/2000; R2=(b+2.830030237+841/(b+2.830030237))/2000; s=-sin(2*pi*f*T); if(s>0) { c1=sqrt(R2*R2-position[0]*position[0]); c2=sqrt(R0*R0-position[0]*position[0]); c3=sqrt(R2*R2-R0*R0*0.1933333333*0.1933333333); position[1]=c2+s*(c1-c2+R0*0.981133131756-c3); } else if(s<0) { e1=sqrt(R1*R1-position[0]*position[0]); c2=sqrt(R0*R0-position[0]*position[0]); e2=sqrt(R1*R1-R0*R0*0.1933333333*0.1933333333); position[1]=c2+s*(c2-e1+e2-R0*0.981133131756); }}}
作者:
胡坤
时间:
2013-8-5 09:53
else if(s<0)<>这是什么?是否应该将<>去掉?
作者:
梭罗
时间:
2013-8-5 17:12
嗯,是该去掉,复制上来的时候不知道怎么出现了这个,只是主要问题不在这,谢谢
作者:
王剑亮
时间:
2013-8-9 08:51
error C2377: &#39
OINT&#39; : redefinition; typedef cannot be overloaded with any other symbol应该是头文件有问题,fluent的头文件会定义这个,vc的也定义了这个. 冲突
欢迎光临 研发埠 (http://bbs.yanfabu.com/)
Powered by Discuz! X3.2