Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MPIBP-Hummer
BioEM
Commits
a7fb3f35
Commit
a7fb3f35
authored
Jul 22, 2014
by
Pilar Cossio
Browse files
Corrected weighted center of mass with electron densities
parent
49a0c950
Changes
1
Hide whitespace changes
Inline
Side-by-side
model.cpp
View file @
a7fb3f35
...
...
@@ -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
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment