Merge pull request #4538 from bathmatt/mliap-coefs-bug

Fixed invalid ref of coeffs in pair style mliap/kk
This commit is contained in:
Axel Kohlmeyer
2025-04-07 13:58:55 -04:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@ -35,6 +35,8 @@ template <class DeviceType> class MLIAPModelKokkos : protected Pointers {
void set_k_coeffelem()
{
if ( model->coeffelem == nullptr )
return;
double **tmp = nullptr;
memoryKK->create_kokkos(k_coeffelem, tmp, model->nelements, model->nparams,
"MLIAPModelKokkos::coeffelem");

View File

@ -76,9 +76,11 @@ MLIAPModelPythonKokkos<DeviceType>::MLIAPModelPythonKokkos(LAMMPS *lmp, char *co
PyList_Append(py_path, PyUnicode_FromString(potentials_path));
}
PyGILState_Release(gstate);
if (coefffilename) read_coeffs(coefffilename);
if (coefffilename) {
read_coeffs(coefffilename);
MLIAPModelKokkos<DeviceType>::set_k_coeffelem();
}
if (coefffilename) MLIAPModelKokkos<DeviceType>::set_k_coeffelem();
nonlinearflag = 1;
}