question about VecLoad

tsjb00 tsjb00 at hotmail.com
Wed May 14 18:16:21 CDT 2008


Hi! I have a question about VecLoad. In my program, I need to read in ordered data from an input file, which in an ordinary c program would be as:
  for (k=0; ky->z,ie p(x0,y0,z0),p(x1,y0,z0),...,p(x0,y1,z0),p(x1,y1,z0),...*/
	fscanf(fp,"%f %f %f %f\n",&dumx,&dumy,&dumz,&var);
	i++;
	idx=i;
	AOApplicationToPetsc(ao,1,&idx);
	VecSetValue(v0,idx,var,INSERT_VALUES);
      }
 then use VecView to output the binary file:
      PetscViewerBinaryOpen(PETSC_COMM_SELF,"out.dat",FILE_MODE_WRITE,&viewer);
      VecView(v0,viewer);

It's wrong. Please let me know how to fix it.

Many thanks!

JB
_________________________________________________________________
多个邮箱同步管理,live mail客户端万人抢用中
http://get.live.cn/product/mail.html




More information about the petsc-users mailing list