petsc-3.14.6 2021-03-30
Report Typos and Errors

VecSetOperation

Allows user to set a vector operation.

Synopsis

#include "petscvec.h"   
PetscErrorCode VecSetOperation(Vec vec,VecOperation op, void (*f)(void))
Logically Collective on Vec

Input Parameters

vec - the vector
op - the name of the operation
f - the function that provides the operation.

Usage

     PetscErrorCode userview(Vec,PetscViewer);
     ierr = VecCreateMPI(comm,m,M,&x);CHKERRQ(ierr);
     ierr = VecSetOperation(x,VECOP_VIEW,(void(*)(void))userview);CHKERRQ(ierr);

Notes

See the file include/petscvec.h for a complete list of matrix operations, which all have the form VECOP_<OPERATION>, where <OPERATION> is the name (in all capital letters) of the user interface routine (e.g., VecView() -> VECOP_VIEW).

This function is not currently available from Fortran.

See Also

VecCreate(), MatShellSetOperation()

Level

advanced

Location

src/vec/vec/interface/vector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages