[petsc-users] Reading vtk file in parallel and assigning to an array

Matthew Knepley knepley at gmail.com
Sat Feb 12 21:41:51 CST 2011


On Sat, Feb 12, 2011 at 8:47 PM, khalid ashraf <khalid_eee at yahoo.com> wrote:

> Hi, I have a .vtk file that I want to read. I want to read one floating
> point from each line of the file and assign the value to an array.
> If I use standard C commands like fscanf(), then it works on single
> processor but doesn't keep the right order when run on on multi processors.
> Could you please give a small code snippet to do it the PETSC way in
> parallel ?
>

The easiest way is to read it in serial, and save it in PETSc binary format.
Then it can be loaded in parallel.

   Matt


> Thanks.
>
>
>
> ------------------------------
> Don't be flakey. Get Yahoo! Mail for Mobile<http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail>and
> always stay connected<http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail>to friends.
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110212/2db0053e/attachment.htm>


More information about the petsc-users mailing list