question about VecLoad (attached )

tsjb00 tsjb00 at hotmail.com
Wed May 14 19:46:38 CDT 2008


Sorry the message gets messed up again! Please check the attached text file of my questions.

Sorry for the inconvenience! Many thanks in advance!

JB
----------------------------------------
> From: tsjb00 at hotmail.com
> To: petsc-users at mcs.anl.gov
> Subject: question about VecLoad (pls disregard previous one)
> Date: Wed, 14 May 2008 23:39:42 +0000
>
>
> Sorry the previous message is wrong
>
> 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);
>
> Please let me know if something is wrong.
>
> Many thanks!
>
> JB
>
> _________________________________________________________________
> MSN 中文网,最新时尚生活资讯,白领聚集门户。
> http://cn.msn.com
>

_________________________________________________________________
新年换新颜,快来妆扮自己的MSN给心仪的TA一个惊喜!
http://im.live.cn/emoticons/?ID=18
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: question.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20080515/e79868e8/attachment.txt>


More information about the petsc-users mailing list