1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>VecLoadIntoVector</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<A NAME="VecLoadIntoVector"><H1>VecLoadIntoVector</H1></A>
Loads a vector that has been stored in binary format with <A HREF="../Vec/VecView.html#VecView">VecView</A>().
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscvec.h"
int VecLoadIntoVector(PetscViewer viewer,Vec vec)
</PRE>
Collective on <A HREF="../Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameters</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>viewer </B></TD><TD>- binary file viewer, obtained from <A HREF="../Viewer/PetscViewerBinaryOpen.html#PetscViewerBinaryOpen">PetscViewerBinaryOpen</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>vec </B></TD><TD>- vector to contain files values (must be of correct length)
</TD></TR></TABLE>
<P>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The input file must contain the full global vector, as
written by the routine <A HREF="../Vec/VecView.html#VecView">VecView</A>().
<P>
Use <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>() to create the vector as the values are read in
<P>
<H3><FONT COLOR="#CC3333">Notes for advanced users</FONT></H3>
Most users should not need to know the details of the binary storage
format, since <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>() and <A HREF="../Vec/VecView.html#VecView">VecView</A>() completely hide these details.
But for anyone who's interested, the standard binary matrix storage
format is
<PRE>
int VEC_FILE_COOKIE
int number of rows
<A HREF="../Sys/PetscScalar.html#PetscScalar">PetscScalar</A> *values of all nonzeros
</PRE>
<P>
Note for Cray users, the int's stored in the binary file are 32 bit
integers; not 64 as they are represented in the memory, so if you
write your own routines to read/write these binary files from the Cray
you need to adjust the integer sizes that you read in, see
PetscReadBinary() and PetscWriteBinary() to see how this may be
done.
<P>
In addition, PETSc automatically does the byte swapping for
machines that store the bytes reversed, e.g. DEC alpha, freebsd,
linux, nt and the paragon; thus if you write your own binary
read/write routines you have to swap the bytes; see PetscReadBinary()
and PetscWriteBinary() to see how this may be done.
<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../Viewer/PetscViewerBinaryOpen.html#PetscViewerBinaryOpen">PetscViewerBinaryOpen</A>(), <A HREF="../Vec/VecView.html#VecView">VecView</A>(), <A HREF="../Mat/MatLoad.html#MatLoad">MatLoad</A>(), <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>()
<BR><P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/vec/interface/vector.c.html#VecLoadIntoVector">src/vec/interface/vector.c</A>
<BR><A HREF="./index.html">Index of all Vec routines</A>
<BR><A HREF="../../index.html">Table of Contents for all manual pages</A>
<BR><A HREF="../singleindex.html">Index of all manual pages</A>
</BODY></HTML>
|