Skip to content

Commit 6372178

Browse files
authored
Merge pull request lammps#4538 from bathmatt/mliap-coefs-bug
Fixed invalid ref of coeffs in pair style mliap/kk
2 parents 0c71daa + ef875b5 commit 6372178

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/KOKKOS/mliap_model_kokkos.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ template <class DeviceType> class MLIAPModelKokkos : protected Pointers {
3535

3636
void set_k_coeffelem()
3737
{
38+
if ( model->coeffelem == nullptr )
39+
return;
3840
double **tmp = nullptr;
3941
memoryKK->create_kokkos(k_coeffelem, tmp, model->nelements, model->nparams,
4042
"MLIAPModelKokkos::coeffelem");

src/KOKKOS/mliap_model_python_kokkos.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ MLIAPModelPythonKokkos<DeviceType>::MLIAPModelPythonKokkos(LAMMPS *lmp, char *co
7676
PyList_Append(py_path, PyUnicode_FromString(potentials_path));
7777
}
7878
PyGILState_Release(gstate);
79-
if (coefffilename) read_coeffs(coefffilename);
79+
if (coefffilename) {
80+
read_coeffs(coefffilename);
81+
MLIAPModelKokkos<DeviceType>::set_k_coeffelem();
82+
}
8083

81-
if (coefffilename) MLIAPModelKokkos<DeviceType>::set_k_coeffelem();
8284

8385
nonlinearflag = 1;
8486
}

0 commit comments

Comments
 (0)