File: VecView.html

package info (click to toggle)
petsc 3.7.5%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 163,864 kB
  • ctags: 618,438
  • sloc: ansic: 515,133; python: 29,793; makefile: 20,458; fortran: 18,998; cpp: 6,515; f90: 3,914; sh: 1,012; xml: 621; objc: 445; csh: 240; java: 13
file content (127 lines) | stat: -rw-r--r-- 8,910 bytes parent folder | download
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML3.2 EN">
<HTML>
<HEAD> <link rel="canonical" href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecView.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>VecView</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
   <div id="version" align=right><b>petsc-3.7.5 2017-01-01</b></div>
   <div id="bugreport" align=right><a href="mailto:petsc-maint@mcs.anl.gov?subject=Typo or Error in Documentation &body=Please describe the typo or error in the documentation: petsc-3.7.5 v3.7.5 docs/manualpages/Vec/VecView.html "><small>Report Typos and Errors</small></a></div>
<A NAME="VecView"><H1>VecView</H1></A>
Views a vector object. 
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscvec.h"   
PetscErrorCode  VecView(Vec vec,PetscViewer viewer)
</PRE>
Collective on <A HREF="../Vec/Vec.html#Vec">Vec</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>vec </B></TD><TD>- the vector
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>viewer </B></TD><TD>- an optional visualization context
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
The available visualization contexts include
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PETSC_VIEWER_STDOUT_SELF.html#PETSC_VIEWER_STDOUT_SELF">PETSC_VIEWER_STDOUT_SELF</A> </B></TD><TD>- for sequential vectors
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PETSC_VIEWER_STDOUT_WORLD.html#PETSC_VIEWER_STDOUT_WORLD">PETSC_VIEWER_STDOUT_WORLD</A> </B></TD><TD>- for parallel vectors created on <A HREF="../Sys/PETSC_COMM_WORLD.html#PETSC_COMM_WORLD">PETSC_COMM_WORLD</A>
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PETSC_VIEWER_STDOUT_.html#PETSC_VIEWER_STDOUT_">PETSC_VIEWER_STDOUT_</A>(comm) </B></TD><TD>- for parallel vectors created on MPI communicator comm
</TD></TR></TABLE>
<P>
You can change the format the vector is printed using the
option <A HREF="../Viewer/PetscViewerPushFormat.html#PetscViewerPushFormat">PetscViewerPushFormat</A>().
<P>
The user can open alternative visualization contexts with
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PetscViewerASCIIOpen.html#PetscViewerASCIIOpen">PetscViewerASCIIOpen</A>() </B></TD><TD>- Outputs vector to a specified file
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PetscViewerBinaryOpen.html#PetscViewerBinaryOpen">PetscViewerBinaryOpen</A>() </B></TD><TD>- Outputs vector in binary to a
specified file; corresponding input uses <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>()
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PetscViewerDrawOpen.html#PetscViewerDrawOpen">PetscViewerDrawOpen</A>() </B></TD><TD>- Outputs vector to an X window display
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PetscViewerSocketOpen.html#PetscViewerSocketOpen">PetscViewerSocketOpen</A>() </B></TD><TD>- Outputs vector to Socket viewer
</TD></TR></TABLE>
<P>
The user can call <A HREF="../Viewer/PetscViewerPushFormat.html#PetscViewerPushFormat">PetscViewerPushFormat</A>() to specify the output
format of ASCII printed objects (when using <A HREF="../Viewer/PETSC_VIEWER_STDOUT_SELF.html#PETSC_VIEWER_STDOUT_SELF">PETSC_VIEWER_STDOUT_SELF</A>,
<A HREF="../Viewer/PETSC_VIEWER_STDOUT_WORLD.html#PETSC_VIEWER_STDOUT_WORLD">PETSC_VIEWER_STDOUT_WORLD</A> and <A HREF="../Viewer/PetscViewerASCIIOpen.html#PetscViewerASCIIOpen">PetscViewerASCIIOpen</A>).  Available formats include
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>PETSC_VIEWER_DEFAULT </B></TD><TD>- default, prints vector contents
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>PETSC_VIEWER_ASCII_MATLAB </B></TD><TD>- prints vector contents in MATLAB format
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>PETSC_VIEWER_ASCII_INDEX </B></TD><TD>- prints vector contents, including indices of vector elements
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>PETSC_VIEWER_ASCII_COMMON </B></TD><TD>- prints vector contents, using a
format common among all vector types
</TD></TR></TABLE>
<P>
Notes: You can pass any number of vector objects, or other PETSc objects to the same viewer.
<P>
Notes for binary viewer: If you pass multiply vectors to a binary viewer you can read them back in in the same order
<pre>
    with <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>().
