Commit 39cc2edc authored by berenger-bramas's avatar berenger-bramas

Miscellaneous modifications

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/scalfmm/scalfmm/trunk@333 2616d619-271b-44dc-8df4-d4a8f33a7222
parent f2fb988b
......@@ -23,13 +23,11 @@ OPTION( SCALFMM_BUILD_UTESTS "Set to ON to build UTests" ON )
OPTION( SCALFMM_BUILD_DEBUG "Set to ON to build in Debug" OFF )
OPTION( SCALFMM_USE_MEM_STATS "Set to ON to profile memory" OFF )
# MPI option has to be set before project
if( SCALFMM_USE_MPI )
SET(CMAKE_CXX_COMPILER mpicxx)
SET(CMAKE_CXX_COMPILER mpicxx)
endif()
# Test if openmp is here
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake)
find_package(OpenMP)
......
......@@ -48,6 +48,18 @@ public:
this->position.setZ(inZ);
}
/** Set Position */
void incPosition(const F3DPosition& inPosition) {
this->position += inPosition;
}
/** Set Position with 3 FReals */
void incPosition(const FReal inPx, const FReal inPy, const FReal inPz) {
this->position.incX(inPx);
this->position.incY(inPy);
this->position.incZ(inPz);
}
};
......
......@@ -122,8 +122,8 @@ public:
file >> fx >> fy >> fz;
inParticle.setPosition(x,y,z);
//inParticle.setForces(fx,fy,fz);
inParticle.setForces(vx,vy,vz);
inParticle.setForces(fx,fy,fz);
//inParticle.setForces(vx,vy,vz);
inParticle.setIndex(index-1);
if( strncmp(type, "OW", 2) == 0){
......
......@@ -98,9 +98,6 @@ int main(int argc, char ** argv){
std::cout << "Done " << "(@Algorithm = " << counter.elapsed() << "s)." << std::endl;
{ // get sum forces&potential
FILE* fout = fopen("./res.temp.txt", "w");
FReal potential = 0;
F3DPosition forces;
typename OctreeClass::Iterator octreeIterator(&tree);
......@@ -111,20 +108,12 @@ int main(int argc, char ** argv){
potential += iter.data().getPotential() * iter.data().getPhysicalValue();
forces += iter.data().getForces();
fprintf(fout, "*** pos= (%f, %f, %f)\tv= %f\t\t\t\t\t\t\tforce= (%f, %f, %f)\t\t\t\tpotential energy=\n%f\n",
iter.data().getPosition().getX(),iter.data().getPosition().getY(),iter.data().getPosition().getZ(),
iter.data().getPhysicalValue(),
iter.data().getForces().getX(),iter.data().getForces().getY(),iter.data().getForces().getZ(),
iter.data().getPotential());
iter.gotoNext();
}
} while(octreeIterator.moveRight());
std::cout << "Foces Sum x = " << forces.getX() << " y = " << forces.getY() << " z = " << forces.getZ() << std::endl;
std::cout << "Potential = " << potential << std::endl;
fclose(fout);
}
// -----------------------------------------------------
......
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