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
|
<!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/VecScatterCreateToZero.html" />
<META NAME="GENERATOR" CONTENT="DOCTEXT">
<TITLE>VecScatterCreateToZero</TITLE>
</HEAD>
<BODY BGCOLOR="FFFFFF">
<div id="version" align=right><b>petsc-3.4.2 2013-07-02</b></div>
<A NAME="VecScatterCreateToZero"><H1>VecScatterCreateToZero</H1></A>
Creates an output vector and a scatter context used to copy all vector values into the output vector on the zeroth processor
<H3><FONT COLOR="#CC3333">Synopsis</FONT></H3>
<PRE>
#include "petscvec.h"
PetscErrorCode VecScatterCreateToZero(Vec vin,VecScatter *ctx,Vec *vout)
</PRE>
Collective on <A HREF="../Vec/Vec.html#Vec">Vec</A>
<P>
<H3><FONT COLOR="#CC3333">Input Parameter</FONT></H3>
<DT><B>vin </B> -input MPIVEC
<br>
<P>
<H3><FONT COLOR="#CC3333">Output Parameter</FONT></H3>
<TABLE border="0" cellpadding="0" cellspacing="0">
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>ctx </B></TD><TD>- scatter context
</TD></TR>
<TR><TD WIDTH=40></TD><TD ALIGN=LEFT VALIGN=TOP><B>vout </B></TD><TD>- output SEQVEC that is large enough to scatter into on processor 0 and
of length zero on all other processors
</TD></TR></TABLE>
<P>
<P>
Note: vout may be NULL [NULL_OBJECT from fortran] if you do not
need to have it created
<P>
<H3><FONT COLOR="#CC3333">Usage</FONT></H3>
<pre>
<A HREF="../Vec/VecScatterCreateToZero.html#VecScatterCreateToZero">VecScatterCreateToZero</A>(vin,&ctx,&vout);
</pre>
<pre>
</pre>
<pre>
// scatter as many times as you need
</pre>
<pre>
<A HREF="../Vec/VecScatterBegin.html#VecScatterBegin">VecScatterBegin</A>(ctx,vin,vout,<A HREF="../Sys/INSERT_VALUES.html#INSERT_VALUES">INSERT_VALUES</A>,<A HREF="../Vec/SCATTER_FORWARD.html#SCATTER_FORWARD">SCATTER_FORWARD</A>);
</pre>
<pre>
<A HREF="../Vec/VecScatterEnd.html#VecScatterEnd">VecScatterEnd</A>(ctx,vin,vout,<A HREF="../Sys/INSERT_VALUES.html#INSERT_VALUES">INSERT_VALUES</A>,<A HREF="../Vec/SCATTER_FORWARD.html#SCATTER_FORWARD">SCATTER_FORWARD</A>);
</pre>
<pre>
</pre>
<pre>
// destroy scatter context and local vector when no longer needed
</pre>
<pre>
<A HREF="../Vec/VecScatterDestroy.html#VecScatterDestroy">VecScatterDestroy</A>(ctx);
</pre>
<pre>
<A HREF="../Vec/VecDestroy.html#VecDestroy">VecDestroy</A>(vout);
</pre>
<P>
<H3><FONT COLOR="#CC3333">See Also</FONT></H3>
<A HREF="../Vec/VecScatterCreate.html#VecScatterCreate">VecScatterCreate</A>(), <A HREF="../Vec/VecScatterCreateToAll.html#VecScatterCreateToAll">VecScatterCreateToAll</A>(), <A HREF="../Vec/VecScatterBegin.html#VecScatterBegin">VecScatterBegin</A>(), <A HREF="../Vec/VecScatterEnd.html#VecScatterEnd">VecScatterEnd</A>()
<BR>
<P>
Do NOT create a vector and then pass it in as the final argument vout! vout is created by this routine
automatically (unless you pass NULL in for that argument if you do not need it).
<P>
<P><B><P><B><FONT COLOR="#CC3333">Level:</FONT></B>intermediate
<BR><FONT COLOR="#CC3333">Location:</FONT></B><A HREF="../../../src/vec/vec/utils/vecmpitoseq.c.html#VecScatterCreateToZero">src/vec/vec/utils/vecmpitoseq.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>
|