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
9b083022
Commit
9b083022
authored
Apr 08, 2013
by
Peter Eastman
Browse files
Added getPeriodicBoxVolume() to State
parent
41bcc20f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
openmmapi/include/openmm/State.h
openmmapi/include/openmm/State.h
+4
-0
openmmapi/src/State.cpp
openmmapi/src/State.cpp
+3
-0
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
...pers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
+9
-0
No files found.
openmmapi/include/openmm/State.h
View file @
9b083022
...
@@ -99,6 +99,10 @@ public:
...
@@ -99,6 +99,10 @@ public:
* @param c on exit, this contains the vector defining the third edge of the periodic box
* @param c on exit, this contains the vector defining the third edge of the periodic box
*/
*/
void
getPeriodicBoxVectors
(
Vec3
&
a
,
Vec3
&
b
,
Vec3
&
c
)
const
;
void
getPeriodicBoxVectors
(
Vec3
&
a
,
Vec3
&
b
,
Vec3
&
c
)
const
;
/**
* Get the volume of the periodic box (measured in nm^3).
*/
double
getPeriodicBoxVolume
()
const
;
/**
/**
* Get a map containing the values of all parameters. If this State does not contain parameters, this will throw an exception.
* Get a map containing the values of all parameters. If this State does not contain parameters, this will throw an exception.
*/
*/
...
...
openmmapi/src/State.cpp
View file @
9b083022
...
@@ -68,6 +68,9 @@ void State::getPeriodicBoxVectors(Vec3& a, Vec3& b, Vec3& c) const {
...
@@ -68,6 +68,9 @@ void State::getPeriodicBoxVectors(Vec3& a, Vec3& b, Vec3& c) const {
b
=
periodicBoxVectors
[
1
];
b
=
periodicBoxVectors
[
1
];
c
=
periodicBoxVectors
[
2
];
c
=
periodicBoxVectors
[
2
];
}
}
double
State
::
getPeriodicBoxVolume
()
const
{
return
periodicBoxVectors
[
0
].
dot
(
periodicBoxVectors
[
1
].
cross
(
periodicBoxVectors
[
2
]));
}
const
map
<
string
,
double
>&
State
::
getParameters
()
const
{
const
map
<
string
,
double
>&
State
::
getParameters
()
const
{
if
((
types
&
Parameters
)
==
0
)
if
((
types
&
Parameters
)
==
0
)
throw
OpenMMException
(
"Invoked getParameters() on a State which does not contain parameters."
);
throw
OpenMMException
(
"Invoked getParameters() on a State which does not contain parameters."
);
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/pythoncode.i
View file @
9b083022
...
@@ -10,6 +10,7 @@ RMIN_PER_SIGMA=math.pow(2, 1/6.0)
...
@@ -10,6 +10,7 @@ RMIN_PER_SIGMA=math.pow(2, 1/6.0)
RVDW_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
/
2.0
RVDW_PER_SIGMA
=
math
.
pow
(
2
,
1
/
6.0
)
/
2.0
import
simtk
.
unit
as
unit
import
simtk
.
unit
as
unit
from
simtk
.
openmm
.
vec3
import
Vec3
class
State
(
_object
)
:
class
State
(
_object
)
:
"""
"""
...
@@ -103,6 +104,14 @@ class State(_object):
...
@@ -103,6 +104,14 @@ class State(_object):
returnValue
=
unit
.
Quantity
(
returnValue
,
unit
.
nanometers
)
returnValue
=
unit
.
Quantity
(
returnValue
,
unit
.
nanometers
)
return
returnValue
return
returnValue
def
getPeriodicBoxVolume
(
self
)
:
"""Get the volume of the periodic box."""
a
=
self
.
_periodicBoxVectorsList
[
0
]
b
=
self
.
_periodicBoxVectorsList
[
1
]
c
=
self
.
_periodicBoxVectorsList
[
2
]
bcrossc
=
Vec3
(
b
[
1
]
*
c
[
2
]
-
b
[
2
]
*
c
[
1
],
b
[
2
]
*
c
[
0
]
-
b
[
0
]
*
c
[
2
],
b
[
0
]
*
c
[
1
]
-
b
[
1
]
*
c
[
0
])
return
unit
.
Quantity
(
unit
.
dot
(
a
,
bcrossc
),
unit
.
nanometers
*
unit
.
nanometers
*
unit
.
nanometers
)
def
getPositions
(
self
,
asNumpy
=
False
)
:
def
getPositions
(
self
,
asNumpy
=
False
)
:
"""Get the position of each particle with units.
"""Get the position of each particle with units.
Raises an exception if postions where not requested in
Raises an exception if postions where not requested in
...
...
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