Skip to content

Commit

Permalink
NBlibTest/IntegratorWorks: Initialize x's and v's
Browse files Browse the repository at this point in the history
The coordinates and velocities of the test atom were left uninitialized.
This, on my machine, occasionally caused NbLibIntegratorTests to
timeout, getting stuck indefinitely inside `put_atoms_in_box` function.
  • Loading branch information
al42and committed Oct 8, 2020
1 parent ee13612 commit c76568d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions api/nblib/tests/integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,9 @@ TEST(NBlibTest, IntegratorWorks)
topologyBuilder.addParticleTypesInteractions(interactions);
Topology topology = topologyBuilder.buildTopology();

std::vector<Vec3> x(numAtoms);
std::vector<Vec3> v(numAtoms);
std::vector<Vec3> f(numAtoms);

f[0][XX] = 1.0;
f[0][YY] = 2.0;
f[0][ZZ] = 0.0;
std::vector<Vec3> x(numAtoms, { 0.0, 0.0, 0.0 });
std::vector<Vec3> v(numAtoms, { 0.0, 0.0, 0.0 });
std::vector<Vec3> f(numAtoms, { 1.0, 2.0, 0.0 });

Box box(100);

Expand Down

0 comments on commit c76568d

Please sign in to comment.