Commit a7fb3f35 authored by Pilar Cossio's avatar Pilar Cossio
Browse files

Corrected weighted center of mass with electron densities

parent 49a0c950
......@@ -182,20 +182,21 @@ int bioem_model::readModel(const char* filemodel)
cout << "\n+++++++++++++++++++++++++++++++++++++++++ \n";
exampleReadCoor.close();
//Moving to Model to its center of mass:
//Moving to Model to its center of density mass:
myfloat3_t r_cm;
for(int n = 0; n < 3; n++)r_cm.pos[n] = 0.0;
for(int n = 0; n < nPointsModel; n++)
{
r_cm.pos[0] += points[n].point.pos[0];
r_cm.pos[1] += points[n].point.pos[1];
r_cm.pos[2] += points[n].point.pos[2];
r_cm.pos[0] += points[n].point.pos[0]*points[n].density;
r_cm.pos[1] += points[n].point.pos[1]*points[n].density;
r_cm.pos[2] += points[n].point.pos[2]*points[n].density;
}
r_cm.pos[0] = r_cm.pos[0] / (myfloat_t) nPointsModel;
r_cm.pos[1] = r_cm.pos[1] / (myfloat_t) nPointsModel;
r_cm.pos[2] = r_cm.pos[2] / (myfloat_t) nPointsModel;
r_cm.pos[0] = r_cm.pos[0] / NormDen;
r_cm.pos[1] = r_cm.pos[1] / NormDen;
r_cm.pos[2] = r_cm.pos[2] / NormDen;
for(int n = 0; n < nPointsModel; n++)
{
points[n].point.pos[0] -= r_cm.pos[0];
......
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