Changeset 09e5c8


Ignore:
Timestamp:
Apr 9, 2013, 2:01:34 PM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
1a1be0
Parents:
61edd6
Message:

Fixed global bounds error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/units/particle/linked_cell_list.cpp

    r61edd6 r09e5c8  
    115115void Particle::LinkedCellList::AddParticle(Particle* p)
    116116{
    117   const Index global_index = (p->Pos() - Extent().Begin()) / Extent().MeshWidth();
     117  const Index global_index = global.GlobalBegin() + (p->Pos() - Extent().Begin()) / Extent().MeshWidth();
    118118  const Index local_index = global_index - Global().LocalBegin() + Local().Begin();
    119119
     
    124124void Particle::LinkedCellList::AddParticleToHalo(const vmg_float* x, const vmg_float& q)
    125125{
    126   const Index global_index = ((Vector(x) - Extent().Begin()) / Extent().MeshWidth()).Floor();
     126  const Index global_index = Global().GlobalBegin() + ((Vector(x) - Extent().Begin()) / Extent().MeshWidth()).Floor();
    127127  const Index local_index = global_index - Global().LocalBegin() + Local().Begin();
    128128
Note: See TracChangeset for help on using the changeset viewer.