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
3848adc6
Commit
3848adc6
authored
Nov 25, 2013
by
peastman
Browse files
Bug fixes to wrapper generation. Implemented wrappers for AMOEBA.
parent
19266648
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
2792 additions
and
33 deletions
+2792
-33
plugins/amoeba/openmmapi/include/openmm/AmoebaAngleForce.h
plugins/amoeba/openmmapi/include/openmm/AmoebaAngleForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaBondForce.h
plugins/amoeba/openmmapi/include/openmm/AmoebaBondForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaGeneralizedKirkwoodForce.h
...openmmapi/include/openmm/AmoebaGeneralizedKirkwoodForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaInPlaneAngleForce.h
...amoeba/openmmapi/include/openmm/AmoebaInPlaneAngleForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
...ns/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaOutOfPlaneBendForce.h
...oeba/openmmapi/include/openmm/AmoebaOutOfPlaneBendForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaPiTorsionForce.h
...ns/amoeba/openmmapi/include/openmm/AmoebaPiTorsionForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaStretchBendForce.h
.../amoeba/openmmapi/include/openmm/AmoebaStretchBendForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
...oeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
+8
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
+4
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaWcaDispersionForce.h
...moeba/openmmapi/include/openmm/AmoebaWcaDispersionForce.h
+4
-0
plugins/amoeba/wrappers/CMakeLists.txt
plugins/amoeba/wrappers/CMakeLists.txt
+28
-28
plugins/amoeba/wrappers/Doxyfile.in
plugins/amoeba/wrappers/Doxyfile.in
+1518
-0
plugins/amoeba/wrappers/generateAmoebaWrappers.py
plugins/amoeba/wrappers/generateAmoebaWrappers.py
+1187
-0
wrappers/generateWrappers.py
wrappers/generateWrappers.py
+11
-5
No files found.
plugins/amoeba/openmmapi/include/openmm/AmoebaAngleForce.h
View file @
3848adc6
...
...
@@ -175,6 +175,10 @@ private:
std
::
vector
<
AngleInfo
>
angles
;
};
/**
* This is an internal class used to record information about an angle.
* @private
*/
class
AmoebaAngleForce
::
AngleInfo
{
public:
int
particle1
,
particle2
,
particle3
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaBondForce.h
View file @
3848adc6
...
...
@@ -147,6 +147,10 @@ private:
std
::
vector
<
BondInfo
>
bonds
;
};
/**
* This is an internal class used to record information about a bond.
* @private
*/
class
AmoebaBondForce
::
BondInfo
{
public:
int
particle1
,
particle2
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaGeneralizedKirkwoodForce.h
View file @
3848adc6
...
...
@@ -174,6 +174,10 @@ private:
std
::
vector
<
ParticleInfo
>
particles
;
};
/**
* This is an internal class used to record information about a particle.
* @private
*/
class
AmoebaGeneralizedKirkwoodForce
::
ParticleInfo
{
public:
double
charge
,
radius
,
scalingFactor
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaInPlaneAngleForce.h
View file @
3848adc6
...
...
@@ -180,6 +180,10 @@ private:
std
::
vector
<
AngleInfo
>
angles
;
};
/**
* This is an internal class used to record information about an angle.
* @private
*/
class
AmoebaInPlaneAngleForce
::
AngleInfo
{
public:
int
particle1
,
particle2
,
particle3
,
particle4
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
View file @
3848adc6
...
...
@@ -368,6 +368,10 @@ private:
std
::
vector
<
MultipoleInfo
>
multipoles
;
};
/**
* This is an internal class used to record information about a multipole.
* @private
*/
class
AmoebaMultipoleForce
::
MultipoleInfo
{
public:
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaOutOfPlaneBendForce.h
View file @
3848adc6
...
...
@@ -172,6 +172,10 @@ private:
std
::
vector
<
OutOfPlaneBendInfo
>
outOfPlaneBends
;
};
/**
* This is an internal class used to record information about a bend.
* @private
*/
class
AmoebaOutOfPlaneBendForce
::
OutOfPlaneBendInfo
{
public:
int
particle1
,
particle2
,
particle3
,
particle4
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaPiTorsionForce.h
View file @
3848adc6
...
...
@@ -121,6 +121,10 @@ private:
std
::
vector
<
PiTorsionInfo
>
piTorsions
;
};
/**
* This is an internal class used to record information about a torsion.
* @private
*/
class
AmoebaPiTorsionForce
::
PiTorsionInfo
{
public:
int
particle1
,
particle2
,
particle3
,
particle4
,
particle5
,
particle6
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaStretchBendForce.h
View file @
3848adc6
...
...
@@ -124,6 +124,10 @@ private:
std
::
vector
<
StretchBendInfo
>
stretchBends
;
};
/**
* This is an internal class used to record information about a stretch-bend.
* @private
*/
class
AmoebaStretchBendForce
::
StretchBendInfo
{
public:
int
particle1
,
particle2
,
particle3
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
View file @
3848adc6
...
...
@@ -145,6 +145,10 @@ private:
std
::
vector
<
TorsionTorsionGridInfo
>
torsionTorsionGrids
;
};
/**
* This is an internal class used to record information about a torsion-torsion term.
* @private
*/
class
AmoebaTorsionTorsionForce
::
TorsionTorsionInfo
{
public:
...
...
@@ -163,6 +167,10 @@ public:
}
};
/**
* This is an internal class used to record information about a grid.
* @private
*/
class
AmoebaTorsionTorsionForce
::
TorsionTorsionGridInfo
{
public:
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaVdwForce.h
View file @
3848adc6
...
...
@@ -230,6 +230,10 @@ private:
std
::
vector
<
std
::
vector
<
std
::
vector
<
double
>
>
>
sigEpsTable
;
};
/**
* This is an internal class used to record information about a particle.
* @private
*/
class
AmoebaVdwForce
::
VdwInfo
{
public:
int
parentIndex
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaWcaDispersionForce.h
View file @
3848adc6
...
...
@@ -137,6 +137,10 @@ private:
std
::
vector
<
WcaDispersionInfo
>
parameters
;
};
/**
* This is an internal class used to record information about a particle.
* @private
*/
class
AmoebaWcaDispersionForce
::
WcaDispersionInfo
{
public:
double
radius
,
epsilon
;
...
...
plugins/amoeba/wrappers/CMakeLists.txt
View file @
3848adc6
#
set(GCCXML_EXTRA_ARGS "" CACHE STRING "Additional arguments to gccxml, such as '--gccxml-compiler;msvc8'")
#SET(GCCXML_ARGS) # start empty
#FOREACH(subdir ${API_INCLUDE
_DIR
S
})
# SET(GCCXML_ARGS ${GCCXML_ARGS} -I${subdir})
#
ENDFOREACH(subdir)
#SET(GCCXML_ARGS ${GCCXML_ARGS} ${GCCXML_EXTRA_ARGS})
SET
(
SAXON_JAR
${
CMAKE_SOURCE_DIR
}
/wrappers/saxonb9-1-0-7j/saxon9.jar
)
# OpenMMAmoeba
ADD_CUSTOM_COMMAND
(
OUTPUT AmoebaOpenMMApi.xml COMMAND
${
GCCXML_PATH
}
${
GCCXML_ARGS
}
-I
${
CMAKE_SOURCE_DIR
}
/openmmapi/include -I
${
CMAKE_SOURCE_DIR
}
/olla/include
${
CMAKE_SOURCE_DIR
}
/plugins/amoeba/openmmapi/include/OpenMMAmoeba.h -fxml=AmoebaOpenMMApi.xml
)
ADD_CUSTOM_COMMAND
(
OUTPUT AmoebaOpenMMCWrapper.h COMMAND
${
JAVA_RUNTIME
}
-jar
${
SAXON_JAR
}
-t -s:AmoebaOpenMMApi
.xml
-xsl:
${
CMAKE_SOURCE_DIR
}
/plugins/amoeba/wrappers/CWrapper_Header.xslt -o:AmoebaOpenMMCWrapper.h DEPENDS AmoebaOpenMMApi.xml
)
#
ADD_CUSTOM_COMMAND
(
OUTPUT AmoebaOpenMMCWrapper.cpp COMMAND
${
JAVA_RUNTIME
}
-jar
${
SAXON_JAR
}
-t -s:AmoebaOpenMMApi.xml
-xsl:
${
CMAKE_SOURCE_DIR
}
/plugins/amoeba/wrappers/CWrapper_Source.xslt -o:AmoebaOpenMMCWrapper.cpp DEPENDS AmoebaOpenMMApi.xml
)
ADD_CUSTOM_COMMAND
(
OUTPUT AmoebaOpenMMFortranModule.f90 COMMAND
${
JAVA_RUNTIME
}
-jar
${
SAXON_JAR
}
-t -s:AmoebaOpenMMApi.xml
-xsl:
${
CMAKE_SOURCE_DIR
}
/plugins/amoeba/wrappers/FortranWrapper_Header.xslt -o:AmoebaOpenMMFortranModule.f90 DEPENDS AmoebaOpenMMApi.xml
${
CMAKE_SOURCE_DIR
}
/plugins/amoeba/wrappers/FortranWrapper_Header.xslt
)
ADD_CUSTOM_COMMAND
(
OUTPUT AmoebaOpenMMFortranWrapper.cpp COMMAND
${
JAVA_RUNTIME
}
-jar
${
SAXON_JAR
}
-t -s:AmoebaOpenMMApi.xml
-xsl:
${
CMAKE_SOURCE_DIR
}
/plugins/amoeba/wrappers/FortranWrapper_Source.xslt -o:AmoebaOpenMMFortranWrapper.cpp DEPENDS AmoebaOpenMMApi.xml
)
ADD_CUSTOM_TARGET
(
AmoebaApiWrappers DEPENDS AmoebaOpenMMCWrapper.h AmoebaOpenMMCWrapper.cpp
AmoebaOpenMMFortranModule.f90 AmoebaOpenMMFortranWrapper.cpp
)
INSTALL_FILES
(
/include FILES AmoebaOpenMMCWrapper.h AmoebaOpenMMFortranModule.f90
)
#
WRAPPER_DOXYGEN_DIR is a workspace directory where wrapper files will be created
set
(
WRAPPER_DOXYGEN_DIR
"
${
CMAKE_CURRENT_BINARY_DIR
}
/doxygen"
)
file
(
MAKE_DIRECTORY
"
${
WRAPPER_DOXYGEN
_DIR
}
"
)
#
Step 1 - Create Doxyfile to point to OpenMM headers
configure_file
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/Doxyfile.in
${
WRAPPER_DOXYGEN_DIR
}
/Doxyfile
@ONLY
)
# Step 2 - Run doxygen to analyze the headers
add_custom_command
(
OUTPUT
"
${
WRAPPER_DOXYGEN_DIR
}
/xml/index
.xml
"
COMMAND
"
${
DOXYGEN_EXECUTABLE
}
"
DEPENDS
"
${
WRAPPER_DOXYGEN_DIR
}
/Doxyfile"
WORKING_DIRECTORY
"
${
WRAPPER_DOXYGEN_DIR
}
"
COMMENT
"Parsing OpenMM header files with Doxygen..."
)
# Step 3 - Generate the wrappers
ADD_CUSTOM_COMMAND
(
OUTPUT AmoebaOpenMMCWrapper.h AmoebaOpenMMCWrapper.cpp AmoebaOpenMMFortranModule.f90 AmoebaOpenMMFortranWrapper.cpp
COMMAND
${
PYTHON_EXECUTABLE
}
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/generateAmoebaWrappers.py"
"
${
WRAPPER_DOXYGEN_DIR
}
/xml"
"
${
CMAKE_CURRENT_BINARY_DIR
}
"
DEPENDS
"
${
WRAPPER_DOXYGEN_DIR
}
/xml/index.xml"
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/generateAmoebaWrappers.py"
)
ADD_CUSTOM_TARGET
(
AmoebaApiWrappers DEPENDS AmoebaOpenMMCWrapper.h AmoebaOpenMMCWrapper.cpp AmoebaOpenMMFortranModule.f90 AmoebaOpenMMFortranWrapper.cpp
)
INSTALL_FILES
(
/include FILES AmoebaOpenMMCWrapper.h AmoebaOpenMMFortranModule.f90
)
plugins/amoeba/wrappers/Doxyfile.in
0 → 100644
View file @
3848adc6
This diff is collapsed.
Click to expand it.
plugins/amoeba/wrappers/generateAmoebaWrappers.py
0 → 100644
View file @
3848adc6
This diff is collapsed.
Click to expand it.
wrappers/generateWrappers.py
View file @
3848adc6
...
...
@@ -801,6 +801,8 @@ class FortranHeaderGenerator(WrapperGenerator):
self
.
typeTranslations
=
{
'int'
:
'integer*4'
,
'bool'
:
'integer*4'
,
'double'
:
'real*8'
,
'char *'
:
'character(*)'
,
'const char *'
:
'character(*)'
,
'std::string'
:
'character(*)'
,
'const std::string &'
:
'character(*)'
,
'std::vector< std::string >'
:
'type (OpenMM_StringArray)'
,
...
...
@@ -811,13 +813,14 @@ class FortranHeaderGenerator(WrapperGenerator):
'std::vector< double >'
:
'type (OpenMM_DoubleArray)'
,
'std::vector< int >'
:
'type (OpenMM_IntArray)'
,
'std::set< int >'
:
'type (OpenMM_IntSet)'
}
self
.
enumerationTypes
=
set
()
def
writeGlobalConstants
(
self
):
self
.
out
.
write
(
" ! Global Constants
\n\n
"
)
node
=
next
((
x
for
x
in
findNodes
(
self
.
doc
.
getroot
(),
"compounddef"
,
kind
=
"namespace"
)
if
x
.
findtext
(
"compoundname"
)
==
"OpenMM"
))
for
section
in
findNodes
(
node
,
"sectiondef"
,
kind
=
"var"
):
for
memberNode
in
findNodes
(
section
,
"memberdef"
,
kind
=
"variable"
,
mutable
=
"no"
,
prot
=
"public"
,
static
=
"yes"
):
vDef
=
convertOpenMMPrefix
(
getText
(
"
definition
"
,
memberNode
))
vDef
=
convertOpenMMPrefix
(
getText
(
"
name
"
,
memberNode
))
iDef
=
getText
(
"initializer"
,
memberNode
)
if
iDef
.
startswith
(
"="
):
iDef
=
iDef
[
1
:]
...
...
@@ -829,7 +832,7 @@ class FortranHeaderGenerator(WrapperGenerator):
className
=
getText
(
"compoundname"
,
classNode
)
shortName
=
stripOpenMMPrefix
(
className
)
typeName
=
convertOpenMMPrefix
(
className
)
self
.
out
.
write
(
"
\n
type
OpenMM_
%s
\n
"
%
typeName
)
self
.
out
.
write
(
"
\n
type %s
\n
"
%
typeName
)
self
.
out
.
write
(
" integer*8 :: handle = 0
\n
"
)
self
.
out
.
write
(
" end type
\n
"
)
self
.
typesByShortName
[
shortName
]
=
typeName
...
...
@@ -858,6 +861,7 @@ class FortranHeaderGenerator(WrapperGenerator):
enumName
=
getText
(
"name"
,
enumNode
)
enumTypeName
=
"%s_%s"
%
(
typeName
,
enumName
)
self
.
typesByShortName
[
enumName
]
=
enumTypeName
self
.
enumerationTypes
.
add
(
enumName
)
if
len
(
enumNodes
)
>
0
:
self
.
out
.
write
(
"
\n
"
)
def
writeMethods
(
self
,
classNode
):
...
...
@@ -882,8 +886,8 @@ class FortranHeaderGenerator(WrapperGenerator):
suffix
=
""
else
:
suffix
=
"_%d"
%
numConstructors
self
.
out
.
write
(
" subroutine %s_create%s(result
,
"
%
(
typeName
,
suffix
))
self
.
writeArguments
(
methodNode
,
Fals
e
)
self
.
out
.
write
(
" subroutine %s_create%s(result"
%
(
typeName
,
suffix
))
self
.
writeArguments
(
methodNode
,
Tru
e
)
self
.
out
.
write
(
")
\n
"
)
self
.
out
.
write
(
" use OpenMM_Types; implicit none
\n
"
)
self
.
out
.
write
(
" type (%s) result
\n
"
%
typeName
)
...
...
@@ -960,7 +964,7 @@ class FortranHeaderGenerator(WrapperGenerator):
continue
name
=
getText
(
'declname'
,
node
)
self
.
out
.
write
(
"%s%s"
%
(
separator
,
name
))
separator
=
", &
\n
"
separator
=
", &
\n
"
numArgs
+=
1
return
numArgs
...
...
@@ -986,6 +990,8 @@ class FortranHeaderGenerator(WrapperGenerator):
def
getType
(
self
,
type
):
if
type
in
self
.
typeTranslations
:
return
self
.
typeTranslations
[
type
]
if
type
in
self
.
enumerationTypes
:
return
'integer*4'
if
type
in
self
.
typesByShortName
:
return
'type (%s)'
%
self
.
typesByShortName
[
type
]
if
type
.
startswith
(
'const '
):
...
...
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