1
#include <blitz/array.h>
3
BZ_USING_NAMESPACE(blitz)
5
//declaration of the stencil kinEnergy
6
BZ_DECLARE_STENCIL2(kinEnergy,A,B)
8
BZ_END_STENCIL_WITH_SHAPE(shape(-1,-1,-1),shape(+1,+1,+1))
10
typedef Array<complex<double>,3> array3d;
17
// Fill a three-dimensional array with a Gaussian function
23
//A = exp(c * (sqr(i-midpoint) + sqr(j-midpoint)
24
// + sqr(k-midpoint)));
25
A = zip( exp(c * (sqr(i-midpoint) + sqr(j-midpoint)
26
+ sqr(k-midpoint))), 0.0, complex<double>());
28
applyStencil(kinEnergy(),A,B);
30
Array<complex<double>,1> a_view(A.data(),shape(N*N*N));
32
Array<complex<double>,1> out_view(B.data(),shape(N*N*N));
33
cout << out_view<<endl;