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
0eb5bc0e
Unverified
Commit
0eb5bc0e
authored
May 09, 2022
by
Peter Eastman
Committed by
GitHub
May 09, 2022
Browse files
Made getCollectiveVariableValues() const (#3599)
parent
e9b8b6a2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
openmmapi/include/openmm/CustomCVForce.h
openmmapi/include/openmm/CustomCVForce.h
+1
-1
openmmapi/include/openmm/Force.h
openmmapi/include/openmm/Force.h
+2
-2
openmmapi/include/openmm/internal/ForceImpl.h
openmmapi/include/openmm/internal/ForceImpl.h
+1
-1
openmmapi/src/CustomCVForce.cpp
openmmapi/src/CustomCVForce.cpp
+1
-1
openmmapi/src/Force.cpp
openmmapi/src/Force.cpp
+2
-2
No files found.
openmmapi/include/openmm/CustomCVForce.h
View file @
0eb5bc0e
...
...
@@ -238,7 +238,7 @@ public:
* @param[out] values the values of the collective variables are computed and
* stored into this
*/
void
getCollectiveVariableValues
(
Context
&
context
,
std
::
vector
<
double
>&
values
);
void
getCollectiveVariableValues
(
Context
&
context
,
std
::
vector
<
double
>&
values
)
const
;
/**
* Get the inner Context used for evaluating collective variables.
*
...
...
openmmapi/include/openmm/Force.h
View file @
0eb5bc0e
...
...
@@ -108,7 +108,7 @@ protected:
/**
* Get the ForceImpl corresponding to this Force in a Context.
*/
ForceImpl
&
getImplInContext
(
Context
&
context
);
ForceImpl
&
getImplInContext
(
Context
&
context
)
const
;
/**
* Get a const reference to the ForceImpl corresponding to this Force in a Context.
*/
...
...
@@ -116,7 +116,7 @@ protected:
/**
* Get the ContextImpl corresponding to a Context.
*/
ContextImpl
&
getContextImpl
(
Context
&
context
);
ContextImpl
&
getContextImpl
(
Context
&
context
)
const
;
private:
int
forceGroup
;
std
::
string
name
;
...
...
openmmapi/include/openmm/internal/ForceImpl.h
View file @
0eb5bc0e
...
...
@@ -116,7 +116,7 @@ protected:
/**
* Get the ContextImpl corresponding to a Context.
*/
ContextImpl
&
getContextImpl
(
Context
&
context
)
{
ContextImpl
&
getContextImpl
(
Context
&
context
)
const
{
return
context
.
getImpl
();
}
};
...
...
openmmapi/src/CustomCVForce.cpp
View file @
0eb5bc0e
...
...
@@ -140,7 +140,7 @@ const string& CustomCVForce::getTabulatedFunctionName(int index) const {
return
functions
[
index
].
name
;
}
void
CustomCVForce
::
getCollectiveVariableValues
(
Context
&
context
,
vector
<
double
>&
values
)
{
void
CustomCVForce
::
getCollectiveVariableValues
(
Context
&
context
,
vector
<
double
>&
values
)
const
{
dynamic_cast
<
CustomCVForceImpl
&>
(
getImplInContext
(
context
)).
getCollectiveVariableValues
(
getContextImpl
(
context
),
values
);
}
...
...
openmmapi/src/Force.cpp
View file @
0eb5bc0e
...
...
@@ -76,7 +76,7 @@ bool Force::usesPeriodicBoundaryConditions() const {
throw
OpenMMException
(
"usesPeriodicBoundaryConditions is not implemented"
);
}
ForceImpl
&
Force
::
getImplInContext
(
Context
&
context
)
{
ForceImpl
&
Force
::
getImplInContext
(
Context
&
context
)
const
{
for
(
auto
impl
:
context
.
getImpl
().
getForceImpls
())
if
(
&
impl
->
getOwner
()
==
this
)
return
*
impl
;
...
...
@@ -90,6 +90,6 @@ const ForceImpl& Force::getImplInContext(const Context& context) const {
throw
OpenMMException
(
"getImplInContext: This Force is not present in the Context"
);
}
ContextImpl
&
Force
::
getContextImpl
(
Context
&
context
)
{
ContextImpl
&
Force
::
getContextImpl
(
Context
&
context
)
const
{
return
context
.
getImpl
();
}
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