[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about VecLoad (attached )
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: question about VecLoad (attached )
- From: "Matthew Knepley" <knepley@xxxxxxxxx>
- Date: Thu, 15 May 2008 07:07:46 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=foqSX1bKXbd7GVhsoQIH1SQDL20+DcLCFG4hS2vTcwM=; b=YV2JlvriIeOvOl7giz+YNh7O+1RytnCguF7EA7+9QSk+k5kuSTbTBn/x4FXSZ6lpwGAKnnRaLIKjzJHQjhLfcGoutBxBm3ngY+KmIEVRKLXLN2PHDgGRSpdTUbYrvBtozWv+GGrGHg5A+e4KJBUeW3pF8XWa0c8TGI5RswlU1LA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=m12glmKML4h4tIxY1i4iTBG/7JghTIYjo6RW59D4qpq7RTJMMlMqS/rv42Pj79OYIZGV2qFF7M4He8iiqgFTHag2Ufd6R317I+as898iSaLK0pNk4QARqnltYYn8PKLnYc0JxSqV2jVhHLdaZOZdeAk8F94jPSwnuk+7uDEu9tQ=
- In-reply-to: <BAY110-W2D5C8DCB88249C4A53164C0C90@phx.gbl>
- References: <BAY110-W2D5C8DCB88249C4A53164C0C90@phx.gbl>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
You do not have to use the AO. We always save to file in the natural ordering.
Without this, we would not be able to load on different numbers of processors.
Matt
2008/5/14 tsjb00 <tsjb00@xxxxxxxxxxx>:
>
> 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@xxxxxxxxxxx
>> To: petsc-users@xxxxxxxxxxx
>> 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
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener