Commit 9e878f8d authored by COULAUD Olivier's avatar COULAUD Olivier

Modifications to compare with DL_POLY code

parent 3bd7cd3e
......@@ -33,7 +33,7 @@ protected:
FPoint centerOfBox; //< The center of box read from file
FReal boxWidth; //< the box width read from file
int nbParticles; //< the number of particles read from file
int levcfg ; //< DL_POLY CONFIG file key. 0,1 or 2
public:
/**
* The constructor need the file name
......@@ -55,7 +55,7 @@ public:
int imcon ;
int tempi(0);
FReal tempf(0);
file >> tempi >> imcon >> this->nbParticles;
file >> levcfg >> imcon >> this->nbParticles;
// Periodic case
if( imcon > 0 ) {
FReal widthx, widthy, widthz;
......@@ -134,10 +134,18 @@ public:
file.read(type, 2);
file >> index;
std::getline(file, line); // needed to skip the end of the line in non periodic case
if ( levcfg == 0) {
file >> x >> y >> z;
}else if ( levcfg == 1) {
file >> x >> y >> z;
file >> vx >> vy >> vz;
}else {
file >> x >> y >> z;
file >> vx >> vy >> vz;
file >> fx >> fy >> fz;
}
file >> x >> y >> z;
file >> vx >> vy >> vz;
file >> fx >> fy >> fz;
// std::cout << " x >> y >> z: " << x<< " " <<y<< " " <<z <<std::endl;
inParticle.setPosition(x,y,z);
inParticle.setForces(fx,fy,fz);
......
......@@ -128,7 +128,7 @@ int main(int argc, char ** argv){
particle.setForces(0,0,0);
particle.setPotential(0);
// insert in tree
tree.insert(part);
tree.insert(particle);
}
counter.tac();
......
......@@ -97,7 +97,8 @@ int main(int argc, char ** argv){
// recommenda
FTic counter;
const FReal coeff_MD = FReal(138935.4835 / 418.4);
const FReal coeff_MD = FReal(138935.4835 / 418.4);
const FReal coeff_MD1 = FReal(138935.4835);
// -----------------------------------------------------
......@@ -187,7 +188,7 @@ int main(int argc, char ** argv){
potential += iter.data().getPotential() * iter.data().getPhysicalValue();
if(FParameters::existParameter(argc, argv, "-verbose")){
std::cout << " " << iter.data().getIndex()+1 << " \t "<<
std::cout << " " << iter.data().getIndex()+1 << " \t "<< iter.data().getType() << " \t " <<
std::setprecision(5)<< iter.data().getPosition().getX() << " \t" <<
iter.data().getPosition().getY() << " \t" <<
iter.data().getPosition().getZ() << " Forces: \t"<< std::setprecision(8)<<
......@@ -216,7 +217,7 @@ int main(int argc, char ** argv){
printf("Fz diff is = \n");
printf("%f\n",fz.getL2Norm());
printf("%f\n",fz.getInfNorm());
std::cout << std::endl<< std::endl<< "Potential = " << potential*coeff_MD << std::endl;
std::cout << std::endl<< std::endl<< "Potential= " << potential*coeff_MD/2 << std::endl;
}
......@@ -234,13 +235,13 @@ int main(int argc, char ** argv){
forces += iter.data().getForces();
if(FParameters::existParameter(argc, argv, "-verbose")){
std::cout << " " << iter.data().getIndex()+1 << " \t "<<
std::cout << " " << iter.data().getIndex()+1 << " \t "<< iter.data().getType() << " \t " <<
std::setprecision(5)<< iter.data().getPosition().getX() << " \t" <<
iter.data().getPosition().getY() << " \t" <<
iter.data().getPosition().getZ() << " Forces: \t"<<
std::setprecision(8) << iter.data().getForces().getX()*coeff_MD << " \t " <<
iter.data().getForces().getY()*coeff_MD << " \t " <<
iter.data().getForces().getZ()*coeff_MD << std::endl;
std::setprecision(8) << iter.data().getForces().getX()*coeff_MD1 << " \t " <<
iter.data().getForces().getY()*coeff_MD1 << " \t " <<
iter.data().getForces().getZ()*coeff_MD1 << std::endl;
}
iter.gotoNext();
......@@ -248,7 +249,7 @@ int main(int argc, char ** argv){
} while(octreeIterator.moveRight());
std::cout << "Foces Sum x = " << forces.getX() << " y = " << forces.getY() << " z = " << forces.getZ() << std::endl;
std::cout << "Potential = " << potential*coeff_MD << std::endl;
std::cout << "Potential = " << potential*coeff_MD/2 << std::endl;
std::cout << "Constante DL_POLY: " << coeff_MD << std::endl;
}
// -----------------------------------------------------
......
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