Commit 0f9e1cf9 authored by Quentin Khan's avatar Quentin Khan

Remove "deprecated" warnings after FTreeCoordinate simplification

parent ff46af1a
......@@ -316,7 +316,7 @@ public:
flopsP2P += tmpCost;
CellClass* cell = _tree->getCell(
LeafCellCoordinate.getMortonIndex(_treeHeight - 1),
LeafCellCoordinate.getMortonIndex(),
_treeHeight - 1);
cell->addNearCost(tmpCost);
......@@ -344,7 +344,7 @@ public:
flopsP2P += tmpCost;
CellClass* cell = _tree->getCell(
LeafCellCoordinate.getMortonIndex(_treeHeight - 1),
LeafCellCoordinate.getMortonIndex(),
_treeHeight - 1);
cell->addNearCost(tmpCost);
......
......@@ -194,7 +194,7 @@ public:
CellClass* cell = _tree->getCell(
LeafCellCoordinate.getMortonIndex(_treeHeight - 1),
LeafCellCoordinate.getMortonIndex(),
_treeHeight - 1);
flopsP2P += tmpCost;
......@@ -210,7 +210,7 @@ public:
FSize tmpCost = 0;
CellClass* cell = _tree->getCell(
LeafCellCoordinate.getMortonIndex(_treeHeight - 1),
LeafCellCoordinate.getMortonIndex(),
_treeHeight - 1);
flopsP2P += tmpCost;
......
......@@ -87,7 +87,7 @@ public:
}
MortonIndex getIndex(const int inX, const int inY, const int inZ) override{
return FTreeCoordinate(inX+coord.getX(), inY+coord.getY(), inZ+coord.getZ()).getMortonIndex(level);
return FTreeCoordinate(inX+coord.getX(), inY+coord.getY(), inZ+coord.getZ()).getMortonIndex();
}
};
......
......@@ -187,7 +187,7 @@ public:
template<typename... Args>
void insert(const FPoint<FReal>& inParticlePosition, Args... args){
const FTreeCoordinate host = getCoordinateFromPosition( inParticlePosition );
const MortonIndex particleIndex = host.getMortonIndex(leafIndex);
const MortonIndex particleIndex = host.getMortonIndex();
if(root->isLeafPart()){
((SubOctreeWithLeaves*)root)->insert( particleIndex, host, this->height, inParticlePosition, args... );
}
......@@ -200,7 +200,7 @@ public:
* @param indexToRemove the index of the leaf to remove
*/
LeafClass* createLeaf(const MortonIndex indexToCreate ){
const FTreeCoordinate host(indexToCreate,this->height-1);
const FTreeCoordinate host(indexToCreate);
if(root->isLeafPart()){
return ((SubOctreeWithLeaves*)root)->createLeaf( indexToCreate, host, this->height );
}
......@@ -222,7 +222,7 @@ public:
* @return the morton index
*/
MortonIndex getMortonFromPosition(const FPoint<FReal>& position) const {
return getCoordinateFromPosition(position).getMortonIndex(leafIndex);
return getCoordinateFromPosition(position).getMortonIndex();
}
/*
......@@ -803,7 +803,7 @@ public:
// if we are not on the current cell
if( !(!idxX && !idxY && !idxZ) ){
const FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
const MortonIndex mortonOther = other.getMortonIndex();
// if not a brother
if( mortonOther>>3 != inIndex>>3 ){
// get cell
......@@ -888,7 +888,7 @@ public:
// if we are not on the current cell
if( neighSeparation<1 || idxX || idxY || idxZ ){
const FTreeCoordinate otherParent(parentCell.getX() + idxX,parentCell.getY() + idxY,parentCell.getZ() + idxZ);
const MortonIndex mortonOtherParent = otherParent.getMortonIndex(inLevel-1) << 3;
const MortonIndex mortonOtherParent = otherParent.getMortonIndex() << 3;
// Get child
CellClass** const cells = getCellPt(mortonOtherParent, inLevel);
......@@ -950,7 +950,7 @@ public:
// if we are not on the current cell
if( neighSeparation<1 || idxX || idxY || idxZ ){
const FTreeCoordinate otherParent(parentCell.getX() + idxX,parentCell.getY() + idxY,parentCell.getZ() + idxZ);
const MortonIndex mortonOtherParent = otherParent.getMortonIndex(inLevel-1) << 3;
const MortonIndex mortonOtherParent = otherParent.getMortonIndex() << 3;
// Get child
CellClass** const cells = getCellPt(mortonOtherParent, inLevel);
......@@ -1016,7 +1016,7 @@ public:
if(!FMath::Between(parentCell.getZ() + idxZ,0,boxLimite)) continue;
const FTreeCoordinate otherParent(parentCell.getX() + idxX,parentCell.getY() + idxY,parentCell.getZ() + idxZ);
const MortonIndex mortonOtherParent = otherParent.getMortonIndex(inLevel-1) << 3;
const MortonIndex mortonOtherParent = otherParent.getMortonIndex() << 3;
// Get child
CellClass** const cells = getCellPt(mortonOtherParent, inLevel);
......@@ -1076,7 +1076,7 @@ public:
if(!FMath::Between(parentCell.getZ() + idxZ,0,boxLimite)) continue;
const FTreeCoordinate otherParent(parentCell.getX() + idxX,parentCell.getY() + idxY,parentCell.getZ() + idxZ);
const MortonIndex mortonOtherParent = otherParent.getMortonIndex(inLevel-1) << 3;
const MortonIndex mortonOtherParent = otherParent.getMortonIndex() << 3;
// Get child
CellClass** const cells = getCellPt(mortonOtherParent, inLevel);
......@@ -1173,7 +1173,7 @@ public:
}
const MortonIndex mortonOtherParent = otherParentInBox.getMortonIndex(inLevel-1) << 3;
const MortonIndex mortonOtherParent = otherParentInBox.getMortonIndex() << 3;
// Get child
CellClass** const cells = getCellPt(mortonOtherParent, inLevel);
......@@ -1270,7 +1270,7 @@ public:
}
const MortonIndex mortonOtherParent = otherParentInBox.getMortonIndex(inLevel-1) << 3;
const MortonIndex mortonOtherParent = otherParentInBox.getMortonIndex() << 3;
// Get child
CellClass** const cells = getCellPt(mortonOtherParent, inLevel);
......@@ -1353,7 +1353,7 @@ public:
// if we are not on the current cell
if( idxX || idxY || idxZ ){
const FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
const MortonIndex mortonOther = other.getMortonIndex();
// get cell
ContainerClass* const leaf = getLeafSrc(mortonOther);
// add to list if not null
......@@ -1393,7 +1393,7 @@ public:
// if we are not on the current cell
if( idxX || idxY || idxZ ){
const FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
const MortonIndex mortonOther = other.getMortonIndex();
// get cell
ContainerClass* const leaf = getLeafSrc(mortonOther);
// add to list if not null
......@@ -1436,7 +1436,7 @@ public:
// if we are not on the current cell
if( idxX || idxY || idxZ ){
const FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
const MortonIndex mortonOther = other.getMortonIndex();
// get cell
CellClass** const leaf = getCellPt(mortonOther, inLevel);
......@@ -1477,7 +1477,7 @@ public:
// if we are not on the current cell
if( idxX || idxY || idxZ ){
const FTreeCoordinate other(center.getX() + idxX,center.getY() + idxY,center.getZ() + idxZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
const MortonIndex mortonOther = other.getMortonIndex();
// get cell
CellClass** const leaf = getCellPt(mortonOther, inLevel);
......@@ -1567,7 +1567,7 @@ public:
}
other.setZ(otherZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
const MortonIndex mortonOther = other.getMortonIndex();
// get cell
ContainerClass* const leaf = getLeafSrc(mortonOther);
// add to list if not null
......@@ -1656,7 +1656,7 @@ public:
}
other.setZ(otherZ);
const MortonIndex mortonOther = other.getMortonIndex(inLevel);
const MortonIndex mortonOther = other.getMortonIndex();
// get cell
ContainerClass* const leaf = getLeafSrc(mortonOther);
// add to list if not null
......@@ -1746,4 +1746,3 @@ public:
};
#endif //FOCTREE_HPP
......@@ -1831,7 +1831,7 @@ protected:
otherParentInBox.setZ( otherParentInBox.getZ() - boxLimite );
}
const MortonIndex mortonOtherParent = otherParentInBox.getMortonIndex(inLevel-1);
const MortonIndex mortonOtherParent = otherParentInBox.getMortonIndex();
// For each child
for(int idxCousin = 0 ; idxCousin < 8 ; ++idxCousin){
......@@ -1871,7 +1871,7 @@ protected:
const FTreeCoordinate otherParent(parentCell.getX() + idxX,parentCell.getY() + idxY,parentCell.getZ() + idxZ);
const MortonIndex mortonOtherParent = otherParent.getMortonIndex(inLevel-1);
const MortonIndex mortonOtherParent = otherParent.getMortonIndex();
// For each child
for(int idxCousin = 0 ; idxCousin < 8 ; ++idxCousin){
......
......@@ -143,7 +143,7 @@ private:
return FCoordinateComputer::
GetCoordinateFromPosition(_boxCenter, _boxWidth,
_divisionLevel, getPosition()).
getMortonIndex(_divisionLevel);
getMortonIndex();
}
......
......@@ -101,7 +101,7 @@ public:
host.setZ( FCoordinateComputer::GetTreeCoordinate<FReal>( originalParticlesUnsorted[idxPart].particle.getPosition().getZ() - boxCorner.getZ(), loader.getBoxWidth(), boxWidthAtLeafLevel,
TreeHeight ));
originalParticlesUnsorted[idxPart].index = host.getMortonIndex(TreeHeight - 1);
originalParticlesUnsorted[idxPart].index = host.getMortonIndex();
}
// Sort particles
......@@ -140,7 +140,7 @@ public:
host.setZ( FCoordinateComputer::GetTreeCoordinate<FReal>( originalParticlesUnsorted[idxPart].particle.getPosition().getZ() - boxCorner.getZ(), boxWidth, boxWidthAtLeafLevel,
TreeHeight ));
originalParticlesUnsorted[idxPart].index = host.getMortonIndex(TreeHeight - 1);
originalParticlesUnsorted[idxPart].index = host.getMortonIndex();
}
FLOG( FLog::Controller << "Particles Distribution: " << "\tPrepare particles (" << counterTime.tacAndElapsed() << "s)\n"; FLog::Controller.flush(); );
......
......@@ -108,7 +108,7 @@ public:
boxWidth,boxWidthAtLeafLevel, NbLevels )
);
// Store morton index and original idx
particleIndexes[idxParts].mindex = host.getMortonIndex(NbLevels-1);
particleIndexes[idxParts].mindex = host.getMortonIndex();
particleIndexes[idxParts].particlePositionInArray = idxParts;
}
......
......@@ -147,7 +147,7 @@ protected:
MortonIndex interactionsIndexes[26];
int interactionsPosition[26];
FTreeCoordinate coord(mindex, tree->getHeight()-1);
FTreeCoordinate coord(mindex);
int counter = coord.getNeighborsIndexes(tree->getHeight(),interactionsIndexes,interactionsPosition);
for(int idxInter = 0 ; idxInter < counter ; ++idxInter){
......@@ -234,7 +234,7 @@ protected:
MortonIndex interactionsIndexes[189];
int interactionsPosition[189];
const FTreeCoordinate coord(mindex, idxLevel);
const FTreeCoordinate coord(mindex);
int counter = coord.getInteractionNeighbors(idxLevel,interactionsIndexes,interactionsPosition);
for(int idxInter = 0 ; idxInter < counter ; ++idxInter){
......@@ -618,7 +618,7 @@ protected:
MortonIndex interactionsIndexes[26];
int interactionsPosition[26];
FTreeCoordinate coord(mindex, tree->getHeight()-1);
FTreeCoordinate coord(mindex);
int counter = coord.getNeighborsIndexes(tree->getHeight(),interactionsIndexes,interactionsPosition);
ParticleContainerClass interactionsObjects[26];
......@@ -673,11 +673,11 @@ protected:
FAssertLF(containers->getLeafMortonIndex((*outsideInteractions)[outInterIdx].insideIdxInBlock) == (*outsideInteractions)[outInterIdx].insideIndex);
ParticleContainerClass* ptrLeaf = &interParticles;
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].insideIndex, tree->getHeight()-1),
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].insideIndex),
&particles , &ptrLeaf, &(*outsideInteractions)[outInterIdx].relativeOutPosition, 1);
const int otherPosition = getOppositeNeighIndex((*outsideInteractions)[outInterIdx].relativeOutPosition);
ptrLeaf = &particles;
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].outIndex, tree->getHeight()-1),
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].outIndex),
&interParticles , &ptrLeaf, &otherPosition, 1);
}
}
......
......@@ -204,7 +204,7 @@ protected:
MortonIndex interactionsIndexes[26];
int interactionsPosition[26];
FTreeCoordinate coord(mindex, tree->getHeight()-1);
FTreeCoordinate coord(mindex);
int counter = coord.getNeighborsIndexes(tree->getHeight(),interactionsIndexes,interactionsPosition);
for(int idxInter = 0 ; idxInter < counter ; ++idxInter){
......@@ -291,7 +291,7 @@ protected:
MortonIndex interactionsIndexes[189];
int interactionsPosition[189];
const FTreeCoordinate coord(mindex, idxLevel);
const FTreeCoordinate coord(mindex);
int counter = coord.getInteractionNeighbors(idxLevel,interactionsIndexes,interactionsPosition);
for(int idxInter = 0 ; idxInter < counter ; ++idxInter){
......@@ -777,11 +777,11 @@ protected:
FAssertLF(containers->getLeafMortonIndex((*outsideInteractions)[outInterIdx].insideIdxInBlock) == (*outsideInteractions)[outInterIdx].insideIndex);
ParticleContainerClass* ptrLeaf = &interParticles;
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].insideIndex, tree->getHeight()-1),
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].insideIndex),
&particles , &ptrLeaf, &(*outsideInteractions)[outInterIdx].relativeOutPosition, 1);
const int otherPosition = getOppositeNeighIndex((*outsideInteractions)[outInterIdx].relativeOutPosition);
ptrLeaf = &particles;
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].outIndex, tree->getHeight()-1),
kernel->P2POuter( FTreeCoordinate((*outsideInteractions)[outInterIdx].outIndex),
&interParticles , &ptrLeaf, &otherPosition, 1);
}
}
......@@ -816,7 +816,7 @@ protected:
MortonIndex interactionsIndexes[26];
int interactionsPosition[26];
FTreeCoordinate coord(mindex, tree->getHeight()-1);
FTreeCoordinate coord(mindex);
int counter = coord.getNeighborsIndexes(tree->getHeight(),interactionsIndexes,interactionsPosition);
ParticleContainerClass interactionsObjects[26];
......
......@@ -203,7 +203,7 @@ public:
const FTreeCoordinate host = FCoordinateComputer::GetCoordinateFromPositionAndCorner<FReal>(this->boxCorner, this->boxWidth,
treeHeight,
FPoint<FReal>(xpos[idxPart], ypos[idxPart], zpos[idxPart]) );
const MortonIndex particleIndex = host.getMortonIndex(treeHeight-1);
const MortonIndex particleIndex = host.getMortonIndex();
particlesToSort[idxPart].mindex = particleIndex;
particlesToSort[idxPart].originalIndex = idxPart;
}
......@@ -260,7 +260,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
// Add leaf
......@@ -344,7 +344,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
......@@ -405,7 +405,7 @@ public:
const FTreeCoordinate host = FCoordinateComputer::GetCoordinateFromPositionAndCorner<FReal>(this->boxCorner, this->boxWidth,
treeHeight,
FPoint<FReal>(xpos[idxPart], ypos[idxPart], zpos[idxPart]) );
const MortonIndex particleIndex = host.getMortonIndex(treeHeight-1);
const MortonIndex particleIndex = host.getMortonIndex();
particlesToSort[idxPart].mindex = particleIndex;
particlesToSort[idxPart].originalIndex = idxPart;
}
......@@ -466,7 +466,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
// Add leaf
......@@ -551,7 +551,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
......@@ -606,7 +606,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
......
......@@ -243,7 +243,7 @@ public:
const FTreeCoordinate host = FCoordinateComputer::GetCoordinateFromPositionAndCorner<FReal>(this->boxCorner, this->boxWidth,
treeHeight,
inParticlesContainer[idxPart].pos);
const MortonIndex particleIndex = host.getMortonIndex(treeHeight-1);
const MortonIndex particleIndex = host.getMortonIndex();
inParticlesContainer[idxPart].mindex = particleIndex;
inParticlesContainer[idxPart].originalIndex = idxPart;
}
......@@ -296,7 +296,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
}
......@@ -397,7 +397,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
......@@ -458,7 +458,7 @@ public:
const FTreeCoordinate host = FCoordinateComputer::GetCoordinateFromPositionAndCorner<FReal>(this->boxCorner, this->boxWidth,
treeHeight,
inParticlesContainer[idxPart].pos);
const MortonIndex particleIndex = host.getMortonIndex(treeHeight-1);
const MortonIndex particleIndex = host.getMortonIndex();
inParticlesContainer[idxPart].mindex = particleIndex;
inParticlesContainer[idxPart].originalIndex = idxPart;
}
......@@ -513,7 +513,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
}
......@@ -615,7 +615,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
......@@ -671,7 +671,7 @@ public:
CompositeCellClass newNode = newBlock->getCompleteCell(cellIdInBlock);
newNode.setMortonIndex(currentBlockIndexes[cellIdInBlock]);
FTreeCoordinate coord;
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock], idxLevel);
coord.setPositionFromMorton(currentBlockIndexes[cellIdInBlock]);
newNode.setCoordinate(coord);
}
......@@ -881,4 +881,3 @@ public:
};
#endif // FGROUPTREEDYN_HPP
......@@ -4,13 +4,13 @@
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
#ifndef FABSTRACTSPHERICALKERNEL_HPP
......@@ -71,7 +71,7 @@ protected:
for(int idxChild = 0 ; idxChild < 8 ; ++idxChild ){
FTreeCoordinate childBox;
childBox.setPositionFromMorton(idxChild,1);
childBox.setPositionFromMorton(idxChild);
const FPoint<FReal> M2MVector (
father.getX() - (treeWidthAtLevel * FReal(1 + (childBox.getX() * 2))),
......@@ -627,7 +627,7 @@ private:
harmonic.result(index_j_k) *= local_exp[index_j_k];
result += harmonic.result(index_j_k).getReal();
++index_j_k;
++index_j_k;
// k>0
for (int k = 1 ; k <= j ; ++k, ++index_j_k){
......@@ -683,5 +683,3 @@ public:
#endif //FABSTRACTSPHERICALKERNEL_HPP
......@@ -115,7 +115,7 @@ int main(int argc, char* argv[]){
loader.getBoxWidth(),
NbLevels,
myParticles[myParticles.getSize()-1].position );
const MortonIndex myLeftLimite = host.getMortonIndex(NbLevels-1);
const MortonIndex myLeftLimite = host.getMortonIndex();
MortonIndex leftLimite = -1;
if(mpiComm.global().processId() != 0){
FMpi::Assert(MPI_Recv(&leftLimite, sizeof(leftLimite), MPI_BYTE,
......
......@@ -124,7 +124,7 @@ int main(int argc, char* argv[]){
loader.getBoxWidth(),
TreeHeight,
myParticles[myParticles.getSize()-1].position );
const MortonIndex myLeftLimite = host.getMortonIndex(TreeHeight-1);
const MortonIndex myLeftLimite = host.getMortonIndex();
MortonIndex leftLimite = -1;
if(mpiComm.global().processId() != 0){
FMpi::Assert(MPI_Recv(&leftLimite, sizeof(leftLimite), MPI_BYTE,
......
......@@ -128,7 +128,7 @@ int main(int argc, char* argv[]){
loader.getBoxWidth(),
TreeHeight,
myParticles[myParticles.getSize()-1].position );
const MortonIndex myLeftLimite = host.getMortonIndex(TreeHeight-1);
const MortonIndex myLeftLimite = host.getMortonIndex();
MortonIndex leftLimite = -1;
if(mpiComm.global().processId() != 0){
FMpi::Assert(MPI_Recv(&leftLimite, sizeof(leftLimite), MPI_BYTE,
......
......@@ -135,7 +135,7 @@ int main(int argc, char* argv[]){
loader.getBoxWidth(),
TreeHeight,
myParticles[myParticles.getSize()-1].position );
const MortonIndex myLeftLimite = host.getMortonIndex(TreeHeight-1);
const MortonIndex myLeftLimite = host.getMortonIndex();
MortonIndex leftLimite = -1;
if(mpiComm.global().processId() != 0){
FMpi::Assert(MPI_Recv(&leftLimite, sizeof(leftLimite), MPI_BYTE,
......
......@@ -126,7 +126,7 @@ int main(int argc, char ** argv){
}while(sscanf(buffer,"%d %d %d",&x,&y,&z) != 3);
FTreeCoordinate coord(x,y,z);
const MortonIndex index = coord.getMortonIndex(requiredlevel) ;
const MortonIndex index = coord.getMortonIndex() ;
std::cout << " Morton Index is " << index << " \t " << std::hex << index << "H \t " << MortonToBinary(index,requiredlevel) << "D\n\n";
}
break;
......@@ -158,7 +158,7 @@ int main(int argc, char ** argv){
host.setY( int(FMath::dfloor(( FReal(y) - centerOfBox.getY() - rootBoxWidth/2) / boxWidthAtThisLevel ) ));
host.setZ( int(FMath::dfloor(( FReal(z) - centerOfBox.getZ() - rootBoxWidth/2) / boxWidthAtThisLevel ) ));
const MortonIndex index = host.getMortonIndex(requiredlevel);
const MortonIndex index = host.getMortonIndex();
std::cout << " Morton Index is " << index << " \t " << std::hex << index << "h \t " << MortonToBinary(index,requiredlevel) << "d\n\n";
}
break;
......@@ -193,7 +193,7 @@ int main(int argc, char ** argv){
for(int y = sy ; y <= ey ; ++y){
for(int x = sx ; x <= ex ; ++x){
FTreeCoordinate coord(x,y,z);
const MortonIndex index = coord.getMortonIndex(requiredlevel);
const MortonIndex index = coord.getMortonIndex();
std::cout << "[x = " << x << " y = " << y << " z = " << z << "]\n";
std::cout << " Morton Index is " << index << " \t " << std::hex << index << "H \t " << MortonToBinary(index,requiredlevel) << "D\n\n";
}
......@@ -219,7 +219,7 @@ int main(int argc, char ** argv){
for(int y = 0 ; y < maxBoxAtThisLevel ; ++y){
for(int x = 0 ; x < maxBoxAtThisLevel ; ++x){
FTreeCoordinate coord(x,y,z);
const MortonIndex index = coord.getMortonIndex(requiredlevel);
const MortonIndex index = coord.getMortonIndex();
std::cout << "[x = " << x << " y = " << y << " z = " << z << "]\n";
std::cout << " Morton Index is " << index << " \t " << std::hex << index << "H \t " << MortonToBinary(index,requiredlevel) << "D\n\n";
}
......
......@@ -185,7 +185,7 @@ int main(int argc, char** argv){
host.setZ( FCoordinateComputer::GetTreeCoordinate<FReal>( arrayOfParts[idxPart].getPosition().getZ() - boxCorner.getZ(), boxWidth, boxWidthAtLeafLevel, NbLevels ));
//Set Morton index from Tree Coordinate
arrayOfParts[idxPart].index = host.getMortonIndex(NbLevels - 1);
arrayOfParts[idxPart].index = host.getMortonIndex();
arrayOfParts[idxPart].indexInFile = idxPart;
}
......
......@@ -181,7 +181,7 @@ int main(int argc, char** argv){
host.setZ( FCoordinateComputer::GetTreeCoordinate<FReal>( arrayOfParts[idxPart].getPosition().getZ() - boxCorner.getZ(), boxWidth, boxWidthAtLeafLevel, NbLevels ));
//Set Morton index from Tree Coordinate
arrayOfParts[idxPart].index = host.getMortonIndex(NbLevels - 1);
arrayOfParts[idxPart].index = host.getMortonIndex();
arrayOfParts[idxPart].indexInFile = idxPart;
}
......
......@@ -4,13 +4,13 @@
// This software is a computer program whose purpose is to compute the FMM.
//
// This software is governed by the CeCILL-C and LGPL licenses and
// abiding by the rules of distribution of free software.
//
// abiding by the rules of distribution of free software.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public and CeCILL-C Licenses for more details.
// "http://www.cecill.info".
// "http://www.cecill.info".
// "http://www.gnu.org/licenses".
// ===================================================================================
......@@ -483,7 +483,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
const FTreeCoordinate boundaryCoord(realCoord.getX() + offsetAtLevel,
realCoord.getY() + offsetAtLevel,
realCoord.getZ() + offsetAtLevel);
const MortonIndex boundaryIndex = boundaryCoord.getMortonIndex(idxLevel + diffLevel);
const MortonIndex boundaryIndex = boundaryCoord.getMortonIndex();
uassert((boundaryIndex & ~((~0LL)<<3*idxLevel))== iter.getCurrentGlobalIndex());
......@@ -545,7 +545,7 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
const FTreeCoordinate boundaryCoord(realCoord.getX() + offsetAtLevel,
realCoord.getY() + offsetAtLevel,
realCoord.getZ() + offsetAtLevel);
const MortonIndex boundaryIndex = boundaryCoord.getMortonIndex(idxLevel + diffLevel);
const MortonIndex boundaryIndex = boundaryCoord.getMortonIndex();
uassert((boundaryIndex & ~((~0LL)<<3*idxLevel))== iter.getCurrentGlobalIndex());
......@@ -638,7 +638,3 @@ class TestChebyshevDirect : public FUTester<TestChebyshevDirect> {
// You must do this
TestClass(TestChebyshevDirect)
......@@ -30,46 +30,46 @@ class TestMorton : public FUTester<TestMorton> {
{
FTreeCoordinate pos(5,1,7);
FTreeCoordinate cp;
cp.setPositionFromMorton(pos.getMortonIndex(10),10);
cp.setPositionFromMorton(pos.getMortonIndex(),10);
uassert(pos == cp);
uassert(cp.getMortonIndex(10) == pos.getMortonIndex(10));
uassert(cp.getMortonIndex() == pos.getMortonIndex());
}
{
FTreeCoordinate pos(2,8,3);
FTreeCoordinate cp;
cp.setPositionFromMorton(pos.getMortonIndex(10),10);
cp.setPositionFromMorton(pos.getMortonIndex(),10);
uassert(pos == cp);
uassert(cp.getMortonIndex(10) == pos.getMortonIndex(10));
uassert(cp.getMortonIndex() == pos.getMortonIndex());
}
{
FTreeCoordinate pos(51,11,47);
FTreeCoordinate cp;
cp.setPositionFromMorton(pos.getMortonIndex(10),10);
cp.setPositionFromMorton(pos.getMortonIndex(),10);
uassert(pos == cp);
uassert(cp.getMortonIndex(10) == pos.getMortonIndex(10));
uassert(cp.getMortonIndex() == pos.getMortonIndex());
}
}
void Position(){
{
FTreeCoordinate pos(0,0,0);
uassert(pos.getMortonIndex(1) == 0);
uassert(pos.getMortonIndex() == 0);
}
{
FTreeCoordinate pos(1,1,1);
uassert(pos.getMortonIndex(1) == 7);
uassert(pos.getMortonIndex() == 7);
}
{
FTreeCoordinate pos(0,1,1);
uassert(pos.getMortonIndex(1) == 3);
uassert(pos.getMortonIndex() == 3);
}
{
FTreeCoordinate pos(2,2,2);
uassert(pos.getMortonIndex(2) == (7 << 3) );
uassert(pos.getMortonIndex() == (7 << 3) );
}
{
FTreeCoordinate pos(1,2,4);
uassert(pos.getMortonIndex(3) == 84 );// 001 010 100 =>> 001010100 => 84d
uassert(pos.getMortonIndex() == 84 );// 001 010 100 =>> 001010100 => 84d
}
}
......
......@@ -129,7 +129,7 @@ class TestMpiTreeBuilder : public FUTesterMpi< class TestMpiTreeBuilder> {
host.setZ( FCoordinateComputer::GetTreeCoordinate<FReal>( arrayOfParticles[idxParts].getPosition().getZ() - boxCorner.getZ(), boxWidth, boxWidthAtLeafLevel, TreeHeight ));
//Set Morton index from Tree Coordinate
arrayOfParticles[idxParts].index = host.getMortonIndex(TreeHeight - 1);
arrayOfParticles[idxParts].index = host.getMortonIndex();