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
cd93e5e0
"...OpenDAS/text-generation-inference.git" did not exist on "c5de7cd88679bc0331185c9cee75e4f68412243d"
Commit
cd93e5e0
authored
Jun 29, 2011
by
Peter Eastman
Browse files
Give a proper error message if the user tries to create a context with no particles
parent
4a1e9683
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
openmmapi/src/ContextImpl.cpp
openmmapi/src/ContextImpl.cpp
+2
-0
platforms/reference/tests/TestReferenceMonteCarloBarostat.cpp
...forms/reference/tests/TestReferenceMonteCarloBarostat.cpp
+1
-0
No files found.
openmmapi/src/ContextImpl.cpp
View file @
cd93e5e0
...
@@ -49,6 +49,8 @@ using std::string;
...
@@ -49,6 +49,8 @@ using std::string;
ContextImpl
::
ContextImpl
(
Context
&
owner
,
System
&
system
,
Integrator
&
integrator
,
Platform
*
platform
,
const
map
<
string
,
string
>&
properties
)
:
ContextImpl
::
ContextImpl
(
Context
&
owner
,
System
&
system
,
Integrator
&
integrator
,
Platform
*
platform
,
const
map
<
string
,
string
>&
properties
)
:
owner
(
owner
),
system
(
system
),
integrator
(
integrator
),
hasInitializedForces
(
false
),
platform
(
platform
),
platformData
(
NULL
)
{
owner
(
owner
),
system
(
system
),
integrator
(
integrator
),
hasInitializedForces
(
false
),
platform
(
platform
),
platformData
(
NULL
)
{
if
(
system
.
getNumParticles
()
==
0
)
throw
OpenMMException
(
"Cannot create a Context for a System with no particles"
);
vector
<
string
>
kernelNames
;
vector
<
string
>
kernelNames
;
kernelNames
.
push_back
(
CalcKineticEnergyKernel
::
Name
());
kernelNames
.
push_back
(
CalcKineticEnergyKernel
::
Name
());
kernelNames
.
push_back
(
CalcForcesAndEnergyKernel
::
Name
());
kernelNames
.
push_back
(
CalcForcesAndEnergyKernel
::
Name
());
...
...
platforms/reference/tests/TestReferenceMonteCarloBarostat.cpp
View file @
cd93e5e0
...
@@ -53,6 +53,7 @@ void testChangingBoxSize() {
...
@@ -53,6 +53,7 @@ void testChangingBoxSize() {
ReferencePlatform
platform
;
ReferencePlatform
platform
;
System
system
;
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
4
,
0
,
0
),
Vec3
(
0
,
5
,
0
),
Vec3
(
0
,
0
,
6
));
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
4
,
0
,
0
),
Vec3
(
0
,
5
,
0
),
Vec3
(
0
,
0
,
6
));
system
.
addParticle
(
1.0
);
LangevinIntegrator
integrator
(
300.0
,
1.0
,
0.01
);
LangevinIntegrator
integrator
(
300.0
,
1.0
,
0.01
);
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
Vec3
x
,
y
,
z
;
Vec3
x
,
y
,
z
;
...
...
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