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
0fcada26
Commit
0fcada26
authored
Jun 27, 2009
by
Michael Sherman
Browse files
Now works with Intel Fortran if you know the right incantations for linking.
parent
b002cf1f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
314 additions
and
86 deletions
+314
-86
examples/HelloArgonInFortran.f90
examples/HelloArgonInFortran.f90
+2
-2
examples/HelloSodiumChlorideInFortran.f90
examples/HelloSodiumChlorideInFortran.f90
+2
-2
examples/HelloWaterBox.cpp
examples/HelloWaterBox.cpp
+1
-1
examples/OpenMM_CWrapper.cpp
examples/OpenMM_CWrapper.cpp
+289
-76
examples/OpenMM_CWrapper.h
examples/OpenMM_CWrapper.h
+18
-3
examples/OpenMM_Module.f90
examples/OpenMM_Module.f90
+2
-2
No files found.
examples/HelloArgonInFortran.f90
View file @
0fcada26
...
...
@@ -21,7 +21,7 @@ PROGRAM HelloArgon
type
(
OpenMM_State
)
state
type
(
OpenMM_String
)
dirName
real
*
8
timeInPs
integer
a
,
frameNum
integer
*
4
a
,
ix
,
frameNum
character
*
10
platformName
! Load any shared libraries containing GPU implementations.
...
...
@@ -46,7 +46,7 @@ PROGRAM HelloArgon
call
OpenMM_System_addParticle
(
system
,
39.95d0
)
!mass of Ar, grams/mole
! charge, L-J sigma (nm), well depth (kJ) (vdWRad(Ar)=.188 nm)
call
OpenMM_NonbondedForce_addParticle
(
nonbond
,
0d0
,
0.3350d0
,
0.996d0
)
ix
=
OpenMM_NonbondedForce_addParticle
(
nonbond
,
0d0
,
0.3350d0
,
0.996d0
)
end
do
! Create particular integrator, and recast to generic one.
...
...
examples/HelloSodiumChlorideInFortran.f90
View file @
0fcada26
...
...
@@ -183,7 +183,7 @@ SUBROUTINE myInitializeOpenMM(ommHandle, platformName)
type
(
OpenMM_Vec3Array
)
initialPosInNm
type
(
OpenMM_NonbondedForce
)
nonbond
type
(
OpenMM_GBSAOBCForce
)
gbsa
integer
n
integer
*
4
n
,
ix
type
(
OpenMM_String
)
dir
...
...
@@ -218,7 +218,7 @@ SUBROUTINE myInitializeOpenMM(ommHandle, platformName)
do
n
=
1
,
NumAtoms
call
OpenMM_System_addParticle
(
system
,
atoms
(
n
)
%
mass
)
call
OpenMM_NonbondedForce_addParticle
(
nonbond
,
&
ix
=
OpenMM_NonbondedForce_addParticle
(
nonbond
,
&
atoms
(
n
)
%
charge
,
&
atoms
(
n
)
%
vdwRadiusInAng
*
OpenMM_NmPerAngstrom
&
*
OpenMM_SigmaPerVdwRadius
,
&
...
...
examples/HelloWaterBox.cpp
View file @
0fcada26
...
...
@@ -269,7 +269,7 @@ myInitializeOpenMM( int numWatersAlongEdge,
std
::
vector
<
Vec3
>
initialPosInNm
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>
bondPairs
;
// Add water molecules one at a time in the
10x10x10
cubic lattice
// Add water molecules one at a time in the
NxNxN
cubic lattice
for
(
int
latticeX
=
0
;
latticeX
<
numWatersAlongEdge
;
++
latticeX
)
for
(
int
latticeY
=
0
;
latticeY
<
numWatersAlongEdge
;
++
latticeY
)
for
(
int
latticeZ
=
0
;
latticeZ
<
numWatersAlongEdge
;
++
latticeZ
)
...
...
examples/OpenMM_CWrapper.cpp
View file @
0fcada26
This diff is collapsed.
Click to expand it.
examples/OpenMM_CWrapper.h
View file @
0fcada26
...
...
@@ -167,10 +167,25 @@ extern const char* OpenMM_Platform_getDefaultPluginsDirectory();
/* OpenMM::System */
extern
OpenMM_System
*
OpenMM_System_create
();
extern
void
OpenMM_System_destroy
(
OpenMM_System
*
);
extern
void
OpenMM_System_addForce
(
OpenMM_System
*
,
OpenMM_Force
*
);
extern
void
OpenMM_System_addParticle
(
OpenMM_System
*
,
double
mass
);
extern
void
OpenMM_System_destroy
(
OpenMM_System
*
);
extern
int
OpenMM_System_addParticle
(
OpenMM_System
*
,
double
mass
);
extern
void
OpenMM_System_setParticleMass
(
OpenMM_System
*
,
int
ix
,
double
mass
);
extern
double
OpenMM_System_getParticleMass
(
const
OpenMM_System
*
,
int
ix
);
extern
int
OpenMM_System_addConstraint
(
OpenMM_System
*
,
int
p1
,
int
p2
,
double
distance
);
extern
void
OpenMM_System_setConstraintParameters
(
OpenMM_System
*
,
int
ix
,
int
p1
,
int
p2
,
double
distance
);
extern
void
OpenMM_System_getConstraintParameters
(
const
OpenMM_System
*
,
int
ix
,
int
*
p1
,
int
*
p2
,
double
*
distance
);
extern
int
OpenMM_System_addForce
(
OpenMM_System
*
,
OpenMM_Force
*
);
extern
OpenMM_Force
*
OpenMM_System_updForce
(
OpenMM_System
*
,
int
ix
);
extern
const
OpenMM_Force
*
OpenMM_System_getForce
(
const
OpenMM_System
*
,
int
ix
);
extern
int
OpenMM_System_getNumParticles
(
const
OpenMM_System
*
);
extern
int
OpenMM_System_getNumConstraints
(
const
OpenMM_System
*
);
extern
int
OpenMM_System_getNumForces
(
const
OpenMM_System
*
);
/* OpenMM::NonbondedForce */
extern
OpenMM_NonbondedForce
*
OpenMM_NonbondedForce_create
();
...
...
examples/OpenMM_Module.f90
View file @
0fcada26
...
...
@@ -25,7 +25,7 @@
! pointers to deal with these objects; they get created by the API
! for you and you just pass them back to the API when you want to
! do something with them.
module
OpenMM_Types
MODULE
OpenMM_Types
implicit
none
! The System, Integrator, and Context must persist between calls.
...
...
@@ -732,4 +732,4 @@ module OpenMM
end
end
interface
end
module
OpenMM
END
MODULE
OpenMM
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