Ignore:
Timestamp:
Dec 8, 2011, 12:53:48 PM (14 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
138f86
Parents:
facba0
Message:

Ensure that interpolating splines are normalized wrt the grid.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1243 5161e1c8-67bf-11de-9fd5-51895aff932f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/interface/interface_particles.cpp

    rfacba0 rab63b6  
    100100#endif
    101101
    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);
    123104
    124105  // Communicate charges over halo
Note: See TracChangeset for help on using the changeset viewer.