Changeset ab63b6 for src/interface/interface_particles.cpp
- Timestamp:
- Dec 8, 2011, 12:53:48 PM (14 years ago)
- Children:
- 138f86
- Parents:
- facba0
- File:
-
- 1 edited
-
src/interface/interface_particles.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/interface/interface_particles.cpp
rfacba0 rab63b6 100 100 #endif 101 101 102 for (iter=particles.begin(); iter!=particles.end(); ++iter) { 103 104 // Compute global and local grid index of the lower left corner of the grid cell containing the particle 105 index_global = static_cast<Index>((iter->Pos() - temp_grid->Extent().Begin()) / temp_grid->Extent().MeshWidth()); 106 index_local = index_global - temp_grid->Global().BeginLocal() + temp_grid->Local().Begin(); 107 108 // Iterate over all grid points which lie in the support of the interpolating B-Spline 109 for (index.X()=-1*near_field_cells-1; index.X()<=near_field_cells+1; ++index.X()) 110 for (index.Y()=-1*near_field_cells-1; index.Y()<=near_field_cells+1; ++index.Y()) 111 for (index.Z()=-1*near_field_cells-1; index.Z()<=near_field_cells+1; ++index.Z()) { 112 113 // Compute distance from grid point to particle 114 length = ( iter->Pos() - grid.Extent().Begin() - grid.Extent().MeshWidth() * (index_global+index) ).Length(); 115 116 // If grid point lies in the support of the B-Spline, do charge interpolation 117 if (length < r_cut) 118 (*temp_grid)(index_local+index) += spl.EvaluateSpline(length) * iter->Charge(); 119 120 } 121 122 } 102 for (iter=particles.begin(); iter!=particles.end(); ++iter) 103 spl.SetSpline(*temp_grid, *iter, near_field_cells); 123 104 124 105 // Communicate charges over halo
Note:
See TracChangeset
for help on using the changeset viewer.
