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
eb2e1ee3
Commit
eb2e1ee3
authored
Dec 30, 2014
by
Jason Swails
Browse files
Remove NotImplementedError -- do everything through OpenMMException
parent
876329d4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
15 deletions
+4
-15
openmmapi/include/openmm/Force.h
openmmapi/include/openmm/Force.h
+1
-1
openmmapi/include/openmm/OpenMMException.h
openmmapi/include/openmm/OpenMMException.h
+0
-11
openmmapi/include/openmm/System.h
openmmapi/include/openmm/System.h
+1
-1
openmmapi/src/Force.cpp
openmmapi/src/Force.cpp
+1
-1
openmmapi/src/System.cpp
openmmapi/src/System.cpp
+1
-1
No files found.
openmmapi/include/openmm/Force.h
View file @
eb2e1ee3
...
@@ -81,7 +81,7 @@ public:
...
@@ -81,7 +81,7 @@ public:
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions. This method should be overridden for all Force subclasses, or
* conditions. This method should be overridden for all Force subclasses, or
* a OpenMM::
NotImplementedError
will be thrown
* a OpenMM::
OpenMMException
will be thrown
*
*
* @return true if Force uses periodic boundaries or false if it does not
* @return true if Force uses periodic boundaries or false if it does not
*/
*/
...
...
openmmapi/include/openmm/OpenMMException.h
View file @
eb2e1ee3
...
@@ -54,17 +54,6 @@ private:
...
@@ -54,17 +54,6 @@ private:
std
::
string
message
;
std
::
string
message
;
};
};
class
NotImplementedError
:
public
std
::
exception
{
public:
explicit
NotImplementedError
(
const
std
::
string
&
message
)
:
message
(
message
)
{
}
~
NotImplementedError
()
throw
()
{
}
const
char
*
what
()
const
throw
()
{
return
message
.
c_str
();
}
};
}
// namespace OpenMM
}
// namespace OpenMM
#endif
/*OPENMM_OPENMMEXCEPTION_H_*/
#endif
/*OPENMM_OPENMMEXCEPTION_H_*/
openmmapi/include/openmm/System.h
View file @
eb2e1ee3
...
@@ -228,7 +228,7 @@ public:
...
@@ -228,7 +228,7 @@ public:
* Returns whether or not any forces in this System use periodic boundaries.
* Returns whether or not any forces in this System use periodic boundaries.
*
*
* If a force in this System does not implement usesPeriodicBoundaryConditions
* If a force in this System does not implement usesPeriodicBoundaryConditions
* a
NotImplementedError
is thrown
* a
OpenMM::OpenMMException
is thrown
*
*
* @return true of at least one force uses PBC and false otherwise
* @return true of at least one force uses PBC and false otherwise
*/
*/
...
...
openmmapi/src/Force.cpp
View file @
eb2e1ee3
...
@@ -50,7 +50,7 @@ void Force::setForceGroup(int group) {
...
@@ -50,7 +50,7 @@ void Force::setForceGroup(int group) {
}
}
bool
Force
::
usesPeriodicBoundaryConditions
()
const
{
bool
Force
::
usesPeriodicBoundaryConditions
()
const
{
throw
NotImplementedError
(
"usesPeriodicBoundaryConditions is not implemented"
);
throw
OpenMMException
(
"usesPeriodicBoundaryConditions is not implemented"
);
}
}
ForceImpl
&
Force
::
getImplInContext
(
Context
&
context
)
{
ForceImpl
&
Force
::
getImplInContext
(
Context
&
context
)
{
...
...
openmmapi/src/System.cpp
View file @
eb2e1ee3
...
@@ -129,7 +129,7 @@ bool System::usesPeriodicBoundaryConditions() {
...
@@ -129,7 +129,7 @@ bool System::usesPeriodicBoundaryConditions() {
try
{
try
{
if
((
*
it
)
->
usesPeriodicBoundaryConditions
())
if
((
*
it
)
->
usesPeriodicBoundaryConditions
())
uses_pbc
=
true
;
uses_pbc
=
true
;
}
catch
(
NotImplementedError
&
e
)
{
}
catch
(
OpenMMException
&
e
)
{
all_forces_implement
=
false
;
all_forces_implement
=
false
;
}
}
}
}
...
...
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