19.01.2015 Views

Monday, 07/24: Writing a pm-code - AIP

Monday, 07/24: Writing a pm-code - AIP

Monday, 07/24: Writing a pm-code - AIP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PM: main <strong>code</strong> blocks 28<br />

⇒ Given a density field ˜δ(r) in real space, we can solve for the gravitational<br />

potential by<br />

• performing the FFT to get ˜δ(k),<br />

• multiplying every element in the field by the corresponding value of G(k) to<br />

get ˜φ(k),<br />

ˆφ lmn = G(k lmn )ˆρ lmn , where<br />

N g −1<br />

∑<br />

ˆf lmn = (∆x) 3<br />

f ijk = 1 L 3<br />

i,j,k=0<br />

N g −1<br />

∑<br />

l,m,n=0<br />

f ijk e −i2π(il+jm+kn)/N g<br />

,<br />

ˆf lmn e i2π(il+jm+kn)/N g<br />

.<br />

• transforming 8 the result back to real space to get ˜φ(r) discretized at cell<br />

centers.<br />

8 Be careful about normalization of the FFT. The transforms ˜δ(r) → ˜δ(k) and ˜δ(k) → ˜δ(r) should recover the<br />

original field ˜δ(r).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!