Commit 2bd08125 authored by berenger-bramas's avatar berenger-bramas
Browse files

Changed files/clases names

Tos to Tsm (Targets Sources Model)

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@39 2616d619-271b-44dc-8df4-d4a8f33a7222
parent ac8a201e
......@@ -44,13 +44,13 @@ public:
*/
virtual void setPosition(const F3DPosition& inPosition) = 0;
/** Because the system can run in ToS mode
/** Because the system can run in Tsm mode
* a cell has to express if it has sources
* @return true if there are sources particules inside
*/
virtual bool hasSourcesChild() const = 0;
/** Because the system can run in ToS mode
/** Because the system can run in Tsm mode
* a cell has to express if it has targets
* @return true if there are targets particules inside
*/
......
......@@ -149,13 +149,13 @@ void ValidateFMMAlgo(FOctree<ParticuleClass, CellClass, LeafClass, TreeHeight ,
do{
typename FList<ParticuleClass*>::BasicIterator iter(*octreeIterator.getCurrentListTargets());
const bool isUsingToS = (octreeIterator.getCurrentListTargets() != octreeIterator.getCurrentListSources());
const bool isUsingTsm = (octreeIterator.getCurrentListTargets() != octreeIterator.getCurrentListSources());
while( iter.isValide() ){
// If a particules has been impacted by less than NbPart - 1 (the current particule)
// there is a problem
if( (!isUsingToS && iter.value()->getDataDown() != NbPart - 1) ||
(isUsingToS && iter.value()->getDataDown() != NbPart) ){
if( (!isUsingTsm && iter.value()->getDataDown() != NbPart - 1) ||
(isUsingTsm && iter.value()->getDataDown() != NbPart) ){
std::cout << "Problem L2P + P2P : " << iter.value()->getDataDown() << "\n";
}
iter.progress();
......
#ifndef FFMMALGORITHMTOS_HPP
#define FFMMALGORITHMTOS_HPP
#ifndef FFMMALGORITHMTSM_HPP
#define FFMMALGORITHMTSM_HPP
// /!\ Please, you must read the license at the bottom of this page
#include "../Utils/FAssertable.hpp"
......@@ -12,7 +12,7 @@
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FFmmAlgorithmToS
* @class FFmmAlgorithmTsm
* @brief
* Please read the license
*
......@@ -25,7 +25,7 @@ template<template< class ParticuleClass, class CellClass, int OctreeHeight> clas
class ParticuleClass, class CellClass,
template<class ParticuleClass> class LeafClass,
int OctreeHeight, int SubtreeHeight>
class FFmmAlgorithmToS : protected FAssertable{
class FFmmAlgorithmTsm : protected FAssertable{
// To reduce the size of variable type based on foctree in this file
typedef FOctree<ParticuleClass, CellClass, LeafClass, OctreeHeight, SubtreeHeight> Octree;
typedef typename FOctree<ParticuleClass, CellClass,LeafClass, OctreeHeight, SubtreeHeight>::Iterator FOctreeIterator;
......@@ -42,17 +42,17 @@ public:
* @param inKernels the kernels to call
* An assert is launched if one of the arguments is null
*/
FFmmAlgorithmToS(Octree* const inTree, KernelClass<ParticuleClass,CellClass,OctreeHeight>* const inKernels)
FFmmAlgorithmTsm(Octree* const inTree, KernelClass<ParticuleClass,CellClass,OctreeHeight>* const inKernels)
: tree(inTree) , kernels(inKernels) {
assert(tree, "tree cannot be null", __LINE__, __FILE__);
assert(kernels, "kernels cannot be null", __LINE__, __FILE__);
FDEBUG(FDebug::Controller << "FFmmAlgorithmToS\n");
FDEBUG(FDebug::Controller << "FFmmAlgorithmTsm\n");
}
/** Default destructor */
virtual ~FFmmAlgorithmToS(){
virtual ~FFmmAlgorithmTsm(){
}
/**
......@@ -283,6 +283,6 @@ public:
};
#endif //FFMMALGORITHMTOS_HPP
#endif //FFMMALGORITHMTSM_HPP
// [--LICENSE--]
......@@ -10,7 +10,7 @@
* This class is an extenssion.
* It proposes a target/source extenssion for cell.
* Because cells may have child that contains only
* sources or targets (in ToS system) then it is important
* sources or targets (in Tsm system) then it is important
* to not compute for nothing.
*/
class FExtendCellType {
......
#ifndef FFMATOSLOADER_HPP
#define FFMATOSLOADER_HPP
#ifndef FFMATSMLOADER_HPP
#define FFMATSMLOADER_HPP
// /!\ Please, you must read the license at the bottom of this page
#include <iostream>
......@@ -11,7 +11,7 @@
/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FFMAToSLoader
* @class FFMATsmLoader
* Please read the license
*
* Load a file with a format like :
......@@ -19,7 +19,7 @@
* X Y Z // one particule by line
* ....
* <code>
* FFMAToSLoader<FBasicParticule> loader("../FMB++/Tests/particules.basic.txt"); <br>
* FFMATsmLoader<FBasicParticule> loader("../FMB++/Tests/particules.basic.txt"); <br>
* if(!loader.isValide()){ <br>
* std::cout << "Loader Error\n"; <br>
* return 1; <br>
......@@ -37,7 +37,7 @@
* Particule has to extend {FExtendPhysicalValue,FExtendPosition}
*/
template <class ParticuleClass>
class FFMAToSLoader : public FAbstractLoader<ParticuleClass> {
class FFMATsmLoader : public FAbstractLoader<ParticuleClass> {
protected:
std::ifstream file; //< The file to read
F3DPosition centerOfBox; //< The center of box read from file
......@@ -50,7 +50,7 @@ public:
* @param filename the name of the file to open
* you can test if file is successfuly open by calling isValide()
*/
FFMAToSLoader(const char* const filename): file(filename,std::ifstream::in){
FFMATsmLoader(const char* const filename): file(filename,std::ifstream::in){
// test if open
if(this->file.is_open()){
FReal x,y,z;
......@@ -67,7 +67,7 @@ public:
/**
* Default destructor, simply close the file
*/
virtual ~FFMAToSLoader(){
virtual ~FFMATsmLoader(){
file.close();
}
......@@ -121,6 +121,6 @@ public:
};
#endif //FFMATOSLOADER_HPP
#endif //FFMATSMLOADER_HPP
// [--LICENSE--]
......@@ -226,7 +226,7 @@ protected:
//////////////////////////////////////////////////////////////////
// position_2_r_cos_th_sin_th_ph
Spherical positionToSphere(const F3DPosition& inVector){
Spherical positionTsmphere(const F3DPosition& inVector){
const FReal x2y2 = (inVector.getX() * inVector.getX()) + (inVector.getY() * inVector.getY());
Spherical outSphere;
......@@ -531,7 +531,7 @@ protected:
father.getZ() - (treeWidthAtLevel * (1 + (childBox.getZ() * 2)))
);
harmonicInner(positionToSphere(M2MVector),this->transitionM2M[idxLevel][idxChild]);
harmonicInner(positionTsmphere(M2MVector),this->transitionM2M[idxLevel][idxChild]);
const F3DPosition L2LVector (
(treeWidthAtLevel * (1 + (childBox.getX() * 2))) - father.getX(),
......@@ -539,7 +539,7 @@ protected:
(treeWidthAtLevel * (1 + (childBox.getZ() * 2))) - father.getZ()
);
harmonicInner(positionToSphere(L2LVector),this->transitionL2L[idxLevel][idxChild]);
harmonicInner(positionTsmphere(L2LVector),this->transitionL2L[idxLevel][idxChild]);
//printf("[M2M_vector]%d/%d = %f/%f/%f\n", idxLevel , idxChild , M2MVector.getX() , M2MVector.getY() , M2MVector.getZ() );
//printf("[M2M_vectorSpherical]%d/%d = %f/%f/%f/%f\n", idxLevel , idxChild , sphericalM2M.r , sphericalM2M.cosTheta , sphericalM2M.sinTheta , sphericalM2M.phi );
......@@ -577,7 +577,7 @@ protected:
// Not blas so
//printf("transferM2L[%d][%d][%d][%d]\n", idxLevel, idxd1, idxd2, idxd3);
harmonicOuter(positionToSphere(relativePos),this->transferM2L[idxLevel][idxd1][idxd2][idxd3]);
harmonicOuter(positionTsmphere(relativePos),this->transferM2L[idxLevel][idxd1][idxd2][idxd3]);
//for(int idxTemp = 0 ; idxTemp < this->FMB_Info_M2L_exp_size ; ++idxTemp){
// printf("transferM2L[%d][%d][%d][%d][%d]=%f/%f\n", idxLevel, idxd1, idxd2, idxd3, idxTemp, this->transferM2L[idxLevel][idxd1][idxd2][idxd3][idxTemp].getReal(),this->transferM2L[idxLevel][idxd1][idxd2][idxd3][idxTemp].getImag());
//}
......@@ -660,7 +660,7 @@ public:
//ok printf("\tp_center.x=%f\tp_center.y=%f\tp_center.z=%f\n",inPole->getPosition().getX(),inPole->getPosition().getY(),inPole->getPosition().getZ());
//ok printf("\tbody.x=%f\tbody.y=%f\tbody.z=%f\n",iterParticule.value()->getPosition().getX(),iterParticule.value()->getPosition().getY(),iterParticule.value()->getPosition().getZ());
harmonicInner(positionToSphere(iterParticule.value()->getPosition() - inPole->getPosition()),current_thread_Y);
harmonicInner(positionTsmphere(iterParticule.value()->getPosition() - inPole->getPosition()),current_thread_Y);
//ok printf("\tr=%f\tcos_theta=%f\tsin_theta=%f\tphi=%f\n",spherical.r,spherical.cosTheta,spherical.sinTheta,spherical.phi);
......
......@@ -43,7 +43,7 @@ public:
F3DPosition force_vector_in_local_base;
typename FAbstractFmbKernels<ParticuleClass,CellClass,TreeHeight>::Spherical spherical;
spherical = positionToSphere( iterTarget.value()->getPosition() - local->getPosition());
spherical = positionTsmphere( iterTarget.value()->getPosition() - local->getPosition());
harmonicInnerThetaDerivated( spherical, FAbstractFmbKernels<ParticuleClass,CellClass,TreeHeight>::current_thread_Y, FAbstractFmbKernels<ParticuleClass,CellClass,TreeHeight>::current_thread_Y_theta_derivated);
// The maximum degree used here will be P.
......
......@@ -36,7 +36,7 @@ public:
//printf("Morton %lld\n",local->getMortonIndex());
// expansion_Evaluate_local
harmonicInner( positionToSphere( iterTarget.value()->getPosition() - local->getPosition()),
harmonicInner( positionTsmphere( iterTarget.value()->getPosition() - local->getPosition()),
FAbstractFmbKernels<ParticuleClass,CellClass,TreeHeight>::current_thread_Y);
FReal potential;
......
......@@ -38,7 +38,7 @@ public:
F3DPosition force_vector_in_local_base;
typename FAbstractFmbKernels<ParticuleClass,CellClass,TreeHeight>::Spherical spherical;
spherical = positionToSphere( iterTarget.value()->getPosition() - local->getPosition());
spherical = positionTsmphere( iterTarget.value()->getPosition() - local->getPosition());
/*printf("\t\t bodies_it_Get_p_position(&it) x = %lf \t y = %lf \t z = %lf \n",
(iterTarget.value()->getPosition()).getX(),
......
......@@ -30,10 +30,10 @@
#include "../Sources/Fmb/FFmbKernelsForces.hpp"
#include "../Sources/Fmb/FFmbKernelsPotential.hpp"
#include "../Sources/Files/FFMAToSLoader.hpp"
#include "../Sources/Files/FFMATsmLoader.hpp"
// With openmp : g++ testFmbToSAlgorithm.cpp ../Sources/Utils/FAssertable.cpp ../Sources/Utils/FDebug.cpp ../Sources/Utils/FTrace.cpp -lgomp -fopenmp -O2 -o testFmbToSAlgorithm.exe
// icpc -openmp -openmp-lib=compat testFmbToSAlgorithm.cpp ../Sources/Utils/FAssertable.cpp ../Sources/Utils/FDebug.cpp -O2 -o testFmbToSAlgorithm.exe
// With openmp : g++ testFmbTsmAlgorithm.cpp ../Sources/Utils/FAssertable.cpp ../Sources/Utils/FDebug.cpp ../Sources/Utils/FTrace.cpp -lgomp -fopenmp -O2 -o testFmbTsmAlgorithm.exe
// icpc -openmp -openmp-lib=compat testFmbTsmAlgorithm.cpp ../Sources/Utils/FAssertable.cpp ../Sources/Utils/FDebug.cpp -O2 -o testFmbTsmAlgorithm.exe
/** This program show an example of use of
* the fmm basic algo
......@@ -60,7 +60,7 @@ public:
// Simply create particules and try the kernels
int main(int argc, char ** argv){
///////////////////////What we do/////////////////////////////
std::cout << ">> This executable has to be used to test Fmb on a ToS system.\n";
std::cout << ">> This executable has to be used to test Fmb on a Tsm system.\n";
//////////////////////////////////////////////////////////////
const int NbLevels = 9;//10;
......@@ -79,7 +79,7 @@ int main(int argc, char ** argv){
std::cout << "Opening : " << filename << "\n";
}
FFMAToSLoader<FmbParticule> loader(filename);
FFMATsmLoader<FmbParticule> loader(filename);
if(!loader.isValide()){
std::cout << "Loader Error, " << filename << " is missing\n";
return 1;
......
......@@ -21,7 +21,7 @@
#include "../Sources/Extenssions/FExtendParticuleType.hpp"
#include "../Sources/Extenssions/FExtendCellType.hpp"
#include "../Sources/Core/FFmmAlgorithmToS.hpp"
#include "../Sources/Core/FFmmAlgorithmTsm.hpp"
#include "../Sources/Core/FFmmAlgorithm.hpp"
#include "../Sources/Core/FFmmAlgorithmArray.hpp"
#include "../Sources/Core/FFmmAlgorithmThreaded.hpp"
......@@ -34,10 +34,10 @@
* it also check that each particules is impacted each other particules
*/
class FTestParticuleToS : public FTestParticule, public FExtendParticuleType {
class FTestParticuleTsm : public FTestParticule, public FExtendParticuleType {
};
class FTestCellToS: public FTestCell , public FExtendCellType{
class FTestCellTsm: public FTestCell , public FExtendCellType{
};
......@@ -50,7 +50,7 @@ int main(int argc, char ** argv){
const int NbLevels = 10;//10;
const int SizeSubLevels = 3;//3
const long NbPart = 2000000;//2000000
FTestParticuleToS* particules = new FTestParticuleToS[NbPart];
FTestParticuleTsm* particules = new FTestParticuleTsm[NbPart];
FTic counter;
srand ( 1 ); // volontary set seed to constant
......@@ -72,7 +72,7 @@ int main(int argc, char ** argv){
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
FOctree<FTestParticuleToS, FTestCellToS, FTypedLeaf, NbLevels, SizeSubLevels> tree(1.0,F3DPosition(0.5,0.5,0.5));
FOctree<FTestParticuleTsm, FTestCellTsm, FTypedLeaf, NbLevels, SizeSubLevels> tree(1.0,F3DPosition(0.5,0.5,0.5));
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
......@@ -92,9 +92,9 @@ int main(int argc, char ** argv){
counter.tic();
// FTestKernels FBasicKernels
FTestKernels<FTestParticuleToS, FTestCellToS, NbLevels> kernels;
FTestKernels<FTestParticuleTsm, FTestCellTsm, NbLevels> kernels;
//FFMMAlgorithm FFMMAlgorithmThreaded FFMMAlgorithmArray FFMMAlgorithmTask
FFmmAlgorithm<FTestKernels, FTestParticuleToS, FTestCellToS, FTypedLeaf, NbLevels, SizeSubLevels> algo(&tree,&kernels);
FFmmAlgorithm<FTestKernels, FTestParticuleTsm, FTestCellTsm, FTypedLeaf, NbLevels, SizeSubLevels> algo(&tree,&kernels);
algo.execute();
counter.tac();
......@@ -110,7 +110,7 @@ int main(int argc, char ** argv){
std::cout << "Deleting particules ..." << std::endl;
counter.tic();
for(long idxPart = 0 ; idxPart < NbPart ; ++idxPart){
particules[idxPart].~FTestParticuleToS();
particules[idxPart].~FTestParticuleTsm();
}
delete [] particules;
counter.tac();
......
......@@ -21,12 +21,12 @@
#include "../Sources/Components/FSimpleLeaf.hpp"
#include "../Sources/Files/FFMAToSLoader.hpp"
#include "../Sources/Files/FFMATsmLoader.hpp"
// Compile by : g++ testLoaderFMAToS.cpp ../Sources/Utils/FAssertable.cpp -O2 -o testLoaderFMAToS.exe
// Compile by : g++ testLoaderFMATsm.cpp ../Sources/Utils/FAssertable.cpp -O2 -o testLoaderFMATsm.exe
class ParticuleToS : public FFmaParticule, public FExtendParticuleType {
class ParticuleTsm : public FFmaParticule, public FExtendParticuleType {
};
/**
......@@ -37,14 +37,14 @@ int main(int argc, char ** argv ){
///////////////////////What we do/////////////////////////////
std::cout << ">> This executable is useless to execute.\n";
std::cout << ">> It is only interesting to wath the code to understand\n";
std::cout << ">> how to use the ToS loader\n";
std::cout << ">> how to use the Tsm loader\n";
//////////////////////////////////////////////////////////////
// we store all particules to be able to dealloc
FList<ParticuleToS*> particules;
FList<ParticuleTsm*> particules;
// Use testLoaderCreate.exe to create this file
FTic counter;
const char* const defaultFilename = "testLoaderFMA.tor.fma";
const char* const defaultFilename = "testLoaderFMA.tsm.fma";
const char* filename;
if(argc == 1){
......@@ -58,20 +58,20 @@ int main(int argc, char ** argv ){
}
// open basic particules loader
FFMAToSLoader<ParticuleToS> loader(filename);
FFMATsmLoader<ParticuleTsm> loader(filename);
if(!loader.isValide()){
std::cout << "Loader Error, " << filename << "is missing\n";
return 1;
}
// otree
FOctree<ParticuleToS, FBasicCell, FSimpleLeaf, 10, 3> tree(loader.getBoxWidth(),loader.getCenterOfBox());
FOctree<ParticuleTsm, FBasicCell, FSimpleLeaf, 10, 3> tree(loader.getBoxWidth(),loader.getCenterOfBox());
// -----------------------------------------------------
std::cout << "Inserting " << loader.getNumberOfParticules() << " particules ..." << std::endl;
counter.tic();
for(int idx = 0 ; idx < loader.getNumberOfParticules() ; ++idx){
ParticuleToS* const part = new ParticuleToS();
ParticuleTsm* const part = new ParticuleTsm();
particules.pushFront(part);
loader.fillParticule(part);
tree.insert(part);
......
......@@ -10,7 +10,7 @@
#include "../Sources/Utils/FGlobal.hpp"
// This file can generate basic particules files in the FMA format
// g++ testLoaderFMAToSCreate.cpp -o testLoaderFMAToSCreate.exe
// g++ testLoaderFMATsmCreate.cpp -o testLoaderFMATsmCreate.exe
int main(int argc, char ** argv){
///////////////////////What we do/////////////////////////////
......@@ -33,7 +33,7 @@ int main(int argc, char ** argv){
// Box width
const FReal BoxWidth = 1.0/2;
// Output file please let .temp extension
const char * const defaultFilename = "testLoaderFMA.tor.fma";
const char * const defaultFilename = "testLoaderFMA.tsm.fma";
const char* Output;
......
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