Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tbgl
tools
arbd
Commits
29210d6d
Commit
29210d6d
authored
6 years ago
by
cmaffeo2
Browse files
Options
Downloads
Patches
Plain Diff
Fixed unit conversion in rigid body BD integrator
parent
312b9d2f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/RigidBody.cu
+10
-4
10 additions, 4 deletions
src/RigidBody.cu
with
10 additions
and
4 deletions
src/RigidBody.cu
+
10
−
4
View file @
29210d6d
...
...
@@ -280,6 +280,12 @@ Miguel X. Fernandes, José García de la Torre
//Chris original implementation for Brownian motion
void
RigidBody
::
integrate
(
int
startFinishAll
)
{
// UNITS
// Temp: kcal_mol
// t->transDamping: (kcal_mol/AA) / (amu AA/ns)
// t->mass: amu
// diffusion: AA**2/ns
//if (startFinishAll == 1) return;
Matrix3
rot
=
Matrix3
(
1
);
// = *p_rot;
...
...
@@ -295,14 +301,14 @@ void RigidBody::integrate(int startFinishAll)
Vector3
rotDiffusion
=
Temp
/
(
Vector3
::
element_mult
(
t
->
rotDamping
,
t
->
inertia
));
Vector3
rando
=
getRandomGaussVector
();
Vector3
offset
=
Vector3
::
element_mult
(
(
diffusion
/
Temp
),
force
)
*
timestep
*
418.679994353
+
Vector3
::
element_mult
(
Vector3
::
element_sqrt
(
2.0
f
*
diffusion
*
timestep
*
418.679994353
),
rando
)
;
Vector3
offset
=
Vector3
::
element_mult
(
(
diffusion
/
Temp
),
force
)
*
timestep
+
Vector3
::
element_mult
(
Vector3
::
element_sqrt
(
2.0
f
*
diffusion
*
timestep
),
rando
)
;
position
+=
offset
;
rando
=
getRandomGaussVector
();
Vector3
rotationOffset
=
Vector3
::
element_mult
(
(
rotDiffusion
/
Temp
)
,
orientation
.
transpose
()
*
torque
*
timestep
)
*
418.679994353
+
Vector3
::
element_mult
(
Vector3
::
element_sqrt
(
2.0
f
*
rotDiffusion
*
timestep
*
418.679994353
),
rando
);
Vector3
rotationOffset
=
Vector3
::
element_mult
(
(
rotDiffusion
/
Temp
)
,
orientation
.
transpose
()
*
torque
*
timestep
)
+
Vector3
::
element_mult
(
Vector3
::
element_sqrt
(
2.0
f
*
rotDiffusion
*
timestep
),
rando
);
// Consider whether a DLM-like decomposition of rotations is needed for time-reversibility
orientation
=
orientation
*
(
Rz
(
rotationOffset
.
z
*
0.5
)
*
Ry
(
rotationOffset
.
y
*
0.5
)
*
Rx
(
rotationOffset
.
x
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment