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

VecDuplicateVecsF90

Creates several vectors of the same type as an existing vector and makes them accessible via a Fortran90 pointer.

Synopsis

VecDuplicateVecsF90(Vec x,PetscInt n,{Vec, pointer :: y(:)},integer ierr)
Collective on Vec Many br

Input Parameters

x - a vector to mimic Many br
n - the number of vectors to obtain Many br

Output Parameters

y - Fortran90 pointer to the array of vectors Many br
ierr - error code Many br

Example of Usage

    Vec x
    Vec, pointer :: y(:)
    ....
    call VecDuplicateVecsF90(x,2,y,ierr)
    call VecSet(y(2),alpha,ierr)
    call VecSet(y(2),alpha,ierr)
    ....
    call VecDestroyVecsF90(2,y,ierr)
Many br

Notes

Not yet supported for all F90 compilers Many br

Use VecDestroyVecsF90() to free the space. Many br

Many br

See Also

VecDestroyVecsF90(), VecDuplicateVecs()

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

Examples

src/vec/vec/examples/tutorials/ex1f90.F.html
src/vec/vec/examples/tutorials/ex20f90.F90.html