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
d0a8058d
"vscode:/vscode.git/clone" did not exist on "4cf722abcb765092d3f70a3b3032e59260e42bb6"
Unverified
Commit
d0a8058d
authored
May 14, 2019
by
Andy Simmonett
Browse files
Replaced Nose-Hoover chain label by chain ID
parent
6343be0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
16 deletions
+16
-16
openmmapi/include/openmm/NoseHooverChain.h
openmmapi/include/openmm/NoseHooverChain.h
+13
-13
openmmapi/src/NoseHooverChain.cpp
openmmapi/src/NoseHooverChain.cpp
+2
-2
openmmapi/src/VelocityVerletIntegrator.cpp
openmmapi/src/VelocityVerletIntegrator.cpp
+1
-1
No files found.
openmmapi/include/openmm/NoseHooverChain.h
View file @
d0a8058d
...
@@ -57,13 +57,13 @@ public:
...
@@ -57,13 +57,13 @@ public:
* This is the name of the parameter that stores the position of the ith bead
* This is the name of the parameter that stores the position of the ith bead
*/
*/
std
::
string
Position
(
int
i
)
const
{
std
::
string
Position
(
int
i
)
const
{
return
defaultLabel
+
"NoseHooverChainPosition"
+
std
::
to_string
(
i
);
return
std
::
to_string
(
defaultChainID
)
+
"NoseHooverChainPosition"
+
std
::
to_string
(
i
);
}
}
/**
/**
* This is the name of the parameter that stores the velocity of the ith bead
* This is the name of the parameter that stores the velocity of the ith bead
*/
*/
std
::
string
Velocity
(
int
i
)
const
{
std
::
string
Velocity
(
int
i
)
const
{
return
defaultLabel
+
"NoseHooverChainVelocity"
+
std
::
to_string
(
i
);
return
std
::
to_string
(
defaultChainID
)
+
"NoseHooverChainVelocity"
+
std
::
to_string
(
i
);
}
}
/**
/**
* Create a NoseHooverChain.
* Create a NoseHooverChain.
...
@@ -75,13 +75,13 @@ public:
...
@@ -75,13 +75,13 @@ public:
* @param defaultChainLength the default length of (number of particles in) this heat bath
* @param defaultChainLength the default length of (number of particles in) this heat bath
* @param defaultNumMTS the default number of multi time steps used to propagate this chain
* @param defaultNumMTS the default number of multi time steps used to propagate this chain
* @param defaultNumYoshidaSuzuki the default number of Yoshida Suzuki steps used to propagate this chain (1, 3, or 5).
* @param defaultNumYoshidaSuzuki the default number of Yoshida Suzuki steps used to propagate this chain (1, 3, or 5).
* @param default
Label
the default
label
used to distinguish this Nose-Hoover chain from others that may
* @param default
ChainID
the default
chain id
used to distinguish this Nose-Hoover chain from others that may
* be used to control a different set of particles, e.g. for Drude oscillators
* be used to control a different set of particles, e.g. for Drude oscillators
* @param thermostatedAtoms the list of atoms to be handled by this thermostat
* @param thermostatedAtoms the list of atoms to be handled by this thermostat
* @param parentAtoms the list of parent atoms, if this thermostat handles Drude particles. Empty vector otherwise.
* @param parentAtoms the list of parent atoms, if this thermostat handles Drude particles. Empty vector otherwise.
*/
*/
NoseHooverChain
(
double
defaultTemperature
,
double
defaultCollisionFrequency
,
int
defaultNumDOFs
,
int
defaultChainLength
,
NoseHooverChain
(
double
defaultTemperature
,
double
defaultCollisionFrequency
,
int
defaultNumDOFs
,
int
defaultChainLength
,
int
defaultNumMTS
,
int
defaultNumYoshidaSuzuki
,
const
std
::
string
&
defaultLabel
,
int
defaultNumMTS
,
int
defaultNumYoshidaSuzuki
,
int
defaultChainID
,
const
std
::
vector
<
int
>&
thermostatedAtoms
,
const
std
::
vector
<
int
>&
parentAtoms
);
const
std
::
vector
<
int
>&
thermostatedAtoms
,
const
std
::
vector
<
int
>&
parentAtoms
);
/**
/**
* Get the default temperature of the heat bath (in Kelvin).
* Get the default temperature of the heat bath (in Kelvin).
...
@@ -188,21 +188,21 @@ public:
...
@@ -188,21 +188,21 @@ public:
defaultNumYS
=
numSteps
;
defaultNumYS
=
numSteps
;
}
}
/**
/**
* Get the default
label
used to identify this chain
* Get the default
chain id
used to identify this chain
*
*
* @returns the default
label
* @returns the default
chain id
*/
*/
std
::
str
in
g
getDefault
Label
()
const
{
in
t
getDefault
ChainID
()
const
{
return
default
Label
;
return
default
ChainID
;
}
}
/**
/**
* Set the default
label
used to identify this chain
* Set the default
chain id
used to identify this chain
* This will affect any new Contexts you create, but not those that already exist.
* This will affect any new Contexts you create, but not those that already exist.
*
*
* @param the default
label
* @param the default
chain id
*/
*/
void
setDefault
Label
(
const
std
::
string
&
label
)
{
void
setDefault
ChainID
(
int
chainID
)
{
default
Label
=
label
;
default
ChainID
=
chainID
;
}
}
/**
/**
* Get the atom ids of all atoms that are thermostated
* Get the atom ids of all atoms that are thermostated
...
@@ -263,7 +263,7 @@ private:
...
@@ -263,7 +263,7 @@ private:
double
defaultTemp
,
defaultFreq
,
defaultTimeStep
;
double
defaultTemp
,
defaultFreq
,
defaultTimeStep
;
int
defaultNumDOFs
,
defaultChainLength
,
defaultNumMTS
,
defaultNumYS
;
int
defaultNumDOFs
,
defaultChainLength
,
defaultNumMTS
,
defaultNumYS
;
// The suffix used to distinguish NH chains, e.g. for Drude particles vs. regular particles.
// The suffix used to distinguish NH chains, e.g. for Drude particles vs. regular particles.
std
::
str
in
g
default
Label
;
in
t
default
ChainID
;
std
::
vector
<
int
>
thermostatedAtoms
,
parentAtoms
;
std
::
vector
<
int
>
thermostatedAtoms
,
parentAtoms
;
};
};
...
...
openmmapi/src/NoseHooverChain.cpp
View file @
d0a8058d
...
@@ -37,11 +37,11 @@ using namespace OpenMM;
...
@@ -37,11 +37,11 @@ using namespace OpenMM;
NoseHooverChain
::
NoseHooverChain
(
double
defaultTemperature
,
double
defaultCollisionFrequency
,
NoseHooverChain
::
NoseHooverChain
(
double
defaultTemperature
,
double
defaultCollisionFrequency
,
int
defaultNumDOFs
,
int
defaultChainLength
,
int
defaultNumMTS
,
int
defaultNumDOFs
,
int
defaultChainLength
,
int
defaultNumMTS
,
int
defaultNumYoshidaSuzuki
,
const
std
::
string
&
defaultLabel
,
int
defaultNumYoshidaSuzuki
,
int
defaultChainID
,
const
std
::
vector
<
int
>&
thermostatedAtoms
,
const
std
::
vector
<
int
>&
parentAtoms
)
:
const
std
::
vector
<
int
>&
thermostatedAtoms
,
const
std
::
vector
<
int
>&
parentAtoms
)
:
defaultTemp
(
defaultTemperature
),
defaultFreq
(
defaultCollisionFrequency
),
defaultNumDOFs
(
defaultNumDOFs
),
defaultTemp
(
defaultTemperature
),
defaultFreq
(
defaultCollisionFrequency
),
defaultNumDOFs
(
defaultNumDOFs
),
defaultChainLength
(
defaultChainLength
),
defaultNumMTS
(
defaultNumMTS
),
defaultNumYS
(
defaultNumYoshidaSuzuki
),
defaultChainLength
(
defaultChainLength
),
defaultNumMTS
(
defaultNumMTS
),
defaultNumYS
(
defaultNumYoshidaSuzuki
),
default
Label
(
default
Label
),
thermostatedAtoms
(
thermostatedAtoms
),
parentAtoms
(
parentAtoms
)
default
ChainID
(
default
ChainID
),
thermostatedAtoms
(
thermostatedAtoms
),
parentAtoms
(
parentAtoms
)
{}
{}
ForceImpl
*
NoseHooverChain
::
createImpl
()
const
{
ForceImpl
*
NoseHooverChain
::
createImpl
()
const
{
...
...
openmmapi/src/VelocityVerletIntegrator.cpp
View file @
d0a8058d
...
@@ -81,7 +81,7 @@ int VelocityVerletIntegrator::addNoseHooverChainThermostat(System& system, doubl
...
@@ -81,7 +81,7 @@ int VelocityVerletIntegrator::addNoseHooverChainThermostat(System& system, doubl
}
}
auto
nhcForce
=
new
NoseHooverChain
(
temperature
,
collisionFrequency
,
nDOF
,
chainLength
,
auto
nhcForce
=
new
NoseHooverChain
(
temperature
,
collisionFrequency
,
nDOF
,
chainLength
,
numMTS
,
numYoshidaSuzuki
,
std
::
to_string
(
noseHooverChains
.
size
()
)
,
numMTS
,
numYoshidaSuzuki
,
noseHooverChains
.
size
(),
thermostatedParticles
,
parentParticles
);
thermostatedParticles
,
parentParticles
);
system
.
addForce
(
nhcForce
);
system
.
addForce
(
nhcForce
);
noseHooverChains
.
push_back
(
nhcForce
);
noseHooverChains
.
push_back
(
nhcForce
);
...
...
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