Commit cc1bda3a authored by COULAUD Olivier's avatar COULAUD Olivier

Now we use scaoed enum for OPENMP priorities ; Rename typed particles (source,...

Now we use scaoed enum for OPENMP priorities ; Rename typed particles (source, target) rather than FParticleSource
parent de34b700
......@@ -7,6 +7,14 @@ This file contains the main features as well as overviews of specific
bug fixes (and other actions) for each version of ScalFMM since
version 1.1
2.0
-----
- New API for Kernels (The same kernel can be used witth all Octree)
- Use scoped enum (FParticleTYpe (target,source), OPM4_Priorities, ...
- StarPU wprks with Duplicate and Let trees with MPI (STF approach)
- Remove all warnings with gcc 7.2
- std::complex is used for equispaced interpolation
-
1.5
-----
......
......@@ -71,7 +71,7 @@ public:
const MortonIndex particuleIndex = tree->getMortonFromPosition(currentPart);
if(particuleIndex != currentMortonIndex){
//Need to move this one
interface->removeFromLeafAndKeep(particles,currentPart,idxPart,FParticleType::FParticleTypeSource);
interface->removeFromLeafAndKeep(particles,currentPart,idxPart,FParticleType::source);
}
else{
//Need to increment idx;
......@@ -88,7 +88,7 @@ public:
const MortonIndex particuleIndex = tree->getMortonFromPosition(currentPart);
if(particuleIndex != currentMortonIndex){
//Need to move this one
interface->removeFromLeafAndKeep(particleTargets,currentPart,idxPart, FParticleType::FParticleTypeTarget);
interface->removeFromLeafAndKeep(particleTargets,currentPart,idxPart, FParticleType::target);
}
else{
//Need to increment idx;
......
......@@ -33,11 +33,11 @@ public:
for(int idxAttr = 0 ; idxAttr < ContainerClass::NbAttributes ; ++idxAttr){
particleValues[idxAttr] = lf->getAttribute(idxAttr)[idxPart];
}
if(type == FParticleType::FParticleTypeTarget){
toStoreRemovedTargetParts.push(particlePos,FParticleType::FParticleTypeTarget,lf->getIndexes()[idxPart],particleValues);
if(type == FParticleType::target){
toStoreRemovedTargetParts.push(particlePos,FParticleType::target,lf->getIndexes()[idxPart],particleValues);
}
else{
toStoreRemovedSourceParts.push(particlePos,FParticleType::FParticleTypeSource,lf->getIndexes()[idxPart],particleValues);
toStoreRemovedSourceParts.push(particlePos,FParticleType::source,lf->getIndexes()[idxPart],particleValues);
}
lf->removeParticles(&idxPart,1);
}
......@@ -53,7 +53,7 @@ public:
const FPoint<FReal> particlePos(toStoreRemovedSourceParts.getPositions()[0][idxToInsert],
toStoreRemovedSourceParts.getPositions()[1][idxToInsert],
toStoreRemovedSourceParts.getPositions()[2][idxToInsert]);
tree->insert(particlePos, FParticleType::FParticleTypeSource, toStoreRemovedSourceParts.getIndexes()[idxToInsert], particleValues);
tree->insert(particlePos, FParticleType::source, toStoreRemovedSourceParts.getIndexes()[idxToInsert], particleValues);
}
for(FSize idxToInsert = 0; idxToInsert<toStoreRemovedTargetParts.getNbParticles() ; ++idxToInsert){
......@@ -64,7 +64,7 @@ public:
toStoreRemovedTargetParts.getPositions()[1][idxToInsert],
toStoreRemovedTargetParts.getPositions()[2][idxToInsert]);
tree->insert(particlePos, FParticleType::FParticleTypeTarget, toStoreRemovedTargetParts.getIndexes()[idxToInsert], particleValues);
tree->insert(particlePos, FParticleType::target, toStoreRemovedTargetParts.getIndexes()[idxToInsert], particleValues);
}
toStoreRemovedSourceParts.clear();
......
......@@ -6,8 +6,8 @@
* @brief The FParticleType enum is to make a difference between Target and Source (Tsm)
*/
enum class FParticleType {
FParticleTypeSource,
FParticleTypeTarget
source,
target
// FParticleTypeSource = 0,
// FParticleTypeTarget = 1
};
......
......@@ -37,7 +37,7 @@ public:
*/
template<typename... Args>
void push(const FPoint<FReal>& inParticlePosition, const FParticleType type, Args ... args){
if(type == FParticleType::FParticleTypeTarget) {
if(type == FParticleType::FParticleType::target) {
targets.push(inParticlePosition, args...);
// targets.push(inParticlePosition, FParticleType::FParticleTypeTarget, args...);
}
......
......@@ -117,8 +117,10 @@ public:
inParticlePositions->setPosition(x,y,z);
*inPhysicalValue = data;
if(isTarget) (*particleType) = FParticleType::FParticleTypeTarget;
else (*particleType) = FParticleType::FParticleTypeSource;
if(isTarget){
(*particleType) = FParticleType::target;}
else {
(*particleType) = FParticleType::source;}
}
};
......
......@@ -110,8 +110,8 @@ public:
void fillParticle(FPoint<FReal>*const inParticlePositions, FParticleType*const isTarget){
FRandomLoader<FReal>::fillParticle(inParticlePositions);
if(FRandomLoader<FReal>::getRandom() > 0.5 ) (*isTarget) = FParticleType::FParticleTypeTarget;
else (*isTarget) = FParticleType::FParticleTypeSource;
if(FRandomLoader<FReal>::getRandom() > 0.5 ) (*isTarget) = FParticleType::target;
else (*isTarget) = FParticleType::source;
}
};
......
......@@ -395,7 +395,7 @@ int main(int argc, char ** argv){
for(int idx = 0 ; idx < finalParticles.getSize(); ++idx){
realTree.insert(finalParticles[idx].position,
finalParticles[idx].isSource? FParticleType::FParticleTypeSource: FParticleType::FParticleTypeTarget);
finalParticles[idx].isSource? FParticleType::source: FParticleType::target);
}
delete[] particles;
......
......@@ -5,31 +5,31 @@
#include <cstdio>
#include <cstdlib>
#include "../../Src/Utils/FTic.hpp"
#include "Utils/FTic.hpp"
#include "../../Src/Containers/FOctree.hpp"
#include "../../Src/Containers/FVector.hpp"
#include "../../Src/Utils/FParameters.hpp"
#include "Containers/FOctree.hpp"
#include "Containers/FVector.hpp"
#include "Utils/FParameters.hpp"
#include "../../Src/Components/FTypedLeaf.hpp"
#include "Components/FTypedLeaf.hpp"
#include "../../Src/Utils/FPoint.hpp"
#include "Utils/FPoint.hpp"
#include "../../Src/Components/FTestCell.hpp"
#include "../../Src/Components/FTestKernels.hpp"
#include "Components/FTestCell.hpp"
#include "Components/FTestKernels.hpp"
#include "../../Src/Extensions/FExtendCellType.hpp"
#include "Extensions/FExtendCellType.hpp"
#include "../../Src/Core/FFmmAlgorithmTsm.hpp"
#include "../../Src/Core/FFmmAlgorithmThreadTsm.hpp"
#include "Core/FFmmAlgorithmTsm.hpp"
#include "Core/FFmmAlgorithmThreadTsm.hpp"
#include "../../Src/Components/FBasicKernels.hpp"
#include "Components/FBasicKernels.hpp"
#include "../../Src/Files/FRandomLoader.hpp"
#include "Files/FRandomLoader.hpp"
#include "../../Src/Components/FTestParticleContainer.hpp"
#include "Components/FTestParticleContainer.hpp"
#include "../../Src/Utils/FParameterNames.hpp"
#include "Utils/FParameterNames.hpp"
/** This program show an example of use of
* the fmm basic algo
......
......@@ -83,7 +83,7 @@ int main(int argc, char ** argv){
(BoxWidth*FReal(drand48())) + (BoxCenter-(BoxWidth/2)),
(BoxWidth*FReal(drand48())) + (BoxCenter-(BoxWidth/2)),
(BoxWidth*FReal(drand48())) + (BoxCenter-(BoxWidth/2)));
tree.insert(particleToFill,FParticleType::FParticleTypeSource,idxPart);
tree.insert(particleToFill,FParticleType::source,idxPart);
}
for(FSize idxPart = 0 ; idxPart < NbPart_Target; ++idxPart){
......@@ -91,7 +91,7 @@ int main(int argc, char ** argv){
(BoxWidth*FReal(drand48())) + (BoxCenter-(BoxWidth/2)),
(BoxWidth*FReal(drand48())) + (BoxCenter-(BoxWidth/2)),
(BoxWidth*FReal(drand48())) + (BoxCenter-(BoxWidth/2)));
tree.insert(particleToFill,FParticleType::FParticleTypeTarget,idxPart);
tree.insert(particleToFill,FParticleType::target,idxPart);
}
}
......
......@@ -54,7 +54,7 @@ class TestChebyshevDirectTsm : public FUTester<TestChebyshevDirectTsm> {
FPoint<FReal> position;
loader.fillParticle(&position);
// put in tree
tree.insert(position, FParticleType::FParticleTypeTarget, idxPart, physicalValue);
tree.insert(position, FParticleType::target, idxPart, physicalValue);
// get copy
particlesTargets[idxPart].setPosition(position);
*(particlesTargets[idxPart].setPhysicalValue()) = physicalValue;
......@@ -69,7 +69,7 @@ class TestChebyshevDirectTsm : public FUTester<TestChebyshevDirectTsm> {
FPoint<FReal> position;
loader.fillParticle(&position);
// put in tree
tree.insert(position, FParticleType::FParticleTypeSource, idxPart, physicalValue);
tree.insert(position, FParticleType::source, idxPart, physicalValue);
// get copy
particlesSources[idxPart].setPosition(position);
*(particlesSources[idxPart].setPhysicalValue()) = physicalValue;
......
......@@ -53,7 +53,7 @@ class TestRotationDirectTsm : public FUTester<TestRotationDirectTsm> {
FPoint<FReal> position;
loader.fillParticle(&position);
// put in tree
tree.insert(position, FParticleType::FParticleTypeTarget, idxPart, physicalValue);
tree.insert(position, FParticleType::target, idxPart, physicalValue);
// get copy
particlesTargets[idxPart].setPosition(position);
*(particlesTargets[idxPart].setPhysicalValue()) = physicalValue;
......@@ -68,7 +68,7 @@ class TestRotationDirectTsm : public FUTester<TestRotationDirectTsm> {
FPoint<FReal> position;
loader.fillParticle(&position);
// put in tree
tree.insert(position, FParticleType::FParticleTypeSource, idxPart, physicalValue);
tree.insert(position, FParticleType::source, idxPart, physicalValue);
// get copy
particlesSources[idxPart].setPosition(position);
*(particlesSources[idxPart].setPhysicalValue()) = physicalValue;
......
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