注册 登录
流体中文网 返回首页

gearboy的个人空间 http://www.cfluid.com/?15372 [收藏] [复制] [分享] [RSS]

日志

UDF获取计算中的残差

已有 1165 次阅读2013-4-17 13:48 |个人分类:UDF使用技巧

This is an example to print the residuals on the console.
#include "udf.h"
DEFINE_ON_DEMAND(residual_list)
{
int nw;
real scaled_res;
Domain*domain=Get_Domain(1);
for(nw=0; nw<MAX_EQNS; ++nw)
{
if(strlen(DOMAIN_EQN_LABEL(domain,nw))>0)
{
if(0==DOMAIN_RES_SCALE(domain,nw)[nres-1])
DOMAIN_RES_SCALE(domain,nw)[nres-1]=1;
scaled_res=DOMAIN_RES(domain,nw)[nres-1]/DOMAIN_RES_SCALE(domain,nw)[nres-1];
Message("%s equation,residual=%g\n",DOMAIN_EQN_LABEL(domain,nw ),scaled_res);
}
}
}

发表评论 评论 (1 个评论)

回复 筱炜轩 2013-7-15 16:39
学习学习!:handshake

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

返回顶部