04 2013 档案

摘要:将数据写入到文本中,View Code ofstream outAMatrix;outAMatrix.open("F:\\test\\AMatrix-.txt");通过这两条即可实现。如果是每隔几步要写入数据到同一文件中,View Code ofstream outAMatrix;outAMatrix.open("F:\\test\\AMatrix-.txt",i);将数据不断写到AMatrix-.txt中去。如果每隔几步将数据写入到不同文件中,View Code char buff[256];sprintf(buff, "F:\\test\\ 阅读全文
posted @ 2013-04-13 14:17 liang_l 阅读(383) 评论(0) 推荐(0) 编辑
摘要:2013-04-11之前的版本求解压力poisson方程View Code #include <iomanip>#include <fstream>#include "matvec.h"#include"GS.h"#include"GMRES.h"#include"ggje.h"#include "callumfpack.h"//2013-2-22 核查了A和B是否于Poisson离散出来形式一致//加入了左边界条件为强制边界(Dirichlet条件)//#define 阅读全文
posted @ 2013-04-12 00:07 liang_l 阅读(222) 评论(0) 推荐(0) 编辑
摘要:/*the Sum and the DATE:2012-8-18*///本程序先测试实现纯流体的流动,//边界条件:左边界为一抛物线,右边界也是和左边界相同的抛物线//边界条件:上下边界是固定边界u=v=0//内部节点初始值全部为0#include<iostream>#include<math.h> #include <iomanip>#include <fstream>#include "mathoperation.h"#include "Solve-ustar.h"#include "Solv 阅读全文
posted @ 2013-04-11 16:06 liang_l 阅读(289) 评论(0) 推荐(0) 编辑
摘要:#include<iostream>#include<math.h> #include <iomanip>#include <fstream>using namespace std;double norm2(double *cvel1,double *cvel2,int N){ double c=0; for(int i=0;i<N;i++) c=c+(cvel1[i]-cvel2[i])*(cvel1[i]-cvel2[i]); c=sqrt(c); return c;}int main(){ int N=10; int M=10; do 阅读全文
posted @ 2013-04-10 21:44 liang_l 阅读(4273) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示