Skip to content
Snippets Groups Projects
Commit b653e5dd authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Corrected a few more ncorrrect math expressions... Getting there...

parent e76ea9ba
No related branches found
No related tags found
No related merge requests found
...@@ -207,7 +207,7 @@ static inline double D_111(double r_x, double r_y, double r_z, double inv_r) { ...@@ -207,7 +207,7 @@ static inline double D_111(double r_x, double r_y, double r_z, double inv_r) {
double inv_r3 = inv_r * inv_r * inv_r; double inv_r3 = inv_r * inv_r * inv_r;
double inv_r7 = inv_r3 * inv_r3 * inv_r; double inv_r7 = inv_r3 * inv_r3 * inv_r;
return -15. * r_x * r_z * r_z * inv_r7; return -15. * r_x * r_y * r_z * inv_r7;
} }
...@@ -316,9 +316,9 @@ static inline void shiftAndAddTensor(struct fieldTensor A, struct fieldTensor* B ...@@ -316,9 +316,9 @@ static inline void shiftAndAddTensor(struct fieldTensor A, struct fieldTensor* B
B->F_000 += 0.5f * dx * dx * A.F_200; B->F_000 += 0.5f * dx * dx * A.F_200;
B->F_000 += 0.5f * dy * dy * A.F_020; B->F_000 += 0.5f * dy * dy * A.F_020;
B->F_000 += 0.5f * dz * dz * A.F_002; B->F_000 += 0.5f * dz * dz * A.F_002;
B->F_000 += 0.5f * dx * dy * A.F_110; B->F_000 += dx * dy * A.F_110;
B->F_000 += 0.5f * dx * dz * A.F_101; B->F_000 += dx * dz * A.F_101;
B->F_000 += 0.5f * dy * dz * A.F_011; B->F_000 += dy * dz * A.F_011;
#endif #endif
B->F_100 += A.F_100; B->F_100 += A.F_100;
...@@ -349,17 +349,19 @@ static inline float applyFieldAcceleration(struct fieldTensor B, double dx, doub ...@@ -349,17 +349,19 @@ static inline float applyFieldAcceleration(struct fieldTensor B, double dx, doub
a += B.F_000; a += B.F_000;
//a += dx * B.F_100; a += dx * B.F_100;
//a += dy * B.F_010; a += dy * B.F_010;
//a += dz * B.F_001; a += dz * B.F_001;
//message("%f %f %f %f %f %f", B.F_100, B.F_010, B.F_001, dx, dy, dz);
#ifdef QUADRUPOLES #ifdef QUADRUPOLES
a += 0.5f * dx * dx * B.F_200; a += 0.5f * dx * dx * B.F_200;
a += 0.5f * dy * dy * B.F_020; a += 0.5f * dy * dy * B.F_020;
a += 0.5f * dz * dz * B.F_002; a += 0.5f * dz * dz * B.F_002;
a += 0.5f * dx * dy * B.F_110; a += dx * dy * B.F_110;
a += 0.5f * dx * dz * B.F_101; a += dx * dz * B.F_101;
a += 0.5f * dy * dz * B.F_011; a += dy * dz * B.F_011;
#endif #endif
return a; return a;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment