#include "PmeBase.h"
#include <math.h>
#include <charm++.h>
#include "Vector.h"
#include "Lattice.h"
Go to the source code of this file.
Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.
Definition at line 8 of file PmeBase.inl.
template<class REAL >
static void compute_b_spline |
( |
REAL *__restrict |
frac, |
|
|
REAL * |
M, |
|
|
REAL * |
dM, |
|
|
int |
order |
|
) |
| |
|
inlinestatic |
Definition at line 86 of file PmeBase.inl.
References order, x, y, and z.
Referenced by compute_b_moduli().
88 REAL
x,
y,
z,x1,y1,z1, div;
89 REAL * __restrict Mx, * __restrict My, * __restrict Mz, * __restrict dMx, * __restrict dMy, * __restrict dMz;
90 Mx=M-1; My=M+
order-1; Mz=M+2*order-1;
91 dMx=dM-1; dMy =dM+order-1; dMz=dM+2*order-1;
95 x1=1.0-
x; y1=1.0-
y; z1=1.0-
z;
111 for (n=4; n<=order-1; n++) {
114 Mx[n] = x*div*Mx[n-1];
115 My[n] = y*div*My[n-1];
116 Mz[n] = z*div*Mz[n-1];
117 for (j=1; j<=n-2; j++) {
118 Mx[n-j] = ((x+j)*Mx[n-j-1] + (n-x-j)*Mx[n-j])*div;
119 My[n-j] = ((y+j)*My[n-j-1] + (n-y-j)*My[n-j])*div;
120 Mz[n-j] = ((z+j)*Mz[n-j-1] + (n-z-j)*Mz[n-j])*div;
122 Mx[1] *= (1.0-
x)*div;
123 My[1] *= (1.0-
y)*div;
124 Mz[1] *= (1.0-
z)*div;
127 dMx[1]=-Mx[1]; dMy[1]=-My[1]; dMz[1]=-Mz[1];
128 for (j=2; j <=
order; j++) {
129 dMx[j] = Mx[j-1] - Mx[j];
130 dMy[j] = My[j-1] - My[j];
131 dMz[j] = Mz[j-1] - Mz[j];
135 Mx[
order] = x*div*Mx[order-1];
136 My[
order] = y*div*My[order-1];
137 Mz[
order] = z*div*Mz[order-1];
138 for (j=1; j<=order-2; j++) {
139 Mx[order-j] = ((x+j)*Mx[order-j-1] + (order-x-j)*Mx[order-j])*div;
140 My[order-j] = ((y+j)*My[order-j-1] + (order-y-j)*My[order-j])*div;
141 Mz[order-j] = ((z+j)*Mz[order-j-1] + (order-z-j)*Mz[order-j])*div;
143 Mx[1] *= (1.0-
x)*div;
144 My[1] *= (1.0-
y)*div;
145 Mz[1] *= (1.0-
z)*div;
Definition at line 17 of file PmeBase.inl.
References Lattice::a_r(), Lattice::b_r(), Lattice::c_r(), PmeGrid::K1, PmeGrid::K2, PmeGrid::K3, PmeGrid::order, Lattice::origin(), PmeParticle::x, Vector::x, x, PmeParticle::y, Vector::y, y, PmeParticle::z, Vector::z, and z.
Referenced by ComputePme::doWork().
25 double r1x = recip1.
x;
26 double r1y = recip1.
y;
27 double r1z = recip1.
z;
28 double r2x = recip2.
x;
29 double r2y = recip2.
y;
30 double r2z = recip2.
z;
31 double r3x = recip3.
x;
32 double r3y = recip3.
y;
33 double r3z = recip3.
z;
37 double shift1 = ((K1 + grid.
order - 1)/2)/(double)K1;
38 double shift2 = ((K2 + grid.
order - 1)/2)/(double)K2;
39 double shift3 = ((K3 + grid.
order - 1)/2)/(double)K3;
41 for (
int i=0; i<N; i++) {
42 double px = p[i].
x - ox;
43 double py = p[i].
y - oy;
44 double pz = p[i].
z - oz;
45 double sx = shift1 + px*r1x + py*r1y + pz*r1z;
46 double sy = shift2 + px*r2x + py*r2y + pz*r2z;
47 double sz = shift3 + px*r3x + py*r3y + pz*r3z;
48 p[i].
x = K1 * ( sx - floor(sx) );
49 p[i].
y = K2 * ( sy - floor(sy) );
50 p[i].
z = K3 * ( sz - floor(sz) );
53 if ( p[i].
x == K1 ) p[i].
x = 0;
54 if ( p[i].
y == K2 ) p[i].
y = 0;
55 if ( p[i].
z == K3 ) p[i].
z = 0;