Changeset 881e4b


Ignore:
Timestamp:
Apr 20, 2013, 1:53:20 PM (13 years ago)
Author:
Julian Iseringhausen <isering@…>
Children:
da7c98
Parents:
534af9
Message:

Adapted Bspline class to open boundary conditions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/units/particle/bspline.hpp

    r534af9 r881e4b  
    7777    assert(index_global_z >= grid.Global().LocalBegin().Z() && index_global_z < grid.Global().LocalEnd().Z());
    7878
    79     const int index_local_x = index_global_x - grid.Global().LocalBegin().X() + grid.Local().Begin().X();
    80     const int index_local_y = index_global_y - grid.Global().LocalBegin().Y() + grid.Local().Begin().Y();
    81     const int index_local_z = index_global_z - grid.Global().LocalBegin().Z() + grid.Local().Begin().Z();
     79    const int index_local_x = index_global_x - grid.Global().LocalBegin().X() + grid.Local().HaloSize1().X();
     80    const int index_local_y = index_global_y - grid.Global().LocalBegin().Y() + grid.Local().HaloSize1().Y();
     81    const int index_local_z = index_global_z - grid.Global().LocalBegin().Z() + grid.Local().HaloSize1().Z();
    8282
    8383    assert(index_local_x >= grid.Local().Begin().X() && index_local_x < grid.Local().End().X());
     
    8585    assert(index_local_z >= grid.Local().Begin().Z() && index_local_z < grid.Local().End().Z());
    8686
    87     const vmg_float pos_beg_x = p.Pos().X() - grid.Extent().Begin().X() - grid.Extent().MeshWidth().X() * (index_global_x - grid.Global().GlobalBegin().X() - near_field_cells);
    88     const vmg_float pos_beg_y = p.Pos().Y() - grid.Extent().Begin().Y() - grid.Extent().MeshWidth().Y() * (index_global_y - grid.Global().GlobalBegin().Y() - near_field_cells);
    89     const vmg_float pos_beg_z = p.Pos().Z() - grid.Extent().Begin().Z() - grid.Extent().MeshWidth().Z() * (index_global_z - grid.Global().GlobalBegin().Z() - near_field_cells);
     87    const vmg_float pos_beg_x =  grid.Extent().Begin().X() + grid.Extent().MeshWidth().X() * (index_global_x - grid.Global().GlobalBegin().X() - near_field_cells) - p.Pos().X();
     88    const vmg_float pos_beg_y =  grid.Extent().Begin().Y() + grid.Extent().MeshWidth().Y() * (index_global_y - grid.Global().GlobalBegin().Y() - near_field_cells) - p.Pos().Y();
     89    const vmg_float pos_beg_z =  grid.Extent().Begin().Z() + grid.Extent().MeshWidth().Z() * (index_global_z - grid.Global().GlobalBegin().Z() - near_field_cells) - p.Pos().Z();
    9090
    9191    const vmg_float& h_x = grid.Extent().MeshWidth().X();
     
    106106          int_val += temp_val;
    107107
    108           dir_z -= h_z;
     108          dir_z += h_z;
    109109        }
    110         dir_y -= h_y;
     110        dir_y += h_y;
    111111      }
    112       dir_x -= h_x;
     112      dir_x += h_x;
    113113    }
    114114
Note: See TracChangeset for help on using the changeset viewer.