simplify compute creation

This commit is contained in:
Axel Kohlmeyer 2020-07-05 22:46:48 -04:00 committed by GitHub
parent 759797733d
commit fe12ea2734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -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];