</pre>
<pre>
</pre>
<pre>
   If the blocksize of the vector is greater than one then you must provide a unique prefix to
</pre>
<pre>
   the vector with PetscObjectSetOptionsPrefix((<A HREF="../Sys/PetscObject.html#PetscObject">PetscObject</A>)vec,"uniqueprefix"); BEFORE calling <A HREF="../Vec/VecView.html#VecView">VecView</A>() on the
</pre>
<pre>
   vector to be stored and then set that same unique prefix on the vector that you pass to <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>(). The blocksize
</pre>
<pre>
   information is stored in an ASCII file with the same name as the binary file plus a ".info" appended to the
</pre>
<pre>
   filename. If you copy the binary file, make sure you copy the associated .info file with it.
</pre>
<P>
Notes for HDF5 Viewer: the name of the <A HREF="../Vec/Vec.html#Vec">Vec</A> (given with <A HREF="../Sys/PetscObjectSetName.html#PetscObjectSetName">PetscObjectSetName</A>() is the name that is used
<pre>
   for the object in the HDF5 file. If you wish to store the same vector to the HDF5 viewer (with different values,
</pre>
<pre>
   obviously) several times, you must change its name each time before calling the <A HREF="../Vec/VecView.html#VecView">VecView</A>(). The name you use
</pre>
<pre>
   here should equal the name that you use in the <A HREF="../Vec/Vec.html#Vec">Vec</A> object that you use with <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>().
</pre>
<P>
See the manual page for <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>() on the exact format the binary viewer stores
the values in the file.
<P>

<P>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
 <A HREF="../Viewer/PetscViewerASCIIOpen.html#PetscViewerASCIIOpen">PetscViewerASCIIOpen</A>(), <A HREF="../Viewer/PetscViewerDrawOpen.html#PetscViewerDrawOpen">PetscViewerDrawOpen</A>(), <A HREF="../Draw/PetscDrawLGCreate.html#PetscDrawLGCreate">PetscDrawLGCreate</A>(),
<BR><A HREF="../Viewer/PetscViewerSocketOpen.html#PetscViewerSocketOpen">PetscViewerSocketOpen</A>(), <A HREF="../Viewer/PetscViewerBinaryOpen.html#PetscViewerBinaryOpen">PetscViewerBinaryOpen</A>(), <A HREF="../Vec/VecLoad.html#VecLoad">VecLoad</A>(), <A HREF="../Viewer/PetscViewerCreate.html#PetscViewerCreate">PetscViewerCreate</A>(),
<A HREF="../Sys/PetscRealView.html#PetscRealView">PetscRealView</A>(), <A HREF="../Sys/PetscScalarView.html#PetscScalarView">PetscScalarView</A>(), <A HREF="../Sys/PetscIntView.html#PetscIntView">PetscIntView</A>()
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>beginner
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/vec/vec/interface/vector.c.html#VecView">src/vec/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>
<P><H3><FONT COLOR="#CC3333">Examples</FONT></H3>
<A HREF="../../../src/vec/vec/examples/tutorials/ex2.c.html">src/vec/vec/examples/tutorials/ex2.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex3.c.html">src/vec/vec/examples/tutorials/ex3.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex5.c.html">src/vec/vec/examples/tutorials/ex5.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex6.c.html">src/vec/vec/examples/tutorials/ex6.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex7.c.html">src/vec/vec/examples/tutorials/ex7.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex8.c.html">src/vec/vec/examples/tutorials/ex8.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex10.c.html">src/vec/vec/examples/tutorials/ex10.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex12.c.html">src/vec/vec/examples/tutorials/ex12.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex15.c.html">src/vec/vec/examples/tutorials/ex15.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex16.c.html">src/vec/vec/examples/tutorials/ex16.c.html</A><BR>
<A HREF="../../../src/vec/vec/examples/tutorials/ex19.c.html">src/vec/vec/examples/tutorials/ex19.c.html</A><BR>
</BODY></HTML>