File: VecView.html

package info (click to toggle)
petsc 3.10.3%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 209,064 kB
  • sloc: ansic: 587,333; python: 29,696; makefile: 12,445; fortran: 11,626; f90: 9,677; cpp: 8,768; sh: 1,027; xml: 621; objc: 445; csh: 194; java: 13
file content (165 lines) | stat: -rw-r--r-- 14,313 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
<!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.10.3 2018-12-18</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.10.3 v3.10.3 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"   
<A HREF="../Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A>  <A HREF="../Vec/VecView.html#VecView">VecView</A>(<A HREF="../Vec/Vec.html#Vec">Vec</A> vec,<A HREF="../Viewer/PetscViewer.html#PetscViewer">PetscViewer</A> 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><A HREF="../Viewer/PetscViewerFormat.html#PetscViewerFormat">PETSC_VIEWER_DEFAULT</A> </B></TD><TD>- default, prints vector contents
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PetscViewerFormat.html#PetscViewerFormat">PETSC_VIEWER_ASCII_MATLAB</A> </B></TD><TD>- prints vector contents in MATLAB format
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PetscViewerFormat.html#PetscViewerFormat">PETSC_VIEWER_ASCII_INDEX</A> </B></TD><TD>- prints vector contents, including indices of vector elements
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B><A HREF="../Viewer/PetscViewerFormat.html#PetscViewerFormat">PETSC_VIEWER_ASCII_COMMON</A> </B></TD><TD>- prints vector contents, using a
format common among all vector types
</TD></TR></TABLE>
<P>
<H3><FONT COLOR="#CC3333">Notes</FONT></H3>
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 <A HREF="../Sys/PetscObjectSetOptionsPrefix.html#PetscObjectSetOptionsPrefix">PetscObjectSetOptionsPrefix</A>((<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></B><H3><FONT COLOR="#CC3333">Level</FONT></H3>beginner<BR>
<H3><FONT COLOR="#CC3333">Location</FONT></H3>
</B><A HREF="../../../src/vec/vec/interface/vector.c.html#VecView">src/vec/vec/interface/vector.c</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>
<P><H3><FONT COLOR="CC3333">Implementations</FONT></H3><A HREF="../../../src/dm/impls/composite/pack.c.html#VecView_DMComposite">VecView_DMComposite in src/dm/impls/composite/pack.c</A><BR>
<A HREF="../../../src/dm/impls/da/gr1.c.html#VecView_MPI_Draw_DA1d">VecView_MPI_Draw_DA1d in src/dm/impls/da/gr1.c</A><BR>
<A HREF="../../../src/dm/impls/da/gr2.c.html#VecView_MPI_Draw_DA2d_Zoom">VecView_MPI_Draw_DA2d_Zoom in src/dm/impls/da/gr2.c</A><BR>
<A HREF="../../../src/dm/impls/da/gr2.c.html#VecView_MPI_Draw_DA2d">VecView_MPI_Draw_DA2d in src/dm/impls/da/gr2.c</A><BR>
<A HREF="../../../src/dm/impls/da/gr2.c.html#VecView_MPI_HDF5_DA">VecView_MPI_HDF5_DA in src/dm/impls/da/gr2.c</A><BR>
<A HREF="../../../src/dm/impls/da/gr2.c.html#VecView_MPI_DA">VecView_MPI_DA in src/dm/impls/da/gr2.c</A><BR>
<A HREF="../../../src/dm/impls/forest/p4est/pforest.c.html#VecView_pforest">VecView_pforest in src/dm/impls/forest/p4est/pforest.c</A><BR>
<A HREF="../../../src/dm/impls/forest/p4est/pforest.c.html#VecView_pforest_Native">VecView_pforest_Native in src/dm/impls/forest/p4est/pforest.c</A><BR>
<A HREF="../../../src/dm/impls/network/networkcreate.c.html#VecView_Network_Seq">VecView_Network_Seq in src/dm/impls/network/networkcreate.c</A><BR>
<A HREF="../../../src/dm/impls/network/networkcreate.c.html#VecView_Network_MPI">VecView_Network_MPI in src/dm/impls/network/networkcreate.c</A><BR>
<A HREF="../../../src/dm/impls/network/networkcreate.c.html#VecView_Network">VecView_Network in src/dm/impls/network/networkcreate.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plex.c.html#VecView_Plex_Local_Draw">VecView_Plex_Local_Draw in src/dm/impls/plex/plex.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plex.c.html#VecView_Plex_Local_VTK">VecView_Plex_Local_VTK in src/dm/impls/plex/plex.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plex.c.html#VecView_Plex_Local">VecView_Plex_Local in src/dm/impls/plex/plex.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plex.c.html#VecView_Plex">VecView_Plex in src/dm/impls/plex/plex.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plex.c.html#VecView_Plex_Native">VecView_Plex_Native in src/dm/impls/plex/plex.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plexhdf5.c.html#VecView_Plex_Local_HDF5_Internal">VecView_Plex_Local_HDF5_Internal in src/dm/impls/plex/plexhdf5.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plexhdf5.c.html#VecView_Plex_HDF5_Internal">VecView_Plex_HDF5_Internal in src/dm/impls/plex/plexhdf5.c</A><BR>
<A HREF="../../../src/dm/impls/plex/plexhdf5.c.html#VecView_Plex_HDF5_Native_Internal">VecView_Plex_HDF5_Native_Internal in src/dm/impls/plex/plexhdf5.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_ASCII">VecView_MPI_ASCII in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_Binary">VecView_MPI_Binary in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_Draw_LG">VecView_MPI_Draw_LG in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_Draw">VecView_MPI_Draw in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_Matlab">VecView_MPI_Matlab in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_ADIOS">VecView_MPI_ADIOS in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_ADIOS2">VecView_MPI_ADIOS2 in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI_HDF5">VecView_MPI_HDF5 in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/mpi/pdvec.c.html#VecView_MPI">VecView_MPI in src/vec/vec/impls/mpi/pdvec.c</A><BR>
<A HREF="../../../src/vec/vec/impls/nest/vecnest.c.html#VecView_Nest">VecView_Nest in src/vec/vec/impls/nest/vecnest.c</A><BR>
<A HREF="../../../src/vec/vec/impls/node/vecnode.c.html#VecView_Node">VecView_Node in src/vec/vec/impls/node/vecnode.c</A><BR>
<A HREF="../../../src/vec/vec/impls/seq/bvec2.c.html#VecView_Seq_ASCII">VecView_Seq_ASCII in src/vec/vec/impls/seq/bvec2.c</A><BR>
<A HREF="../../../src/vec/vec/impls/seq/bvec2.c.html#VecView_Seq_Draw_LG">VecView_Seq_Draw_LG in src/vec/vec/impls/seq/bvec2.c</A><BR>
<A HREF="../../../src/vec/vec/impls/seq/bvec2.c.html#VecView_Seq_Draw">VecView_Seq_Draw in src/vec/vec/impls/seq/bvec2.c</A><BR>
<A HREF="../../../src/vec/vec/impls/seq/bvec2.c.html#VecView_Seq_Binary">VecView_Seq_Binary in src/vec/vec/impls/seq/bvec2.c</A><BR>
<A HREF="../../../src/vec/vec/impls/seq/bvec2.c.html#VecView_Seq_Matlab">VecView_Seq_Matlab in src/vec/vec/impls/seq/bvec2.c</A><BR>
<A HREF="../../../src/vec/vec/impls/seq/bvec2.c.html#VecView_Seq">VecView_Seq in src/vec/vec/impls/seq/bvec2.c</A><BR>
<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>