Skip to content

Commit

Permalink
Fixing uninitialized force table
Browse files Browse the repository at this point in the history
  • Loading branch information
llaniewski committed May 9, 2024
1 parent fcaf7e3 commit c0288e4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lammps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int main(int argc, char* argv[]) {
info.MPMD = &MPMD;
info.lmp = lmp;
info.RFI = &RFI;
info.atom_force = true;
info.atom_force = false;
info.first_print = true;
info.wsize.resize(RFI.Workers());
info.windex.resize(RFI.Workers());
Expand All @@ -180,17 +180,17 @@ void tclb_callback(void* ptr, bigint ntimestep, int nlocal, int* id, double** x_
double** omega = info->lmp->atom->omega;
double** f = NULL;
double** torque = NULL;
for (size_t k=0; k<nlocal; k++) {
f_[k][0] = 0;
f_[k][1] = 0;
f_[k][2] = 0;
}
if (info->atom_force) {
f = info->lmp->atom->f;
torque = info->lmp->atom->torque;
} else {
for (size_t k=0; k<nlocal; k++) {
f_[k][0] = 0;
f_[k][1] = 0;
f_[k][2] = 0;
}
f = f_;
}
torque = info->lmp->atom->torque;
double* r = info->lmp->atom->radius;

if (info->first_print) {
Expand Down

0 comments on commit c0288e4

Please sign in to comment.