Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
f1f974c2
"vscode:/vscode.git/clone" did not exist on "d7da750ad3d2c8064ffb28417402f44e1cdb8bd7"
Commit
f1f974c2
authored
Aug 16, 2010
by
Mark Friedrichs
Browse files
Random number seed can now be set for initial generation of velocities
parent
589390a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
...amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
+11
-2
No files found.
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
View file @
f1f974c2
...
...
@@ -5232,7 +5232,7 @@ double getEnergyForceBreakdown( Context& context, MapStringDouble& mapEnergies,
*
--------------------------------------------------------------------------------------- */
static
void
setVelocitiesBasedOnTemperature
(
const
System
&
system
,
std
::
vector
<
Vec3
>&
velocities
,
double
temperature
,
FILE
*
log
)
{
static
void
setVelocitiesBasedOnTemperature
(
const
System
&
system
,
int
seed
,
std
::
vector
<
Vec3
>&
velocities
,
double
temperature
,
FILE
*
log
)
{
// ---------------------------------------------------------------------------------------
...
...
@@ -5241,6 +5241,13 @@ static void setVelocitiesBasedOnTemperature( const System& system, std::vector<V
// ---------------------------------------------------------------------------------------
if
(
seed
){
SimTKOpenMMUtilities
::
setRandomNumberSeed
(
static_cast
<
uint32_t
>
(
seed
)
);
if
(
log
){
(
void
)
fprintf
(
log
,
"%s set random number seed to %d
\n
"
,
methodName
.
c_str
(),
seed
);
}
}
// set velocities based on temperature
double
scaledTemperature
=
temperature
*
2.0
*
BOLTZ
;
...
...
@@ -5499,6 +5506,7 @@ void testEnergyConservation( std::string parameterFileName, MapStringInt& forceM
int
energyMinimize
=
1
;
int
applyAssertion
=
0
;
int
randomNumberSeed
=
0
;
// tolerance for energy conservation test
...
...
@@ -5543,7 +5551,8 @@ void testEnergyConservation( std::string parameterFileName, MapStringInt& forceM
std
::
vector
<
Vec3
>
velocities
;
velocities
.
resize
(
numberOfAtoms
);
double
initialT
=
300.0
;
setVelocitiesBasedOnTemperature
(
system
,
velocities
,
initialT
,
log
);
setIntFromMap
(
inputArgumentMap
,
"randomNumberSeed"
,
randomNumberSeed
);
setVelocitiesBasedOnTemperature
(
system
,
randomNumberSeed
,
velocities
,
initialT
,
log
);
context
->
setVelocities
(
velocities
);
// energy minimize
...
...
Write
Preview
Markdown
is supported
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