petsc-3.12.1 2019-10-22
Report Typos and Errors

# VecSum

Computes the sum of all the components of a vector.

### Synopsis

    #include "petscvec.h"
    PetscErrorCode  VecSum(Vec v,PetscScalar *sum)

Collective on Vec

### Input Parameter

v -the vector

### Output Parameter

sum -the result

### See Also

VecNorm()

### Level

beginner

### Location

src/vec/vec/utils/vinv.c

### Examples

src/vec/vec/examples/tutorials/ex18.c.html
src/ksp/ksp/examples/tutorials/ex59.c.html
src/ts/examples/tutorials/ex9.c.html
src/ts/examples/tutorials/extchem.c.html
src/tao/unconstrained/examples/tutorials/spectraladjointassimilation.c.html
src/tao/pde_constrained/examples/tutorials/elliptic.c.html
src/tao/pde_constrained/examples/tutorials/hyperbolic.c.html
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages