petsc-3.7.1 2016-05-15
Report Typos and Errors

VecReplaceArray

Allows one to replace the array in a vector with an array provided by the user. This is useful to avoid copying an array into a vector.

Synopsis

#include "petscvec.h"   
PetscErrorCode  VecReplaceArray(Vec vec,const PetscScalar array[])
Not Collective Many br

Input Parameters

vec - the vector Many br
array - the array Many br

Notes

This permanently replaces the array and frees the memory associated Many brwith the old array. Many br

The memory passed in MUST be obtained with PetscMalloc() and CANNOT be Many brfreed by the user. It will be freed when the vector is destroy. Many br

Not supported from Fortran Many br

Many br

See Also

VecGetArray(), VecRestoreArray(), VecPlaceArray(), VecResetArray()

Level:developer
Location:
src/vec/vec/interface/rvector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages