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
"platforms/vscode:/vscode.git/clone" did not exist on "e9c5ab17df46e87443f8046d8ce7c083c0be2773"
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
Show 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:
...
@@ -80,6 +80,12 @@ public:
return
Vec3
(
lhs
[
0
]
+
rhs
[
0
],
lhs
[
1
]
+
rhs
[
1
],
lhs
[
2
]
+
rhs
[
2
]);
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
// unary minus
Vec3
operator
-
()
const
{
Vec3
operator
-
()
const
{
const
Vec3
&
lhs
=
*
this
;
const
Vec3
&
lhs
=
*
this
;
...
@@ -92,18 +98,35 @@ public:
...
@@ -92,18 +98,35 @@ public:
return
Vec3
(
lhs
[
0
]
-
rhs
[
0
],
lhs
[
1
]
-
rhs
[
1
],
lhs
[
2
]
-
rhs
[
2
]);
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
// scalar product
Vec3
operator
*
(
double
rhs
)
const
{
Vec3
operator
*
(
double
rhs
)
const
{
const
Vec3
&
lhs
=
*
this
;
const
Vec3
&
lhs
=
*
this
;
return
Vec3
(
lhs
[
0
]
*
rhs
,
lhs
[
1
]
*
rhs
,
lhs
[
2
]
*
rhs
);
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
// dot product
double
dot
(
const
Vec3
&
rhs
)
const
{
double
dot
(
const
Vec3
&
rhs
)
const
{
const
Vec3
&
lhs
=
*
this
;
const
Vec3
&
lhs
=
*
this
;
return
lhs
[
0
]
*
rhs
[
0
]
+
lhs
[
1
]
*
rhs
[
1
]
+
lhs
[
2
]
*
rhs
[
2
];
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:
private:
double
data
[
3
];
double
data
[
3
];
};
};
...
...
openmmapi/include/openmm/internal/ContextImpl.h
View file @
95aa79b7
...
@@ -175,6 +175,10 @@ public:
...
@@ -175,6 +175,10 @@ public:
* ForceImpl in the system, allowing them to modify the values of state variables.
* ForceImpl in the system, allowing them to modify the values of state variables.
*/
*/
void
updateContextState
();
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.
* Get the platform-specific data stored in this context.
*/
*/
...
...
openmmapi/include/openmm/internal/CustomBondForceImpl.h
View file @
95aa79b7
...
@@ -60,7 +60,7 @@ public:
...
@@ -60,7 +60,7 @@ public:
double
calcEnergy
(
ContextImpl
&
context
);
double
calcEnergy
(
ContextImpl
&
context
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
();
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
();
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
;
private:
private:
CustomBondForce
&
owner
;
CustomBondForce
&
owner
;
Kernel
kernel
;
Kernel
kernel
;
...
...
openmmapi/include/openmm/internal/ForceImpl.h
View file @
95aa79b7
...
@@ -105,7 +105,7 @@ public:
...
@@ -105,7 +105,7 @@ public:
* Get pairs of particles connected by bonds by this force. This is used to determine which particles
* Get pairs of particles connected by bonds by this force. This is used to determine which particles
* are part of the same molecule.
* 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
);
return
std
::
vector
<
std
::
pair
<
int
,
int
>
>
(
0
);
}
}
};
};
...
...
openmmapi/include/openmm/internal/HarmonicBondForceImpl.h
View file @
95aa79b7
...
@@ -62,7 +62,7 @@ public:
...
@@ -62,7 +62,7 @@ public:
return
std
::
map
<
std
::
string
,
double
>
();
// This force field doesn't define any parameters.
return
std
::
map
<
std
::
string
,
double
>
();
// This force field doesn't define any parameters.
}
}
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
();
std
::
vector
<
std
::
pair
<
int
,
int
>
>
getBondedParticles
()
const
;
private:
private:
HarmonicBondForce
&
owner
;
HarmonicBondForce
&
owner
;
Kernel
kernel
;
Kernel
kernel
;
...
...
openmmapi/src/ContextImpl.cpp
View file @
95aa79b7
...
@@ -169,6 +169,10 @@ void ContextImpl::updateContextState() {
...
@@ -169,6 +169,10 @@ void ContextImpl::updateContextState() {
forceImpls
[
i
]
->
updateContextState
(
*
this
);
forceImpls
[
i
]
->
updateContextState
(
*
this
);
}
}
const
vector
<
ForceImpl
*>&
ContextImpl
::
getForceImpls
()
const
{
return
forceImpls
;
}
void
*
ContextImpl
::
getPlatformData
()
{
void
*
ContextImpl
::
getPlatformData
()
{
return
platformData
;
return
platformData
;
}
}
...
...
openmmapi/src/CustomBondForceImpl.cpp
View file @
95aa79b7
...
@@ -103,7 +103,7 @@ map<string, double> CustomBondForceImpl::getDefaultParameters() {
...
@@ -103,7 +103,7 @@ map<string, double> CustomBondForceImpl::getDefaultParameters() {
return
parameters
;
return
parameters
;
}
}
vector
<
pair
<
int
,
int
>
>
CustomBondForceImpl
::
getBondedParticles
()
{
vector
<
pair
<
int
,
int
>
>
CustomBondForceImpl
::
getBondedParticles
()
const
{
int
numBonds
=
owner
.
getNumBonds
();
int
numBonds
=
owner
.
getNumBonds
();
vector
<
pair
<
int
,
int
>
>
bonds
(
numBonds
);
vector
<
pair
<
int
,
int
>
>
bonds
(
numBonds
);
for
(
int
i
=
0
;
i
<
numBonds
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numBonds
;
i
++
)
{
...
...
openmmapi/src/HarmonicBondForceImpl.cpp
View file @
95aa79b7
...
@@ -63,7 +63,7 @@ std::vector<std::string> HarmonicBondForceImpl::getKernelNames() {
...
@@ -63,7 +63,7 @@ std::vector<std::string> HarmonicBondForceImpl::getKernelNames() {
return
names
;
return
names
;
}
}
vector
<
pair
<
int
,
int
>
>
HarmonicBondForceImpl
::
getBondedParticles
()
{
vector
<
pair
<
int
,
int
>
>
HarmonicBondForceImpl
::
getBondedParticles
()
const
{
int
numBonds
=
owner
.
getNumBonds
();
int
numBonds
=
owner
.
getNumBonds
();
vector
<
pair
<
int
,
int
>
>
bonds
(
numBonds
);
vector
<
pair
<
int
,
int
>
>
bonds
(
numBonds
);
for
(
int
i
=
0
;
i
<
numBonds
;
i
++
)
{
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