Dear all,

I am trying to use FFT to calculate the demagnetizing field in micromagnetics, 
which is of a discrete convolution form,

Hdemag(i,j,k)=\sum_{p=0}^Nx\sum_{q=0}^Ny\sum_{r=0}^Nz 
DemagTensor(i-p,j-q,k-r)aM(p,q,r)

I wrote a subroutine based on the examples ex121.c(sequential convolution) and 
ex158.c (parallel FFT) in Petsc website, but the result is inconsistent with 
the one from direct method. I've attached my code. My concern is in the 
implementation of zero-padding and wrap-around order. I would very much 
appreciate your time to take a look and direct me to any possible problems.

regards,
Likun



                                          

Attachment: parallel 3D convolution.pdf
Description: Adobe PDF document

Reply via email to