Commit 05476fcf authored by berenger-bramas's avatar berenger-bramas

Rename list vector methods

(step 2/2)

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@102 2616d619-271b-44dc-8df4-d4a8f33a7222
parent 6cfc352f
......@@ -74,8 +74,8 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
// The particles is impacted by the parent cell
typename FList<ParticleClass>::BasicIterator iter(*particles);
while( iter.isValide() ){
iter.value().setDataDown(iter.value().getDataDown() + local->getDataDown());
while( iter.hasNotFinished() ){
iter.data().setDataDown(iter.data().getDataDown() + local->getDataDown());
iter.gotoNext();
}
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
......@@ -95,8 +95,8 @@ public:
}
typename FList<ParticleClass>::BasicIterator iter(*targets);
while( iter.isValide() ){
iter.value().setDataDown(iter.value().getDataDown() + inc);
while( iter.hasNotFinished() ){
iter.data().setDataDown(iter.data().getDataDown() + inc);
iter.gotoNext();
}
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
......@@ -118,8 +118,8 @@ public:
}
typename FList<ParticleClass>::BasicIterator iter(*targets);
while( iter.isValide() ){
iter.value().setDataDown(iter.value().getDataDown() + inc);
while( iter.hasNotFinished() ){
iter.data().setDataDown(iter.data().getDataDown() + inc);
iter.gotoNext();
}
FTRACE( FTrace::Controller.leaveFunction(FTrace::KERNELS) );
......@@ -178,12 +178,12 @@ void ValidateFMMAlgo(FOctree<ParticleClass, CellClass, LeafClass, TreeHeight , S
const bool isUsingTsm = (octreeIterator.getCurrentListTargets() != octreeIterator.getCurrentListSrc());
while( iter.isValide() ){
while( iter.hasNotFinished() ){
// If a particles has been impacted by less than NbPart - 1 (the current particle)
// there is a problem
if( (!isUsingTsm && iter.value().getDataDown() != NbPart - 1) ||
(isUsingTsm && iter.value().getDataDown() != NbPart) ){
std::cout << "Problem L2P + P2P : " << iter.value().getDataDown() << "\n";
if( (!isUsingTsm && iter.data().getDataDown() != NbPart - 1) ||
(isUsingTsm && iter.data().getDataDown() != NbPart) ){
std::cout << "Problem L2P + P2P : " << iter.data().getDataDown() << "\n";
}
iter.gotoNext();
}
......
......@@ -164,8 +164,8 @@ public:
* FList<int> values; <br>
* // inserting ... <br>
* FList<int>::BasicIterator iter(values); <br>
* while( iter.isValide() ){ <br>
* iter.value() += 1; <br>
* while( iter.hasNotFinished() ){ <br>
* iter.data() += 1; <br>
* iter.gotoNext(); <br>
* } <br>
* </code>
......@@ -189,17 +189,17 @@ public:
/**
* Current pointed value
* current iterator must be valide (isValide()) to use this function
* current iterator must be valide (hasNotFinished()) to use this function
*/
Object& value(){
Object& data(){
return this->iter->target;
}
/**
* Current pointed value
* current iterator must be valide (isValide()) to use this function
* current iterator must be valide (hasNotFinished()) to use this function
*/
const Object& value() const{
const Object& data() const{
return this->iter->target;
}
......@@ -207,7 +207,7 @@ public:
* To know if an iterator is at the end of the list
* @return true if the current iterator can gotoNext and access to value, else false
*/
bool isValide() const{
bool hasNotFinished() const{
return iter;
}
......@@ -221,8 +221,8 @@ public:
* FList<int> values; <br>
* // inserting ... <br>
* FList<int>::ConstBasicIterator iter(values); <br>
* while( iter.isValide() ){ <br>
* iter.value() += 1; <br>
* while( iter.hasNotFinished() ){ <br>
* iter.data() += 1; <br>
* iter.gotoNext(); <br>
* } <br>
* </code>
......@@ -246,17 +246,17 @@ public:
/**
* Current pointed value
* current iterator must be valide (isValide()) to use this function
* current iterator must be valide (hasNotFinished()) to use this function
*/
Object value(){
Object data(){
return this->iter->target;
}
/**
* Current pointed value
* current iterator must be valide (isValide()) to use this function
* current iterator must be valide (hasNotFinished()) to use this function
*/
const Object& value() const{
const Object& data() const{
return this->iter->target;
}
......@@ -264,7 +264,7 @@ public:
* To know if an iterator is at the end of the list
* @return true if the current iterator can gotoNext and access to value, else false
*/
bool isValide() const{
bool hasNotFinished() const{
return iter;
}
};
......
......@@ -178,15 +178,15 @@ public:
++this->index;
}
bool isValide() const{
bool hasNotFinished() const{
return this->index < this->vector->index;
}
T& value(){
T& data(){
return this->vector->array[this->index];
}
const T& value() const{
const T& data() const{
return this->vector->array[this->index];
}
......@@ -209,11 +209,11 @@ public:
++this->index;
}
bool isValide() const{
bool hasNotFinished() const{
return this->index < this->vector->index;
}
const T& value() const{
const T& data() const{
return this->vector->array[this->index];
}
......
......@@ -49,7 +49,7 @@ public:
* To know if the loader is valide (file opened, etc.)
* @return true if file is open
*/
virtual bool isValide() const = 0;
virtual bool hasNotFinished() const = 0;
/**
* Fill the next particle
......
......@@ -20,7 +20,7 @@
* ....
* <code>
* FBasicLoader<FBasicParticle> loader("../FMB++/Tests/particles.basic.txt"); <br>
* if(!loader.isValide()){ <br>
* if(!loader.hasNotFinished()){ <br>
* std::cout << "Loader Error\n"; <br>
* return 1; <br>
* } <br>
......@@ -46,7 +46,7 @@ public:
/**
* The constructor need the file name
* @param filename the name of the file to open
* you can test if file is successfuly open by calling isValide()
* you can test if file is successfuly open by calling hasNotFinished()
*/
FBasicLoader(const char* const filename): file(filename,std::ifstream::in){
// test if open
......@@ -72,7 +72,7 @@ public:
* To know if file is open and ready to read
* @return true if loader can work
*/
bool isValide() const{
bool hasNotFinished() const{
return this->file.is_open() && !this->file.eof();
}
......
......@@ -20,7 +20,7 @@
* ....
* <code>
* FFmaLoader<FBasicParticle> loader("../FMB++/Tests/particles.basic.txt"); <br>
* if(!loader.isValide()){ <br>
* if(!loader.hasNotFinished()){ <br>
* std::cout << "Loader Error\n"; <br>
* return 1; <br>
* } <br>
......@@ -48,7 +48,7 @@ public:
/**
* The constructor need the file name
* @param filename the name of the file to open
* you can test if file is successfuly open by calling isValide()
* you can test if file is successfuly open by calling hasNotFinished()
*/
FFmaLoader(const char* const filename): file(filename,std::ifstream::in){
// test if open
......@@ -75,7 +75,7 @@ public:
* To know if file is open and ready to read
* @return true if loader can work
*/
bool isValide() const{
bool hasNotFinished() const{
return this->file.is_open() && !this->file.eof();
}
......
......@@ -20,7 +20,7 @@
* ....
* <code>
* FFmaScanfLoader<FBasicParticle> loader("../FMB++/Tests/particles.basic.txt"); <br>
* if(!loader.isValide()){ <br>
* if(!loader.hasNotFinished()){ <br>
* std::cout << "Loader Error\n"; <br>
* return 1; <br>
* } <br>
......@@ -48,7 +48,7 @@ public:
/**
* The constructor need the file name
* @param filename the name of the file to open
* you can test if file is successfuly open by calling isValide()
* you can test if file is successfuly open by calling hasNotFinished()
*/
FFmaScanfLoader(const char* const filename): file(0){
file = fopen(filename,"r");
......@@ -83,7 +83,7 @@ public:
* To know if file is open and ready to read
* @return true if loader can work
*/
bool isValide() const{
bool hasNotFinished() const{
return this->file != NULL;
}
......
......@@ -20,7 +20,7 @@
* ....
* <code>
* FFmaTsmLoader<FBasicParticle> loader("../FMB++/Tests/particles.basic.txt"); <br>
* if(!loader.isValide()){ <br>
* if(!loader.hasNotFinished()){ <br>
* std::cout << "Loader Error\n"; <br>
* return 1; <br>
* } <br>
......@@ -48,7 +48,7 @@ public:
/**
* The constructor need the file name
* @param filename the name of the file to open
* you can test if file is successfuly open by calling isValide()
* you can test if file is successfuly open by calling hasNotFinished()
*/
FFmaTsmLoader(const char* const filename): file(filename,std::ifstream::in){
// test if open
......@@ -75,7 +75,7 @@ public:
* To know if file is open and ready to read
* @return true if loader can work
*/
bool isValide() const{
bool hasNotFinished() const{
return this->file.is_open() && !this->file.eof();
}
......
......@@ -20,7 +20,7 @@
* ....
* <code>
* FHLoader<FBasicParticle> loader("../FMB++/Tests/particles.basic.txt"); <br>
* if(!loader.isValide()){ <br>
* if(!loader.hasNotFinished()){ <br>
* std::cout << "Loader Error\n"; <br>
* return 1; <br>
* } <br>
......@@ -48,7 +48,7 @@ public:
/**
* The constructor need the file name
* @param filename the name of the file to open
* you can test if file is successfuly open by calling isValide()
* you can test if file is successfuly open by calling hasNotFinished()
*/
FHLoader(const char* const filename): file(0){
file = fopen(filename,"r");
......@@ -86,7 +86,7 @@ public:
* To know if file is open and ready to read
* @return true if loader can work
*/
bool isValide() const{
bool hasNotFinished() const{
return this->file != NULL;
}
......
......@@ -666,23 +666,23 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles);
iterParticle.isValide() ; iterParticle.gotoNext()){
iterParticle.hasNotFinished() ; iterParticle.gotoNext()){
//std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n";
//F3DPosition tempPos = iterParticle.value()->getPosition() - inPole->getPosition();
//std::cout << "Working on part " << iterParticle.data()->getPhysicalValue() << "\n";
//F3DPosition tempPos = iterParticle.data()->getPosition() - inPole->getPosition();
//ok printf("\tpos_rel.x=%e\tpos_rel.y=%e\tpos_rel.z=%e\n",tempPos.getX(),tempPos.getY(),tempPos.getZ());
//ok printf("\tp_center.x=%e\tp_center.y=%e\tp_center.z=%e\n",inPole->getPosition().getX(),inPole->getPosition().getY(),inPole->getPosition().getZ());
//ok printf("\tbody.x=%e\tbody.y=%e\tbody.z=%e\n",iterParticle.value()->getPosition().getX(),iterParticle.value()->getPosition().getY(),iterParticle.value()->getPosition().getZ());
//ok printf("\tbody.x=%e\tbody.y=%e\tbody.z=%e\n",iterParticle.data()->getPosition().getX(),iterParticle.data()->getPosition().getY(),iterParticle.data()->getPosition().getZ());
harmonicInner(positionTsmphere(iterParticle.value().getPosition() - inPole->getPosition()),current_thread_Y);
harmonicInner(positionTsmphere(iterParticle.data().getPosition() - inPole->getPosition()),current_thread_Y);
//printf("\tr=%e\tcos_theta=%e\tsin_theta=%e\tphi=%e\n",spherical.r,spherical.cosTheta,spherical.sinTheta,spherical.phi);
FComplexe* p_exp_term = inPole->getMultipole();
FComplexe* p_Y_term = current_thread_Y;
FReal pow_of_minus_1_j = 1.0;//(-1)^j
const FReal valueParticle = iterParticle.value().getPhysicalValue();
const FReal valueParticle = iterParticle.data().getPhysicalValue();
for(int j = 0 ; j <= FMB_Info_P ; ++j, pow_of_minus_1_j = -pow_of_minus_1_j ){
for(int k = 0 ; k <= j ; ++k, ++p_Y_term, ++p_exp_term){
......@@ -1072,25 +1072,25 @@ public:
void L2P(const CellClass* const local, FList<ParticleClass>* const particles){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
typename FList<ParticleClass>::BasicIterator iterTarget(*particles);
while( iterTarget.isValide() ){
while( iterTarget.hasNotFinished() ){
//printf("Morton %lld\n",local->getMortonIndex());
F3DPosition force_vector_in_local_base;
Spherical spherical;
spherical = positionTsmphere( iterTarget.value().getPosition() - local->getPosition());
spherical = positionTsmphere( iterTarget.data().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(),
(iterTarget.value()->getPosition()).getY(),
(iterTarget.value()->getPosition()).getZ());
(iterTarget.data()->getPosition()).getX(),
(iterTarget.data()->getPosition()).getY(),
(iterTarget.data()->getPosition()).getZ());
printf("\t\t p_leaf_center x = %lf \t y = %lf \t z = %lf \n",
(local->getPosition()).getX(),
(local->getPosition()).getY(),
(local->getPosition()).getZ());*/
/*printf("\t\t p_position_to_leaf_center x = %lf \t y = %lf \t z = %lf \n",
(iterTarget.value()->getPosition() - local->getPosition()).getX(),
(iterTarget.value()->getPosition() - local->getPosition()).getY(),
(iterTarget.value()->getPosition() - local->getPosition()).getZ());*/
(iterTarget.data()->getPosition() - local->getPosition()).getX(),
(iterTarget.data()->getPosition() - local->getPosition()).getY(),
(iterTarget.data()->getPosition() - local->getPosition()).getZ());*/
/*printf("\t\t phi = %lf \t cos = %lf \t sin = %lf \t r= %lf \n",
spherical.phi,spherical.cosTheta,spherical.sinTheta,spherical.r);*/
......@@ -1267,20 +1267,20 @@ public:
//#ifndef _DIRECT_MATRIX_
// When _DIRECT_MATRIX_ is defined, this multiplication is done in 'leaf_Sum_near_and_far_fields()'
force_vector_tmp *= iterTarget.value().getPhysicalValue();
force_vector_tmp *= iterTarget.data().getPhysicalValue();
//#endif
/*printf("[force_vector_tmp] fx = %e \t fy = %e \t fz = %e \n",
force_vector_tmp.getX(),force_vector_tmp.getY(),force_vector_tmp.getZ());*/
iterTarget.value().setForces( iterTarget.value().getForces() + force_vector_tmp );
iterTarget.data().setForces( iterTarget.data().getForces() + force_vector_tmp );
FReal potential;
expansion_Evaluate_local_with_Y_already_computed(local->getLocal(),&potential);
iterTarget.value().setPotential(potential);
iterTarget.data().setPotential(potential);
/*printf("[END] fx = %e \t fy = %e \t fz = %e \n\n",
iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/
iterTarget.data()->getForces().getX(),iterTarget.data()->getForces().getY(),iterTarget.data()->getForces().getZ());*/
//printf("p_potential = %lf\n", potential);
iterTarget.gotoNext();
......@@ -1336,14 +1336,14 @@ public:
FList<ParticleClass>* const directNeighbors[26], const MortonIndex inNeighborsIndex[26], const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
typename FList<ParticleClass>::BasicIterator iterTarget(*targets);
while( iterTarget.isValide() ){
while( iterTarget.hasNotFinished() ){
for(int idxDirectNeighbors = 0 ; idxDirectNeighbors < size ; ++idxDirectNeighbors){
if(inCurrentIndex < inNeighborsIndex[idxDirectNeighbors] ){
typename FList<ParticleClass>::BasicIterator iterSource(*directNeighbors[idxDirectNeighbors]);
while( iterSource.isValide() ){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSource.value());
while( iterSource.hasNotFinished() ){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.data(),
iterSource.data());
iterSource.gotoNext();
}
}
......@@ -1351,17 +1351,17 @@ public:
typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets);
iterSameBox.gotoNext();
while( iterSameBox.isValide() ){
if(&iterSameBox.value() < &iterTarget.value()){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value());
while( iterSameBox.hasNotFinished() ){
if(&iterSameBox.data() < &iterTarget.data()){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.data(),
iterSameBox.data());
}
iterSameBox.gotoNext();
}
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential());
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.data()->getPosition().getX(),iterTarget.data()->getPosition().getY(),iterTarget.data()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.data()->getForces().getX(),iterTarget.data()->getForces().getY(),iterTarget.data()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.data()->getPotential());
iterTarget.gotoNext();
}
......@@ -1413,29 +1413,29 @@ public:
const FList<ParticleClass>* const directNeighbors[26], const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
typename FList<ParticleClass>::BasicIterator iterTarget(*targets);
while( iterTarget.isValide() ){
while( iterTarget.hasNotFinished() ){
for(int idxDirectNeighbors = 0 ; idxDirectNeighbors < size ; ++idxDirectNeighbors){
typename FList<ParticleClass>::ConstBasicIterator iterSource(*directNeighbors[idxDirectNeighbors]);
while( iterSource.isValide() ){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSource.value());
while( iterSource.hasNotFinished() ){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.data(),
iterSource.data());
iterSource.gotoNext();
}
}
typename FList<ParticleClass>::ConstBasicIterator iterSameBox(*sources);
while( iterSameBox.isValide() ){
if(&iterSameBox.value() != &iterTarget.value()){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value());
while( iterSameBox.hasNotFinished() ){
if(&iterSameBox.data() != &iterTarget.data()){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.data(),
iterSameBox.data());
}
iterSameBox.gotoNext();
}
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential());
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.data()->getPosition().getX(),iterTarget.data()->getPosition().getY(),iterTarget.data()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.data()->getForces().getX(),iterTarget.data()->getForces().getY(),iterTarget.data()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.data()->getPotential());
iterTarget.gotoNext();
}
......
......@@ -677,23 +677,23 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles);
iterParticle.isValide() ; iterParticle.gotoNext()){
iterParticle.hasNotFinished() ; iterParticle.gotoNext()){
//std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n";
//F3DPosition tempPos = iterParticle.value()->getPosition() - inPole->getPosition();
//std::cout << "Working on part " << iterParticle.data()->getPhysicalValue() << "\n";
//F3DPosition tempPos = iterParticle.data()->getPosition() - inPole->getPosition();
//ok printf("\tpos_rel.x=%e\tpos_rel.y=%e\tpos_rel.z=%e\n",tempPos.getX(),tempPos.getY(),tempPos.getZ());
//ok printf("\tp_center.x=%e\tp_center.y=%e\tp_center.z=%e\n",inPole->getPosition().getX(),inPole->getPosition().getY(),inPole->getPosition().getZ());
//ok printf("\tbody.x=%e\tbody.y=%e\tbody.z=%e\n",iterParticle.value()->getPosition().getX(),iterParticle.value()->getPosition().getY(),iterParticle.value()->getPosition().getZ());
//ok printf("\tbody.x=%e\tbody.y=%e\tbody.z=%e\n",iterParticle.data()->getPosition().getX(),iterParticle.data()->getPosition().getY(),iterParticle.data()->getPosition().getZ());
harmonicInner(positionTsmphere(iterParticle.value()->getPosition() - inPole->getPosition()),current_thread_Y);
harmonicInner(positionTsmphere(iterParticle.data()->getPosition() - inPole->getPosition()),current_thread_Y);
//ok printf("\tr=%e\tcos_theta=%e\tsin_theta=%e\tphi=%e\n",spherical.r,spherical.cosTheta,spherical.sinTheta,spherical.phi);
FComplexe* p_exp_term = inPole->getMultipole();
FComplexe* p_Y_term = current_thread_Y;
FReal pow_of_minus_1_j = 1.0;//(-1)^j
const FReal valueParticle = iterParticle.value().getPhysicalValue();
const FReal valueParticle = iterParticle.data().getPhysicalValue();
for(int j = 0 ; j <= FMB_Info_P ; ++j, pow_of_minus_1_j = -pow_of_minus_1_j ){
for(int k = 0 ; k <= j ; ++k, ++p_Y_term, ++p_exp_term){
......@@ -1122,25 +1122,25 @@ public:
void L2P(const CellClass* const local, FList<ParticleClass>* const particles){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
typename FList<ParticleClass>::BasicIterator iterTarget(*particles);
while( iterTarget.isValide() ){
while( iterTarget.hasNotFinished() ){
//printf("Morton %lld\n",local->getMortonIndex());
F3DPosition force_vector_in_local_base;
typename FFmbKernelsBlas<ParticleClass,CellClass,TreeHeight>::Spherical spherical;
spherical = positionTsmphere( iterTarget.value()->getPosition() - local->getPosition());
spherical = positionTsmphere( iterTarget.data()->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(),
(iterTarget.value()->getPosition()).getY(),
(iterTarget.value()->getPosition()).getZ());
(iterTarget.data()->getPosition()).getX(),
(iterTarget.data()->getPosition()).getY(),
(iterTarget.data()->getPosition()).getZ());
printf("\t\t p_leaf_center x = %lf \t y = %lf \t z = %lf \n",
(local->getPosition()).getX(),
(local->getPosition()).getY(),
(local->getPosition()).getZ());*/
/*printf("\t\t p_position_to_leaf_center x = %lf \t y = %lf \t z = %lf \n",
(iterTarget.value()->getPosition() - local->getPosition()).getX(),
(iterTarget.value()->getPosition() - local->getPosition()).getY(),
(iterTarget.value()->getPosition() - local->getPosition()).getZ());*/
(iterTarget.data()->getPosition() - local->getPosition()).getX(),
(iterTarget.data()->getPosition() - local->getPosition()).getY(),
(iterTarget.data()->getPosition() - local->getPosition()).getZ());*/
/*printf("\t\t phi = %lf \t cos = %lf \t sin = %lf \t r= %lf \n",
spherical.phi,spherical.cosTheta,spherical.sinTheta,spherical.r);*/
......@@ -1317,20 +1317,20 @@ public:
//#ifndef _DIRECT_MATRIX_
// When _DIRECT_MATRIX_ is defined, this multiplication is done in 'leaf_Sum_near_and_far_fields()'
force_vector_tmp *= iterTarget.value().getPhysicalValue();
force_vector_tmp *= iterTarget.data().getPhysicalValue();
//#endif
/*printf("[force_vector_tmp] fx = %e \t fy = %e \t fz = %e \n",
force_vector_tmp.getX(),force_vector_tmp.getY(),force_vector_tmp.getZ());*/
iterTarget.value()->setForces( iterTarget.value().getForces() + force_vector_tmp );
iterTarget.data()->setForces( iterTarget.data().getForces() + force_vector_tmp );
FReal potential;
expansion_Evaluate_local_with_Y_already_computed(local->getLocal(),&potential);
iterTarget.value().setPotential(potential);
iterTarget.data().setPotential(potential);
/*printf("[END] fx = %e \t fy = %e \t fz = %e \n\n",
iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());*/
iterTarget.data()->getForces().getX(),iterTarget.data()->getForces().getY(),iterTarget.data()->getForces().getZ());*/
//printf("p_potential = %lf\n", potential);
iterTarget.gotoNext();
......@@ -1387,14 +1387,14 @@ public:
FList<ParticleClass>* const directNeighbors[26], const MortonIndex inNeighborsIndex[26], const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
typename FList<ParticleClass>::BasicIterator iterTarget(*targets);
while( iterTarget.isValide() ){
while( iterTarget.hasNotFinished() ){
for(int idxDirectNeighbors = 0 ; idxDirectNeighbors < size ; ++idxDirectNeighbors){
if(inCurrentIndex < inNeighborsIndex[idxDirectNeighbors] ){
typename FList<ParticleClass>::BasicIterator iterSource(*directNeighbors[idxDirectNeighbors]);
while( iterSource.isValide() ){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSource.value());
while( iterSource.hasNotFinished() ){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.data(),
iterSource.data());
iterSource.gotoNext();
}
}
......@@ -1402,17 +1402,17 @@ public:
typename FList<ParticleClass>::BasicIterator iterSameBox = iterTarget;//(*targets);
iterSameBox.gotoNext();
while( iterSameBox.isValide() ){
if(&iterSameBox.value() < &iterTarget.value()){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value());
while( iterSameBox.hasNotFinished() ){
if(&iterSameBox.data() < &iterTarget.data()){
DIRECT_COMPUTATION_MUTUAL_SOFT(iterTarget.data(),
iterSameBox.data());
}
iterSameBox.gotoNext();
}
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential());
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.data()->getPosition().getX(),iterTarget.data()->getPosition().getY(),iterTarget.data()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.data()->getForces().getX(),iterTarget.data()->getForces().getY(),iterTarget.data()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.data()->getPotential());
iterTarget.gotoNext();
}
......@@ -1464,29 +1464,29 @@ public:
const FList<ParticleClass>* const directNeighbors[26], const int size) {
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
typename FList<ParticleClass>::BasicIterator iterTarget(*targets);
while( iterTarget.isValide() ){
while( iterTarget.hasNotFinished() ){
for(int idxDirectNeighbors = 0 ; idxDirectNeighbors < size ; ++idxDirectNeighbors){
typename FList<ParticleClass>::ConstBasicIterator iterSource(*directNeighbors[idxDirectNeighbors]);
while( iterSource.isValide() ){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSource.value());
while( iterSource.hasNotFinished() ){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.data(),
iterSource.data());
iterSource.gotoNext();
}
}
typename FList<ParticleClass>::ConstBasicIterator iterSameBox(*sources);
while( iterSameBox.isValide() ){
if(&iterSameBox.value() != &iterTarget.value()){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.value(),
iterSameBox.value());
while( iterSameBox.hasNotFinished() ){
if(&iterSameBox.data() != &iterTarget.data()){
DIRECT_COMPUTATION_NO_MUTUAL_SOFT(iterTarget.data(),
iterSameBox.data());
}
iterSameBox.gotoNext();
}
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.value()->getPosition().getX(),iterTarget.value()->getPosition().getY(),iterTarget.value()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.value()->getForces().getX(),iterTarget.value()->getForces().getY(),iterTarget.value()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.value()->getPotential());
//printf("x = %e \t y = %e \t z = %e \n",iterTarget.data()->getPosition().getX(),iterTarget.data()->getPosition().getY(),iterTarget.data()->getPosition().getZ());
//printf("\t P2P fx = %e \t fy = %e \t fz = %e \n",iterTarget.data()->getForces().getX(),iterTarget.data()->getForces().getY(),iterTarget.data()->getForces().getZ());
//printf("\t potential = %e \n",iterTarget.data()->getPotential());
iterTarget.gotoNext();
}
......
......@@ -854,23 +854,23 @@ public:
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
for(typename FList<ParticleClass>::ConstBasicIterator iterParticle(*inParticles);
iterParticle.isValide() ; iterParticle.gotoNext()){
iterParticle.hasNotFinished() ; iterParticle.gotoNext()){
//std::cout << "Working on part " << iterParticle.value()->getPhysicalValue() << "\n";
//F3DPosition tempPos = iterParticle.value()->getPosition() - inPole->getPosition();
//std::cout << "Working on part " << iterParticle.data()->getPhysicalValue() << "\n";
//F3DPosition tempPos = iterParticle.data()->getPosition() - inPole->getPosition();
//ok printf("\tpos_rel.x=%.15e\tpos_rel.y=%.15e\tpos_rel.z=%.15e\n",tempPos.getX(),tempPos.getY(),tempPos.getZ());
//ok printf("\tp_center.x=%.15e\tp_center.y=%.15e\tp_center.z=%.15e\n",inPole->getPosition().getX(),inPole->getPosition().getY(),inPole->getPosition().getZ());
//ok printf("\tbody.x=%.15e\tbody.y=%.15e\tbody.z=%.15e\n",iterParticle.value()->getPosition().getX(),iterParticle.value()->getPosition().getY(),iterParticle.value()->getPosition().getZ());
//ok printf("\tbody.x=%.15e\tbody.y=%.15e\tbody.z=%.15e\n",iterParticle.data()->getPosition().getX(),iterParticle.data()->getPosition().getY(),iterParticle.data()->getPosition().getZ());
harmonicInner(positionTsmphere(iterParticle.value().getPosition() - inPole->getPosition()),current_thread_Y);
harmonicInner(positionTsmphere(iterParticle.data().getPosition() - inPole->getPosition()),current_thread_Y);
//ok printf("\tr=%.15e\tcos_theta=%.15e\tsin_theta=%.15e\tphi=%.15e\n",spherical.r,spherical.cosTheta,spherical.sinTheta,spherical.phi);
FComplexe* p_exp_term = inPole->getMultipole();
FComplexe* p_Y_term = current_thread_Y;
FReal pow_of_minus_1_j = 1.0;//(-1)^j
const FReal valueParticle = iterParticle.value().getPhysicalValue();
const FReal valueParticle = iterParticle.data().getPhysicalValue();
for(int j = 0 ; j <= FMB_Info_P ; ++j, pow_of_minus_1_j = -pow_of_minus_1_j ){
for(int k = 0 ; k <= j ; ++k, ++p_Y_term, ++p_exp_term){
......@@ -1376,25 +1376,25 @@ public:
void L2P(const CellClass* const local, FList<ParticleClass>* const particles){
FTRACE( FTrace::Controller.enterFunction(FTrace::KERNELS, __FUNCTION__ , __FILE__ , __LINE__) );
typename FList<ParticleClass>::BasicIterator iterTarget(*particles);
while( iterTarget.isValide() ){
while( iterTarget.hasNotFinished() ){
//printf("Morton %lld\n",local->getMortonIndex());
F3DPosition force_vector_in_local_base;
typename FFmbKernelsBlockBlas<ParticleClass,CellClass,TreeHeight>::Spherical spherical;
spherical = positionTsmphere( iterTarget.value().getPosition() - local->getPosition());
spherical = positionTsmphere( iterTarget.data().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(),
(iterTarget.value()->getPosition()).getY(),
(iterTarget.value()->getPosition()).getZ());
(iterTarget.data()->getPosition()).getX(),
(iterTarget.data()->getPosition()).getY(),
(iterTarget.data()->getPosition()).getZ());
printf("\t\t p_leaf_center x = %lf \t y = %lf \t z = %lf \n",
(local->getPosition()).getX(),
(local->getPosition()).getY(),
(local->getPosition()).getZ());*/
/*printf("\t\t p_position_to_leaf_center x = %lf \t y = %lf \t z = %lf \n",
(iterTarget.value()->getPosition() - local->getPosition()).getX(),
(iterTarget.value()->getPosition() - local->getPosition()).getY(),
(iterTarget.value()->getPosition() - local->getPosition()).getZ());*/
(iterTarget.data()->getPosition() - local->getPosition()).getX(),
(iterTarget.data()->getPosition() - local->getPosition()).getY(),