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
f62ba9d8
Commit
f62ba9d8
authored
Jun 12, 2009
by
Michael Sherman
Browse files
Minor tweaks and comments.
parent
f337005b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
92 deletions
+91
-92
examples/HelloArgon.cpp
examples/HelloArgon.cpp
+79
-79
examples/HelloSodiumChloride.cpp
examples/HelloSodiumChloride.cpp
+3
-3
examples/HelloSodiumChlorideInC.c
examples/HelloSodiumChlorideInC.c
+7
-8
examples/wrappers/OpenMM_CWrapper.cpp
examples/wrappers/OpenMM_CWrapper.cpp
+1
-1
examples/wrappers/OpenMM_CWrapper.h
examples/wrappers/OpenMM_CWrapper.h
+1
-1
No files found.
examples/HelloArgon.cpp
View file @
f62ba9d8
examples/HelloSodiumChloride.cpp
View file @
f62ba9d8
...
...
@@ -187,9 +187,9 @@ struct MyOpenMMData {
// INITIALIZE OpenMM DATA STRUCTURES
// -----------------------------------------------------------------------------
// We take these actions here:
// (1) Allocate a MyOpenMMData structure to hang on to OpenMM data structures
// (1) Load any available OpenMM plugins, e.g. Cuda and Brook.
// (2) Allocate a MyOpenMMData structure to hang on to OpenMM data structures
// in a manner which is opaque to the caller.
// (2) Allocate the OpenMM objects which persist from call to call.
// (3) Fill the OpenMM::System with the force field parameters we want to
// use and the particular set of atoms to be simulated.
// (4) Create an Integrator and a Context associating the Integrator with
...
...
@@ -232,7 +232,7 @@ myInitializeOpenMM( const MyAtomInfo atoms[],
// (1) System needs to know the masses.
// (2) NonbondedForce needs charges,van der Waals properties (in MD units!).
// (3) GBSA needs charge, radius, and scale factor.
// (
3
) Collect default positions for initializing the simulation later.
// (
4
) Collect default positions for initializing the simulation later.
std
::
vector
<
Vec3
>
initialPosInNm
;
for
(
int
n
=
0
;
*
atoms
[
n
].
pdb
;
++
n
)
{
const
MyAtomInfo
&
atom
=
atoms
[
n
];
...
...
examples/HelloSodiumChlorideInC.c
View file @
f62ba9d8
...
...
@@ -184,7 +184,7 @@ struct MyOpenMMData_s {
*
* Note that this function must understand the calling MD code's molecule and
* force field data structures so will need to be customized for each MD code.
*/
*/
static
MyOpenMMData
*
myInitializeOpenMM
(
const
MyAtomInfo
atoms
[],
double
temperature
,
...
...
@@ -274,7 +274,7 @@ myGetOpenMMState(MyOpenMMData* omm, int wantEnergy,
MyAtomInfo
atoms
[])
{
OpenMM_State
*
state
;
const
OpenMM_Vec3Array
*
posArray
;
const
OpenMM_Vec3Array
*
posArray
InNm
;
int
infoMask
;
int
n
;
...
...
@@ -291,12 +291,11 @@ myGetOpenMMState(MyOpenMMData* omm, int wantEnergy,
/* Positions are maintained as a Vec3Array inside the State. This will give
* us access, but don't destroy it yourself -- it will go away with the State. */
posArray
=
OpenMM_State_getPositions
(
state
);
for
(
n
=
0
;
*
atoms
[
n
].
pdb
;
++
n
)
{
double
posInNm
[
3
];
OpenMM_Vec3Array_get
(
posArray
,
n
,
posInNm
);
OpenMM_Vec3_scale
(
posInNm
,
OpenMM_AngstromsPerNm
,
atoms
[
n
].
posInAng
);
}
posArrayInNm
=
OpenMM_State_getPositions
(
state
);
for
(
n
=
0
;
*
atoms
[
n
].
pdb
;
++
n
)
/* Sets atoms[n].pos = posArray[n] * Angstroms/nm. */
OpenMM_Vec3Array_getScaled
(
posArrayInNm
,
n
,
OpenMM_AngstromsPerNm
,
atoms
[
n
].
posInAng
);
/* If energy has been requested, obtain it and convert from kJ to kcal. */
*
energyInKcal
=
0
;
...
...
examples/wrappers/OpenMM_CWrapper.cpp
View file @
f62ba9d8
...
...
@@ -299,7 +299,7 @@ void OpenMM_GBSAOBCForce_destroy(OpenMM_GBSAOBCForce* doomed)
void
openmm_gbsaobcforce_destroy_
(
OpenMM_GBSAOBCForce
*&
doomed
)
{
OpenMM_GBSAOBCForce_destroy
(
doomed
);
doomed
=
0
;}
// Fortran only: recast
Nonbonded
Force as a Force.
// Fortran only: recast
GBSAOBC
Force as a Force.
void
openmm_gbsaobcforce_asforce_
(
OpenMM_GBSAOBCForce
*
const
&
gbsa
,
OpenMM_Force
*&
force
)
{
force
=
(
OpenMM_Force
*
)
gbsa
;
}
...
...
examples/wrappers/OpenMM_CWrapper.h
View file @
f62ba9d8
...
...
@@ -129,7 +129,7 @@ extern void OpenMM_Vec3Array_get(const OpenMM_Vec3Array*, int i,
extern
void
OpenMM_Vec3Array_getScaled
(
const
OpenMM_Vec3Array
*
,
int
i
,
double
s
,
double
[
3
]);
extern
void
OpenMM_Vec3Array_set
(
OpenMM_Vec3Array
*
,
int
i
,
const
double
[
3
]);
extern
void
OpenMM_Vec3Array_setScaled
(
OpenMM_Vec3Array
*
,
int
i
,
const
double
[
3
],
double
s
);
extern
void
OpenMM_Vec3_scale
(
const
double
[
3
],
double
s
,
double
[
3
]);
extern
void
OpenMM_Vec3_scale
(
const
double
in
[
3
],
double
s
,
double
out
[
3
]);
/* OpenMM_String */
extern
OpenMM_String
*
OpenMM_String_create
(
const
char
*
init
);
...
...
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