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
95aa79b7
Commit
95aa79b7
authored
May 26, 2010
by
Peter Eastman
Browse files
Minor API additions needed for the Normal Mode Langevin plugin
parent
00eec5ea
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
5 deletions
+36
-5
openmmapi/include/openmm/Vec3.h
openmmapi/include/openmm/Vec3.h
+23
-0
openmmapi/include/openmm/internal/ContextImpl.h
openmmapi/include/openmm/internal/ContextImpl.h
+4
-0
openmmapi/include/openmm/internal/CustomBondForceImpl.h
openmmapi/include/openmm/internal/CustomBondForceImpl.h
+1
-1
openmmapi/include/openmm/internal/ForceImpl.h
openmmapi/include/openmm/internal/ForceImpl.h
+1
-1
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
+1
-1
openmmapi/src/ContextImpl.cpp
openmmapi/src/ContextImpl.cpp
+4
-0
openmmapi/src/CustomBondForceImpl.cpp
openmmapi/src/CustomBondForceImpl.cpp
+1
-1
openmmapi/src/HarmonicBondForceImpl.cpp
openmmapi/src/HarmonicBondForceImpl.cpp
+1
-1
No files found.
openmmapi/include/openmm/Vec3.h
View file @
95aa79b7
...
...
@@ -80,6 +80,12 @@ public:
return
Vec3
(
lhs
[
0
]
+
rhs
[
0
],
lhs
[
1
]
+
rhs
[
1
],
lhs
[
2
]
+
rhs
[
2
]);
}
Vec3
operator
+=
(
const
Vec3
&
rhs
)
{
data
[
0
]
+=
rhs
[
0
];
data
[
1
]
+=
rhs
[
1
];
data
[
2
]
+=
rhs
[
2
];
}
// unary minus
Vec3
operator
-
()
const
{
const
Vec3
&
lhs
=
*
this
;
...
...
@@ -92,17 +98,34 @@ public:
return
Vec3
(
lhs
[
0
]
-
rhs
[
0
],
lhs
[
1
]
-
rhs
[
1
],
lhs
[
2
]
-
rhs
[
2
]);
}
Vec3
operator
-=
(
const
Vec3
&
rhs
)
{
data
[
0
]
-=
rhs
[
0
];
data
[
1
]
-=
rhs
[
1
];
data
[
2
]
-=
rhs
[
2
];
}
// scalar product
Vec3
operator
*
(
double
rhs
)
const
{
const
Vec3
&
lhs
=
*
this
;
return
Vec3
(
lhs
[
0
]
*
rhs
,
lhs
[
1
]
*
rhs
,
lhs
[
2
]
*
rhs
);
}
Vec3
operator
*=
(
double
rhs
)
{
data
[
0
]
*=
rhs
;
data
[
1
]
*=
rhs
;
data
[
2
]
*=
rhs
;
}
// dot product
double
dot
(
const
Vec3
&
rhs
)
const
{
const
Vec3
&
lhs
=
*
this
;
return
lhs
[
0
]
*
rhs
[
0
]
+
lhs
[
1
]
*
rhs
[
1
]
+
lhs
[
2
]
*
rhs
[
2
];
}
// cross product
Vec3
cross
(
const
Vec3
&
rhs
)
const
{
return
Vec3
(
data
[
1
]
*
rhs
[
2
]
-
data
[
2
]
*
rhs
[
1
],
data
[
2
]
*
rhs
[
0
]
-
data
[
0
]
*
rhs
[
2
],
data
[
0
]
*
rhs
[
1
]
-
data
[
1
]
*
rhs
[
0
]);
}
private:
double
data
[
3
];
...
...
openmmapi/include/openmm/internal/ContextImpl.h
View file @
95aa79b7
...
...
@@ -175,6 +175,10 @@ public:
* ForceImpl in the system, allowing them to modify the values of state variables.
*/
void
updateContextState
();
/**
* Get the list of ForceImpls belonging to this ContextImpl.
*/
const
std
::
vector
<
ForceImpl
*>&
getForceImpls
()
const
;
/**
* Get the platform-specific data stored in this context.
*/
...
...
openmmapi/include/openmm/internal/CustomBondForceImpl.h
View file @
95aa79b7
...
...
@@ -60,7 +60,7 @@ public:
double
calcEnergy
(
ContextImpl
&
context
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
();
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
;
private:
CustomBondForce
&
owner
;
Kernel
kernel
;
...
...
openmmapi/include/openmm/internal/ForceImpl.h
View file @
95aa79b7
...
...
@@ -105,7 +105,7 @@ public:
* Get pairs of particles connected by bonds by this force. This is used to determine which particles
* are part of the same molecule.
*/
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
{
virtual
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
{
return
std
::
vector
<
std
::
pair
<
int
,
int
>
>
(
0
);
}
};
...
...
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
View file @
95aa79b7
...
...
@@ -62,7 +62,7 @@ public:
return
std
::
map
<
std
::
string
,
double
>
();
// This force field doesn't define any parameters.
}
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
;
private:
HarmonicBondForce
&
owner
;
Kernel
kernel
;
...
...
openmmapi/src/ContextImpl.cpp
View file @
95aa79b7
...
...
@@ -169,6 +169,10 @@ void ContextImpl::updateContextState() {
forceImpls
[
i
]
->
updateContextState
(
*
this
);
}
const
vector
<
ForceImpl
*>&
ContextImpl
::
getForceImpls
()
const
{
return
forceImpls
;
}
void
*
ContextImpl
::
getPlatformData
()
{
return
platformData
;
}
...
...
openmmapi/src/CustomBondForceImpl.cpp
View file @
95aa79b7
...
...
@@ -103,7 +103,7 @@ map<string, double> CustomBondForceImpl::getDefaultParameters() {
return
parameters
;
}
vector
<
pair
<
int
,
int
>
>
CustomBondForceImpl
::
getBondedParticles
()
{
vector
<
pair
<
int
,
int
>
>
CustomBondForceImpl
::
getBondedParticles
()
const
{
int
numBonds
=
owner
.
getNumBonds
();
vector
<
pair
<
int
,
int
>
>
bonds
(
numBonds
);
for
(
int
i
=
0
;
i
<
numBonds
;
i
++
)
{
...
...
openmmapi/src/HarmonicBondForceImpl.cpp
View file @
95aa79b7
...
...
@@ -63,7 +63,7 @@ std::vector<std::string> HarmonicBondForceImpl::getKernelNames() {
return
names
;
}
vector
<
pair
<
int
,
int
>
>
HarmonicBondForceImpl
::
getBondedParticles
()
{
vector
<
pair
<
int
,
int
>
>
HarmonicBondForceImpl
::
getBondedParticles
()
const
{
int
numBonds
=
owner
.
getNumBonds
();
vector
<
pair
<
int
,
int
>
>
bonds
(
numBonds
);
for
(
int
i
=
0
;
i
<
numBonds
;
i
++
)
{
...
...
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