Ignore:
Timestamp:
Apr 9, 2013, 8:44:10 PM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
b3075a
Parents:
1a1be0
Message:

Fixed position to index conversion errors.# Please enter the commit message for your changes. Lines starting

File:
1 edited

Legend:

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

    r1a1be0 r866ac4  
    4949  local.BoundaryBegin2() = 0;
    5050  local.BoundaryEnd2() = 0;
    51   local.BoundarySize2() = 0;/*
    52    *    vmg - a versatile multigrid solver
    53    *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
    54    *
    55    *  vmg is free software: you can redistribute it and/or modify
    56    *  it under the terms of the GNU General Public License as published by
    57    *  the Free Software Foundation, either version 3 of the License, or
    58    *  (at your option) any later version.
    59    *
    60    *  vmg is distributed in the hope that it will be useful,
    61    *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    62    *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    63    *  GNU General Public License for more details.
    64    *
    65    *  You should have received a copy of the GNU General Public License
    66    *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    67    */
    68 
    69   /**
    70    * @file   global_grid_partitioning.hpp
    71    * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
    72    * @date   Thu May 19 14:02:46 2011
    73    *
    74    * @brief  Class to store global grid partitioning.
    75    *
    76    */
     51  local.BoundarySize2() = 0;
    7752
    7853  for (int i=0; i<3; ++i) {
     
    11590void Particle::LinkedCellList::AddParticle(Particle* p)
    11691{
    117   const Index global_index = global.GlobalBegin() + (p->Pos() - Extent().Begin()) / Extent().MeshWidth();
     92  const Index global_index = global.GlobalBegin() + ((p->Pos() - Extent().Begin()) / Extent().MeshWidth()).Floor();
    11893  const Index local_index = global_index - Global().LocalBegin() + Local().Begin();
    11994
Note: See TracChangeset for help on using the changeset viewer.