Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit 28464609 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Fix for chebInterface and hibox

parent 970a66a9
...@@ -447,6 +447,17 @@ typedef void (*Callback_P2PFull)(FSize nbParticles, const FSize* particleIndexes ...@@ -447,6 +447,17 @@ typedef void (*Callback_P2PFull)(FSize nbParticles, const FSize* particleIndexes
typedef void (*Callback_P2PInner)(FSize nbParticles, const FSize* particleIndexes, void* userData); typedef void (*Callback_P2PInner)(FSize nbParticles, const FSize* particleIndexes, void* userData);
/**
* @brief Function to be filled by user's method to reset a user's cell
* @param level level of the cell.
* @param morton_index morton index of the cell to be allocated.
* @param tree_position int[3] position inside the tree (number of boxes in
* each direction)
* @param spatial_position double[3] center of the cell
* @param usercell ptr to user's cell
*/
typedef void (*Callback_reset_cell)(int level, long long morton_index, int* tree_position, double* spatial_position, void * userCell);
/** /**
* @brief Structure containing callbacks to fill in order to define * @brief Structure containing callbacks to fill in order to define
...@@ -522,7 +533,7 @@ void scalfmm_dealloc_handle(scalfmm_handle handle, Callback_free_cell cellDestro ...@@ -522,7 +533,7 @@ void scalfmm_dealloc_handle(scalfmm_handle handle, Callback_free_cell cellDestro
* and local development, forces and potentials) * and local development, forces and potentials)
* @param Handle scalfmm_handle provided by scalfmm_init. * @param Handle scalfmm_handle provided by scalfmm_init.
*/ */
void scalfmm_reset_tree(scalfmm_handle handle); void scalfmm_reset_tree(scalfmm_handle handle, Callback_reset_cell cellReseter);
/** /**
* @brief This function shouldn't be there !! display information * @brief This function shouldn't be there !! display information
......
...@@ -359,7 +359,7 @@ public: ...@@ -359,7 +359,7 @@ public:
//get back the potentials //get back the potentials
void get_potentials( int nbPotentials, double * potentialsToFill){ void get_potentials( int nbPotentials, double * potentialsToFill){
octree->forEachLeaf([&](LeafClass* leaf){ octree->forEachLeaf([&](LeafClass* leaf){
ContainerClass * sources = leaf->getSrc(); ContainerClass * sources = leaf->getTargets();
const FVector<FSize>& indexes = leaf->getTargets()->getIndexes(); const FVector<FSize>& indexes = leaf->getTargets()->getIndexes();
FSize nbPartThere = sources->getNbParticles(); FSize nbPartThere = sources->getNbParticles();
for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){ for(FSize idxPart = 0 ; idxPart<nbPartThere ; ++idxPart){
...@@ -519,7 +519,7 @@ public: ...@@ -519,7 +519,7 @@ public:
} }
//Simple call to FScalFMMEngine method with good template //Simple call to FScalFMMEngine method with good template
void reset_tree(){ void reset_tree(Callback_reset_cell /*not used*/){
generic_reset_tree<FReal,ContainerClass,InterCell,LeafClass>(octree); generic_reset_tree<FReal,ContainerClass,InterCell,LeafClass>(octree);
} }
......
...@@ -202,7 +202,7 @@ public: ...@@ -202,7 +202,7 @@ public:
FAssertLF(0,"No tree instancied, exiting ...\n"); FAssertLF(0,"No tree instancied, exiting ...\n");
} }
virtual void reset_tree(){ virtual void reset_tree(Callback_reset_cell cellReset){
} }
template<class FReal,class ContainerClass, class CellClass, class LeafClass> template<class FReal,class ContainerClass, class CellClass, class LeafClass>
...@@ -242,6 +242,8 @@ public: ...@@ -242,6 +242,8 @@ public:
FAssertLF(0,"No kernel set, cannot execute anything, exiting ...\n"); FAssertLF(0,"No kernel set, cannot execute anything, exiting ...\n");
} }
virtual void hibox_Rinflu_display(FSize nbPartIn, double *Rinflu){
}
}; };
...@@ -441,8 +443,12 @@ extern "C" void scalfmm_utils_interactionPosition(int interactionPosition, int* ...@@ -441,8 +443,12 @@ extern "C" void scalfmm_utils_interactionPosition(int interactionPosition, int*
} }
extern "C" void scalfmm_reset_tree(scalfmm_handle Handle){ extern "C" void scalfmm_reset_tree(scalfmm_handle Handle, Callback_reset_cell cellReseter){
((ScalFmmCoreHandle * ) Handle)->engine->reset_tree(); ((ScalFmmCoreHandle * ) Handle)->engine->reset_tree(cellReseter);
}
extern "C" void scalfmm_hibox_Rinflu_display(scalfmm_handle Handle, FSize nbPart, double * Rinflu){
((ScalFmmCoreHandle * ) Handle)->engine->hibox_Rinflu_display(nbPart, Rinflu);
} }
#endif #endif
...@@ -250,7 +250,7 @@ extern "C" void ChebKernel_L2P(void* leafCell, FSize nbParticles, const FSize* p ...@@ -250,7 +250,7 @@ extern "C" void ChebKernel_L2P(void* leafCell, FSize nbParticles, const FSize* p
forcesToFill[indexes[idxPart]*3+0] += tempContainer->getForcesX()[idxPart]; forcesToFill[indexes[idxPart]*3+0] += tempContainer->getForcesX()[idxPart];
forcesToFill[indexes[idxPart]*3+1] += tempContainer->getForcesY()[idxPart]; forcesToFill[indexes[idxPart]*3+1] += tempContainer->getForcesY()[idxPart];
forcesToFill[indexes[idxPart]*3+2] += tempContainer->getForcesZ()[idxPart]; forcesToFill[indexes[idxPart]*3+2] += tempContainer->getForcesZ()[idxPart];
potentialsToFill[indexes[idxPart]] =+ tempContainer->getPotentials()[idxPart]; potentialsToFill[indexes[idxPart]] += tempContainer->getPotentials()[idxPart];
} }
delete tempContainer; delete tempContainer;
...@@ -317,7 +317,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes, ...@@ -317,7 +317,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes,
forcesToFill[indexes[idxPart]*3+0] += tempContTarget->getForcesX()[idxPart]; forcesToFill[indexes[idxPart]*3+0] += tempContTarget->getForcesX()[idxPart];
forcesToFill[indexes[idxPart]*3+1] += tempContTarget->getForcesY()[idxPart]; forcesToFill[indexes[idxPart]*3+1] += tempContTarget->getForcesY()[idxPart];
forcesToFill[indexes[idxPart]*3+2] += tempContTarget->getForcesZ()[idxPart]; forcesToFill[indexes[idxPart]*3+2] += tempContTarget->getForcesZ()[idxPart];
potentialsToFill[indexes[idxPart]] =+ tempContTarget->getPotentials()[idxPart]; potentialsToFill[indexes[idxPart]] += tempContTarget->getPotentials()[idxPart];
} }
//Note that sources are also modified. //Note that sources are also modified.
...@@ -329,7 +329,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes, ...@@ -329,7 +329,7 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes,
forcesToFill[indexesSource[idxSourcePart]*3+0] += tempContSources[idSource]->getForcesX()[idxSourcePart]; forcesToFill[indexesSource[idxSourcePart]*3+0] += tempContSources[idSource]->getForcesX()[idxSourcePart];
forcesToFill[indexesSource[idxSourcePart]*3+1] += tempContSources[idSource]->getForcesY()[idxSourcePart]; forcesToFill[indexesSource[idxSourcePart]*3+1] += tempContSources[idSource]->getForcesY()[idxSourcePart];
forcesToFill[indexesSource[idxSourcePart]*3+2] += tempContSources[idSource]->getForcesZ()[idxSourcePart]; forcesToFill[indexesSource[idxSourcePart]*3+2] += tempContSources[idSource]->getForcesZ()[idxSourcePart];
potentialsToFill[indexesSource[idxSourcePart]] =+ tempContSources[idSource]->getPotentials()[idxSourcePart]; potentialsToFill[indexesSource[idxSourcePart]] += tempContSources[idSource]->getPotentials()[idxSourcePart];
} }
} }
...@@ -340,6 +340,10 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes, ...@@ -340,6 +340,10 @@ void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes,
delete tempContTarget; delete tempContTarget;
} }
void ChebCell_reset(int level, long long morton_index, int* tree_position, double* spatial_position, void * userCell){
ChebCellStruct * cellStruct = reinterpret_cast<ChebCellStruct *>(userCell);
FChebCell<double,7>* chebCell = cellStruct->cell;
chebCell->resetToInitialState();
}
#endif #endif
...@@ -492,6 +492,28 @@ public: ...@@ -492,6 +492,28 @@ public:
} }
void reset_tree(Callback_reset_cell cellReset){
double boxwidth = octree->getBoxWidth();
FPoint<FReal> BoxCenter = octree->getBoxCenter();
double boxCorner[3];
boxCorner[0] = BoxCenter.getX() - boxwidth/2.0;
boxCorner[1] = BoxCenter.getY() - boxwidth/2.0;
boxCorner[2] = BoxCenter.getZ() - boxwidth/2.0;
//apply user function reset on each user's cell
octree->forEachCellWithLevel([&](CoreCell * currCell,const int currLevel){
if(currCell->getContainer()){
FTreeCoordinate currCoord = currCell->getCoordinate();
int arrayCoord[3] = {currCoord.getX(),currCoord.getY(),currCoord.getZ()};
MortonIndex currMorton = currCoord.getMortonIndex(currLevel);
double position[3];
position[0] = boxCorner[0] + currCoord.getX()*boxwidth/double(1<<currLevel);
position[1] = boxCorner[1] + currCoord.getY()*boxwidth/double(1<<currLevel);
position[2] = boxCorner[2] + currCoord.getZ()*boxwidth/double(1<<currLevel);
cellReset(currLevel,currMorton,arrayCoord,position,currCell->getContainer());
}
});
}
void intern_dealloc_handle(Callback_free_cell userDeallocator){ void intern_dealloc_handle(Callback_free_cell userDeallocator){
free_cell(userDeallocator); free_cell(userDeallocator);
} }
......
...@@ -56,6 +56,8 @@ void ChebKernel_L2P(void* leafCell, FSize nbParticles, const FSize* particleInde ...@@ -56,6 +56,8 @@ void ChebKernel_L2P(void* leafCell, FSize nbParticles, const FSize* particleInde
void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes, void ChebKernel_P2P(FSize nbParticles, const FSize* particleIndexes,
const FSize * sourceParticleIndexes[27], FSize sourceNbPart[27],void* userData); const FSize * sourceParticleIndexes[27], FSize sourceNbPart[27],void* userData);
void ChebCell_reset(int level, long long morton_index, int* tree_position, double* spatial_position, void * userCell);
typedef struct myUserDatas{ typedef struct myUserDatas{
ChebKernelStruct * kernelStruct; ChebKernelStruct * kernelStruct;
double * insertedPositions; double * insertedPositions;
......
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