Commit e750b58e authored by berenger-bramas's avatar berenger-bramas

Change a function to return offset and not position of neighbors at leaf level.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@307 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 6ee40a3c
......@@ -976,22 +976,40 @@ public:
if( idxX || idxY || idxZ ){
FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
if( other.getX() < 0 ) other.setX( other.getX() + limite );
else if( limite <= other.getX() ) other.setX( other.getX() - limite );
if( other.getY() < 0 ) other.setY( other.getY() + limite );
else if( limite <= other.getY() ) other.setY( other.getY() - limite );
if( other.getZ() < 0 ) other.setZ( other.getZ() + limite );
else if( limite <= other.getZ() ) other.setZ( other.getZ() - limite );
// To give the orientation of the neighbors
FTreeCoordinate offset;
if( other.getX() < 0 ){
other.setX( other.getX() + limite );
offset.setX(-1);
}
else if( limite <= other.getX() ){
other.setX( other.getX() - limite );
offset.setX(1);
}
if( other.getY() < 0 ){
other.setY( other.getY() + limite );
offset.setY(-1);
}
else if( limite <= other.getY() ){
other.setY( other.getY() - limite );
offset.setY(1);
}
if( other.getZ() < 0 ){
other.setZ( other.getZ() + limite );
offset.setZ(-1);
}
else if( limite <= other.getZ() ){
other.setZ( other.getZ() - limite );
offset.setZ(1);
}
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
// get cell
ContainerClass* const leaf = getLeafSrc(mortonOther);
// add to list if not null
if(leaf){
inNeighborsPosition[idxNeighbors].setPosition( idxX,
idxY,
idxZ);
inNeighborsPosition[idxNeighbors] = offset;
inNeighbors[idxNeighbors++] = leaf;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment