File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed
Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ class OPENMM_EXPORT CustomCVForce : public Force {
238238 * @param[out] values the values of the collective variables are computed and
239239 * stored into this
240240 */
241- void getCollectiveVariableValues (Context& context, std::vector<double >& values);
241+ void getCollectiveVariableValues (Context& context, std::vector<double >& values) const ;
242242 /* *
243243 * Get the inner Context used for evaluating collective variables.
244244 *
Original file line number Diff line number Diff line change @@ -108,15 +108,15 @@ class OPENMM_EXPORT Force {
108108 /* *
109109 * Get the ForceImpl corresponding to this Force in a Context.
110110 */
111- ForceImpl& getImplInContext (Context& context);
111+ ForceImpl& getImplInContext (Context& context) const ;
112112 /* *
113113 * Get a const reference to the ForceImpl corresponding to this Force in a Context.
114114 */
115115 const ForceImpl& getImplInContext (const Context& context) const ;
116116 /* *
117117 * Get the ContextImpl corresponding to a Context.
118118 */
119- ContextImpl& getContextImpl (Context& context);
119+ ContextImpl& getContextImpl (Context& context) const ;
120120private:
121121 int forceGroup;
122122 std::string name;
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ class OPENMM_EXPORT ForceImpl {
116116 /* *
117117 * Get the ContextImpl corresponding to a Context.
118118 */
119- ContextImpl& getContextImpl (Context& context) {
119+ ContextImpl& getContextImpl (Context& context) const {
120120 return context.getImpl ();
121121 }
122122};
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ const string& CustomCVForce::getTabulatedFunctionName(int index) const {
140140 return functions[index].name ;
141141}
142142
143- void CustomCVForce::getCollectiveVariableValues (Context& context, vector<double >& values) {
143+ void CustomCVForce::getCollectiveVariableValues (Context& context, vector<double >& values) const {
144144 dynamic_cast <CustomCVForceImpl&>(getImplInContext (context)).getCollectiveVariableValues (getContextImpl (context), values);
145145}
146146
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ bool Force::usesPeriodicBoundaryConditions() const {
7676 throw OpenMMException (" usesPeriodicBoundaryConditions is not implemented" );
7777}
7878
79- ForceImpl& Force::getImplInContext (Context& context) {
79+ ForceImpl& Force::getImplInContext (Context& context) const {
8080 for (auto impl : context.getImpl ().getForceImpls ())
8181 if (&impl->getOwner () == this )
8282 return *impl;
@@ -90,6 +90,6 @@ const ForceImpl& Force::getImplInContext(const Context& context) const {
9090 throw OpenMMException (" getImplInContext: This Force is not present in the Context" );
9191}
9292
93- ContextImpl& Force::getContextImpl (Context& context) {
93+ ContextImpl& Force::getContextImpl (Context& context) const {
9494 return context.getImpl ();
9595}
You can’t perform that action at this time.
0 commit comments