Skip to content

Commit

Permalink
simplify compute creation
Browse files Browse the repository at this point in the history
  • Loading branch information
akohlmey committed Jul 6, 2020
1 parent 7597977 commit fe12ea2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/SNAP/compute_snap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,16 @@ void ComputeSnap::init()

// find compute for reference energy

std::string id_pe = std::string("thermo_pe");
int ipe = modify->find_compute(id_pe);
int ipe = modify->find_compute("thermo_pe");
if (ipe == -1)
error->all(FLERR,"compute thermo_pe does not exist.");
c_pe = modify->compute[ipe];

// add compute for reference virial tensor

std::string id_virial = std::string("snap_press");
std::string pcmd = id_virial + " all pressure NULL virial";
modify->add_compute(pcmd);
modify->add_compute("snap_press all pressure NULL virial");

int ivirial = modify->find_compute(id_virial);
int ivirial = modify->find_compute("snap_press");
if (ivirial == -1)
error->all(FLERR,"compute snap_press does not exist.");
c_virial = modify->compute[ivirial];
Expand Down

0 comments on commit fe12ea2

Please sign in to comment.