Changeset ef94e7 for src/units/particle/interpolation.cpp
- Timestamp:
- Jul 4, 2012, 6:10:39 PM (13 years ago)
- Children:
- 0260d3
- Parents:
- 290aa3
- File:
-
- 1 edited
-
src/units/particle/interpolation.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/units/particle/interpolation.cpp
r290aa3 ref94e7 30 30 #include "units/particle/particle.hpp" 31 31 32 #include "mg.hpp" 33 #include "comm/comm.hpp" 34 32 35 using namespace VMG; 33 36 … … 54 57 Index i; 55 58 56 const Index begin = index - deg/2 - 1;59 const Index begin = index - deg/2; 57 60 58 61 h = grid.Extent().MeshWidth(); … … 105 108 void Particle::Interpolation::Evaluate(Particle& p) 106 109 { 107 Vector offset; 110 const Vector& pos = p.Pos(); 111 vmg_float& pot = p.Pot(); 112 Vector& field = p.Field(); 108 113 109 const Vector& pos = p.Pos(); 110 vmg_float& pot = p.Pot(); 111 Vector& field = p.Field(); 114 pot = 0.0; 115 field = 0.0; 112 116 113 pot = 0.0; 114 field = 0.0; 115 117 Vector offset = pos - pos_begin; 116 118 buffer[0] = 1.0; 117 offset = pos - pos_begin;118 for (int i=1; i<deg_1; ++i) {119 buffer[i] = buffer[i-1] * offset;120 offset -= h;121 }122 123 offset = pos - pos_begin;124 119 for (int i=0; i<deg; ++i) { 120 buffer[i+1] = buffer[i] * offset; 125 121 for (int j=0; j<i; ++j) 126 122 buffer_diff[i][j] = buffer_diff[i-1][j] * offset; … … 145 141 field[2] -= _access_coeff(i, j, k+1) * buffer[i][0] * buffer[j][1] * buffer_diff[k][0][2]; 146 142 } 147 148 143 } 149 144
Note:
See TracChangeset
for help on using the changeset viewer.
