Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions source/lmp/pair_deepmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ void PairDeepMD::make_fparam_from_compute(vector<double> &fparam) {
int icompute = modify->find_compute(compute_fparam_id);
Compute *compute = modify->compute[icompute];

assert(compute);
if (!compute) {
error->all(FLERR, "compute id is not found: " + compute_fparam_id);
}
fparam.resize(dim_fparam);

if (dim_fparam == 1) {
Expand All @@ -246,7 +248,9 @@ void PairDeepMD::make_aparam_from_compute(vector<double> &aparam) {
int icompute = modify->find_compute(compute_aparam_id);
Compute *compute = modify->compute[icompute];

assert(compute);
if (!compute) {
error->all(FLERR, "compute id is not found: " + compute_aparam_id);
}
int nlocal = atom->nlocal;
aparam.resize(static_cast<size_t>(dim_aparam) * nlocal);

Expand Down Expand Up @@ -277,7 +281,9 @@ void PairDeepMD::make_ttm_fparam(vector<double> &fparam) {
ttm_fix = dynamic_cast<FixTTMDP *>(modify->fix[ii]);
}
}
assert(ttm_fix);
if (!ttm_fix) {
error->all(FLERR, "fix ttm id is not found: " + ttm_fix_id);
}

fparam.resize(dim_fparam);

Expand Down Expand Up @@ -316,7 +322,9 @@ void PairDeepMD::make_ttm_aparam(vector<double> &daparam) {
ttm_fix = dynamic_cast<FixTTMDP *>(modify->fix[ii]);
}
}
assert(ttm_fix);
if (!ttm_fix) {
error->all(FLERR, "fix ttm id is not found: " + ttm_fix_id);
}
// modify
double **x = atom->x;
int *mask = atom->mask;
Expand Down