# VecScatterPetscToFFTW
Copies a PETSc vector to the vector that goes into `MATFFTW` calls. 
## Synopsis
```
#include "petscmat.h" 
#include "petscvec.h"   
PetscErrorCode VecScatterPetscToFFTW(Mat A, Vec x, Vec y)
```
Collective on Mat


## Input Parameters

- ***A -*** FFTW matrix
- ***x -*** the PETSc vector



## Output Parameters

- ***y -*** the FFTW vector





## Note
For real parallel FFT, FFTW requires insertion of extra space at the end of last dimension. This required even when
one is not doing in-place transform. The last dimension size must be changed to 2*(dim[last]/2+1) to accommodate these extra
zeros. This routine does that job by scattering operation.


## See Also
 `MATFFTW`, `VecScatterFFTWToPetsc()`, `MatCreateVecsFFTW()`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/fft/fftw/fftw.c.html#VecScatterPetscToFFTW_FFTW">VecScatterPetscToFFTW_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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
