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
1e9099cd
"platforms/opencl/vscode:/vscode.git/clone" did not exist on "446aaeb47db6dc2d2fe156bc4484847d6281e209"
Commit
1e9099cd
authored
Jun 20, 2013
by
Peter Eastman
Browse files
Fixed Python wrapper for specifying the pressure as a Vec3
parent
3d855210
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
openmmapi/include/OpenMM.h
openmmapi/include/OpenMM.h
+1
-0
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
+15
-0
No files found.
openmmapi/include/OpenMM.h
View file @
1e9099cd
...
...
@@ -53,6 +53,7 @@
#include "openmm/Integrator.h"
#include "openmm/LangevinIntegrator.h"
#include "openmm/LocalEnergyMinimizer.h"
#include "openmm/MonteCarloAnisotropicBarostat.h"
#include "openmm/MonteCarloBarostat.h"
#include "openmm/NonbondedForce.h"
#include "openmm/Context.h"
...
...
wrappers/python/src/swig_doxygen/swig_lib/python/typemaps.i
View file @
1e9099cd
...
...
@@ -31,6 +31,10 @@
/* Convert python tuple to C++ Vec3 object*/
%
typemap
(
typecheck
)
Vec3
{
// typemap -- %typemap(typecheck) Vec3
$
1
=
(
PySequence_Length
(
$
input
)
>=
3
?
1
:
0
)
;
}
%
typemap
(
in
)
Vec3
{
// typemap -- %typemap(in) Vec3
double
x
,
y
,
z
;
...
...
@@ -50,6 +54,10 @@
$
1
=
OpenMM
::
Vec3
(
x
,
y
,
z
)
;
}
%
typemap
(
typecheck
)
const
Vec3&
{
// typemap -- %typemap(typecheck) Vec3
$
1
=
(
PySequence_Length
(
$
input
)
>=
3
?
1
:
0
)
;
}
%
typemap
(
in
)
const
Vec3&
(
OpenMM
::
Vec3
myVec
)
{
// typemap -- %typemap(in) Vec3
double
x
,
y
,
z
;
...
...
@@ -70,6 +78,13 @@
myVec
=
OpenMM
::
Vec3
(
x
,
y
,
z
)
;
$
1
=
&
myVec;
}
%
typemap
(
out
)
Vec3
{
PyObject
*
mm
=
PyImport_AddModule
(
"simtk.openmm"
)
;
PyObject
*
vec3
=
PyObject_GetAttrString
(
mm
,
"Vec3"
)
;
PyObject
*
args
=
Py_BuildValue
(
"(d,d,d)"
,
(
$
1
)[
0
],
(
$
1
)[
1
],
(
$
1
)[
2
])
;
$
result
=
PyObject_CallObject
(
vec3
,
args
)
;
Py_DECREF
(
args
)
;
}
/* Convert C++ (Vec3&, Vec3&, Vec3&) object to python tuple or tuples */
%
typemap
(
argout
)
(
Vec3&
a
,
Vec3&
b
,
Vec3&
c
)
{
...
...
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