:orphan:
# VecScatterFFTWToPetsc
Converts `MATFFTW` output vector to a PETSc vector. 
## Synopsis
```
#include "petscmat.h" 
#include "petscvec.h"   
PetscErrorCode VecScatterFFTWToPetsc(Mat A, Vec x, Vec y)
```
Collective


## Input Parameters

- ***A -*** `MATFFTW` matrix
- ***x -*** FFTW vector



## Output Parameter

- ***y -*** PETSc vector





## Note
While doing real transform the FFTW output of backward DFT contains extra zeros at the end of last dimension.
`VecScatterFFTWToPetsc()` removes those extra zeros.


## See Also
 [](ch_matrices), `Mat`, `VecScatterPetscToFFTW()`, `MATFFTW`, `MatCreateVecsFFTW()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/fft/fftw/fftw.c.html#VecScatterFFTWToPetsc">src/mat/impls/fft/fftw/fftw.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/fft/fftw/fftw.c.html#VecScatterFFTWToPetsc_FFTW">VecScatterFFTWToPetsc_FFTW in src/mat/impls/fft/fftw/fftw.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/fft/fftw/fftw.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
