petsc-3.5.1 2014-07-24
Report Typos and Errors

MatGetVecsFFTW

Get vector(s) compatible with the matrix, i.e. with the parallel layout determined by FFTW

Synopsis

#include "petscmat.h" 
#include "petscvec.h"   
PetscErrorCode MatGetVecsFFTW(Mat A,Vec *x,Vec *y,Vec *z)
Collective on Mat

Input Parameter

A -the matrix

Output Parameter

x - (optional) input vector of forward FFTW
y - (optional) output vector of forward FFTW
z -(optional) output vector of backward FFTW

Note: The parallel layout of output of forward FFTW is always same as the input of the backward FFTW. But parallel layout of the input vector of forward FFTW might not be same as the output of backward FFTW. Also note that we need to provide enough space while doing parallel real transform. We need to pad extra zeros at the end of last dimension. For this reason the one needs to invoke the routine fftw_mpi_local_size_transposed routines. Remember one has to change the last dimension from n to n/2+1 while invoking this routine. The number of zeros to be padded depends on if the last dimension is even or odd. If the last dimension is even need to pad two zeros if it is odd only one zero is needed. Lastly one needs some scratch space at the end of data set in each process. alloc_local figures out how much space is needed, i.e. it figures out the data+scratch space for each processor and returns that.

See Also

MatCreateFFTW()

Level:advanced
Location:
src/mat/impls/fft/fftw/fftw.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages