petsc-main 2021-04-20
Report Typos and Errors

# MatCreateVecsFFTW

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

### Synopsis

```#include "petscmat.h"
#include "petscvec.h"
PetscErrorCode MatCreateVecsFFTW(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.

MatCreateFFT()
{"ft_lang_label":"__label__en","ft_lang_prob":0.83945227,"math_prob":0.93068755,"size":1190,"snap":"2021-21-2021-25","text_gpt3_token_len":285,"char_repetition_ratio":0.11973018,"word_repetition_ratio":0.01980198,"special_character_ratio":0.2210084,"punctuation_ratio":0.08189655,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9701611,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-17T16:17:19Z\",\"WARC-Record-ID\":\"<urn:uuid:d7f57967-ae88-4f61-813f-4cb6a14ada55>\",\"Content-Length\":\"4016\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:78790217-1676-4267-b13c-7a7bc5b1e455>\",\"WARC-Concurrent-To\":\"<urn:uuid:cc97f980-7b51-4a55-bbc8-e218467b960b>\",\"WARC-IP-Address\":\"140.221.25.3\",\"WARC-Target-URI\":\"https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Mat/MatCreateVecsFFTW.html\",\"WARC-Payload-Digest\":\"sha1:3T3OE3VW2QMADZMK76GCWO6DZXOAMGDG\",\"WARC-Block-Digest\":\"sha1:HP2BQVCI6TJRTWRFI46IAL6XR7ARSIM4\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243991258.68_warc_CC-MAIN-20210517150020-20210517180020-00367.warc.gz\"}"}